Commit dd1442e3 authored by legoc's avatar legoc
Browse files

Calling directly calculate in VEXPController

parent d85bf203
......@@ -128,7 +128,7 @@ void VEXPController::updateBMatrix() {
void VEXPController::refreshCalcParameters(const std::string& value) {
cout << "refreshCalcParameters " << value << endl;
//cout << "refreshCalcParameters " << value << endl;
// Parse the values.
rapidjson::Document document;
......@@ -144,38 +144,23 @@ void VEXPController::refreshCalcParameters(const std::string& value) {
calculate(ki.GetDouble(), kf.GetDouble(), qh.GetDouble(), qk.GetDouble(), ql.GetDouble());
}
void VEXPController::refreshCalcTrigger(int32 value) {
cout << "refreshCalcTrigger " << value << endl;
rapidjson::Document document;
rapidjson::StringBuffer s;
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(s);
s.Clear();
writer.StartObject();
writer.Key("ki");
writer.Double(calcki());
double toDouble(double value) {
writer.Key("kf");
writer.Double(calckf());
writer.Key("qh");
writer.Double(calcqh());
writer.Key("qk");
writer.Double(calcqk());
if (isinf(value)) {
return numeric_limits<double>::max();
}
writer.Key("ql");
writer.Double(calcql());
if (isnan(value)) {
return 0.0;
}
writer.EndObject();
return value;
}
cout << "JSON parameters = " << s.GetString() << endl;
//calculate(calcki(), calckf(), calcqh(), calcqk(), calcql());
void VEXPController::refreshCalcTrigger(int32 value) {
refreshCalcParameters(s.GetString());
//cout << "refreshCalcTrigger " << value << endl;
calculate(calcki(), calckf(), calcqh(), calcqk(), calcql());
}
void VEXPController::refreshFloat64Property(SimpleProperty<float64>& property, float64 value) {
......
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