Commit 28b81548 authored by ics's avatar ics
Browse files

add multiplot save image for remote

parent 1d253d20
......@@ -133,7 +133,7 @@ int main(int32 argc, char* argv[]) {
}
DBGMSG("Connected to " << *ploty2);
spysubscriber = application::Subscriber::create(*nomadserver, "spy_publisher");
spysubscriber = application::Subscriber::create(*ploty2, "spy_publisher");
DBGMSG("Created subscriber " << *spysubscriber);
if (spysubscriber.get() == 0) {
Error("mainplot", "Connection problem on spy_publisher");
......
......@@ -136,11 +136,11 @@ void OffScreenPlotManager::spyloop(std::shared_ptr<cameo::application::Subscribe
ploty::SpyMultiPlotMessage message;
message.ParseFromString(data1);
boost::filesystem::path pngfile = getenv("HOME");
if (message.type() == ploty::SpyMultiPlotMessage::SpyImage) {
boost::filesystem::path pngfile = "/users/ics/offscreenImages/spy";
pngfile.append("offscreenImages/spy");
pngfile.append(message.name());
pngfile.replace_extension("png");
DBGMSG(pngfile.string());
ofstream file(pngfile.string().c_str(), fstream::binary);
if (file.is_open()) {
file.write(data2.c_str(),data2.size());
......@@ -151,6 +151,15 @@ void OffScreenPlotManager::spyloop(std::shared_ptr<cameo::application::Subscribe
string buf;
m_SpyPublisher->sendTwoBinaryParts(spymessage.SerializeAsString(), buf);
}
else if (message.type() == ploty::SpyMultiPlotMessage::MultiPlotImage) {
pngfile.append("offscreenImages/multiplot");
pngfile.append(message.name());
pngfile.replace_extension("png");
ofstream file(pngfile.string().c_str(), fstream::binary);
if (file.is_open()) {
file.write(data2.c_str(),data2.size());
}
}
} else {
break;
}
......@@ -213,7 +222,7 @@ void OffScreenPlotManager::run(std::string pbfilename, std::string path) {
buffer::Data data;
data.ParseFromArray(buffer, size);
DBGMSG("pbfilename = " << path << "/" << pbfilename);
// DBGMSG("pbfilename = " << path << "/" << pbfilename);
// DBGMSG("buffer = " << size);
// DBGMSG("numor = " << data.numor());
// DBGMSG("dataxArray = " << data.xdata_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