프로젝트

일반

사용자정보

개정판 833b2cd8

ID833b2cd819b43018df8b43ae02a5c91eb45a8162
상위 8d5a086c
하위 c235988e

백흠경이(가) 약 4년 전에 추가함

issue #1493: AutoCAD에서 블럭을 추출하여 ID2 XML 파일로 저장한다

Change-Id: I22eafaabecfcb70d41602154d43005e8cd614d26

차이점 보기:

DTI_PID/DTI_PID/AppDocData.py
26 26

  
27 27
class Config:
28 28
    def __init__(self, section, key, value):
29
        """constructor"""
29 30
        self.section = section
30 31
        self.key = key
31 32
        self.value = value
......
4346 4347

  
4347 4348
        return symbolTypeList
4348 4349

  
4349
    '''
4350
        @brief      Get Symbol Category by Symbol Type
4351
        @author     Jeongwoo
4352
        @date       2018.05.09
4353
    '''
4354

  
4355
    def getSymbolCategoryByType(self, type):
4350
    def getSymbolCategoryByType(self, type: str):
4351
        """get symbol category by using symbol type"""
4356 4352
        category = None
4357 4353
        if type in self._symbolType:
4358 4354
            return self._symbolType[type]
DTI_PID/DTI_PID/HMBDialog.py
28 28
            self.ui = Ui_HMBDialog()
29 29
            self.ui.setupUi(self)
30 30
            self.waiting_spinner = QtWaitingSpinner(self)
31
            self.ui.horizontalLayoutSpinnerWaiting.addWidget(self.waiting_spinner)
32 31

  
33 32
            self.ui.buttonBox.button(QDialogButtonBox.Ok).setIcon(QIcon(':/newPrefix/OK.svg'))
34 33
            self.ui.buttonBox.button(QDialogButtonBox.Ok).setText(self.tr('Import'))
......
180 179
            self.ui.lineEditHMBFilePath.setText(file)
181 180

  
182 181
    def accept(self):
183
        """no more used"""
184 182
        """accept dialog"""
185 183
        from HMBTable import HMBTable, HMBData
186 184
        from SymbolAttr import SymbolAttr
......
202 200
                self.worker.start()
203 201
            else:
204 202
                QMessageBox.warning(self, self.tr('Warning'), self.tr('Please, select a HMB excel file'))
205

  
206
                """
207
                app_doc_data = AppDocData.instance()
208
                model = self.ui.tableViewHMB.model()
209
                app_doc_data.save_hmb_model(model)
210
                QDialog.accept(self)
211
                """
212 203
        except Exception as ex:
213 204
            message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
214 205
                      f"{sys.exc_info()[-1].tb_lineno}"
DTI_PID/DTI_PID/ImportTextFromCADDialog.py
31 31
        return editor if editor else super(LineTypeMappingDelegate, self).createEditor(parent, option, index)
32 32

  
33 33

  
34
class SymbolMappingDelegate(QStyledItemDelegate):
35
    def __init__(self, symbol_types: list, parent=None):
36
        QStyledItemDelegate.__init__(self, parent)
37

  
38
        self._symbol_types = symbol_types
39

  
40
    def createEditor(self, parent, option, index):
41
        """create a editor for symbol mapping"""
42
        editor = None
43

  
44
        item = index.model().itemFromIndex(index)
45
        if item.parent() and not item.parent().parent():
46
            if index.column() == 1:
47
                editor = QComboBox(parent)
48
                editor.addItems(self._symbol_types if self._symbol_types else [''])
49

  
50
        return editor if editor else super(SymbolMappingDelegate, self).createEditor(parent, option, index)
51

  
52

  
34 53
class LineTypeMappingModel(QStandardItemModel):
35 54
    """This is LineTypeMapping Model class"""
36 55
    def __init__(self):
......
61 80
            header.setTextAlignment(Qt.AlignCenter)
62 81
            self.setHorizontalHeaderItem(idx, header)
63 82

  
83

  
84
class SymbolMappingModel(QStandardItemModel):
85
    """This is SymbolMapping Model class"""
86
    def __init__(self):
87
        """constructor"""
88
        QStandardItemModel.__init__(self)
89

  
90
        self._autocad_symbols = []  # holder for autocad symbol
91

  
92
        project = AppDocData.instance().getCurrentProject()
93
        if project is not None:
94
            self.clear()
95
            self.load_symbol_info()
96

  
97
            # load and display symbol mapping
98
            app_doc_data = AppDocData.instance()
99
            configs = app_doc_data.getConfigs(section='Symbol Mapping')
100

  
101
            for row in range(self.rowCount()):
102
                category_index = self.index(row, 0)
103

  
104
                child_count = self.rowCount(category_index)
105
                for child_row in range(child_count):
106
                    child_index = self.index(child_row, 0, category_index)
107
                    id2_symbol_item = self.itemFromIndex(child_index)
108
                    id2_symbol_uid = id2_symbol_item.data(Qt.UserRole)
109

  
110
                    matches = [config for config in configs if config.key == str(id2_symbol_uid)]
111
                    for match in matches:
112
                        symbols = match.value.split(',')
113
                        for symbol in symbols:
114
                            if symbol not in self._autocad_symbols:
115
                                self._autocad_symbols.append(symbol)
116

  
117
                            childs = [QStandardItem(''), QStandardItem(symbol), QStandardItem('')]
118
                            childs[0].setData(id2_symbol_uid, Qt.UserRole)
119
                            for child in childs:
120
                                child.setEditable(False)
121
                            id2_symbol_item.appendRow(childs)
122

  
123
            headers = [QStandardItem("ID2 Symbol"), QStandardItem("AutoCAD Symbol"), QStandardItem('')]
124
            for idx, header in enumerate(headers):
125
                header.setTextAlignment(Qt.AlignCenter)
126
                self.setHorizontalHeaderItem(idx, header)
127

  
128
    def load_symbol_info(self):
129
        """load symbol information and display it on tree view"""
130
        try:
131
            app_doc_data = AppDocData.instance()
132

  
133
            symbolTypeList = app_doc_data.getSymbolTypeList()
134
            for row, symbolType in enumerate(symbolTypeList):
135
                items = [QStandardItem(symbolType[2]), QStandardItem(''), QStandardItem('')]
136
                items[0].setData(symbolType, Qt.UserRole)
137
                items[0].setEditable(False)
138
                items[0].setSelectable(False)
139
                items[1].setEditable(False)
140
                items[1].setSelectable(False)
141
                items[2].setEditable(False)
142
                items[2].setSelectable(False)
143

  
144
                symbolList = app_doc_data.getSymbolListByType('UID', symbolType[0])
145
                for symbol in symbolList:
146
                    childs = [QStandardItem(symbol.getName()), QStandardItem(''), QStandardItem('')]
147
                    childs[0].setData(symbol.getUid(), Qt.UserRole)
148
                    childs[0].setEditable(False)
149

  
150
                    _, svg = app_doc_data.read_symbol_shape(symbol.sName)
151
                    if svg:
152
                        symbol.pixmap = QPixmap()
153
                        symbol.pixmap.loadFromData(svg if isinstance(svg, bytes) else svg.encode())
154
                        icon = QIcon(symbol.pixmap)
155
                        childs[0].setIcon(icon)
156
                        childs[0].svgFilePath = None  # save svg file path
157
                    else:
158
                        svgPath = symbol.getSvgFileFullPath()
159
                        symbol.pixmap = QPixmap(svgPath)
160
                        icon = QIcon(symbol.pixmap)
161
                        childs[0].setIcon(icon)
162
                        childs[0].svgFilePath = svgPath  # save svg file path
163

  
164
                    items[0].appendRow(childs)
165

  
166
                items[0].sortChildren(0, Qt.AscendingOrder)
167
                self.appendRow(items)
168
        except Exception as ex:
169
            from App import App
170
            from AppDocData import MessageType
171

  
172
            message = f'error occurred({ex}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:' \
173
                      f'{sys.exc_info()[-1].tb_lineno}'
174
            App.mainWnd().addMessage.emit(MessageType.Error, message)
175

  
176
    @property
177
    def autocad_symbols(self):
178
        """property of autocad symbol"""
179
        return self._autocad_symbols
