Commit b427678a authored by Locatelli's avatar Locatelli

Some changes:

- Redo jars files
- ScanSpy plots
- Offscreens plots improvements
parent 3ef15e5b
......@@ -219,7 +219,7 @@ void DataPlot::postConfiguration() {
registerUpdater(m_DetectorElements[i]->ySize, &DataPlot::updateDetectorYSize, this, i, m_DetectorElements[i]);
registerUpdater(m_DetectorElements[i]->zSize, &DataPlot::updateDetectorZSize, this, i, m_DetectorElements[i]);
registerUpdater(m_DetectorElements[i]->wSize, &DataPlot::updateDetectorWSize, this, i, m_DetectorElements[i]);
registerUpdater(m_DetectorElements[i]->data, &DataPlot::updateDetectorData, this, i, m_DetectorElements[i]);
//registerUpdater(m_DetectorElements[i]->data, &DataPlot::updateDetectorData, this, i, m_DetectorElements[i]);
registerUpdater(m_DetectorElements[i]->detSum, &DataPlot::updateDetectorData, this, i, m_DetectorElements[i]);
registerUpdater(m_DetectorElements[i]->nbRoi, &DataPlot::updateDetectorNbRoi, this, i, m_DetectorElements[i]);
......@@ -484,6 +484,11 @@ void DataPlot::updateDetectorWSize(int32 index, ControllerPtr<DetectorElement>&
*/
void DataPlot::updateDetectorData(int32 index, ControllerPtr<DetectorElement>& detector) {
calculate(index);
// Multi plot stuff
if (useMultiplot(index) == true) {
calculateMultiplot(index);
}
}
/*
......@@ -670,8 +675,23 @@ void DataPlot::calculate(int32 nbElement) {
} catch (DataTreatmentState::CannotPlot& e) {
}
// Multi plot stuff
if (useMultiplot(nbElement) == true) {
}
/*
* calculateMultiplot
*/
void DataPlot::calculateMultiplot(int32 nbElement) {
if (m_DetectorElements[nbElement]->getData() == NULL) {
return;
}
DataContainer detectorData(m_DetectorElements[nbElement]->getDataType(), m_DetectorElements[nbElement]->getData(),
m_DetectorElements[nbElement]->getXGeometry(), m_DetectorElements[nbElement]->getYGeometry(),
detectorMaxXPosition(nbElement), detectorMaxYPosition(nbElement), detectorMaxZPosition(nbElement),
detectorMaxWPosition(nbElement), detectorXPosition(nbElement), detectorYPosition(nbElement),
detectorZPosition(nbElement), detectorWPosition(nbElement), autoContrast.get(nbElement), m_DetectorElements[nbElement]->dataMin(),
m_DetectorElements[nbElement]->dataMax());
try {
if (multiplotType(nbElement) == RAW_DATA) {
......@@ -925,7 +945,6 @@ void DataPlot::calculate(int32 nbElement) {
} catch (DataTreatmentState::CannotPlot& e) {
}
}
}
void DataPlot::cut() {
......
......@@ -214,6 +214,13 @@ private:
*/
void calculate(int32 nbElement);
/*!
* \brief compute all plots and multiplots for a detector element
*
* \param[in] nbElement The element number
*/
void calculateMultiplot(int32 nbElement);
/*!
* \brief cut the plot
*/
......
......@@ -18,6 +18,9 @@
#include "SumState.h"
#include "CImg.h"
using namespace cimg_library;
#include <cstring>
namespace acquisition {
......@@ -40,6 +43,12 @@ void SumState::setSumState(DataPlot* dataPlot) {
void SumState::setData(DataContainer& data) throw (CannotPlot) {
if ((data.nz > 1) && (data.nw == 1)) {
bool resize = false;
int32 newzsize = data.nz;
if (data.nz > XMAX) {
resize = true;
newzsize = XMAX;
}
/*
* Using z
*/
......@@ -49,36 +58,50 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
deleteZData();
m_Nx = data.nx;
m_Ny = data.ny;
m_Nz = data.nz;
m_Nz = newzsize;
m_Nw = data.nw;
// No geometry yet
m_XData = setGeometry(0, NULL, m_Nz);
m_ZData = new int32[m_Nz];
}
memset(m_ZData, 0, sizeof(int32) * m_Nz);
m_XSize = newzsize;
m_YSize = 0;
m_ZSize = newzsize;
m_DontDeleteZData = false;
int32* tmparray = new int32[data.nz];
memset(tmparray, 0, sizeof(int32) * data.nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
for (int32 i = 0; i < m_Nx * m_Ny; ++i) {
for (int32 j = 0; j < m_Nz; ++j) {
m_ZData[j] += data.data[j + i * m_Nz];
for (int32 j = 0; j < data.nz; ++j) {
tmparray[j] += data.data[j + i * data.nz];
}
}
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
for (int32 i = 0; i < m_Nx * m_Ny; ++i) {
for (int32 j = 0; j < m_Nz; ++j) {
m_ZData[j] += data.data[i + j * m_Nx * m_Ny];
for (int32 j = 0; j < data.nz; ++j) {
tmparray[j] += data.data[i + j * m_Nx * m_Ny];
}
}
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
for (int32 i = 0; i < m_Nx * m_Ny; ++i) {
for (int32 j = 0; j < m_Nz; ++j) {
m_ZData[j] += data.data[j + i * m_Nz];
for (int32 j = 0; j < data.nz; ++j) {
tmparray[j] += data.data[j + i * data.nz];
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = 0;
m_ZSize = m_Nz;
if (resize == true) {
m_ZData = new int32[m_ZSize];
CImg<int32> img(tmparray, data.nz);
CImg<int32> res = img.resize(m_ZSize);
memcpy(m_ZData, res.data(), m_ZSize * sizeof(int32));
float64 factor = (float64) data.nz / (float64) m_ZSize;
for (int32 i = 0; i < m_XSize; ++i) {
m_XData[i] = (float64) i * factor;
}
} else {
// No geometry yet
m_ZData = tmparray;
}
m_XLegend = CHANNELS_LEGEND;
m_YLegend = SUMS_LEGEND;
} else if ((data.nz == 1) && (data.nw > 1)) {
......
......@@ -18,6 +18,9 @@
#include "XSliceState.h"
#include "CImg.h"
using namespace cimg_library;
namespace acquisition {
/*
......@@ -49,6 +52,47 @@ void XSliceState::setXSliceState(DataPlot* dataPlot) {
*/
void XSliceState::setData(DataContainer& data) throw (CannotPlot) {
if ((data.nx > 1) && (data.ny == 1) && (data.nz > 1) && (data.nw == 1)) {
bool resize = false;
int32 newzsize = data.nz;
if (data.nz > XMAX) {
resize = true;
newzsize = XMAX;
}
m_Position = data.xPosition;
// Detector 1D X size > 1
if ((m_Nx != data.nx) || (m_Ny != data.ny) || (m_Nz != newzsize) || (m_Nw != data.nw)) {
deleteXData();
deleteYData();
deleteZData();
m_Ny = data.ny;
m_Nz = newzsize;
m_Nw = data.nw;
m_Nx = data.nx;
}
m_XSize = newzsize;
m_YSize = 0;
m_ZSize = newzsize;
if (resize == true) {
m_DontDeleteZData = false;
m_ZData = new int32[m_ZSize];
CImg<int32> img(&data.data[m_Position * data.nz], data.nz);
CImg<int32> res = img.resize(m_ZSize);
memcpy(m_ZData, res.data(), m_ZSize * sizeof(int32));
m_XData = setGeometry(0, NULL, newzsize);
float64 factor = (float64) data.nz / (float64) m_ZSize;
for (int32 i = 0; i < m_XSize; ++i) {
m_XData[i] = (float64) i * factor;
}
} else {
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
}
m_XLegend = CHANNELS_LEGEND;
m_YLegend = COUNTS_LEGEND;
} else if ((data.nx > 1) && (data.ny > 1) && (data.nz == 1) && (data.nw == 1)) {
m_Position = data.xPosition;
// Detector 1D X size > 1
if ((m_Nx != data.nx) || (m_Ny != data.ny) || (m_Nz != data.nz) || (m_Nw != data.nw)) {
......@@ -59,35 +103,15 @@ void XSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_Nx = data.nx;
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_XData = setGeometry(0, data.xGeometry, m_Ny);
}
m_ZData = &data.data[m_Position * m_Nz];
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
m_XSize = m_Nz;
m_XSize = m_Ny;
m_YSize = 0;
m_ZSize = m_Nz;
m_ZSize = m_Ny;
m_XLegend = CHANNELS_LEGEND;
m_YLegend = COUNTS_LEGEND;
} else if ((data.nx > 1) && (data.ny > 1) && (data.nz == 1) && (data.nw == 1)) {
m_Position = data.xPosition;
// Detector 1D X size > 1
if ((m_Nx != data.nx) || (m_Ny != data.ny) || (m_Nz != data.nz) || (m_Nw != data.nw)) {
deleteXData();
deleteYData();
deleteZData();
m_Ny = data.ny;
m_Nz = data.nz;
m_Nw = data.nw;
m_Nx = data.nx;
m_XData = setGeometry(0, data.xGeometry, m_Ny);
}
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
m_XSize = m_Ny;
m_YSize = 0;
m_ZSize = m_Ny;
m_XLegend = CHANNELS_LEGEND;
m_YLegend = COUNTS_LEGEND;
} else {
throw CannotPlot();
}
......
......@@ -114,13 +114,13 @@ GenericScan1D::GenericScan1D(const string& name) :
optimizationFitPlotY.resize(m_numberOfCounts);
optimization1dResultFound.resize(m_numberOfCounts);
optimization1dXResult.resize(m_numberOfCounts);
optimizationPlotX.update(0, NULL);
optimizationPlotX.update(0, nullptr);
optimizationPlotX.setSize(0, 0);
optimizationPlotY.update(0, NULL);
optimizationPlotY.update(0, nullptr);
optimizationPlotY.setSize(0, 0);
optimizationFitPlotY.update(0, NULL);
optimizationFitPlotY.update(0, nullptr);
optimizationFitPlotY.setSize(0, 0);
optimizationPlotYCount.update(0, NULL);
optimizationPlotYCount.update(0, nullptr);
optimizationPlotYCount.setSize(0, 0);
// float64 * plot_x = new float64[m_numberOfCounts];
......@@ -220,17 +220,21 @@ void GenericScan1D::initOptimizationPlot(int32 size) {
}
// Updating the X values
float64 * plot_x = optimizationPlotX.get(0);
delete [] plot_x;
int32 x_size = (size <= 0 ? 1 : size);
plot_x = new float64[x_size];
for (int32 i = 0; i < x_size; ++i) {
plot_x[i] = 0.0;
}
for (int32 i = 0; i < m_numberOfCounts; ++i) {
optimizationFitPlot.update(i ,false);
optimization1dResultFound.update(i ,false);
float64 * plot_x = optimizationPlotX.get(i);
delete [] plot_x;
int32 x_size = (size <= 0 ? 1 : size);
plot_x = new float64[x_size];
for (int32 i = 0; i < x_size; ++i) {
plot_x[i] = 0.0;
}
optimizationPlotX.update(i, plot_x);
optimizationPlotX.setSize(i, 0);
......@@ -247,8 +251,6 @@ void GenericScan1D::initOptimizationPlot(int32 size) {
optimizationPlotY.update(i, plot_y);
optimizationPlotY.setSize(i, 0);
optimizationFitPlot.update(i ,false);
optimization1dResultFound.update(i ,false);
emptyFitArray(i);
}
......@@ -293,8 +295,6 @@ void GenericScan1D::updateMeasure() {
int32 repeaterStep = any_cast<int32>(repeater()->getValue(ScanRepeater::COUNT_STEP_PROPERTY));
// getting the plot arrays
float64 * plot_x = optimizationPlotX(repeaterStep);
// getting the values from OptimizationScan and copying them until the end of the array.
vector<float64> X = repeaterOptimizationScan1D->getX();
......@@ -308,29 +308,23 @@ void GenericScan1D::updateMeasure() {
}
index = any_cast<int32> (getValue(OPTIMIZATION_X_VARIABLE_INDEX_PROPERTY));
if (countIndex == 0) {
for (int32 i = m_optimization_plot_index; i < m_countIterator->getNumberOfSteps(); ++i) {
plot_x[i] = X[index];
// cout << "setting plot_x " << i << " to " << X[index] << " -> " << repeaterStep << endl;
}
optimizationPlotX.setSize(repeaterStep, m_optimization_plot_index + 1);
optimizationPlotX.sendEvent(repeaterStep);
// getting the plot arrays
float64 * plot_x = optimizationPlotX(repeaterStep);
float64 * plot_y = optimizationPlotY.get(repeaterStep);
for (int32 i = m_optimization_plot_index; i < m_countIterator->getNumberOfSteps(); ++i) {
plot_x[i] = X[index];
plot_y[i] = Y;
// cout << "setting plot_x " << i << " to " << X[index] << " -> " << repeaterStep << endl;
}
// if (countIndex == 0) {
float64 * plot_y = optimizationPlotY.get(repeaterStep);
for (int32 i = m_optimization_plot_index; i < m_countIterator->getNumberOfSteps(); ++i) {
plot_y[i] = Y;
// cout << "setting plot_y " << i << " to " << Y << " -> " << repeaterStep << endl;
}
// }
optimizationPlotX.setSize(repeaterStep, m_optimization_plot_index + 1);
optimizationPlotX.sendEvent(repeaterStep);
optimizationPlotY.setSize(repeaterStep, m_optimization_plot_index + 1);
optimizationPlotY.sendEvent(repeaterStep);
// filling the optimization arrays
// int32 n = any_cast<int32>(getValue(N_PROPERTIES_PROPERTY));
// for (int32 i = 0; i < n; ++i) {
//
int32 n = any_cast<int32>(getValue(N_PROPERTIES_PROPERTY));
for (int32 i = 0; i < n; ++i) {
try {
plot_x = any_cast<float64 *> (getValue(concat(OPTIMIZATION_PLOT_X_VARIABLE_PROPERTY, index)));
......@@ -343,7 +337,7 @@ void GenericScan1D::updateMeasure() {
} catch (const UnknownProperty & e) {
cerr << "GenericScan1D::updateMeasure : unknown property" << endl;
}
// }
}
plot_y = any_cast<float64 *> (getValue(concat(OPTIMIZATION_PLOT_Y_COUNT_PROPERTY, countIndex)));
for (int32 i = m_optimization_plot_index; i < m_countIterator->getNumberOfSteps(); ++i) {
......@@ -353,6 +347,9 @@ void GenericScan1D::updateMeasure() {
sendArrayEvent(concat(OPTIMIZATION_PLOT_Y_COUNT_PROPERTY, countIndex));
// cout << "countIndex = " << countIndex << " , m_numberOfCounts = " << m_numberOfCounts << " , repeaterStep = " << repeaterStep
// << " , m_optimization_plot_index = " << m_optimization_plot_index << " , optimizationPlotY.getSizE() = " << optimizationPlotY.getSize(repeaterStep) <<endl;
// incrementing counter
if (countIndex == m_numberOfCounts - 1) {
++m_optimization_plot_index;
......@@ -478,36 +475,30 @@ std::vector<float64> GenericScan1D::getOptimizationResultsWithRepeater(int32 cou
// get optimization type
string optimizationType = any_cast<string> (getValue(OPTIMIZATION_TYPE_PROPERTY));
for (int32 i = 0; i < m_numberOfCounts; ++i) {
vector<float64> fit = repeaterOptimizationScan1D->getFitY()[countIndex];
if (fit.size() > 0) {
vector<float64> fit = repeaterOptimizationScan1D->getFitY()[countIndex];
// updating fit infos
// only first curve
if (countIndex == 0) {
if (fit.size() > 0) {
float64 * fit_plot_y = optimizationFitPlotY(i);
delete [] fit_plot_y;
float64 * fit_plot_y = optimizationFitPlotY(countIndex);
delete [] fit_plot_y;
fit_plot_y = new float64[fit.size()];
for (int32 i = 0; i < (int32)fit.size(); ++i) {
fit_plot_y[i] = fit[i];
}
optimizationFitPlot.update(i, true);
optimizationFitPlotY.update(i, fit_plot_y);
optimizationFitPlotY.setSize(i, fit.size());
optimizationFitPlotY.sendEvent(i);
}
fit_plot_y = new float64[fit.size()];
for (int32 i = 0; i < (int32)fit.size(); ++i) {
fit_plot_y[i] = fit[i];
}
optimizationFitPlot.update(countIndex, true);
optimizationFitPlotY.update(countIndex, fit_plot_y);
optimizationFitPlotY.setSize(countIndex, fit.size());
optimizationFitPlotY.sendEvent(countIndex);
if (optimizationType == OptimizationFunction1D::MULTI_GAUSSIAN_PEAK || optimizationType == OptimizationFunction1D::GAUSSIAN_PEAK) {
m_fitResult[countIndex] = repeaterOptimizationScan1D->getFitResults()[countIndex];
}
} else {
// only first curve
if (countIndex == 0) {
optimizationFitPlot.update(i, false);
emptyFitArray(i);
}
if (optimizationType == OptimizationFunction1D::MULTI_GAUSSIAN_PEAK || optimizationType == OptimizationFunction1D::GAUSSIAN_PEAK) {
m_fitResult[countIndex] = repeaterOptimizationScan1D->getFitResults()[countIndex];
}
} else {
// only first curve
if (countIndex == 0) {
optimizationFitPlot.update(countIndex, false);
emptyFitArray(countIndex);
}
}
result = repeaterOptimizationScan1D->getOptimumPoint(countIndex);
......@@ -665,8 +656,8 @@ void GenericScan1D::finishWithoutRepeater() {
for (int32 c = 0; c < m_numberOfCounts; c++) {
optimization1dXResult.update(c, optimumPoint[0]);
optimization1dResultFound.update(c, true);
optimization1dXResult.update(c, optimumPoint[c]);
logOptimum = getPointForLogOptimum(optimumPoint);
......@@ -768,13 +759,13 @@ void GenericScan1D::finishWithRepeater() {
vector<float64> optimumPoint = getOptimizationResultsWithRepeater(c);
optimumsFound++;
optimization1dXResult.update(c, optimumPoint[0]);
optimization1dResultFound.update(c, true);
optimization1dXResult.update(c, optimumPoint[c]);
ostringstream os;
for (int32 i = 1; i < (int32)optimumPoint.size(); i++) {
os << ", " << optimumPoint[i];
}
// ostringstream os;
// for (int32 i = 1; i < (int32)optimumPoint.size(); i++) {
// os << ", " << optimumPoint[i];
// }
logOptimum = getPointForLogOptimum(optimumPoint);
......@@ -819,8 +810,6 @@ void GenericScan1D::finishWithRepeater() {
}
}
updateValue(OPTIMIZATION1D_RESULT_FOUND_PROPERTY, (optimumsFound > 0));
BaseScan::logPhaseDuration();
}
......@@ -830,8 +819,13 @@ void GenericScan1D::setRepeaterOptimizationPlotXProperties(int32 numberOfCounts,
// removing previous arrays
for (int32 i = 0; i < m_numberOfCounts; ++i) {
delete [] optimizationPlotX.get(i);
optimizationPlotX.update(i, nullptr);
delete [] optimizationPlotY.get(i);
optimizationPlotY.update(i, nullptr);
delete [] optimizationPlotYCount.get(i);
optimizationPlotYCount.update(i, nullptr);
delete [] optimizationFitPlotY.get(i);
optimizationFitPlotY.update(i, nullptr);
}
updateValue(COUNT_REPEATER_NB_COUNTS_PROPERTY, numberOfCounts);
......@@ -840,19 +834,25 @@ void GenericScan1D::setRepeaterOptimizationPlotXProperties(int32 numberOfCounts,
optimizationPlotYCount.resize(numberOfCounts);
optimizationPlotY.resize(numberOfCounts);
optimizationPlotX.resize(numberOfCounts);
plotXLabel.resize(m_numberOfCounts);
plotXLabel.resize(numberOfCounts);
optimizationFitPlot.resize(numberOfCounts);
optimizationFitPlotY.resize(numberOfCounts);
optimization1dResultFound.resize(numberOfCounts);
optimization1dXResult.resize(numberOfCounts);
// adding new arrays
for (int32 i = 0; i < numberOfCounts; i++) {
optimizationPlotX.update(i, new float64[size]);
optimizationPlotX.setSize(i, size);
optimizationPlotX.sendEvent(i);
// optimizationPlotX.sendEvent(i);
optimizationPlotYCount.update(i, new float64[size]);
optimizationPlotYCount.setSize(i, size);
optimizationPlotYCount.sendEvent(i);
// optimizationPlotYCount.sendEvent(i);
optimizationPlotY.update(i, new float64[size]);
optimizationPlotY.setSize(i, size);
optimizationPlotY.sendEvent(i);
// optimizationPlotY.sendEvent(i);
optimizationFitPlotY.update(i, new float64[size]);
optimizationFitPlotY.setSize(i, size);
}
m_numberOfCounts = numberOfCounts;
......
......@@ -248,9 +248,9 @@ bool RepeaterOptimizationScan1D::calculate() throw(std::logic_error) {
OptimizationData * data = d->second;
if ((data->m_optimizationFunction != 0)/* && (m_i + 1 > fitOrder())*/) {
try {
// cout << "calculate optimization" << endl;
// cout << "x = " << m_x << endl;
// cout << "y = " << m_y << endl;
// cout << "calculate optimization " << d->first << endl;
// cout << "x = " << data->m_x << endl;
// cout << "y = " << data->m_y << endl;
data->m_optimum = data->m_optimizationFunction->calculate(data->m_y, data->m_x);
......
......@@ -65,11 +65,24 @@ ScanSpy::ScanSpy(const string& name) :
useGrid.init(this, SAVE, "use_grid");
useLog.init(this, SAVE, "use_log");
// optimizationPlotY.resize(MAX_OPTIMIZATION_PLOTY);
// for(int32 i = 0; i < MAX_OPTIMIZATION_PLOTY; ++i) {
// optimizationPlotY.update(i, NULL);
// optimizationPlotY.setSize(i, 0);
// }
nbOptimizationPlotY.update(MAX_OPTIMIZATION_PLOTY);
optimizationPlotX.resize(MAX_OPTIMIZATION_PLOTY);
optimizationPlotY.resize(MAX_OPTIMIZATION_PLOTY);
optimizationFitPlot.resize(MAX_OPTIMIZATION_PLOTY);
optimizationFitPlotY.resize(MAX_OPTIMIZATION_PLOTY);
optimization1dResultFound.resize(MAX_OPTIMIZATION_PLOTY);
optimization1dXResult.resize(MAX_OPTIMIZATION_PLOTY);
plotXLabel.resize(MAX_OPTIMIZATION_PLOTY);
plotYLabel.resize(MAX_OPTIMIZATION_PLOTY);
plotTitle.resize(MAX_OPTIMIZATION_PLOTY);
for(int32 i = 0; i < MAX_OPTIMIZATION_PLOTY; ++i) {
optimizationPlotX.update(i, nullptr);
optimizationPlotX.setSize(i, 0);
optimizationPlotY.update(i, nullptr);
optimizationPlotY.setSize(i, 0);
optimizationFitPlotY.update(i, nullptr);
optimizationFitPlotY.setSize(i, 0);
}
/*
* Register functions
......@@ -148,7 +161,7 @@ void ScanSpy::updateAll(int32 index) {
updateStartedNumor(index);
updateEndedNumor(index);
updateIncrementalData(index);
for(uint32 i = 0;i < plotXLabel.getSize();++i) {
for(uint32 i = 0;i < countRepeaterNbCounts();++i) {
updatePlotXLabel(index, i);
}
}
......@@ -252,6 +265,7 @@ void ScanSpy::updateOptimization1dResultFound(int32 index, int32 nplot) {
}
else {
optimization1dResultFound.update(nplot, m_ScanControllers[index]->optimization1dResultFound(nplot));
}
}
......@@ -309,31 +323,46 @@ void ScanSpy::updateCountRepeaterActive(int32 index) {
*/
void ScanSpy::updateNbOptimizationPlotY(int32 index) {
int32 nbcount = m_ScanControllers[index]->nbOptimizationPlotY();
cout << "updateNbOptimizationPlotY : " << index << endl;
countRepeaterNbCounts = nbcount;
nbOptimizationPlotY = nbcount;
optimizationPlotX.resize(nbcount);
for(int32 i = 0; i < nbcount; ++i) {
optimizationPlotX.update(i, NULL);
for (int32 i = nbcount; i < countRepeaterNbCounts(); ++i) {
optimizationPlotX.update(i, nullptr);
optimizationPlotX.setSize(i, 0);
}
optimizationPlotY.resize(nbcount);
for(int32 i = 0; i < nbcount; ++i) {
optimizationPlotY.update(i, NULL);
optimizationPlotY.update(i, nullptr);
optimizationPlotY.setSize(i, 0);
}
optimizationFitPlotY.resize(nbcount);
for(int32 i = 0; i < nbcount; ++i) {
optimizationFitPlotY.update(i, NULL);
optimizationFitPlotY.update(i, nullptr);
optimizationFitPlotY.setSize(i, 0);
}
optimizationFitPlot.resize(nbcount);
optimization1dResultFound.resize(nbcount);
optimization1dXResult.resize(nbcount);
plotXLabel.resize(nbcount);
plotYLabel.resize(nbcount);
plotTitle.resize(nbcount);
for (int32 i = 0; i < nbcount; ++i) {
optimizationPlotX.update(i, m_ScanControllers[index]->optimizationPlotX(i));
optimizationPlotX.setSize(i, m_ScanControllers[index]->optimizationPlotX.getSize(i));
optimizationPlotY.update(i, m_ScanControllers[index]->optimizationPlotY(i));
optimizationPlotY.setSize(i, m_ScanControllers[index]->optimizationPlotY.getSize(i));
optimizationFitPlotY.update(i, m_ScanControllers[index]->optimizationFitPlotY(i));
optimizationFitPlotY.setSize(i, m_ScanControllers[index]->optimizationFitPlotY.getSize(i));
}
countRepeaterNbCounts = nbcount;
//nbOptimizationPlotY = nbcount;
// optimizationPlotX.resize(nbcount);
// for(int32 i = 0; i < nbcount; ++i) {
// optimizationPlotX.update(i, NULL);
// optimizationPlotX.setSize(i, 0);
// }
// optimizationPlotY.resize(nbcount);
// for(int32 i = 0; i < nbcount; ++i) {
// optimizationPlotY.update(i, NULL);
// optimizationPlotY.setSize(i, 0);
// }
// optimizationFitPlotY.resize(nbcount);
// for(int32 i = 0; i < nbcount; ++i) {
// optimizationFitPlotY.update(i, NULL);
// optimizationFitPlotY.setSize(i, 0);
// }
// optimizationFitPlot.resize(nbcount);
// optimization1dResultFound.resize(nbcount);
// optimization1dXResult.resize(nbcount);
// plotXLabel.resize(nbcount);
// plotYLabel.resize(nbcount);
// plotTitle.resize(nbcount);
updateAll(index);
}
......@@ -421,7 +450,7 @@ void ScanSpy::updatePlotTitle(int32 index) {
else {
buf << "Scan : " << numor() << endl;
}
for(uint32 i = 0;i < plotTitle.getSize();++i) {
for(uint32 i = 0;i < (uint32) plotTitle.getSize();++i) {
plotTitle.update(i, buf.str());
}