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

Added status to D22AutoConfig

parent 4a0dd059
......@@ -298,41 +298,49 @@ void AutoConfig::start() {
lssautoconfig::NumorResponse autoConfigResponse;
autoConfigResponse.ParseFromString(response);
int size = autoConfigResponse.results_size();
resultSize = size;
type.resize(size);
distance.resize(size);
wavelength.resize(size);
collimation.resize(size);
scatterModelType = autoConfigResponse.scattermodeltype();
string status = autoConfigResponse.status();
for (int i = 0; i < size; ++i) {
type.set(i, autoConfigResponse.results(i).type());
distance.set(i, autoConfigResponse.results(i).parameters().distance());
wavelength.set(i, autoConfigResponse.results(i).parameters().wavelength());
collimation.set(i, autoConfigResponse.results(i).parameters().collimation());
if (status == "ERROR") {
commandProgression = 100;
commandStatus.setError();
}
else {
scatterModelType = autoConfigResponse.scattermodeltype();
int size = autoConfigResponse.results_size();
resultSize = size;
string sampleParametersString;
for (int i = 0; i < autoConfigResponse.sampleparameters_size() - 1; ++i) {
sampleParametersString += autoConfigResponse.sampleparameters(i).type() + " " + to_string(autoConfigResponse.sampleparameters(i).value()) + ", ";
}
int i = autoConfigResponse.sampleparameters_size() - 1;
sampleParametersString += autoConfigResponse.sampleparameters(i).type() + " " + to_string(autoConfigResponse.sampleparameters(i).value());
sampleParameters = sampleParametersString;
type.resize(size);
distance.resize(size);
wavelength.resize(size);
collimation.resize(size);
// Intermediate progression.
commandProgression = 50;
for (int i = 0; i < size; ++i) {
type.set(i, autoConfigResponse.results(i).type());
distance.set(i, autoConfigResponse.results(i).parameters().distance());
wavelength.set(i, autoConfigResponse.results(i).parameters().wavelength());
collimation.set(i, autoConfigResponse.results(i).parameters().collimation());
}
log(Level::s_Debug) << "Apply" << endlog;
string sampleParametersString;
for (int i = 0; i < autoConfigResponse.sampleparameters_size() - 1; ++i) {
sampleParametersString += autoConfigResponse.sampleparameters(i).type() + " " + to_string(autoConfigResponse.sampleparameters(i).value()) + ", ";
}
int i = autoConfigResponse.sampleparameters_size() - 1;
sampleParametersString += autoConfigResponse.sampleparameters(i).type() + " " + to_string(autoConfigResponse.sampleparameters(i).value());
sampleParameters = sampleParametersString;
apply();
// Intermediate progression.
commandProgression = 50;
// End progression.
commandProgression = 100;
commandStatus.setIdle();
log(Level::s_Debug) << "Apply" << endlog;
apply();
// End progression.
commandProgression = 100;
commandStatus.setIdle();
}
log(Level::s_Info) << "Finished auto settings" << endlog;
}
......
......@@ -54,6 +54,7 @@ message InitResponse {
message NumorResponse {
required string scatterModelType = 1;
repeated SampleParameters sampleParameters = 2;
repeated Result results = 3;
required string status = 2;
repeated SampleParameters sampleParameters = 3;
repeated Result results = 4;
}
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