13 #include "param_codec.hh" 16 #include "tk_spline.hh" 33 switch (a_trigger_mode) {
43 throw psyllid::error() <<
"string <" << a_trigger_mode_string <<
"> not recognized as valid trigger_mode type";
49 switch (a_threshold) {
59 throw psyllid::error() <<
"string <" << a_threshold_string <<
"> not recognized as valid threshold type";
64 f_n_packets_for_mask( 10 ),
65 f_threshold_snr( 30. ),
66 f_threshold_snr_high( 30. ),
67 f_threshold_sigma( 30 ),
68 f_threshold_sigma_high( 30 ),
70 f_n_spline_points( 20 ),
73 f_n_excluded_bins( 0 ),
92 throw error() <<
"Number of packets for the trigger mask must be non-zero";
94 f_n_packets_for_mask = a_n_pkts;
100 f_threshold_snr = a_ampl_snr * a_ampl_snr;
101 LDEBUG(
plog,
"Setting threshold (power via ampl) to " << f_threshold_snr );
107 f_threshold_snr = pow( 10, a_dB / 10. );
108 LDEBUG(
plog,
"Setting threshold (power via dB) to " << f_threshold_snr );
114 unsigned t_n_bins_per_point =
f_average_data.size() / f_n_spline_points;
115 for(
unsigned i_spline_point = 0; i_spline_point < f_n_spline_points; ++i_spline_point )
117 unsigned t_bin_begin = i_spline_point * t_n_bins_per_point;
118 unsigned t_bin_end = i_spline_point == f_n_spline_points - 1 ?
f_average_data.size() : t_bin_begin + t_n_bins_per_point;
120 for(
unsigned i_bin = t_bin_begin; i_bin < t_bin_end; ++i_bin )
124 t_mean *= 1. / (double)(t_bin_end - t_bin_begin);
125 t_y_vals[ i_spline_point ] = t_mean;
126 t_x_vals[ i_spline_point ] = (double)t_bin_begin + 0.5 * (
double)(t_bin_end - 1 - t_bin_begin);
132 unsigned t_n_bins_per_point =
f_average_data.size() / f_n_spline_points;
133 for(
unsigned i_spline_point = 0; i_spline_point < f_n_spline_points; ++i_spline_point )
135 unsigned t_bin_begin = i_spline_point * t_n_bins_per_point;
136 unsigned t_bin_end = i_spline_point == f_n_spline_points - 1 ?
f_average_data.size() : t_bin_begin + t_n_bins_per_point;
138 for(
unsigned i_bin = t_bin_begin; i_bin < t_bin_end; ++i_bin )
142 t_mean *= 1. / (double)(t_bin_end - t_bin_begin);
143 t_y_vals[ i_spline_point ] = t_mean;
144 t_x_vals[ i_spline_point ] = (double)t_bin_begin + 0.5 * (
double)(t_bin_end - 1 - t_bin_begin);
151 f_n_packets_for_mask = a_mask_and_data_values[
"n-packets"]().as_uint();
153 const scarab::param_array t_new_mask = a_mask_and_data_values[
"mask"].as_array();
154 const scarab::param_array t_new_mask2 = a_mask_and_data_values[
"mask2"].as_array();
155 const scarab::param_array t_new_data_mean = a_mask_and_data_values[
"data-mean"].as_array();
156 const scarab::param_array t_new_data_variance = a_mask_and_data_values[
"data-variance"].as_array();
157 LDEBUG(
plog,
"Finished reading mask" );
163 f_mask.resize( t_new_mask.size() );
169 for(
unsigned i_bin = 0; i_bin < t_new_mask.size(); ++i_bin )
171 f_mask[ i_bin ] = t_new_mask[i_bin]().as_double();
178 if ( t_new_mask2.size() != t_new_mask.size() )
throw psyllid::error() <<
"new mask and new mask2 must have same size";
180 f_mask2.resize( t_new_mask2.size() );
181 for(
unsigned i_bin = 0; i_bin < t_new_mask2.size(); ++i_bin )
183 f_mask2[ i_bin ] = t_new_mask2[i_bin]().as_double();
190 LDEBUG(
plog,
"Requesting switch to update-mask mode" );
204 LDEBUG(
plog,
"Requesting switch to apply-trigger mode" );
217 LDEBUG(
plog,
"Switching to exe_apply_two_thresholds" );
220 LDEBUG(
plog,
"Break exe_func" );
236 throw error() <<
"Mask is empty";
239 scarab::param_node t_output_node;
240 t_output_node.add(
"timestamp", scarab::param_value( scarab::get_formatted_now() ) );
241 t_output_node.add(
"n-packets", scarab::param_value( f_n_packets_for_mask ) );
243 scarab::param_array t_mask_array = scarab::param_array();
244 t_mask_array.resize(
f_mask.size() );
245 for(
unsigned i_bin = 0; i_bin <
f_mask.size(); ++i_bin )
247 t_mask_array.assign( i_bin, scarab::param_value(
f_mask[ i_bin ] ) );
249 t_output_node.add(
"mask", t_mask_array );
253 scarab::param_array t_mask_array2 = scarab::param_array();
254 t_mask_array2.resize(
f_mask2.size() );
255 for(
unsigned i_bin = 0; i_bin <
f_mask2.size(); ++i_bin )
257 t_mask_array2.assign( i_bin, scarab::param_value(
f_mask2[ i_bin ] ) );
259 t_output_node.add(
"mask2", t_mask_array2 );
263 scarab::param_array t_mean_data_array = scarab::param_array();
264 scarab::param_array t_variance_data_array = scarab::param_array();
269 t_mean_data_array.assign( i_bin, scarab::param_value(
f_average_data[ i_bin ] ) );
270 t_variance_data_array.assign( i_bin, scarab::param_value(
f_variance_data[ i_bin ] ) );
272 t_output_node.add(
"data-mean", t_mean_data_array );
273 t_output_node.add(
"data-variance", t_variance_data_array );
275 scarab::param_translator t_param_translator = scarab::param_translator();
277 LTRACE(
plog,
"Mask file:\n" << t_output_node );
278 if( ! t_param_translator.write_file( t_output_node, a_filename ) )
280 throw error() <<
"Unable to write mask to file <" << a_filename <<
">";
301 LINFO(
plog,
"Starting main loop" );
314 LINFO(
plog,
"FMT has exited" );
325 double t_real = 0., t_imag = 0., t_abs_square = 0.;
326 unsigned t_array_size = 0;
328 LDEBUG(
plog,
"Entering add-to-mask loop" );
337 LTRACE(
plog,
"FMT read s_none" );
341 LTRACE(
plog,
"FMT read s_error" );
346 LDEBUG(
plog,
"Starting mask update" );
354 t_freq_data = in_stream< 0 >().data();
360 LTRACE(
plog,
"Already have enough packets for the mask; skipping this packet" );
364 LTRACE(
plog,
"Considering frequency data: chan = " << t_freq_data->
get_digital_id() <<
366 " id = " << t_freq_data->get_pkt_in_session() <<
368 " bin 0 [0] = " << (unsigned)t_freq_data->
get_array()[ 0 ][ 0 ] );
375 for(
unsigned i_bin = 0; i_bin < t_array_size; ++i_bin )
382 for(
unsigned i_bin = 0; i_bin < t_array_size; ++i_bin )
384 t_real = t_freq_data->
get_array()[ i_bin ][ 0 ];
385 t_imag = t_freq_data->
get_array()[ i_bin ][ 1 ];
386 t_abs_square = t_real*t_real + t_imag*t_imag;
392 LTRACE(
plog,
"Added data to frequency mask; mask now has " <<
f_n_summed <<
" packets" );
403 LDEBUG(
plog,
"Calculating spline for frequency mask" );
404 std::vector< double > t_x_vals( f_n_spline_points );
405 std::vector< double > t_y_vals( f_n_spline_points );
413 t_spline.set_points( t_x_vals, t_y_vals );
416 LDEBUG(
plog,
"Calculating frequency sigma mask" );
418 for(
unsigned i_bin = 0; i_bin <
f_mask.size(); ++i_bin )
420 f_mask[ i_bin ] = t_spline( i_bin );
428 t_spline.set_points( t_x_vals, t_y_vals );
430 LDEBUG(
plog,
"Calculating frequency sigma mask2" );
433 for(
unsigned i_bin = 0; i_bin <
f_mask2.size(); ++i_bin )
435 f_mask2[ i_bin ] = t_spline( i_bin );
445 t_spline.set_points( t_x_vals, t_y_vals );
448 LDEBUG(
plog,
"Calculating frequency snr mask" );
451 for(
unsigned i_bin = 0; i_bin <
f_mask.size(); ++i_bin )
453 f_mask[ i_bin ] = t_spline( i_bin );
461 t_spline.set_points( t_x_vals, t_y_vals );
463 LDEBUG(
plog,
"Calculating frequency snr mask2" );
466 for(
unsigned i_bin = 0; i_bin <
f_mask2.size(); ++i_bin )
468 f_mask2[ i_bin ] = t_spline( i_bin );
479 LERROR(
plog,
"Exiting due to error while processing frequency data: " << e.
what() );
486 LDEBUG(
plog,
"FMT is stopping" );
489 LWARN(
plog,
"FMT is stopping: it did not process enough packets to update the mask" );
494 LDEBUG(
plog,
"FMT is exiting" );
497 LWARN(
plog,
"FMT is exiting: it did not process enough packets to update the mask" );
504 LTRACE(
plog,
"FMT (update-mask) reading stream at index " << in_stream< 0 >().get_current_index() );
508 LDEBUG(
plog,
"FMT has exited the add-to-mask while loop; possible reasons: is_canceled() = " << is_canceled() <<
"; f_break_exe_func.load() = " <<
f_break_exe_func.load() );
511 LINFO(
plog,
"FMT is switching exe while loops" );
516 LINFO(
plog,
"FMT is exiting" );
519 LDEBUG(
plog,
"Stopping output stream" );
520 if( ! out_stream< 0 >().
set( stream::s_stop ) )
return;
522 LDEBUG(
plog,
"Exiting output stream" );
523 out_stream< 0 >().
set( stream::s_exit );
529 if( a_ctx.
f_midge ) a_ctx.
f_midge->throw_ex( std::current_exception() );
542 double t_real = 0., t_imag = 0., t_power_amp = 0.;
543 unsigned t_array_size = 0;
544 unsigned t_loop_lower_limit = 0;
545 unsigned t_loop_upper_limit = 0;
548 std::vector< double > t_mask_buffer(
f_mask );
551 LDEBUG(
plog,
"Entering apply-threshold loop" );
560 LTRACE(
plog,
"FMT read s_none" );
564 LTRACE(
plog,
"FMT read s_error" );
569 LDEBUG(
plog,
"Starting the FMT; output at stream index " << out_stream< 0 >().get_current_index() );
570 if( ! out_stream< 0 >().
set( stream::s_start ) )
break;
575 t_freq_data = in_stream< 0 >().data();
576 t_trigger_flag = out_stream< 0 >().data();
578 LTRACE(
plog,
"Considering frequency data: chan = " << t_freq_data->
get_digital_id() <<
580 " id = " << t_freq_data->get_pkt_in_session() <<
582 " bin 0 [0] = " << (unsigned)t_freq_data->
get_array()[ 0 ][ 0 ] );
586 t_loop_lower_limit = f_n_excluded_bins;
587 t_loop_upper_limit = t_array_size - f_n_excluded_bins;
588 LDEBUG(
plog,
"Array size: "<<t_array_size );
589 LDEBUG(
plog,
"Looping from "<<t_loop_lower_limit<<
" to "<<t_loop_upper_limit-1 );
593 if( t_mask_buffer.size() != t_array_size )
595 throw psyllid::error() <<
"Frequency mask is not the same size as frequency data array";
600 t_trigger_flag->set_flag(
false );
601 t_trigger_flag->set_high_threshold(
false );
602 t_trigger_flag->set_id( t_freq_data->get_pkt_in_session() );
604 for(
unsigned i_bin = t_loop_lower_limit; i_bin < t_loop_upper_limit; ++i_bin )
606 t_real = t_freq_data->
get_array()[ i_bin ][ 0 ];
607 t_imag = t_freq_data->
get_array()[ i_bin ][ 1 ];
608 t_power_amp = t_real*t_real + t_imag*t_imag;
610 if( t_power_amp >= t_mask_buffer[ i_bin ] )
612 t_trigger_flag->set_flag(
true );
613 t_trigger_flag->set_high_threshold(
true );
614 LDEBUG(
plog,
"Data id <" << t_trigger_flag->get_id() <<
"> [bin " << i_bin <<
615 "] resulted in flag <" << t_trigger_flag->get_flag() <<
">" <<
'\n' <<
616 "\tdata: " << t_power_amp <<
"; mask1: " << t_mask_buffer[ i_bin ] );
621 if( ! t_trigger_flag->get_flag() )
623 LTRACE(
plog,
"Data id <" << t_trigger_flag->get_id() <<
"> resulted in flag <" << t_trigger_flag->get_flag() <<
">");
627 LTRACE(
plog,
"FMT writing data to output stream at index " << out_stream< 0 >().get_current_index() );
628 if( ! out_stream< 0 >().
set( stream::s_run ) )
630 LERROR(
plog,
"Exiting due to stream error" );
631 throw midge::node_nonfatal_error() <<
"Stream error while applying threshold";
636 LERROR(
plog,
"Exiting due to error while processing frequency data: " << e.
what() );
643 LDEBUG(
plog,
"FMT is stopping at stream index " << out_stream< 0 >().get_current_index() );
644 if( ! out_stream< 0 >().
set( stream::s_stop ) )
break;
648 LDEBUG(
plog,
"FMT is exiting at stream index " << out_stream< 0 >().get_current_index() );
649 out_stream< 0 >().
set( stream::s_exit );
654 LTRACE(
plog,
"FMT (apply-threshold) reading stream at index " << in_stream< 0 >().get_current_index() );
658 LDEBUG(
plog,
"FMT has exited the apply-threshold while loop; possible reasons: is_canceled() = " <<
659 is_canceled() <<
"; f_break_exe_func.load() = " <<
f_break_exe_func.load() );
662 LINFO(
plog,
"FMT is switching exe while loops" );
667 LINFO(
plog,
"FMT is exiting" );
670 LDEBUG(
plog,
"Stopping output stream" );
671 if( ! out_stream< 0 >().
set( stream::s_stop ) )
return;
673 LDEBUG(
plog,
"Exiting output stream" );
674 out_stream< 0 >().
set( stream::s_exit );
680 if( a_ctx.
f_midge ) a_ctx.
f_midge->throw_ex( std::current_exception() );
694 double t_real = 0., t_imag = 0., t_power_amp = 0.;
695 unsigned t_array_size = 0;
696 unsigned t_loop_lower_limit = 0;
697 unsigned t_loop_upper_limit = 0;
701 std::vector< double > t_mask_buffer(
f_mask );
702 std::vector< double > t_mask2_buffer(
f_mask2 );
704 LDEBUG(
plog,
"mask sizes: " << t_mask_buffer.size() <<
" " << t_mask2_buffer.size() );
708 LDEBUG(
plog,
"Entering apply-two-thresholds loop" );
718 LTRACE(
plog,
"FMT read s_none" );
722 LTRACE(
plog,
"FMT read s_error" );
727 LDEBUG(
plog,
"Starting the FMT; output at stream index " << out_stream< 0 >().get_current_index() );
728 if( ! out_stream< 0 >().
set( stream::s_start ) )
break;
733 t_freq_data = in_stream< 0 >().data();
734 t_trigger_flag = out_stream< 0 >().data();
736 LTRACE(
plog,
"Considering frequency data: chan = " << t_freq_data->
get_digital_id() <<
738 " id = " << t_freq_data->get_pkt_in_session() <<
740 " bin 0 [0] = " << (unsigned)t_freq_data->
get_array()[ 0 ][ 0 ] );
744 t_loop_lower_limit = f_n_excluded_bins;
745 t_loop_upper_limit = t_array_size - f_n_excluded_bins;
746 LDEBUG(
plog,
"Array size: "<<t_array_size );
747 LDEBUG(
plog,
"Looping from "<<t_loop_lower_limit<<
" to "<<t_loop_upper_limit-1 );
753 throw psyllid::error() <<
"Frequency mask is not the same size as frequency data array";
757 throw psyllid::error() <<
"Frequency mask2 is not the same size as frequency data array";
762 t_trigger_flag->set_flag(
false );
763 t_trigger_flag->set_high_threshold(
false );
764 t_trigger_flag->set_id( t_freq_data->get_pkt_in_session() );
766 for(
unsigned i_bin = t_loop_lower_limit; i_bin < t_loop_upper_limit; ++i_bin )
768 t_real = t_freq_data->
get_array()[ i_bin ][ 0 ];
769 t_imag = t_freq_data->
get_array()[ i_bin ][ 1 ];
770 t_power_amp = t_real*t_real + t_imag*t_imag;
772 if( t_power_amp >= t_mask2_buffer[ i_bin ] )
774 t_trigger_flag->set_flag(
true );
775 t_trigger_flag->set_high_threshold(
true );
776 LDEBUG(
plog,
"Data " << t_trigger_flag->get_id() <<
" [bin " << i_bin <<
777 "] resulted in flag <" << t_trigger_flag->get_flag() <<
">" <<
'\n' <<
778 "\tdata: " << t_power_amp <<
"; mask2: " << t_mask2_buffer[ i_bin ] );
781 else if( t_power_amp >= t_mask_buffer[ i_bin ] )
783 t_trigger_flag->set_flag(
true );
784 t_trigger_flag->set_high_threshold(
false );
785 LTRACE(
plog,
"Data id <" << t_trigger_flag->get_id() <<
"> [bin " << i_bin <<
786 "] resulted in flag <" << t_trigger_flag->get_flag() <<
">" <<
'\n' <<
787 "\tdata: " << t_power_amp <<
"; mask1: " << t_mask_buffer[ i_bin ] );
792 if( ! t_trigger_flag->get_flag() )
794 LTRACE(
plog,
"Data id <" << t_trigger_flag->get_id() <<
"> resulted in flag <" <<
795 t_trigger_flag->get_flag() <<
">");
799 LTRACE(
plog,
"FMT writing data to output stream at index " << out_stream< 0 >().get_current_index() );
800 if( ! out_stream< 0 >().
set( stream::s_run ) )
802 LERROR(
plog,
"Exiting due to stream error" );
803 throw midge::node_nonfatal_error() <<
"Stream error while applying threshold";
808 LERROR(
plog,
"Exiting due to error while processing frequency data: " << e.
what() );
815 LDEBUG(
plog,
"FMT is stopping at stream index " << out_stream< 0 >().get_current_index() );
816 if( ! out_stream< 0 >().
set( stream::s_stop ) )
break;
820 LDEBUG(
plog,
"FMT is exiting at stream index " << out_stream< 0 >().get_current_index() );
821 out_stream< 0 >().
set( stream::s_exit );
826 LTRACE(
plog,
"FMT (apply-threshold) reading stream at index " << in_stream< 0 >().get_current_index() );
830 LDEBUG(
plog,
"FMT has exited the apply-two-threshold while loop; possible reasons: is_canceled() = " <<
831 is_canceled() <<
"; f_break_exe_func.load() = " <<
f_break_exe_func.load() );
834 LINFO(
plog,
"FMT is switching exe while loops" );
839 LINFO(
plog,
"FMT is exiting" );
842 LDEBUG(
plog,
"Stopping output stream" );
843 if( ! out_stream< 0 >().
set( stream::s_stop ) )
return;
845 LDEBUG(
plog,
"Exiting output stream" );
846 out_stream< 0 >().
set( stream::s_exit );
852 if( a_ctx.
f_midge ) a_ctx.
f_midge->throw_ex( std::current_exception() );
875 LDEBUG(
plog,
"Configuring frequency_mask_trigger with:\n" << a_config );
876 a_node->
set_n_packets_for_mask( a_config.get_value(
"n-packets-for-mask", a_node->get_n_packets_for_mask() ) );
877 a_node->set_n_spline_points( a_config.get_value(
"n-spline-points", a_node->get_n_spline_points() ) );
879 if( a_config.has(
"threshold-ampl-snr" ) )
883 if( a_config.has(
"threshold-power-snr" ) )
885 a_node->set_threshold_snr( a_config[
"threshold-power-snr"]().as_double() );
887 if( a_config.has(
"threshold-power-snr-high" ) )
889 a_node->set_threshold_snr_high( a_config[
"threshold-power-snr-high"]().as_double() );
891 if( a_config.has(
"threshold-power-sigma" ) )
893 a_node->set_threshold_sigma( a_config[
"threshold-power-sigma"]().as_double() );
895 if( a_config.has(
"threshold-power-sigma-high" ) )
897 a_node->set_threshold_sigma_high( a_config[
"threshold-power-sigma-high"]().as_double() );
899 if( a_config.has(
"threshold-db" ) )
903 if( a_config.has(
"trigger-mode" ) )
907 if( a_config.has(
"threshold-type" ) )
911 if( a_config.has(
"n-excluded-bins" ))
913 a_node->set_n_excluded_bins( a_config[
"n-excluded-bins"]().as_uint() );
915 if( a_config.has(
"mask-configuration" ) )
917 const scarab::param& t_mask_config = a_config[
"mask-configuration"];
918 if ( t_mask_config.is_value() )
920 scarab::param_translator t_param_translator = scarab::param_translator();
921 scarab::param_ptr_t t_file_param = t_param_translator.read_file( t_mask_config.as_value().as_string() );
922 if ( t_file_param->is_node() )
931 else if ( t_mask_config.is_node() )
937 throw psyllid::error() <<
"invalid config: mask-configuration must be a file path or a node with mask and mask-data";
941 a_node->set_length( a_config.get_value(
"length", a_node->get_length() ) );
947 LDEBUG(
plog,
"Dumping configuration for frequency_mask_trigger" );
948 a_config.add(
"n-packets-for-mask", a_node->get_n_packets_for_mask() );
949 a_config.add(
"n-spline-points", a_node->get_n_spline_points() );
950 a_config.add(
"length", a_node->get_length() );
953 a_config.add(
"n-excluded-bins", a_node->get_n_excluded_bins() );
956 switch ( a_node->get_threshold_type() )
959 a_config.add(
"threshold-power-snr", a_node->get_threshold_snr() );
960 a_config.add(
"threshold-power-snr-high", a_node->get_threshold_snr_high() );
963 a_config.add(
"threshold-power-sigma", a_node->get_threshold_sigma() );
964 a_config.add(
"threshold-power-sigma-high", a_node->get_threshold_sigma_high() );
973 if( a_cmd ==
"update-mask" )
978 else if( a_cmd ==
"apply-trigger" )
983 else if( a_cmd ==
"write-mask" )
987 a_node->
write_mask( a_args.get_value(
"filename",
"fmt_mask.yaml" ) );
997 LWARN(
plog,
"Unrecognized command: <" << a_cmd <<
">" );
void calculate_sigma_mask_spline_points(std::vector< double > &t_x_vals, std::vector< double > &t_y_vals, double threshold)
static uint32_t threshold_to_uint(threshold_t a_threshold)
const char * what() const
std::string get_trigger_mode_str() const
void exe_add_to_mask(exe_func_context &a_ctx)
virtual ~frequency_mask_trigger_binding()
static scarab::logger plog("batch_executor")
static std::string trigger_mode_to_string(trigger_mode_t a_trigger_mode)
static uint32_t trigger_mode_to_uint(trigger_mode_t a_trigger_mode)
void set_threshold_ampl_snr(double a_ampl_snr)
std::vector< double > f_variance_data
virtual void do_apply_config(frequency_mask_trigger *a_node, const scarab::param_node &a_config) const
void set_mask_parameters_from_node(const scarab::param_node &a_mask_and_data_values)
void write_mask(const std::string &a_filename)
std::string get_threshold_type_str() const
void switch_to_apply_trigger()
std::mutex f_exe_func_mutex
void(frequency_mask_trigger::* f_exe_func)(exe_func_context &a_ctx)
virtual bool do_run_command(frequency_mask_trigger *a_node, const std::string &a_cmd, const scarab::param_node &a_args) const
in derived classes, should throw a std::exception if the command fails, and return false if the comma...
midge::enum_t f_in_command
static std::string threshold_to_string(threshold_t a_threshold)
void set_n_packets_for_mask(unsigned a_n_pkts)
REGISTER_NODE_AND_BUILDER(data_producer, "data-producer", data_producer_binding)
static trigger_mode_t string_to_trigger_mode(const std::string &a_trigger_mode)
bool get_freq_not_time() const
void exe_apply_threshold(exe_func_context &a_ctx)
LOGGER(plog, "egg_writer")
std::vector< double > f_mask2
void calculate_snr_mask_spline_points(std::vector< double > &t_x_vals, std::vector< double > &t_y_vals, double threshold)
std::vector< double > f_average_data
void set_threshold_dB(double a_dB)
uint32_t get_digital_id() const
frequency_mask_trigger_binding()
virtual ~frequency_mask_trigger()
void set_threshold_type(const std::string &a_threshold_type)
static threshold_t string_to_threshold(const std::string &a_threshold_string)
void set_trigger_mode(const std::string &a_trigger_mode)
bool f_first_packet_after_start
virtual void do_dump_config(const frequency_mask_trigger *a_node, scarab::param_node &a_config) const
std::atomic< bool > f_break_exe_func
std::vector< double > f_mask
const iq_t * get_array() const
void exe_apply_two_thresholds(exe_func_context &a_ctx)
size_t get_array_size() const
void execute(midge::diptera *a_midge=nullptr)
void switch_to_update_mask()
uint32_t get_unix_time() const