Browse Source

alpha 0.3

alpha
Jeong Geol Kim 4 years ago
parent
commit
8ee2ea3ac5

BIN
how_to_use/00_run_file.png View File


BIN
how_to_use/01_Initailze.png View File


BIN
how_to_use/02_confirm.png View File


BIN
how_to_use/03_recording.png View File


BIN
how_to_use/04_quit.png View File


BIN
how_to_use/05_err_cn.png View File


BIN
how_to_use/06_err_pc.png View File


+ 1
- 0
logs.txt View File

@@ -0,0 +1 @@
1
+###This file creates automatically.

+ 48
- 12
main.py View File

@@ -1,12 +1,14 @@
1 1
 import tkinter
2 2
 import json
3 3
 import paramiko
4
+import time
5
+from tkinter import messagebox
4 6
 
5 7
 
6 8
 window = tkinter.Tk()
7 9
 settings =[]
8 10
 customer_code = ''
9
-surgery_date = ''
11
+surgery_date =  str(time.strftime('%Y%m%d', time.localtime(time.time())))
10 12
 
11 13
 with open('./settings.json', encoding='utf-8')as json_file:
12 14
     json_data = json.load(json_file)
@@ -19,27 +21,61 @@ window.title(settings[0])
19 21
 window.geometry(settings[1])
20 22
 window.resizable(False,False)
21 23
 
22
-label_customer_code = tkinter.Label(window, text="고객번호(지점 번호 제외 7자리)")
23
-label_surgery_date = tkinter.Label(window, text="일자(yyyymmdd)")
24
+label_branch = tkinter.Label(window, text = '지점 위치: ' + settings[2] + ' / 수술방 번호: ' + str(settings[3]))
25
+label_customer_code = tkinter.Label(window, text="고객번호(지점 번호 포함 9자리)")
24 26
 
25
-# def fillForm():
26 27
 
27
-def fillCustomerCode(event):
28
-    customer_code = str(entry_customer_code.get())
29
-    surgery_date = str(entry_surgery_date.get())
30
-    print(customer_code, surgery_date)
28
+def dummyexit():
29
+    pass
30
+
31
+def askInformation(customer_code,surgery_date):        
32
+    cs = customer_code
33
+    sd = surgery_date
34
+
35
+    if len(cs) != 9:
36
+        err_box = messagebox.showerror("고객 번호 오류", '지점 번호를 포함한 9자리를 입력해주세요.')    
37
+    else:
38
+        msg_box = messagebox.askquestion("입력 정보 확인", "입력하신 정보가 정확한지 확인해주세요.\n고객 번호: "+customer_code + '\n 수술일자: ' + surgery_date +'\n\nYes를 눌러 기록 시작을,\n입력 정보의 수정을 원하시면 No을 눌러 변경해주세요.')
39
+        #TODO: try: 형태로 고칠 것. Err 메세지도 종류 정할 것
40
+        if msg_box == 'yes':
41
+            err_status = True
42
+
43
+            if err_status == False:
44
+                label_recording = tkinter.Label(window, text='분석 PC에 문제가 발생하였습니다.\nHOBIT LAB으로 연락 부탁드립니다.\n내선번호: 1237 \n에러 코드: REQUEST TIME OUT')
45
+                label_recording.pack()
46
+            else:
47
+                #TODO: paramiko로 ssh 접속 후 도커 명령어 보낼 것
48
+                button_confirm['text'] = '기록 종료'
49
+                window.protocol('WM_DELETE_WINDOW', dummyexit)
50
+
51
+                label_recording = tkinter.Label(window, text='MAIL system에 수술을 기록 중입니다.\n기록 중단을 원할 시 \n기록 종료 버튼을 눌러주세요.')
52
+                label_recording.pack()
53
+        
54
+def askQuit():
55
+    msg_box = messagebox.askquestion("기록 중지 확인", '기록을 중지하시겠습니까?')
56
+    if msg_box == 'yes':
57
+        #TODO: docker 중지 명령어 보내기
58
+        window.destroy()
59
+
60
+
61
+
62
+def buttonAction(event):    
63
+    if button_confirm['text'] == '입력완료':
64
+        customer_code = str(entry_customer_code.get())        
65
+        askInformation(customer_code, surgery_date)
66
+    else:
67
+        askQuit()
31 68
 # def fillSurgeryDate():
32 69
 
33 70
 entry_customer_code = tkinter.Entry(window)
34 71
 entry_surgery_date = tkinter.Entry(window)
35 72
 button_confirm = tkinter.Button(window, text="입력완료", width=20, height=2)
36
-button_confirm.bind("<Button-1>", fillCustomerCode)
37
-
73
+button_confirm.bind("<Button-1>", buttonAction)
38 74
 
75
+label_branch.pack()
39 76
 label_customer_code.pack()
40 77
 entry_customer_code.pack()
41
-label_surgery_date.pack()
42
-entry_surgery_date.pack()
78
+
43 79
 
44 80
 
45 81
 button_confirm.pack()

+ 2
- 3
settings.json View File

@@ -1,7 +1,6 @@
1 1
 {
2 2
     "window_name":"365mc M.A.I.L system Recorder",
3
-    "window_position": "240x320+300+300",
4
-    "branch_location": "seoul",
3
+    "window_position": "240x240+300+300",
4
+    "branch_location": "서울",
5 5
     "surgery_room_number": 801
6
-
7 6
 }

Loading…
Cancel
Save