Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions include/cosim.h
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,54 @@ int cosim_execution_connect_integer_variables(
cosim_value_reference inputValueReference);


/**
* Connects one boolean output variable to one boolean input variable.
*
* \param [in] execution
* The execution.
* \param [in] outputSlaveIndex
* The source slave.
* \param [in] outputValueReference
* The source variable.
* \param [in] inputSlaveIndex
* The destination slave.
* \param [in] inputValueReference
* The destination variable.
*
* \returns
* 0 on success and -1 on error.
*/
int cosim_execution_connect_boolean_variables(
cosim_execution* execution,
cosim_slave_index outputSlaveIndex,
cosim_value_reference outputValueReference,
cosim_slave_index inputSlaveIndex,
cosim_value_reference inputValueReference);


/**
* Connects one string output variable to one string input variable.
*
* \param [in] execution
* The execution.
* \param [in] outputSlaveIndex
* The source slave.
* \param [in] outputValueReference
* The source variable.
* \param [in] inputSlaveIndex
* The destination slave.
* \param [in] inputValueReference
* The destination variable.
*
* \returns
* 0 on success and -1 on error.
*/
int cosim_execution_connect_string_variables(
cosim_execution* execution,
cosim_slave_index outputSlaveIndex,
cosim_value_reference outputValueReference,
cosim_slave_index inputSlaveIndex,
cosim_value_reference inputValueReference);
/// Creates an observer which stores the last observed value for all variables.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some whitespace missing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uh oh, just noticed after merging.

cosim_observer* cosim_last_value_observer_create();

Expand Down
22 changes: 22 additions & 0 deletions src/cosim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,28 @@ int cosim_execution_connect_integer_variables(
cosim::variable_type::integer);
}

int cosim_execution_connect_boolean_variables(
cosim_execution* execution,
cosim_slave_index outputSlaveIndex,
cosim_value_reference outputValueReference,
cosim_slave_index inputSlaveIndex,
cosim_value_reference inputValueReference)
{
return connect_variables(execution, outputSlaveIndex, outputValueReference, inputSlaveIndex, inputValueReference,
cosim::variable_type::boolean);
}

int cosim_execution_connect_string_variables(
cosim_execution* execution,
cosim_slave_index outputSlaveIndex,
cosim_value_reference outputValueReference,
cosim_slave_index inputSlaveIndex,
cosim_value_reference inputValueReference)
{
return connect_variables(execution, outputSlaveIndex, outputValueReference, inputSlaveIndex, inputValueReference,
cosim::variable_type::string);
}

int cosim_observer_slave_get_real(
cosim_observer* observer,
cosim_slave_index slave,
Expand Down