Commit 86b1af46 authored by yannick legoc's avatar yannick legoc
Browse files

Added sampleBackground to D22AutoConfig

parent 2f1f34d1
......@@ -141,6 +141,42 @@ bool AutoConfig::initApplication() {
return true;
}
float64 AutoConfig::getSampleBackground() {
// model_name
string modelName = m_simulation->displaySampleModelName();
int modelNameSize = m_simulation->model_name.getSize();
int i = 0;
while (i < modelNameSize) {
if (modelName == m_simulation->model_name.get(i)) {
break;
}
++i;
}
cout << "Model " << modelName << " found at index " << i << endl;
int pnamesSize = m_simulation->pnames.getSize(i);
int j = 0;
while (j < pnamesSize) {
string pname = m_simulation->pnames.get(i, j);
if (pname.find("background") != string::npos || pname.find("Background") != string::npos) {
cout << "Background found at index " << j << " with " << pname << endl;
return m_simulation->parameters.get(i, j);
}
++j;
}
cout << "Background not found" << endl;
return 0;
}
void AutoConfig::start() {
if (!initApplication()) {
......@@ -171,6 +207,7 @@ void AutoConfig::start() {
request.set_samplemodel(m_simulation->displaySampleModelName());
request.set_backgroundmodel(m_simulation->displayBackgroundModelName());
request.set_samplebackground(getSampleBackground());
// Get the data from the active count controller.
acquisition::Count* count = nullptr;
......
......@@ -75,6 +75,7 @@ public:
private:
bool initApplication();
float64 getSampleBackground();
static const std::string REMOTE_APPLICATION;
static const std::string RESPONDER;
......
......@@ -18,9 +18,11 @@ message NumorRequest {
required string sampleModel = 3;
required string backgroundModel = 4;
required int32 xSize = 5;
required int32 ySize = 6;
required bytes data = 7;
required double sampleBackground = 5;
required int32 xSize = 6;
required int32 ySize = 7;
required bytes data = 8;
}
message Result {
......
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