프로젝트

일반

사용자정보

개정판 60f50aee

ID60f50aee9dbba12d16ea4311a675e64c4f2b1d14
상위 1813be93
하위 0025a793, 06b97fe7

백흠경이(가) 5년 이상 전에 추가함

issue #000: save items to database

Change-Id: I2c5729c590148b6cb87290d2fa328b5f44099b7d

차이점 보기:

DTI_PID/DTI_PID/Shapes/EngineeringTextItem.py
646 646
        values = ['?', '?', "(select UID from Symbol where Name='Text' and SymbolType_UID='-1')", '?', '?', '?', '?', '?', '?', '?', '?', '?', '?']
647 647

  
648 648
        rect = self.sceneBoundingRect()
649
        param = [str(self.uid), str(appDocData.activeDrawing.UID), rect.x(), rect.y(), rect.width(), rect.height(), str(self.angle), 
649
        param = [(str(self.uid), str(appDocData.activeDrawing.UID), rect.x(), rect.y(), rect.width(), rect.height(), str(self.angle), 
650 650
        self.area, self.text(), \
651 651
        str(self.owner) if self.owner else None, \
652 652
        str(self.conns[0]) if self.conns else None, \
653
        str(self.special_item_type) if self.special_item_type else None]
653
        str(self.special_item_type) if self.special_item_type else None)]
654 654
        sql = 'insert or replace into Components({}) values({})'.format(','.join(cols), ','.join(values))
655 655
        res.append((sql, tuple(param)))
656 656

  
657 657
        titleBlockProps = appDocData.getTitleBlockProperties()
658
        for titleBlockProp in titleBlockProps:
659
            if self.area == titleBlockProp[0]:
660
                cols = ['UID', 'Drawing_UID', 'TitleBlockProperties_UID', 'VALUE']
661
                values = ['?','?','?','?']
662
                param = [str(self.uid), appDocData.activeDrawing.name, self.area, self.text()]
663

  
664
                sql = 'insert or replace into TitleBlockValues({}) values({})'.format(','.join(cols), ','.join(values))
665
                res.append((sql, tuple(param)))
658
        if titleBlockProps:
659
            cols = ['UID', 'Drawing_UID', 'TitleBlockProperties_UID', 'VALUE']
660
            values = ['?','?','?','?']
661
            params = []
662
            for titleBlockProp in titleBlockProps:
663
                if self.area == titleBlockProp[0]:
664
                    params.append((str(self.uid), appDocData.activeDrawing.name, self.area, self.text()))
665

  
666
            sql = 'insert or replace into TitleBlockValues({}) values({})'.format(','.join(cols), ','.join(values))
667
            if params: res.append((sql, tuple(params)))
666 668

  
667 669
        return res
668 670

  

내보내기 Unified diff

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