485 |
485 |
self.treeWidgetDrawingList.root.setCheckState(0, Qt.Unchecked)
|
486 |
486 |
files = app_doc_data.getDrawingFileList()
|
487 |
487 |
|
488 |
|
self.progress_bar.setMaximum(len(files))
|
|
488 |
#self.progress_bar.setMaximum(len(files))
|
489 |
489 |
count = 0
|
490 |
|
self.progress_bar.setValue(count)
|
|
490 |
#self.progress_bar.setValue(count)
|
491 |
491 |
for file in files:
|
492 |
492 |
x = [drawing for drawing in drawings if drawing.name == file]
|
493 |
493 |
if not x or not x[0].UID:
|
... | ... | |
503 |
503 |
item.setData(Qt.UserRole, 0, drawing)
|
504 |
504 |
|
505 |
505 |
count += 1
|
506 |
|
self.progress_bar.setValue(count)
|
507 |
|
QApplication.processEvents()
|
|
506 |
#self.progress_bar.setValue(count)
|
|
507 |
#QApplication.processEvents()
|
508 |
508 |
|
509 |
509 |
self.treeWidgetDrawingList.root.setText(0, self.tr('P&ID Drawings') +
|
510 |
510 |
f"({self.treeWidgetDrawingList.root.childCount()})")
|
... | ... | |
702 |
702 |
app_doc_data.clearItemList(False)
|
703 |
703 |
|
704 |
704 |
items = self.graphicsView.scene.items()
|
|
705 |
|
|
706 |
# for check line disappear bug
|
|
707 |
disappear_lines = [line for line in app_doc_data.lines if line not in items]
|
|
708 |
|
705 |
709 |
for item in items:
|
706 |
710 |
if issubclass(type(item), QEngineeringAbstractItem):
|
707 |
711 |
app_doc_data.allItems.append(item)
|
708 |
712 |
if issubclass(type(item), QEngineeringTextItem):
|
709 |
713 |
app_doc_data.texts.append(item)
|
710 |
714 |
|
|
715 |
# for check line disappear bug
|
|
716 |
if disappear_lines:
|
|
717 |
app_doc_data.allItems.extend(disappear_lines)
|
|
718 |
for dis_line in disappear_lines:
|
|
719 |
self.addMessage.emit('check', f"disapper line from scene : {str(dis_line)}")
|
|
720 |
|
711 |
721 |
itemTypes = []
|
712 |
722 |
for item in items:
|
713 |
723 |
typeExist = False
|
... | ... | |
770 |
780 |
item.setFlags(item.flags() | Qt.ItemIsEditable)
|
771 |
781 |
if messageType == MessageType.Error:
|
772 |
782 |
item.setBackground(Qt.red)
|
|
783 |
elif messageType == 'check':
|
|
784 |
item.setBackground(Qt.yellow)
|
773 |
785 |
|
774 |
786 |
self.listWidgetLog.insertItem(0, item)
|
775 |
787 |
except Exception as ex:
|
... | ... | |
1934 |
1946 |
if type(item) is QEngineeringLineNoTextItem and item in app_doc_data.tracerLineNos:
|
1935 |
1947 |
app_doc_data.tracerLineNos.pop(app_doc_data.tracerLineNos.index(item))
|
1936 |
1948 |
|
|
1949 |
if type(item) is QEngineeringLineItem:
|
|
1950 |
app_doc_data.lines.pop(item)
|
|
1951 |
|
1937 |
1952 |
matches = [_item for _item in self.graphicsView.scene.items() if type(_item) is QEngineeringLineNoTextItem]
|
1938 |
1953 |
matches.extend([lineNo for lineNo in app_doc_data.tracerLineNos if
|
1939 |
1954 |
type(lineNo) is QEngineeringTrimLineNoTextItem])
|
... | ... | |
2836 |
2851 |
# connect flow item to line
|
2837 |
2852 |
for line in lines:
|
2838 |
2853 |
line.update_arrow()
|
|
2854 |
docData.lines.append(line)
|
2839 |
2855 |
# for flowMark in [item for item in symbols if type(item) is QEngineeringFlowMarkItem]:
|
2840 |
2856 |
# for line in lines:
|
2841 |
2857 |
# if flowMark.owner is line:
|
... | ... | |
3075 |
3091 |
# connect flow item to line
|
3076 |
3092 |
for line in lines:
|
3077 |
3093 |
line.update_arrow()
|
|
3094 |
docData.lines.append(line)
|
3078 |
3095 |
# for flowMark in [item for item in symbols if type(item) is QEngineeringFlowMarkItem]:
|
3079 |
3096 |
# for line in lines:
|
3080 |
3097 |
# if flowMark.owner is line:
|