diff --git a/developHw.pro.user b/developHw.pro.user index b33236f..20ea1bd 100644 --- a/developHw.pro.user +++ b/developHw.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId diff --git a/hdf5Scenario/hdf5Scenario.cpp b/hdf5Scenario/hdf5Scenario.cpp index 7ed6e7c..ccecd8b 100644 --- a/hdf5Scenario/hdf5Scenario.cpp +++ b/hdf5Scenario/hdf5Scenario.cpp @@ -1076,11 +1076,16 @@ void Hdf5::scanConversionParamsRead(scanConversionParameters ¶ms) params.dz = (floatArray[0]); /*** /swScenarioParameters/scanConversionParameters/rxLineNo ***/ - datasetBranch("/swScenarioParameters/scanConversionParameters/rxLineNo", floatArray); + datasetBranch("/swScenarioParameters/scanConversionParameters/rxLineNo", floatArray); //input + //frame + //width params.gridX_size = static_cast(floatArray[0]); /*** /swScenarioParameters/scanConversionParameters/rxFocusPointNo ***/ - datasetBranch("/swScenarioParameters/scanConversionParameters/rxFocusPointNo", floatArray); + datasetBranch("/swScenarioParameters/scanConversionParameters/rxFocusPointNo", + floatArray); //input + //frame + //depth params.gridZ_size = static_cast(floatArray[0]); /*** /swScenarioParameters/scanConversionParameters/scanAz ***/ @@ -1104,12 +1109,20 @@ void Hdf5::scanConversionParamsRead(scanConversionParameters ¶ms) params.gridZ = gridZ; /*** /swScenarioParameters/scanConversionParameters/pixelParameters/pixelZNo ***/ - datasetBranch("/swScenarioParameters/scanConversionParameters/pixelParameters/pixelZNo", floatArray); + datasetBranch( + "/swScenarioParameters/scanConversionParameters/pixelParameters/pixelZNo", //output + //image + //depth + floatArray); quint32 queryRow = static_cast(floatArray[0]); params.pixelZNo = queryRow; /*** /swScenarioParameters/scanConversionParameters/pixelParameters/pixelXNo ***/ - datasetBranch("/swScenarioParameters/scanConversionParameters/pixelParameters/pixelXNo", floatArray); + datasetBranch( + "/swScenarioParameters/scanConversionParameters/pixelParameters/pixelXNo", //output + //image + //width + floatArray); quint32 queryColumn = static_cast(floatArray[0]); params.pixelXNo = queryColumn; diff --git a/hdf5Scenario/hdf5Scenario.h b/hdf5Scenario/hdf5Scenario.h index 177eaa9..7c276de 100644 --- a/hdf5Scenario/hdf5Scenario.h +++ b/hdf5Scenario/hdf5Scenario.h @@ -7,7 +7,7 @@ #include "model/hardware/core/lowLevelApi/TrxBoard.h" #include "../kernelParams/KernelParams.h" -#define MAX_ARRAY_DEPTH 131072U +#define MAX_ARRAY_DEPTH 1310720U using namespace std; using namespace H5; diff --git a/mainwindow.cpp b/mainwindow.cpp index 35dfabd..c8eacaa 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2245,90 +2245,115 @@ void MainWindow::show3d() qDebug() << "mPoint" << mPoint; _colorMap->data()->clear(); - _colorMap->data()->setSize(line, point + 1); - _colorMap->data()->setRange(QCPRange(1, line), QCPRange(1, point + 1)); - quint32 max = 0; - auto indx = 0; - auto lnSum = 0; - foreach(const QByteArray& plotPacket, plotFrame) + if(_isScanConvDynamicCont) { - auto lnPacket = (((static_cast(plotPacket[136])) & 0x00FF) | - (((static_cast(plotPacket[137])) << 8) & 0xFF00)); - - for(auto ln = 0; ln < lnPacket; ln += 1) + _colorMap->data()->setSize(static_cast(scanConversionParams.pixelXNo), + static_cast(scanConversionParams.pixelZNo + 1)); + _colorMap->data()->setRange(QCPRange(1, + static_cast(scanConversionParams.pixelXNo)), + QCPRange(1, + static_cast(scanConversionParams.pixelZNo + + 1))); + for(quint32 ln = 0; ln < scanConversionParams.pixelXNo; ln += 1) { - for(auto pnt = 0; pnt < (point + 1); pnt += 1) + for(quint32 pnt = 0; pnt < scanConversionParams.pixelZNo + 1; pnt += 1) { - indx = (ln * point + pnt) * 4 + 160; - auto val = frameDataCalc(plotPacket, indx); + float pixel = 0.0f; + float queryX = 0.0f; + float queryZ = 0.0f; + quint32 scanValue = 0; - if(max < val) + if(pnt < scanConversionParams.pixelZNo && ln < scanConversionParams.pixelXNo) { - max = val; + queryX = scanConversionParams.queryX.at(static_cast(ln)).at( + static_cast(pnt)); + queryZ = scanConversionParams.queryZ.at(static_cast(ln)).at( + static_cast(pnt)); } - - if(_isScanConvDynamicCont) + QPair index = readScanConversionIndex(queryX, + queryZ, + scanConversionParams); + qint32 gridX_index = index.first; + qint32 gridZ_index = index.second; + + if(gridX_index >= 0 && + (gridX_index) < + static_cast(scanConversionParams.gridX_size - 1) && + gridZ_index >= 0 && + (gridZ_index) < static_cast(scanConversionParams.gridZ_size - 1)) { - float pixel = 0.0f; - float queryX = 0.0f; - float queryZ = 0.0f; - - if(static_cast(pnt) < scanConversionParams.pixelZNo && - static_cast(ln) < scanConversionParams.pixelXNo) - { - queryX = scanConversionParams.queryX.at(ln).at(pnt); - queryZ = scanConversionParams.queryZ.at(ln).at(pnt); - } - QPair index = readScanConversionIndex(queryX, queryZ, scanConversionParams); - qint32 gridX_index = index.first; - qint32 gridZ_index = index.second; + matrix.a11 = scanConversionParams.gridZ.at(gridZ_index + 1) - queryZ; + matrix.a12 = queryZ - scanConversionParams.gridZ.at(gridZ_index); + matrix.c11 = scanConversionParams.gridX.at(gridX_index + 1) - queryX; + matrix.c12 = queryX - scanConversionParams.gridX.at(gridX_index); + matrix.dx = scanConversionParams.dx; + matrix.dz = scanConversionParams.dz; - if(gridX_index >= 0 && (gridX_index) < static_cast(scanConversionParams.gridX_size - 1) && - gridZ_index >= 0 && (gridZ_index) < static_cast(scanConversionParams.gridZ_size - 1)) - { - matrix.a11 = scanConversionParams.gridZ.at(gridZ_index + 1) - queryZ; - matrix.a12 = queryZ - scanConversionParams.gridZ.at(gridZ_index); - matrix.c11 = scanConversionParams.gridX.at(gridX_index + 1) - queryX; - matrix.c12 = queryX - scanConversionParams.gridX.at(gridX_index); - matrix.dx = scanConversionParams.dx; - matrix.dz = scanConversionParams.dz; - - auto scanConIndex = (gridX_index * point + gridZ_index) * 4 + 160; - auto scanConValue = frameDataCalc(plotPacket, scanConIndex); - matrix.b11 = scanConValue; - - scanConIndex = ((gridX_index + 1) * point + gridZ_index) * 4 + 160; - scanConValue = frameDataCalc(plotPacket, scanConIndex); - matrix.b12 = scanConValue; + auto scanConIndex = (gridX_index * point + gridZ_index) * 4 + 160; + auto scanConValue = frameDataCalc(plotFrame.at(0), scanConIndex); + matrix.b11 = scanConValue; - scanConIndex = (gridX_index * point + (gridZ_index + 1)) * 4 + 160; - scanConValue = frameDataCalc(plotPacket, scanConIndex); - matrix.b21 = scanConValue; + scanConIndex = ((gridX_index + 1) * point + gridZ_index) * 4 + 160; + scanConValue = frameDataCalc(plotFrame.at(0), scanConIndex); + matrix.b12 = scanConValue; - scanConIndex = ((gridX_index + 1) * point + (gridZ_index + 1)) * 4 + 160; - scanConValue = frameDataCalc(plotPacket, scanConIndex); - matrix.b22 = scanConValue; + scanConIndex = (gridX_index * point + (gridZ_index + 1)) * 4 + 160; + scanConValue = frameDataCalc(plotFrame.at(0), scanConIndex); + matrix.b21 = scanConValue; - pixel = scanConversionFmaCalc(matrix); + scanConIndex = ((gridX_index + 1) * point + (gridZ_index + 1)) * 4 + + 160; + scanConValue = frameDataCalc(plotFrame.at(0), scanConIndex); + matrix.b22 = scanConValue; - pixel = DynamicContrast(pixel, dynamicContrastParams); - } + pixel = scanConversionFmaCalc(matrix); - val = static_cast(pixel); + pixel = DynamicContrast(pixel, dynamicContrastParams); } - if(pnt == point) + scanValue = static_cast(pixel); + + if(pnt == scanConversionParams.pixelZNo) { - _colorMap->data()->setCell(lnSum + ln, pnt, double(255)); + scanValue = 255; } - else + _colorMap->data()->setCell(static_cast(ln), + static_cast(scanConversionParams.pixelZNo - + pnt), + static_cast(scanValue)); + } + } + } + else + { + _colorMap->data()->setSize(line, point); + _colorMap->data()->setRange(QCPRange(1, line), QCPRange(1, point)); + quint32 max = 0; + auto indx = 0; + auto lnSum = 0; + foreach(const QByteArray& plotPacket, plotFrame) + { + auto lnPacket = (((static_cast(plotPacket[136])) & 0x00FF) | + (((static_cast(plotPacket[137])) << 8) & 0xFF00)); + + for(auto ln = 0; ln < lnPacket; ln += 1) + { + for(auto pnt = 0; pnt < point; pnt += 1) { + indx = (ln * point + pnt) * 4 + 160; + auto val = frameDataCalc(plotPacket, indx); + + if(max < val) + { + max = val; + } + _colorMap->data()->setCell(lnSum + ln, pnt, double(val)); } } + lnSum = lnSum + lnPacket; } - lnSum = lnSum + lnPacket; } if(!ui->plot_2->plotLayout()->hasElement(0, 1)) diff --git a/mainwindow.ui b/mainwindow.ui index ca9a3f5..c0eef6e 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -1752,7 +1752,7 @@ Scenarios - 10 + 9 50 false @@ -1794,7 +1794,7 @@ Scenarios - 10 + 9 50 false @@ -1840,7 +1840,7 @@ Scenarios - 10 + 9 50 false @@ -1872,7 +1872,9 @@ Scenarios - 10 + 9 + 50 + false @@ -1912,7 +1914,7 @@ Scenarios - 10 + 9 50 false