프로젝트

일반

사용자정보

개정판 cf391d75

IDcf391d7548bb83c71bea94f7c08a690607ed38a6
상위 eb21c6d5
하위 1fc1d77a, 2d0ab83b

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

issue #477: add connection in_out and break attribute

Change-Id: Ibb0aa3cbb70e9e0af68b80de73c3bb5df25b5ba2

차이점 보기:

DTI_PID/DTI_PID/LineNoTracer.py
697 697
        fixed_run = []
698 698
        waiting_run = []
699 699
        runs = []
700
        # first step : make fixed run using opc
700 701
        for lineNo in [lineNo for lineNo in docdata.tracerLineNos if len(lineNo.runs) > 0]:
701 702
            not_trim = True if type(lineNo) is QEngineeringLineNoTextItem else False
702 703
            run_index = 0
......
725 726
                    waiting_run.append([run, lineNo, not_trim, not_secondary])
726 727
                run_index += 1
727 728

  
729
        # second step : determine waiting run flow
730
        
731

  
728 732
        # trace special item
729 733
        worker.displayMessage.emit('Find line for special item...')
730 734
        tracer = SpecialItemTracer([item for item in worker.graphicsView.scene.items() if (type(item) is SymbolSvgItem or type(item) is QEngineeringTextItem) and item.special_item_type], lines)
DTI_PID/DTI_PID/RecognitionDialog.py
872 872
                            cpx = sow - float(tokens[1])
873 873
                            cpy = float(tokens[2])
874 874
                            cflip = direction + ',' + str(cpx) + ',' + str(cpy)
875
                        elif len(tokens) == 4:
875
                        elif len(tokens) >= 4:
876 876
                            direction = tokens[0]
877 877
                            cpx = sow - float(tokens[1])
878 878
                            cpy = float(tokens[2])
......
1305 1305
                    direction = tokens[0]
1306 1306
                    cpx = float(tokens[1])
1307 1307
                    cpy = float(tokens[2])
1308
                elif len(tokens) == 4:
1308
                elif len(tokens) >= 4:
1309 1309
                    direction = tokens[0]
1310 1310
                    cpx = float(tokens[1])
1311 1311
                    cpy = float(tokens[2])
DTI_PID/DTI_PID/Shapes/SymbolSvgItem.py
70 70

  
71 71
        self._angle = 0
72 72

  
73
        self.in_out_connector = [[], []] # 0 : in, 1 : out
74
        self.break_connector = []
75

  
73 76
        try:
74 77
            f = QFile(path)
75 78
            f.open(QIODevice.ReadOnly)
......
591 594
                    x = float(tokens[1])
592 595
                    y = float(tokens[2])
593 596
                    symbol_idx = tokens[3]
597
                elif len(tokens) > 4:
598
                    direction = tokens[0]
599
                    x = float(tokens[1])
600
                    y = float(tokens[2])
601
                    symbol_idx = tokens[3]
602
                    if tokens[4] == 'In':
603
                        self.in_out_connector[0].append(index)
604
                    elif tokens[4] == 'Out':
605
                        self.in_out_connector[1].append(index)
606
                    if tokens[5] == 'O':
607
                        self.break_connector.append(index)
594 608

  
595 609
                self.setConnector(index + 1)
596 610
                self.connectors[index].direction = direction
DTI_PID/DTI_PID/SymbolEditorDialog.py
43 43
            self.project = project
44 44
            self.ui = SymbolEditor_UI.Ui_Dialog()
45 45
            self.ui.setupUi(self)
46
            self.ui.tableWidgetConnList.setColumnCount(3)
47
            self.ui.tableWidgetConnList.setHorizontalHeaderLabels([self.tr('위치'), self.tr('방향'), self.tr('심볼')])
46
            self.ui.tableWidgetConnList.setColumnCount(5)
47
            self.ui.tableWidgetConnList.setHorizontalHeaderLabels([self.tr('Position'), self.tr('Direction'), self.tr('Symbol'), self.tr('In_out'), self.tr('Break')])
48 48
            self.ui.tableWidgetConnList.horizontalHeaderItem(0).setSizeHint(QSize(25, 25))
49 49
            self.ui.tableWidgetConnList.itemPressed.connect(self.onConnPtPressed)
50 50

  
......
301 301
                    for conString in splitConnectionPointList: # conString : x,y
302 302
                        direction = 'AUTO'
303 303
                        symbol_idx = '0'
304
                        in_out = 'None'
305
                        break_or_not = 'X'
304 306
                        tokens = conString.split(',')
305 307
                        if len(tokens) == 4:
306 308
                            direction = tokens[0]
307 309
                            x = tokens[1]
308 310
                            y = tokens[2]
309 311
                            symbol_idx = tokens[3]
310
                        if len(tokens) == 3:
312
                        elif len(tokens) == 3:
311 313
                            direction = tokens[0]
312 314
                            x = tokens[1]
313 315
                            y = tokens[2]
314 316
                        elif len(tokens) == 2:
315 317
                            x = tokens[0]
316 318
                            y = tokens[1]
319
                        elif len(tokens) > 4:
320
                            direction = tokens[0]
321
                            x = float(tokens[1])
322
                            y = float(tokens[2])
323
                            symbol_idx = tokens[3]
324
                            in_out = tokens[4]
325
                            break_or_not = tokens[5]
317 326

  
318 327
                        conn = ConnectionPointCommand.ConnectionPointCommand.drawCircle(self.ui.imageView, x, y, self.conn_index)
319 328
                        self.conn_index += 1
......
338 347
                        self.ui.tableWidgetConnList.setCellWidget(row, 2, symbol_idx_combobox)
339 348
                        # up to here
340 349

  
350
                        in_out_ComboBox = QComboBox(self.ui.tableWidgetConnList)
351
                        in_out_ComboBox.addItems(['None', 'In', 'Out'])
352
                        in_out_ComboBox.setCurrentText(in_out)
353
                        self.ui.tableWidgetConnList.setCellWidget(row, 3, in_out_ComboBox)
354

  
355
                        break_ComboBox = QComboBox(self.ui.tableWidgetConnList)
356
                        break_ComboBox.addItems(['O', 'X'])
357
                        break_ComboBox.setCurrentText(break_or_not)
358
                        self.ui.tableWidgetConnList.setCellWidget(row, 4, break_ComboBox)
359

  
341 360
                        row = row + 1
342 361

  
343 362
                        self.ui.tableWidgetConnList.resizeColumnsToContents()
......
495 514
        for row in range(self.ui.tableWidgetConnList.rowCount()):
496 515
            direction = self.ui.tableWidgetConnList.cellWidget(row, 1).currentText()
497 516
            symbol_idx = self.ui.tableWidgetConnList.cellWidget(row, 2).currentText()
517
            in_out = self.ui.tableWidgetConnList.cellWidget(row, 3).currentText()
518
            break_or_not = self.ui.tableWidgetConnList.cellWidget(row, 4).currentText()
498 519

  
499
            connPtString = '{},{},{}'.format(direction, self.ui.tableWidgetConnList.item(row, 0).text(), symbol_idx)
520
            connPtString = '{},{},{},{},{}'.format(direction, self.ui.tableWidgetConnList.item(row, 0).text(), symbol_idx, in_out, break_or_not)
500 521
            connPtStringList.append(connPtString)
501 522

  
502 523
        res = '/'.join(connPtStringList)

내보내기 Unified diff

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