From 5580c4cb8e9d16e44047155de0955d70320859d7 Mon Sep 17 00:00:00 2001 From: epernod Date: Mon, 28 Aug 2023 15:00:32 +0200 Subject: [PATCH] Add BeamActions warning at init --- .../component/controller/BeamAdapterActionController.inl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/BeamAdapter/component/controller/BeamAdapterActionController.inl b/src/BeamAdapter/component/controller/BeamAdapterActionController.inl index 8fb8777dd..92ec1fd40 100644 --- a/src/BeamAdapter/component/controller/BeamAdapterActionController.inl +++ b/src/BeamAdapter/component/controller/BeamAdapterActionController.inl @@ -31,7 +31,7 @@ using namespace sofa::beamadapter; template BeamAdapterActionController::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")) @@ -53,6 +53,11 @@ void BeamAdapterActionController::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); }