Commit d5e4f9ca50b8d0ff13719bf2b18348327034a45f

Authored by Alain Klotz
1 parent a88e292a
Exists in master

platform for TP CCD

Showing 1 changed file with 13 additions and 8 deletions   Show diff stats
gui/tp_audine_elec/tp_audine_elec.py
... ... @@ -4,7 +4,7 @@ Created on Thu Mar 11 15:39:17 2021
4 4  
5 5 @author: alain
6 6  
7   -$ cd ~/guitastro/gui/tp_audine_elec
  7 +$ cd ~/guitastro/gui/tp_audine_elec
8 8 $ python3 tp_audine_elec.py
9 9 """
10 10  
... ... @@ -16,6 +16,7 @@ import time
16 16 from PIL import ImageTk
17 17 import tkinter as tk
18 18 from tkinter import ttk
  19 +import platform
19 20  
20 21 path = os.path.abspath("../../src")
21 22 if path not in sys.path:
... ... @@ -47,7 +48,7 @@ if __name__ == "__main__":
47 48 config = yaml.safe_load(stream)
48 49 except yaml.YAMLError as exc:
49 50 print(exc)
50   -
  51 +
51 52 infos = {}
52 53 infos['demarrer_acq'] = "Appuyez sur le bouton Acquisition pour prendre une image"
53 54 infos['acq_en_cours'] = "Acquisition en cours. Attendre quelques secondes... Prendre des mesures à l'oscilloscope"
... ... @@ -84,7 +85,7 @@ if __name__ == "__main__":
84 85 widgets["button_saveima_1"].configure(state= tk.DISABLED)
85 86 widgets["button_acq"].configure(state= tk.DISABLED)
86 87 var['info'].set(infos['acq_en_cours'])
87   - # ---
  88 + # ---
88 89 method = var_method.get()
89 90 meth = "full_frame"
90 91 if method=="zi_zh":
... ... @@ -98,7 +99,7 @@ if __name__ == "__main__":
98 99 if expo > 30:
99 100 expo = 30
100 101 var_exp.set(expo)
101   - # ---
  102 + # ---
102 103 binn = var_bin.get()
103 104 if binn < 1:
104 105 binn = 1
... ... @@ -114,6 +115,10 @@ if __name__ == &quot;__main__&quot;:
114 115 argus.append(f"{expo}")
115 116 argus.append(f"{binn}")
116 117 # --- Launch the acquisition process
  118 + psystem = platform.system()
  119 + distribution = platform.freedesktop_os_release()
  120 + uname = platform.uname()
  121 +
117 122 message = f'subprocess.run({argus},capture_output=True)'
118 123 print(message)
119 124 t0 = time.time()
... ... @@ -140,7 +145,7 @@ if __name__ == &quot;__main__&quot;:
140 145 widgets["button_saveima_1"].configure(state= tk.NORMAL)
141 146 widgets["button_acq"].configure(state= tk.NORMAL)
142 147 var['info'].set(infos['demarrer_acq'])
143   -
  148 +
144 149 # update the plot
145 150 tkroot.update()
146 151  
... ... @@ -157,7 +162,7 @@ if __name__ == &quot;__main__&quot;:
157 162 tkroot.title("TP CCD Electronique - BUT S5")
158 163 tkroot.minsize(height=dimy, width=dimx)
159 164 tkroot.maxsize(height=dimy+50, width=dimx+50)
160   -
  165 +
161 166 # ---
162 167 frame1 = tk.Frame(tkroot)
163 168 frame1.pack(side = tk.TOP, fill=tk.X, expand=tk.NO)
... ... @@ -203,7 +208,7 @@ if __name__ == &quot;__main__&quot;:
203 208 widgets["button_saveima_1"] = tk.Button(frame1m, text="Save FITS", command=ima1_save, state= tk.DISABLED)
204 209 widgets["button_saveima_1"].pack(side=tk.LEFT, padx = 2)
205 210 frame1m.pack(side = tk.TOP, fill=tk.X, expand=tk.NO)
206   -
  211 +
207 212 # ---
208 213 frame2 = tk.Frame(tkroot)
209 214 # ---
... ... @@ -212,7 +217,7 @@ if __name__ == &quot;__main__&quot;:
212 217 widgets["label_info"] = tk.Label(frame2, textvariable=var['info'], padx = 10)
213 218 widgets["label_info"].pack(side = tk.LEFT)
214 219 frame2.pack(side = tk.TOP, fill=tk.X, expand=tk.NO)
215   -
  220 +
216 221 # --- Create and use a visu
217 222 try:
218 223 frame1i = tk.Frame(tkroot)
... ...