프로젝트

일반

사용자정보

개정판 66a0f7c9

ID66a0f7c985e7f72dddfe01342f0e6375b9d9b77e
상위 cb647869
하위 10d046ef, f46d52a9

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

drawing open optimize

Change-Id: Ife1288204719a6bc2b65ff95fa3aa9ad97d580dc

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringLineNoTextItem.py
452 452
            textInfo = TextInfo(text, x, y, width, height, angle)
453 453
            connline = node.find('CONNLINE').text if node.find('CONNLINE') is not None else None
454 454

  
455
            item = TextItemFactory.instance().createTextItem(textInfo)
455
            matches = [prop_node for prop_node in node.iter('PROPERTY') if prop_node.attrib['Attribute'] == 'Config']
456
            if matches:
457
                item = TextItemFactory.instance().createTextItem(textInfo, matches[0].text)
458
            else:
459
                item = TextItemFactory.instance().createTextItem(textInfo)
460

  
456 461
            if item is not None:
457 462
                item.setVisible(False)
458 463
                for prop_node in node.iter('PROPERTY'):
......
511 516
        from SymbolSvgItem import SymbolSvgItem
512 517

  
513 518
        try:
514
            docData = AppDocData.instance()
515
            configs = docData.getConfigs('Line No', 'Delimiter')
516
            delimiter = configs[0].value if 1 == len(configs) else '-'
517
            lineNoconfigs = docData.getConfigs('Line No', 'Configuration')
519
            #docData = AppDocData.instance()
520
            #configs = docData.getConfigs('Line No', 'Delimiter')
521
            #delimiter = configs[0].value if 1 == len(configs) else '-'
522
            #lineNoconfigs = docData.getConfigs('Line No', 'Configuration')
518 523

  
519 524
            node = Element('LINE_NO')
520 525
            uidNode = Element('UID')
DTI_PID/DTI_PID/TextItemFactory.py
44 44
                    euisung 2018.11.19  now textitemfactory set plain text in createTextItem() for allowables
45 45
    '''
46 46

  
47
    def createTextItem(self, textInfo):
47
    def createTextItem(self, textInfo, lineNoConfig=None):
48 48
        from Configs import LineNoConfig, TagNoConfig
49 49
        import csv
50 50

  
......
61 61
            # check is line no
62 62
            line_no_configs = LineNoConfig.instance()
63 63
            if line_no_configs:
64
                for line_no_config in line_no_configs:
65
                    result = line_no_config.parse(text)
66
                    if result[0]:
67
                        sizeUnit = line_no_config.unit
68
                        _no_config = line_no_config.value
69
                        break
64
                if not lineNoConfig:
65
                    for line_no_config in line_no_configs:
66
                        result = line_no_config.parse(text)
67
                        if result[0]:
68
                            sizeUnit = line_no_config.unit
69
                            _no_config = line_no_config.value
70
                            break
71
                else:
72
                    matches = [line for line in line_no_configs if lineNoConfig in line.value]
73
                    if matches:
74
                        result = matches[0].parse(text)
75
                        if result[0]:
76
                            sizeUnit = matches[0].unit
77
                            _no_config = matches[0].value
78
                        else:
79
                            for line_no_config in line_no_configs:
80
                                result = line_no_config.parse(text)
81
                                if result[0]:
82
                                    sizeUnit = line_no_config.unit
83
                                    _no_config = line_no_config.value
84
                                    break
85
                    else:
86
                        for line_no_config in line_no_configs:
87
                            result = line_no_config.parse(text)
88
                            if result[0]:
89
                                sizeUnit = line_no_config.unit
90
                                _no_config = line_no_config.value
91
                                break
70 92
            else:
71 93
                result = (False,)
72 94

  

내보내기 Unified diff

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