Commit 811f0a5f30b66d6f7d8b2aaaef95dbf8f908fd85
1 parent
e10c7309
Exists in
master
Add methods for TP CCD
Showing
2 changed files
with
41 additions
and
16 deletions
Show diff stats
gui/tp_audine_elec/main.cpp
... | ... | @@ -184,7 +184,6 @@ int tp_zi_zh(struct camprop *cam) |
184 | 184 | return 0; |
185 | 185 | } |
186 | 186 | |
187 | - | |
188 | 187 | /* |
189 | 188 | tp_read_pel_fast2(struct camprop *cam) -- |
190 | 189 | Lecture rapide d'un pixel : decalage du registre horizontal |
... | ... | @@ -425,7 +424,7 @@ void mc_savefits(struct camprop *cam, char *filename) |
425 | 424 | } |
426 | 425 | fwrite(&value0,1,sizeof(unsigned short),f); |
427 | 426 | } |
428 | - int n= (cam->h*cam->w) % 2880; | |
427 | + int n= (cam->h*cam->w) % 2880 -1; | |
429 | 428 | //printf("big_endian=%d n=%d",big_endian, n); |
430 | 429 | value0=(float)0.; |
431 | 430 | for (k=0;k<n;k++) { |
... | ... | @@ -449,12 +448,12 @@ int main(int argc, char* argv[]) |
449 | 448 | int binning = 1; |
450 | 449 | if(argc < 3) |
451 | 450 | { |
452 | - printf("ERR 1 : Not enough command line parameters\: method exptime binningn"); | |
451 | + printf("ERR 1 : Not enough command line parameters\n: method exptime binningn"); | |
453 | 452 | //exit(1); |
454 | 453 | } else { |
455 | - strcpy(method,argv[0]); | |
456 | - exptime = atof(argv[1]); | |
457 | - binning = atoi(argv[2]); | |
454 | + strcpy(method,argv[1]); | |
455 | + exptime = atof(argv[2]); | |
456 | + binning = atoi(argv[3]); | |
458 | 457 | } |
459 | 458 | printf("ERR 0 : %s %f %d\n", method, exptime, binning); |
460 | 459 | |
... | ... | @@ -523,7 +522,22 @@ int main(int argc, char* argv[]) |
523 | 522 | for (int i = 0; i <1; i++) { |
524 | 523 | tp_zi_zh(&cam); |
525 | 524 | } |
526 | - | |
525 | + } else if (strcmp(method, "fast_line")==0) { | |
526 | + for (int i = 0; i <1; i++) { | |
527 | + tp_fast_line(&cam); | |
528 | + } | |
529 | + } else if (strcmp(method, "read_pel_fast")==0) { | |
530 | + for (int i = 0; i <1; i++) { | |
531 | + tp_read_pel_fast(&cam); | |
532 | + } | |
533 | + } else if (strcmp(method, "read_pel_fast2")==0) { | |
534 | + for (int i = 0; i <1; i++) { | |
535 | + tp_read_pel_fast2(&cam); | |
536 | + } | |
537 | + } else if (strcmp(method, "fast_vidage")==0) { | |
538 | + for (int i = 0; i <1; i++) { | |
539 | + tp_fast_vidage(&cam); | |
540 | + } | |
527 | 541 | } else if (strcmp(method, "square_signal")==0) { |
528 | 542 | for (int i = 0; i < 100000; i++) { |
529 | 543 | float tphiV=2.0; | ... | ... |
gui/tp_audine_elec/tp_audine_elec.py
... | ... | @@ -49,10 +49,13 @@ if __name__ == "__main__": |
49 | 49 | except yaml.YAMLError as exc: |
50 | 50 | print(exc) |
51 | 51 | |
52 | + methods = ["full_frame", "zi_zh", "fast_line", "read_pel_fast", "read_pel_fast2", "fast_vidage", "square_signal"] | |
53 | + | |
52 | 54 | infos = {} |
53 | - infos['demarrer_acq'] = "Appuyez sur le bouton Acquisition pour prendre une image" | |
55 | + infos['demarrer_acq'] = "Appuyez sur le bouton Acquisition pour envoyer des signaux à la caméra" | |
54 | 56 | infos['acq_en_cours'] = "Acquisition en cours. Attendre quelques secondes... Prendre des mesures à l'oscilloscope" |
55 | 57 | infos['acq_impossible'] = "Acquisition impossible sur cet OS. Utiliser un Raspberry PI" |
58 | + infos['bad_method'] = f"Method not found amonsgt {methods}" | |
56 | 59 | var = {} |
57 | 60 | |
58 | 61 | def save_config(): |
... | ... | @@ -82,17 +85,22 @@ if __name__ == "__main__": |
82 | 85 | global widgets |
83 | 86 | global infos |
84 | 87 | global var |
88 | + global methods | |
85 | 89 | widgets["button_loadima_1"].configure(state= tk.DISABLED) |
86 | 90 | widgets["button_saveima_1"].configure(state= tk.DISABLED) |
87 | 91 | widgets["button_acq"].configure(state= tk.DISABLED) |
88 | 92 | var['info'].set(infos['acq_en_cours']) |
89 | 93 | # --- |
90 | 94 | method = var_method.get() |
91 | - meth = "full_frame" | |
92 | - if method=="zi_zh": | |
93 | - meth = "zi_zh" | |
94 | - elif method=="square_signal": | |
95 | - meth = "square_signal" | |
95 | + if method in methods: | |
96 | + meth = method | |
97 | + else: | |
98 | + var['info'].set(infos['bad_method']) | |
99 | + tkroot.update() | |
100 | + time.sleep(5) | |
101 | + var['info'].set(infos['demarrer_acq']) | |
102 | + tkroot.update() | |
103 | + return | |
96 | 104 | # --- |
97 | 105 | expo = var_exp.get() |
98 | 106 | if expo < 0: |
... | ... | @@ -127,7 +135,10 @@ if __name__ == "__main__": |
127 | 135 | stdo = res.stdout |
128 | 136 | print(stdo) |
129 | 137 | #lstdos = str(stdo).split("\\n") |
130 | - image = True | |
138 | + if meth == "full_frame": | |
139 | + image = True | |
140 | + else: | |
141 | + time.sleep(1) | |
131 | 142 | else: |
132 | 143 | var['info'].set(infos['acq_impossible']) |
133 | 144 | tkroot.update() |
... | ... | @@ -182,11 +193,11 @@ if __name__ == "__main__": |
182 | 193 | label1.pack(side = tk.LEFT, padx=2) |
183 | 194 | # --- |
184 | 195 | var_method = tk.StringVar() |
185 | - var_method.set("FullFrame") | |
196 | + var_method.set(methods[0]) | |
186 | 197 | label_method = tk.Label(frame1m, text="Method") |
187 | 198 | label_method.pack(side = tk.LEFT) |
188 | 199 | entry_method = ttk.Combobox(frame1m, textvariable=var_method, width=12) |
189 | - entry_method['values'] = ["full_frame", "zi_zh", "square_signal"] | |
200 | + entry_method['values'] = methods | |
190 | 201 | entry_method['state'] = 'readonly' |
191 | 202 | entry_method.pack(side = tk.LEFT) |
192 | 203 | #entry_method('<<ComboboxSelected>>', var_method) | ... | ... |