cwIoFlowCtl.h/cpp : Added program_ui_net() and set/get_variable_value().

This commit is contained in:
kevin 2024-10-12 15:30:20 -04:00
parent e5bff5cd9c
commit c9519d745c
2 changed files with 64 additions and 2 deletions

View File

@ -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);
}

View File

@ -34,6 +34,9 @@ namespace cw
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,6 +50,28 @@ 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 );