Repository for M.A.I.L system's recording client.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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