Commit 9c1e97f6 authored by yannick legoc's avatar yannick legoc
Browse files

D22AutoConfig updated

parent 7adf010e
......@@ -48,7 +48,7 @@ AutoConfig::AutoConfig(const std::string& name) :
initialized.init(this, NOSAVE, "initialized");
scatterModelType.init(this, NOSAVE, "scatter_model_type");
sampleRadius.init(this, NOSAVE, "sample_radius");
sampleParameters.init(this, NOSAVE, "sample_parameters");
resultSize.init(this, NOSAVE, "result_size");
type.init(this, NOSAVE, "type");
......@@ -269,12 +269,13 @@ void AutoConfig::start() {
scatterModelType = autoConfigResponse.scattermodeltype();
string sampleRadiusString;
for (int i = 0; i < autoConfigResponse.sampleradius_size() - 1; ++i) {
sampleRadiusString += to_string(autoConfigResponse.sampleradius(i)) + ", ";
string sampleParametersString;
for (int i = 0; i < autoConfigResponse.sampleparameters_size() - 1; ++i) {
sampleParametersString += autoConfigResponse.sampleparameters(i).type() + " " + to_string(autoConfigResponse.sampleparameters(i).value()) + ", ";
}
sampleRadiusString += to_string(autoConfigResponse.sampleradius(autoConfigResponse.sampleradius_size() - 1));
sampleRadius = sampleRadiusString;
int i = autoConfigResponse.sampleparameters_size() - 1;
sampleParametersString += autoConfigResponse.sampleparameters(i).type() + " " + to_string(autoConfigResponse.sampleparameters(i).value());
sampleParameters = sampleParametersString;
}
void AutoConfig::apply() {
......
......@@ -63,7 +63,7 @@ public:
Property<bool> initialized;
Property<std::string> scatterModelType;
Property<std::string> sampleRadius;
Property<std::string> sampleParameters;
Property<int32> resultSize;
DynamicProperty<std::string> type;
......
......@@ -10,6 +10,12 @@ message InstrumentParameters {
required double collimation = 3;
}
message SampleParameters {
required string type = 1;
required double value = 2;
}
message NumorRequest {
required string instrumentName = 1;
......@@ -34,6 +40,6 @@ message Result {
message Response {
required string scatterModelType = 1;
repeated double sampleRadius = 2;
repeated SampleParameters sampleParameters = 2;
repeated Result results = 3;
}
......@@ -3,7 +3,7 @@ d22_auto_config.wavelengthPrefix=Wavelength
d22_auto_config.collimationPrefix=Collimation
d22_auto_config.scatter_model_typePrefix=Scatter Model Type
d22_auto_config.typePrefix=Type
d22_auto_config.sample_radiusPrefix=Sample Radius
d22_auto_config.sample_parametersPrefix=Sample Parameters
d22_auto_config.resultsPrefix=Results
d22_auto_config.applyPrefix=Apply
d22_auto_config.wantedTypePrefix=Type
\ No newline at end of file
......@@ -3,7 +3,7 @@
<controller type="d22_auto_config">
<property name="scatter_model_type" type="string"/>
<property name="sample_radius" type="string"/>
<property name="sample_parameters" type="string"/>
<property name="result_size" type="int32"/>
......
......@@ -6,8 +6,8 @@
<table_composite nbColumns="2">
<simple_label prefix="d22_auto_config.scatter_model_typePrefix"/>
<label role="d22_auto_config1" property="scatter_model_type"/>
<simple_label prefix="d22_auto_config.sample_radiusPrefix"/>
<label role="d22_auto_config1" property="sample_radius"/>
<simple_label prefix="d22_auto_config.sample_parametersPrefix"/>
<label role="d22_auto_config1" property="sample_parameters"/>
</table_composite>
<newLine/>
......
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