Commit 9ee6e2ec authored by Locatelli's avatar Locatelli

Reduce big data for plot in x slice

parent b427678a
......@@ -686,15 +686,15 @@ void DataPlot::calculateMultiplot(int32 nbElement) {
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) {
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());
/**************************************************************************
* RAW_DATA
**************************************************************************/
......@@ -911,6 +911,12 @@ void DataPlot::calculateMultiplot(int32 nbElement) {
multiplotReady.sendEvent(nbElement);
} else if (multiplotType(nbElement) == SUM_DATA) {
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());
/*
* SUM_DATA
*/
......
......@@ -73,6 +73,13 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, newxsize);
m_YData = setGeometry(1, NULL, newysize);
if (resize == true) {
m_DontDeleteZData = false;
m_ZData = new int32[newxsize * newysize];
}
else {
m_DontDeleteZData = true;
}
}
m_XSize = newxsize;
m_YSize = newysize;
......@@ -83,8 +90,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
adjust(data.nx * data.ny, data.dataMin, data.dataMax, data.data);
}
if (resize == true) {
m_DontDeleteZData = false;
m_ZData = new int32[m_ZSize];
// Counter c1;
CImg<int32> img(data.data, data.ny, data.nx);
CImg<int32> res = img.resize(m_YSize, m_XSize);
......@@ -100,7 +105,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
// cout << "time : " << c1.getTime() << endl;
} else {
m_ZData = data.data;
m_DontDeleteZData = true;
}
m_XLegend = X_LEGEND;
m_YLegend = Y_LEGEND;
......@@ -115,9 +119,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_Nx = data.nx;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nx;
m_YSize = 0;
m_ZSize = m_Nx;
......@@ -134,9 +138,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_Ny = data.ny;
m_XData = setGeometry(0, data.xGeometry, m_Ny);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Ny;
m_YSize = 0;
m_ZSize = m_Ny;
......@@ -151,11 +155,11 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nx = data.nx;
m_Ny = data.ny;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_DontDeleteZData = true;
}
m_Nz = data.nz;
m_Nw = data.nw;
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nx;
m_YSize = 0;
m_ZSize = m_Ny;
......@@ -180,6 +184,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -201,7 +206,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -221,6 +225,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Nz);
m_ZData = new int32[m_Nz * m_Nx];
m_DontDeleteZData = false;
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
for (int32 i = 0; i < m_Nx; ++i) {
......@@ -241,7 +246,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nz;
m_ZSize = m_Nx * m_Nz;
......@@ -261,6 +265,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Ny * m_Nz];
m_DontDeleteZData = false;
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
for (int32 i = 0; i < m_Nz; ++i) {
......@@ -281,7 +286,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = m_Ny;
m_ZSize = m_Nz * m_Ny;
......@@ -298,9 +302,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nz;
m_YSize = 0;
m_ZSize = m_Nz;
......@@ -326,6 +330,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
......@@ -342,7 +347,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -362,6 +366,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Nw);
m_ZData = new int32[m_Nx * m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Nw);
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
......@@ -378,7 +383,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nw;
m_ZSize = m_Nx * m_Nw;
......@@ -397,12 +401,18 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nw);
// No geometry yet
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Ny * m_Nw];
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
|| (data.dataType == AcquisitionController::CELL_DATA_TYPE)) {
m_DontDeleteZData = true;
}
else {
m_ZData = new int32[m_Ny * m_Nw];
m_DontDeleteZData = false;
}
}
if ((data.dataType == AcquisitionController::CHANNEL_DATA_TYPE)
|| (data.dataType == AcquisitionController::CELL_DATA_TYPE)) {
m_ZData = data.data;
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
memset(m_ZData, 0, sizeof(int32) * m_Ny * m_Nw);
for (int32 i = 0; i < m_Nw; ++i) {
......@@ -410,7 +420,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_ZData[j + i * m_Ny] += data.data[i + j * m_Nw];
}
}
m_DontDeleteZData = false;
}
m_XSize = m_Nw;
m_YSize = m_Ny;
......@@ -429,9 +438,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nw);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nw;
m_YSize = 0;
m_ZSize = m_Nw;
......@@ -461,6 +470,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -488,7 +498,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -508,6 +517,7 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_YData = setGeometry(1, NULL, m_Nz);
m_ZData = new int32[m_Nz * m_Nx];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -533,12 +543,12 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nz;
m_ZSize = m_Nx * m_Nz;
m_XLegend = X_LEGEND;
m_YLegend = CHANNELS_LEGEND;
m_DontDeleteZData = false;
} else if ((data.nx == 1) && (data.ny > 1)) {
// 1D
// create new arrays if necessary
......@@ -583,7 +593,6 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = m_Ny;
m_ZSize = m_Nz * m_Ny;
......@@ -604,9 +613,9 @@ void RawState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nw);
m_YData = setGeometry(1, NULL, m_Nz);
m_DontDeleteZData = true;
}
m_ZData = data.data;
m_DontDeleteZData = true;
m_XSize = m_Nw;
m_YSize = m_Nz;
m_ZSize = m_Nw * m_Nz;
......
......@@ -61,12 +61,13 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = newzsize;
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nz);
m_DontDeleteZData = false;
m_ZData = new int32[newzsize];
}
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) {
......@@ -90,7 +91,6 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
}
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));
......@@ -100,7 +100,7 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
}
} else {
// No geometry yet
m_ZData = tmparray;
memcpy(m_ZData, tmparray, m_ZSize * sizeof(int32));
}
m_XLegend = CHANNELS_LEGEND;
m_YLegend = SUMS_LEGEND;
......@@ -119,6 +119,7 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_XData = setGeometry(0, NULL, m_Nw);
m_ZData = new int32[m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nw);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -140,7 +141,6 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nw;
m_YSize = 0;
m_ZSize = m_Nw;
......@@ -167,6 +167,7 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
// No geometry yet
m_XData = setGeometry(0, NULL, m_Nw);
m_ZData = new int32[m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nw);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -194,7 +195,6 @@ void SumState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nw;
m_YSize = 0;
m_ZSize = m_Nw;
......
......@@ -59,20 +59,24 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
for (int32 j = 0; j < m_Nx * m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nw + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Nx;
m_YSize = m_Ny;
......@@ -91,20 +95,24 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx];
memset(m_ZData, 0, sizeof(int32) * m_Nx);
for (int32 j = 0; j < m_Nx; ++j) {
m_ZData[j] = data.data[j * m_Nw + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Nx;
m_YSize = 0;
......@@ -123,20 +131,24 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.yGeometry, m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Ny];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Ny];
memset(m_ZData, 0, sizeof(int32) * m_Ny);
for (int32 j = 0; j < m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nw + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Ny;
m_YSize = 0;
......@@ -161,6 +173,7 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -182,7 +195,6 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -202,6 +214,7 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_YData = setGeometry(0, data.yGeometry, m_Nz);
m_ZData = new int32[m_Nx * m_Nz];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Nx * m_Nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -223,7 +236,6 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nz;
m_ZSize = m_Nx * m_Nz;
......@@ -243,6 +255,7 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_YData = setGeometry(0, data.yGeometry, m_Ny);
m_ZData = new int32[m_Ny * m_Nz];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32) * m_Ny * m_Nz);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -264,7 +277,6 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nz;
m_YSize = m_Ny;
m_ZSize = m_Ny * m_Nz;
......@@ -282,16 +294,14 @@ void WSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nz);
m_DontDeleteZData = true;
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nz];
m_DontDeleteZData = true;
}
m_XSize = m_Nz;
m_YSize = 0;
......
......@@ -68,26 +68,29 @@ void XSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = newzsize;
m_Nw = data.nw;
m_Nx = data.nx;
if (resize == true) {
m_ZData = new int32[newzsize];
m_DontDeleteZData = false;
m_XData = setGeometry(0, NULL, newzsize);
float64 factor = (float64) data.nz / (float64) newzsize;
for (int32 i = 0; i < m_XSize; ++i) {
m_XData[i] = (float64) i * factor;
}
} else {
m_XData = setGeometry(0, data.xGeometry, newzsize);
m_DontDeleteZData = true;
}
}
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;
......@@ -104,9 +107,9 @@ void XSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_Nx = data.nx;
m_XData = setGeometry(0, data.xGeometry, m_Ny);
m_DontDeleteZData = true;
}
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
m_XSize = m_Ny;
m_YSize = 0;
m_ZSize = m_Ny;
......
......@@ -58,24 +58,28 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nw = data.nw;
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
memset(m_ZData, 0, sizeof(int32 ) * m_Nx * m_Ny);
for (int32 j = 0; j < m_Nx * m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nz + m_Position];
}
m_DontDeleteZData = false;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx * m_Ny];
memset(m_ZData, 0, sizeof(int32 ) * m_Nx * m_Ny);
for (int32 j = 0; j < m_Nx * m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nz + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Nx;
m_YSize = m_Ny;
......@@ -94,24 +98,28 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.xGeometry, m_Nx);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = new int32[m_Nx];
m_DontDeleteZData = false;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = new int32[m_Nx];
memset(m_ZData, 0, sizeof(int32 ) * m_Nx);
for (int32 j = 0; j < m_Nx; ++j) {
m_ZData[j] = data.data[j * m_Nz + m_Position];
}
m_DontDeleteZData = false;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Nx];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Nx];
memset(m_ZData, 0, sizeof(int32 ) * m_Nx);
for (int32 j = 0; j < m_Nx; ++j) {
m_ZData[j] = data.data[j * m_Nz + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Nx;
m_YSize = 0;
......@@ -130,24 +138,28 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_Nz = data.nz;
m_Nw = data.nw;
m_XData = setGeometry(0, data.yGeometry, m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = new int32[m_Ny];
m_DontDeleteZData = false;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Ny];
m_DontDeleteZData = false;
}
}
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
m_ZData = new int32[m_Ny];
memset(m_ZData, 0, sizeof(int32 ) * m_Ny);
for (int32 j = 0; j < m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nz + m_Position];
}
m_DontDeleteZData = false;
} else if (data.dataType == AcquisitionController::CELL_DATA_TYPE) {
m_ZData = &data.data[m_Position * m_Ny];
m_DontDeleteZData = true;
} else if (data.dataType == AcquisitionController::MASTERACQ_DATA_TYPE) {
m_ZData = new int32[m_Ny];
memset(m_ZData, 0, sizeof(int32 ) * m_Ny);
for (int32 j = 0; j < m_Ny; ++j) {
m_ZData[j] = data.data[j * m_Nz + m_Position];
}
m_DontDeleteZData = false;
}
m_XSize = m_Ny;
m_YSize = 0;
......@@ -172,6 +184,7 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, NULL, m_Nx);
m_YData = setGeometry(1, NULL, m_Ny);
m_ZData = new int32[m_Nx * m_Ny];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32 ) * m_Nx * m_Ny);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -193,7 +206,6 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Ny;
m_ZSize = m_Nx * m_Ny;
......@@ -213,6 +225,7 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, data.xGeometry, m_Nx);
m_YData = setGeometry(0, data.yGeometry, m_Nw);
m_ZData = new int32[m_Nx * m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32 ) * m_Nx * m_Nw);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -234,7 +247,6 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nx;
m_YSize = m_Nw;
m_ZSize = m_Nx * m_Nw;
......@@ -254,6 +266,7 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
m_XData = setGeometry(0, data.xGeometry, m_Nw);
m_YData = setGeometry(0, data.yGeometry, m_Ny);
m_ZData = new int32[m_Ny * m_Nw];
m_DontDeleteZData = false;
}
memset(m_ZData, 0, sizeof(int32 ) * m_Ny * m_Nw);
if (data.dataType == AcquisitionController::CHANNEL_DATA_TYPE) {
......@@ -275,12 +288,12 @@ void ZSliceState::setData(DataContainer& data) throw (CannotPlot) {
}
}
}
m_DontDeleteZData = false;
m_XSize = m_Nw;