Commit 926068bc authored by Locatelli's avatar Locatelli

Use fix name for scan and data plot offscreen images

parent cf70e052
......@@ -668,9 +668,7 @@ void DataPlot::calculate(int32 nbElement) {
}
imageGeneration.update(nbElement, false);
if (useWebspy(nbElement) == true) {
imageGeneration.update(nbElement, true);
}
imageGeneration.update(nbElement, true);
} catch (DataTreatmentState::CannotPlot& e) {
}
......
......@@ -114,7 +114,7 @@ void WebSpyPublisher::loop() {
try {
if (it->useWebspy.get(i) == true) {
ostringstream filename;
filename << it->getName() << "#detector_plot_data" << i << "#" << it->plotName.get(i) << ".png";
filename << it->getType() << ".png";
boost::filesystem::path imgname = getenv("HOME");
imgname /= "offscreenImages/web";
imgname /= filename.str();
......@@ -145,7 +145,7 @@ void WebSpyPublisher::loop() {
if (m_ScanSpy != nullptr) {
try {
ostringstream filename;
filename << m_ScanSpy->getName() << "#scanspyPlot0#Scan plot.png";
filename << m_ScanSpy->getType() << ".png";
boost::filesystem::path imgname = getenv("HOME");
imgname /= "offscreenImages/web";
imgname /= filename.str();
......
......@@ -207,7 +207,7 @@ void AcquisitionSerializer::init() {
if (common::ServerProperties::getInstance()->getPlotyVersion() == 2) {
// Create empty plots spies (acquisition and scan
for (uint32 i = 0; i < m_dataPlot.size(); ++i) {
for (uint32 j = 0; j < m_dataPlot[i]->imageGeneration.getSize(); ++j) {
for (uint32 j = 0; j < (uint32) m_dataPlot[i]->imageGeneration.getSize(); ++j) {
createEmptyDataPlot(i, j);
}
}
......@@ -246,11 +246,11 @@ void AcquisitionSerializer::updateCountSerializerEvent(int32 i) {
yPhysicalSize = m_dataPlot[j]->detectorYPhysicalSize(0);
errorBars.resize(1);
errorBars[0] = false;
useGrid = m_dataPlot[j]->useGrid.get(0);
useLog = m_dataPlot[j]->useLog.get(0);
colorMap = m_dataPlot[j]->colorMap.get(0);
minColorLimit = m_dataPlot[j]->minColorLimit.get(0);
maxColorLimit = m_dataPlot[j]->maxColorLimit.get(0);
useGrid = m_dataPlot[j]->useGrid(0);
useLog = m_dataPlot[j]->useLog(0);
colorMap = m_dataPlot[j]->colorMap(0);
minColorLimit = m_dataPlot[j]->minColorLimit(0);
maxColorLimit = m_dataPlot[j]->maxColorLimit(0);
ostringstream extra;
if (m_dataPlot[j]->plotType(0) == "raw") {
......@@ -297,11 +297,11 @@ void AcquisitionSerializer::updateScanSerializerEvent(int32 i) {
optimizationResultFounds.resize(size);
optimizationResultValues.resize(size);
for(int32 j = 0; j < size; ++j) {
xDatas[j] = m_scanControllers[i]->optimizationPlotX.get(j);
yDatas[j] = m_scanControllers[i]->optimizationPlotY.get(j);
optimizationFitDatas[j] = m_scanControllers[i]->optimizationFitPlotY.get(j);
optimizationResultFounds[j] = m_scanControllers[i]->optimization1dResultFound.get(j);
optimizationResultValues[j] = m_scanControllers[i]->optimization1dXResult.get(j);
xDatas[j] = m_scanControllers[i]->optimizationPlotX(j);
yDatas[j] = m_scanControllers[i]->optimizationPlotY(j);
optimizationFitDatas[j] = m_scanControllers[i]->optimizationFitPlotY(j);
optimizationResultFounds[j] = m_scanControllers[i]->optimization1dResultFound(j);
optimizationResultValues[j] = m_scanControllers[i]->optimization1dXResult(j);
errorBars[j] = true;
}
zDatas.clear();
......@@ -335,7 +335,7 @@ void AcquisitionSerializer::updateDataPlotEvent(int32 i, int32 j) {
if (m_dataPlot[i]->imageGeneration(j) == true) {
//get name of image here to avoid having it empty
ostringstream imageName;
imageName << m_dataPlot[i]->getName() << "#detector_plot_data" << j << "#" << m_dataPlot[i]->plotName(j) << ".png";
imageName << m_dataPlot[i]->getType() << ".png";
xDatas.resize(1);
xDatas[0] = m_dataPlot[i]->detectorXData(j);
......@@ -354,11 +354,11 @@ void AcquisitionSerializer::updateDataPlotEvent(int32 i, int32 j) {
yPhysicalSize = m_dataPlot[i]->detectorYPhysicalSize(j);
errorBars.resize(1);
errorBars[0] = false;
useGrid = m_dataPlot[j]->useGrid.get(j);
useLog = m_dataPlot[j]->useLog.get(j);
colorMap = m_dataPlot[j]->colorMap.get(j);
minColorLimit = m_dataPlot[j]->minColorLimit.get(j);
maxColorLimit = m_dataPlot[j]->maxColorLimit.get(j);
useGrid = m_dataPlot[j]->useGrid(j);
useLog = m_dataPlot[j]->useLog(j);
colorMap = m_dataPlot[j]->colorMap(j);
minColorLimit = m_dataPlot[j]->minColorLimit(j);
maxColorLimit = m_dataPlot[j]->maxColorLimit(j);
ostringstream extra;
if (m_dataPlot[i]->plotType(j) == "raw") {
......@@ -406,11 +406,11 @@ void AcquisitionSerializer::updateDataMultiPlotEvent(int32 i, int32 j) {
yPhysicalSize = m_dataPlot[i]->detectorYPhysicalSize(j);
errorBars.resize(1);
errorBars[0] = false;
useGrid = m_dataPlot[i]->useGrid.get(j);
useLog = m_dataPlot[i]->useLog.get(j);
colorMap = m_dataPlot[i]->colorMap.get(j);
minColorLimit = m_dataPlot[j]->minColorLimit.get(j);
maxColorLimit = m_dataPlot[j]->maxColorLimit.get(j);
useGrid = m_dataPlot[i]->useGrid(j);
useLog = m_dataPlot[i]->useLog(j);
colorMap = m_dataPlot[i]->colorMap(j);
minColorLimit = m_dataPlot[j]->minColorLimit(j);
maxColorLimit = m_dataPlot[j]->maxColorLimit(j);
int32 size = m_dataPlot[i]->multiplotXData.getSize(j);
for (int32 k = 0;k < size; ++k) {
......@@ -419,15 +419,15 @@ void AcquisitionSerializer::updateDataMultiPlotEvent(int32 i, int32 j) {
imageName << m_dataPlot[i]->getName() << "#detector_plot_data." << j << "#" << k << ".png";
xDatas.resize(1);
xDatas[0] = m_dataPlot[i]->multiplotXData.get(j, k);
xDatas[0] = m_dataPlot[i]->multiplotXData(j, k);
xSize = m_dataPlot[i]->multiplotXData.getSize(j, k);
yDatas.resize(1);
yDatas[0] = m_dataPlot[i]->multiplotYData.get(j, k);
yDatas[0] = m_dataPlot[i]->multiplotYData(j, k);
ySize = m_dataPlot[i]->multiplotYData.getSize(j, k);
zDatas.resize(1);
zDatas[0] = m_dataPlot[i]->multiplotZData.get(j, k);
zDatas[0] = m_dataPlot[i]->multiplotZData(j, k);
zSize = m_dataPlot[i]->multiplotZData.getSize(j, k);
ostringstream extra;
......@@ -484,11 +484,11 @@ void AcquisitionSerializer::updateScanSpyPlotEvent(int32 i) {
optimizationResultFounds.resize(size);
optimizationResultValues.resize(size);
for(int32 j = 0; j < size; ++j) {
xDatas[j] = m_scanSpy->optimizationPlotX.get(j);
yDatas[j] = m_scanSpy->optimizationPlotY.get(j);
optimizationFitDatas[j] = m_scanSpy->optimizationFitPlotY.get(j);
optimizationResultFounds[j] = m_scanSpy->optimization1dResultFound.get(j);
optimizationResultValues[j]= m_scanSpy->optimization1dXResult.get(j);
xDatas[j] = m_scanSpy->optimizationPlotX(j);
yDatas[j] = m_scanSpy->optimizationPlotY(j);
optimizationFitDatas[j] = m_scanSpy->optimizationFitPlotY(j);
optimizationResultFounds[j] = m_scanSpy->optimization1dResultFound(j);
optimizationResultValues[j]= m_scanSpy->optimization1dXResult(j);
errorBars[j] = true;
}
zDatas.clear();
......@@ -506,7 +506,7 @@ void AcquisitionSerializer::updateScanSpyPlotEvent(int32 i) {
// if ((xDatas[0] != NULL) && (yDatas[0] != NULL)) {
ostringstream imageName;
imageName << m_scanSpy->getName() << "#" << "scanSpyPlot0.png";
imageName << m_scanSpy->getType() << ".png";
sendData(false, buffer::Data::Spy, m_imageSpyPath, imageName.str(), 100, 100);
Log::getInstance()->imageDataReadyLog(imageName.str(), m_imageSpyPath);
sendData(false, buffer::Data::WebSpy, m_imageWebPath, imageName.str(), 800, 800);
......@@ -521,7 +521,7 @@ void AcquisitionSerializer::createEmptyDataPlot(int32 i, int32 j) {
if (m_dataPlot[i]->isEnabled()) {
//get name of image here to avoid having it empty
ostringstream imageName;
imageName << m_dataPlot[i]->getName() << "#detector_plot_data" << j << "#" << m_dataPlot[i]->plotName(j) << ".png";
imageName << m_dataPlot[i]->getType() << ".png";
xDatas.resize(1);
xDatas[0] = m_dataPlot[i]->detectorXData(j);
......@@ -579,11 +579,11 @@ void AcquisitionSerializer::createEmptyScanSpyPlot(int32 i) {
optimizationResultFounds.resize(size);
optimizationResultValues.resize(size);
for(int32 j = 0; j < size; ++j) {
xDatas[j] = m_scanSpy->optimizationPlotX.get(j);
yDatas[j] = m_scanSpy->optimizationPlotY.get(j);
optimizationFitDatas[j] = m_scanSpy->optimizationFitPlotY.get(j);
optimizationResultFounds[j] = m_scanSpy->optimization1dResultFound.get(j);
optimizationResultValues[j]= m_scanSpy->optimization1dXResult.get(j);
xDatas[j] = m_scanSpy->optimizationPlotX(j);
yDatas[j] = m_scanSpy->optimizationPlotY(j);
optimizationFitDatas[j] = m_scanSpy->optimizationFitPlotY(j);
optimizationResultFounds[j] = m_scanSpy->optimization1dResultFound(j);
optimizationResultValues[j]= m_scanSpy->optimization1dXResult(j);
errorBars[j] = true;
}
zDatas.clear();
......@@ -598,7 +598,7 @@ void AcquisitionSerializer::createEmptyScanSpyPlot(int32 i) {
title = numorStream.str();
ostringstream imageName;
imageName << m_scanSpy->getName() << "#" << "scanSpyPlot0.png";
imageName << m_scanSpy->getType() << ".png";
sendData(false, buffer::Data::Spy, m_imageSpyPath, imageName.str(), 100, 100);
Log::getInstance()->imageDataReadyLog(imageName.str(), m_imageSpyPath);
sendData(false, buffer::Data::WebSpy, m_imageWebPath, imageName.str(), 800, 800);
......
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