180

  
181

  
64 182
class QImportTextFromCADDialog(QDialog):
65 183
    def __init__(self, parent):
184
        """constructor"""
66 185
        QDialog.__init__(self, parent)
67 186

  
68 187
        self.ui = ImportTextFromCAD_UI.Ui_ImportTextFromCADDialog()
......
70 189

  
71 190
        self._dwgs = []
72 191
        self._line_types = []
192
        self._symbol_types = []
73 193
        self.on_load_line_type_mapping()
194
        self.on_load_symbol_mapping()
74 195

  
75 196
        app_doc_data = AppDocData.instance()
76 197

  
......
94 215
        self.isAccepted = False
95 216
 
96 217
        self.ui.toolButtonCAD.clicked.connect(self.on_add_cad_click)
97
        self.ui.pushButtonSave.clicked.connect(self.on_save_line_type_mapping)
218
        self.ui.pushButtonSave.clicked.connect(self.on_save_mappings)
98 219
        self.ui.pushButtonImport.clicked.connect(self.on_import_autocad)
99 220
        self.ui.pushButtonClose.clicked.connect(self.close)
100 221

  
......
106 227
                self.ui.treeViewLineType.model().removeRow(index.row(), index.parent())
107 228

  
108 229
        def on_add_line_type_item(index: QModelIndex):
109
            _index = self.ui.treeViewLineType.model().index(index.row(), 1)
110
            autocad_line_type_item = self.ui.treeViewLineType.model().itemFromIndex(_index)
111
            if autocad_line_type_item and autocad_line_type_item.text():
112
                _index = self.ui.treeViewLineType.model().index(index.row(), 0, index.parent())
113
                id2_line_type_item = self.ui.treeViewLineType.model().itemFromIndex(_index)
114
                items = [QStandardItem(''), QStandardItem(autocad_line_type_item.text()), QStandardItem('')]
115
                items[0].setData(id2_line_type_item.text(), Qt.UserRole)
116
                for item in items:
117
                    item.setEditable(False)
118
                id2_line_type_item.appendRow(items)
119

  
120
                """add remove button"""
121
                child_count = self.ui.treeViewLineType.model().rowCount(id2_line_type_item.index())
122
                button = QPushButton(icon=QIcon(":/newPrefix/Remove.svg"))
123
                button.setMaximumWidth(20)
124
                button.clicked.connect(on_remove_treeview_item)
125
                _index = self.ui.treeViewLineType.model().index(child_count - 1, 2, id2_line_type_item.index())
126
                self.ui.treeViewLineType.setIndexWidget(_index, button)
127
                """up to here"""
128

  
129
                self.ui.treeViewLineType.expandAll()
230
            """add AutoCAD line type corresponding to ID2 line type"""
231

  
232
            try:
233
                _index = self.ui.treeViewLineType.model().index(index.row(), 1)
234
                autocad_line_type_item = self.ui.treeViewLineType.model().itemFromIndex(_index)
235
                if autocad_line_type_item and autocad_line_type_item.text():
236
                    _index = self.ui.treeViewLineType.model().index(index.row(), 0, index.parent())
237
                    id2_line_type_item = self.ui.treeViewLineType.model().itemFromIndex(_index)
238
                    items = [QStandardItem(''), QStandardItem(autocad_line_type_item.text()), QStandardItem('')]
239
                    items[0].setData(id2_line_type_item.text(), Qt.UserRole)
240
                    for item in items:
241
                        item.setEditable(False)
242
                    id2_line_type_item.appendRow(items)
243

  
244
                    ## add remove button
245
                    child_count = self.ui.treeViewLineType.model().rowCount(id2_line_type_item.index())
246
                    button = QPushButton(icon=QIcon(":/newPrefix/Remove.svg"))
247
                    button.setMaximumWidth(20)
248
                    button.clicked.connect(on_remove_treeview_item)
249
                    _index = self.ui.treeViewLineType.model().index(child_count - 1, 2, id2_line_type_item.index())
250
                    self.ui.treeViewLineType.setIndexWidget(_index, button)
251

  
252
                    self.ui.treeViewLineType.expandAll()
253
            except Exception as ex:
254
                from App import App
255
                from AppDocData import MessageType
256

  
257
                message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
258
                          f"{sys.exc_info()[-1].tb_lineno}"
259
                QMessageBox.warning(self, self._tr('Warning'), message)
130 260

  
131 261
        model = LineTypeMappingModel()
132 262
        model.invisibleRootItem()
......
154 284
        self.ui.treeViewLineType.resizeColumnToContents(2)
155 285
        self.ui.treeViewLineType.expandAll()
156 286

  
287
    def on_load_symbol_mapping(self):
288
        """load symbol mapping setting"""
289

  
290
        def on_remove_symbol_mapping_item():
291
            """remove selected items"""
292
            indices = self.ui.treeViewSymbolMapping.selectionModel().selectedRows()
293
            for index in sorted(indices):
294
                self.ui.treeViewSymbolMapping.model().removeRow(index.row(), index.parent())
295

  
296
        def on_add_symbol_type_item(index: QModelIndex):
297
            """map AutoCAD symbol and ID2 symbol"""
298

  
299
            try:
300
                _index = self.ui.treeViewSymbolMapping.model().index(index.row(), 1, index.parent())
301
                autocad_symbol_item = self.ui.treeViewSymbolMapping.model().itemFromIndex(_index)
302
                if autocad_symbol_item and autocad_symbol_item.text():
303
                    _index = self.ui.treeViewSymbolMapping.model().index(index.row(), 0, index.parent())
304
                    id2_symbol_item = self.ui.treeViewSymbolMapping.model().itemFromIndex(_index)
305
                    items = [QStandardItem(''), QStandardItem(autocad_symbol_item.text()), QStandardItem('')]
306
                    items[0].setData(id2_symbol_item.data(Qt.UserRole), Qt.UserRole)
307
                    for item in items:
308
                        item.setEditable(False)
309
                    id2_symbol_item.appendRow(items)
310

  
311
                    ## add remove button
312
                    child_count = self.ui.treeViewSymbolMapping.model().rowCount(id2_symbol_item.index())
313
                    button = QPushButton(icon=QIcon(":/newPrefix/Remove.svg"))
314
                    button.setMaximumWidth(20)
315
                    button.clicked.connect(on_remove_symbol_mapping_item)
316
                    _index = self.ui.treeViewSymbolMapping.model().index(child_count - 1, 2, id2_symbol_item.index())
317
                    self.ui.treeViewSymbolMapping.setIndexWidget(_index, button)
318

  
319
                    self.ui.treeViewSymbolMapping.expandAll()
320
            except Exception as ex:
321
                from App import App
322
                from AppDocData import MessageType
323

  
324
                message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
325
                          f"{sys.exc_info()[-1].tb_lineno}"
326
                QMessageBox.warning(self, 'Warning', message)
327

  
328
        model = SymbolMappingModel()
329
        model.invisibleRootItem()
330
        self.ui.treeViewSymbolMapping.setModel(model)
331

  
332
        for row in range(model.rowCount()):
333
            parent_index = model.index(row, 0)
334
            child_count = model.rowCount(parent_index)
335
            for child_row in range(child_count):
336
                button = QPushButton(icon=QIcon(":/newPrefix/Add.svg"))
337
                button.setMaximumWidth(20)
338
                index = self.ui.treeViewSymbolMapping.model().index(child_row, 2, parent_index)
339
                button.clicked.connect(partial(on_add_symbol_type_item, index))
340
                self.ui.treeViewSymbolMapping.setIndexWidget(index, button)
341

  
342
        self.ui.treeViewSymbolMapping.resizeColumnToContents(0)
343
        self.ui.treeViewSymbolMapping.resizeColumnToContents(1)
344
        self.ui.treeViewSymbolMapping.resizeColumnToContents(2)
345
        self.ui.treeViewSymbolMapping.expandAll()
346

  
347
        self._symbol_types = model.autocad_symbols[:]
348
        self.ui.treeViewSymbolMapping.setItemDelegate(SymbolMappingDelegate(self._symbol_types,
349
                                                                            self.ui.treeViewSymbolMapping))
350

  
157 351
    def on_add_cad_click(self):
158
        """select autocad files"""
352
        """extract information from select autocad files"""
159 353
        project = AppDocData.instance().getCurrentProject()
160 354

  
161 355
        options = QFileDialog.Options()
......
169 363

  
170 364
            self._dwgs.clear()
171 365
            self._line_types.clear()
172
            for file in files:
173
                if os.path.exists(file):
366
            self._symbol_types.clear()
367
            for _file in files:
368
                if os.path.exists(_file):
174 369
                    try:
370
                        file = os.path.normpath(_file)
175 371
                        executable = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'OdReadExMgd',
176 372
                                                  'OdReadExMgd.exe')
177 373
                        args = [executable, file, '0', '0', '1']
......
200 396
                                continue
201 397

  
202 398
                            self._line_types.append(line_type_tbl_record.attrib['Name'])
399

  
400
                        for block_ref_record in autocad_xml_root.iter('AcDbBlockReference'):
401
                            block_name = block_ref_record.attrib['Name']
402
                            if block_name in self._symbol_types:
403
                                continue
404

  
405
                            self._symbol_types.append(block_name)
203 406
                        """up to here"""
204 407

  
205 408
                        self._dwgs.append(file)
......
211 414
                                  f"{sys.exc_info()[-1].tb_lineno}"
212 415
                        App.mainWnd().addMessage.emit(MessageType.Error, message)
213 416

  
214
    def on_save_line_type_mapping(self):
215
        """save line type mapping"""
417
    def on_save_mappings(self):
418
        """save line type and symbol mappings"""
216 419
        from AppDocData import Config
217 420

  
218 421
        configs = []
......
236 439
            if autocad_line_types:
237 440
                configs.append(Config('Line Type Mapping', id2_line_type, ','.join(autocad_line_types)))
238 441

  
442
        # save symbol mappings
443
        model = self.ui.treeViewSymbolMapping.model()
444
        for row in range(model.rowCount()):
445
            category_index = model.index(row, 0)
446

  
447
            child_count = model.rowCount(category_index)
448
            for child_row in range(child_count):
449
                autocad_symbols = []
450
                child_index = model.index(child_row, 0, category_index)
451
                id2_symbol_item = model.itemFromIndex(child_index)
452
                id2_symbol_uid = id2_symbol_item.data(Qt.UserRole)
453
                id2_symbol = id2_symbol_item.text()
454
                mapping_count = model.rowCount(child_index)
455
                for mapping_row in range(mapping_count):
456
                    mapping_index = model.index(mapping_row, 1, child_index)
457
                    autocad_symbols.append(model.itemFromIndex(mapping_index).text())
458

  
459
                if autocad_symbols:
460
                    configs.append(Config('Symbol Mapping', id2_symbol_uid, ','.join(autocad_symbols)))
461

  
239 462
        app_doc_data = AppDocData.instance()
240 463
        app_doc_data.saveConfigs(configs)
241 464

  
......
243 466
        """up to here"""
244 467

  
245 468
    def on_import_autocad(self):
246
        """import line and text from autocad"""
469
        """import line, text and symbol from autocad"""
247 470
        from AppDocData import Config
248 471
        import XmlGenerator as xg
249 472

  
250
        project = AppDocData.instance().getCurrentProject()
473
        if not self._dwgs:
474
            QMessageBox.information(self, self.tr('Information'), self.tr('There is no selected file(s)'))
475
            return
476

  
477
        app_doc_data = AppDocData.instance()
478
        project = app_doc_data.getCurrentProject()
251 479

  
252 480
        temp_path = project.getTempPath()
253 481
        id2_xml_files = [f for f in os.listdir(temp_path) if os.path.isfile(os.path.join(temp_path, f)) and
254 482
                         (os.path.splitext(f)[1].upper() == '.XML')]
255 483

  
256 484
        self.text_scale = self.ui.doubleSpinBoxScale.value()
485
        mapping_configs = app_doc_data.getConfigs(section='Symbol Mapping')
257 486

  
258 487
        for _file in self._dwgs:
259 488
            file_name = os.path.splitext(os.path.basename(_file))[0]
......
261 490
            matches = [id2_xml_file for id2_xml_file in id2_xml_files if id2_xml_file.replace(file_name, '').upper() == '.XML']
262 491
            if matches:
263 492
                try:
264
                    layers, line_types = [], []
493
                    layers, line_types, symbols = [], [], []
265 494
                    autocad_xml = parse(autocad_xml_path)
266 495

  
267
                    """parse layer and line type"""
496
                    """parse layer, line type and symbol"""
268 497
                    autocad_xml_root = autocad_xml.getroot()
269 498
                    for layer_tbl_record in autocad_xml_root.iter('AcDbLayerTableRecord'):
270 499
                        layer_name = layer_tbl_record.attrib['Name']
......
275 504
                        line_type_oid = line_type_tbl_record.attrib['ObjectId']
276 505
                        line_type_name = line_type_tbl_record.attrib['Name']
277 506
                        line_types.append([line_type_oid, line_type_name])
507

  
508
                    for blk_ref_record in autocad_xml_root.iter('AcDbBlockReference'):
509
                        blk_ref_handle = blk_ref_record.attrib['Handle']
510
                        blk_ref_name = blk_ref_record.attrib['Name']
511
                        symbols.append([blk_ref_handle, blk_ref_name])
278 512
                    """up to here"""
279 513

  
280 514
                    id2_xml_path = os.path.join(temp_path, matches[0])
......
292 526
                                    int(id2_xml_root.find('SIZE').text.split(',')[1])]
293 527
                        id2_bbox_text = id2_bbox
294 528

  
529
                    symbols_node = id2_xml_root.find(xg.SYMBOL_LIST_NODE_NAME)
530
                    if symbols_node:
531
                        symbols = symbols_node.findall('SYMBOL')
532
                        # remove only converted symbol nodes
533
                        for symbol in symbols:
534
                            if 'Converted' in symbol.attrib and symbol.attrib['Converted'] == str(True):
535
                                symbols_node.remove(symbol)
536

  
295 537
                    """remove texts from id2 xml file"""
296 538
                    textInfo = id2_xml_root.find(xg.TEXT_INFO_LIST_NODE_NAME)
297 539
                    textInfo.clear()
......
330 572
                                textInfo.append(node)
331 573

  
332 574
                        for blk_ref in blk_tbl_record.iter('AcDbBlockReference'):
575
                            node = self.symbol_to_xml(blk_ref, id2_bbox, autocad_bbox, mapping_configs)
576
                            if node:
577
                                symbols_node.append(node)
578

  
333 579
                            for record in blk_ref.iter('AcDbAttribute'):
334 580
                                node = self.text_to_xml(record, id2_bbox_text, autocad_bbox)
335 581
                                if node:
......
358 604
                              f"{sys.exc_info()[-1].tb_lineno}"
359 605
                    App.mainWnd().addMessage.emit(MessageType.Error, message)
360 606

  
607
    def symbol_to_xml(self, blk_ref_node, id2_bbox, autocad_bbox, mapping_configs: list) -> str:
608
        """try to convert block reference element to id2 xml"""
609
        import uuid
610
        from SymbolSvgItem import SymbolSvgItem
611

  
612
        def convert_to_image_coords(pt, scale: float, offset: list):
613
            """convert autocad coordinates to image coordinates"""
614
            return [pt[0] * scale + offset[0], -pt[1] * scale + offset[1]]
615

  
616
        try:
617
            scale = max([id2_bbox[2] / autocad_bbox[2], id2_bbox[3] / autocad_bbox[3]])
618
            offsets = [id2_bbox[0] - autocad_bbox[0] * scale, (id2_bbox[1] + id2_bbox[3]) - autocad_bbox[1] * scale]
619

  
620
            name = blk_ref_node.attrib['Name']
621
            origin = convert_to_image_coords((float(blk_ref_node.attrib['X']), float(blk_ref_node.attrib['Y'])),
622
                                             scale, offsets)
623
            angle = round(float(blk_ref_node.attrib['Angle']), 2)
624

  
625
            min_extents, max_extents = None, None
626
            tokens = blk_ref_node.attrib['MaxExtents'].strip('()').split(',')
627
            if 3 == len(tokens):
628
                max_extents = convert_to_image_coords((float(tokens[0]), float(tokens[1])), scale, offsets)
629

  
630
            tokens = blk_ref_node.attrib['MinExtents'].strip('()').split(',')
631
            if 3 == len(tokens):
632
                min_extents = convert_to_image_coords((float(tokens[0]), float(tokens[1])), scale, offsets)
633

  
634
            _height = abs(max_extents[1] - min_extents[1])
635
            _width = abs(max_extents[0] - min_extents[0])
636

  
637
            allowed_error = 0.01
638
            if abs(angle - 1.57) < allowed_error:
639
                _height, _width = _width, _height
640
                origin[0], origin[1] = origin[0] - _width, origin[1] - _height + _width
641
            elif abs(angle - 4.71) < allowed_error:
642
                _height, _width = _width, _height
643
                origin[0], origin[1] = origin[0] - _width, origin[1] + _height - _width
644

  
645
            uid = None
646
            for config in mapping_configs:
647
                if name in config.value.split(','):
648
                    uid = config.key
649
                    break
650
            if uid:
651
                app_doc_data = AppDocData.instance()
652
                symbol = app_doc_data.getSymbolByQuery('UID', uid)
653
                svg_file_path = os.path.join(app_doc_data.getCurrentProject().getSvgFilePath(), symbol.getType(),
654
                                             symbol.getName() + '.svg')
655

  
656
                item = SymbolSvgItem.createItem(symbol.getType(), symbol.getName(), path=svg_file_path)
657
                loc = [min(min_extents[0], max_extents[0]), min(min_extents[1], max_extents[1])]
658
                item.buildItem(name, symbol.getType(), angle, loc, (_width, _height), origin, connPts=None,
659
                               parentSymbol=None, childSymbol=None, hasInstrumentLabel=False, dbUid=uid)
660
                item.converted = True
661

  
662
                app_doc_data = AppDocData.instance()
663
                for area in app_doc_data.getAreaList():
664
                    if area.contains([origin[0], origin[1]]):
665
                        item.area = area.name
666
                        break
667

  
668
                return item.toXml()
669
        except Exception as ex:
670
            from App import App
671
            from AppDocData import MessageType
672

  
673
            message = f"error occurred({repr(ex)}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:" \
674
                      f"{sys.exc_info()[-1].tb_lineno}"
675

  
676
            App.mainWnd().addMessage.emit(MessageType.Error, message)
677

  
678
        return None
679

  
361 680
    def text_to_xml(self, text_node, id2_bbox, autocad_bbox):
362 681
        """try to convert text element to id2 xml"""
363 682
        import uuid
DTI_PID/DTI_PID/ImportTextFromCAD_UI.py
1 1
# -*- coding: utf-8 -*-
2 2

  
3
# Form implementation generated from reading ui file './UI/ImportTextFromCAD.ui'
3
# Form implementation generated from reading ui file '.\UI\ImportTextFromCAD.ui'
4 4
#
5
# Created by: PyQt5 UI code generator 5.11.3
5
# Created by: PyQt5 UI code generator 5.15.2
6 6
#
7
# WARNING! All changes made in this file will be lost!
7
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8
# run again.  Do not edit this file unless you know what you are doing.
9

  
8 10

  
9 11
from PyQt5 import QtCore, QtGui, QtWidgets
10 12

  
13

  
11 14
class Ui_ImportTextFromCADDialog(object):
12 15
    def setupUi(self, ImportTextFromCADDialog):
13 16
        ImportTextFromCADDialog.setObjectName("ImportTextFromCADDialog")
......
27 30
        self.spinBoxY.setMinimum(-50000)
28 31
        self.spinBoxY.setMaximum(50000)
29 32
        self.spinBoxY.setObjectName("spinBoxY")
30
        self.gridLayout.addWidget(self.spinBoxY, 2, 2, 1, 1)
33
        self.gridLayout.addWidget(self.spinBoxY, 3, 2, 1, 1)
31 34
        self.spinBoxX = QtWidgets.QSpinBox(ImportTextFromCADDialog)
32 35
        self.spinBoxX.setMinimumSize(QtCore.QSize(0, 0))
33 36
        self.spinBoxX.setMinimum(-50000)
34 37
        self.spinBoxX.setMaximum(50000)
35 38
        self.spinBoxX.setObjectName("spinBoxX")
36
        self.gridLayout.addWidget(self.spinBoxX, 2, 1, 1, 1)
39
        self.gridLayout.addWidget(self.spinBoxX, 3, 1, 1, 1)
37 40
        self.label = QtWidgets.QLabel(ImportTextFromCADDialog)
38 41
        self.label.setObjectName("label")
39
        self.gridLayout.addWidget(self.label, 2, 0, 1, 1)
40
        self.treeViewLineType = QtWidgets.QTreeView(ImportTextFromCADDialog)
41
        self.treeViewLineType.setObjectName("treeViewLineType")
42
        self.gridLayout.addWidget(self.treeViewLineType, 1, 1, 1, 3)
42
        self.gridLayout.addWidget(self.label, 3, 0, 1, 1)
43 43
        self.horizontalLayout = QtWidgets.QHBoxLayout()
44 44
        self.horizontalLayout.setObjectName("horizontalLayout")
45 45
        self.spinBoxTextX = QtWidgets.QSpinBox(ImportTextFromCADDialog)
......
56 56
        self.doubleSpinBoxScale.setSingleStep(0.1)
57 57
        self.doubleSpinBoxScale.setObjectName("doubleSpinBoxScale")
58 58
        self.horizontalLayout.addWidget(self.doubleSpinBoxScale)
59
        self.gridLayout.addLayout(self.horizontalLayout, 3, 1, 1, 3)
59
        self.gridLayout.addLayout(self.horizontalLayout, 4, 1, 1, 3)
60 60
        self.lineEditCAD = QtWidgets.QLineEdit(ImportTextFromCADDialog)
61 61
        self.lineEditCAD.setObjectName("lineEditCAD")
62 62
        self.gridLayout.addWidget(self.lineEditCAD, 0, 1, 1, 3)
63
        self.label_2 = QtWidgets.QLabel(ImportTextFromCADDialog)
64
        self.label_2.setMinimumSize(QtCore.QSize(50, 0))
65
        self.label_2.setObjectName("label_2")
66
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
63 67
        self.toolButtonCAD = QtWidgets.QToolButton(ImportTextFromCADDialog)
64 68
        self.toolButtonCAD.setText("")
65 69
        icon = QtGui.QIcon()
