15 #include "midge_error.hh" 18 #include "signal_handler.hh" 21 #include <condition_variable> 26 using scarab::param_array;
27 using scarab::param_node;
28 using scarab::param_value;
29 using scarab::param_ptr_t;
31 using dripline::request_ptr_t;
42 f_activation_condition(),
44 f_node_manager( a_mgr ),
47 f_node_bindings( nullptr ),
50 f_do_break_run( false ),
53 f_run_duration( 1000 ),
54 f_use_monarch( true ),
55 f_status(
status::deactivated )
58 if( a_master_config.has(
"daq" ) )
63 set_run_duration(
f_daq_config.get_value(
"duration", get_run_duration() ) );
72 butterfly_house::get_instance()->prepare_files(
f_daq_config );
76 void daq_control::execute( std::condition_variable& a_ready_condition_variable, std::mutex& a_ready_mutex )
79 std::future< void > t_activation_return;
80 if(
f_daq_config.get_value(
"activate-at-startup",
false ) )
82 LDEBUG(
plog,
"Will activate DAQ control asynchronously" );
83 t_activation_return = std::async( std::launch::async,
86 std::this_thread::sleep_for( std::chrono::milliseconds(250) );
87 LDEBUG(
plog,
"Activating DAQ control at startup" );
94 while( ! is_canceled() )
102 std::unique_lock< std::mutex > t_lock(
f_daq_mutex );
103 LDEBUG(
plog,
"DAQ control waiting for activation signal; status is " <<
interpret_status( t_status ) );
110 LPROG(
plog,
"DAQ control activating" );
116 LDEBUG(
plog,
"Reseting midge" );
122 LWARN(
plog,
"Exception caught while resetting midge: " << e.
what() );
123 LWARN(
plog,
"Returning to the \"deactivated\" state and awaiting further instructions" );
129 LDEBUG(
plog,
"Acquiring midge package" );
134 LERROR(
plog,
"Could not get midge resource" );
142 [
this, &a_ready_condition_variable, &a_ready_mutex]() {
144 std::lock_guard<std::mutex> ready_lock(a_ready_mutex);
145 a_ready_condition_variable.notify_all();
152 std::exception_ptr t_e_ptr;
157 LDEBUG(
plog,
"Starting midge with run string <" << t_run_string <<
">" );
159 LINFO(
plog,
"DAQ control is shutting down after midge exited" );
161 catch( std::exception& e )
163 LERROR(
plog,
"An exception was thrown while running midge: " << e.what() );
168 LDEBUG(
plog,
"Midge has finished running" );
171 LDEBUG(
plog,
"An exception from midge is present; rethrowing" );
174 std::rethrow_exception( t_e_ptr );
176 catch( midge::error& e )
178 LERROR(
plog,
"A Midge error has been caught: " << e.what() );
182 catch( midge::node_fatal_error& e )
184 LERROR(
plog,
"A fatal node error was thrown from midge: " << e.what() );
188 catch( midge::node_nonfatal_error& e )
190 LWARN(
plog,
"A non-fatal node error was thrown from midge: " << e.what() );
192 "Psyllid is still running (hopefully) but its state has been reset.\n" +
193 "Error details: " + e.what() );
196 catch( std::exception& e )
198 LERROR(
plog,
"An unknown exception was thrown from midge: " << e.what() );
202 LDEBUG(
plog,
"Calling stop_run" );
211 LERROR(
plog,
"Midge exited abnormally; error condition is unknown; canceling" );
212 scarab::signal_handler::cancel_all( RETURN_ERROR );
217 LERROR(
plog,
"Canceling due to midge error" );
218 f_msg_relay->
slack_error(
"Psyllid has crashed due to an error while running. Hopefully the details have already been reported." );
219 scarab::signal_handler::cancel_all( RETURN_ERROR );
224 LDEBUG(
plog,
"Setting status to deactivated" );
226 LINFO(
plog,
"Commencing restart of the DAQ" );
228 std::this_thread::sleep_for( std::chrono::milliseconds(250) );
229 LDEBUG(
plog,
"Will activate DAQ control asynchronously" );
230 t_activation_return = std::async( std::launch::async,
233 std::this_thread::sleep_for( std::chrono::milliseconds(250) );
234 LDEBUG(
plog,
"Restarting DAQ control" );
242 LERROR(
plog,
"DAQ control status is activated in the outer execution loop!" );
249 LDEBUG(
plog,
"DAQ control deactivating; status now set to \"deactivated\"" );
254 LINFO(
plog,
"Exiting DAQ control" );
260 LERROR(
plog,
"DAQ control is in an error state" );
263 scarab::signal_handler::cancel_all( RETURN_ERROR );
273 LDEBUG(
plog,
"Activating DAQ control" );
277 throw error() <<
"DAQ control has been canceled";
282 throw status_error() <<
"DAQ control is not in the deactivated state";
285 LDEBUG(
plog,
"Setting status to activating" );
295 std::this_thread::sleep_for( std::chrono::seconds(1) );
302 LDEBUG(
plog,
"Deactivating DAQ" );
306 throw error() <<
"DAQ control has been canceled";
317 LDEBUG(
plog,
"Canceling DAQ worker from DAQ control" );
331 LDEBUG(
plog,
"Preparing for run" );
335 throw error() <<
"daq_control has been canceled";
340 throw status_error() <<
"DAQ control must be in the activated state to start a run; activate the DAQ and try again";
345 throw error() <<
"Do not have midge resource";
348 LDEBUG(
plog,
"Launching asynchronous do_run" );
359 LINFO(
plog,
"Run is commencing" );
364 LDEBUG(
plog,
"Starting egg files" );
367 butterfly_house::get_instance()->start_files();
369 catch( std::exception& e )
371 LERROR(
plog,
"Unable to start files: " << e.what() );
374 LDEBUG(
plog,
"Canceling midge" );
380 typedef std::chrono::steady_clock::duration duration_t;
381 typedef std::chrono::steady_clock::time_point time_point_t;
383 duration_t t_run_duration = std::chrono::duration_cast< duration_t >( std::chrono::milliseconds(a_duration) );
384 duration_t t_sub_duration = std::chrono::duration_cast< duration_t >( std::chrono::milliseconds(500) );
385 LINFO(
plog,
"Run duration will be " << a_duration <<
" ms; sub-durations of 500 ms will be used" );
386 LDEBUG(
plog,
"In units of steady_clock::duration: run duration is " << t_run_duration.count() <<
" and sub_duration is " << t_sub_duration.count() );
391 LDEBUG(
plog,
"Unpausing midge" );
396 LERROR(
plog,
"Midge resource is not available" );
400 if( a_duration == 0 )
402 LDEBUG(
plog,
"Untimed run stopper in use" );
413 LDEBUG(
plog,
"Timed run stopper in use; limit is " << a_duration <<
" ms" );
420 time_point_t t_run_start = std::chrono::steady_clock::now();
421 time_point_t t_run_end = t_run_start + t_run_duration;
423 while( std::chrono::steady_clock::now() < t_run_end && !
f_do_break_run && ! is_canceled() )
426 f_run_stopper.wait_until( t_run_stop_lock, std::min( std::chrono::steady_clock::now() + t_sub_duration, t_run_end ) );
434 LDEBUG(
plog,
"Run stopper has been released" );
439 LINFO(
plog,
"Run has stopped" );
443 if( is_canceled() ) LINFO(
plog,
"Run was cancelled" );
447 LDEBUG(
plog,
"Finishing egg files" );
450 butterfly_house::get_instance()->finish_files();
452 catch( std::exception& e )
454 LERROR(
plog,
"Unable to finish files: " << e.what() );
457 LDEBUG(
plog,
"Canceling midge" );
468 LINFO(
plog,
"Run stop requested" );
483 LDEBUG(
plog,
"Canceling DAQ control" );
487 LDEBUG(
plog,
"Canceling run" );
494 LERROR(
plog,
"Unable to complete stop-run: " << e.
what() );
498 LDEBUG(
plog,
"Canceling midge" );
510 throw error() <<
"Can't apply config to node <" << a_node_name <<
">: node bindings aren't available";
513 active_node_bindings::iterator t_binding_it =
f_node_bindings->find( a_node_name );
516 throw error() <<
"Can't apply config to node <" << a_node_name <<
">: did not find node";
521 LDEBUG(
plog,
"Applying config to active node <" << a_node_name <<
">: " << a_config );
522 t_binding_it->second.first->apply_config( t_binding_it->second.second, a_config );
524 catch( std::exception& e )
526 throw error() <<
"Can't apply config to node <" << a_node_name <<
">: " << e.
what();
535 throw error() <<
"Can't dump config from node <" << a_node_name <<
">: node bindings aren't available";
540 throw error() <<
"Can't dump config from node <" << a_node_name <<
">: node bindings aren't available";
543 active_node_bindings::iterator t_binding_it =
f_node_bindings->find( a_node_name );
546 throw error() <<
"Can't dump config from node <" << a_node_name <<
">: did not find node";
551 LDEBUG(
plog,
"Dumping config from active node <" << a_node_name <<
">" );
552 t_binding_it->second.first->dump_config( t_binding_it->second.second, a_config );
554 catch( std::exception& e )
556 throw error() <<
"Can't dump config from node <" << a_node_name <<
">: " << e.
what();
565 throw error() <<
"Can't run command <" << a_cmd <<
"> on node <" << a_node_name <<
">: node bindings aren't available";
570 throw error() <<
"Can't run command <" << a_cmd <<
"> on node <" << a_node_name <<
">: node bindings aren't available";
573 active_node_bindings::iterator t_binding_it =
f_node_bindings->find( a_node_name );
576 throw error() <<
"Can't run command <" << a_cmd <<
"> on node <" << a_node_name <<
">: did not find node";
581 LDEBUG(
plog,
"Running command <" << a_cmd <<
"> on active node <" << a_node_name <<
">" );
582 return t_binding_it->second.first->run_command( t_binding_it->second.second, a_cmd, a_args );
584 catch( std::exception& e )
586 throw error() <<
"Can't run command <" << a_cmd <<
"> on node <" << a_node_name <<
">: " << e.
what();
596 return a_request->reply( dripline::dl_success(),
"DAQ control activated" );
600 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to activate DAQ control: " ) + e.
what() );
609 return a_request->reply( dripline::dl_success(),
"DAQ control reactivated" );
613 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to reactivate DAQ control: " ) + e.
what() );
622 return a_request->reply( dripline::dl_success(),
"DAQ control deactivated" );
626 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to deactivate DAQ control: " ) + e.
what() );
634 if( a_request->payload().is_node() )
636 param_node& t_payload = a_request->payload().as_node();
637 if( t_payload.has(
"filename" ) )
set_filename( t_payload[
"filename"]().as_string(), 0 );
639 if( t_payload.as_node().has(
"filenames" ) )
641 const scarab::param_array t_filenames = t_payload[
"filenames"].as_array();
642 for(
unsigned i_fn = 0; i_fn < t_filenames.size(); ++i_fn )
648 if( t_payload.has(
"description" ) )
set_description( t_payload[
"description"]().as_string(), 0 );
649 if( t_payload.has(
"descriptions" ) )
651 const scarab::param_array t_descriptions = t_payload[
"descriptions"].as_array();
652 for(
unsigned i_fn = 0; i_fn < t_descriptions.size(); ++i_fn )
658 f_run_duration = a_request->payload().get_value(
"duration", f_run_duration );
662 return a_request->reply( dripline::dl_success(),
"Run started" );
664 catch( std::exception& e )
666 LWARN(
plog,
"there was an error starting a run" );
667 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to start run: " ) + e.what() );
676 return a_request->reply( dripline::dl_success(),
"Run stopped" );
680 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to stop run: " ) + e.
what() );
686 if( a_request->parsed_specifier().size() < 2 )
688 return a_request->reply( dripline::dl_message_error_invalid_key(),
"Specifier is improperly formatted: active-config.[stream].[node] or node-config.[stream].[node].[parameter]" );
693 std::string t_target_stream = a_request->parsed_specifier().front();
694 a_request->parsed_specifier().pop_front();
696 std::string t_target_node = t_target_stream +
"_" + a_request->parsed_specifier().front();
697 a_request->parsed_specifier().pop_front();
699 param_ptr_t t_payload_ptr(
new param_node() );
700 param_node& t_payload = t_payload_ptr->as_node();
702 if( a_request->parsed_specifier().empty() )
705 LDEBUG(
plog,
"Performing config for multiple values in active node <" << t_target_node <<
">" );
707 if( ! a_request->payload().is_node() || a_request->payload().as_node().empty() )
709 return a_request->reply( dripline::dl_message_error_bad_payload(),
"Unable to perform active-config request: payload is empty" );
714 apply_config( t_target_node, a_request->payload().as_node() );
715 t_payload.merge( a_request->payload().as_node() );
717 catch( std::exception& e )
719 return a_request->reply( dripline::dl_device_error(), std::string(
"Unable to perform node-config request: ") + e.what() );
725 LDEBUG(
plog,
"Performing node config for a single value in active node <" << t_target_node <<
">" );
727 if( ! a_request->payload().is_node() || ! a_request->payload().as_node().has(
"values" ) )
729 return a_request->reply( dripline::dl_message_error_bad_payload(),
"Unable to perform active-config (single value): values array is missing" );
731 scarab::param_array t_values_array;
732 if ( a_request->payload().as_node().has(
"values") ) {
733 t_values_array.append( a_request->payload()[
"values"].as_array() );
735 if( t_values_array.empty() || ! t_values_array[0].is_value() )
737 return a_request->reply( dripline::dl_message_error_bad_payload(),
"Unable to perform active-config (single value): \"values\" is not an array, or the array is empty, or the first element in the array is not a value", std::move(t_payload_ptr) );
740 scarab::param_node t_param_to_set;
741 t_param_to_set.add( a_request->parsed_specifier().front(), scarab::param_value( t_values_array[0].as_value() ) );
746 t_payload.merge( t_param_to_set );
748 catch( std::exception& e )
750 return a_request->reply( dripline::dl_device_error(), std::string(
"Unable to perform active-config request (single value): ") + e.what(), std::move(t_payload_ptr) );
754 LDEBUG(
plog,
"Node-config was successful" );
755 return a_request->reply( dripline::dl_success(),
"Performed node-config", std::move(t_payload_ptr) );
760 if( a_request->parsed_specifier().size() < 2 )
762 return a_request->reply( dripline::dl_message_error_invalid_key(),
"Specifier is improperly formatted: active-config.[stream].[node] or active-config.[stream].[node].[parameter]" );
767 std::string t_target_stream = a_request->parsed_specifier().front();
768 a_request->parsed_specifier().pop_front();
770 std::string t_target_node = t_target_stream +
"_" + a_request->parsed_specifier().front();
771 a_request->parsed_specifier().pop_front();
773 param_ptr_t t_payload_ptr(
new param_node() );
774 param_node& t_payload = t_payload_ptr->as_node();
776 if( a_request->parsed_specifier().empty() )
779 LDEBUG(
plog,
"Getting node config for active node <" << t_target_node <<
">" );
785 catch( std::exception& e )
787 return a_request->reply( dripline::dl_device_error(), std::string(
"Unable to perform get-active-config request: ") + e.what(), std::move(t_payload_ptr) );
793 LDEBUG(
plog,
"Getting value for a single parameter in active node <" << t_target_node <<
">" );
795 std::string t_param_to_get = a_request->parsed_specifier().front();
799 scarab::param_node t_param_dump;
801 if( ! t_param_dump.has( t_param_to_get ) )
803 return a_request->reply( dripline::dl_message_error_invalid_key(),
"Unable to get active-node parameter: cannot find parameter <" + t_param_to_get +
">" );
805 t_payload.add( t_param_to_get, t_param_dump[t_param_to_get]() );
807 catch( std::exception& e )
809 return a_request->reply( dripline::dl_device_error(), std::string(
"Unable to get active-node parameter (single value): ") + e.what(), std::move(t_payload_ptr) );
813 LDEBUG(
plog,
"Get-active-node-config was successful" );
814 return a_request->reply( dripline::dl_success(),
"Performed get-active-node-config", std::move(t_payload_ptr) );
819 if( a_request->parsed_specifier().size() < 2 )
821 return a_request->reply( dripline::dl_message_error_invalid_key(),
"RKS is improperly formatted: run-command.[stream].[node].[command]" );
826 std::string t_target_stream = a_request->parsed_specifier().front();
827 a_request->parsed_specifier().pop_front();
829 std::string t_target_node = t_target_stream +
"_" + a_request->parsed_specifier().front();
830 a_request->parsed_specifier().pop_front();
832 scarab::param_node t_args_node;
833 if( a_request->payload().is_node() ) t_args_node = a_request->payload().as_node();
835 std::string t_command( a_request->parsed_specifier().front() );
836 a_request->parsed_specifier().pop_front();
838 LDEBUG(
plog,
"Performing run-command <" << t_command <<
"> for active node <" << t_target_node <<
">; args:\n" << t_args_node );
840 param_ptr_t t_payload_ptr(
new param_node() );
841 param_node& t_payload = t_payload_ptr->as_node();
843 bool t_return =
false;
846 t_return =
run_command( t_target_node, t_command, t_args_node );
847 t_payload.merge( t_args_node );
848 t_payload.add(
"command", t_command );
850 catch( std::exception& e )
852 return a_request->reply( dripline::dl_device_error(), std::string(
"Unable to perform run-command request: ") + e.what(), std::move(t_payload_ptr) );
857 LDEBUG(
plog,
"Active run-command execution was successful" );
858 return a_request->reply( dripline::dl_success(),
"Performed active run-command execution", std::move(t_payload_ptr) );
862 LWARN(
plog,
"Active run-command execution failed" );
863 return a_request->reply( dripline::dl_message_error_invalid_method(),
"Command was not recognized", std::move(t_payload_ptr) );
871 unsigned t_file_num = 0;
872 if( a_request->parsed_specifier().size() > 0)
874 t_file_num = std::stoi( a_request->parsed_specifier().front() );
877 std::string t_filename = a_request->payload()[
"values"][0]().as_string();
878 LDEBUG(
plog,
"Setting filename for file <" << t_file_num <<
"> to <" << t_filename <<
">" );
880 return a_request->reply( dripline::dl_success(),
"Filename set" );
882 catch( std::exception& e )
884 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to set filename: " ) + e.what() );
892 unsigned t_file_num = 0;
893 if( a_request->parsed_specifier().size() > 0)
895 t_file_num = std::stoi( a_request->parsed_specifier().front() );
898 std::string t_description = a_request->payload()[
"values"][0]().as_string();
899 LDEBUG(
plog,
"Setting description for file <" << t_file_num <<
"> to <" << t_description <<
">" );
902 return a_request->reply( dripline::dl_success(),
"Description set" );
904 catch( std::exception& e )
906 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to set description: " ) + e.what() );
914 unsigned t_new_duration = a_request->payload()[
"values"][0]().as_uint();
915 if( t_new_duration == 0 )
917 throw error() <<
"Invalid duration: " << t_new_duration;
919 f_run_duration = t_new_duration;
921 LDEBUG(
plog,
"Duration set to <" << f_run_duration <<
"> ms" );
922 return a_request->reply( dripline::dl_success(),
"Duration set" );
924 catch( std::exception& e )
926 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to set duration: " ) + e.what() );
934 f_use_monarch = a_request->payload()[
"values"][0]().as_bool();
935 LDEBUG(
plog,
"Use-monarch set to <" << f_use_monarch <<
">" );
936 return a_request->reply( dripline::dl_success(),
"Use Monarch set" );
938 catch( std::exception& e )
940 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to set use-monarch: " ) + e.what() );
946 param_node t_server_node;
952 param_ptr_t t_payload_ptr(
new param_node() );
953 t_payload_ptr->as_node().add(
"server", t_server_node );
955 return a_request->reply( dripline::dl_success(),
"DAQ status request succeeded", std::move(t_payload_ptr) );
963 unsigned t_file_num = 0;
964 if( a_request->parsed_specifier().size() > 0)
966 t_file_num = std::stoi( a_request->parsed_specifier().front() );
969 param_array t_values_array;
970 t_values_array.push_back( param_value(
get_filename( t_file_num ) ) );
971 param_ptr_t t_payload_ptr(
new param_node() );
972 t_payload_ptr->as_node().add(
"values", t_values_array );
973 return a_request->reply( dripline::dl_success(),
"Filename request completed", std::move(t_payload_ptr) );
975 catch( scarab::error& e )
977 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to get description: " ) + e.what() );
985 unsigned t_file_num = 0;
986 if( a_request->parsed_specifier().size() > 0)
988 t_file_num = std::stoi( a_request->parsed_specifier().front() );
991 param_array t_values_array;
992 t_values_array.push_back( param_value(
get_description( t_file_num ) ) );
993 param_ptr_t t_payload_ptr(
new param_node() );
994 t_payload_ptr->as_node().add(
"values", t_values_array );
995 return a_request->reply( dripline::dl_success(),
"Description request completed", std::move(t_payload_ptr) );
997 catch( scarab::error& e )
999 return a_request->reply( dripline::dl_device_error(),
string(
"Unable to get description: " ) + e.what() );
1005 param_array t_values_array;
1006 t_values_array.push_back( param_value( f_run_duration ) );
1008 param_ptr_t t_payload_ptr(
new param_node() );
1009 t_payload_ptr->as_node().add(
"values", t_values_array );
1011 return a_request->reply( dripline::dl_success(),
"Duration request completed", std::move(t_payload_ptr) );
1016 param_array t_values_array;
1017 t_values_array.push_back( param_value( f_use_monarch ) );
1019 param_ptr_t t_payload_ptr(
new param_node() );
1020 t_payload_ptr->as_node().add(
"values", t_values_array );
1022 return a_request->reply( dripline::dl_success(),
"Use Monarch request completed", std::move(t_payload_ptr) );
1030 butterfly_house::get_instance()->set_filename( a_filename, a_file_num );
1043 return butterfly_house::get_instance()->get_filename( a_file_num );
1055 butterfly_house::get_instance()->set_description( a_desc, a_file_num );
1068 return butterfly_house::get_instance()->get_description( a_file_num );
1078 return static_cast< uint32_t
>( a_status );
1082 return static_cast< status >( a_value );
1089 return std::string(
"Deactivated" );
1092 return std::string(
"Activating" );
1095 return std::string(
"Activated" );
1098 return std::string(
"Running" );
1101 return std::string(
"Deactivating" );
1104 return std::string(
"Canceled" );
1107 return std::string(
"Done" );
1110 return std::string(
"Do Restart" );
1113 return std::string(
"Error" );
1116 return std::string(
"Unknown" );
dripline::reply_ptr_t handle_reactivate_daq_control(const dripline::request_ptr_t a_request)
std::future< void > f_run_return
const char * what() const
dripline::reply_ptr_t handle_apply_config_request(const dripline::request_ptr_t a_request)
void slack_error(const std::string &a_msg_text) const
dripline::reply_ptr_t handle_get_use_monarch_request(const dripline::request_ptr_t a_request)
const std::string & get_filename(unsigned a_file_num=0)
static status uint_to_status(uint32_t a_value)
static std::string interpret_status(status a_status)
static scarab::logger plog("batch_executor")
const std::string & get_description(unsigned a_file_num=0)
void do_run(unsigned a_duration)
dripline::reply_ptr_t handle_stop_run_request(const dripline::request_ptr_t a_request)
void dump_config(const std::string &a_node_name, scarab::param_node &a_config)
std::condition_variable f_run_stopper
void initialize()
Pre-execution initialization (call after setting the control_access pointer)
std::atomic< status > f_status
bool run_command(const std::string &a_node_name, const std::string &a_cmd, const scarab::param_node &a_args)
dripline::reply_ptr_t handle_start_run_request(const dripline::request_ptr_t a_request)
dripline::reply_ptr_t handle_set_use_monarch_request(const dripline::request_ptr_t a_request)
void apply_config(const std::string &a_node_name, const scarab::param_node &a_config)
status get_status() const
dripline::reply_ptr_t handle_get_duration_request(const dripline::request_ptr_t a_request)
daq_control(const scarab::param_node &a_master_config, std::shared_ptr< stream_manager > a_mgr)
dripline::reply_ptr_t handle_activate_daq_control(const dripline::request_ptr_t a_request)
Gives other classes access to daq_control.
std::shared_ptr< stream_manager > f_node_manager
static uint32_t status_to_uint(status a_status)
void slack_notice(const std::string &a_msg_text) const
midge_package f_midge_pkg
dripline::reply_ptr_t handle_get_status_request(const dripline::request_ptr_t a_request)
dripline::reply_ptr_t handle_run_command_request(const dripline::request_ptr_t a_request)
void set_status(status a_status)
void set_description(const std::string &a_desc, unsigned a_file_num=0)
void execute(std::condition_variable &a_ready_condition_variable, std::mutex &a_ready_mutex)
Run the DAQ control thread.
std::mutex f_run_stop_mutex
dripline::reply_ptr_t handle_get_filename_request(const dripline::request_ptr_t a_request)
void do_cancellation(int a_code)
dripline::reply_ptr_t handle_set_description_request(const dripline::request_ptr_t a_request)
scarab::param_node f_daq_config
LOGGER(plog, "egg_writer")
void slack_warn(const std::string &a_msg_text) const
std::condition_variable f_activation_condition
active_node_bindings * f_node_bindings
dripline::reply_ptr_t handle_dump_config_request(const dripline::request_ptr_t a_request)
bool is_ready_at_startup() const
void set_filename(const std::string &a_filename, unsigned a_file_num=0)
message_relayer * f_msg_relay
dripline::reply_ptr_t handle_set_duration_request(const dripline::request_ptr_t a_request)
dripline::reply_ptr_t handle_get_description_request(const dripline::request_ptr_t a_request)
dripline::reply_ptr_t handle_deactivate_daq_control(const dripline::request_ptr_t a_request)
dripline::reply_ptr_t handle_set_filename_request(const dripline::request_ptr_t a_request)