프로젝트

일반

사용자정보

개정판 ade19289

IDade192899ebf3a29033342d37d313d954d8ccaa7
상위 80696a97
하위 95ba36bc

김정우 이(가) 약 7년 전에 추가함

SymbolBase.getPath() 관련 이전 주석 제거 / xmlGenerator 부분 중 additionalSymbol 노드 변환 코드 삭제

차이점 보기:

DTI_PID/DTI_PID/DTI_PID.py
296 296
    symbolName = targetSymbol.getName()
297 297
    symbolType = targetSymbol.getType()
298 298
    symbolPath = targetSymbol.getPath()
299
    #symbolPath = AppDocData.instance().getCurrentProject().getPath() + "/image/" + symbolName + ".png"
300
    #symbolPath = os.path.dirname(os.path.realpath(__file__)) + "/image/" + symbolName
301 299
    symbolThreshold = targetSymbol.getThreshold()
302 300
    symbolMinMatchCount = targetSymbol.getMinMatchCount()
303 301
    isDetectOnOrigin = targetSymbol.getIsDetectOnOrigin()
......
493 491
    global threadLock
494 492
    
495 493
    path = sym.getPath()
496
    #path = AppDocData.instance().getCurrentProject().getPath() + "/image/" + sym.getName() + ".png"
497 494
    sp = sym.getSp()
498 495
    sw = sym.getWidth()
499 496
    sh = sym.getHeight()
......
519 516
    global ocrCompletedSrc
520 517
    
521 518
    path = sym.getPath()
522
    #path = AppDocData.instance().getCurrentProject().getPath() + "/image/" + sym.getName() + ".png"
523 519
    sp = sym.getSp()
524 520
    sw = sym.getWidth()
525 521
    sh = sym.getHeight()
......
537 533

  
538 534
    symbolId = symbol.getId()
539 535
    symbolPath = symbol.getPath()
540
    #symbolPath = AppDocData.instance().getCurrentProject().getPath() + "/image/" + symbol.getName() + ".png"
541 536
    symbolSp = symbol.getSp()
542 537
    symbolWidth = symbol.getWidth()
543 538
    symbolHeight = symbol.getHeight()
......
690 685
def drawTempLine(sym):
691 686
    ADJUST = 8
692 687
    symPath = sym.getPath()
693
    #symPath = AppDocData.instance().getCurrentProject().getPath() + "/image/" + sym.getName() + ".png"
694 688
    symSp = sym.getSp()
695 689
    symWidth = sym.getWidth()
696 690
    symHeight = sym.getHeight()
DTI_PID/DTI_PID/QDirTreeWidget.py
119 119
        sym = self.getSymbolByItemName(item, columnNo)
120 120
        if sym is not None:
121 121
            path = sym.getPath()
122
            #path = AppDocData.instance().getCurrentProject().getPath() + "/image/" + sym.getName() + ".png"
123 122
            image = QImage(path, "PNG")
124 123
            print("after image")
125 124
            symbolEditorDialog = QSymbolEditorDialog.QSymbolEditorDialog(self, image, AppDocData.instance().getCurrentProject(), sym)
DTI_PID/DTI_PID/QPropertyTableWidget.py
96 96
            self.setItem(0,     1,   QTableWidgetItem(str(self.symData.getId())))
97 97
            self.setItem(1,     1,   QTableWidgetItem(self.symData.getName()))
98 98
            self.setItem(2,     1,   QTableWidgetItem(self.symData.getPath()))
99
            #self.setItem(2,     1,   QTableWidgetItem(AppDocData.instance().getCurrentProject().getPath() + "/image/" + self.symData.getName() + ".png"))
100 99
            self.setItem(3,     1,   QTableWidgetItem(str(int(self.symData.getThreshold() * 100))))
101 100
            self.setItem(4,     1,   QTableWidgetItem(str(self.symData.getMinMatchCount())))
102 101

  
DTI_PID/DTI_PID/QSymbolEditorDialog.py
219 219
            fileName = name
220 220
        else:
221 221
            fileName = self.makeFileName(name, name)
222
        path = self.project.getPath() + "/image/" + fileName + ".png"
222
        #path = self.project.getPath() + "/image/" + fileName + ".png"
223 223
        threshold = self.ui.thresholdLineEdit.text()
224 224
        minMatchPoint = self.ui.minMatchPointLineEdit.text()
225 225
        isDetectOnOrigin = self.ui.isOriginDetectComboBox.currentData()
......
233 233

  
234 234
        convertedThreshold = int(threshold) / 100.0
