프로젝트

일반

사용자정보

개정판 a7b4bb70

IDa7b4bb70493e5c6a7256b419dd3ed6c0c7998053
상위 7d410e18
하위 bf2f0565, 9f5097ca

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

issue #000 Export To PAP UI 업데이트

Change-Id: Ia417e9fe1f57dd4f89287fb649b0ed40572f58b1

차이점 보기:

HYTOS/HYTOS/Export_To_PAP.py
7 7
from AppDocData import AppDocData
8 8
import Export_To_PAP_UI
9 9
import math
10

  
10
import requests
11
import json
11 12

  
12 13
def is_float(s):
13 14
    try:
......
51 52
        self.ui.setupUi(self)
52 53
        self.ui.buttonBox.button(QDialogButtonBox.Ok).setIcon(QtGui.QIcon(':/images/OK.svg'))
53 54
        self.ui.buttonBox.button(QDialogButtonBox.Cancel).setIcon(QtGui.QIcon(':/images/Cancel.svg'))
55
        project = self.send_api("/api/Projects", "GET")
56

  
57
    def send_api(self, path, method):
58
        API_HOST = "https://papwebapi.azurewebsites.net"
59
        url = API_HOST + path
60
        headers = {'Content-Type': 'application/json', 'charset': 'UTF-8', 'Accept': '*/*'}
61
        try:
62
            if method == 'GET':
63
                response = requests.get(url, headers=headers)
64
                if response.status_code == 200:
65
                    json_objects = json.loads(response.text)
66
                    for json_object in json_objects:
67
                        self.ui.comboBox_select_PAP_Project.addItem(json_object['Name'])
68
        except Exception as ex:
69
            print(ex)
54 70

  
55 71
    def accept(self):
56 72
        QDialog.accept(self)
HYTOS/HYTOS/Export_To_PAP_UI.py
15 15
    def setupUi(self, Dialog):
16 16
        Dialog.setObjectName("Dialog")
17 17
        Dialog.resize(629, 510)
18
        icon = QtGui.QIcon()
19
        icon.addPixmap(QtGui.QPixmap(":/images/PAP.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
20
        Dialog.setWindowIcon(icon)
18 21
        self.gridLayout_2 = QtWidgets.QGridLayout(Dialog)
19 22
        self.gridLayout_2.setObjectName("gridLayout_2")
20 23
        self.label = QtWidgets.QLabel(Dialog)
......
64 67
        self.label.setText(_translate("Dialog", "Export to PAP"))
65 68
        self.label_3.setText(_translate("Dialog", "PAP Project"))
66 69
        self.label_2.setText(_translate("Dialog", "Calculation Case"))
70
import Resource_rc
HYTOS/HYTOS/UI/Export_To_PAP.ui
13 13
  <property name="windowTitle">
14 14
   <string>Export to PAP</string>
15 15
  </property>
16
  <property name="windowIcon">
17
   <iconset resource="../res/Resource.qrc">
18
    <normaloff>:/images/PAP.png</normaloff>:/images/PAP.png</iconset>
19
  </property>
16 20
  <layout class="QGridLayout" name="gridLayout_2">
17 21
   <item row="0" column="0">
18 22
    <widget class="QLabel" name="label">
......
94 98
   </item>
95 99
  </layout>
96 100
 </widget>
97
 <resources/>
101
 <resources>
102
  <include location="../res/Resource.qrc"/>
103
 </resources>
98 104
 <connections>
99 105
  <connection>
100 106
   <sender>buttonBox</sender>
HYTOS/HYTOS/requirements.txt
4 4
PyQt5==5.15.2
5 5
Shapely==1.7.1
6 6
pywinsparkle==1.6.0
7
packaging==20.9
7
packaging==20.9
8
requests==2.23.0

내보내기 Unified diff