Skip to content
Snippets Groups Projects
Commit 4853f91c authored by Jerome Locatelli's avatar Jerome Locatelli
Browse files

remove scan viewer temporary

parent 0ca9ec76
Branches
No related tags found
No related merge requests found
......@@ -312,8 +312,8 @@ int main(int argc, char* argv[]) {
DataPlotDescription dataplot;
map<std::string, std::string> scans;
map<std::string, std::string> scanviewers;
// map<std::string, std::string> scans;
// map<std::string, std::string> scanviewers;
std::string scanspy;
nscom::OctetSequence_var binaryResult = servantManager->getWholeConfiguration(0);
......@@ -354,29 +354,30 @@ int main(int argc, char* argv[]) {
}
++piter;
}
} else if (type == "scan_viewer") {
::google::protobuf::RepeatedPtrField<configuration::PropertyDescriptor>::const_iterator piter =
desc.properties().begin();
while (piter != desc.properties().end()) {
string name = (*piter).name();
if (name.find("plot_name") != std::string::npos) {
scanviewers[desc.name()] = DatabaseAccessorVar->getFormattedValue(0, (*piter).idarray(0));
}
++piter;
}
} else if (type == "parameterizable_scan_1d") {
scans[desc.name()] = desc.name();
// } else if (type == "scan_viewer") {
// ::google::protobuf::RepeatedPtrField<configuration::PropertyDescriptor>::const_iterator piter =
// desc.properties().begin();
// while (piter != desc.properties().end()) {
// string name = (*piter).name();
// if (name.find("plot_name") != std::string::npos) {
// scanviewers[desc.name()] = DatabaseAccessorVar->getFormattedValue(0, (*piter).idarray(0));
// }
// ++piter;
// }
// } else if (type == "parameterizable_scan_1d") {
// scans[desc.name()] = desc.name();
} else if (type == "scan_spy") {
::google::protobuf::RepeatedPtrField<configuration::PropertyDescriptor>::const_iterator piter =
desc.properties().begin();
while (piter != desc.properties().end()) {
string name = (*piter).name();
if (name.find("scan_controller_name") != std::string::npos) {
scanspy = DatabaseAccessorVar->getFormattedValue(0, (*piter).idarray(0));
break;
}
++piter;
}
scanspy = desc.name();
// ::google::protobuf::RepeatedPtrField<configuration::PropertyDescriptor>::const_iterator piter =
// desc.properties().begin();
// while (piter != desc.properties().end()) {
// string name = (*piter).name();
// if (name.find("scan_controller_name") != std::string::npos) {
// scanspy = DatabaseAccessorVar->getFormattedValue(0, (*piter).idarray(0));
// break;
// }
// ++piter;
// }
}
}
......@@ -398,7 +399,8 @@ int main(int argc, char* argv[]) {
servantSpyProperties.MergeFrom(servantSpyDynamicProperties);
if ((desc.enabled() == true) && ((desc.visible() == true) || ((desc.visible() == false) && (desc.type() == "acquisition_spy")) ||
((desc.visible() == false) && (desc.type() == "scan_spy"))) && (servantSpyProperties.properties_size() > 3)) {
((desc.visible() == false) && (desc.type() == "scan_spy")) ||
((desc.visible() == false) && (desc.type() == "level")) || ((desc.visible() == false) && (desc.type() == "commandline"))) && (servantSpyProperties.properties_size() > 3)) {
// cout << desc.name() << " : ENABLE" << endl;
for (int32 j = 0; j < servantSpyProperties.properties_size(); ++j) {
configuration::SpyPropertyDescriptor spydesc = servantSpyProperties.properties(j);
......@@ -420,6 +422,12 @@ int main(int argc, char* argv[]) {
if ((*piter).name() == "commandStatus") {
value = lexical_cast<string>(DatabaseAccessorVar->getInt32Value(0, spydesc.actualid()));
}
else if ((*piter).name() == "title") {
replace_all(value,"'"," ");
}
else if ((*piter).name() == "subtitle") {
replace_all(value,"'"," ");
}
WebServantProperty sp((*piter).name(), value);
if (spydesc.setpointid() != 0) {
piter = desc.properties().begin();
......@@ -523,60 +531,60 @@ int main(int argc, char* argv[]) {
// }
}
}
// Scan viewers
map<std::string, std::string>::iterator iters = scanviewers.begin();
while (iters != scanviewers.end()) {
// cout << "plot : " << iters->first << " : " << iters->second << endl;
ostringstream imgloc;
imgloc << LOCALPATH << picsInstrumentName << "_" << iters->first << ".png";
if (boost::filesystem::exists(imgloc.str()) == true) {
// cout << "remove file: " << imgloc.str() << endl;
boost::filesystem::remove(imgloc.str());
}
// copy image
ostringstream imgrem;
imgrem << "/net/" << picsInstrumentName << "/users/" << picsUserName << "/offscreenImages/web/" << iters->first
<< "#scan_viewer_plot#" << iters->second << ".png";
// if (boost::filesystem::exists(imgrem.str()) == true) {
// cout << "copy file : " << imgrem.str() << " to " << imgloc.str() << endl;
try {
boost::filesystem::copy_file(imgrem.str(), imgloc.str());
boost::filesystem::last_write_time(imgloc.str(), boost::filesystem::last_write_time(imgrem.str()));
} catch (...) {
}
// } else {
// cout << "file doesn't: " << imgrem.str() << endl;
// // Scan viewers
// map<std::string, std::string>::iterator iters = scanviewers.begin();
// while (iters != scanviewers.end()) {
//// cout << "plot : " << iters->first << " : " << iters->second << endl;
// ostringstream imgloc;
// imgloc << LOCALPATH << picsInstrumentName << "_" << iters->first << ".png";
// if (boost::filesystem::exists(imgloc.str()) == true) {
//// cout << "remove file: " << imgloc.str() << endl;
// boost::filesystem::remove(imgloc.str());
// }
++iters;
}
// // copy image
// ostringstream imgrem;
// imgrem << "/net/" << picsInstrumentName << "/users/" << picsUserName << "/offscreenImages/web/" << iters->first
// << "#scan_viewer_plot#" << iters->second << ".png";
//// if (boost::filesystem::exists(imgrem.str()) == true) {
//// cout << "copy file : " << imgrem.str() << " to " << imgloc.str() << endl;
// try {
// boost::filesystem::copy_file(imgrem.str(), imgloc.str());
// boost::filesystem::last_write_time(imgloc.str(), boost::filesystem::last_write_time(imgrem.str()));
// } catch (...) {
//
// }
//// } else {
//// cout << "file doesn't: " << imgrem.str() << endl;
//// }
// ++iters;
// }
// Scans
map<std::string, std::string>::iterator itersv = scans.begin();
while (itersv != scans.end()) {
// cout << "plot : " << itersv->first << " : " << itersv->second << endl;
ostringstream imgloc;
imgloc << LOCALPATH << picsInstrumentName << "_" << itersv->first << ".png";
if (boost::filesystem::exists(imgloc.str()) == true) {
// cout << "remove file: " << imgloc.str() << endl;
boost::filesystem::remove(imgloc.str());
}
// copy image
ostringstream imgrem;
imgrem << "/net/" << picsInstrumentName << "/users/" << picsUserName << "/offscreenImages/web/" << itersv->first
<< "#optimisationParameterizableScan1DPlot#parameterizable_scan_1d.optimisationPlotTitle.png";
// if (boost::filesystem::exists(imgrem.str()) == true) {
// cout << "copy file : " << imgrem.str() << " to " << imgloc.str() << endl;
try {
boost::filesystem::copy_file(imgrem.str(), imgloc.str());
boost::filesystem::last_write_time(imgloc.str(), boost::filesystem::last_write_time(imgrem.str()));
} catch (...) {
}
// } else {
// cout << "file doesn't: " << imgrem.str() << endl;
// map<std::string, std::string>::iterator itersv = scans.begin();
// while (itersv != scans.end()) {
//// cout << "plot : " << itersv->first << " : " << itersv->second << endl;
// ostringstream imgloc;
// imgloc << LOCALPATH << picsInstrumentName << "_" << itersv->first << ".png";
// if (boost::filesystem::exists(imgloc.str()) == true) {
//// cout << "remove file: " << imgloc.str() << endl;
// boost::filesystem::remove(imgloc.str());
// }
++itersv;
}
// // copy image
// ostringstream imgrem;
// imgrem << "/net/" << picsInstrumentName << "/users/" << picsUserName << "/offscreenImages/web/" << itersv->first
// << "#optimisationParameterizableScan1DPlot#parameterizable_scan_1d.optimisationPlotTitle.png";
//// if (boost::filesystem::exists(imgrem.str()) == true) {
//// cout << "copy file : " << imgrem.str() << " to " << imgloc.str() << endl;
// try {
// boost::filesystem::copy_file(imgrem.str(), imgloc.str());
// boost::filesystem::last_write_time(imgloc.str(), boost::filesystem::last_write_time(imgrem.str()));
// } catch (...) {
//
// }
//// } else {
//// cout << "file doesn't: " << imgrem.str() << endl;
//// }
// ++itersv;
// }
if (scanspy.empty() == false) {
ostringstream imgloc;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment