프로젝트

일반

사용자정보

개정판 3d43dd5c

ID3d43dd5c04a6e8c6fc76fd7ae9526ad4315c2764
상위 a882d9e5
하위 4568bd7f

함의성이(가) 약 4년 전에 추가함

issue #1465: format

Change-Id: Ica5f854876b7a29943b89bc0fea11b842ccbe171

차이점 보기:

DTI_PID/DTI_PID/ItemDataFormatDialog.py
19 19

  
20 20
    DATA_LIST = ['LINE_DATA_LIST', 'EQUIPMENT_DATA_LIST', 'VALVE_DATA_LIST', 'INSTRUMENT_DATA_LIST', 'NOTE_DATA_LIST']
21 21

  
22
    def __init__(self, parent, columnListAll, columnOrder):
22
    def __init__(self, parent, columnListAll, columnOrder, line_list=False):
23 23
        QDialog.__init__(self, parent)
24 24
        self.setWindowFlag(Qt.WindowMinMaxButtonsHint)
25 25

  
......
27 27
        self.ui = ItemDataFormat_UI.Ui_ItemDataFormatDialog()
28 28
        self.ui.setupUi(self)
29 29

  
30
        self.line_list = line_list
31

  
30 32
        self.columnListAll = columnListAll
31 33
        self.columnOrder = columnOrder
32 34

  
......
189 191
            self.ui.pushButtonLineColAdd.setDisabled(True)
190 192
            self.ui.pushButtonLineColDelete.setDisabled(True)
191 193
            self.ui.pushButtonLineColEdit.setDisabled(True)
194

  
195
            self.ui.pushButtonEqpColAdd.setDisabled(True)
192 196
            self.ui.pushButtonEqpColDelete.setDisabled(True)
197
            self.ui.pushButtonEqpColEdit.setDisabled(True)
198

  
199
            self.ui.pushButtonValveColAdd.setDisabled(True)
193 200
            self.ui.pushButtonValveColDelete.setDisabled(True)
201
            self.ui.pushButtonValveColEdit.setDisabled(True)
202

  
203
            self.ui.pushButtonInstColAdd.setDisabled(True)
194 204
            self.ui.pushButtonInstColDelete.setDisabled(True)
205
            self.ui.pushButtonInstColEdit.setDisabled(True)
206
            
195 207
            self.ui.pushButtonNoteColAdd.setDisabled(True)
196 208
            self.ui.pushButtonNoteColDelete.setDisabled(True)
197 209
            self.ui.pushButtonNoteColEdit.setDisabled(True)
......
228 240
                self.tableWidgets[key].setAcceptDrops(True)
229 241
                self.tableWidgets[key].dropEvent = self.drops[key]
230 242

  
243
                if self.line_list:
244
                    break
245

  
231 246
            # attribute list setting
232 247
            for key in self.listWidgets.keys():
233 248
                self.listWidgets[key].itemDoubleClicked.connect(self.items[key])
......
246 261
                self.listWidgets[key].setDragDropMode(QAbstractItemView.DragDrop)
247 262
                self.listWidgets[key].dragEnterEvent = self.dragEnterEvent
248 263

  
264
                if self.line_list:
265
                    break
266

  
249 267
            self.ui.pushButtonApply.clicked.connect(self.pushButtonApplyClicked)
250 268
            self.ui.pushButtonClose.clicked.connect(self.pushButtonCloseClicked)
251 269
            self.ui.tabWidget.currentChanged.connect(self.tabchanged)
252 270

  
271
            if self.line_list:
272
                self.ui.tabWidget.removeTab(4)
273
                self.ui.tabWidget.removeTab(3)
274
                self.ui.tabWidget.removeTab(2)
275
                self.ui.tabWidget.removeTab(1)
276

  
253 277
        except Exception as ex:
254 278
            from App import App
255 279
            from AppDocData import MessageType
DTI_PID/DTI_PID/LineListDialog.py
7 7
from PyQt5.QtCore import *
8 8
from PyQt5.QtGui import *
9 9
from PyQt5.QtWidgets import *
10
from AppDocData import AppDocData, MessageType
10
from AppDocData import AppDocData, MessageType, Config
11 11
from App import App
12 12

  
13 13
from EngineeringAbstractItem import QEngineeringAbstractItem
......
38 38

  
39 39
        self.ui.tableViewLineList.setSortingEnabled(True)
40 40

  
41
        self.delimiter = '!-!'
42
        self.delimiterCombine = '!@!'
43
        self.emptyCol = 'Empty Column'
44

  
41 45
        self.isAccepted = False
42 46
        self.code_data = None
43 47

  
44 48
        # load drawing list
45 49
        # skip
46 50

  
51
        self.initListOrder()
52

  
47 53
        datas = self.make_line_list_data()
48 54
        self.fill_data(datas)
49 55

  
50 56
        self.ui.buttonBox.button(QDialogButtonBox.Save).clicked.connect(self.export_line_list)
51 57
        self.ui.buttonBox.button(QDialogButtonBox.Close).clicked.connect(self.reject)
58
        self.ui.pushButtonDataFormat.clicked.connect(self.show_item_data_format_dialog)
52 59

  
53 60
        self.ui.tableViewLineList.clicked.connect(self.listCellClicked)
54 61

  
62
    def initListOrder(self):
63
        # 엑셀 추출시 사용할 리스트 오더를 db에서 읽거나 없으면 db에 추가
64

  
65
        app_doc_data = AppDocData.instance()
66

  
67
        self.lineColumnListAll = ['FROM', 'TO', 'P&ID NO.', 'PHASE', 'Stream No']
68
        #['SIZE', 'FLUID CODE', 'NO.', "MAT'L SPEC.", 'FROM', 'TO', 'P&ID NO.', 'PHASE', 'Stream No', 'INSULATION CODE', 'THK.']
69
        self.lineColumnListAll.extend([prop.Attribute for prop in app_doc_data.getLineProperties()])
70

  
71
        self.columnListAll = \
72
                {
73
                    'LINE_DATA_LIST': self.lineColumnListAll,
74
                }
75

  
76
        self.lineOrder = []
77
        self.columnOrder = \
78
            {
79
                'LINE_DATA_LIST': self.lineOrder,
80
            }
81

  
82
        try:
83
            configs = []
84
            self.columnOrder['LINE_DATA_LIST'] = app_doc_data.getConfigs('Order', 'LINE_LIST_DATA_LIST')
85
            if len(self.columnOrder['LINE_DATA_LIST']) is 0:  # use column name if setting does not exit
86
                value = ''
87
                for prop in app_doc_data.getLineProperties():
88
                    value += (prop.Attribute + self.delimiterCombine + prop.Attribute + self.delimiter)
89
                value = value[:-len(self.delimiter)]
90
                config = Config('Order', 'LINE_LIST_DATA_LIST', value)
91
                configs.append(config)
92
                self.columnOrder['LINE_DATA_LIST'] = [config]
93

  
94
            app_doc_data.saveConfigs(configs)
95

  
96
        except Exception as ex:
97
            from App import App
98
            from AppDocData import MessageType
99

  
100
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
101
                                                          sys.exc_info()[-1].tb_lineno)
102
            App.mainWnd().addMessage.emit(MessageType.Error, message)
103

  
104
    def show_item_data_format_dialog(self):
105
        """ show item data format dialog """
106

  
107
        from ItemDataFormatDialog import QItemDataFormatDialog
108

  
109
        dlg = QItemDataFormatDialog(self, self.columnListAll, self.columnOrder, line_list=True)
110
        if dlg.exec_():
111
            datas = self.make_line_list_data()
112
            self.fill_data(datas)
113

  
55 114
    def listCellClicked(self, index):
56 115
        from HighlightCommand import HighlightCommand
57 116

  
DTI_PID/DTI_PID/LineNoList_UI.py
11 11
class Ui_LineListTable(object):
12 12
    def setupUi(self, LineListTable):
13 13
        LineListTable.setObjectName("LineListTable")
