개정판 ca43fed5
issue #1053: 생성한 장치의 데이터 입력 - 기기에 맞는 다이얼로그를 띄우는 로직 개선
Change-Id: I0d5cb23c21c38a9a04530fe6cb22d3a5702142f4
HYTOS/HYTOS/Shapes/SymbolSvgItem.py | ||
---|---|---|
631 | 631 |
@date 2019.04.16 |
632 | 632 |
''' |
633 | 633 |
def mouseDoubleClickEvent(self, event): |
634 |
func_map = [ |
|
635 |
(('Equipment - [ Pressure Drop ]', 'Air Fin Cooler', 'Air Fin Cooler'), self.show_AirFinCooler), |
|
636 |
(('Equipment - [ Pressure Drop ]', 'Filter', ('Horizontal','Vertical')), self.show_Filter), |
|
637 |
(('Equipment - [ Pressure Drop ]', 'Heat Exchanger', ('Double Pipe','Horizontal','Vertical','Kettle')), self.show_ShlTubHeatExchanger), |
|
638 |
(('Equipment - [ Pressure Drop ]', 'Heat Exchanger', ('Plate')), self.show_PlateHeatExchanger), |
|
639 |
(('Equipment - [ Pressure Drop ]', 'Miscellaneous', ('Coil')), self.show_Coil), |
|
640 |
(('Equipment - [ Pressure Drop ]', 'Miscellaneous', ('Equipment')), self.show_DP_Equipment), |
|
641 |
(('Equipment - [ Pressure Drop ]', 'Miscellaneous', ('Reactor')), self.show_Reactor), |
|
642 |
(('Equipment - [ Pressure Drop ]', 'Strainer', ('Horizontal T','Vertical T')), self.show_Strainer_T), |
|
643 |
(('Equipment - [ Pressure Drop ]', 'Strainer', ('Horizontal Y','Vertical Y')), self.show_Strainer_Y), |
|
644 |
(('Equipment - [ Pressurized ]', 'Battery Limit', None), self.show_BatteryLimit), |
|
645 |
(('Equipment - [ Pressurized ]', 'Column', ('Tray')), self.show_Tray), |
|
646 |
(('Equipment - [ Pressurized ]', 'Column', ('Single Packed')), self.show_SinglePacked), |
|
647 |
(('Equipment - [ Pressurized ]', 'Column', ('Dual Packed')), self.show_DualPacked), |
|
648 |
(('Equipment - [ Pressurized ]', 'Drum', ('Horizontal')), self.show_Drum_Horizontal), |
|
649 |
(('Equipment - [ Pressurized ]', 'Drum', ('Vertical')), self.show_Drum_Vertical), |
|
650 |
(('Equipment - [ Pressurized ]', 'Miscellaneous', ('Equipment')), self.show_Equipment), |
|
651 |
(('Equipment - [ Pressurized ]', 'Tank', ('Ball')), self.show_Ball), |
|
652 |
(('Equipment - [ Pressurized ]', 'Tank', ('Cone Roof')), self.show_ConeRoof), |
|
653 |
(('Equipment - [ Rotating ]', 'Compressor', ('Left','Right')), self.show_Compressor), |
|
654 |
(('Equipment - [ Rotating ]', 'Pump', ('Horizontal Left','Horizontal Right','Vertical')), self.show_Pump), |
|
655 |
(('Instrument', 'Valve', ('Horizontal Control','Vertical Control')), self.show_ValveControl), |
|
656 |
(('Instrument', 'Valve', ('Horizontal Manual','Vertical Manual')), self.show_ValveManual), |
|
657 |
(('Instrument', 'Line Splitter', ('Line Splitter')), self.show_LineSplitter), |
|
658 |
(('Instrument', 'Flowmeter', ('Horizontal Orifice','Horizontal Others','Horizontal Venturi','Vertical Orifice','Vertical Others','Vertical Venturi')), self.show_Flowmeter), |
|
659 |
(('Instrument', 'Reducer', ('Down','Left','Right','Up')), self.show_Reducer) |
|
660 |
] |
|
634 | 661 |
|
635 | 662 |
connectedItems = [connector for connector in self.connectors if connector.connectedItem is not None] |
636 | 663 |
if len(connectedItems) < 1: |
637 | 664 |
|
638 | 665 |
msg = QMessageBox() |
639 | 666 |
msg.setIcon(QMessageBox.Information) |
640 |
msg.setText('Connect Line before Data input')
|
|
667 |
msg.setText(self.tr('Connect Line before Data input'))
|
|
641 | 668 |
msg.setWindowTitle(self.tr("Notice")) |
642 | 669 |
msg.setStandardButtons(QMessageBox.Ok) |
643 | 670 |
msg.exec_() |
644 | 671 |
return |
645 | 672 |
|
646 |
category = self.category |
|
647 |
type = self.type |
|
648 |
name = self.name |
|
649 |
|
|
650 |
if category == 'Equipment - [ Pressure Drop ]': |
|
651 |
if type == 'Air Fin Cooler': |
|
652 |
if name == 'Air Fin Cooler': |
|
653 |
self.show_AirFinCooler() |
|
654 |
elif type == 'Filter': |
|
655 |
if name == 'Horizontal' or name == 'Vertical': |
|
656 |
self.show_Filter() |
|
657 |
elif type == 'Heat Exchanger': |
|
658 |
if name == 'Double Pipe' or name == 'Horizontal' or name == 'Vertical' or name == 'Kettle': |
|
659 |
self.show_ShlTubHeatExchanger() |
|
660 |
elif name == 'Plate': |
|
661 |
self.show_PlateHeatExchanger() |
|
662 |
elif type == 'Miscellaneous': |
|
663 |
if name == 'Coil': |
|
664 |
self.show_Coil() |
|
665 |
elif name == 'Equipment': |
|
666 |
self.show_DP_Equipment() |
|
667 |
elif name == 'Reactor': |
|
668 |
self.show_Reactor() |
|
669 |
elif type == 'Strainer': |
|
670 |
if name == 'Horizontal T' or name == 'Vertical T': |
|
671 |
self.show_Strainer_T() |
|
672 |
elif name == 'Horizontal Y' or name == 'Vertical Y': |
|
673 |
self.show_Strainer_Y() |
|
674 |
elif category == 'Equipment - [ Pressurized ]': |
|
675 |
if type == 'Battery Limit': |
|
676 |
self.show_BatteryLimit() |
|
677 |
elif type == 'Column': |
|
678 |
if name == 'Tray': |
|
679 |
self.show_Tray() |
|
680 |
elif name == 'Single Packed': |
|
681 |
self.show_SinglePacked() |
|
682 |
elif name == 'Dual Packed': |
|
683 |
self.show_DualPacked() |
|
684 |
elif type == 'Drum': |
|
685 |
if name == 'Horizontal': |
|
686 |
self.show_Drum_Horizontal() |
|
687 |
elif name == 'Vertical': |
|
688 |
self.show_Drum_Vertical() |
|
689 |
elif type == 'Miscellaneous': |
|
690 |
if name == 'Equipment': |
|
691 |
self.show_Equipment() |
|
692 |
elif type == 'Tank': |
|
693 |
if name == 'Ball': |
|
694 |
self.show_Ball() |
|
695 |
elif name == 'Cone Roof': |
|
696 |
self.show_ConeRoof() |
|
697 |
elif name == 'Dome Roof': |
|
698 |
self.show_DomeRoof() |
|
699 |
elif category == 'Equipment - [ Rotating ]': |
|
700 |
if type == 'Compressor': |
|
701 |
if name == 'Left' or name == 'Right': |
|
702 |
self.show_Compressor() |
|
703 |
elif type == 'Pump': |
|
704 |
if name == 'Horizontal Left' or name == 'Horizontal Right' or name == 'Vertical': |
|
705 |
self.show_Pump() |
|
706 |
elif category == 'Instrument': |
|
707 |
if type == 'Valve': |
|
708 |
if name == 'Horizontal Control' or name == 'Vertical Control': |
|
709 |
self.show_ValveControl() |
|
710 |
elif name == 'Horizontal Manual' or name == 'Vertical Manual': |
|
711 |
self.show_ValveManual() |
|
712 |
elif type == 'Line Splitter': |
|
713 |
if name == 'Line Splitter': |
|
714 |
self.show_LineSplitter() |
|
715 |
elif type == 'Flowmeter': |
|
716 |
if name == 'Horizontal Orifice' or name == 'Horizontal Others' or name == 'Horizontal Venturi' or name == 'Vertical Orifice' or name == 'Vertical Others' or name == 'Vertical Venturi': |
|
717 |
self.show_Flowmeter() |
|
718 |
elif type == 'Reducer': |
|
719 |
if name == 'Down' or name == 'Left' or name == 'Right' or name == 'Up': |
|
720 |
self.show_Reducer() |
|
721 |
|
|
673 |
matches = [func for func in func_map if func[0][0] == self.category and func[0][1] == self.type and (func[0][2] is None or self.name in func[0][2])] |
|
674 |
if matches: matches[0][1]() |
|
722 | 675 |
|
723 | 676 |
def show_AirFinCooler(self): |
724 | 677 |
from AirFinCooler import QAirFinCooler |
내보내기 Unified diff