增加DEM的经纬度转XYZ的工具,并且修复了日志文件与界面日志显示的差异bug
parent
0ab8617983
commit
3153719801
|
@ -34,7 +34,7 @@ void customMessageHandler(QtMsgType type, const QMessageLogContext& context, con
|
||||||
.arg(file)
|
.arg(file)
|
||||||
.arg(context.line)
|
.arg(context.line)
|
||||||
.arg(function);
|
.arg(function);
|
||||||
ts << logMessage;
|
ts << logMessage << "\n";
|
||||||
_showIntance->ShowMessageInfo(logMessage);
|
_showIntance->ShowMessageInfo(logMessage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ void customMessageHandler(QtMsgType type, const QMessageLogContext& context, con
|
||||||
.arg(file)
|
.arg(file)
|
||||||
.arg(context.line)
|
.arg(context.line)
|
||||||
.arg(function);
|
.arg(function);
|
||||||
ts << logMessage;
|
ts << logMessage << "\n";
|
||||||
_showIntance->ShowMessageInfo(logMessage);
|
_showIntance->ShowMessageInfo(logMessage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ void customMessageHandler(QtMsgType type, const QMessageLogContext& context, con
|
||||||
.arg(file)
|
.arg(file)
|
||||||
.arg(context.line)
|
.arg(context.line)
|
||||||
.arg(function);
|
.arg(function);
|
||||||
ts << logMessage;
|
ts << logMessage << "\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
|
@ -69,7 +69,7 @@ void customMessageHandler(QtMsgType type, const QMessageLogContext& context, con
|
||||||
.arg(file)
|
.arg(file)
|
||||||
.arg(context.line)
|
.arg(context.line)
|
||||||
.arg(function);
|
.arg(function);
|
||||||
ts << logMessage;
|
ts << logMessage << "\n";
|
||||||
_showIntance->ShowMessageInfo(logMessage);
|
_showIntance->ShowMessageInfo(logMessage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ void customMessageHandler(QtMsgType type, const QMessageLogContext& context, con
|
||||||
.arg(file)
|
.arg(file)
|
||||||
.arg(context.line)
|
.arg(context.line)
|
||||||
.arg(function);
|
.arg(function);
|
||||||
ts << logMessage;
|
ts << logMessage<<"\n";
|
||||||
_showIntance->ShowMessageInfo(logMessage);
|
_showIntance->ShowMessageInfo(logMessage);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
#include "RasterWidgetMessageShow.h"
|
||||||
|
|
||||||
|
namespace RasterMessageShow {
|
||||||
|
|
||||||
|
RasterWidgetMessageShow* RasterWidgetMessageShow::_instance = nullptr;
|
||||||
|
|
||||||
|
RasterWidgetMessageShow::RasterWidgetMessageShow(QObject* parant):QObject(parant)
|
||||||
|
{
|
||||||
|
QObject::connect(this, SIGNAL(ShowMessage(QString)), this, SLOT(ShowMessageInfo(QString)));
|
||||||
|
}
|
||||||
|
|
||||||
|
RasterWidgetMessageShow::~RasterWidgetMessageShow()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void RasterWidgetMessageShow::bandingTextBrowserMessage(QTextBrowser* intextBrowserMessage)
|
||||||
|
{
|
||||||
|
this->textBrowserMessage = intextBrowserMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
QTextBrowser* RasterWidgetMessageShow::getTextBrowserMessage()
|
||||||
|
{
|
||||||
|
return textBrowserMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RasterWidgetMessageShow::ShowMessageInfo(QString Message)
|
||||||
|
{
|
||||||
|
if (nullptr != this->textBrowserMessage) {
|
||||||
|
this->textBrowserMessage->append(Message);
|
||||||
|
}
|
||||||
|
else {}
|
||||||
|
}
|
||||||
|
|
||||||
|
RasterWidgetMessageShow* RasterWidgetMessageShow::getInstance(QObject* parant)
|
||||||
|
{
|
||||||
|
if (nullptr == RasterWidgetMessageShow::_instance) {
|
||||||
|
RasterWidgetMessageShow::_instance = new RasterWidgetMessageShow(parant);
|
||||||
|
}
|
||||||
|
return RasterWidgetMessageShow::_instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
|
@ -27,6 +27,7 @@ namespace RasterMessageShow {
|
||||||
{
|
{
|
||||||
if (nullptr != this->textBrowserMessage) {
|
if (nullptr != this->textBrowserMessage) {
|
||||||
this->textBrowserMessage->append(Message);
|
this->textBrowserMessage->append(Message);
|
||||||
|
|
||||||
}
|
}
|
||||||
else {}
|
else {}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "RasterMainWidget.h"
|
#include "RasterMainWidget.h"
|
||||||
#include "ToolBoxWidget.h"
|
#include "ToolBoxWidget.h"
|
||||||
#include "QDEMResampleDialog.h"
|
#include "QDEMResampleDialog.h"
|
||||||
|
#include "DEMLLA2XYZTool.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,14 +102,13 @@ void MergeRasterProcessToolButton::excute()
|
||||||
|
|
||||||
void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox)
|
void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
emit toolbox->addBoxToolItemSIGNAL(new GF3ImportDataToolButton(toolbox));
|
emit toolbox->addBoxToolItemSIGNAL(new GF3ImportDataToolButton(toolbox));
|
||||||
emit toolbox->addBoxToolItemSIGNAL(new Complex2AmpPhaseToolButton(toolbox));
|
emit toolbox->addBoxToolItemSIGNAL(new Complex2AmpPhaseToolButton(toolbox));
|
||||||
emit toolbox->addBoxToolItemSIGNAL(new QRDOrthProcessClassToolButton(toolbox));
|
emit toolbox->addBoxToolItemSIGNAL(new QRDOrthProcessClassToolButton(toolbox));
|
||||||
emit toolbox->addBoxToolItemSIGNAL(new QOrthSlrRasterToolButton(toolbox));
|
emit toolbox->addBoxToolItemSIGNAL(new QOrthSlrRasterToolButton(toolbox));
|
||||||
emit toolbox->addBoxToolItemSIGNAL(new MergeRasterProcessToolButton(toolbox));
|
emit toolbox->addBoxToolItemSIGNAL(new MergeRasterProcessToolButton(toolbox));
|
||||||
emit toolbox->addBoxToolItemSIGNAL(new QDEMResampleDialogToolButton(toolbox));
|
emit toolbox->addBoxToolItemSIGNAL(new QDEMResampleDialogToolButton(toolbox));
|
||||||
|
emit toolbox->addBoxToolItemSIGNAL(new QDEMLLA2XYZToolToolButton(toolbox));
|
||||||
}
|
}
|
||||||
|
|
||||||
QDEMResampleDialogToolButton::QDEMResampleDialogToolButton(QWidget* parent)
|
QDEMResampleDialogToolButton::QDEMResampleDialogToolButton(QWidget* parent)
|
||||||
|
@ -127,3 +127,20 @@ void QDEMResampleDialogToolButton::excute()
|
||||||
QDEMResampleDialog* dialog = new QDEMResampleDialog();
|
QDEMResampleDialog* dialog = new QDEMResampleDialog();
|
||||||
dialog->show();
|
dialog->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QDEMLLA2XYZToolToolButton::QDEMLLA2XYZToolToolButton(QWidget* parent)
|
||||||
|
{
|
||||||
|
this->toolPath = QVector<QString>(0);
|
||||||
|
this->toolPath.push_back(u8"基础处理");
|
||||||
|
this->toolname = QString(u8"DEM(WGS84)LLA转为XYZ");
|
||||||
|
}
|
||||||
|
|
||||||
|
QDEMLLA2XYZToolToolButton::~QDEMLLA2XYZToolToolButton()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void QDEMLLA2XYZToolToolButton::excute()
|
||||||
|
{
|
||||||
|
DEMLLA2XYZTool* dialog = new DEMLLA2XYZTool();
|
||||||
|
dialog->show();
|
||||||
|
}
|
||||||
|
|
|
@ -68,10 +68,22 @@ class BASETOOLBOX_EXPORT QDEMResampleDialogToolButton : public QToolAbstract {
|
||||||
public:
|
public:
|
||||||
QDEMResampleDialogToolButton(QWidget* parent = nullptr);
|
QDEMResampleDialogToolButton(QWidget* parent = nullptr);
|
||||||
~QDEMResampleDialogToolButton();
|
~QDEMResampleDialogToolButton();
|
||||||
public :
|
public slots:
|
||||||
virtual void excute() override;
|
virtual void excute() override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class BASETOOLBOX_EXPORT QDEMLLA2XYZToolToolButton : public QToolAbstract {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
QDEMLLA2XYZToolToolButton(QWidget* parent = nullptr);
|
||||||
|
~QDEMLLA2XYZToolToolButton();
|
||||||
|
public slots:
|
||||||
|
virtual void excute() override;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern "C" BASETOOLBOX_EXPORT void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox);
|
extern "C" BASETOOLBOX_EXPORT void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox);
|
||||||
|
|
|
@ -10,8 +10,8 @@ DEMLLA2XYZTool::DEMLLA2XYZTool(QWidget *parent)
|
||||||
{
|
{
|
||||||
ui.setupUi(this);
|
ui.setupUi(this);
|
||||||
|
|
||||||
connect(this->ui.dialogBtn, SIGNAL(accept()), this, SLOT(accept()));
|
connect(this->ui.dialogBtn, SIGNAL(accepted()), this, SLOT(onaccept()));
|
||||||
connect(this->ui.dialogBtn, SIGNAL(reject()), this, SLOT(reject()));
|
connect(this->ui.dialogBtn, SIGNAL(rejected()), this, SLOT(onreject()));
|
||||||
connect(this->ui.DEMWSG84SelectBtn, SIGNAL(clicked()), this, SLOT(onDEMWSG84SelectBtn_Clicked()));
|
connect(this->ui.DEMWSG84SelectBtn, SIGNAL(clicked()), this, SLOT(onDEMWSG84SelectBtn_Clicked()));
|
||||||
connect(this->ui.DEMXYZSelectBtn, SIGNAL(clicked()), this, SLOT(onDEMXYZSelectBtn_Clicked()));
|
connect(this->ui.DEMXYZSelectBtn, SIGNAL(clicked()), this, SLOT(onDEMXYZSelectBtn_Clicked()));
|
||||||
connect(this->ui.BtnSloper, SIGNAL(clicked()), this, SLOT(onBtnSloper_Clicked()));
|
connect(this->ui.BtnSloper, SIGNAL(clicked()), this, SLOT(onBtnSloper_Clicked()));
|
||||||
|
@ -22,7 +22,7 @@ DEMLLA2XYZTool::DEMLLA2XYZTool(QWidget *parent)
|
||||||
DEMLLA2XYZTool::~DEMLLA2XYZTool()
|
DEMLLA2XYZTool::~DEMLLA2XYZTool()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void DEMLLA2XYZTool::accept()
|
void DEMLLA2XYZTool::onaccept()
|
||||||
{
|
{
|
||||||
QString DEMPath = this->ui.lineEditLLA->text();
|
QString DEMPath = this->ui.lineEditLLA->text();
|
||||||
QString XYZPath = this->ui.lineEditXYZ->text();
|
QString XYZPath = this->ui.lineEditXYZ->text();
|
||||||
|
@ -36,14 +36,14 @@ void DEMLLA2XYZTool::accept()
|
||||||
|
|
||||||
// 分块计算并转换为XYZ
|
// 分块计算并转换为XYZ
|
||||||
|
|
||||||
Eigen::MatrixXd demArr = demds.getData(0, 0, demds.height, demds.width, 1);
|
//Eigen::MatrixXd demArr = demds.getData(0, 0, demds.height, demds.width, 1);
|
||||||
Eigen::MatrixXd demR = demArr;
|
//Eigen::MatrixXd demR = demArr;
|
||||||
Landpoint LandP{ 0,0,0 };
|
Landpoint LandP{ 0,0,0 };
|
||||||
Point3 GERpoint{ 0,0,0 };
|
Point3 GERpoint{ 0,0,0 };
|
||||||
double R = 0;
|
double R = 0;
|
||||||
double dem_row = 0, dem_col = 0, dem_alt = 0;
|
double dem_row = 0, dem_col = 0, dem_alt = 0;
|
||||||
|
|
||||||
long line_invert = 1000;
|
long line_invert = Memory1MB/8.0/ demds.width*2000;
|
||||||
|
|
||||||
double rowidx = 0;
|
double rowidx = 0;
|
||||||
double colidx = 0;
|
double colidx = 0;
|
||||||
|
@ -60,6 +60,7 @@ void DEMLLA2XYZTool::accept()
|
||||||
int datarows = demdata.rows();
|
int datarows = demdata.rows();
|
||||||
int datacols = demdata.cols();
|
int datacols = demdata.cols();
|
||||||
|
|
||||||
|
#pragma omp parallel for
|
||||||
for (int i = 0; i < datarows; i++) {
|
for (int i = 0; i < datarows; i++) {
|
||||||
for (int j = 0; j < datacols; j++) {
|
for (int j = 0; j < datacols; j++) {
|
||||||
rowidx = i + max_rows_ids;
|
rowidx = i + max_rows_ids;
|
||||||
|
@ -75,7 +76,7 @@ void DEMLLA2XYZTool::accept()
|
||||||
demxyz.saveImage(xyzdata_y, max_rows_ids, 0, 2);
|
demxyz.saveImage(xyzdata_y, max_rows_ids, 0, 2);
|
||||||
demxyz.saveImage(xyzdata_z, max_rows_ids, 0, 3);
|
demxyz.saveImage(xyzdata_z, max_rows_ids, 0, 3);
|
||||||
|
|
||||||
this->ui.progressBar->setValue(max_rows_ids/ demds.height/2);
|
this->ui.progressBar->setValue(100.0*(max_rows_ids/ demds.height/2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -107,7 +108,7 @@ void DEMLLA2XYZTool::accept()
|
||||||
Vector3D Zaxis = { 0,0,1 };
|
Vector3D Zaxis = { 0,0,1 };
|
||||||
|
|
||||||
double rowidx = 0, colidx = 0;
|
double rowidx = 0, colidx = 0;
|
||||||
|
#pragma omp parallel for
|
||||||
for (long i = 1; i < dem_rows - 1; i++) {
|
for (long i = 1; i < dem_rows - 1; i++) {
|
||||||
for (long j = 1; j < dem_cols - 1; j++) {
|
for (long j = 1; j < dem_cols - 1; j++) {
|
||||||
rowidx = i + startlineid;
|
rowidx = i + startlineid;
|
||||||
|
@ -139,7 +140,7 @@ void DEMLLA2XYZTool::accept()
|
||||||
demsloperxyz.saveImage(demsloper_z, start_ids - 1, 0, 3);
|
demsloperxyz.saveImage(demsloper_z, start_ids - 1, 0, 3);
|
||||||
demsloperxyz.saveImage(demsloper_angle, start_ids - 1, 0, 4);
|
demsloperxyz.saveImage(demsloper_angle, start_ids - 1, 0, 4);
|
||||||
|
|
||||||
this->ui.progressBar->setValue(50+start_ids / demds.height / 2);
|
this->ui.progressBar->setValue(50+ 100.0 * start_ids / demds.height / 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMessageBox::information(this, tr(u8"程序执行完成"), tr(u8"程序执行完成。"));
|
QMessageBox::information(this, tr(u8"程序执行完成"), tr(u8"程序执行完成。"));
|
||||||
|
@ -148,7 +149,7 @@ void DEMLLA2XYZTool::accept()
|
||||||
this->ui.label_3->setText("");
|
this->ui.label_3->setText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void DEMLLA2XYZTool::reject()
|
void DEMLLA2XYZTool::onreject()
|
||||||
{
|
{
|
||||||
this->close();
|
this->close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,8 +14,8 @@ public:
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void accept();
|
void onaccept();
|
||||||
void reject();
|
void onreject();
|
||||||
void onDEMWSG84SelectBtn_Clicked();
|
void onDEMWSG84SelectBtn_Clicked();
|
||||||
void onDEMXYZSelectBtn_Clicked();
|
void onDEMXYZSelectBtn_Clicked();
|
||||||
void onBtnSloper_Clicked();
|
void onBtnSloper_Clicked();
|
||||||
|
|
Loading…
Reference in New Issue