修改了编译方式
parent
71de7a4e8c
commit
fe5c3f4149
|
@ -18,7 +18,7 @@ ErrorCode GF3CalibrationRaster(QString inRasterPath, QString outRasterPath, doub
|
|||
gdalImageComplex outraster(outRasterPath);
|
||||
|
||||
|
||||
long blocklines = Memory1GB * 2 / 8 / imgraster.width;
|
||||
long blocklines = Memory1GB / 8 / imgraster.width*2;
|
||||
blocklines = blocklines < 100 ? 100 : blocklines;
|
||||
Eigen::MatrixXd imgArrb1 = Eigen::MatrixXd::Zero(blocklines, imgraster.width);
|
||||
Eigen::MatrixXd imgArrb2 = Eigen::MatrixXd::Zero(blocklines, imgraster.width);
|
||||
|
|
|
@ -24,7 +24,6 @@ ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT ImportGF3L1AProcess(QString inMetaxml
|
|||
// RD Ëã·¨Àà
|
||||
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT RD_PSTN(double& refrange,double& lamda, double& timeR, double& R, double& tx, double& ty, double& tz, double& slopex, double& slopey, double& slopez, GF3PolyfitSatelliteOribtModel& polyfitmodel, SatelliteOribtNode& node,double& d0,double& d1, double& d2, double& d3, double& d4);
|
||||
|
||||
|
||||
//´´½¨²éÕÒ±í
|
||||
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString outworkdir, QString outlooktablePath, QString outLocalIncidenceAnglePath, bool localincAngleFlag=false);
|
||||
ErrorCode GF3CALIBRATIONANDORTHLIB_EXPORT GF3OrthSLC( QString inRasterPath, QString inlooktablePath, QString outRasterPath);
|
||||
|
|
|
@ -8,9 +8,18 @@
|
|||
#include "FileOperator.h"
|
||||
#include "GPUBaseTool.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include <omp.h>
|
||||
// GPU相关的代码
|
||||
#include "GF3CalibrationGeoCodingFunCUDA.cuh"
|
||||
|
||||
|
||||
GF3CALIBRATIONANDORTHLIB_EXPORT int GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath, QString in_IncidencAngleRasterPath, QString out_SigmaVVRasterPath)
|
||||
/// <summary>
|
||||
/// 将HH极化转换为VV极化
|
||||
/// </summary>
|
||||
/// <param name="in_SigmaHHRasterPath"></param>
|
||||
/// <param name="in_IncidencAngleRasterPath"></param>
|
||||
/// <param name="out_SigmaVVRasterPath"></param>
|
||||
/// <returns></returns>
|
||||
int GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath, QString in_IncidencAngleRasterPath, QString out_SigmaVVRasterPath)
|
||||
{
|
||||
// step 1 检查输入合法性
|
||||
{
|
||||
|
@ -63,61 +72,23 @@ GF3CALIBRATIONANDORTHLIB_EXPORT int GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPat
|
|||
std::shared_ptr<double> sigmaHHRasterData = readDataArr<double>(inSigmaHHRaster, 0, 0, height, width, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> incidenceAngleData = readDataArr<double>(inIncidencAngleRaster, 0, 0, height, width, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> outSigmaVVRasterData = readDataArr<double>(outSigmaVVRaster, 0, 0, height, width, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
||||
// 分块执行数据
|
||||
int64_t block_count = Memory1MB / 8 * 500; // 500M内存 作为数据分块大小
|
||||
|
||||
// 创建交换内存
|
||||
|
||||
//double* sigmaHHRasterDataPtr_H = (double*)mallocCUDAHost(sizeof(double) * block_count); // 主机内存
|
||||
double* sigmaHHRasterDataPtr_D = (double*)mallocCUDADevice(sizeof(double) * block_count);// 设备内存
|
||||
|
||||
//double* incidenceAngleDataPtr_H = (double*)mallocCUDAHost(sizeof(double) * block_count); // 主机内存
|
||||
double* incidenceAngleDataPtr_D = (double*)mallocCUDADevice(sizeof(double) * block_count);// 设备内存
|
||||
|
||||
//double* outSigmaVVRasterDataPtr_H = (double*)mallocCUDAHost(sizeof(double) * block_count); // 主机内存
|
||||
double* outSigmaVVRasterDataPtr_D = (double*)mallocCUDADevice(sizeof(double) * block_count);// 设备内存
|
||||
|
||||
for (int64_t i = 0; i < pixel_count64; i += block_count)
|
||||
|
||||
#pragma omp parallel for
|
||||
for (int64_t i = 0; i < pixel_count64; i++)
|
||||
{
|
||||
int64_t block_size = (i + block_count) > pixel_count64 ? pixel_count64 - i : block_count;
|
||||
//采用内存拷贝 从主内存到分块内存
|
||||
HostToDevice(sigmaHHRasterDataPtr_D, sigmaHHRasterData.get() + i, sizeof(double) * block_size);
|
||||
HostToDevice(incidenceAngleDataPtr_D, incidenceAngleData.get() + i, sizeof(double) * block_size);
|
||||
// 执行GPU计算
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 从设备内存到主机内存
|
||||
DeviceToHost(outSigmaVVRasterDataPtr_D, outSigmaVVRasterData.get() + i, sizeof(double) * block_size);
|
||||
|
||||
double sigmaHH = sigmaHHRasterData.get()[i];
|
||||
double incidenceAngle = incidenceAngleData.get()[i];
|
||||
double sigmaVV = sigmaHH * polartionConver_d(sigmaHH, incidenceAngle, 1.0, false);
|
||||
outSigmaVVRasterData.get()[i] = sigmaVV;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 强制释放内存
|
||||
|
||||
FreeCUDADevice(sigmaHHRasterDataPtr_D);
|
||||
//FreeCUDAHost(sigmaHHRasterDataPtr_H);
|
||||
FreeCUDADevice(incidenceAngleDataPtr_D);
|
||||
//FreeCUDAHost(incidenceAngleDataPtr_H);
|
||||
FreeCUDADevice(outSigmaVVRasterDataPtr_D);
|
||||
//FreeCUDAHost(outSigmaVVRasterDataPtr_H);
|
||||
|
||||
// 保存输出影像数据
|
||||
outSigmaVVRaster.saveImage(outSigmaVVRasterData,0,0,height,width,1);
|
||||
// 释放内存
|
||||
sigmaHHRasterData.reset();
|
||||
incidenceAngleData.reset();
|
||||
outSigmaVVRasterData.reset();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return -1;// 代表执行成功
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@
|
|||
/// <param name="out_SigmaVVRasterPath"></param>
|
||||
/// <param name="isVVPolar"></param>
|
||||
/// <returns></returns>
|
||||
extern "C" GF3CALIBRATIONANDORTHLIB_EXPORT int GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath,QString in_IncidencAngleRasterPath,QString out_SigmaVVRasterPath);
|
||||
|
||||
int GF3CALIBRATIONANDORTHLIB_EXPORT GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath,QString in_IncidencAngleRasterPath,QString out_SigmaVVRasterPath);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -66,6 +66,26 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<IncludePath>.;..\GPUBaseLib\GPUTool;..\GPUBaseLib;..\BaseCommonLibrary\ToolAbstract;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<CudaCompile>
|
||||
<InterleaveSourceInPTX>true</InterleaveSourceInPTX>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
</CudaCompile>
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>cufft.lib;cudart.lib;cudadevrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -82,7 +102,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>GF3CALIBRATIONANDORTHLIB_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PreprocessorDefinitions>GF3CALIBRATIONANDORTHLIB_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
|
@ -98,6 +118,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GF3PSTNClass.cpp" />
|
||||
<ClCompile Include="GF3Util.cpp" />
|
||||
<ClCompile Include="SatelliteGF3xmlParser.cpp" />
|
||||
<ClCompile Include="SateOrbit.cpp" />
|
||||
<ClInclude Include="GF3CalibrationAndGeocodingClass.h" />
|
||||
|
@ -107,6 +128,7 @@
|
|||
<ClCompile Include="GF3CalibrationAndOrthLib.cpp" />
|
||||
<ClInclude Include="GF3CalibrationGecodingBaseFuntion.h" />
|
||||
<ClInclude Include="GF3PSTNClass.h" />
|
||||
<ClInclude Include="GF3Util.h" />
|
||||
<ClInclude Include="SatelliteGF3xmlParser.h" />
|
||||
<ClInclude Include="SateOrbit.h" />
|
||||
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cuh" />
|
||||
|
|
|
@ -47,6 +47,9 @@
|
|||
<ClInclude Include="SateOrbit.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GF3Util.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cu" />
|
||||
|
@ -65,5 +68,8 @@
|
|||
<ClCompile Include="SateOrbit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GF3Util.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -49,7 +49,7 @@ __device__ __host__ double Computrer_polartionConver_rpol_d(double inangle, doub
|
|||
return rpol;
|
||||
}
|
||||
|
||||
__host__ __device__ float polartionConver_f(float insig, float inangle, float alpha = 1.0, bool isvv = true)
|
||||
__host__ __device__ float polartionConver_f(float insig, float inangle, float alpha , bool isvv )
|
||||
{
|
||||
float rpol = Computrer_polartionConver_rpol_f(inangle, alpha);
|
||||
|
||||
|
@ -69,8 +69,7 @@ __host__ __device__ float polartionConver_f(float insig, float inangle, float al
|
|||
}
|
||||
|
||||
|
||||
|
||||
__host__ __device__ double polartionConver_d(double insig, double inangle, double alpha = 1.0, bool isvv = true)
|
||||
__host__ __device__ double polartionConver_d(double insig, double inangle, double alpha , bool isvv )
|
||||
{
|
||||
double rpol = Computrer_polartionConver_rpol_d(inangle, alpha);
|
||||
|
||||
|
@ -88,6 +87,10 @@ __host__ __device__ double polartionConver_d(double insig, double inangle, doubl
|
|||
}
|
||||
}
|
||||
|
||||
/** 核函数部分 ******************************************************************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
/** 对外调用函数部分 ******************************************************************************************************************************/
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
|
||||
/** 核函数 *********************************************************************************************************************/
|
||||
/// <summary>
|
||||
/// 计算极化转换系数(float)
|
||||
/// </summary>
|
||||
|
@ -50,5 +51,22 @@ extern __host__ __device__ float polartionConver_f(float insig, float inangle, f
|
|||
|
||||
|
||||
|
||||
|
||||
/** 对外调用函数部分 ******************************************************************************************************************************/
|
||||
|
||||
extern "C" void GPUComputePolarizationConver_f(
|
||||
float* insig, float* inangle, float* alpha,
|
||||
bool isvv, int count,
|
||||
float* outsig
|
||||
);
|
||||
extern "C" void GPUComputePolarizationConver_d(
|
||||
double* insig, double* inangle, double* alpha,
|
||||
bool isvv, int count,
|
||||
double* outsig
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
#include "GF3Util.h"
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
#ifndef __GF3UTIL_H__
|
||||
#define __GF3UTIL_H__
|
||||
#include "gf3calibrationandorthlib_global.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -1,8 +1,7 @@
|
|||
#pragma once
|
||||
#ifndef __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||
#define __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
|
||||
|
||||
#ifdef GF3CALIBRATIONANDORTHLIB_LIB
|
||||
#define GF3CALIBRATIONANDORTHLIB_EXPORT __declspec(dllexport)
|
||||
|
|
|
@ -37,12 +37,12 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtModules>core;xml;sql;opengl;gui;widgets;location;dbus;charts;datavisualization</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
|
@ -62,10 +62,14 @@
|
|||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<CopyLocalDeploymentContent>true</CopyLocalDeploymentContent>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyLocalDebugSymbols>true</CopyLocalDebugSymbols>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>cufft.lib;cudart.lib;cudadevrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
|
@ -91,16 +95,20 @@
|
|||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
<ClCompile Include="QGF3StripBatchProcessDialog.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="GF3RDZProcess.cu" />
|
||||
<QtMoc Include="QGF3StripBatchProcessDialog.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="QGF3StripBatchProcessDialog.ui" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
|
|
|
@ -29,10 +29,18 @@
|
|||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QGF3StripBatchProcessDialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="GF3RDZProcess.cu">
|
||||
<Filter>GPULib</Filter>
|
||||
</None>
|
||||
<QtMoc Include="QGF3StripBatchProcessDialog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="QGF3StripBatchProcessDialog.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,105 @@
|
|||
#include "QGF3StripBatchProcessDialog.h"
|
||||
#include "ui_QGF3StripBatchProcessDialog.h"
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
|
||||
QGF3StripBatchProcessDialog::QGF3StripBatchProcessDialog(QWidget *parent)
|
||||
: QDialog(parent), ui(new Ui::QGF3StripBatchProcessDialogClass)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QObject::connect(ui->pushButtonAdd, SIGNAL(clicked(bool)), this, SLOT(onpushButtonAddClicked(bool)));
|
||||
QObject::connect(ui->pushButtonRemove, SIGNAL(clicked(bool)), this, SLOT(onpushButtonRemoveClicked(bool)));
|
||||
QObject::connect(ui->pushButtonWorkSpace, SIGNAL(clicked(bool)), this, SLOT(onpushButtonWorkSpaceClicked(bool)));
|
||||
QObject::connect(ui->checkBoxDEM, SIGNAL(stateChanged(int)), this, SLOT(ontstateChanged(int)));
|
||||
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onreject()));
|
||||
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onaccept()));
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
QGF3StripBatchProcessDialog::~QGF3StripBatchProcessDialog()
|
||||
{}
|
||||
|
||||
void QGF3StripBatchProcessDialog::onaccept()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QGF3StripBatchProcessDialog::onreject()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
void QGF3StripBatchProcessDialog::onpushButtonAddClicked(bool)
|
||||
{
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames(
|
||||
this, // 父窗口
|
||||
tr(u8"选择GF3条带L1A压缩包"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(u8"tar.gz (*.tar.gz);;tar (*.tar);;All Files (*)") // 文件过滤器
|
||||
);
|
||||
|
||||
// 如果用户选择了文件
|
||||
if (!fileNames.isEmpty()) {
|
||||
QString message = "选择的文件有:\n";
|
||||
for (const QString& fileName : fileNames) {
|
||||
this->ui->listWidgetMetaxml->addItem(fileName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||
}
|
||||
}
|
||||
|
||||
void QGF3StripBatchProcessDialog::onpushButtonRemoveClicked(bool)
|
||||
{
|
||||
QList<QListWidgetItem*> selectedItems = this->ui->listWidgetMetaxml->selectedItems();
|
||||
for (QListWidgetItem* item : selectedItems) {
|
||||
delete this->ui->listWidgetMetaxml->takeItem(this->ui->listWidgetMetaxml->row(item));
|
||||
}
|
||||
}
|
||||
|
||||
void QGF3StripBatchProcessDialog::onpushButtonWorkSpaceClicked(bool)
|
||||
{
|
||||
// 调用文件选择对话框并选择一个 .tif 文件
|
||||
QString fileName = QFileDialog::getExistingDirectory(this, u8"选择工作空间路径", "");
|
||||
|
||||
if (!fileName.isEmpty()) {
|
||||
ui->lineEditWorkDir->setText(fileName);
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, u8"没有选择文件夹", u8"没有选择任何文件夹");
|
||||
}
|
||||
}
|
||||
|
||||
void QGF3StripBatchProcessDialog::ontstateChanged(int checked)
|
||||
{
|
||||
bool checkedflag = ui->checkBoxDEM->isChecked();
|
||||
if (!checkedflag) {
|
||||
ui->pushButton_lineDEM->setEnabled(true);
|
||||
ui->lineEdit_DEM->setEnabled(true);
|
||||
}
|
||||
else {
|
||||
ui->pushButton_lineDEM->setEnabled(false);
|
||||
ui->lineEdit_DEM->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void showQGF3StripBatchProcessDialog(QWidget* parent)
|
||||
{
|
||||
QGF3StripBatchProcessDialog* dialog = new QGF3StripBatchProcessDialog(parent);
|
||||
dialog->setWindowTitle(u8"GF3条带影像正射批量处理");
|
||||
dialog->setAttribute(Qt::WA_DeleteOnClose);
|
||||
dialog->show();
|
||||
}
|
||||
|
||||
QString getDefaultDEMFilePath()
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(nullptr, u8"选择DEM文件", "", u8"tif (*.tif);;All Files (*)");
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
#pragma once
|
||||
#ifndef __QGF3STRIPBATCHPROCESSDIALOG_H__
|
||||
#define __QGF3STRIPBATCHPROCESSDIALOG_H__
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui{
|
||||
class QGF3StripBatchProcessDialogClass;
|
||||
}
|
||||
|
||||
class QGF3StripBatchProcessDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QGF3StripBatchProcessDialog(QWidget *parent = nullptr);
|
||||
~QGF3StripBatchProcessDialog();
|
||||
|
||||
public slots:
|
||||
void onaccept();
|
||||
void onreject();
|
||||
void onpushButtonAddClicked(bool);
|
||||
void onpushButtonRemoveClicked(bool);
|
||||
void onpushButtonWorkSpaceClicked(bool);
|
||||
|
||||
void ontstateChanged(int checked);
|
||||
|
||||
|
||||
private:
|
||||
Ui::QGF3StripBatchProcessDialogClass* ui;
|
||||
};
|
||||
|
||||
|
||||
// Ä£¿éÏÔʾµ÷ÓÃ
|
||||
void showQGF3StripBatchProcessDialog(QWidget* parent = nullptr);
|
||||
QString getDefaultDEMFilePath();
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,238 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QGF3StripBatchProcessDialogClass</class>
|
||||
<widget class="QDialog" name="QGF3StripBatchProcessDialogClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>787</width>
|
||||
<height>580</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QGF3StripBatchProcessDialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>GF3条带列表(L1A)</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QListWidget" name="listWidgetMetaxml">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::MultiSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonAdd">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonRemove">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>删除</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>参数</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="3">
|
||||
<widget class="QPushButton" name="pushButton_lineDEM">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>分辨率(m)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="checkBoxDEM">
|
||||
<property name="text">
|
||||
<string>默认DEM</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QLineEdit" name="lineEdit_DEM">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>DEM文件地址:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QDoubleSpinBox" name="doubleSpinBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>100000.000000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输出工作空间:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEditWorkDir">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonWorkSpace">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -7,18 +7,14 @@
|
|||
* @version 1.0
|
||||
*/
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
|
||||
#include "QGF3StripBatchProcessDialog.h"
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
QApplication a(argc, argv);
|
||||
showQGF3StripBatchProcessDialog(nullptr);
|
||||
return a.exec();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue