Commit c1cc641d authored by legoc's avatar legoc
Browse files

Added refreshFloat64PropertyToMoveModel to move the A1...A6 axes when simulating with VEXP

parent 40293ff2
......@@ -63,6 +63,7 @@ VEXPController::VEXPController(const string& name) :
calculationStatus.init(this, NOSAVE, "calculation_status");
errorMessage.init(this, NOSAVE, "error_message");
moveModel.init(this, SAVE, "move_model");
tasSettings.init(this, "tas_settings");
sample.init(this, "sample");
......@@ -137,6 +138,14 @@ void VEXPController::refreshFloat64Property(SimpleProperty<float64>& property, f
property = value;
}
void VEXPController::refreshFloat64PropertyToMoveModel(SimpleProperty<float64>& property, float64 value) {
// Update the value only in case moveModel is true.
if (moveModel()) {
property = value;
}
}
void VEXPController::postConfiguration() {
// Copy the values.
......@@ -227,6 +236,12 @@ void VEXPController::postConfiguration() {
registerRefresher(bz, &VEXPController::refreshFloat64Property, this, tasSettings->bz);
registerRefresher(ki, &VEXPController::refreshKi, this);
registerRefresher(kf, &VEXPController::refreshKf, this);
registerRefresher(a1, &VEXPController::refreshFloat64PropertyToMoveModel, this, a1Controller->position);
registerRefresher(a2, &VEXPController::refreshFloat64PropertyToMoveModel, this, a2Controller->position);
registerRefresher(a3, &VEXPController::refreshFloat64PropertyToMoveModel, this, a3Controller->position);
registerRefresher(a4, &VEXPController::refreshFloat64PropertyToMoveModel, this, a4Controller->position);
registerRefresher(a5, &VEXPController::refreshFloat64PropertyToMoveModel, this, a5Controller->position);
registerRefresher(a6, &VEXPController::refreshFloat64PropertyToMoveModel, this, a6Controller->position);
}
}
......@@ -47,6 +47,7 @@ public:
void refreshKi(float64 value);
void refreshKf(float64 value);
void refreshFloat64Property(SimpleProperty<float64>& property, float64 value);
void refreshFloat64PropertyToMoveModel(SimpleProperty<float64>& property, float64 value);
virtual void postConfiguration();
......@@ -84,6 +85,7 @@ public:
StatusProperty calculationStatus;
Property<std::string> errorMessage;
Property<bool> moveModel;
ControllerPtr<tas::TasSettings> tasSettings;
ControllerPtr<tas::Sample> sample;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment