强度模拟增加了进度条显示

pull/5/head
chenzenghui 2025-02-24 15:32:30 +08:00
parent 9fcc57b140
commit 45dd2e1246
5 changed files with 28 additions and 8 deletions

View File

@ -3922,7 +3922,9 @@ void CreateSARIntensityByLookTable(QString IntensityRasterPath,
QString LookTableRasterPath,
QString SARIntensityPath,
long min_rid, long max_rid,
long min_cid, long max_cid)
long min_cid, long max_cid,
std::function<void(long, long)> processBarShow
)
{
GDALAllRegister();
constexpr size_t GB4 = size_t(1) * 1024 * 1024 * 1024; // 4GB in bytes
@ -3964,7 +3966,7 @@ void CreateSARIntensityByLookTable(QString IntensityRasterPath,
for (int yOff = 0; yOff < height; yOff += blockYSize)
{
const int ySize = std::min(blockYSize, height - yOff);
// 读取行号列号数据
std::vector<long> rData(width * ySize);
std::vector<long> cData(width * ySize);
@ -3994,6 +3996,10 @@ void CreateSARIntensityByLookTable(QString IntensityRasterPath,
}
}
}
if (processBarShow) {
processBarShow(yOff, height);
}
}
// 写入输出

View File

@ -27,6 +27,7 @@
#include "LogInfoCls.h"
#include <QObject>
#include <QList>
#include <functional>
enum ProjectStripDelta {
Strip_6, // 6度带
@ -301,7 +302,7 @@ void BASECONSTVARIABLEAPI testOutAmpArr(QString filename, double* amp, long row
void BASECONSTVARIABLEAPI testOutClsArr(QString filename, long* amp, long rowcount, long colcount);
void BASECONSTVARIABLEAPI CreateSARIntensityByLookTable(QString IntensityRasterPath, QString LookTableRasterPath, QString SARIntensityPath, long min_rid, long max_rid, long min_cid, long max_cid);
void BASECONSTVARIABLEAPI CreateSARIntensityByLookTable(QString IntensityRasterPath, QString LookTableRasterPath, QString SARIntensityPath, long min_rid, long max_rid, long min_cid, long max_cid, std::function<void(long, long)> processBarShow = {});
//--------------------- 图像文件读写 ------------------------------

View File

@ -90,14 +90,13 @@ void QCreateSARIntensityByLookTableDialog::ondialogBtnaccepted()
long maxRid = ui->spinBoxMaxRid->value();
long minCid = ui->spinBoxMinCid->value();
long maxCid = ui->spinBoxMaxCid->value();
this->ui->progressBar->setValue(0);
auto func = [this](long v, long maxv) { this->showPrcess(v, maxv); }; // 调用函数
CreateSARIntensityByLookTable(inRasterPath, RefRasterPath, OutRasterPath,
minRid, maxRid, minCid, maxCid);
minRid, maxRid, minCid, maxCid, func);
//alignRaster(inRasterPath, RefRasterPath, OutRasterPath,GDALResampleAlg::GRA_Bilinear);
QMessageBox::information(this, tr(u8"Ìáʾ"), tr(u8"completed!!!"));
}
@ -105,3 +104,9 @@ void QCreateSARIntensityByLookTableDialog::ondialogBtnrejected()
{
this->close();
}
void QCreateSARIntensityByLookTableDialog::showPrcess(long v, long maxv)
{
this->ui->progressBar->setMaximum(maxv);
this->ui->progressBar->setValue(v);
}

View File

@ -23,6 +23,7 @@ public slots:
void ondialogBtnaccepted();
void ondialogBtnrejected();
void showPrcess(long v, long maxv);
private:
Ui::QCreateSARIntensityByLookTableDialogClass* ui;

View File

@ -238,7 +238,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>76</height>
<height>50</height>
</size>
</property>
</spacer>
@ -250,6 +250,13 @@
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="progressBar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="dialogBtn">
<property name="standardButtons">