##// END OF EJS Templates
3.1.0.2...
paul -
r293:e6dce572ae0e R3_plus draft
parent child
Show More
@@ -1,2 +1,2
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
1 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters
2 2450d4935652a4d0370245cc7fc60a4c51e6fc9b header/lfr_common_headers
2 c378fa14eadd80b3b873ca7c8f9f387893c07692 header/lfr_common_headers
@@ -20,7 +20,7 SWVERSION=-1-0
20 DEFINES += SW_VERSION_N1=3 # major
20 DEFINES += SW_VERSION_N1=3 # major
21 DEFINES += SW_VERSION_N2=1 # minor
21 DEFINES += SW_VERSION_N2=1 # minor
22 DEFINES += SW_VERSION_N3=0 # patch
22 DEFINES += SW_VERSION_N3=0 # patch
23 DEFINES += SW_VERSION_N4=1 # internal
23 DEFINES += SW_VERSION_N4=2 # internal
24
24
25 # <GCOV>
25 # <GCOV>
26 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
26 #QMAKE_CFLAGS_RELEASE += -fprofile-arcs -ftest-coverage
@@ -30,7 +30,7 extern float cp_rpw_sc_rw3_f1;
30 extern float cp_rpw_sc_rw3_f2;
30 extern float cp_rpw_sc_rw3_f2;
31 extern float cp_rpw_sc_rw4_f1;
31 extern float cp_rpw_sc_rw4_f1;
32 extern float cp_rpw_sc_rw4_f2;
32 extern float cp_rpw_sc_rw4_f2;
33 extern float sy_lfr_sc_rw_delta_f;
33 extern filterPar_t filterPar;
34
34
35 // RTEMS TASKS
35 // RTEMS TASKS
36 rtems_task Init( rtems_task_argument argument);
36 rtems_task Init( rtems_task_argument argument);
@@ -90,7 +90,9 float cp_rpw_sc_rw3_f1;
90 float cp_rpw_sc_rw3_f2;
90 float cp_rpw_sc_rw3_f2;
91 float cp_rpw_sc_rw4_f1;
91 float cp_rpw_sc_rw4_f1;
92 float cp_rpw_sc_rw4_f2;
92 float cp_rpw_sc_rw4_f2;
93 float sy_lfr_sc_rw_delta_f;
93
94 // TC_LFR_LOAD_FILTER_PAR
95 filterPar_t filterPar;
94
96
95 fbins_masks_t fbins_masks;
97 fbins_masks_t fbins_masks;
96 unsigned int acquisitionDurations[3] = {ACQUISITION_DURATION_F0, ACQUISITION_DURATION_F1, ACQUISITION_DURATION_F2};
98 unsigned int acquisitionDurations[3] = {ACQUISITION_DURATION_F0, ACQUISITION_DURATION_F1, ACQUISITION_DURATION_F2};
@@ -169,7 +169,13 rtems_task Init( rtems_task_argument ign
169 cp_rpw_sc_rw3_f2 = 0.0;
169 cp_rpw_sc_rw3_f2 = 0.0;
170 cp_rpw_sc_rw4_f1 = 0.0;
170 cp_rpw_sc_rw4_f1 = 0.0;
171 cp_rpw_sc_rw4_f2 = 0.0;
171 cp_rpw_sc_rw4_f2 = 0.0;
172 sy_lfr_sc_rw_delta_f = 0.0;
172 // initialize filtering parameters
173 filterPar.spare_sy_lfr_pas_filter_enabled = DEFAULT_SY_LFR_PAS_FILTER_ENABLED;
174 filterPar.sy_lfr_pas_filter_modulus = DEFAULT_SY_LFR_PAS_FILTER_MODULUS;
175 filterPar.sy_lfr_pas_filter_tbad = DEFAULT_SY_LFR_PAS_FILTER_TBAD;
176 filterPar.sy_lfr_pas_filter_offset = DEFAULT_SY_LFR_PAS_FILTER_OFFSET;
177 filterPar.sy_lfr_pas_filter_shift = DEFAULT_SY_LFR_PAS_FILTER_SHIFT;
178 filterPar.sy_lfr_sc_rw_delta_f = DEFAULT_SY_LFR_SC_RW_DELTA_F;
173 update_last_valid_transition_date( DEFAULT_LAST_VALID_TRANSITION_DATE );
179 update_last_valid_transition_date( DEFAULT_LAST_VALID_TRANSITION_DATE );
174
180
175 // waveform picker initialization
181 // waveform picker initialization
@@ -716,30 +716,21 unsigned char acquisitionTimeIsValid( un
716 unsigned char pasFilteringIsEnabled;
716 unsigned char pasFilteringIsEnabled;
717 unsigned char ret;
717 unsigned char ret;
718
718
719 pasFilteringIsEnabled = (parameter_dump_packet.spare_sy_lfr_pas_filter_enabled & 0x01); // [0000 0001]
719 pasFilteringIsEnabled = (filterPar.spare_sy_lfr_pas_filter_enabled & 0x01); // [0000 0001]
720 ret = 1;
720 ret = 1;
721
721
722 //***************************
723 // <FOR TESTING PURPOSE ONLY>
724 unsigned char sy_lfr_pas_filter_modulus = 4;
725 unsigned char sy_lfr_pas_filter_offset = 1;
726 float sy_lfr_pas_filter_shift = 0.5;
727 float sy_lfr_pas_filter_tbad = 1.0;
728 // </FOR TESTING PURPOSE ONLY>
729 //****************************
730
731 // compute acquisition time from caoarseTime and fineTime
722 // compute acquisition time from caoarseTime and fineTime
732 acquisitionTime = ( ((u_int64_t)coarseTime) << 16 )
723 acquisitionTime = ( ((u_int64_t)coarseTime) << 16 )
733 + (u_int64_t) fineTime;
724 + (u_int64_t) fineTime;
734
725
735 // compute the timecode reference
726 // compute the timecode reference
736 timecodeReference = (u_int64_t) (floor( ((double) coarseTime) / ((double) sy_lfr_pas_filter_modulus) )
727 timecodeReference = (u_int64_t) (floor( ((double) coarseTime) / ((double) filterPar.sy_lfr_pas_filter_modulus) )
737 * ((double) sy_lfr_pas_filter_modulus)) * 65536;
728 * ((double) filterPar.sy_lfr_pas_filter_modulus)) * 65536;
738
729
739 // compute the acquitionTime range
730 // compute the acquitionTime range
740 offsetInFineTime = ((double) sy_lfr_pas_filter_offset) * 65536;
731 offsetInFineTime = ((double) filterPar.sy_lfr_pas_filter_offset) * 65536;
741 shiftInFineTime = ((double) sy_lfr_pas_filter_shift) * 65536;
732 shiftInFineTime = ((double) filterPar.sy_lfr_pas_filter_shift) * 65536;
742 tBadInFineTime = ((double) sy_lfr_pas_filter_tbad) * 65536;
733 tBadInFineTime = ((double) filterPar.sy_lfr_pas_filter_tbad) * 65536;
743
734
744 acquisitionTimeRangeMin =
735 acquisitionTimeRangeMin =
745 timecodeReference
736 timecodeReference
@@ -343,9 +343,25 int action_load_filter_par(ccsdsTelecomm
343 parameter_dump_packet.sy_lfr_sc_rw_delta_f[2] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + 2 ];
343 parameter_dump_packet.sy_lfr_sc_rw_delta_f[2] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + 2 ];
344 parameter_dump_packet.sy_lfr_sc_rw_delta_f[3] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + 3 ];
344 parameter_dump_packet.sy_lfr_sc_rw_delta_f[3] = TC->dataAndCRC[ DATAFIELD_POS_SY_LFR_SC_RW_DELTA_F + 3 ];
345
345
346 //****************************
347 // store PAS filter parameters
348 // sy_lfr_pas_filter_enabled
349 filterPar.spare_sy_lfr_pas_filter_enabled = parameter_dump_packet.spare_sy_lfr_pas_filter_enabled;
350 // sy_lfr_pas_filter_modulus
351 filterPar.sy_lfr_pas_filter_modulus = parameter_dump_packet.sy_lfr_pas_filter_modulus;
352 // sy_lfr_pas_filter_tbad
353 copyFloatByChar( (unsigned char*) &filterPar.sy_lfr_pas_filter_tbad,
354 parameter_dump_packet.sy_lfr_pas_filter_tbad );
355 // sy_lfr_pas_filter_offset
356 filterPar.sy_lfr_pas_filter_offset = parameter_dump_packet.sy_lfr_pas_filter_offset;
357 // sy_lfr_pas_filter_shift
358 copyFloatByChar( (unsigned char*) &filterPar.sy_lfr_pas_filter_shift,
359 parameter_dump_packet.sy_lfr_pas_filter_shift );
360
361 //****************************************************
346 // store the parameter sy_lfr_sc_rw_delta_f as a float
362 // store the parameter sy_lfr_sc_rw_delta_f as a float
347 copyFloatByChar( (unsigned char*) &sy_lfr_sc_rw_delta_f,
363 copyFloatByChar( (unsigned char*) &filterPar.sy_lfr_sc_rw_delta_f,
348 (unsigned char*) &parameter_dump_packet.sy_lfr_sc_rw_delta_f[0] );
364 parameter_dump_packet.sy_lfr_sc_rw_delta_f );
349 }
365 }
350
366
351 return flag;
367 return flag;
@@ -967,8 +983,8 void setFBinMask( unsigned char *fbins_m
967 bin = 0;
983 bin = 0;
968
984
969 // compute the frequency range to filter [ rw_f - delta_f/2; rw_f + delta_f/2 ]
985 // compute the frequency range to filter [ rw_f - delta_f/2; rw_f + delta_f/2 ]
970 fmin = rw_f - sy_lfr_sc_rw_delta_f / 2.;
986 fmin = rw_f - filterPar.sy_lfr_sc_rw_delta_f / 2.;
971 fMAX = rw_f + sy_lfr_sc_rw_delta_f / 2.;
987 fMAX = rw_f + filterPar.sy_lfr_sc_rw_delta_f / 2.;
972
988
973 // compute the index of the frequency bin immediately below fmin
989 // compute the index of the frequency bin immediately below fmin
974 binBelow = (int) ( floor( ((double) fmin) / ((double) deltaFreq)) );
990 binBelow = (int) ( floor( ((double) fmin) / ((double) deltaFreq)) );
General Comments 0
You need to be logged in to leave comments. Login now