......
72 76
        icon1.addPixmap(QtGui.QPixmap(":/newPrefix/Remove.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
73 77
        self.pushButtonClose.setIcon(icon1)
74 78
        self.pushButtonClose.setObjectName("pushButtonClose")
75
        self.gridLayout.addWidget(self.pushButtonClose, 5, 3, 1, 1)
76
        self.label_2 = QtWidgets.QLabel(ImportTextFromCADDialog)
77
        self.label_2.setMinimumSize(QtCore.QSize(50, 0))
78
        self.label_2.setObjectName("label_2")
79
        self.gridLayout.addWidget(self.label_2, 0, 0, 1, 1)
80
        self.pushButtonImport = QtWidgets.QPushButton(ImportTextFromCADDialog)
79
        self.gridLayout.addWidget(self.pushButtonClose, 6, 3, 1, 1)
80
        self.pushButtonSave = QtWidgets.QPushButton(ImportTextFromCADDialog)
81 81
        icon2 = QtGui.QIcon()
82
        icon2.addPixmap(QtGui.QPixmap(":/newPrefix/OK.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
83
        self.pushButtonImport.setIcon(icon2)
82
        icon2.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
83
        self.pushButtonSave.setIcon(icon2)
84
        self.pushButtonSave.setObjectName("pushButtonSave")
85
        self.gridLayout.addWidget(self.pushButtonSave, 5, 1, 1, 3)
86
        self.pushButtonImport = QtWidgets.QPushButton(ImportTextFromCADDialog)
87
        icon3 = QtGui.QIcon()
88
        icon3.addPixmap(QtGui.QPixmap(":/newPrefix/OK.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
89
        self.pushButtonImport.setIcon(icon3)
84 90
        self.pushButtonImport.setObjectName("pushButtonImport")
85
        self.gridLayout.addWidget(self.pushButtonImport, 5, 2, 1, 1)
91
        self.gridLayout.addWidget(self.pushButtonImport, 6, 2, 1, 1)
86 92
        self.label_3 = QtWidgets.QLabel(ImportTextFromCADDialog)
87 93
        self.label_3.setObjectName("label_3")
88
        self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
89
        self.pushButtonSave = QtWidgets.QPushButton(ImportTextFromCADDialog)
90
        icon3 = QtGui.QIcon()
91
        icon3.addPixmap(QtGui.QPixmap(":/newPrefix/Save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
92
        self.pushButtonSave.setIcon(icon3)
93
        self.pushButtonSave.setObjectName("pushButtonSave")
94
        self.gridLayout.addWidget(self.pushButtonSave, 4, 1, 1, 3)
94
        self.gridLayout.addWidget(self.label_3, 4, 0, 1, 1)
95
        self.tabWidgetEntities = QtWidgets.QTabWidget(ImportTextFromCADDialog)
96
        self.tabWidgetEntities.setObjectName("tabWidgetEntities")
97
        self.tabLineTypes = QtWidgets.QWidget()
98
        self.tabLineTypes.setObjectName("tabLineTypes")
99
        self.gridLayout_2 = QtWidgets.QGridLayout(self.tabLineTypes)
100
        self.gridLayout_2.setObjectName("gridLayout_2")
101
        self.treeViewLineType = QtWidgets.QTreeView(self.tabLineTypes)
102
        self.treeViewLineType.setObjectName("treeViewLineType")
103
        self.gridLayout_2.addWidget(self.treeViewLineType, 0, 0, 1, 1)
104
        self.tabWidgetEntities.addTab(self.tabLineTypes, "")
105
        self.tabSymbols = QtWidgets.QWidget()
106
        self.tabSymbols.setObjectName("tabSymbols")
107
        self.gridLayout_3 = QtWidgets.QGridLayout(self.tabSymbols)
108
        self.gridLayout_3.setObjectName("gridLayout_3")
109
        self.treeViewSymbolMapping = QtWidgets.QTreeView(self.tabSymbols)
110
        self.treeViewSymbolMapping.setObjectName("treeViewSymbolMapping")
111
        self.gridLayout_3.addWidget(self.treeViewSymbolMapping, 0, 0, 1, 1)
112
        self.tabWidgetEntities.addTab(self.tabSymbols, "")
113
        self.gridLayout.addWidget(self.tabWidgetEntities, 2, 1, 1, 3)
95 114
        self.verticalLayout.addLayout(self.gridLayout)
96 115
        self.errorLabel = QtWidgets.QLabel(ImportTextFromCADDialog)
97 116
        self.errorLabel.setMaximumSize(QtCore.QSize(16777215, 0))
......
102 121
        self.verticalLayout.addWidget(self.errorLabel)
103 122

  
104 123
        self.retranslateUi(ImportTextFromCADDialog)
124
        self.tabWidgetEntities.setCurrentIndex(0)
105 125
        QtCore.QMetaObject.connectSlotsByName(ImportTextFromCADDialog)
106 126

  
107 127
    def retranslateUi(self, ImportTextFromCADDialog):
......
109 129
        ImportTextFromCADDialog.setWindowTitle(_translate("ImportTextFromCADDialog", "Import AutoCAD"))
110 130
        self.label.setText(_translate("ImportTextFromCADDialog", "Line Offset(x, y) : "))
111 131
        self.lineEditCAD.setPlaceholderText(_translate("ImportTextFromCADDialog", "Select AutoCAD File(s)"))
112
        self.pushButtonClose.setText(_translate("ImportTextFromCADDialog", "Close"))
113 132
        self.label_2.setText(_translate("ImportTextFromCADDialog", "AutoCAD Files : "))
133
        self.pushButtonClose.setText(_translate("ImportTextFromCADDialog", "Close"))
134
        self.pushButtonSave.setText(_translate("ImportTextFromCADDialog", "Save Mapping"))
114 135
        self.pushButtonImport.setText(_translate("ImportTextFromCADDialog", "Import"))
115 136
        self.label_3.setText(_translate("ImportTextFromCADDialog", "Text Offset(x, y, scale) : "))
116
        self.pushButtonSave.setText(_translate("ImportTextFromCADDialog", "Save Mapping"))
117

  
137
        self.tabWidgetEntities.setTabText(self.tabWidgetEntities.indexOf(self.tabLineTypes), _translate("ImportTextFromCADDialog", "Line Types"))
138
        self.tabWidgetEntities.setTabText(self.tabWidgetEntities.indexOf(self.tabSymbols), _translate("ImportTextFromCADDialog", "Symbols"))
118 139
import MainWindow_rc
119

  
120
if __name__ == "__main__":
121
    import sys
122
    app = QtWidgets.QApplication(sys.argv)
123
    ImportTextFromCADDialog = QtWidgets.QDialog()
124
    ui = Ui_ImportTextFromCADDialog()
125
    ui.setupUi(ImportTextFromCADDialog)
126
    ImportTextFromCADDialog.show()
127
    sys.exit(app.exec_())
128

  
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
62 62
        self.hasInstrumentLabel = 0
63 63
        self.flip = flip
64 64
        self.hit_ratio = None
65
        self._converted = False  # flag indicate whether symbol is converted or not
65 66
        # attributeType uid
66 67
        self.attribute = ''
67 68
        self._properties = {SymbolProp(None, 'Supplied By', 'String'): None}
......
118 119
        configs = app_doc_data.getConfigs('Symbol Style', 'Opacity')
119 120
        self.setOpacity(float(configs[0].value) / 100 if configs else 0.5)
120 121

  
122
    @property
123
    def converted(self):
124
        """return whethere symbol is converted or not"""
125
        return self._converted
126

  
127
    @converted.setter
128
    def converted(self, value):
129
        """set converted flag with given value"""
130
        self._converted = value
131

  
121 132
    def has_in_out_connector(self):
122 133
        """ return True if item has in or out connector """
123 134
        if len(self.in_out_connector[0]) > 0 and len(self.in_out_connector[1]) > 0:
......
1138 1149

  
1139 1150
        try:
1140 1151
            node = Element('SYMBOL')
1152
            node.attrib['Converted'] = str(self.converted)
1141 1153
            uidNode = Element('UID')
1142 1154
            uidNode.text = str(self.uid)
1143 1155
            node.append(uidNode)
......
1173 1185
            # up to here
1174 1186

  
1175 1187
            originNode = Element('ORIGINALPOINT')
1176
            origin = self.mapToScene(self.transformOriginPoint())
1177
            originNode.text = f"{origin.x()},{origin.y()}"
1188
            if not self.transformOriginPoint().isNull():
1189
                origin = self.mapToScene(self.transformOriginPoint())
1190
                originNode.text = f"{origin.x()},{origin.y()}"
1191
            else:
1192
                origin = self.origin
1193
                originNode.text = f"{origin[0]},{origin[1]}"
1178 1194
            node.append(originNode)
1179 1195

  
1180 1196
            connectorsNode = Element('CONNECTORS')
......
1256 1272

  
1257 1273
            node.append(attributesNode)
1258 1274

  
1259
            currentPointModeIndexNode = Element('CURRENTPOINTMODEINDEX')
1260
            currentPointModeIndexNode.text = str(self.currentPointModeIndex)
1261
            node.append(currentPointModeIndexNode)
1275
            if hasattr(self, 'currentPointModeIndex'):
1276
                currentPointModeIndexNode = Element('CURRENTPOINTMODEINDEX')
1277
                currentPointModeIndexNode.text = str(self.currentPointModeIndex) if self.currentPointModeIndex else ''
1278
                node.append(currentPointModeIndexNode)
1262 1279
        except Exception as ex:
1263 1280
            from App import App
1264
            message = 'error occurred({}) in {}:{}'.format(ex, sys.exc_info()[-1].tb_frame.f_code.co_filename,
1265
                                                          sys.exc_info()[-1].tb_lineno)
1281
            message = f'error occurred({ex}) in {sys.exc_info()[-1].tb_frame.f_code.co_filename}:' \
1282
                      f'{sys.exc_info()[-1].tb_lineno}'
1266 1283
            App.mainWnd().addMessage.emit(MessageType.Error, message)
1267 1284

  
1268 1285
            return None
......
1646 1663
    '''
1647 1664

  
1648 1665
    @staticmethod
1649
    def createItem(type, name, path, uid=None, owner=None, flip=0):
1666
    def createItem(type: str, name: str, path: str, uid=None, owner=None, flip=0):
1650 1667
        from QEngineeringOPCItem import QEngineeringOPCItem
1651 1668
        from EngineeringEquipmentItem import QEngineeringEquipmentItem
1652 1669
        from EngineeringInstrumentItem import QEngineeringInstrumentItem
DTI_PID/DTI_PID/UI/ImportTextFromCAD.ui
35 35
  <layout class="QVBoxLayout" name="verticalLayout">
36 36
   <item>
37 37
    <layout class="QGridLayout" name="gridLayout">
38
     <item row="2" column="2">
38
     <item row="3" column="2">
39 39
      <widget class="QSpinBox" name="spinBoxY">
40 40
       <property name="minimum">
41 41
        <number>-50000</number>
......
45 45
       </property>
46 46
      </widget>
47 47
     </item>
48
     <item row="2" column="1">
48
     <item row="3" column="1">
49 49
      <widget class="QSpinBox" name="spinBoxX">
50 50
       <property name="minimumSize">
51 51
        <size>
......
61 61
       </property>
62 62
      </widget>
63 63
     </item>
64
     <item row="2" column="0">
64
     <item row="3" column="0">
65 65
      <widget class="QLabel" name="label">
66 66
       <property name="text">
67 67
        <string>Line Offset(x, y) : </string>
68 68
       </property>
69 69
      </widget>
70 70
     </item>
71
     <item row="1" column="1" colspan="3">
72
      <widget class="QTreeView" name="treeViewLineType"/>
73
     </item>
74
     <item row="3" column="1" colspan="3">
71
     <item row="4" column="1" colspan="3">
75 72
      <layout class="QHBoxLayout" name="horizontalLayout">
76 73
       <item>
77 74
        <widget class="QSpinBox" name="spinBoxTextX">
......
109 106
       </property>
110 107
      </widget>
111 108
     </item>
109
     <item row="0" column="0">
110
      <widget class="QLabel" name="label_2">
111
       <property name="minimumSize">
112
        <size>
113
         <width>50</width>
114
         <height>0</height>
115
        </size>
116
       </property>
117
       <property name="text">
118
        <string>AutoCAD Files : </string>
119
       </property>
120
      </widget>
121
     </item>
112 122
     <item row="0" column="4">
113 123
      <widget class="QToolButton" name="toolButtonCAD">
114 124
       <property name="text">
......
120 130
       </property>
121 131
      </widget>
122 132
     </item>
123
     <item row="5" column="3">
133
     <item row="6" column="3">
124 134
      <widget class="QPushButton" name="pushButtonClose">
125 135
       <property name="text">
126 136
        <string>Close</string>
......
131 141
       </property>
132 142
      </widget>
133 143
     </item>
134
     <item row="0" column="0">
135
      <widget class="QLabel" name="label_2">
136
       <property name="minimumSize">
137
        <size>
138
         <width>50</width>
139
         <height>0</height>
140
        </size>
141
       </property>
144
     <item row="5" column="1" colspan="3">
145
      <widget class="QPushButton" name="pushButtonSave">
142 146
       <property name="text">
143
        <string>AutoCAD Files : </string>
147
        <string>Save Mapping</string>
148
       </property>
149
       <property name="icon">
150
        <iconset resource="../res/MainWindow.qrc">
151
         <normaloff>:/newPrefix/Save.svg</normaloff>:/newPrefix/Save.svg</iconset>
144 152
       </property>
145 153
      </widget>
146 154
     </item>
147
     <item row="5" column="2">
155
     <item row="6" column="2">
148 156
      <widget class="QPushButton" name="pushButtonImport">
149 157
       <property name="text">
150 158
        <string>Import</string>
......
155 163
       </property>
156 164
      </widget>
157 165
     </item>
158
     <item row="3" column="0">
166
     <item row="4" column="0">
159 167
      <widget class="QLabel" name="label_3">
160 168
       <property name="text">
161 169
        <string>Text Offset(x, y, scale) : </string>
162 170
       </property>
163 171
      </widget>
164 172
     </item>
165
     <item row="4" column="1" colspan="3">
166
      <widget class="QPushButton" name="pushButtonSave">
167
       <property name="text">
168
        <string>Save Mapping</string>
169
       </property>
170
       <property name="icon">
171
        <iconset resource="../res/MainWindow.qrc">
172
         <normaloff>:/newPrefix/Save.svg</normaloff>:/newPrefix/Save.svg</iconset>
173
       </property>
173
     <item row="2" column="1" colspan="3">
174
      <widget class="QTabWidget" name="tabWidgetEntities">
175
       <property name="currentIndex">
176
        <number>0</number>
177
       </property>
178
       <widget class="QWidget" name="tabLineTypes">
179
        <attribute name="title">
180
         <string>Line Types</string>
181
        </attribute>
182
        <layout class="QGridLayout" name="gridLayout_2">
183
         <item row="0" column="0">
184
          <widget class="QTreeView" name="treeViewLineType"/>
185
         </item>
186
        </layout>
187
       </widget>
188
       <widget class="QWidget" name="tabSymbols">
189
        <attribute name="title">
190
         <string>Symbols</string>
191
        </attribute>
192
        <layout class="QGridLayout" name="gridLayout_3">
193
         <item row="0" column="0">
194
          <widget class="QTreeView" name="treeViewSymbolMapping"/>
195
         </item>
196
        </layout>
197
       </widget>
174 198
      </widget>
175 199
     </item>
176 200
    </layout>
Doxyfile
1
# Doxyfile 1.9.0
2

  
3
# This file describes the settings to be used by the documentation system
4
# doxygen (www.doxygen.org) for a project.
5
#
6
# All text after a double hash (##) is considered a comment and is placed in
7
# front of the TAG it is preceding.
8
#
9
# All text after a single hash (#) is considered a comment and will be ignored.
10
# The format is:
11
# TAG = value [value, ...]
12
# For lists, items can also be appended using:
13
# TAG += value [value, ...]
14
# Values that contain spaces should be placed between quotes (\" \").
15

  
16
#---------------------------------------------------------------------------
17
# Project related configuration options
18
#---------------------------------------------------------------------------
19

  
20
# This tag specifies the encoding used for all characters in the configuration
21
# file that follow. The default is UTF-8 which is also the encoding used for all
22
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
23
# iconv built into libc) for the transcoding. See
24
# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
25
# The default value is: UTF-8.
26

  
27
DOXYFILE_ENCODING      = UTF-8
28

  
29
# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
30
# double-quotes, unless you are using Doxywizard) that should identify the
31
# project for which the documentation is generated. This name is used in the
32
# title of most generated pages and in a few other places.
33
# The default value is: My Project.
34

  
35
PROJECT_NAME           = ID2
36

  
37
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
38
# could be handy for archiving the generated documentation or if some version
39
# control system is used.
40

  
41
PROJECT_NUMBER         =
42

  
43
# Using the PROJECT_BRIEF tag one can provide an optional one line description
44
# for a project that appears at the top of each page and should give viewer a
45
# quick idea about the purpose of the project. Keep the description short.
46

  
47
PROJECT_BRIEF          =
48

  
49
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
50
# in the documentation. The maximum height of the logo should not exceed 55
51
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy
52
# the logo to the output directory.
53

  
54
PROJECT_LOGO           = ./ID2.ico
55

  
56
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
57
# into which the generated documentation will be written. If a relative path is
58
# entered, it will be relative to the location where doxygen was started. If
59
# left blank the current directory will be used.
60

  
61
OUTPUT_DIRECTORY       = C:\inetpub\wwwroot\Doxygen\ID2
62

  
63
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
64
# directories (in 2 levels) under the output directory of each output format and
65
# will distribute the generated files over these directories. Enabling this
66
# option can be useful when feeding doxygen a huge amount of source files, where
67
# putting all generated files in the same directory would otherwise causes
68
# performance problems for the file system.
69
# The default value is: NO.
70

  
71
CREATE_SUBDIRS         = NO
72

  
73
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
74
# characters to appear in the names of generated files. If set to NO, non-ASCII
75
# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
76
# U+3044.
77
# The default value is: NO.
78

  
79
ALLOW_UNICODE_NAMES    = NO
80

  
81
# The OUTPUT_LANGUAGE tag is used to specify the language in which all
82
# documentation generated by doxygen is written. Doxygen will use this
83
# information to generate all constant output in the proper language.
84
# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
85
# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
86
# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
87
# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
88
# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
89
# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
90
# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
91
# Ukrainian and Vietnamese.
92
# The default value is: English.
93

  
94
OUTPUT_LANGUAGE        = Korean
95

  
96
# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
97
# documentation generated by doxygen is written. Doxygen will use this
98
# information to generate all generated output in the proper direction.
99
# Possible values are: None, LTR, RTL and Context.
100
# The default value is: None.
101

  
102
OUTPUT_TEXT_DIRECTION  = None
103

  
104
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
105
# descriptions after the members that are listed in the file and class
106
# documentation (similar to Javadoc). Set to NO to disable this.
107
# The default value is: YES.
108

  
109
BRIEF_MEMBER_DESC      = YES
110

  
111
# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
112
# description of a member or function before the detailed description
113
#
114
# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
115
# brief descriptions will be completely suppressed.
116
# The default value is: YES.
117

  
118
REPEAT_BRIEF           = YES
119

  
120
# This tag implements a quasi-intelligent brief description abbreviator that is
121
# used to form the text in various listings. Each string in this list, if found
122
# as the leading text of the brief description, will be stripped from the text
123
# and the result, after processing the whole list, is used as the annotated
124
# text. Otherwise, the brief description is used as-is. If left blank, the
125
# following values are used ($name is automatically replaced with the name of
126
# the entity):The $name class, The $name widget, The $name file, is, provides,
127
# specifies, contains, represents, a, an and the.
128

  
129
ABBREVIATE_BRIEF       = "The $name class" \
130
                         "The $name widget" \
131
                         "The $name file" \
132
                         is \
133
                         provides \
134
                         specifies \
135
                         contains \
136
                         represents \
137
                         a \
138
                         an \
139
                         the
140

  
141
# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
142
# doxygen will generate a detailed section even if there is only a brief
143
# description.
144
# The default value is: NO.
145

  
146
ALWAYS_DETAILED_SEC    = NO
147

  
148
# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
149
# inherited members of a class in the documentation of that class as if those
150
# members were ordinary class members. Constructors, destructors and assignment
151
# operators of the base classes will not be shown.
152
# The default value is: NO.
153

  
154
INLINE_INHERITED_MEMB  = NO
155

  
156
# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path
157
# before files name in the file list and in the header files. If set to NO the
158
# shortest path that makes the file name unique will be used
159
# The default value is: YES.
160

  
161
FULL_PATH_NAMES        = YES
162

  
163
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
164
# Stripping is only done if one of the specified strings matches the left-hand
165
# part of the path. The tag can be used to show relative paths in the file list.
166
# If left blank the directory from which doxygen is run is used as the path to
167
# strip.
168
#
169
# Note that you can specify absolute paths here, but also relative paths, which
170
# will be relative from the directory where doxygen is started.
171
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
172

  
173
STRIP_FROM_PATH        =
174

  
175
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
176
# path mentioned in the documentation of a class, which tells the reader which
177
# header file to include in order to use a class. If left blank only the name of
178
# the header file containing the class definition is used. Otherwise one should
179
# specify the list of include paths that are normally passed to the compiler
180
# using the -I flag.
181

  
182
STRIP_FROM_INC_PATH    =
183

  
184
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
185
# less readable) file names. This can be useful is your file systems doesn't
186
# support long names like on DOS, Mac, or CD-ROM.
187
# The default value is: NO.
188

  
189
SHORT_NAMES            = NO
190

  
191
# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
192
# first line (until the first dot) of a Javadoc-style comment as the brief
193
# description. If set to NO, the Javadoc-style will behave just like regular Qt-
194
# style comments (thus requiring an explicit @brief command for a brief
195
# description.)
196
# The default value is: NO.
197

  
198
JAVADOC_AUTOBRIEF      = NO
199

  
200
# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
201
# such as
202
# /***************
203
# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
204
# Javadoc-style will behave just like regular comments and it will not be
205
# interpreted by doxygen.
206
# The default value is: NO.
207

  
208
JAVADOC_BANNER         = NO
209

  
210
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
211
# line (until the first dot) of a Qt-style comment as the brief description. If
212
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
213
# requiring an explicit \brief command for a brief description.)
214
# The default value is: NO.
215

  
216
QT_AUTOBRIEF           = NO
217

  
218
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
219
# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
220
# a brief description. This used to be the default behavior. The new default is
221
# to treat a multi-line C++ comment block as a detailed description. Set this
222
# tag to YES if you prefer the old behavior instead.
223
#
224
# Note that setting this tag to YES also means that rational rose comments are
225
# not recognized any more.
226
# The default value is: NO.
227

  
228
MULTILINE_CPP_IS_BRIEF = NO
229

  
230
# By default Python docstrings are displayed as preformatted text and doxygen's
231
# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the
232
# doxygen's special commands can be used and the contents of the docstring
233
# documentation blocks is shown as doxygen documentation.
234
# The default value is: YES.
235

  
236
PYTHON_DOCSTRING       = YES
237

  
238
# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
239
# documentation from any documented member that it re-implements.
240
# The default value is: YES.
241

  
242
INHERIT_DOCS           = YES
243

  
244
# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
245
# page for each member. If set to NO, the documentation of a member will be part
246
# of the file/class/namespace that contains it.
247
# The default value is: NO.
248

  
249
SEPARATE_MEMBER_PAGES  = NO
250

  
251
# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
252
# uses this value to replace tabs by spaces in code fragments.
253
# Minimum value: 1, maximum value: 16, default value: 4.
254

  
255
TAB_SIZE               = 4
256

  
257
# This tag can be used to specify a number of aliases that act as commands in
258
# the documentation. An alias has the form:
259
# name=value
260
# For example adding
261
# "sideeffect=@par Side Effects:\n"
262
# will allow you to put the command \sideeffect (or @sideeffect) in the
263
# documentation, which will result in a user-defined paragraph with heading
264
# "Side Effects:". You can put \n's in the value part of an alias to insert
265
# newlines (in the resulting output). You can put ^^ in the value part of an
266
# alias to insert a newline as if a physical newline was in the original file.
267
# When you need a literal { or } or , in the value part of an alias you have to
268
# escape them by means of a backslash (\), this can lead to conflicts with the
269
# commands \{ and \} for these it is advised to use the version @{ and @} or use
270
# a double escape (\\{ and \\})
271

  
272
ALIASES                =
273

  
274
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
275
# only. Doxygen will then generate output that is more tailored for C. For
276
# instance, some of the names that are used will be different. The list of all
277
# members will be omitted, etc.
278
# The default value is: NO.
279

  
280
OPTIMIZE_OUTPUT_FOR_C  = NO
281

  
282
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
283
# Python sources only. Doxygen will then generate output that is more tailored
284
# for that language. For instance, namespaces will be presented as packages,
285
# qualified scopes will look different, etc.
286
# The default value is: NO.
287

  
288
OPTIMIZE_OUTPUT_JAVA   = NO
289

  
290
# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
291
# sources. Doxygen will then generate output that is tailored for Fortran.
292
# The default value is: NO.
293

  
294
OPTIMIZE_FOR_FORTRAN   = NO
295

  
296
# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
297
# sources. Doxygen will then generate output that is tailored for VHDL.
298
# The default value is: NO.
299

  
300
OPTIMIZE_OUTPUT_VHDL   = NO
301

  
302
# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
303
# sources only. Doxygen will then generate output that is more tailored for that
304
# language. For instance, namespaces will be presented as modules, types will be
305
# separated into more groups, etc.
306
# The default value is: NO.
307

  
308
OPTIMIZE_OUTPUT_SLICE  = NO
309

  
310
# Doxygen selects the parser to use depending on the extension of the files it
311
# parses. With this tag you can assign which parser to use for a given
312
# extension. Doxygen has a built-in mapping, but you can override or extend it
313
# using this tag. The format is ext=language, where ext is a file extension, and
314
# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
315
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL,
316
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
317
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
318
# tries to guess whether the code is fixed or free formatted code, this is the
319
# default for Fortran type files). For instance to make doxygen treat .inc files
320
# as Fortran files (default is PHP), and .f files as C (default is Fortran),
321
# use: inc=Fortran f=C.
322
#
323
# Note: For files without extension you can use no_extension as a placeholder.
324
#
325
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
326
# the files are not read by doxygen. When specifying no_extension you should add
327
# * to the FILE_PATTERNS.
328
#
329
# Note see also the list of default file extension mappings.
330

  
331
EXTENSION_MAPPING      =
332

  
333
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
334
# according to the Markdown format, which allows for more readable
335
# documentation. See https://daringfireball.net/projects/markdown/ for details.
336
# The output of markdown processing is further processed by doxygen, so you can
337
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
338
# case of backward compatibilities issues.
339
# The default value is: YES.
340

  
341
MARKDOWN_SUPPORT       = YES
342

  
343
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
344
# to that level are automatically included in the table of contents, even if
345
# they do not have an id attribute.
346
# Note: This feature currently applies only to Markdown headings.
347
# Minimum value: 0, maximum value: 99, default value: 5.
348
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
349

  
350
TOC_INCLUDE_HEADINGS   = 5
351

  
352
# When enabled doxygen tries to link words that correspond to documented
353
# classes, or namespaces to their corresponding documentation. Such a link can
354
# be prevented in individual cases by putting a % sign in front of the word or
355
# globally by setting AUTOLINK_SUPPORT to NO.
356
# The default value is: YES.
357

  
358
AUTOLINK_SUPPORT       = YES
359

  
360
# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
361
# to include (a tag file for) the STL sources as input, then you should set this
362
# tag to YES in order to let doxygen match functions declarations and
363
# definitions whose arguments contain STL classes (e.g. func(std::string);
364
# versus func(std::string) {}). This also make the inheritance and collaboration
365
# diagrams that involve STL classes more complete and accurate.
366
# The default value is: NO.
367

  
368
BUILTIN_STL_SUPPORT    = NO
369

  
370
# If you use Microsoft's C++/CLI language, you should set this option to YES to
371
# enable parsing support.
372
# The default value is: NO.
373

  
374
CPP_CLI_SUPPORT        = NO
375

  
376
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
377
# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
378
# will parse them like normal C++ but will assume all classes use public instead
379
# of private inheritance when no explicit protection keyword is present.
380
# The default value is: NO.
381

  
382
SIP_SUPPORT            = NO
383

  
384
# For Microsoft's IDL there are propget and propput attributes to indicate
385
# getter and setter methods for a property. Setting this option to YES will make
386
# doxygen to replace the get and set methods by a property in the documentation.
387
# This will only work if the methods are indeed getting or setting a simple
388
# type. If this is not the case, or you want to show the methods anyway, you
389
# should set this option to NO.
390
# The default value is: YES.
391

  
392
IDL_PROPERTY_SUPPORT   = YES
393

  
394
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
395
# tag is set to YES then doxygen will reuse the documentation of the first
396
# member in the group (if any) for the other members of the group. By default
397
# all members of a group must be documented explicitly.
398
# The default value is: NO.
399

  
400
DISTRIBUTE_GROUP_DOC   = NO
401

  
402
# If one adds a struct or class to a group and this option is enabled, then also
403
# any nested class or struct is added to the same group. By default this option
404
# is disabled and one has to add nested compounds explicitly via \ingroup.
405
# The default value is: NO.
406

  
407
GROUP_NESTED_COMPOUNDS = NO
408

  
409
# Set the SUBGROUPING tag to YES to allow class member groups of the same type
410
# (for instance a group of public functions) to be put as a subgroup of that
411
# type (e.g. under the Public Functions section). Set it to NO to prevent
412
# subgrouping. Alternatively, this can be done per class using the
413
# \nosubgrouping command.
414
# The default value is: YES.
415

  
416
SUBGROUPING            = YES
417

  
418
# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
419
# are shown inside the group in which they are included (e.g. using \ingroup)
420
# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
421
# and RTF).
422
#
423
# Note that this feature does not work in combination with
424
# SEPARATE_MEMBER_PAGES.
425
# The default value is: NO.
426

  
427
INLINE_GROUPED_CLASSES = NO
428

  
429
# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
430
# with only public data fields or simple typedef fields will be shown inline in
431
# the documentation of the scope in which they are defined (i.e. file,
432
# namespace, or group documentation), provided this scope is documented. If set
433
# to NO, structs, classes, and unions are shown on a separate page (for HTML and
434
# Man pages) or section (for LaTeX and RTF).
435
# The default value is: NO.
436

  
437
INLINE_SIMPLE_STRUCTS  = NO
438

  
439
# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
440
# enum is documented as struct, union, or enum with the name of the typedef. So
441
# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
442
# with name TypeT. When disabled the typedef will appear as a member of a file,
443
# namespace, or class. And the struct will be named TypeS. This can typically be
444
# useful for C code in case the coding convention dictates that all compound
445
# types are typedef'ed and only the typedef is referenced, never the tag name.
446
# The default value is: NO.
447

  
448
TYPEDEF_HIDES_STRUCT   = NO
449

  
450
# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
451
# cache is used to resolve symbols given their name and scope. Since this can be
452
# an expensive process and often the same symbol appears multiple times in the
453
# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
454
# doxygen will become slower. If the cache is too large, memory is wasted. The
455
# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
456
# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
457
# symbols. At the end of a run doxygen will report the cache usage and suggest
458
# the optimal cache size from a speed point of view.
459
# Minimum value: 0, maximum value: 9, default value: 0.
460

  
461
LOOKUP_CACHE_SIZE      = 0
462

  
463
# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use
464
# during processing. When set to 0 doxygen will based this on the number of
465
# cores available in the system. You can set it explicitly to a value larger
466
# than 0 to get more control over the balance between CPU load and processing
467
# speed. At this moment only the input processing can be done using multiple
468
# threads. Since this is still an experimental feature the default is set to 1,
469
# which efficively disables parallel processing. Please report any issues you
470
# encounter. Generating dot graphs in parallel is controlled by the
471
# DOT_NUM_THREADS setting.
472
# Minimum value: 0, maximum value: 32, default value: 1.
473

  
474
NUM_PROC_THREADS       = 1
475

  
476
#---------------------------------------------------------------------------
477
# Build related configuration options
478
#---------------------------------------------------------------------------
479

  
480
# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in
481
# documentation are documented, even if no documentation was available. Private
482
# class members and static file members will be hidden unless the
483
# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
484
# Note: This will also disable the warnings about undocumented members that are
485
# normally produced when WARNINGS is set to YES.
486
# The default value is: NO.
487

  
488
EXTRACT_ALL            = YES
489

  
490
# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will
491
# be included in the documentation.
492
# The default value is: NO.
493

  
494
EXTRACT_PRIVATE        = NO
495

  
496
# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
497
# methods of a class will be included in the documentation.
498
# The default value is: NO.
499

  
500
EXTRACT_PRIV_VIRTUAL   = NO
501

  
502
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
503
# scope will be included in the documentation.
504
# The default value is: NO.
505

  
506
EXTRACT_PACKAGE        = NO
507

  
508
# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
509
# included in the documentation.
510
# The default value is: NO.
511

  
512
EXTRACT_STATIC         = NO
513

  
514
# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
515
# locally in source files will be included in the documentation. If set to NO,
516
# only classes defined in header files are included. Does not have any effect
517
# for Java sources.
518
# The default value is: YES.
519

  
520
EXTRACT_LOCAL_CLASSES  = YES
521

  
522
# This flag is only useful for Objective-C code. If set to YES, local methods,
523
# which are defined in the implementation section but not in the interface are
524
# included in the documentation. If set to NO, only methods in the interface are
525
# included.
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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