235 235

  
236
        newSym = symbol.SymbolBase(int(symId), fileName, type, path, convertedThreshold, int(minMatchPoint), isDetectOnOrigin
236
        newSym = symbol.SymbolBase(int(symId), fileName, type, convertedThreshold, int(minMatchPoint), isDetectOnOrigin
237 237
                                   , rotationCount, ocrOption, isContainChild, originalPoint, connectionPoint, baseSymbol, additionalSymbol, uid)
238 238

  
239 239
        return newSym
DTI_PID/DTI_PID/SG_DbHelper.py
50 50
    
51 51
    INSERT_SYMBOL_SQL = '''
52 52
        INSERT INTO Symbol(symId, name, type, threshold, minMatchPoint, isDetectOrigin, rotationCount, ocrOption, isContainChild, originalPoint, connectionPoint, baseSymbol, additionalSymbol) 
53
        VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
53
        VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
54 54
    '''
55 55
    #INSERT_SYMBOL_SQL = '''
56 56
    #    INSERT INTO Symbol(symId, name, type, path, threshold, minMatchPoint, isDetectOrigin, rotationCount, ocrOption, isContainChild, originalPoint, connectionPoint, baseSymbol, additionalSymbol) 
......
142 142
                           , symbol.getOcrOption(), symbol.getIsContainChild()
143 143
                           , symbol.getOriginalPoint(), symbol.getConnectionPoint()
144 144
                           , symbol.getBaseSymbol(), symbol.getAdditionalSymbol())
145
            #query = (symbol.getId(), symbol.getName(), symbol.getType(), symbol.getPath(), symbol.getThreshold()
146
            #               , symbol.getMinMatchCount(), symbol.getIsDetectOnOrigin(), symbol.getRotationCount()
147
            #               , symbol.getOcrOption(), symbol.getIsContainChild()
148
            #               , symbol.getOriginalPoint(), symbol.getConnectionPoint()
149
            #               , symbol.getBaseSymbol(), symbol.getAdditionalSymbol())
150 145
            cursor.execute(self.INSERT_SYMBOL_SQL, query)
151 146
            conn.commit()
152 147
            isAdded = True
......
167 162
                           , symbol.getOcrOption(), symbol.getIsContainChild()
168 163
                           , symbol.getOriginalPoint(), symbol.getConnectionPoint()
169 164
                           , symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getUid())
170
            #query = (symbol.getId(), symbol.getName(), symbol.getType(), symbol.getPath(), symbol.getThreshold()
171
            #               , symbol.getMinMatchCount(), symbol.getIsDetectOnOrigin(), symbol.getRotationCount()
172
            #               , symbol.getOcrOption(), symbol.getIsContainChild()
173
            #               , symbol.getOriginalPoint(), symbol.getConnectionPoint()
174
            #               , symbol.getBaseSymbol(), symbol.getAdditionalSymbol(), symbol.getUid())
175 165
            cursor.execute(self.UPDATE_SYMBOL_SQL, query)
176 166
            conn.commit()
177 167
            isUpdated = True
DTI_PID/DTI_PID/XmlGenerator.py
82 82

  
83 83
    return xml
84 84

  
85
def getConvertedChildInfo(childInfo):
86
    ret = ''
87
    childList = childInfo.split("/")
88
    for index in range(len(childList)):
89
        child = childList[index]
90
        #direction = int(child.split(",")[0])
91
        direction = child.split(",")[0]
92
        childName = child.split(",")[1]
93
        if index != 0:
94
            ret = ret + "/"
95
        #directionCode = getDirectionCode(direction)
96
        #ret = ret + directionCode + "," + childName
97
        ret = ret + direction + "," + childName
98
    return ret
85
#def getConvertedChildInfo(childInfo):
86
#    ret = ''
87
#    childList = childInfo.split("/")
88
#    for index in range(len(childList)):
89
#        child = childList[index]
90
#        #direction = int(child.split(",")[0])
91
#        direction = child.split(",")[0]
92
#        childName = child.split(",")[1]
93
#        if index != 0:
94
#            ret = ret + "/"
95
#        #directionCode = getDirectionCode(direction)
96
#        #ret = ret + directionCode + "," + childName
97
#        ret = ret + direction + "," + childName
98
#    return ret
99 99

  
100 100
#def getDirectionCode(direction):
101 101
#    ret = ""
......
149 149

  
150 150
    if sAdditionalSymbol is not None:
151 151
        sAdditionalSymbolNode = Element(SSUB_CHILD)
152
        sAdditionalSymbolNode.text = getConvertedChildInfo(sAdditionalSymbol)
152
        sAdditionalSymbolNode.text = sAdditionalSymbol
153
        #sAdditionalSymbolNode.text = getConvertedChildInfo(sAdditionalSymbol)
153 154
        sCategoryNode.append(sAdditionalSymbolNode)
154 155

  
155 156
    sAngleNode = Element(SSUB_ANGLE)

내보내기 Unified diff

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