프로젝트

일반

사용자정보

개정판 eed69765

IDeed697652f84251f03250233355c066532419820
상위 67a46a0c
하위 ff096d3a, 987d8d73

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

issue #503: before db and item attr

Change-Id: I73fa74c9751f1b82250d4b479d5da8555ef7681e

차이점 보기:

DTI_PID/DTI_PID/LineNoTracer.py
28 28
    '''
29 29
        @history    2018.04.26 Jeongwoo Variable name changed (texts → lineNos)
30 30
    '''
31
    def __init__(self, symbols, lines, lineNos, specBreak, lineIndicator):
31
    def __init__(self, symbols, lines, lineNos, specBreak, lineIndicator, vendor):
32 32
        try:
33 33
            self._symbols = symbols
34 34
            #for symbol in self._symbols: symbol.owner = None
......
38 38
            self._specBreak = specBreak
39 39
            self._specBreakUID = []
40 40
            self._lineIndicator = lineIndicator
41
            self._vendor = vendor
41 42
            
42 43
            for spec in self._specBreak:
43 44
                for attr in spec.attrs:
......
301 302

  
302 303
                    docData.tracerLineNos.append(trimLineNo)
303 304
            """
305
            # vendor package
306
            for vendor in self._vendor:
307
                print(str(vendor.uid))
308
                for symbol in self._symbols:
309
                    if vendor.includes(symbol):
310
                        print(str(symbol.uid))
304 311
            
305 312
            updateProgress.emit(maxValue)
306 313
        except Exception as ex:
......
420 427
    from EngineeringEquipmentItem import QEngineeringEquipmentItem
421 428
    from QEngineeringOPCItem import QEngineeringOPCItem
422 429
    from EngineeringSpecBreakItem import QEngineeringSpecBreakItem
430
    from EngineeringVendorItem import QEngineeringVendorItem
423 431

  
424 432
    try:
425 433
        symbols = []
......
427 435
        lineNos = []
428 436
        specBreak = []
429 437
        lineIndicator = []
438
        vendor = []
430 439
        for item in worker.graphicsView.scene.items():
431 440
            if type(item) is QEngineeringSpecBreakItem:
432 441
                specBreak.append(item)
......
442 451
                lines.append(item)
443 452
            elif type(item) is QEngineeringUnknownItem and item.lineIndicator != 'False':
444 453
                lineIndicator.append(item)
454
            elif type(item) is QEngineeringVendorItem:
455
                vendor.append(item)
445 456

  
446 457
        # trace line no
447
        tracer = LineNoTracer(symbols, lines, lineNos, specBreak, lineIndicator)
458
        tracer = LineNoTracer(symbols, lines, lineNos, specBreak, lineIndicator, vendor)
448 459
        tracer.execute(worker.displayMessage, worker.updateProgress)
449 460
        # up to here
450 461

  
DTI_PID/DTI_PID/Shapes/EngineeringVendorItem.py
21 21
    """
22 22
    This is vendor package item
23 23
    """
24
    DELIMITER = '!-!'
24
    DELIMITER = '/'
25 25
    ZVALUE = 100
26 26
    def __init__(self, polygon, points, parent=None, uid=None):
27 27
        import uuid
......
52 52
            connector.transfer.onPosChanged.connect(self.onConnectorPosChaned)
53 53
            self.connectors.append(connector)
54 54

  
55
    def includes(self, item):
56
        rect = item.sceneBoundingRect()
57
        topLeft = QPoint(rect.x(), rect.y())
58
        bottomRight = QPoint(rect.x() + rect.width(), rect.y() + rect.height())
59
        if self.contains(topLeft) and self.contains(bottomRight):
60
            return True
61
        else:
62
            return False
63

  
55 64
    @staticmethod 
56 65
    def fromXml(node):
57 66
        import uuid

내보내기 Unified diff

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