Skip to content

Commit

Permalink
Add BeamActions warning at init
Browse files Browse the repository at this point in the history
  • Loading branch information
epernod committed Aug 28, 2023
1 parent d912de9 commit 5580c4c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using namespace sofa::beamadapter;

template <class DataTypes>
BeamAdapterActionController<DataTypes>::BeamAdapterActionController()
: d_writeMode(initData(&d_writeMode, false, "writeMode", "If true, will accumulate actions from keyboard and dump the actions and times when key 'E' is pressed."))
: d_writeMode(initData(&d_writeMode, true, "writeMode", "If true, will accumulate actions from keyboard and dump the actions and times when key 'E' is pressed."))
, d_actions(initData(&d_actions, "actions", "List of actions to script the BeamAdapter"))
, d_actionString(initData(&d_actionString, "actionString", "List of actions as string to script the BeamAdapter"))
, d_timeSteps(initData(&d_timeSteps, "timeSteps", "List of key times corresponding to the actions"))
Expand All @@ -53,6 +53,11 @@ void BeamAdapterActionController<DataTypes>::init()
// the controller must listen to the event (in particular BeginAnimationStep event)
this->f_listening.setValue(true);

if (d_writeMode.getValue() && (d_actions.isSet() || d_actionString.isSet()))
{
msg_warning() << "WriteMode is set to on but a list of actions has been set as input. The list will be overwritten.";
}

this->d_componentState.setValue(sofa::core::objectmodel::ComponentState::Valid);
}

Expand Down

0 comments on commit 5580c4c

Please sign in to comment.