14
        LineListTable.resize(981, 384)
14
        LineListTable.resize(951, 384)
15 15
        font = QtGui.QFont()
16 16
        font.setFamily("맑은 고딕")
17 17
        LineListTable.setFont(font)
......
31 31
        self.groupBoxTitleBlock.setObjectName("groupBoxTitleBlock")
32 32
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBoxTitleBlock)
33 33
        self.gridLayout_4.setObjectName("gridLayout_4")
34
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
35
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
36
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
37
        self.horizontalLayout_2.addItem(spacerItem)
38
        self.pushButtonDataFormat = QtWidgets.QPushButton(self.groupBoxTitleBlock)
39
        self.pushButtonDataFormat.setObjectName("pushButtonDataFormat")
40
        self.horizontalLayout_2.addWidget(self.pushButtonDataFormat)
41
        self.gridLayout_4.addLayout(self.horizontalLayout_2, 0, 0, 1, 1)
34 42
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
35 43
        self.verticalLayout_3.setObjectName("verticalLayout_3")
36 44
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
......
39 47
        self.tableViewLineList.setObjectName("tableViewLineList")
40 48
        self.horizontalLayout_4.addWidget(self.tableViewLineList)
41 49
        self.verticalLayout_3.addLayout(self.horizontalLayout_4)
42
        self.gridLayout_4.addLayout(self.verticalLayout_3, 0, 0, 1, 1)
50
        self.gridLayout_4.addLayout(self.verticalLayout_3, 2, 0, 1, 1)
43 51
        self.gridLayout.addWidget(self.groupBoxTitleBlock, 1, 0, 1, 1)
44 52

  
45 53
        self.retranslateUi(LineListTable)
......
49 57
        _translate = QtCore.QCoreApplication.translate
50 58
        LineListTable.setWindowTitle(_translate("LineListTable", "Line List Export"))
51 59
        self.groupBoxTitleBlock.setTitle(_translate("LineListTable", "Line List"))
60
        self.pushButtonDataFormat.setText(_translate("LineListTable", "List Format"))
52 61

  
53 62
import MainWindow_rc
54 63

  
DTI_PID/DTI_PID/Shapes/EngineeringAbstractItem.py
88 88

  
89 89
        app_doc_data = AppDocData.instance()
90 90

  
91
        if DisplayOptions.DisplayByStreamNo == DisplayColors.instance().option:
91
        if DisplayOptions.DisplayByStreamNo == DisplayColors.instance().option and \
92
                (issubclass(type(self), SymbolSvgItem) or type(self) is QEngineeringLineItem):
92 93
            res = check_stream_no_attribute()
93 94
            if res and res in app_doc_data._hmbColors:
94 95
                return app_doc_data._hmbColors[res]
DTI_PID/DTI_PID/UI/LineNoList.ui
6 6
   <rect>
7 7
    <x>0</x>
8 8
    <y>0</y>
9
    <width>981</width>
9
    <width>951</width>
10 10
    <height>384</height>
11 11
   </rect>
12 12
  </property>
......
41 41
     </property>
42 42
     <layout class="QGridLayout" name="gridLayout_4">
43 43
      <item row="0" column="0">
44
       <layout class="QHBoxLayout" name="horizontalLayout_2">
45
        <item>
46
         <spacer name="horizontalSpacer">
47
          <property name="orientation">
48
           <enum>Qt::Horizontal</enum>
49
          </property>
50
          <property name="sizeHint" stdset="0">
51
           <size>
52
            <width>40</width>
53
            <height>20</height>
54
           </size>
55
          </property>
56
         </spacer>
57
        </item>
58
        <item>
59
         <widget class="QPushButton" name="pushButtonDataFormat">
60
          <property name="text">
61
           <string>List Format</string>
62
          </property>
63
         </widget>
64
        </item>
65
       </layout>
66
      </item>
67
      <item row="2" column="0">
44 68
       <layout class="QVBoxLayout" name="verticalLayout_3">
45 69
        <item>
46 70
         <layout class="QHBoxLayout" name="horizontalLayout_4">

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)