Skip to content
Snippets Groups Projects
Commit e9546c64 authored by Locatelli's avatar Locatelli
Browse files

Add test line empty

parent fa569f7f
Branches
No related tags found
No related merge requests found
......@@ -114,38 +114,40 @@ void PlotManager::restore(std::shared_ptr<cameo::coms::Publisher> frontpublisher
while(file.eof() == false) {
// Get plot key
getline(file, line);
ostringstream filename1;
filename1 << getenv("HOME") << m_ConfigPath << line << DATA1_SUFFIX;
// Get plot data messages
ifstream file1(filename1.str().c_str(), ios::binary);
if (file1.is_open() == true) {
char c;
ostringstream part1;
while (file1.get(c)) {
part1 << c;
}
file1.close();
ostringstream filename2;
filename2 << getenv("HOME") << m_ConfigPath << line << DATA2_SUFFIX;
ifstream file2(filename2.str().c_str(),ios::binary);
if (file2.is_open() == true) {
ostringstream part2;
while (file2.get(c)) {
part2 << c;
if (line.empty() == false) {
ostringstream filename1;
filename1 << getenv("HOME") << m_ConfigPath << line << DATA1_SUFFIX;
// Get plot data messages
ifstream file1(filename1.str().c_str(), ios::binary);
if (file1.is_open() == true) {
char c;
ostringstream part1;
while (file1.get(c)) {
part1 << c;
}
file2.close();
ploty::Message message;
message.ParseFromString(part1.str());
ploty::PlotPropertyDataMessage plotMessage;
plotMessage.ParseFromString(part2.str());
file1.close();
ostringstream filename2;
filename2 << getenv("HOME") << m_ConfigPath << line << DATA2_SUFFIX;
ifstream file2(filename2.str().c_str(),ios::binary);
if (file2.is_open() == true) {
ostringstream part2;
while (file2.get(c)) {
part2 << c;
}
file2.close();
ploty::Message message;
message.ParseFromString(part1.str());
ploty::PlotPropertyDataMessage plotMessage;
plotMessage.ParseFromString(part2.str());
plotMessage.mutable_clientinfo()->set_client_type(clientinfo.client_type());
plotMessage.mutable_clientinfo()->set_client_id(clientinfo.client_id());
plotMessage.mutable_clientinfo()->set_remotecontrolstate(clientinfo.remotecontrolstate());
plotMessage.mutable_clientinfo()->set_tokenfree(clientinfo.tokenfree());
plotMessage.mutable_clientinfo()->set_tokenownbyme(clientinfo.tokenownbyme());
// Display plot
displayPropertyPlot(message, plotMessage, frontpublisher);
plotMessage.mutable_clientinfo()->set_client_type(clientinfo.client_type());
plotMessage.mutable_clientinfo()->set_client_id(clientinfo.client_id());
plotMessage.mutable_clientinfo()->set_remotecontrolstate(clientinfo.remotecontrolstate());
plotMessage.mutable_clientinfo()->set_tokenfree(clientinfo.tokenfree());
plotMessage.mutable_clientinfo()->set_tokenownbyme(clientinfo.tokenownbyme());
// Display plot
displayPropertyPlot(message, plotMessage, frontpublisher);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment