Commit a7df5e16 authored by yannick legoc's avatar yannick legoc
Browse files

VEXPController is using Scattering calcsens property

parent 44632742
......@@ -57,6 +57,7 @@ VEXPController::VEXPController(const string& name) :
en.init(this, NOSAVE, "en");
qm.init(this, NOSAVE, "qm");
fx.init(this, NOSAVE, "fx");
ss.init(this, NOSAVE, "ss");
ki.init(this, NOSAVE, "ki");
kf.init(this, NOSAVE, "kf");
......@@ -133,9 +134,10 @@ void VEXPController::refreshCalcParameters(const std::string& value) {
rapidjson::Value& qk = document["qk"];
rapidjson::Value& ql = document["ql"];
rapidjson::Value& fx = document["fx"];
rapidjson::Value& ss = document["ss"];
// Calculate the angles and the status.
calculate(ki.GetDouble(), kf.GetDouble(), qh.GetDouble(), qk.GetDouble(), ql.GetDouble(), fx.GetInt());
calculate(ki.GetDouble(), kf.GetDouble(), qh.GetDouble(), qk.GetDouble(), ql.GetDouble(), fx.GetInt(), ss.GetInt());
}
double toDouble(double value) {
......@@ -190,6 +192,7 @@ void VEXPController::updateProperties() {
en.update(scattering->en());
qm.update(scattering->qm());
fx.update(scattering->fx());
ss.update(scattering->sens());
ki.update(incidentBeam->ki());
kf.update(scatteredBeam->kf());
......@@ -228,6 +231,7 @@ void VEXPController::postConfiguration() {
registerPropertyCopierByUpdate(scattering->en, en);
registerPropertyCopierByUpdate(scattering->qm, qm);
registerPropertyCopierByUpdate(scattering->fx, fx);
registerPropertyCopierByUpdate(scattering->sens, ss);
registerPropertyCopierByUpdate(incidentBeam->ki, ki);
registerPropertyCopierByUpdate(scatteredBeam->kf, kf);
......@@ -256,7 +260,7 @@ void VEXPController::postConfiguration() {
updateProperties();
}
void VEXPController::calculate(float64 ki, float64 kf, float64 qh, float64 qk, float64 ql, int32 fx) {
void VEXPController::calculate(float64 ki, float64 kf, float64 qh, float64 qk, float64 ql, int32 fx, int32 ss) {
// Reset status.
calculationStatus.setIdle();
......@@ -310,6 +314,7 @@ void VEXPController::calculate(float64 ki, float64 kf, float64 qh, float64 qk, f
scattering->calcen = 2.072 * (ki * ki - kf * kf);
scattering->calcki = ki;
scattering->calckf = kf;
scattering->calcsens = ss;
// Calculate by fixing Ki.
scattering->calculate(tas::Beam::K_MODE, fx);
......
......@@ -64,7 +64,7 @@ public:
virtual void postConfiguration();
void calculate(float64 ki, float64 kf, float64 qh, float64 qk, float64 ql, int32 fx);
void calculate(float64 ki, float64 kf, float64 qh, float64 qk, float64 ql, int32 fx, int32 ss);
Property<float64> as;
Property<float64> bs;
......@@ -89,6 +89,7 @@ public:
Property<float64> en;
Property<float64> qm;
Property<int32> fx;
Property<int32> ss;
Property<float64> ki;
Property<float64> kf;
......
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