Commit 286cec64 authored by yannick legoc's avatar yannick legoc
Browse files

Separated results from type list in D22AutoConfig

parent 4274a5a5
......@@ -50,6 +50,9 @@ AutoConfig::AutoConfig(const std::string& name) :
scatterModelType.init(this, NOSAVE | SPY, "scatter_model_type", "Model");
sampleParameters.init(this, NOSAVE | SPY, "sample_parameters", "Sample");
calcTypeSize.init(this, NOSAVE, "calc_type_size");
calcType.init(this, NOSAVE, "calc_type");
resultSize.init(this, NOSAVE, "result_size");
type.init(this, NOSAVE, "type");
distance.init(this, NOSAVE, "distance");
......@@ -61,8 +64,8 @@ AutoConfig::AutoConfig(const std::string& name) :
wantedWavelength.init(this, SAVE | SPY, "wanted_wavelength", "Wavelength");
wantedCollimation.init(this, SAVE | SPY, "wanted_collimation", "Collimation");
wantedType.setEnumeratedValues(type);
wantedType.setEnumeratedLabels(type);
wantedType.setEnumeratedValues(calcType);
wantedType.setEnumeratedLabels(calcType);
m_d22settings.init(this, "settings");
m_simulation.init(this, "simulation");
......@@ -164,22 +167,23 @@ bool AutoConfig::initApplication() {
autoConfigResponse.ParseFromString(response);
int size = autoConfigResponse.types_size();
resultSize = size;
type.resize(size);
distance.resize(size);
wavelength.resize(size);
collimation.resize(size);
calcTypeSize = size;
calcType.resize(size);
for (int i = 0; i < size; ++i) {
type.set(i, autoConfigResponse.types(i));
calcType.set(i, autoConfigResponse.types(i));
}
// Set default value.
if (size > 0) {
wantedType = type.get(0);
wantedType = calcType.get(0);
}
type.resize(1);
distance.resize(1);
wavelength.resize(1);
collimation.resize(1);
// Application initialized
initialized = true;
......
......@@ -53,6 +53,9 @@ public:
Property<std::string> scatterModelType;
Property<std::string> sampleParameters;
Property<int32> calcTypeSize;
DynamicProperty<std::string> calcType;
Property<int32> resultSize;
DynamicProperty<std::string> type;
DynamicProperty<float64> distance;
......
......@@ -4,9 +4,11 @@
<property name="scatter_model_type" type="string"/>
<property name="sample_parameters" type="string"/>
<property name="calc_type_size" type="int32"/>
<dynamic_property name="calc_type" type="string" size_property="result_size"/>
<property name="result_size" type="int32"/>
<dynamic_property name="type" type="string" size_property="result_size"/>
<dynamic_property name="distance" type="float64" size_property="result_size"/>
<dynamic_property name="wavelength" type="float64" size_property="result_size"/>
......
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