diff --git a/cwIoFlowCtl.cpp b/cwIoFlowCtl.cpp index 95dfbce..c0ab950 100644 --- a/cwIoFlowCtl.cpp +++ b/cwIoFlowCtl.cpp @@ -729,6 +729,12 @@ bool cw::io_flow_ctl::program_is_initialized( handle_t h ) return p->init_fl; } +const cw::flow::ui_net_t* cw::io_flow_ctl::program_ui_net( handle_t h ) +{ + io_flow_ctl_t* p = _handleToPtr(h); + return ui_net(p->flowH); +} + cw::rc_t cw::io_flow_ctl::exec_nrt( handle_t h ) { @@ -801,6 +807,33 @@ bool cw::io_flow_ctl::is_exec_complete( handle_t h ) } +cw::rc_t cw::io_flow_ctl::get_variable_value( handle_t h, const flow::ui_var_t* ui_var, bool& value_ref ) +{ return get_variable_value( _handleToPtr(h)->flowH, ui_var, value_ref ); } +cw::rc_t cw::io_flow_ctl::get_variable_value( handle_t h, const flow::ui_var_t* ui_var, int& value_ref ) +{ return get_variable_value( _handleToPtr(h)->flowH, ui_var, value_ref ); } +cw::rc_t cw::io_flow_ctl::get_variable_value( handle_t h, const flow::ui_var_t* ui_var, unsigned& value_ref ) +{ return get_variable_value( _handleToPtr(h)->flowH, ui_var, value_ref ); } +cw::rc_t cw::io_flow_ctl::get_variable_value( handle_t h, const flow::ui_var_t* ui_var, float& value_ref ) +{ return get_variable_value( _handleToPtr(h)->flowH, ui_var, value_ref ); } +cw::rc_t cw::io_flow_ctl::get_variable_value( handle_t h, const flow::ui_var_t* ui_var, double& value_ref ) +{ return get_variable_value( _handleToPtr(h)->flowH, ui_var, value_ref ); } +cw::rc_t cw::io_flow_ctl::get_variable_value( handle_t h, const flow::ui_var_t* ui_var, const char*& value_ref ) +{ return get_variable_value( _handleToPtr(h)->flowH, ui_var, value_ref ); } + +cw::rc_t cw::io_flow_ctl::set_variable_value( handle_t h, const flow::ui_var_t* ui_var, bool value ) +{ return set_variable_value( _handleToPtr(h)->flowH, ui_var, value ); } +cw::rc_t cw::io_flow_ctl::set_variable_value( handle_t h, const flow::ui_var_t* ui_var, int value ) +{ return set_variable_value( _handleToPtr(h)->flowH, ui_var, value ); } +cw::rc_t cw::io_flow_ctl::set_variable_value( handle_t h, const flow::ui_var_t* ui_var, unsigned value ) +{ return set_variable_value( _handleToPtr(h)->flowH, ui_var, value ); } +cw::rc_t cw::io_flow_ctl::set_variable_value( handle_t h, const flow::ui_var_t* ui_var, float value ) +{ return set_variable_value( _handleToPtr(h)->flowH, ui_var, value ); } +cw::rc_t cw::io_flow_ctl::set_variable_value( handle_t h, const flow::ui_var_t* ui_var, double value ) +{ return set_variable_value( _handleToPtr(h)->flowH, ui_var, value ); } +cw::rc_t cw::io_flow_ctl::set_variable_value( handle_t h, const flow::ui_var_t* ui_var, const char* value ) +{ return set_variable_value( _handleToPtr(h)->flowH, ui_var, value ); } + + void cw::io_flow_ctl::report( handle_t h ) { io_flow_ctl_t* p = _handleToPtr(h); @@ -814,3 +847,7 @@ void cw::io_flow_ctl::print_network( handle_t h ) if( p->flowH.isValid() ) print_network(p->flowH); } + + + + diff --git a/cwIoFlowCtl.h b/cwIoFlowCtl.h index ec1ef56..0b0d79b 100644 --- a/cwIoFlowCtl.h +++ b/cwIoFlowCtl.h @@ -33,6 +33,9 @@ namespace cw // Create the network and prepare to enter runtime. rc_t program_initialize( handle_t h, unsigned preset_idx=kInvalidIdx ); bool program_is_initialized( handle_t h ); + + // Get the UI description data structures for the current program. + const flow::ui_net_t* program_ui_net( handle_t h ); // Execute the currently loaded non-real-time program to completion. rc_t exec_nrt( handle_t h ); @@ -47,10 +50,32 @@ namespace cw // The current program has completed. bool is_exec_complete( handle_t h ); + rc_t get_variable_value( handle_t h, const flow::ui_var_t* ui_var, bool& value_ref ); + rc_t get_variable_value( handle_t h, const flow::ui_var_t* ui_var, int& value_ref ); + rc_t get_variable_value( handle_t h, const flow::ui_var_t* ui_var, unsigned& value_ref ); + rc_t get_variable_value( handle_t h, const flow::ui_var_t* ui_var, float& value_ref ); + rc_t get_variable_value( handle_t h, const flow::ui_var_t* ui_var, double& value_ref ); + rc_t get_variable_value( handle_t h, const flow::ui_var_t* ui_var, const char*& value_ref ); + + template< typename T > + rc_t get_variable( handle_t h, const flow::ui_var_t* ui_var, T& value_ref ) + { return get_variable_value(h,ui_var,value_ref); } + + rc_t set_variable_value( handle_t h, const flow::ui_var_t* ui_var, bool value ); + rc_t set_variable_value( handle_t h, const flow::ui_var_t* ui_var, int value ); + rc_t set_variable_value( handle_t h, const flow::ui_var_t* ui_var, unsigned value ); + rc_t set_variable_value( handle_t h, const flow::ui_var_t* ui_var, float value ); + rc_t set_variable_value( handle_t h, const flow::ui_var_t* ui_var, double value ); + rc_t set_variable_value( handle_t h, const flow::ui_var_t* ui_var, const char* value ); + + template< typename T > + rc_t set_variable( handle_t h, const flow::ui_var_t* ui_var, T value ) + { return set_variable_value(h,ui_var,value); } + void report( handle_t h ); void print_network( handle_t h ); - - + + } }