Line 1... |
Line 1... |
1 |
;Josef Szylar ver 1.2 - 30.1.2013 |
1 |
;Josef Szylar ver 1.4 - 8.2.2013 |
- |
|
2 |
;8.2.2013 oprava t0_1 na t0_2 => moc rychlé děje |
- |
|
3 |
;oprava dur_count1 na dur_count_1 |
- |
|
4 |
;nově záznam o generování screenshotu bez meteoru |
- |
|
5 |
;oprava timer3.expired na timer3.expired(1) |
- |
|
6 |
|
2 |
;PODMÍNKA JEN 80 ZNAKŮ |
7 |
;PODMÍNKA JEN 80 ZNAKŮ |
3 |
;PŘÍKAZY JEN 255 ZNAKŮ |
8 |
;PŘÍKAZY JEN 255 ZNAKŮ |
4 |
|
9 |
|
5 |
;Časovače |
10 |
;Časovače |
6 |
;timer0 - časovač maximální mezery mezi 2 meteory K_max_time_btw_met |
11 |
;timer0 - časovač maximální mezery mezi 2 meteory K_max_time_btw_met |
Line 30... |
Line 35... |
30 |
;t4=0 čas meteoru s nejdelší dobou aktivity (násobek K_int_cond * dur_count) |
35 |
;t4=0 čas meteoru s nejdelší dobou aktivity (násobek K_int_cond * dur_count) |
31 |
;id_met=0 identifikátor meteoru do screenshotu |
36 |
;id_met=0 identifikátor meteoru do screenshotu |
32 |
|
37 |
|
33 |
;Konstanty: |
38 |
;Konstanty: |
34 |
;K_station_name="JOSY_A" station name (devices code - 7 characters maximum, only "A-Z" and "_" - get your unique station code on http://home.robozor.cz) |
39 |
;K_station_name="JOSY_A" station name (devices code - 7 characters maximum, only "A-Z" and "_" - get your unique station code on http://home.robozor.cz) |
35 |
;K_path základní lokální adresář |
- |
|
36 |
;K_path_scr vložit lokální adresář pro screenshoty |
40 |
;K_path_scr="/media/sd/capture/" vložit lokální adresář pro screenshoty |
37 |
;K_path_audio vložit lokální adresář pro audio soubory |
41 |
;K_path_audio="/media/sd/capture_audio/" vložit lokální adresář pro audio soubory |
38 |
;K_path_RMOB vložit lokální adresář textové soubory RMOB |
42 |
;K_path_RMOB="/media/sd/RMOB/" vložit lokální adresář textové soubory RMOB |
39 |
;K_path_SDR vložit lokální adresář textové soubory RMOB |
43 |
;K_path_SDR="/media/sd/SDR_data/" vložit lokální adresář textové soubory RMOB |
40 |
;K_max_time_btw_met=1 maximální doba mezi 2 meteory jsou 1 vteřina (nižší se počítá jako 1 meteor) |
44 |
;K_max_time_btw_met=1 maximální doba mezi 2 meteory jsou 1 vteřina (nižší se počítá jako 1 meteor) |
41 |
;K_max_time_to_scr=50 maximální doba bez meteoru, která pokud vyprší, udělá screenshot (max doba za kterou odroluje waterfall) |
45 |
;K_max_time_to_scr=100 maximální doba bez meteoru, která pokud vyprší, udělá screenshot (max doba za kterou odroluje waterfall) |
42 |
;K_init_cond=50 interval pro nastavení vyhodnocení scriptu 50ms Evaluate SpectrumLab condition interval (50ms) |
46 |
;K_init_cond=50 interval pro nastavení vyhodnocení scriptu 50ms Evaluate SpectrumLab condition interval (50ms) |
43 |
;K_time_to_start_up_waterf=4 vteřiny od okraje screenshot Kolik sekund se má počkat do screenshotu po detekci metreoru (jak daleko od okraje) |
47 |
;K_time_to_start_up_waterf=4 vteřiny od okraje screenshot Kolik sekund se má počkat do screenshotu po detekci metreoru (jak daleko od okraje) |
44 |
;K=7 - citlivost detekce meteoru |
48 |
;K=7 - citlivost detekce meteoru (odstup od šumu v db) |
45 |
;K_min_dur_count_bolid=50 detekce bolidu pro audio (2,5 vteřiny) |
49 |
;K_min_dur_count_bolid=50 detekce bolidu pro audio (2,5 vteřiny) |
46 |
|
50 |
|
47 |
;Události |
51 |
;Události |
48 |
;A_init (inicializace) |
52 |
;A_init (inicializace) |
49 |
;A_measurement (kdykoliv po 50 ms) |
53 |
;A_measurement (kdykoliv po 50 ms) |
Line 61... |
Line 65... |
61 |
;A_once_hour |
65 |
;A_once_hour |
62 |
;A_once_hour_10s_before (událost 1x za hodinu před ukončením hodiny 10 vteřin) |
66 |
;A_once_hour_10s_before (událost 1x za hodinu před ukončením hodiny 10 vteřin) |
63 |
;A_once_hour_30s_after (událost 1x za hodinu po ukončení hodiny 30 vteřin) |
67 |
;A_once_hour_30s_after (událost 1x za hodinu po ukončení hodiny 30 vteřin) |
64 |
|
68 |
|
65 |
|
69 |
|
66 |
;-----------------A_init - Inicializace proměnných a konstant-------------------- |
70 |
;-----------------A_init - Inicializace proměnných------------------------------- |
67 |
if( initialising ) then A_init=1:A_still_detect=0:n=0:n_1=0:f=0:f_1=0:aver_amp=0:a=0:mag=0:mag_max=0:hour_count=0:strenght_count=0:strenght_count_1=0:dur_count=0:dur_count_1=0:aver_amp_1=-999:aver_amp_max=-999:t0=0:t0_1=0:t1=0:t1_1=0:t1_2=0:t2=0:t3=0:t4=0:id_met="no" |
71 |
if( initialising ) then A_init=1:A_still_detect=0:n=0:n_1=0:f=0:f_1=0:aver_amp=0:a=0:mag=0:mag_max=0:hour_count=0:strenght_count=0:strenght_count_1=0:dur_count=0:dur_count_1=0:aver_amp_1=-999:aver_amp_max=-999:t0=0:t0_1=0:t1=0:t1_1=0:t1_2=0:t2=0:t3=0:t4=0 |
68 |
if( A_init = 1 ) then A_init=2:K_station_name="JOSY_A":K_path_scr="capture\\":K_path_audio="capture_audio\\":K_path_RMOB="C:\\Spectrum\\":K_path_SDR="C:\\Spectrum\\":K_path="Z:\\sd\\" |
72 |
if( A_init = 1 ) then A_init=2:id_met="no":id_met2="no":K_station_name="JOSY_A":K_path_scr="capture\\":K_path_audio="capture_audio\\":K_path_RMOB="C:\\Spectrum\\":K_path_SDR="C:\\Spectrum\\":K_path="Z:\\sd\\" |
69 |
if( A_init = 2 ) then A_init=3:K_max_time_btw_met=2:K_max_time_to_scr=40:K_init_cond=50:K_time_to_start_up_waterf=4:K=7:K_min_dur_count_bolid=50 |
73 |
if( A_init = 2 ) then A_init=3:K_max_time_btw_met=2:K_max_time_to_scr=100:K_init_cond=50:K_time_to_start_up_waterf=2:K=7:K_min_dur_count_bolid=50 |
70 |
if( A_init = 3 ) then A_init=4:A_measurement=0:A_start_detect=0:A_end_detect=0:A_end_detect_end=0:A_write_waterf=0:A_update_SDR_data_file=0:A_update_RMOB_Dur_file=0:A_met_screenshot=0 |
74 |
if( A_init = 3 ) then A_init=4:A_measurement=0:A_start_detect=0:A_end_detect=0:A_end_detect_end=0:A_write_waterf=0:A_update_SDR_data_file=0:A_update_RMOB_Dur_file=0:A_met_screenshot=0 |
71 |
if( A_init = 4 ) then A_init=5:A_no_met_screenshot=0:A_once_hour_20s_before=0:A_once_hour=0:A_once_hour_10s_before=0:A_once_hour_30s_after=0:A_once_hour_40s_after=0:timer3.restart(K_max_time_to_scr) |
75 |
if( A_init = 4 ) then A_init=5:A_no_met_screenshot=0:A_once_hour_20s_before=0:A_once_hour=0:A_once_hour_10s_before=0:A_once_hour_30s_after=0:A_once_hour_40s_after=0:timer3.restart(K_max_time_to_scr) |
72 |
if( A_init = 5 ) then A_init=0: |
76 |
if( A_init = 5 ) then A_init=0: |
73 |
|
77 |
|
74 |
;----------------A_measurement - (po 50 ms)------------------------------------- |
78 |
;----------------A_measurement - (po 50 ms)------------------------------------- |
Line 96... |
Line 100... |
96 |
if( A_still_detect=1 ) then A_start_detect=1:t1_1=t1:id_met=(K_station_name+str(t1_1)):sp.print("_ __t+"+str("ss",time)) |
100 |
if( A_still_detect=1 ) then A_start_detect=1:t1_1=t1:id_met=(K_station_name+str(t1_1)):sp.print("_ __t+"+str("ss",time)) |
97 |
if( A_start_detect=1 ) then A_start_detect=2:n_1=n:f_1=f |
101 |
if( A_start_detect=1 ) then A_start_detect=2:n_1=n:f_1=f |
98 |
if( A_start_detect=3 ) then A_start_detect=0: |
102 |
if( A_start_detect=3 ) then A_start_detect=0: |
99 |
|
103 |
|
100 |
;------------A_end_detect (událost detekce konce meteoru nebo bolidu)----------- |
104 |
;------------A_end_detect (událost detekce konce meteoru nebo bolidu)----------- |
101 |
if( timer0.expired(1) ) then A_end_detect=1:hour_count=hour_count+1:timer4.restart(K_time_to_start_up_waterf):dur_count1=dur_count: |
105 |
if( timer0.expired(1) ) then A_end_detect=1:id_met2=id_met:hour_count=hour_count+1:timer4.restart(K_time_to_start_up_waterf):dur_count_1=dur_count: |
102 |
if( A_end_detect=1 ) then A_end_detect=2:sp.print("_ __"+id_met+" HCount"+str(hour_count)+" nb"+str(round(n_1))+" f"+str(f_1)+" mag"+str(round(n_1-aver_amp_max+10))) |
106 |
if( A_end_detect=1 ) then A_end_detect=2:sp.print("_ __"+id_met2+" HCount"+str(hour_count)+" nb"+str(round(n_1))+" f"+str(f_1)+" mag"+str(round(n_1-aver_amp_max+10))) |
103 |
if( A_end_detect=2 ) then A_end_detect=3:A_update_SDR_data_file=1 |
107 |
if( A_end_detect=2 ) then A_end_detect=3:A_update_SDR_data_file=1 |
104 |
if( A_end_detect=3 ) then A_end_detect=0 |
108 |
if( A_end_detect=3 ) then A_end_detect=0 |
105 |
|
109 |
|
106 |
;-----------------A_update_SDR_data_file---------------------------------------- |
110 |
;-----------------A_update_SDR_data_file---------------------------------------- |
107 |
;SDR datový soubor záznamu radiometeorů (projekt astrozor.cz) |
111 |
;SDR datový soubor záznamu radiometeorů (projekt astrozor.cz) |
108 |
;Název souboru:JOSY_A20130123.dat |
112 |
;Název souboru:JOSY_A20130123.dat |
109 |
if( A_update_SDR_data_file=1 ) then A_update_SDR_data_file=2:fopen1(K_path_SDR+K_station_name+t0+".dat",a) |
113 |
if( A_update_SDR_data_file=1 ) then A_update_SDR_data_file=2:fopen1(K_path_SDR+K_station_name+t0+".dat",a) |
110 |
if( A_update_SDR_data_file=2 ) then A_update_SDR_data_file=3:fp1(id_met+" ; "+str(round(n_1))+" ; "+str(f_1)+" ; "+str(aver_amp_max)+" ; "+str(round(n_1-aver_amp_max+10))+" ; "+str(dur_count_1)+" ; "+str(K_init_cond)+" ; "+str(K_min_dur_count_bolid)) |
114 |
if( A_update_SDR_data_file=2 ) then A_update_SDR_data_file=3:fp1(id_met2+" ; "+str(round(n_1))+" ; "+str(f_1)+" ; "+str(aver_amp_max)+" ; "+str(round(n_1-aver_amp_max+10))+" ; "+str(dur_count_1)+" ; "+str(K_init_cond)+" ; "+str(K_min_dur_count_bolid)) |
111 |
if( A_update_SDR_data_file=3 ) then A_update_SDR_data_file=4:fclose1 |
115 |
if( A_update_SDR_data_file=3 ) then A_update_SDR_data_file=4:fclose1 |
112 |
if( A_update_SDR_data_file=4 ) then A_update_SDR_data_file=5:A_update_RMOB_Dur_file=1 |
116 |
if( A_update_SDR_data_file=4 ) then A_update_SDR_data_file=5:A_update_RMOB_Dur_file=1 |
113 |
if( A_update_SDR_data_file=5 ) then A_update_SDR_data_file=0 |
117 |
if( A_update_SDR_data_file=5 ) then A_update_SDR_data_file=0 |
114 |
|
118 |
|
115 |
;-----A_update_RMOB_Dur_file (událost generování souborů RMOB-Dur)-------------- |
119 |
;-----A_update_RMOB_Dur_file (událost generování souborů RMOB-Dur)-------------- |
Line 121... |
Line 125... |
121 |
if( A_update_RMOB_Dur_file=4 ) then A_update_RMOB_Dur_file=0: |
125 |
if( A_update_RMOB_Dur_file=4 ) then A_update_RMOB_Dur_file=0: |
122 |
|
126 |
|
123 |
;--------------A_end_detect_end------------------------------------------------- |
127 |
;--------------A_end_detect_end------------------------------------------------- |
124 |
;zametení |
128 |
;zametení |
125 |
if( A_end_detect_end=1 ) then A_end_detect_end=2:dur_count=0:dur_count_1=0:aver_amp_1=-999:aver_amp_max=-999:rec.trigger=0:A_still_detect=0 |
129 |
if( A_end_detect_end=1 ) then A_end_detect_end=2:dur_count=0:dur_count_1=0:aver_amp_1=-999:aver_amp_max=-999:rec.trigger=0:A_still_detect=0 |
126 |
if( A_end_detect_end=2 ) then A_end_detect_end=3:REM exec(K_path+K_path_audio+"ftp_up.bat "+id_met+".wav") |
130 |
if( A_end_detect_end=2 ) then A_end_detect_end=3:REM exec(K_path+K_path_audio+"ftp_up.bat "+id_met2+".wav") |
127 |
if( A_end_detect_end=3 ) then A_end_detect_end=4:REM exec(K_path+K_path_audio+"ftp_up.bat "+id_met+".aux") |
131 |
if( A_end_detect_end=3 ) then A_end_detect_end=4:REM exec(K_path+K_path_audio+"ftp_up.bat "+id_met2+".aux") |
128 |
if( A_end_detect_end=4 ) then A_end_detect_end=0 |
132 |
if( A_end_detect_end=4 ) then A_end_detect_end=0 |
129 |
|
133 |
|
130 |
;-----------------A_start_detect_bolid (událost start bolidu)------------------- |
134 |
;-----------------A_start_detect_bolid (událost start bolidu)------------------- |
131 |
if( dur_count=K_min_dur_count_bolid ) then rec.filename=K_path+K_path_audio+id_met+".wav":rec.trigger=1 |
135 |
if( dur_count=K_min_dur_count_bolid ) then rec.filename=K_path+K_path_audio+id_met2+".wav":rec.trigger=1 |
132 |
|
136 |
|
133 |
;---A_met_screenshot (událost generování screenshotu waterfallu pokud je zaznamenán meteor)--- |
137 |
;---A_met_screenshot (událost generování screenshotu waterfallu pokud je zaznamenán meteor)--- |
134 |
if( timer4.expired(1) ) then A_met_screenshot=1:capture (K_path+K_path_scr+id_met+".jpg") |
138 |
if( timer4.expired(1) ) then A_met_screenshot=1:capture (K_path+K_path_scr+id_met2+".jpg") |
135 |
if( A_met_screenshot=1 ) then A_met_screenshot=2:REM exec(K_path+K_path_scr+"ftp_up.bat "+id_met+".jpg") |
139 |
if( A_met_screenshot=1 ) then A_met_screenshot=2:REM exec(K_path+K_path_scr+"ftp_up.bat "+id_met2+".jpg") |
136 |
if( A_met_screenshot=2 ) then A_met_screenshot=0: |
140 |
if( A_met_screenshot=2 ) then A_met_screenshot=0: |
137 |
|
141 |
|
138 |
;---A_no_met_screenshot (událost generování screenshotu waterfallu pokud není dlouho zaznamenán meteor)--- |
142 |
;---A_no_met_screenshot (událost generování screenshotu waterfallu pokud není dlouho zaznamenán meteor)--- |
139 |
if( timer3.expired ) then A_no_met_screenshot=1:t1_2=t1:capture (K_path+K_path_scr+K_station_name+str(t1_2)+"no_met.jpg"):timer3.restart(K_max_time_to_scr) |
143 |
if( timer3.expired(1) ) then A_no_met_screenshot=1:t1_2=t1:capture (K_path+K_path_scr+K_station_name+str(t1_2)+"no_met.jpg") |
140 |
if( A_no_met_screenshot=1 ) then A_no_met_screenshot=2:REM exec(K_path+K_path_scr+"ftp_up.bat "+K_station_name+str(t1_2)+"no_met.jpg") |
144 |
if( A_no_met_screenshot=1 ) then A_no_met_screenshot=2:REM exec(K_path+K_path_scr+"ftp_up.bat "+K_station_name+str(t1_2)+"no_met.jpg") |
- |
|
145 |
if( A_no_met_screenshot=2 ) then A_no_met_screenshot=3:fopen1(K_path_SDR+K_station_name+t0+".dat",a) |
- |
|
146 |
if( A_no_met_screenshot=3 ) then A_no_met_screenshot=4:fp1(K_station_name+str(t1_2)+"no_met ; ; ; ; ; ; ; ") |
141 |
if( A_no_met_screenshot=2 ) then A_no_met_screenshot=3:t1_2=0 |
147 |
if( A_no_met_screenshot=4 ) then A_no_met_screenshot=5:fclose1 |
142 |
if( A_no_met_screenshot=3 ) then A_no_met_screenshot=0: |
148 |
if( A_no_met_screenshot=5 ) then A_no_met_screenshot=6:t1_2=0 |
- |
|
149 |
if( A_no_met_screenshot=6 ) then A_no_met_screenshot=0:timer3.restart(K_max_time_to_scr) |
143 |
|
150 |
|
144 |
;-A_once_hour_20s_before (událost 1x za hodinu před ukončením hodiny 20 vteřin)- |
151 |
;-A_once_hour_20s_before (událost 1x za hodinu před ukončením hodiny 20 vteřin)- |
145 |
;RMOB - soubor pro měření hodinových četností radiometeorů (projekt www.rmob.org) |
152 |
;RMOB - soubor pro měření hodinových četností radiometeorů (projekt www.rmob.org) |
146 |
;Název souboru:RMOB-201301.dat, kde RMOB je zkratka pro Radio Meteor Observing Bulletin, 2013 je rok a 01 je měsíc |
153 |
;Název souboru:RMOB-201301.dat, kde RMOB je zkratka pro Radio Meteor Observing Bulletin, 2013 je rok a 01 je měsíc |
147 |
if( val(t3,"####")=5940 ) then A_once_hour_20s_before=A_once_hour_20s_before+1:fopen4(K_path_RMOB+"RMOB-"+str("YYYYMM",now)+".dat",a) |
154 |
if( val(t3,"####")=5940 ) then A_once_hour_20s_before=A_once_hour_20s_before+1 |
148 |
if( A_once_hour_20s_before=1 ) then A_once_hour=1:fp4(t0,",",t2,",",hour_count):fclose4:t0_1=t0 |
155 |
if( A_once_hour_20s_before=1 ) then A_once_hour=1:fopen4(K_path_RMOB+"RMOB-"+str("YYYYMM",now)+".dat",a):fp4(t0,",",t2,",",hour_count):fclose4:t0_1=t0 |
149 |
if( A_once_hour=1 ) then A_once_hour=2:sp.print("Last hour=",hour_count):hour_count=0:strenght_count=0:strenght_count_1=0 |
156 |
if( A_once_hour=1 ) then A_once_hour=2:sp.print("Last hour=",hour_count):hour_count=0:strenght_count=0:strenght_count_1=0 |
150 |
if( A_once_hour=2 ) then A_once_hour=3: |
157 |
if( A_once_hour=2 ) then A_once_hour=3: |
151 |
if( A_once_hour=3 ) then A_once_hour=0: |
158 |
if( A_once_hour=3 ) then A_once_hour=0: |
152 |
|
159 |
|
153 |
;-A_once_hour_10s_before (událost 1x za hodinu před ukončením hodiny 10 vteřin)- |
160 |
;-A_once_hour_10s_before (událost 1x za hodinu před ukončením hodiny 10 vteřin)- |
Line 162... |
Line 169... |
162 |
;-A_once_hour_40s_after (událost 1x za hodinu po ukončení hodiny 40 vteřin)- |
169 |
;-A_once_hour_40s_after (událost 1x za hodinu po ukončení hodiny 40 vteřin)- |
163 |
if( val(t3,"####")=0040 ) then A_once_hour_40s_after=1:A_once_hour_30s_after=0 |
170 |
if( val(t3,"####")=0040 ) then A_once_hour_40s_after=1:A_once_hour_30s_after=0 |
164 |
if( A_once_hour_40s_after=1 ) then A_once_hour_40s_after=2:t0_1=0 |
171 |
if( A_once_hour_40s_after=1 ) then A_once_hour_40s_after=2:t0_1=0 |
165 |
if( A_once_hour_40s_after=2 ) then A_once_hour_40s_after=0 |
172 |
if( A_once_hour_40s_after=2 ) then A_once_hour_40s_after=0 |
166 |
|
173 |
|
167 |
|
174 |
|
- |
|
175 |
;Nahrada casoveho intervalu timery |
- |
|
176 |
;timer5 |
- |
|
177 |
;timer6 |
- |
|
178 |
;timer7 |
- |
|
179 |
|
- |
|
180 |
|
168 |
|
181 |
|