@@ -1,2 +1,2 | |||
|
1 | 1 | 3081d1f9bb20b2b64a192585337a292a9804e0c5 LFR_basic-parameters |
|
2 | 21ada91882790323b08a38518ed1af5a36fa4deb header/lfr_common_headers | |
|
2 | f97721719ddb7e088956d5fd3cffb0f9587a041b header/lfr_common_headers |
@@ -720,7 +720,8 int getFBinMask( int index, unsigned cha | |||
|
720 | 720 | |
|
721 | 721 | unsigned char acquisitionTimeIsValid( unsigned int coarseTime, unsigned int fineTime, unsigned char channel) |
|
722 | 722 | { |
|
723 | u_int64_t acquisitionTime; | |
|
723 | u_int64_t acquisitionTimeStart; | |
|
724 | u_int64_t acquisitionTimeStop; | |
|
724 | 725 | u_int64_t timecodeReference; |
|
725 | 726 | u_int64_t offsetInFineTime; |
|
726 | 727 | u_int64_t shiftInFineTime; |
@@ -734,8 +735,20 unsigned char acquisitionTimeIsValid( un | |||
|
734 | 735 | ret = 1; |
|
735 | 736 | |
|
736 | 737 | // compute acquisition time from caoarseTime and fineTime |
|
737 | acquisitionTime = ( ((u_int64_t)coarseTime) << SHIFT_2_BYTES ) | |
|
738 | acquisitionTimeStart = ( ((u_int64_t)coarseTime) << SHIFT_2_BYTES ) | |
|
738 | 739 | + (u_int64_t) fineTime; |
|
740 | switch(channel) | |
|
741 | { | |
|
742 | case CHANNELF0: | |
|
743 | acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F0; | |
|
744 | break; | |
|
745 | case CHANNELF1: | |
|
746 | acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F1; | |
|
747 | break; | |
|
748 | case CHANNELF2: | |
|
749 | acquisitionTimeStop = acquisitionTimeStart + FINETIME_PER_SM_F2; | |
|
750 | break; | |
|
751 | } | |
|
739 | 752 | |
|
740 | 753 | // compute the timecode reference |
|
741 | 754 | timecodeReference = (u_int64_t) ( (floor( ((double) coarseTime) / ((double) filterPar.sy_lfr_pas_filter_modulus) ) |
@@ -757,8 +770,8 unsigned char acquisitionTimeIsValid( un | |||
|
757 | 770 | + shiftInFineTime |
|
758 | 771 | + tBadInFineTime; |
|
759 | 772 | |
|
760 | if ( (acquisitionTime >= acquisitionTimeRangeMin) | |
|
761 | && (acquisitionTime <= acquisitionTimeRangeMax) | |
|
773 | if ( (acquisitionTimeStart >= acquisitionTimeRangeMin) | |
|
774 | && (acquisitionTimeStart <= acquisitionTimeRangeMax) | |
|
762 | 775 | && (pasFilteringIsEnabled == 1) ) |
|
763 | 776 | { |
|
764 | 777 | ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored |
@@ -768,6 +781,21 unsigned char acquisitionTimeIsValid( un | |||
|
768 | 781 | ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging |
|
769 | 782 | } |
|
770 | 783 | |
|
784 | // the last sample of the data used to compute the matrix shall not be INSIDE the range, test it now, it depends on the channel | |
|
785 | if (ret == 1) | |
|
786 | { | |
|
787 | if ( (acquisitionTimeStop >= acquisitionTimeRangeMin) | |
|
788 | && (acquisitionTimeStop <= acquisitionTimeRangeMax) | |
|
789 | && (pasFilteringIsEnabled == 1) ) | |
|
790 | { | |
|
791 | ret = 0; // the acquisition time is INSIDE the range, the matrix shall be ignored | |
|
792 | } | |
|
793 | else | |
|
794 | { | |
|
795 | ret = 1; // the acquisition time is OUTSIDE the range, the matrix can be used for the averaging | |
|
796 | } | |
|
797 | } | |
|
798 | ||
|
771 | 799 | // printf("coarseTime = %x, fineTime = %x\n", |
|
772 | 800 | // coarseTime, |
|
773 | 801 | // fineTime); |
General Comments 0
You need to be logged in to leave comments.
Login now