|
|
@@ -25,15 +25,34 @@ window.title(settings[0])
|
|
25
|
25
|
window.geometry(settings[1])
|
|
26
|
26
|
window.resizable(False,False)
|
|
27
|
27
|
|
|
28
|
|
-def sshConnect():
|
|
|
28
|
+def sshConnect(cs, sd):
|
|
|
29
|
+ cs = cs
|
|
|
30
|
+ sd = sd
|
|
|
31
|
+ ssh = paramiko.SSHClient()
|
|
|
32
|
+ ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
|
33
|
+ ssh.connect(settings[4],port= settings[3], username=settings[5], password=settings[6])
|
|
|
34
|
+ data_root_dir = './data/'+cs+sd
|
|
|
35
|
+ stdin, stdout, stderr = ssh.exec_command('mkdir ' + data_root_dir)
|
|
|
36
|
+ #TODO: 여기에 도커 명령어 및 동시 녹화 코드 입력
|
|
|
37
|
+ stdin, stdout, stderr = ssh.exec_command('docker run --rm --name mail_recorder --gpus 1 --privileged -v /dev:/dev -v /home/mc365/sources:/sources -v /home/mc365/data/'+cs+sd+':/data/'+cs+sd+' stereolabs/zed:3.5-gl-devel-cuda11.0-ubuntu18.04 python3 /sources/recorder.py')
|
|
|
38
|
+
|
|
|
39
|
+ print(stdout.readlines())
|
|
|
40
|
+
|
|
|
41
|
+def sshQuit(cs, sd):
|
|
|
42
|
+ cs = cs
|
|
|
43
|
+ sd = sd
|
|
29
|
44
|
ssh = paramiko.SSHClient()
|
|
30
|
45
|
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
31
|
46
|
ssh.connect(settings[4],port= settings[3], username=settings[5], password=settings[6])
|
|
32
|
47
|
|
|
33
|
|
- stdin, stdout, stderr = ssh.exec_command('echo this is paramiko')
|
|
|
48
|
+ stdin, stdout, stderr = ssh.exec_command('docker stop mail_recorder')
|
|
|
49
|
+ stdin, stdout, stderr = ssh.exec_command('docker run --rm --name extract_01 --gpus 0 --privileged -v /dev:/dev -v /home/mc365/sources:/sources -v /home/mc365/data/'+cs+sd+':/data/'+cs+sd+' ellishuntingmoon/mailsys_extract:latest python3 /sources/extract_01.py')
|
|
|
50
|
+ stdin, stdout, stderr = ssh.exec_command('docker run --rm --name extract_02 --gpus 1 --privileged -v /dev:/dev -v /home/mc365/sources:/sources -v /home/mc365/data/'+cs+sd+':/data/'+cs+sd+' ellishuntingmoon/mailsys_extract:latest python3 /sources/extract_02.py')
|
|
|
51
|
+
|
|
34
|
52
|
# TODO: 여기에 스크립트 명령어 입력
|
|
35
|
53
|
print(stdout.readlines())
|
|
36
|
54
|
|
|
|
55
|
+
|
|
37
|
56
|
label_branch = tkinter.Label(window, text = '지점 위치: ' + settings[2] + ' / 수술방 번호: ' + str(settings[3]))
|
|
38
|
57
|
label_customer_code = tkinter.Label(window, text="고객번호(지점 번호 포함 9자리)")
|
|
39
|
58
|
|
|
|
@@ -58,17 +77,18 @@ def askInformation(customer_code,surgery_date):
|
|
58
|
77
|
label_recording.pack()
|
|
59
|
78
|
else:
|
|
60
|
79
|
#TODO: paramiko로 ssh 접속 후 도커 명령어 보낼 것
|
|
|
80
|
+ sshConnect(cs, sd)
|
|
61
|
81
|
button_confirm['text'] = '기록 종료'
|
|
62
|
82
|
window.protocol('WM_DELETE_WINDOW', dummyexit)
|
|
63
|
83
|
|
|
64
|
84
|
label_recording = tkinter.Label(window, text='MAIL system에 수술을 기록 중입니다.\n기록 중단을 원할 시 \n기록 종료 버튼을 눌러주세요.')
|
|
65
|
85
|
label_recording.pack()
|
|
66
|
86
|
|
|
67
|
|
-def askQuit():
|
|
|
87
|
+def askQuit(customer):
|
|
68
|
88
|
msg_box = messagebox.askquestion("기록 중지 확인", '기록을 중지하시겠습니까?')
|
|
69
|
89
|
if msg_box == 'yes':
|
|
70
|
90
|
#TODO: docker 중지 명령어 보내기
|
|
71
|
|
- sshConnect()
|
|
|
91
|
+ sshQuit()
|
|
72
|
92
|
window.destroy()
|
|
73
|
93
|
|
|
74
|
94
|
|
|
|
@@ -78,7 +98,7 @@ def buttonAction(event):
|
|
78
|
98
|
customer_code = str(entry_customer_code.get())
|
|
79
|
99
|
askInformation(customer_code, surgery_date)
|
|
80
|
100
|
else:
|
|
81
|
|
- askQuit()
|
|
|
101
|
+ askQuit(customer_code, surgery_date)
|
|
82
|
102
|
# def fillSurgeryDate():
|
|
83
|
103
|
|
|
84
|
104
|
|
|
|
@@ -97,7 +117,4 @@ entry_customer_code.pack()
|
|
97
|
117
|
|
|
98
|
118
|
button_confirm.pack()
|
|
99
|
119
|
|
|
100
|
|
-window.mainloop()
|
|
101
|
|
-
|
|
102
|
|
-
|
|
103
|
|
-
|
|
|
120
|
+window.mainloop()
|