프로젝트

일반

사용자정보

개정판 15dda994

ID15dda9941fe4b6249851a0e719bde39b2d804320
상위 9c083580
하위 7d410e18

송근호이(가) 약 3년 전에 추가함

issue #000 Export to PAP UI 소스 추가.

Change-Id: I4504ab4ed1116b5e7c7670a9d594e09355e2eee7

차이점 보기:

HYTOS/HYTOS/Export_To_PAP.py
1
# -*- coding: utf-8 -*-
2
"""This is Equipment module"""
3

  
4
from PyQt5 import QtCore, QtGui, QtWidgets
5
from PyQt5.QtWidgets import *
6
import os
7
from AppDocData import AppDocData
8
import Export_To_PAP_UI
9
import math
10

  
11

  
12
def is_float(s):
13
    try:
14
        if s:
15
            float(s)
16
            return True
17
        else:
18
            return False
19
    except ValueError:
20
        return False
21

  
22

  
23
def is_blank(s):
24
    return not (s and s.strip())
25

  
26

  
27
def is_not_blank(s):
28
    return bool(s and s.strip())
29

  
30

  
31
def convert_to_fixed_point(value):
32
    if is_float(str(value)):
33
        tokens = f"{float(value):.10f}".split('.')
34
        if len(tokens) == 2:
35
            # 소수점 아래가 있을 경우 소수점 아래의 trailing zero를 제거한다.
36
            if is_blank(tokens[1].rstrip('0')):
37
                return tokens[0]
38
            else:
39
                tokens[1] = tokens[1].rstrip('0')
40
                return '.'.join(tokens)
41
        else:
42
            return tokens[0]
43
    else:
44
        return value
45

  
46

  
47
class QExport_To_PAP(QDialog):
48
    def __init__(self):
49
        QDialog.__init__(self)
50
        self.ui = Export_To_PAP_UI.Ui_Dialog()
51
        self.ui.setupUi(self)
52
        self.ui.buttonBox.button(QDialogButtonBox.Ok).setIcon(QtGui.QIcon(':/images/OK.svg'))
53
        self.ui.buttonBox.button(QDialogButtonBox.Cancel).setIcon(QtGui.QIcon(':/images/Cancel.svg'))
54

  
55
    def accept(self):
56
        QDialog.accept(self)
57

  
58
    def reject(self):
59
        QDialog.reject(self)
HYTOS/HYTOS/Export_To_PAP_UI.py
1
# -*- coding: utf-8 -*-
2

  
3
# Form implementation generated from reading ui file 'Ui\Export_To_PAP.ui'
4
#
5
# Created by: PyQt5 UI code generator 5.15.2
6
#
7
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
8
# run again.  Do not edit this file unless you know what you are doing.
9

  
10

  
11
from PyQt5 import QtCore, QtGui, QtWidgets
12

  
13

  
14
class Ui_Dialog(object):
15
    def setupUi(self, Dialog):
16
        Dialog.setObjectName("Dialog")
17
        Dialog.resize(629, 510)
18
        self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
19
        self.gridLayout_2.setObjectName("gridLayout_2")
20
        self.label = QtWidgets.QLabel(Dialog)
21
        font = QtGui.QFont()
22
        font.setPointSize(13)
23
        font.setBold(True)
24
        font.setWeight(75)
25
        self.label.setFont(font)
26
        self.label.setObjectName("label")
27
        self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
28
        self.gridLayout = QtWidgets.QGridLayout()
29
        self.gridLayout.setObjectName("gridLayout")
30
        self.label_3 = QtWidgets.QLabel(Dialog)
31
        self.label_3.setObjectName("label_3")
32
        self.gridLayout.addWidget(self.label_3, 0, 0, 1, 1)
33
        self.label_2 = QtWidgets.QLabel(Dialog)
34
        self.label_2.setObjectName("label_2")
35
        self.gridLayout.addWidget(self.label_2, 1, 0, 1, 1)
36
        self.comboBox_select_PAP_Project = QtWidgets.QComboBox(Dialog)
37
        self.comboBox_select_PAP_Project.setMinimumSize(QtCore.QSize(200, 0))
38
        self.comboBox_select_PAP_Project.setObjectName("comboBox_select_PAP_Project")
39
        self.gridLayout.addWidget(self.comboBox_select_PAP_Project, 0, 1, 1, 1)
40
        self.comboBox_Calculation_Case = QtWidgets.QComboBox(Dialog)
41
        self.comboBox_Calculation_Case.setMinimumSize(QtCore.QSize(200, 0))
42
        self.comboBox_Calculation_Case.setObjectName("comboBox_Calculation_Case")
43
        self.gridLayout.addWidget(self.comboBox_Calculation_Case, 1, 1, 1, 1)
44
        self.gridLayout_2.addLayout(self.gridLayout, 1, 0, 1, 1)
45
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
46
        self.gridLayout_2.addItem(spacerItem, 1, 1, 1, 1)
47
        self.tableView_upload_item_list = QtWidgets.QTableView(Dialog)
48
        self.tableView_upload_item_list.setObjectName("tableView_upload_item_list")
49
        self.gridLayout_2.addWidget(self.tableView_upload_item_list, 2, 0, 1, 2)
50
        self.buttonBox = QtWidgets.QDialogButtonBox(Dialog)
51
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
52
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
53
        self.buttonBox.setObjectName("buttonBox")
54
        self.gridLayout_2.addWidget(self.buttonBox, 3, 0, 1, 2)
55

  
56
        self.retranslateUi(Dialog)
57
        self.buttonBox.accepted.connect(Dialog.accept)
58
        self.buttonBox.rejected.connect(Dialog.reject)
59
        QtCore.QMetaObject.connectSlotsByName(Dialog)
60

  
61
    def retranslateUi(self, Dialog):
62
        _translate = QtCore.QCoreApplication.translate
63
        Dialog.setWindowTitle(_translate("Dialog", "Export to PAP"))
64
        self.label.setText(_translate("Dialog", "Export to PAP"))
65
        self.label_3.setText(_translate("Dialog", "PAP Project"))
66
        self.label_2.setText(_translate("Dialog", "Calculation Case"))
HYTOS/HYTOS/MainWindow.py
276 276
            if app_doc_data.activeDrawing is None:
277 277
                self.showImageSelectionMessageBox()
278 278
                return
279
            
279

  
280
            from Export_To_PAP import QExport_To_PAP
281

  
282
            dlg = QExport_To_PAP()
283
            dlg.exec_()
284

  
280 285
            QMessageBox.information(self, "Error", "Not Implemented.")
281 286

  
282 287
        except Exception as ex:
HYTOS/HYTOS/UI/Export_To_PAP.ui
1
<?xml version="1.0" encoding="UTF-8"?>
2
<ui version="4.0">
3
 <class>Dialog</class>
4
 <widget class="QDialog" name="Dialog">
5
  <property name="geometry">
6
   <rect>
7
    <x>0</x>
8
    <y>0</y>
9
    <width>629</width>
10
    <height>510</height>
11
   </rect>
12
  </property>
13
  <property name="windowTitle">
14
   <string>Export to PAP</string>
15
  </property>
16
  <layout class="QGridLayout" name="gridLayout_2">
17
   <item row="0" column="0">
18
    <widget class="QLabel" name="label">
19
     <property name="font">
20
      <font>
21
       <pointsize>13</pointsize>
22
       <weight>75</weight>
23
       <bold>true</bold>
24
      </font>
25
     </property>
26
     <property name="text">
27
      <string>Export to PAP</string>
28
     </property>
29
    </widget>
30
   </item>
31
   <item row="1" column="0">
32
    <layout class="QGridLayout" name="gridLayout">
33
     <item row="0" column="0">
34
      <widget class="QLabel" name="label_3">
35
       <property name="text">
36
        <string>PAP Project</string>
37
       </property>
38
      </widget>
39
     </item>
40
     <item row="1" column="0">
41
      <widget class="QLabel" name="label_2">
42
       <property name="text">
43
        <string>Calculation Case</string>
44
       </property>
45
      </widget>
46
     </item>
47
     <item row="0" column="1">
48
      <widget class="QComboBox" name="comboBox_select_PAP_Project">
49
       <property name="minimumSize">
50
        <size>
51
         <width>200</width>
52
         <height>0</height>
53
        </size>
54
       </property>
55
      </widget>
56
     </item>
57
     <item row="1" column="1">
58
      <widget class="QComboBox" name="comboBox_Calculation_Case">
59
       <property name="minimumSize">
60
        <size>
61
         <width>200</width>
62
         <height>0</height>
63
        </size>
64
       </property>
65
      </widget>
66
     </item>
67
    </layout>
68
   </item>
69
   <item row="1" column="1">
70
    <spacer name="horizontalSpacer">
71
     <property name="orientation">
72
      <enum>Qt::Horizontal</enum>
73
     </property>
74
     <property name="sizeHint" stdset="0">
75
      <size>
76
       <width>40</width>
77
       <height>20</height>
78
      </size>
79
     </property>
80
    </spacer>
81
   </item>
82
   <item row="2" column="0" colspan="2">
83
    <widget class="QTableView" name="tableView_upload_item_list"/>
84
   </item>
85
   <item row="3" column="0" colspan="2">
86
    <widget class="QDialogButtonBox" name="buttonBox">
87
     <property name="orientation">
88
      <enum>Qt::Horizontal</enum>
89
     </property>
90
     <property name="standardButtons">
91
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
92
     </property>
93
    </widget>
94
   </item>
95
  </layout>
96
 </widget>
97
 <resources/>
98
 <connections>
99
  <connection>
100
   <sender>buttonBox</sender>
101
   <signal>accepted()</signal>
102
   <receiver>Dialog</receiver>
103
   <slot>accept()</slot>
104
   <hints>
105
    <hint type="sourcelabel">
106
     <x>248</x>
107
     <y>254</y>
108
    </hint>
109
    <hint type="destinationlabel">
110
     <x>157</x>
111
     <y>274</y>
112
    </hint>
113
   </hints>
114
  </connection>
115
  <connection>
116
   <sender>buttonBox</sender>
117
   <signal>rejected()</signal>
118
   <receiver>Dialog</receiver>
119
   <slot>reject()</slot>
120
   <hints>
121
    <hint type="sourcelabel">
122
     <x>316</x>
123
     <y>260</y>
124
    </hint>
125
    <hint type="destinationlabel">
126
     <x>286</x>
127
     <y>274</y>
128
    </hint>
129
   </hints>
130
  </connection>
131
 </connections>
132
</ui>

내보내기 Unified diff

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