개정판 884d3d5f
issue #1124: fix title block
Change-Id: I0f0acc98293fa95569db1ae1bc8b873e327016b2
DTI_PID/DTI_PID/AppDocData.py | ||
---|---|---|
868 | 868 |
cursor.execute(sql) |
869 | 869 |
|
870 | 870 |
for titleBlockProp in titleBlockProps: |
871 |
sql = self.project.database.to_sql("insert into [TitleBlockProperties]([UID], [NAME], [AREA]) values(?,?,?)")
|
|
872 |
param = (titleBlockProp[0], titleBlockProp[1], titleBlockProp[2]) # uid, name, area
|
|
871 |
sql = self.project.database.to_sql("insert into [TitleBlockProperties]([UID], [NAME], [AREA], [TEXT]) values(?,?,?,?)")
|
|
872 |
param = (titleBlockProp[0], titleBlockProp[1], titleBlockProp[2], titleBlockProp[3]) # uid, name, area, text
|
|
873 | 873 |
cursor.execute(sql, param) |
874 | 874 |
conn.commit() |
875 | 875 |
# Catch the exception |
... | ... | |
908 | 908 |
# Get a cursor object |
909 | 909 |
cursor = conn.cursor() |
910 | 910 |
|
911 |
sql = "select UID, Name, AREA from TitleBlockProperties" |
|
911 |
sql = "select UID, Name, AREA, [TEXT] from TitleBlockProperties"
|
|
912 | 912 |
cursor.execute(sql) |
913 | 913 |
rows = cursor.fetchall() |
914 | 914 |
for row in rows: |
... | ... | |
916 | 916 |
attr.append(row[0]) # uid |
917 | 917 |
attr.append(row[1]) # name |
918 | 918 |
attr.append(row[2]) # area |
919 |
attr.append(row[3]) # text |
|
919 | 920 |
self._titleBlockProperties.append(attr) |
920 | 921 |
|
921 | 922 |
res = self._titleBlockProperties |
... | ... | |
2027 | 2028 |
params.append(svg_blob_data) |
2028 | 2029 |
|
2029 | 2030 |
image_display_blob_data = None |
2030 |
if image_file and os.path.isfile(image_display_file): |
|
2031 |
if image_file and image_display_file and os.path.isfile(image_display_file):
|
|
2031 | 2032 |
with open(image_file, 'rb') as file: |
2032 | 2033 |
image_display_blob_data = file.read() |
2033 | 2034 |
cols.append('Image_display=?') |
... | ... | |
3297 | 3298 |
|
3298 | 3299 |
sql = "delete from LINE_DATA_LIST where PNID_NO = '{}'".format(drawing_name) |
3299 | 3300 |
cursor.execute(sql) |
3300 |
sql = "delete from TitleBlockValues where Drawings_UID = '{}'".format(drawing_name)
|
|
3301 |
sql = "delete from TitleBlockValues where Drawings_UID = '{}'".format(drawing_uid)
|
|
3301 | 3302 |
cursor.execute(sql) |
3302 | 3303 |
|
3303 | 3304 |
# delete LineNoAttributes |
DTI_PID/DTI_PID/Commands/SaveWorkCommand.py | ||
---|---|---|
34 | 34 |
try: |
35 | 35 |
appDocData = AppDocData.instance() |
36 | 36 |
|
37 |
titleBlockProps = appDocData.getTitleBlockProperties() |
|
38 | 37 |
items = appDocData.allItems |
38 |
|
|
39 |
''' |
|
40 |
titleBlockProps = appDocData.getTitleBlockProperties() |
|
39 | 41 |
titleBlockItems = [] |
40 | 42 |
for item in items: |
41 | 43 |
if type(item) is QEngineeringTextItem: |
42 | 44 |
for titleBlockProp in titleBlockProps: |
43 | 45 |
if item.area == titleBlockProp[0]: |
44 | 46 |
titleBlockItems.append(item) |
47 |
''' |
|
45 | 48 |
|
46 | 49 |
db_items = [item for item in items if issubclass(type(item), QEngineeringAbstractItem) and type( |
47 | 50 |
item) is not QGraphicsBoundingBoxItem and type(item) is not QEngineeringErrorItem and type( |
48 | 51 |
item) is not QEngineeringLineNoTextItem] |
49 | 52 |
db_items.extend([item for item in items if type(item) is QEngineeringLineNoTextItem]) |
50 | 53 |
db_items.extend([line for line in appDocData.tracerLineNos if type(line) is QEngineeringTrimLineNoTextItem]) |
51 |
db_items.extend(titleBlockItems) |
|
54 |
#db_items.extend(titleBlockItems)
|
|
52 | 55 |
appDocData.saveToDatabase(db_items, self.show_progress) |
53 | 56 |
|
54 | 57 |
self.resultStr = SaveWorkCommand.save_to_xml() |
DTI_PID/DTI_PID/ConfigurationAreaDialog.py | ||
---|---|---|
34 | 34 |
for index in range(self.ui.tableWidgetEquipmentDescArea.columnCount()): |
35 | 35 |
self.ui.tableWidgetEquipmentDescArea.horizontalHeaderItem(0).setSizeHint(QSize(25, 25)) |
36 | 36 |
self.ui.tableWidgetEquipmentDescArea.setColumnWidth(index, len(self.ui.tableWidgetEquipmentDescArea.horizontalHeaderItem(index).text()) * 8 + 10) |
37 |
self.ui.tableWidgetTitleBlockArea.setColumnCount(3)
|
|
38 |
self.ui.tableWidgetTitleBlockArea.setHorizontalHeaderLabels(['UID', 'Name', 'Area']) |
|
37 |
self.ui.tableWidgetTitleBlockArea.setColumnCount(4)
|
|
38 |
self.ui.tableWidgetTitleBlockArea.setHorizontalHeaderLabels(['UID', 'Name', 'Area', 'defualt text'])
|
|
39 | 39 |
for index in range(self.ui.tableWidgetTitleBlockArea.columnCount()): |
40 | 40 |
self.ui.tableWidgetTitleBlockArea.horizontalHeaderItem(0).setSizeHint(QSize(25, 25)) |
41 | 41 |
self.ui.tableWidgetTitleBlockArea.setColumnWidth(index, len(self.ui.tableWidgetTitleBlockArea.horizontalHeaderItem(index).text()) * 8 + 10) |
... | ... | |
125 | 125 |
item.setFlags(Qt.ItemIsEnabled) |
126 | 126 |
item.tag = boundingBox |
127 | 127 |
self.ui.tableWidgetTitleBlockArea.setItem(row, 2, item) |
128 |
item = QTableWidgetItem(titleBlockProp[3]) |
|
129 |
item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsEditable) |
|
130 |
self.ui.tableWidgetTitleBlockArea.setItem(row, 3, item) |
|
128 | 131 |
row += 1 |
129 | 132 |
|
130 | 133 |
section = '{} Equipment Desc Area'.format(docData.imgName) |
... | ... | |
513 | 516 |
item.setFlags(Qt.ItemIsEnabled) |
514 | 517 |
item.tag = boundingBox |
515 | 518 |
self.ui.tableWidgetTitleBlockArea.setItem(row, 2, item) |
519 |
item = QTableWidgetItem() |
|
520 |
item.setFlags(Qt.ItemIsEnabled|Qt.ItemIsEditable) |
|
521 |
self.ui.tableWidgetTitleBlockArea.setItem(row, 3, item) |
|
516 | 522 |
self.ui.tableWidgetTitleBlockArea.resizeColumnsToContents() |
523 |
|
|
517 | 524 |
# up to here |
518 | 525 |
elif self._cmd.tag is self.ui.lineEditTypicalArea: |
519 | 526 |
x, y = round(x), round(y) |
... | ... | |
666 | 673 |
titleBlockProps = [] |
667 | 674 |
for row in range(self.ui.tableWidgetTitleBlockArea.rowCount()): |
668 | 675 |
if self.ui.tableWidgetTitleBlockArea.item(row, 1).text() != '': |
669 |
titleBlockProps.append([self.ui.tableWidgetTitleBlockArea.item(row, 0).text(), self.ui.tableWidgetTitleBlockArea.item(row, 1).text(), self.ui.tableWidgetTitleBlockArea.item(row, 2).text()]) |
|
676 |
titleBlockProps.append([self.ui.tableWidgetTitleBlockArea.item(row, 0).text(), self.ui.tableWidgetTitleBlockArea.item(row, 1).text(), self.ui.tableWidgetTitleBlockArea.item(row, 2).text(), self.ui.tableWidgetTitleBlockArea.item(row, 3).text()])
|
|
670 | 677 |
|
671 | 678 |
self.removeArea(self.ui.tableWidgetTitleBlockArea.item(row, 2).tag) |
672 | 679 |
docData.updateTitleBlockProperties(titleBlockProps) |
DTI_PID/DTI_PID/MainWindow.py | ||
---|---|---|
612 | 612 |
''' |
613 | 613 |
try: |
614 | 614 |
appDocData = AppDocData.instance() |
615 |
items = appDocData.allItems |
|
615 | 616 |
|
617 |
''' |
|
616 | 618 |
titleBlockProps = appDocData.getTitleBlockProperties() |
617 |
# items = self.graphicsView.scene.items() |
|
618 |
items = appDocData.allItems |
|
619 | 619 |
titleBlockItems = [] |
620 | 620 |
for item in items: |
621 | 621 |
# if type(item) is QEngineeringLineNoTextItem: |
... | ... | |
624 | 624 |
for titleBlockProp in titleBlockProps: |
625 | 625 |
if item.area == titleBlockProp[0]: |
626 | 626 |
titleBlockItems.append(item) |
627 |
''' |
|
627 | 628 |
|
628 | 629 |
# unknown item is not saved now for performance |
629 | 630 |
db_items = [item for item in items if issubclass(type(item), QEngineeringAbstractItem) and type( |
DTI_PID/DTI_PID/Scripts/MSSQL/ID2.sql | ||
---|---|---|
2052 | 2052 |
NOT NULL, |
2053 | 2053 |
NAME VARCHAR(32) NOT NULL |
2054 | 2054 |
UNIQUE, |
2055 |
AREA TEXT |
|
2055 |
AREA TEXT, |
|
2056 |
[TEXT], text |
|
2056 | 2057 |
); |
2057 | 2058 |
|
2058 | 2059 |
CREATE TABLE TitleBlockValues ( |
내보내기 Unified diff