同步笔记本代码
commit
eb4bfecb06
|
@ -101,6 +101,7 @@ StyleCopReport.xml
|
|||
**.tlog
|
||||
*.tlog
|
||||
*.idb
|
||||
*.sqlite
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
|
|
|
@ -357,5 +357,4 @@ inline void releaseVoidArray(void* a)
|
|||
};
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -225,6 +225,17 @@ double operator /(Point3 a, Point3 b)
|
|||
return sqrt(pow(a.x, 2) + pow(a.y, 2)) / sqrt(pow(b.x, 2) + pow(b.y, 2));
|
||||
}
|
||||
|
||||
double BASECONSTVARIABLEAPI getPixelSpacingInDegree(double pixelSpacingInMeter)
|
||||
{
|
||||
return pixelSpacingInMeter / WGS84_A * r2d;
|
||||
|
||||
}
|
||||
|
||||
double BASECONSTVARIABLEAPI getPixelSpacingInMeter(double pixelSpacingInDegree)
|
||||
{
|
||||
return pixelSpacingInDegree * WGS84_A * r2d;
|
||||
}
|
||||
|
||||
|
||||
Landpoint getSlopeVector(const Landpoint& p0, const Landpoint& p1, const Landpoint& p2, const Landpoint& p3, const Landpoint& p4,bool inLBH) {
|
||||
Landpoint n0, n1, n2, n3, n4;
|
||||
|
|
|
@ -23,6 +23,9 @@ Landpoint BASECONSTVARIABLEAPI LLA2XYZ(const Landpoint& LLA);
|
|||
void BASECONSTVARIABLEAPI LLA2XYZ(const Landpoint& LLA,Point3& XYZ);
|
||||
Eigen::MatrixXd BASECONSTVARIABLEAPI LLA2XYZ(Eigen::MatrixXd landpoint);
|
||||
|
||||
double BASECONSTVARIABLEAPI getPixelSpacingInDegree(double pixelSpacingInMeter);
|
||||
|
||||
double BASECONSTVARIABLEAPI getPixelSpacingInMeter(double pixelSpacingInDegree);
|
||||
/// <summary>
|
||||
/// 将地固参心坐标系转换为经纬度
|
||||
/// </summary>
|
||||
|
|
|
@ -357,17 +357,20 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
rows_count = start_row + rows_count <= imgds.height ? rows_count : imgds.height - start_row;
|
||||
cols_count = start_col + cols_count <= imgds.width ? cols_count : imgds.width - start_col;
|
||||
|
||||
int64_t pixel_count64 = static_cast<int64_t>(rows_count)* static_cast<int64_t>(cols_count);
|
||||
|
||||
|
||||
//Eigen::MatrixXd datamatrix(rows_count, cols_count);
|
||||
|
||||
if (gdal_datatype == GDT_Byte) {
|
||||
char* temp = new char[rows_count * cols_count];
|
||||
char* temp = new char[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -376,14 +379,14 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
delete[] temp;
|
||||
}
|
||||
else if (gdal_datatype == GDT_UInt16) {
|
||||
unsigned short* temp = new unsigned short[rows_count * cols_count];
|
||||
unsigned short* temp = new unsigned short[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -391,14 +394,14 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
delete[] temp;
|
||||
}
|
||||
else if (gdal_datatype == GDT_Int16) {
|
||||
short* temp = new short[rows_count * cols_count];
|
||||
short* temp = new short[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -406,14 +409,14 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
delete[] temp;
|
||||
}
|
||||
else if (gdal_datatype == GDT_UInt32) {
|
||||
unsigned int* temp = new unsigned int[rows_count * cols_count];
|
||||
unsigned int* temp = new unsigned int[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -421,14 +424,14 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
delete[] temp;
|
||||
}
|
||||
else if (gdal_datatype == GDT_Int32) {
|
||||
int* temp = new int[rows_count * cols_count];
|
||||
int* temp = new int[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -436,7 +439,7 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
delete[] temp;
|
||||
}
|
||||
// else if (gdal_datatype == GDT_UInt64) {
|
||||
// unsigned long* temp = new unsigned long[rows_count * cols_count];
|
||||
// unsigned long* temp = new unsigned long[pixel_count64];
|
||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count,
|
||||
//rows_count, gdal_datatype, 0, 0); for (int i = 0; i < rows_count; i++) { for (int j = 0; j <
|
||||
//cols_count; j++) { datamatrix(i, j) = temp[i * cols_count + j];
|
||||
|
@ -445,7 +448,7 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
// delete[] temp;
|
||||
// }
|
||||
// else if (gdal_datatype == GDT_Int64) {
|
||||
// long* temp = new long[rows_count * cols_count];
|
||||
// long* temp = new long[pixel_count64];
|
||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count,
|
||||
//rows_count, gdal_datatype, 0, 0); for (int i = 0; i < rows_count; i++) { for (int j = 0; j <
|
||||
//cols_count; j++) { datamatrix(i, j) = temp[i * cols_count + j];
|
||||
|
@ -454,15 +457,15 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
// delete[] temp;
|
||||
// }
|
||||
else if (gdal_datatype == GDT_Float32) {
|
||||
float* temp = new float[rows_count * cols_count];
|
||||
float* temp = new float[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -470,15 +473,15 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
delete[] temp;
|
||||
}
|
||||
else if (gdal_datatype == GDT_Float64) {
|
||||
double* temp = new double[rows_count * cols_count];
|
||||
double* temp = new double[pixel_count64];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i]);
|
||||
}
|
||||
|
@ -487,15 +490,15 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
}
|
||||
//else if (gdal_datatype == GDT_CFloat32) {
|
||||
// if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
||||
// float* temp = new float[rows_count * cols_count * 2];
|
||||
// float* temp = new float[pixel_count64 * 2];
|
||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
|
||||
// result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
// result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
// if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
// std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
// std::memcpy(result.get(), temp, pixel_count64);
|
||||
// }
|
||||
// else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
// long count = rows_count * cols_count;
|
||||
// long count = pixel_count64;
|
||||
// for (long i = 0; i < count; i++) {
|
||||
// result.get()[i] = T(temp[i * 2],
|
||||
// temp[i * 2 + 1]);
|
||||
|
@ -509,15 +512,15 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
//}
|
||||
//else if (gdal_datatype == GDT_CFloat64 ) {
|
||||
// if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
||||
// double* temp = new double[rows_count * cols_count * 2];
|
||||
// double* temp = new double[pixel_count64 * 2];
|
||||
// demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
|
||||
// result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
// result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
// if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
// std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
// std::memcpy(result.get(), temp, pixel_count64);
|
||||
// }
|
||||
// else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
// long count = rows_count * cols_count;
|
||||
// long count = pixel_count64;
|
||||
// for (long i = 0; i < count; i++) {
|
||||
// result.get()[i] = T(temp[i * 2],
|
||||
// temp[i * 2 + 1]);
|
||||
|
@ -556,19 +559,21 @@ inline std::shared_ptr<T> readDataArrComplex(gdalImageComplex& imgds, long start
|
|||
rows_count = start_row + rows_count <= imgds.height ? rows_count : imgds.height - start_row;
|
||||
cols_count = start_col + cols_count <= imgds.width ? cols_count : imgds.width - start_col;
|
||||
|
||||
int64_t pixel_count64 = static_cast<int64_t>(rows_count) * static_cast<int64_t>(cols_count);
|
||||
|
||||
//Eigen::MatrixXd datamatrix(rows_count, cols_count);
|
||||
|
||||
if (gdal_datatype == GDT_CFloat32) {
|
||||
if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
||||
float* temp = new float[rows_count * cols_count * 2];
|
||||
float* temp = new float[pixel_count64 * 2];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i * 2],
|
||||
temp[i * 2 + 1]);
|
||||
|
@ -582,15 +587,15 @@ inline std::shared_ptr<T> readDataArrComplex(gdalImageComplex& imgds, long start
|
|||
}
|
||||
else if (gdal_datatype == GDT_CFloat64) {
|
||||
if (std::is_same<T, std::complex<double>>::value || std::is_same<T, std::complex<double>>::value) {
|
||||
double* temp = new double[rows_count * cols_count * 2];
|
||||
double* temp = new double[pixel_count64 * 2];
|
||||
demBand->RasterIO(GF_Read, start_col, start_row, cols_count, rows_count, temp, cols_count, rows_count, gdal_datatype, 0, 0);
|
||||
|
||||
result = std::shared_ptr<T>(new T[rows_count * cols_count], delArrPtr);
|
||||
result = std::shared_ptr<T>(new T[pixel_count64], delArrPtr);
|
||||
if (method == GDALREADARRCOPYMETHOD::MEMCPYMETHOD) {
|
||||
std::memcpy(result.get(), temp, rows_count * cols_count);
|
||||
std::memcpy(result.get(), temp, pixel_count64);
|
||||
}
|
||||
else if (method == GDALREADARRCOPYMETHOD::VARIABLEMETHOD) {
|
||||
long count = rows_count * cols_count;
|
||||
long count = pixel_count64;
|
||||
for (long i = 0; i < count; i++) {
|
||||
result.get()[i] = T(temp[i * 2],
|
||||
temp[i * 2 + 1]);
|
||||
|
|
|
@ -0,0 +1,123 @@
|
|||
#include "GF3CalibrationAndOrthLib.h"
|
||||
#include "BaseConstVariable.h"
|
||||
#include "RasterToolBase.h"
|
||||
#include "ImageOperatorBase.h"
|
||||
#include <QDebug>
|
||||
#include <QFile>
|
||||
#include <memory>
|
||||
#include "FileOperator.h"
|
||||
#include "GPUBaseTool.h"
|
||||
#include "GPUTool.cuh"
|
||||
|
||||
|
||||
GF3CALIBRATIONANDORTHLIB_EXPORT int GF3_Sigma0_HH2VV(QString in_SigmaHHRasterPath, QString in_IncidencAngleRasterPath, QString out_SigmaVVRasterPath)
|
||||
{
|
||||
// step 1 检查输入合法性
|
||||
{
|
||||
// 1. 检查输入合法性
|
||||
if (in_SigmaHHRasterPath.isEmpty() || in_IncidencAngleRasterPath.isEmpty() || out_SigmaVVRasterPath.isEmpty())
|
||||
{
|
||||
qDebug() << "Input or output file path is empty.";
|
||||
throw std::invalid_argument("Input or output file path is empty.");
|
||||
return 1; // 代表输入或输出文件路径为空
|
||||
}
|
||||
// 2. 检查输入影像是否存在
|
||||
if (!QFile::exists(in_SigmaHHRasterPath) || !QFile::exists(in_IncidencAngleRasterPath))
|
||||
{
|
||||
qDebug() << "Input file does not exist.";
|
||||
throw std::runtime_error("Input file does not exist.");
|
||||
return 2; // 代表输入文件不存在
|
||||
}
|
||||
gdalImage inSigmaHHRaster(in_SigmaHHRasterPath);
|
||||
gdalImage inIncidencAngleRaster(in_IncidencAngleRasterPath);
|
||||
// 3. 检查输入影像大小是否一致
|
||||
if (inSigmaHHRaster.width != inIncidencAngleRaster.width || inSigmaHHRaster.height != inIncidencAngleRaster.height)
|
||||
{
|
||||
qDebug() << "Input images have different sizes.";
|
||||
throw std::runtime_error("Input images have different sizes.");
|
||||
return 3; // 代表输入影像大小不一致
|
||||
}
|
||||
|
||||
// 复制输入文件到输出文件
|
||||
copyFile(in_SigmaHHRasterPath, out_SigmaVVRasterPath);
|
||||
// 4. 检查输出文件是否存在
|
||||
if (!QFile::exists(out_SigmaVVRasterPath))
|
||||
{
|
||||
qDebug() << "Output file does not exist.";
|
||||
throw std::runtime_error("Output file does not exist.");
|
||||
return 4; // 代表输出文件不存在
|
||||
}
|
||||
}
|
||||
|
||||
// step 2 执行操作
|
||||
{
|
||||
gdalImage inSigmaHHRaster(in_SigmaHHRasterPath);
|
||||
gdalImage inIncidencAngleRaster(in_IncidencAngleRasterPath);
|
||||
gdalImage outSigmaVVRaster(out_SigmaVVRasterPath);
|
||||
|
||||
long width = inSigmaHHRaster.width;
|
||||
long height = inSigmaHHRaster.height;
|
||||
|
||||
int64_t pixel_count64 = static_cast<int64_t>(height) * static_cast<int64_t>(width);
|
||||
// 读取输入影像数据
|
||||
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)
|
||||
{
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 强制释放内存
|
||||
|
||||
FreeCUDADevice(sigmaHHRasterDataPtr_D);
|
||||
//FreeCUDAHost(sigmaHHRasterDataPtr_H);
|
||||
FreeCUDADevice(incidenceAngleDataPtr_D);
|
||||
//FreeCUDAHost(incidenceAngleDataPtr_H);
|
||||
FreeCUDADevice(outSigmaVVRasterDataPtr_D);
|
||||
//FreeCUDAHost(outSigmaVVRasterDataPtr_H);
|
||||
|
||||
sigmaHHRasterData.reset();
|
||||
incidenceAngleData.reset();
|
||||
outSigmaVVRasterData.reset();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return -1;// 代表执行成功
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
/**
|
||||
* 用于GF3影像的几何校正和正射处理的数据库
|
||||
* @file GF3CalibrationAndOrthLib.h
|
||||
* @brief GF3影像几何校正和正射处理的数据库
|
||||
* @details
|
||||
* 本库用于GF3影像的几何校正和正射处理,主要操作包括HH->VV极化的转换、影像的几何校正和正射处理等。
|
||||
* 本库的实现基于GF3影像的几何校正和正射处理的相关算法,具体实现细节请参考相关文献。
|
||||
* @author 陈增辉
|
||||
*/
|
||||
#ifndef __GF3CALIBRATIONANDORTHLIB__H__
|
||||
#define __GF3CALIBRATIONANDORTHLIB__H__
|
||||
#include "gf3calibrationandorthlib_global.h"
|
||||
#include <QString>
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 将HH极化的雷达散射系数转换为VV极化的雷达散射系数
|
||||
/// </summary>
|
||||
/// <param name="in_SigmaHHRasterPath"></param>
|
||||
/// <param name="in_IncidencAngleRasterPath"></param>
|
||||
/// <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);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,124 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{886F7829-AF74-4F23-B3BE-29B7B3C9843C}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<IncludePath>.;..\GPUBaseLib\GPUTool;..\GPUBaseLib;..\BaseCommonLibrary\ToolAbstract;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>GF3CALIBRATIONANDORTHLIB_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>GF3CALIBRATIONANDORTHLIB_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="gf3calibrationandorthlib_global.h" />
|
||||
<ClInclude Include="GF3CalibrationAndOrthLib.h" />
|
||||
<ClCompile Include="GF3CalibrationAndOrthLib.cpp" />
|
||||
<ClInclude Include="GF3CalibrationGecodingBaseFuntion.h" />
|
||||
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cuh" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BaseCommonLibrary\BaseCommonLibrary.vcxproj">
|
||||
<Project>{872ecd6f-30e3-4a1b-b17c-15e87d373ff6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\GPUBaseLib\GPUBaseLib.vcxproj">
|
||||
<Project>{b8b40c54-f7fe-4809-b6fb-8bc014570d7b}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cu" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="gf3calibrationandorthlib_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClCompile Include="GF3CalibrationAndOrthLib.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="GF3CalibrationAndOrthLib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GF3CalibrationGecodingBaseFuntion.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cu" />
|
||||
<CudaCompile Include="GF3CalibrationGeoCodingFunCUDA.cuh" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
#ifndef __GF3CALIBRATIONGECODINGBASEFUNTION__H__
|
||||
#define __GF3CALIBRATIONGECODINGBASEFUNTION__H__
|
||||
#include "gf3calibrationandorthlib_global.h"
|
||||
#include "BaseConstVariable.h"
|
||||
|
||||
|
||||
|
||||
#endif // __GF3CALIBRATIONGECODINGBASEFUNTION__H__
|
|
@ -0,0 +1,93 @@
|
|||
#include "GF3CalibrationGeoCodingFunCUDA.cuh"
|
||||
#include <cmath>
|
||||
#include <complex>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <cufft.h>
|
||||
#include <cufftw.h>
|
||||
#include <cufftXt.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include <chrono>
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
|
||||
|
||||
__device__ __host__ float Computrer_polartionConver_rpol_f(float inangle, float alpha)
|
||||
{
|
||||
float tang = 0.0;
|
||||
if (inangle <= 0.0) {
|
||||
tang = 0.0;
|
||||
}
|
||||
else if (inangle > 90.0) {
|
||||
tang = 90.0;
|
||||
}
|
||||
else {
|
||||
tang = inangle;
|
||||
}
|
||||
tang = tang * PI / 180.0;
|
||||
float tan_val = tanf(tang);
|
||||
float rpol = powf((1.0 + 2.0 * tan_val * tan_val), 2) / powf((1.0 + alpha * tan_val * tan_val), 2);
|
||||
return rpol;
|
||||
}
|
||||
|
||||
__device__ __host__ double Computrer_polartionConver_rpol_d(double inangle, double alpha)
|
||||
{
|
||||
double tang = 0.0;
|
||||
if (inangle <= 0.0) {
|
||||
tang = 0.0;
|
||||
}
|
||||
else if (inangle > 90.0) {
|
||||
tang = 90.0;
|
||||
}
|
||||
else {
|
||||
tang = inangle;
|
||||
}
|
||||
tang = tang * PI / 180.0;
|
||||
double tan_val = tan(tang);
|
||||
double rpol = pow((1.0 + 2.0 * tan_val * tan_val), 2) / pow((1.0 + alpha * tan_val * tan_val), 2);
|
||||
return rpol;
|
||||
}
|
||||
|
||||
__host__ __device__ float polartionConver_f(float insig, float inangle, float alpha = 1.0, bool isvv = true)
|
||||
{
|
||||
float rpol = Computrer_polartionConver_rpol_f(inangle, alpha);
|
||||
|
||||
// dB转线性
|
||||
float insig_linear = powf(10.0, insig / 10.0);
|
||||
float osig = 0.0;
|
||||
if (isvv) { // C: VV->HH
|
||||
osig = insig_linear * rpol;
|
||||
// 返回线性值
|
||||
return osig;
|
||||
}
|
||||
else { // L: HH->VV
|
||||
osig = insig_linear / rpol;
|
||||
// 返回dB值
|
||||
return 10.0 * log10f(osig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
__host__ __device__ double polartionConver_d(double insig, double inangle, double alpha = 1.0, bool isvv = true)
|
||||
{
|
||||
double rpol = Computrer_polartionConver_rpol_d(inangle, alpha);
|
||||
|
||||
// dB转线性
|
||||
double insig_linear = pow(10.0, insig / 10.0);
|
||||
double osig = 0.0;
|
||||
if (isvv) { // C: VV->HH
|
||||
osig = insig_linear * rpol;
|
||||
// 返回线性值
|
||||
return osig;
|
||||
} else { // L: HH->VV
|
||||
osig = insig_linear / rpol;
|
||||
// 返回dB值
|
||||
return 10.0 * log10(osig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
#ifndef __GF3CALIBRATIONGEOCODINGFUNCUDA__H__
|
||||
#define __GF3CALIBRATIONGEOCODINGFUNCUDA__H__
|
||||
#include "gf3calibrationandorthlib_global.h"
|
||||
|
||||
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include <cuda_runtime.h>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
|
||||
/// <summary>
|
||||
/// 计算极化转换系数(float)
|
||||
/// </summary>
|
||||
/// <param name="inangle">入射角</param>
|
||||
/// <param name="alpha">转换参数</param>
|
||||
/// <returns></returns>
|
||||
extern __device__ __host__ float Computrer_polartionConver_rpol_f(float inangle, float alpha = 1);
|
||||
|
||||
/// <summary>
|
||||
/// 计算极化转换系数 (double)
|
||||
/// </summary>
|
||||
/// <param name="inangle">入射角</param>
|
||||
/// <param name="alpha">转换参数</param>
|
||||
/// <returns></returns>
|
||||
extern __device__ __host__ double Computrer_polartionConver_rpol_d(double inangle, double alpha = 1);
|
||||
|
||||
/// <summary>
|
||||
/// 后向散射系数变换函数
|
||||
/// </summary>
|
||||
/// <param name="insig">sigma0 (dB)</param>
|
||||
/// <param name="inangle">入射角 (度)</param>
|
||||
/// <param name="alpha">默认1,基尔霍夫模型,0.6为汤姆森</param>
|
||||
/// <param name="isvv">true表示输入为VV,false为HH</param>
|
||||
/// <returns></returns>
|
||||
extern __host__ __device__ double polartionConver_d(double insig, double inangle, double alpha = 1.0, bool isvv = true);
|
||||
|
||||
/// <summary>
|
||||
/// 后向散射系数变换函数
|
||||
/// </summary>
|
||||
/// <param name="insig">sigma0 (dB)</param>
|
||||
/// <param name="inangle">入射角 (度)</param>
|
||||
/// <param name="alpha">默认1,基尔霍夫模型,0.6为汤姆森</param>
|
||||
/// <param name="isvv">true表示输入为VV,false为HH</param>
|
||||
/// <returns></returns>
|
||||
extern __host__ __device__ float polartionConver_f(float insig, float inangle, float alpha = 1.0, bool isvv = true);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
#pragma once
|
||||
#ifndef __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||
#define __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
|
||||
#ifdef GF3CALIBRATIONANDORTHLIB_LIB
|
||||
#define GF3CALIBRATIONANDORTHLIB_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define GF3CALIBRATIONANDORTHLIB_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
|
||||
#endif// __GF3CALIBRATIONANDORTHLIB_GLOBAL_H__
|
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{6386D3E3-B743-419F-8354-DA48D0B08728}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Link>
|
||||
<AdditionalDependencies>cufft.lib;cudart.lib;cudadevrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="GF3RDZProcess.cu" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="GPULib">
|
||||
<UniqueIdentifier>{da979fa3-1a37-4b67-aaf3-148de4a4c027}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="GF3RDZProcess.cu">
|
||||
<Filter>GPULib</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @file GF3StripPatchProcess/main.cpp
|
||||
* @brief Main entry point for the GF3 Strip Patch Process application.
|
||||
* @details 适用于GF3卫星影像的条带批量化处理程序。
|
||||
* @author 陈增辉(3045316072@qq.com)
|
||||
* @date 2025-05-12
|
||||
* @version 1.0
|
||||
*/
|
||||
#include <QtCore/QCoreApplication>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication a(argc, argv);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return a.exec();
|
||||
}
|
|
@ -42,6 +42,12 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pluginToolboxLibrary", "plu
|
|||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPG4Tool", "SPG4Tool\SPG4Tool.vcxproj", "{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "KJ135WBJYAlgInterfaceToolbox", "Toolbox\KJ135WBJYAlgInterfaceToolbox\KJ135WBJYAlgInterfaceToolbox.vcxproj", "{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GF3StripPatchProcess", "GF3StripPatchProcess\GF3StripPatchProcess.vcxproj", "{6386D3E3-B743-419F-8354-DA48D0B08728}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GF3CalibrationAndOrthLib", "GF3CalibrationAndOrthLib\GF3CalibrationAndOrthLib.vcxproj", "{886F7829-AF74-4F23-B3BE-29B7B3C9843C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
|
@ -196,6 +202,42 @@ Global
|
|||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x64.Build.0 = Release|x64
|
||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x86.ActiveCfg = Release|x64
|
||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E}.Release|x86.Build.0 = Release|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|ARM.ActiveCfg = Debug|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|ARM.Build.0 = Debug|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x64.Build.0 = Debug|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Debug|x86.Build.0 = Debug|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|ARM.ActiveCfg = Release|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|ARM.Build.0 = Release|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x64.ActiveCfg = Release|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x64.Build.0 = Release|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x86.ActiveCfg = Release|x64
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}.Release|x86.Build.0 = Release|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|ARM.ActiveCfg = Debug|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|ARM.Build.0 = Debug|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x64.Build.0 = Debug|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Debug|x86.Build.0 = Debug|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|ARM.ActiveCfg = Release|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|ARM.Build.0 = Release|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x64.ActiveCfg = Release|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x64.Build.0 = Release|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x86.ActiveCfg = Release|x64
|
||||
{6386D3E3-B743-419F-8354-DA48D0B08728}.Release|x86.Build.0 = Release|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|ARM.ActiveCfg = Debug|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|ARM.Build.0 = Debug|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x64.Build.0 = Debug|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Debug|x86.Build.0 = Debug|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|ARM.ActiveCfg = Release|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|ARM.Build.0 = Release|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x64.ActiveCfg = Release|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x64.Build.0 = Release|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x86.ActiveCfg = Release|x64
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C}.Release|x86.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -210,6 +252,8 @@ Global
|
|||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64} = {6505E2BA-06A2-447B-BC85-8CF1A81359BC}
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
||||
{80A5854F-6F80-4EC2-9F73-84E0F4DB8D7E} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
||||
{D3E9A2CA-7F05-425A-A4B6-416EC20972E8} = {41B1F23D-9119-47A7-B102-34022AF83CDA}
|
||||
{886F7829-AF74-4F23-B3BE-29B7B3C9843C} = {2768F9D6-D410-4E88-A479-8336DAF97072}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {179F0A62-C631-4667-AD03-3780ADE09F41}
|
||||
|
|
|
@ -196,9 +196,6 @@
|
|||
<ProjectReference Include="..\GPUBaseLib\GPUBaseLib.vcxproj">
|
||||
<Project>{b8b40c54-f7fe-4809-b6fb-8bc014570d7b}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\pluginToolboxLibrary\pluginToolboxLibrary.vcxproj">
|
||||
<Project>{667625a5-8de2-4373-99f0-8bad2cced011}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\RasterMainWidgetGUI\RasterMainWidgetGUI.vcxproj">
|
||||
<Project>{e56b3878-a3dc-41a4-abf3-b628816d0d64}</Project>
|
||||
</ProjectReference>
|
||||
|
|
Binary file not shown.
|
@ -90,6 +90,9 @@ namespace LAMPMainWidget {
|
|||
}
|
||||
|
||||
void RasterMainWidget::setupWindow() {
|
||||
//mMapglWidget = new QOpenGLWidget(mMapConvas); // 使用OpenGL渲染
|
||||
//mMapConvas->setViewport(mMapglWidget);
|
||||
//mMapConvas->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
|
||||
mUi->mapCanvasLayout->addWidget(mMapConvas);
|
||||
//setFixedSize(size());
|
||||
//setWindowFlags(windowFlags() | Qt::WindowMinMaxButtonsHint | Qt::WindowSystemMenuHint);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <QActionGroup>
|
||||
#include <QListWidgetItem>
|
||||
#include <QHash>
|
||||
#include <QOpenGLWidget>
|
||||
#include <QTableWidget>
|
||||
#include <mapcanvas.h>
|
||||
#include <maplayer.h>
|
||||
|
@ -76,6 +77,9 @@ namespace LAMPMainWidget {
|
|||
private:
|
||||
Ui::RasterMainWidget* mUi;
|
||||
MapCanvas* mMapConvas;//地图容器
|
||||
QOpenGLWidget* mMapglWidget;// OpenGL窗口
|
||||
|
||||
|
||||
QLineEdit* mScaleText;
|
||||
QLabel* mScaleLabel;
|
||||
QLineEdit* mCenterText;
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace RasterMessageShow {
|
|||
this->textBrowserMessage->append(Message);
|
||||
this->textBrowserMessage->moveCursor(QTextCursor::MoveOperation::End);
|
||||
this->textBrowserMessage->repaint();
|
||||
std::cout << Message.toLocal8Bit().constData() << std::endl;
|
||||
//std::cout << Message.toLocal8Bit().constData() << std::endl;
|
||||
}
|
||||
else {}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWi
|
|||
|
||||
// 大场景仿真流程
|
||||
#ifdef __BASETOOLBOX__SARSATALLITESIMULATIONWORKFLOW__H__
|
||||
initBaseToolSARSateSimulationWorkflow(toolbox);
|
||||
// initBaseToolSARSateSimulationWorkflow(toolbox);
|
||||
#endif // __BASETOOLBOX__SARSATALLITESIMULATIONWORKFLOW__H__
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
#include "KJ135WBJYAlgInterfaceToolbox.h"
|
||||
#include "ToolBoxWidget.h"
|
||||
#include "QWBFZAlgComponetXmlParamsDialog.h"
|
||||
#include "QWBFZExcuteAlgProgramDialog.h"
|
||||
|
||||
void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox)
|
||||
{
|
||||
emit toolbox->addBoxToolItemSIGNAL(new WBFZAlgComponetLoadXmlParamsDialogToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QWBFZExcuteAlgProgramDialogToolButton(toolbox));
|
||||
}
|
||||
|
||||
|
||||
WBFZAlgComponetLoadXmlParamsDialogToolButton::WBFZAlgComponetLoadXmlParamsDialogToolButton(QWidget* parent) : QToolAbstract(parent)
|
||||
{
|
||||
this->toolPath = QVector<QString>(0);
|
||||
this->toolPath.push_back(u8"微波算法组件");
|
||||
this->toolname = QString(u8"加载算法组件xml参数界面");
|
||||
}
|
||||
|
||||
|
||||
WBFZAlgComponetLoadXmlParamsDialogToolButton::~WBFZAlgComponetLoadXmlParamsDialogToolButton()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
void WBFZAlgComponetLoadXmlParamsDialogToolButton::run()
|
||||
{
|
||||
WBFZAlgComponetLoadXmlParamsProcess();
|
||||
}
|
||||
|
||||
|
||||
|
||||
QWBFZExcuteAlgProgramDialogToolButton::QWBFZExcuteAlgProgramDialogToolButton(QWidget* parent) : QToolAbstract(parent)
|
||||
{
|
||||
this->toolPath = QVector<QString>(0);
|
||||
this->toolPath.push_back(u8"微波算法组件");
|
||||
this->toolname = QString(u8"执行微波算法组件");
|
||||
}
|
||||
|
||||
QWBFZExcuteAlgProgramDialogToolButton::~QWBFZExcuteAlgProgramDialogToolButton()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void QWBFZExcuteAlgProgramDialogToolButton::run()
|
||||
{
|
||||
QWBFZExcuteAlgProgramDialog* dialog = new QWBFZExcuteAlgProgramDialog();
|
||||
dialog->setWindowTitle(u8"执行微波算法组件");
|
||||
dialog->show();
|
||||
//dialog->exec();
|
||||
//dialog->deleteLater();
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
#pragma once
|
||||
/**
|
||||
* 增加界面空基的项目组件
|
||||
* @file KJ2AlgInterfaceToolbox.h
|
||||
* @brief KJ2AlgInterfaceToolbox.h
|
||||
* @details
|
||||
* 界面空基的项目组件,完成项目文件中的参数文件加载显示,并给出对应算法组件的执行调用
|
||||
*
|
||||
*/
|
||||
#ifndef __KJ2ALGINTERFACETOOLBOX_GLOBAL_H__
|
||||
#define __KJ2ALGINTERFACETOOLBOX_GLOBAL_H__
|
||||
#include "KJ135WBJYAlgInterfacetoolbox_global.h"
|
||||
#include "QToolAbstract.h"
|
||||
|
||||
namespace LAMPMainWidget {
|
||||
class RasterMainWidget;
|
||||
}
|
||||
|
||||
class ToolBoxWidget;
|
||||
|
||||
|
||||
extern "C" KJ2ALGINTERFACETOOLBOX_EXPORT void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载空基十三五微波算法组件xml参数界面
|
||||
/// </summary>
|
||||
class KJ2ALGINTERFACETOOLBOX_EXPORT WBFZAlgComponetLoadXmlParamsDialogToolButton : public QToolAbstract {
|
||||
Q_OBJECT
|
||||
public:
|
||||
WBFZAlgComponetLoadXmlParamsDialogToolButton(QWidget* parent = nullptr);
|
||||
~WBFZAlgComponetLoadXmlParamsDialogToolButton();
|
||||
public:
|
||||
virtual void run() override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 加载空基十三五微波算法组件执行界面
|
||||
/// </summary>
|
||||
class KJ2ALGINTERFACETOOLBOX_EXPORT QWBFZExcuteAlgProgramDialogToolButton : public QToolAbstract {
|
||||
Q_OBJECT
|
||||
public:
|
||||
QWBFZExcuteAlgProgramDialogToolButton(QWidget* parent = nullptr);
|
||||
~QWBFZExcuteAlgProgramDialogToolButton();
|
||||
public:
|
||||
virtual void run() override;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __KJ2ALGINTERFACETOOLBOX_GLOBAL_H__
|
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D3E9A2CA-7F05-425A-A4B6-416EC20972E8}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
<ProjectName>KJ135WBJYAlgInterfaceToolbox</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;sql;opengl;gui;xmlpatterns;widgets;location;qml;positioning;printsupport;concurrent;3dcore;3danimation;3dextras;3dinput;3dlogic;3drender;dbus;gamepad;openglextensions;charts;datavisualization;purchasing</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Toolbox\</OutDir>
|
||||
<TargetName>PluginTool_$(ProjectName)</TargetName>
|
||||
<IncludePath>..\..\BaseCommonLibrary;..\..\BaseCommonLibrary\BaseTool;..\..\BaseCommonLibrary\ToolAbstract;.;..\..\RasterMainWidgetGUI\RasterMainWidget;..\..\RasterMainWidgetGUI;..\..\RasterProcessToolWidget;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>KJ2ALGINTERFACETOOLBOX_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>KJ2ALGINTERFACETOOLBOX_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\BaseCommonLibrary\BaseCommonLibrary.vcxproj">
|
||||
<Project>{872ecd6f-30e3-4a1b-b17c-15e87d373ff6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RasterMainWidgetGUI\RasterMainWidgetGUI.vcxproj">
|
||||
<Project>{e56b3878-a3dc-41a4-abf3-b628816d0d64}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\RasterProcessToolWidget\RasterProcessTool.vcxproj">
|
||||
<Project>{7ef67daa-dbc0-4b7f-80e8-11b4d2cb7ec2}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="KJ135WBJYAlgInterfaceToolbox.cpp" />
|
||||
<ClCompile Include="KJ135WBJYAlgWidgetComponet.cpp" />
|
||||
<ClCompile Include="QWBFZAlgComponetXmlParamsDialog.cpp" />
|
||||
<ClCompile Include="QWBFZExcuteAlgProgramDialog.cpp" />
|
||||
<ClCompile Include="WBFZAlgComponetXmlParaseOperator.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="QWBFZExcuteAlgProgramDialog.h" />
|
||||
<QtMoc Include="WBFZAlgComponetXmlParaseOperator.h" />
|
||||
<QtMoc Include="QWBFZAlgComponetXmlParamsDialog.h" />
|
||||
<QtMoc Include="KJ135WBJYAlgInterfaceToolbox.h" />
|
||||
<ClInclude Include="KJ135WBJYAlgInterfacetoolbox_global.h" />
|
||||
<QtMoc Include="KJ135WBJYAlgWidgetComponet.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="QWBFZAlgComponetXmlParamsDialog.ui" />
|
||||
<QtUic Include="QWBFZExcuteAlgProgramDialog.ui" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="KJ135WBJYAlgInterfaceToolbox.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="KJ135WBJYAlgWidgetComponet.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QWBFZAlgComponetXmlParamsDialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WBFZAlgComponetXmlParaseOperator.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="QWBFZExcuteAlgProgramDialog.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="KJ135WBJYAlgInterfacetoolbox_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="KJ135WBJYAlgInterfaceToolbox.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="QWBFZAlgComponetXmlParamsDialog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="KJ135WBJYAlgWidgetComponet.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="WBFZAlgComponetXmlParaseOperator.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="QWBFZExcuteAlgProgramDialog.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="QWBFZAlgComponetXmlParamsDialog.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="QWBFZExcuteAlgProgramDialog.ui">
|
||||
<Filter>Form Files</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef BUILD_STATIC
|
||||
# if defined(KJ2ALGINTERFACETOOLBOX_LIB)
|
||||
# define KJ2ALGINTERFACETOOLBOX_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define KJ2ALGINTERFACETOOLBOX_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define KJ2ALGINTERFACETOOLBOX_EXPORT
|
||||
#endif
|
|
@ -0,0 +1,923 @@
|
|||
#include "KJ135WBJYAlgWidgetComponet.h"
|
||||
#include <QHBoxLayout>
|
||||
#include <QMessageBox>
|
||||
#include <QGroupBox>
|
||||
|
||||
AbstractComponentWidget::AbstractComponentWidget(QWidget* parent) :QWidget(parent)
|
||||
{
|
||||
this->componentType = ComponentType::UNKNOW; // 默认未知类型
|
||||
this->ParaName = QString(); // 参数名称
|
||||
this->ParaChsName = QString(); // 参数中文名称
|
||||
this->Description = QString(); // 参数描述
|
||||
this->Datatype = QString(); // 数据类型
|
||||
this->ParaType = QString(); // 参数类型
|
||||
}
|
||||
|
||||
AbstractComponentWidget::~AbstractComponentWidget()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QString AbstractComponentWidget::getParaName() const
|
||||
{
|
||||
return this->ParaName;
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::setParaName(const QString& name)
|
||||
{
|
||||
this->ParaName = name;
|
||||
}
|
||||
|
||||
QString AbstractComponentWidget::getParaChsName() const
|
||||
{
|
||||
return this->ParaChsName;
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::setParaChsName(const QString& name)
|
||||
{
|
||||
this->ParaChsName = name;
|
||||
}
|
||||
|
||||
QString AbstractComponentWidget::getDescription() const
|
||||
{
|
||||
|
||||
return this->Description;
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::setDescription(const QString& description)
|
||||
{
|
||||
this->setToolTip(description);// 绑定提示
|
||||
this->Description = description;
|
||||
}
|
||||
|
||||
QString AbstractComponentWidget::getDatatype() const
|
||||
{
|
||||
return this->Datatype;
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::setDatatype(const QString& datatype)
|
||||
{
|
||||
this->Datatype = datatype;
|
||||
}
|
||||
|
||||
QString AbstractComponentWidget::getParaType() const
|
||||
{
|
||||
return this->ParaType;
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::setParaType(const QString& type)
|
||||
{
|
||||
this->ParaType = type;
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::setComponentType(ComponentType type)
|
||||
{
|
||||
this->componentType = type;
|
||||
}
|
||||
|
||||
ComponentType AbstractComponentWidget::getComponentType() const
|
||||
{
|
||||
return this->componentType;
|
||||
}
|
||||
|
||||
QString AbstractComponentWidget::getValue() const
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
|
||||
void AbstractComponentWidget::initUI()
|
||||
{
|
||||
}
|
||||
|
||||
// File 文件选择
|
||||
|
||||
FileSelectWidget::FileSelectWidget(QWidget* parent) :AbstractComponentWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
FileSelectWidget::~FileSelectWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void FileSelectWidget::initUI()
|
||||
{
|
||||
// 初始化控件
|
||||
// fileNameLabel
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
|
||||
//filePathEdit
|
||||
filePathEdit = new QLineEdit(this);
|
||||
|
||||
// fileSelectButton
|
||||
fileSelectButton = new QToolButton(this);
|
||||
fileSelectButton->setText(u8"选择文件");
|
||||
|
||||
|
||||
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
filePathEdit->setMinimumHeight(40);
|
||||
fileSelectButton->setMinimumHeight(40);
|
||||
|
||||
// 绑定信号-槽
|
||||
QObject::connect(fileSelectButton, SIGNAL(clicked()), this, SLOT(onFileSelectButtonClicked()));
|
||||
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(filePathEdit);
|
||||
layout->addWidget(fileSelectButton);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString FileSelectWidget::getValue() const
|
||||
{
|
||||
if (nullptr != filePathEdit)
|
||||
{
|
||||
if (this->componentType == ComponentType::FolderSelect) {
|
||||
//检测最后一个字符是否为分隔符
|
||||
QString filePath = filePathEdit->text();
|
||||
if (filePath.endsWith(QDir::separator())) {
|
||||
return filePath;
|
||||
}
|
||||
else {
|
||||
return QString(u8"%1%2").arg(filePath).arg(QDir::separator());
|
||||
}
|
||||
}
|
||||
else{
|
||||
return filePathEdit->text();
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请先选择文件");
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
void FileSelectWidget::onFileSelectButtonClicked()
|
||||
{
|
||||
if (this->componentType == ComponentType::FileSelect)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(this,
|
||||
QString(u8"选择%1").arg(this->getParaChsName()),
|
||||
"",
|
||||
QString(u8"所有文件(*.*);;%1文件(*.%2);;").arg(this->getDatatype()).arg(this->getDatatype()));
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
filePathEdit->setText(fileName);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, u8"警告", u8"请选择文件");
|
||||
}
|
||||
}
|
||||
else if (this->componentType == ComponentType::MulitFileSelect)
|
||||
{
|
||||
QStringList fileName = QFileDialog::getOpenFileNames(this,
|
||||
QString(u8"选择文件夹:%1").arg(this->getParaChsName()),
|
||||
"");
|
||||
if (fileName.count() != 0)
|
||||
{
|
||||
QString filePathlist = fileName.at(0);
|
||||
for (long i = 1; i < fileName.count(); i++)
|
||||
{
|
||||
filePathlist = QString(u8"%1;%2").arg(filePathlist).arg(fileName.at(i));
|
||||
}
|
||||
filePathlist = QString(u8"%1;").arg(filePathlist);
|
||||
filePathEdit->setText(filePathlist);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, u8"警告", u8"请选择文件夹");
|
||||
}
|
||||
}
|
||||
else if (this->componentType == ComponentType::FolderSelect) {
|
||||
QString fileName = QFileDialog::getExistingDirectory(this,
|
||||
QString(u8"选择文件夹:%1").arg(this->getParaChsName()),
|
||||
"");
|
||||
if (!fileName.isEmpty())
|
||||
{
|
||||
fileName = QString(u8"%1%2").arg(fileName).arg(QDir::separator());
|
||||
filePathEdit->setText(fileName);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, u8"警告", u8"请选择文件夹");
|
||||
}
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(this, u8"警告", u8"参数控件格式错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 整数输入组件
|
||||
IntInputWidget::IntInputWidget(QWidget* parent) :AbstractComponentWidget(parent)
|
||||
{
|
||||
|
||||
}
|
||||
IntInputWidget::~IntInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void IntInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
|
||||
|
||||
intInput = new QSpinBox(this);
|
||||
intInput->setRange(-920240809, 920240809);
|
||||
intInput->setSingleStep(1);
|
||||
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
intInput->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(intInput);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString IntInputWidget::getValue() const
|
||||
{
|
||||
if (nullptr == this->intInput)
|
||||
{
|
||||
return QString();
|
||||
}
|
||||
else {
|
||||
return QString::number(this->intInput->value());
|
||||
}
|
||||
}
|
||||
|
||||
// 浮点数输入组件
|
||||
|
||||
DoubleInputWidget::DoubleInputWidget(QWidget* parent) :AbstractComponentWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
DoubleInputWidget::~DoubleInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void DoubleInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
|
||||
|
||||
doubleInput = new QLineEdit(this);
|
||||
|
||||
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
doubleInput->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(doubleInput);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString DoubleInputWidget::getValue() const
|
||||
{
|
||||
if (nullptr != this->doubleInput)
|
||||
{
|
||||
return this->doubleInput->text();
|
||||
}
|
||||
else {
|
||||
return QString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 整数输入组件
|
||||
ScopeIntInputWidget::ScopeIntInputWidget(QWidget* parent) :AbstractComponentWidget(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
ScopeIntInputWidget::~ScopeIntInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ScopeIntInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
intInputMin = new QSpinBox(this);
|
||||
intInputMin->setRange(-1000000, 1000000);
|
||||
intInputMin->setSingleStep(1);
|
||||
|
||||
scopeConnectStr = new QLabel(this);
|
||||
scopeConnectStr->setText(u8" - ");
|
||||
|
||||
intInputMax = new QSpinBox(this);
|
||||
intInputMax->setRange(-1000000, 1000000);
|
||||
intInputMax->setSingleStep(1);
|
||||
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
intInputMin->setMinimumHeight(40);
|
||||
intInputMax->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(intInputMin);
|
||||
layout->addWidget(scopeConnectStr);
|
||||
layout->addWidget(intInputMax);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
|
||||
QString ScopeIntInputWidget::getValue() const
|
||||
{
|
||||
if (nullptr != intInputMin && nullptr != intInputMax)
|
||||
{
|
||||
return QString("%1;%2")
|
||||
.arg(QString::number(intInputMin->value()))
|
||||
.arg(QString::number(intInputMax->value()));
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请先输入");
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 浮点数输入组件
|
||||
ScopeDoubleInputWidget::ScopeDoubleInputWidget(QWidget* parent) :AbstractComponentWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
ScopeDoubleInputWidget::~ScopeDoubleInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void ScopeDoubleInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
doubleInputMin = new QLineEdit(this);
|
||||
|
||||
|
||||
scopeConnectStr = new QLabel(this);
|
||||
scopeConnectStr->setText(u8" - ");
|
||||
|
||||
doubleInputMax = new QLineEdit(this);
|
||||
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
doubleInputMin->setMinimumHeight(40);
|
||||
doubleInputMax->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(doubleInputMin);
|
||||
layout->addWidget(scopeConnectStr);
|
||||
layout->addWidget(doubleInputMax);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString ScopeDoubleInputWidget::getValue() const
|
||||
{
|
||||
if (nullptr != doubleInputMin && nullptr != doubleInputMax)
|
||||
{
|
||||
return QString("%1;%2")
|
||||
.arg(doubleInputMin->text())
|
||||
.arg(doubleInputMax->text());
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请先输入");
|
||||
}
|
||||
return QString();
|
||||
}
|
||||
|
||||
AbstractComponentWidget* createComponentWidgetFactory(QString ParaName, QString ParaChsName, QString Datatype, QString ParaType, QString Description, QWidget* parent)
|
||||
{
|
||||
qDebug() << "createComponentWidgetFactory: " << ParaName << ParaChsName << Datatype << ParaType << Description;
|
||||
if (QString::compare(ParaName, u8"WorkSpace", Qt::CaseInsensitive) == 0) { // 判断是否相等
|
||||
AbstractComponentWidget* workspacePathWidget = new FileSelectWidget(parent);
|
||||
workspacePathWidget->setParaName(ParaName);
|
||||
workspacePathWidget->setParaChsName(ParaChsName);
|
||||
workspacePathWidget->setDescription(Description);
|
||||
workspacePathWidget->setDatatype(Datatype);
|
||||
workspacePathWidget->setComponentType(ComponentType::FolderSelect);
|
||||
workspacePathWidget->initUI();
|
||||
return workspacePathWidget;
|
||||
}
|
||||
else if(QString::compare(ParaName, u8"box", Qt::CaseInsensitive) == 0 ){ // 包围盒
|
||||
AbstractComponentWidget* boxInpputWidget = new BoxDoubleInputWidget(parent);
|
||||
boxInpputWidget->setParaName(ParaName);
|
||||
boxInpputWidget->setParaChsName(ParaChsName);
|
||||
boxInpputWidget->setDescription(Description);
|
||||
boxInpputWidget->setDatatype(Datatype);
|
||||
boxInpputWidget->setComponentType(ComponentType::BoxDoubleInput);
|
||||
boxInpputWidget->initUI();
|
||||
return boxInpputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaName, u8"CoveringIDs", Qt::CaseInsensitive) == 0 ) { // 地表覆盖类型
|
||||
AbstractComponentWidget* intInpputWidget = new MultiIntInputWidget(parent);
|
||||
intInpputWidget->setParaName(ParaName);
|
||||
intInpputWidget->setParaChsName(ParaChsName);
|
||||
intInpputWidget->setDescription(Description);
|
||||
intInpputWidget->setDatatype(Datatype);
|
||||
intInpputWidget->setComponentType(ComponentType::MultiIntInput);
|
||||
intInpputWidget->initUI();
|
||||
return intInpputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaName, u8"NDVIScope", Qt::CaseInsensitive) == 0) { //NDVI 范围
|
||||
AbstractComponentWidget* scopeDoubleInputWidget = new ScopeDoubleInputWidget(parent);
|
||||
scopeDoubleInputWidget->setParaName(ParaName);
|
||||
scopeDoubleInputWidget->setParaChsName(ParaChsName);
|
||||
scopeDoubleInputWidget->setDescription(Description);
|
||||
scopeDoubleInputWidget->setDatatype(Datatype);
|
||||
scopeDoubleInputWidget->setComponentType(ComponentType::ScopeDoubleInput);
|
||||
scopeDoubleInputWidget->initUI();
|
||||
return scopeDoubleInputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaName, u8"MainImg", Qt::CaseInsensitive) == 0 ) { // 浮点数输入
|
||||
AbstractComponentWidget* InputWidget = new IntInputWidget(parent);
|
||||
InputWidget->setParaName(ParaName);
|
||||
InputWidget->setParaChsName(ParaChsName);
|
||||
InputWidget->setDescription(Description);
|
||||
InputWidget->setDatatype(Datatype);
|
||||
InputWidget->setComponentType(ComponentType::IntInput);
|
||||
InputWidget->initUI();
|
||||
return InputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaName, u8"SARS", Qt::CaseInsensitive) == 0 ) { // 浮点数输入
|
||||
AbstractComponentWidget* InputWidget = new FileSelectWidget(parent);
|
||||
InputWidget->setParaName(ParaName);
|
||||
InputWidget->setParaChsName(ParaChsName);
|
||||
InputWidget->setDescription(Description);
|
||||
InputWidget->setDatatype(Datatype);
|
||||
InputWidget->setComponentType(ComponentType::MulitFileSelect);
|
||||
InputWidget->initUI();
|
||||
return InputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaName, u8"CorrectMethod", Qt::CaseInsensitive) == 0 ) { // 浮点数输入
|
||||
AbstractComponentWidget* scopeDoubleInputWidget = new CorrectMethodcomboxSelectWidget(parent);
|
||||
scopeDoubleInputWidget->setParaName(ParaName);
|
||||
scopeDoubleInputWidget->setParaChsName(ParaChsName);
|
||||
scopeDoubleInputWidget->setDescription(Description);
|
||||
scopeDoubleInputWidget->setDatatype(Datatype);
|
||||
scopeDoubleInputWidget->setComponentType(ComponentType::IntInput);
|
||||
scopeDoubleInputWidget->initUI();
|
||||
return scopeDoubleInputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaName, u8"FeatureCombination", Qt::CaseInsensitive) == 0) { // 浮点数输入
|
||||
AbstractComponentWidget* InputWidget = new FeatureCombinationMultiIntInputWidget(parent);
|
||||
InputWidget->setParaName(ParaName);
|
||||
InputWidget->setParaChsName(ParaChsName);
|
||||
InputWidget->setDescription(Description);
|
||||
InputWidget->setDatatype(Datatype);
|
||||
InputWidget->setComponentType(ComponentType::IntInput);
|
||||
InputWidget->initUI();
|
||||
return InputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaType, u8"Value", Qt::CaseInsensitive) == 0 && QString::compare(Datatype, u8"string", Qt::CaseInsensitive) == 0) {
|
||||
AbstractComponentWidget* InputWidget = new StringInputWidget(parent);
|
||||
InputWidget->setParaName(ParaName);
|
||||
InputWidget->setParaChsName(ParaChsName);
|
||||
InputWidget->setDescription(Description);
|
||||
InputWidget->setDatatype(Datatype);
|
||||
InputWidget->setComponentType(ComponentType::IntInput);
|
||||
InputWidget->initUI();
|
||||
return InputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaType, u8"Value", Qt::CaseInsensitive) == 0 && QString::compare(Datatype, u8"float", Qt::CaseInsensitive) == 0) { // 浮点数输入
|
||||
AbstractComponentWidget* InputWidget = new DoubleInputWidget(parent);
|
||||
InputWidget->setParaName(ParaName);
|
||||
InputWidget->setParaChsName(ParaChsName);
|
||||
InputWidget->setDescription(Description);
|
||||
InputWidget->setDatatype(Datatype);
|
||||
InputWidget->setComponentType(ComponentType::DoubleInput);
|
||||
InputWidget->initUI();
|
||||
return InputWidget;
|
||||
}
|
||||
else if (QString::compare(ParaType, u8"File", Qt::CaseInsensitive) == 0 && QString::compare(Datatype, u8"File", Qt::CaseInsensitive) == 0) { // 强制选择文件夹
|
||||
AbstractComponentWidget* fileSelectWidget = new FileSelectWidget(parent);
|
||||
fileSelectWidget->setParaName(ParaName);
|
||||
fileSelectWidget->setParaChsName(ParaChsName);
|
||||
fileSelectWidget->setDescription(Description);
|
||||
fileSelectWidget->setDatatype(Datatype);
|
||||
fileSelectWidget->setComponentType(ComponentType::FolderSelect);
|
||||
fileSelectWidget->initUI();
|
||||
return fileSelectWidget;
|
||||
}
|
||||
else if (QString::compare(ParaType, u8"File", Qt::CaseInsensitive) == 0 && QString::compare(Datatype, u8"tar.gz", Qt::CaseInsensitive) == 0) {// 选择文件
|
||||
AbstractComponentWidget* fileSelectWidget = new FileSelectWidget(parent);
|
||||
fileSelectWidget->setParaName(ParaName);
|
||||
fileSelectWidget->setParaChsName(ParaChsName);
|
||||
fileSelectWidget->setDescription(Description);
|
||||
fileSelectWidget->setDatatype(Datatype);
|
||||
fileSelectWidget->setComponentType(ComponentType::FileSelect);
|
||||
fileSelectWidget->initUI();
|
||||
return fileSelectWidget;
|
||||
}
|
||||
else if (QString::compare(ParaType, u8"File", Qt::CaseInsensitive) == 0) {// 选择文件
|
||||
AbstractComponentWidget* fileSelectWidget = new FileSelectWidget(parent);
|
||||
fileSelectWidget->setParaName(ParaName);
|
||||
fileSelectWidget->setParaChsName(ParaChsName);
|
||||
fileSelectWidget->setDescription(Description);
|
||||
fileSelectWidget->setDatatype(Datatype);
|
||||
fileSelectWidget->setComponentType(ComponentType::MulitFileSelect);
|
||||
fileSelectWidget->initUI();
|
||||
return fileSelectWidget;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BoxDoubleInputWidget::BoxDoubleInputWidget(QWidget* parent) :AbstractComponentWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
BoxDoubleInputWidget::~BoxDoubleInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void BoxDoubleInputWidget::initUI()
|
||||
{
|
||||
// 修改提示
|
||||
this->Description = QString(u8"%1;不填参数请填写empty作为不填写指令").arg(this->Description);
|
||||
this->setToolTip(this->Description);
|
||||
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
doubleInputMin = new QLineEdit(this);
|
||||
doubleInputMin->setPlaceholderText(u8"请输入包围盒参数");
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
doubleInputMin->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(doubleInputMin);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString BoxDoubleInputWidget::getValue() const
|
||||
{
|
||||
QString valuestr = this->doubleInputMin->text();
|
||||
// 非法性检查
|
||||
if (valuestr.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请先输入");
|
||||
return QString();
|
||||
}
|
||||
else if (valuestr.compare("empty", Qt::CaseSensitive) == 0)
|
||||
{
|
||||
return QString("empty");
|
||||
}
|
||||
else {
|
||||
// 经纬度包围盒SNWE。例子:30.0;30.2;117.3;117.5 37;38.2;108.87;109.1 , 请根据例子给出规则检查代码
|
||||
|
||||
QStringList list = valuestr.split(";");
|
||||
if (list.size() != 4)
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", QString(u8"包围盒参数格式错误\n%1").arg(this->Description));
|
||||
return QString("empty");
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
bool ok;
|
||||
double value = list.at(i).toDouble(&ok);
|
||||
if (!ok)
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", QString(u8"包围盒参数格式错误\n%1").arg(this->Description));
|
||||
return QString("empty");
|
||||
}
|
||||
}
|
||||
return valuestr;
|
||||
}
|
||||
return QString("empty");
|
||||
}
|
||||
|
||||
|
||||
MultiIntInputWidget::MultiIntInputWidget(QWidget* parent)
|
||||
{
|
||||
}
|
||||
|
||||
MultiIntInputWidget::~MultiIntInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void MultiIntInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
IntInputMin = new QLineEdit(this);
|
||||
IntInputMin->setPlaceholderText(u8"请输入整数");
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
IntInputMin->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(IntInputMin);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString MultiIntInputWidget::getValue() const
|
||||
{
|
||||
QString valuestr = this->IntInputMin->text();
|
||||
// 非法性检查
|
||||
if (valuestr.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请先输入");
|
||||
return QString();
|
||||
}
|
||||
else if (valuestr.compare("empty", Qt::CaseSensitive) == 0)
|
||||
{
|
||||
return QString("empty");
|
||||
}
|
||||
else {
|
||||
QStringList list = valuestr.split(";");
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
bool ok;
|
||||
int value = list.at(i).toInt(&ok);
|
||||
if (!ok)
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", QString(u8"整数参数格式错误\n%1").arg(this->Description));
|
||||
return QString("empty");
|
||||
}
|
||||
}
|
||||
return valuestr;
|
||||
}
|
||||
return QString("empty");
|
||||
}
|
||||
|
||||
MultiDoubleInputWidget::MultiDoubleInputWidget(QWidget* parent)
|
||||
{
|
||||
}
|
||||
|
||||
MultiDoubleInputWidget::~MultiDoubleInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void MultiDoubleInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
doubleInputMin = new QLineEdit(this);
|
||||
doubleInputMin->setPlaceholderText(u8"请输入浮点数");
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
doubleInputMin->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(doubleInputMin);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString MultiDoubleInputWidget::getValue() const
|
||||
{
|
||||
QString valuestr = this->doubleInputMin->text();
|
||||
// 非法性检查
|
||||
if (valuestr.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请先输入");
|
||||
return QString();
|
||||
}
|
||||
else if (valuestr.compare("empty", Qt::CaseSensitive) == 0)
|
||||
{
|
||||
return QString("empty");
|
||||
}
|
||||
else {
|
||||
QStringList list = valuestr.split(";");
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
bool ok;
|
||||
double value = list.at(i).toDouble(&ok);
|
||||
if (!ok)
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", QString(u8"浮点数参数格式错误\n%1").arg(this->Description));
|
||||
return QString("empty");
|
||||
}
|
||||
}
|
||||
return valuestr;
|
||||
}
|
||||
return QString("empty");
|
||||
}
|
||||
|
||||
|
||||
CorrectMethodcomboxSelectWidget::CorrectMethodcomboxSelectWidget(QWidget* parent)
|
||||
{
|
||||
}
|
||||
|
||||
CorrectMethodcomboxSelectWidget::~CorrectMethodcomboxSelectWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void CorrectMethodcomboxSelectWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
comboxSelect = new QComboBox(this);
|
||||
comboxSelect->addItem(u8"2:RD");
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
comboxSelect->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(comboxSelect);
|
||||
this->setLayout(layout);
|
||||
comboxSelect->setEnabled(false);
|
||||
}
|
||||
|
||||
QString CorrectMethodcomboxSelectWidget::getValue() const
|
||||
{
|
||||
return u8"2";
|
||||
}
|
||||
|
||||
FeatureCombinationMultiIntInputWidget::FeatureCombinationMultiIntInputWidget(QWidget* parent)
|
||||
{
|
||||
}
|
||||
|
||||
FeatureCombinationMultiIntInputWidget::~FeatureCombinationMultiIntInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void FeatureCombinationMultiIntInputWidget::initUI()
|
||||
{
|
||||
/*
|
||||
根据下面的参数,设置一个 checkbox 阵列
|
||||
Freeman:表面散射p_s(0)、偶次散射p_d(1)、体散射p_v(2);
|
||||
Touzi:散射角α_s(3)、散射相位ϕ_α(4)、目标散射对称度τ(5)、相对能量λ_i(6);
|
||||
Yamaguchi:表面散射f_s(7)、二次散射f_d(8)、体散射f_v(9)、螺旋体散射f_h(10);
|
||||
Cloude-Pottier:分解散射熵H(11)、反熵A(12)、平均散射角α(13)*/
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
|
||||
|
||||
// 不同控件checkbox 初始化
|
||||
checkbox0 = new QCheckBox(u8"表面散射p_s(0)", this);
|
||||
checkbox1 = new QCheckBox(u8"偶次散射p_d(1)", this);
|
||||
checkbox2 = new QCheckBox(u8"体散射p_v(2)", this);
|
||||
checkbox3 = new QCheckBox(u8"散射角α_s(3)", this);
|
||||
checkbox4 = new QCheckBox(u8"散射相位ϕ_α(4)", this);
|
||||
checkbox5 = new QCheckBox(u8"目标散射对称度τ(5)", this);
|
||||
checkbox6 = new QCheckBox(u8"相对能量λ_i(6)", this);
|
||||
checkbox7 = new QCheckBox(u8"表面散射f_s(7)", this);
|
||||
checkbox8 = new QCheckBox(u8"二次散射f_d(8)", this);
|
||||
checkbox9 = new QCheckBox(u8"体散射f_v(9)", this);
|
||||
checkbox10 = new QCheckBox(u8"螺旋体散射f_h(10)", this);
|
||||
checkbox11 = new QCheckBox(u8"分解散射熵H(11)", this);
|
||||
checkbox12 = new QCheckBox(u8"反熵A(12)", this);
|
||||
checkbox13 = new QCheckBox(u8"平均散射角α(13)", this);
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
checkbox0->setMinimumHeight(40);
|
||||
checkbox1->setMinimumHeight(40);
|
||||
checkbox2->setMinimumHeight(40);
|
||||
checkbox3->setMinimumHeight(40);
|
||||
checkbox4->setMinimumHeight(40);
|
||||
checkbox5->setMinimumHeight(40);
|
||||
checkbox6->setMinimumHeight(40);
|
||||
checkbox7->setMinimumHeight(40);
|
||||
checkbox8->setMinimumHeight(40);
|
||||
checkbox9->setMinimumHeight(40);
|
||||
checkbox10->setMinimumHeight(40);
|
||||
checkbox11->setMinimumHeight(40);
|
||||
checkbox12->setMinimumHeight(40);
|
||||
checkbox13->setMinimumHeight(40);
|
||||
// 垂直布局,并按照Freeman、Touzi、Yamaguchi、Cloude-Pottier的分组,每一个分组使用一个QGroupBox,水平
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
QGroupBox* FreemanGroup = new QGroupBox(u8"Freeman", this);
|
||||
QHBoxLayout* FreemanLayout = new QHBoxLayout(FreemanGroup);
|
||||
FreemanLayout->addWidget(checkbox0);
|
||||
FreemanLayout->addWidget(checkbox1);
|
||||
FreemanLayout->addWidget(checkbox2);
|
||||
QGroupBox* TouziGroup = new QGroupBox(u8"Touzi", this);
|
||||
QHBoxLayout* TouziLayout = new QHBoxLayout(TouziGroup);
|
||||
TouziLayout->addWidget(checkbox3);
|
||||
TouziLayout->addWidget(checkbox4);
|
||||
TouziLayout->addWidget(checkbox5);
|
||||
TouziLayout->addWidget(checkbox6);
|
||||
QGroupBox* YamaguchiGroup = new QGroupBox(u8"Yamaguchi", this);
|
||||
QHBoxLayout* YamaguchiLayout = new QHBoxLayout(YamaguchiGroup);
|
||||
YamaguchiLayout->addWidget(checkbox7);
|
||||
YamaguchiLayout->addWidget(checkbox8);
|
||||
YamaguchiLayout->addWidget(checkbox9);
|
||||
YamaguchiLayout->addWidget(checkbox10);
|
||||
QGroupBox* CloudePottierGroup = new QGroupBox(u8"Cloude-Pottier", this);
|
||||
QHBoxLayout* CloudePottierLayout = new QHBoxLayout(CloudePottierGroup);
|
||||
CloudePottierLayout->addWidget(checkbox11);
|
||||
CloudePottierLayout->addWidget(checkbox12);
|
||||
CloudePottierLayout->addWidget(checkbox13);
|
||||
layout->addWidget(FreemanGroup);
|
||||
layout->addWidget(TouziGroup);
|
||||
layout->addWidget(YamaguchiGroup);
|
||||
layout->addWidget(CloudePottierGroup);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString FeatureCombinationMultiIntInputWidget::getValue() const
|
||||
{
|
||||
|
||||
// 检查所有的checkbox是否被选中,然后给出形如0,1,2,7,8,9,10的字符串
|
||||
QString valuestr = QString();
|
||||
if (checkbox0->isChecked())
|
||||
{
|
||||
valuestr += "0,";
|
||||
}
|
||||
if (checkbox1->isChecked())
|
||||
{
|
||||
valuestr += "1,";
|
||||
}
|
||||
if (checkbox2->isChecked())
|
||||
{
|
||||
valuestr += "2,";
|
||||
}
|
||||
if (checkbox3->isChecked())
|
||||
{
|
||||
valuestr += "3,";
|
||||
}
|
||||
if (checkbox4->isChecked())
|
||||
{
|
||||
valuestr += "4,";
|
||||
}
|
||||
if (checkbox5->isChecked())
|
||||
{
|
||||
valuestr += "5,";
|
||||
}
|
||||
if (checkbox6->isChecked())
|
||||
{
|
||||
valuestr += "6,";
|
||||
}
|
||||
if (checkbox7->isChecked())
|
||||
{
|
||||
valuestr += "7,";
|
||||
}
|
||||
if (checkbox8->isChecked())
|
||||
{
|
||||
valuestr += "8,";
|
||||
}
|
||||
if (checkbox9->isChecked())
|
||||
{
|
||||
valuestr += "9,";
|
||||
}
|
||||
if (checkbox10->isChecked())
|
||||
{
|
||||
valuestr += "10,";
|
||||
}
|
||||
if (checkbox11->isChecked())
|
||||
{
|
||||
valuestr += "11,";
|
||||
}
|
||||
if (checkbox12->isChecked())
|
||||
{
|
||||
valuestr += "12,";
|
||||
}
|
||||
if (checkbox13->isChecked())
|
||||
{
|
||||
valuestr += "13,";
|
||||
}
|
||||
// 去掉最后一个逗号
|
||||
if (valuestr.length() > 0)
|
||||
{
|
||||
valuestr = valuestr.left(valuestr.length() - 1);
|
||||
}
|
||||
else {
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请至少选择一个参数");
|
||||
return QString();
|
||||
}
|
||||
return valuestr;
|
||||
}
|
||||
|
||||
StringInputWidget::StringInputWidget(QWidget* parent)
|
||||
{
|
||||
}
|
||||
|
||||
StringInputWidget::~StringInputWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void StringInputWidget::initUI()
|
||||
{
|
||||
fileNameLabel = new QLabel(this);
|
||||
fileNameLabel->setText(this->getParaName());
|
||||
IntInputMin = new QLineEdit(this);
|
||||
IntInputMin->setPlaceholderText(u8"请输入");
|
||||
// 设置文件最小控件高度
|
||||
fileNameLabel->setMinimumHeight(40);
|
||||
IntInputMin->setMinimumHeight(40);
|
||||
// 水平布局
|
||||
QHBoxLayout* layout = new QHBoxLayout(this);
|
||||
layout->addWidget(fileNameLabel);
|
||||
layout->addWidget(IntInputMin);
|
||||
this->setLayout(layout);
|
||||
}
|
||||
|
||||
QString StringInputWidget::getValue() const
|
||||
{
|
||||
return IntInputMin->text();
|
||||
}
|
|
@ -0,0 +1,341 @@
|
|||
#pragma once
|
||||
|
||||
/**
|
||||
* 空基十三五微波算法组件界面组件类集
|
||||
* @file KJ135WBJYAlgWidgetComponet.h
|
||||
* @brief KJ135WBJYAlgWidgetComponet.h
|
||||
* @details
|
||||
* 空基十三五微波算法组件界面组件类集
|
||||
*/
|
||||
|
||||
#ifndef __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
||||
#define __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
||||
|
||||
#include "KJ135WBJYAlgInterfaceToolbox_global.h"
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
#include <QToolButton>
|
||||
#include <QLineEdit>
|
||||
#include <QLabel>
|
||||
#include <QComboBox>
|
||||
#include <QSpinBox>
|
||||
#include <QDoubleSpinBox>
|
||||
#include <QCheckBox>
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 参数类型枚举
|
||||
/// </summary>
|
||||
enum ComponentType{
|
||||
UNKNOW = 0, // 未知类型
|
||||
WorkSpace, // 工作空间路径
|
||||
FileSelect , // 文件选择
|
||||
MulitFileSelect , // 文件选择
|
||||
FolderSelect, // 文件夹选择
|
||||
ComboxSelect,// 枚举多选
|
||||
IntInput,// 整数输入
|
||||
stringInput,
|
||||
BoxDoubleInput,// 复选框浮点数输入
|
||||
DoubleInput,// 浮点数输入
|
||||
MultipleSelect,// 多选
|
||||
MultiIntInput,// 整数多选输入
|
||||
MultiDoubleInput,// 浮点数多选输入
|
||||
ScopeIntInput,// 整数范围输入
|
||||
ScopeDoubleInput,// 浮点数范围输入
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
<Parameter>
|
||||
<ParaName>CoveringIDs</ParaName>
|
||||
<ParaChsName>地表覆盖类型数据的类别id</ParaChsName>
|
||||
<Description>地表覆盖类型数据中植被区域、裸土区域的类别id,多个id使用“;”分割。示例:GlobeLand30数据的cover_roi_ids = 10;20;30;40;50;70;71;72;83;74;90</Description>
|
||||
<ParaType>Value</ParaType>
|
||||
<DataType>string</DataType>
|
||||
<ParaSource>Man</ParaSource>
|
||||
<ParaValue>1;4;5;6;7;11;10;20;30;50;60;70;71;72;73;74;80;90;255</ParaValue>
|
||||
<EnModification>True</EnModification>
|
||||
<EnMultipleChoice>False</EnMultipleChoice>
|
||||
<Control>UploadInput</Control>
|
||||
<InputType>Aux</InputType>
|
||||
<InputNum>0</InputNum>
|
||||
<DateFrom>Aux</DateFrom>
|
||||
<OptionValue>DEFAULT</OptionValue>
|
||||
<MinValue>DEFAULT</MinValue>
|
||||
<MaxValue>DEFAULT</MaxValue>
|
||||
<NoDataValue>DEFAULT</NoDataValue>
|
||||
<filePath>DEFAULT</filePath>
|
||||
</Parameter>
|
||||
|
||||
**/
|
||||
|
||||
class AbstractComponentWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
AbstractComponentWidget(QWidget* parent = nullptr);
|
||||
~AbstractComponentWidget();
|
||||
|
||||
protected:
|
||||
QString ParaName; // 参数名称
|
||||
QString ParaChsName;// 参数中文名称
|
||||
QString Description;// 参数描述
|
||||
|
||||
QString Datatype;// 数据类型 Value // 决定参数的输入类型
|
||||
QString ParaType;// 参数类型 string
|
||||
|
||||
ComponentType componentType = ComponentType::UNKNOW; // 组件类型
|
||||
public://属性操作
|
||||
QString getParaName() const;
|
||||
void setParaName(const QString& name);
|
||||
// 设置参数中文名称
|
||||
QString getParaChsName() const;
|
||||
void setParaChsName(const QString& name);
|
||||
// 设置参数描述
|
||||
QString getDescription() const;
|
||||
void setDescription(const QString& description);
|
||||
// 设置数据类型
|
||||
QString getDatatype() const;
|
||||
void setDatatype(const QString& datatype);
|
||||
// 设置参数类型
|
||||
QString getParaType() const;
|
||||
void setParaType(const QString& type);
|
||||
|
||||
void setComponentType(ComponentType type);
|
||||
ComponentType getComponentType() const;
|
||||
|
||||
virtual QString getValue() const;
|
||||
virtual void initUI();
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// File 文件选择组件
|
||||
/// </summary>
|
||||
class FileSelectWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FileSelectWidget(QWidget* parent = nullptr);
|
||||
~FileSelectWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel=nullptr; // 文件名称
|
||||
QLineEdit* filePathEdit = nullptr;
|
||||
QToolButton* fileSelectButton = nullptr;
|
||||
public slots:
|
||||
void onFileSelectButtonClicked();
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// int输入组件
|
||||
/// </summary>
|
||||
class IntInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
IntInputWidget(QWidget* parent = nullptr);
|
||||
~IntInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QSpinBox* intInput = nullptr;
|
||||
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// double 输入组件
|
||||
/// </summary>
|
||||
class DoubleInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
DoubleInputWidget(QWidget* parent = nullptr);
|
||||
~DoubleInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLineEdit* doubleInput = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 整数值 数据范围输入组件
|
||||
/// </summary>
|
||||
class ScopeIntInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScopeIntInputWidget(QWidget* parent = nullptr);
|
||||
~ScopeIntInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLabel* scopeConnectStr = nullptr; // 文件名称
|
||||
QSpinBox* intInputMin = nullptr;
|
||||
QSpinBox* intInputMax = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 浮点数值 数据范围输入组件
|
||||
/// </summary>
|
||||
class ScopeDoubleInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScopeDoubleInputWidget(QWidget* parent = nullptr);
|
||||
~ScopeDoubleInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLabel* scopeConnectStr = nullptr; // 文件名称
|
||||
QLineEdit* doubleInputMin = nullptr;
|
||||
QLineEdit* doubleInputMax = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
|
||||
|
||||
class BoxDoubleInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BoxDoubleInputWidget(QWidget* parent = nullptr);
|
||||
~BoxDoubleInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLineEdit* doubleInputMin = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
class MultiIntInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MultiIntInputWidget(QWidget* parent = nullptr);
|
||||
~MultiIntInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLineEdit* IntInputMin = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
class MultiDoubleInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MultiDoubleInputWidget(QWidget* parent = nullptr);
|
||||
~MultiDoubleInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLineEdit* doubleInputMin = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
|
||||
class CorrectMethodcomboxSelectWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
CorrectMethodcomboxSelectWidget(QWidget* parent = nullptr);
|
||||
~CorrectMethodcomboxSelectWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QComboBox* comboxSelect = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
|
||||
class FeatureCombinationMultiIntInputWidget : public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
FeatureCombinationMultiIntInputWidget(QWidget* parent = nullptr);
|
||||
~FeatureCombinationMultiIntInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
/*
|
||||
根据下面的参数,设置一个 checkbox 阵列
|
||||
Freeman:表面散射p_s(0)、偶次散射p_d(1)、体散射p_v(2);
|
||||
Touzi:散射角α_s(3)、散射相位ϕ_α(4)、目标散射对称度τ(5)、相对能量λ_i(6);
|
||||
Yamaguchi:表面散射f_s(7)、二次散射f_d(8)、体散射f_v(9)、螺旋体散射f_h(10);
|
||||
Cloude-Pottier:分解散射熵H(11)、反熵A(12)、平均散射角α(13)*/
|
||||
QCheckBox* checkbox0 = nullptr; // 表面散射
|
||||
QCheckBox* checkbox1 = nullptr; // 偶次散射p_d
|
||||
QCheckBox* checkbox2 = nullptr; // 体散射p_v
|
||||
QCheckBox* checkbox3 = nullptr; // 散射角α_s
|
||||
QCheckBox* checkbox4 = nullptr; // 散射相位ϕ_α
|
||||
QCheckBox* checkbox5 = nullptr; // 目标散射对称度τ
|
||||
QCheckBox* checkbox6 = nullptr; // 相对能量λ_i
|
||||
QCheckBox* checkbox7 = nullptr; // 表面散射f_s
|
||||
QCheckBox* checkbox8 = nullptr; // 二次散射f_d
|
||||
QCheckBox* checkbox9 = nullptr; // 体散射f_v
|
||||
QCheckBox* checkbox10 = nullptr; // 螺旋体散射f_h
|
||||
QCheckBox* checkbox11 = nullptr; // 分解散射熵H
|
||||
QCheckBox* checkbox12 = nullptr; // 反熵A
|
||||
QCheckBox* checkbox13 = nullptr; // 平均散射角α
|
||||
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
|
||||
class StringInputWidget :public AbstractComponentWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
StringInputWidget(QWidget* parent = nullptr);
|
||||
~StringInputWidget();
|
||||
virtual void initUI() override;
|
||||
private:
|
||||
QLabel* fileNameLabel = nullptr; // 文件名称
|
||||
QLineEdit* IntInputMin = nullptr;
|
||||
public:
|
||||
virtual QString getValue() const override;
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 参数文件工厂
|
||||
/// </summary>
|
||||
/// <param name="ParaName">参数名称</param>
|
||||
/// <param name="ParaChsName">参数中文别名</param>
|
||||
/// <param name="Datatype">数据类型</param>
|
||||
/// <param name="ParaType">参数类型</param>
|
||||
/// <param name="Description">描述</param>
|
||||
/// <param name="parent">父控件</param>
|
||||
/// <returns></returns>
|
||||
AbstractComponentWidget* createComponentWidgetFactory(QString ParaName, QString ParaChsName, QString Datatype, QString ParaType, QString Description,QWidget* parent = nullptr);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif// __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
#include "QWBFZAlgComponetXmlParamsDialog.h"
|
||||
#include "ui_QWBFZAlgComponetXmlParamsDialog.h"
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include "WBFZAlgComponetXmlParaseOperator.h"
|
||||
#include "FileOperator.h"
|
||||
QWBFZAlgComponetXmlParamsDialog::QWBFZAlgComponetXmlParamsDialog(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::QWBFZAlgComponetXmlParamsDialogClass)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// 绑定信号-槽
|
||||
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(OnacceptButton_Clicked()));
|
||||
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(OncancelButton_Clicked()));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
QWBFZAlgComponetXmlParamsDialog::~QWBFZAlgComponetXmlParamsDialog()
|
||||
{
|
||||
delete ui;
|
||||
delete xmlParseOperator;
|
||||
}
|
||||
|
||||
void QWBFZAlgComponetXmlParamsDialog::OnacceptButton_Clicked()
|
||||
{
|
||||
// 获取参数值
|
||||
QString workspacePath = workspacePathWidget->getValue();
|
||||
qDebug() << "workspacePath:" << workspacePath;
|
||||
QMap<QString, QString> parameterMap;
|
||||
for (long i = 0; i < parameterWidgetList.size(); i++)
|
||||
{
|
||||
AbstractComponentWidget* parameterWidget = parameterWidgetList.at(i);
|
||||
QString parameterValue = parameterWidget->getValue();
|
||||
qDebug() << "parameterValue:" << parameterValue;
|
||||
parameterMap.insert(parameterWidget->getParaName(), parameterValue);
|
||||
}
|
||||
|
||||
// 1. 获取xml文件模板路径
|
||||
QString formatxmlpath = this->formatxmlString;
|
||||
// 2. 获取xml文件输出路径
|
||||
QString filepath = QFileDialog::getSaveFileName(this, u8"保存xml文件", "", u8"xml文件(*.xml)");
|
||||
if (filepath.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(this, u8"警告", u8"请选择xml文件");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
qDebug() << "filepath:" << filepath;
|
||||
}
|
||||
xmlParseOperator = new WBFZAlgComponetXmlParaseOperator(this);
|
||||
xmlParseOperator->writeXmlFile(formatxmlString, filepath, workspacePath,parameterMap);
|
||||
// 3. 关闭窗口
|
||||
QMessageBox::information(nullptr, u8"提示", u8"写入完成");
|
||||
}
|
||||
|
||||
void QWBFZAlgComponetXmlParamsDialog::OncancelButton_Clicked()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
void QWBFZAlgComponetXmlParamsDialog::loadXmlFile(const QString& fileName)
|
||||
{
|
||||
if (nullptr != xmlParseOperator)
|
||||
{
|
||||
delete xmlParseOperator;
|
||||
xmlParseOperator = nullptr;
|
||||
}
|
||||
else {}
|
||||
this->formatxmlString = fileName;
|
||||
// 创建xml解析类
|
||||
xmlParseOperator = new WBFZAlgComponetXmlParaseOperator(this);
|
||||
xmlParseOperator->loadXmlFile(fileName);
|
||||
|
||||
// 根据解析结果创建界面ui
|
||||
// 1. workspace路径
|
||||
workspacePathWidget = new FileSelectWidget(this);
|
||||
workspacePathWidget->setParaName("WorkSpace");
|
||||
workspacePathWidget->setParaChsName(u8"工作空间路径");
|
||||
workspacePathWidget->setDescription(u8"工作空间路径");
|
||||
workspacePathWidget->setDatatype(u8"string");
|
||||
workspacePathWidget->setComponentType(ComponentType::FolderSelect);
|
||||
workspacePathWidget->initUI();
|
||||
|
||||
ui->verticalLayout_param->addWidget(workspacePathWidget);
|
||||
// 2. 参数列表
|
||||
QList < WBFZAlgComponetXmlParamenterItem*> parameterList = xmlParseOperator->getParameterList();
|
||||
for (long i = 0; i < parameterList.size(); i++)
|
||||
{
|
||||
WBFZAlgComponetXmlParamenterItem* item = parameterList.at(i);
|
||||
qDebug() << "item->getParaName():" << item->getParaName();
|
||||
// 创建参数组件
|
||||
AbstractComponentWidget* parameterWidget = createComponentWidgetFactory(
|
||||
item->getParaName(),
|
||||
item->getParaChsName(),
|
||||
item->getDatatype(),
|
||||
item->getParaType(),
|
||||
item->getDescription(),
|
||||
this);
|
||||
//parameterWidget->initUI();
|
||||
|
||||
ui->verticalLayout_param->addWidget(parameterWidget);
|
||||
|
||||
this->parameterWidgetList.append(parameterWidget);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void WBFZAlgComponetLoadXmlParamsProcess()
|
||||
{
|
||||
QString xmlFileName = QFileDialog::getOpenFileName(nullptr, u8"选择算法组件xml参数文件", "", u8"xml文件(*.xml)");
|
||||
if (xmlFileName.isEmpty())
|
||||
{
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"请选择算法组件xml参数文件");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
// TODO: 解析xml文件,加载参数
|
||||
qDebug() << "xmlFileName:" << xmlFileName;
|
||||
|
||||
QWBFZAlgComponetXmlParamsDialog* dialog = new QWBFZAlgComponetXmlParamsDialog();
|
||||
dialog->setWindowTitle(QString(u8"算法组件xml参数文件-%1").arg(getFileNameFromPath(xmlFileName)));
|
||||
dialog->loadXmlFile(xmlFileName);
|
||||
dialog->show();
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class QWBFZAlgComponetXmlParamsDialogClass;
|
||||
}
|
||||
|
||||
class WBFZAlgComponetXmlParaseOperator;
|
||||
class AbstractComponentWidget; // 算法组件参数界面组件类
|
||||
|
||||
class QWBFZAlgComponetXmlParamsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QWBFZAlgComponetXmlParamsDialog(QWidget *parent = nullptr);
|
||||
~QWBFZAlgComponetXmlParamsDialog();
|
||||
|
||||
private:
|
||||
Ui::QWBFZAlgComponetXmlParamsDialogClass* ui;
|
||||
QString formatxmlString; // 格式化字符串
|
||||
public slots:
|
||||
void OnacceptButton_Clicked(); // 确定按钮点击事件
|
||||
void OncancelButton_Clicked(); // 取消按钮点击事件
|
||||
|
||||
|
||||
private:
|
||||
WBFZAlgComponetXmlParaseOperator* xmlParseOperator = nullptr; // 算法组件xml参数解析类
|
||||
public:
|
||||
void loadXmlFile(const QString& fileName); // 加载xml文件
|
||||
|
||||
private: // 界面控件
|
||||
AbstractComponentWidget* workspacePathWidget = nullptr; // 工作空间路径组件
|
||||
QList<AbstractComponentWidget*> parameterWidgetList; // 参数组件列表
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 加载微波算法组件xml参数界面渲染流程
|
||||
void WBFZAlgComponetLoadXmlParamsProcess();
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QWBFZAlgComponetXmlParamsDialogClass</class>
|
||||
<widget class="QDialog" name="QWBFZAlgComponetXmlParamsDialogClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QWBFZAlgComponetXmlParamsDialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollAreaParamWidget">
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>580</width>
|
||||
<height>351</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_param"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</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>
|
|
@ -0,0 +1,94 @@
|
|||
#include "QWBFZExcuteAlgProgramDialog.h"
|
||||
#include "ui_QWBFZExcuteAlgProgramDialog.h"
|
||||
#include "KJ135WBJYAlgWidgetComponet.h"
|
||||
#include <QProcess>
|
||||
#include <qt_windows.h>
|
||||
|
||||
QWBFZExcuteAlgProgramDialog::QWBFZExcuteAlgProgramDialog(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
ui(new Ui::QWBFZExcuteAlgProgramDialogClass),
|
||||
xmlfileSelectWidget(new FileSelectWidget(this)),
|
||||
exefileSelectWidget(new FileSelectWidget(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
// 添加参数选择组件
|
||||
exefileSelectWidget->setParaName(u8"算法执行exe");
|
||||
exefileSelectWidget->setParaChsName(u8"算法执行exe");
|
||||
exefileSelectWidget->setDescription(u8"算法执行exe");
|
||||
exefileSelectWidget->setDatatype(u8"string");
|
||||
exefileSelectWidget->setParaType(u8"Value");
|
||||
exefileSelectWidget->setComponentType(ComponentType::FileSelect);
|
||||
exefileSelectWidget->initUI();
|
||||
|
||||
xmlfileSelectWidget->setParaName(u8"算法xml参数文件");
|
||||
xmlfileSelectWidget->setParaChsName(u8"算法xml参数文件");
|
||||
xmlfileSelectWidget->setDescription(u8"算法xml参数文件");
|
||||
xmlfileSelectWidget->setDatatype(u8"string");
|
||||
xmlfileSelectWidget->setParaType(u8"Value");
|
||||
xmlfileSelectWidget->setComponentType(ComponentType::FileSelect);
|
||||
xmlfileSelectWidget->initUI();
|
||||
|
||||
|
||||
ui->verticalLayout_InParamsRegion->addWidget(exefileSelectWidget);
|
||||
ui->verticalLayout_InParamsRegion->addWidget(xmlfileSelectWidget);
|
||||
|
||||
// 连接信号槽
|
||||
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onacceptButton_Clicked()));
|
||||
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(oncancelButton_Clicked()));
|
||||
this->show();
|
||||
}
|
||||
|
||||
QWBFZExcuteAlgProgramDialog::~QWBFZExcuteAlgProgramDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void QWBFZExcuteAlgProgramDialog::onacceptButton_Clicked()
|
||||
{
|
||||
QString xmlfilepath = xmlfileSelectWidget->getValue();
|
||||
QString exefilepath = exefileSelectWidget->getValue();
|
||||
|
||||
qDebug() <<"xmlpath :\t" << xmlfilepath;
|
||||
qDebug() << "exepath :\t" << exefilepath;
|
||||
|
||||
// 获取exe文件文件夹路径
|
||||
QString exeDirPath = QFileInfo(exefilepath).absolutePath();
|
||||
qDebug() << "exedirpath :\t" << exeDirPath;
|
||||
|
||||
// 构建cmd命令:先进入exe文件所在目录,然后执行exe文件,参数为xml文件路径
|
||||
QString cmdstr = QString("cd /d %1 && %2 %3").arg(exeDirPath).arg(exefilepath).arg(xmlfilepath);
|
||||
qDebug() << "cmdstr :\t" << cmdstr;
|
||||
// 执行cmd命令
|
||||
QProcess* process = new QProcess(this);
|
||||
process->setProcessChannelMode(QProcess::MergedChannels);
|
||||
|
||||
|
||||
// 设置Windows API参数强制弹出窗口
|
||||
process->setCreateProcessArgumentsModifier([](QProcess::CreateProcessArguments* args) {
|
||||
args->flags |= CREATE_NEW_CONSOLE; // 创建新控制台窗口
|
||||
args->startupInfo->wShowWindow = SW_SHOWNORMAL; // 正常显示窗口
|
||||
args->startupInfo->dwFlags &= ~STARTF_USESTDHANDLES; // 禁用标准句柄重定向[3,7](@ref)
|
||||
});
|
||||
|
||||
|
||||
// 实时读取命令输出
|
||||
connect(process, &QProcess::readyRead, [=]() {
|
||||
QString output = QString::fromLocal8Bit(process->readAll());
|
||||
qDebug() << "CMD Output:" << output;
|
||||
});
|
||||
|
||||
// 设置程序路径和参数
|
||||
process->start("cmd.exe", QStringList() << "/k" << cmdstr);
|
||||
|
||||
// 错误处理
|
||||
connect(process, &QProcess::errorOccurred, [](QProcess::ProcessError error) {
|
||||
qDebug() << "Error:" << error;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
void QWBFZExcuteAlgProgramDialog::oncancelButton_Clicked()
|
||||
{
|
||||
this->close();
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
#ifndef __QWBFZEXCUTEALGPROGRAMDIALOG_H__
|
||||
#define __QWBFZEXCUTEALGPROGRAMDIALOG_H__
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QWBFZExcuteAlgProgramDialogClass;
|
||||
};
|
||||
|
||||
|
||||
class FileSelectWidget;
|
||||
|
||||
|
||||
class QWBFZExcuteAlgProgramDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QWBFZExcuteAlgProgramDialog(QWidget *parent = nullptr);
|
||||
~QWBFZExcuteAlgProgramDialog();
|
||||
|
||||
|
||||
public slots:
|
||||
void onacceptButton_Clicked(); // 确定按钮点击事件
|
||||
void oncancelButton_Clicked(); // 取消按钮点击事件
|
||||
|
||||
private:
|
||||
Ui::QWBFZExcuteAlgProgramDialogClass* ui;
|
||||
FileSelectWidget* xmlfileSelectWidget = nullptr; // xml文件选择组件
|
||||
FileSelectWidget* exefileSelectWidget = nullptr; // 输入文件选择组件
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QWBFZExcuteAlgProgramDialogClass</class>
|
||||
<widget class="QDialog" name="QWBFZExcuteAlgProgramDialogClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QWBFZExcuteAlgProgramDialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_InParamsRegion"/>
|
||||
</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>
|
|
@ -0,0 +1,240 @@
|
|||
#include "WBFZAlgComponetXmlParaseOperator.h"
|
||||
|
||||
WBFZAlgComponetXmlParamenterItem::WBFZAlgComponetXmlParamenterItem(QDomElement* itemparameter, QObject* parent) :QObject(parent)
|
||||
{
|
||||
if (nullptr == itemparameter) {
|
||||
qDebug() << "itemparameter is nullptr.";
|
||||
return;
|
||||
}
|
||||
|
||||
this->ParaName = itemparameter->firstChildElement("ParaName").isNull() ? QString() : itemparameter->firstChildElement("ParaName").text();
|
||||
this->ParaChsName = itemparameter->firstChildElement("ParaChsName").isNull() ? QString() : itemparameter->firstChildElement("ParaChsName").text();
|
||||
this->Description = itemparameter->firstChildElement("Description").isNull() ? QString() : itemparameter->firstChildElement("Description").text();
|
||||
this->Datatype = itemparameter->firstChildElement("DataType").isNull() ? QString() : itemparameter->firstChildElement("DataType").text();
|
||||
this->ParaType = itemparameter->firstChildElement("ParaType").isNull() ? QString() : itemparameter->firstChildElement("ParaType").text();
|
||||
this->ValueStr = itemparameter->firstChildElement("ParaValue").isNull() ? QString() : itemparameter->firstChildElement("ParaValue").text();
|
||||
}
|
||||
|
||||
WBFZAlgComponetXmlParamenterItem::~WBFZAlgComponetXmlParamenterItem()
|
||||
{
|
||||
}
|
||||
|
||||
WBFZAlgComponetXmlParaseOperator::WBFZAlgComponetXmlParaseOperator(QObject* parent) :QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
WBFZAlgComponetXmlParaseOperator::~WBFZAlgComponetXmlParaseOperator()
|
||||
{
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParaseOperator::loadXmlFile(const QString& fileName)
|
||||
{
|
||||
this->xmlFilePath = fileName;
|
||||
this->parseXmlFile();
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParaseOperator::writeXmlFile(const QString& formatfilepath, QString outfilepath, QString workspace, QMap<QString, QString> inputParamslist)
|
||||
{
|
||||
// 打开输入模板xml文件
|
||||
QFile inputFile(formatfilepath);
|
||||
if (!inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qDebug() << "Failed to open input XML file.";
|
||||
return;
|
||||
}
|
||||
// 创建QDomDocument对象
|
||||
QDomDocument doc;
|
||||
if (!doc.setContent(&inputFile)) {
|
||||
qDebug() << "Failed to parse input XML file.";
|
||||
inputFile.close();
|
||||
return;
|
||||
}
|
||||
// 关闭输入文件
|
||||
inputFile.close();
|
||||
|
||||
// 修改工作空间路径
|
||||
QDomElement root = doc.documentElement();
|
||||
QDomNodeList workspacePathNodes = root.elementsByTagName("WorkSpace");
|
||||
if (workspacePathNodes.count() > 0) {
|
||||
QDomElement workspacePathElement = workspacePathNodes.at(0).toElement();
|
||||
workspacePathElement.firstChild().setNodeValue(workspace);
|
||||
}
|
||||
else {
|
||||
qDebug() << "WorkspacePath not found.";
|
||||
return;
|
||||
}
|
||||
|
||||
// 修改Input标签下的Param标签下的ParaValue标签内容
|
||||
QDomNodeList InputsNodes = root.elementsByTagName("Inputs");
|
||||
if (InputsNodes.count() > 0) {
|
||||
QDomElement InputsElement = InputsNodes.at(0).toElement();
|
||||
QDomNodeList parameterNodes = InputsElement.elementsByTagName("Parameter");
|
||||
for (int i = 0; i < parameterNodes.count(); ++i) {
|
||||
QDomElement parameterElement = parameterNodes.at(i).toElement();
|
||||
QString paraName = parameterElement.firstChildElement("ParaName").text();
|
||||
if (inputParamslist.contains(paraName)) {
|
||||
QDomNodeList valueNodes = parameterElement.elementsByTagName("ParaValue");
|
||||
if (valueNodes.count() > 0) {
|
||||
valueNodes.at(0).firstChild().setNodeValue(inputParamslist.value(paraName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Inputs not found.";
|
||||
return;
|
||||
}
|
||||
// 7. 保存修改后的XML文件
|
||||
QFile outputFile(outfilepath);
|
||||
if (!outputFile.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
qDebug() << "Failed to open output XML file.";
|
||||
return;
|
||||
}
|
||||
// 将修改后的内容写入输出文件
|
||||
QTextStream out(&outputFile);
|
||||
out.setCodec("UTF-8");
|
||||
doc.save(out, 4); // 4表示缩进级别
|
||||
outputFile.close();
|
||||
qDebug() << "XML file written successfully.";
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void WBFZAlgComponetXmlParaseOperator::parseXmlFile()
|
||||
{
|
||||
// 1. Load the XML file
|
||||
QFile file(xmlFilePath);
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
qDebug() << "Failed to open XML file.";
|
||||
return;
|
||||
}
|
||||
// 2. Create a QDomDocument object
|
||||
QDomDocument doc;
|
||||
if (!doc.setContent(&file)) {
|
||||
qDebug() << "Failed to parse XML file.";
|
||||
file.close();
|
||||
return;
|
||||
}
|
||||
// 3. Close the file
|
||||
file.close();
|
||||
// 4. Get the root element
|
||||
QDomElement root = doc.documentElement();
|
||||
// 5. Get the child elements of the root
|
||||
QDomNodeList childNodes = root.childNodes();
|
||||
// 6. get the workspace path node
|
||||
QDomNodeList workspacePathNodes = root.elementsByTagName("WorkSpace");
|
||||
if (workspacePathNodes.count() > 0) {
|
||||
QDomElement workspacePathElement = workspacePathNodes.at(0).toElement();
|
||||
this->workSpacePath = workspacePathElement.text();
|
||||
}
|
||||
else {
|
||||
qDebug() << "WorkspacePath not found.";
|
||||
return;
|
||||
}
|
||||
// 7. get Root/AlgCompt/Inputs 下的所有Parameter子节点
|
||||
QDomNodeList InputsNodes = root.elementsByTagName("Inputs");
|
||||
QDomNodeList parameterNodes = InputsNodes.at(0).toElement().elementsByTagName("Parameter");
|
||||
if (parameterNodes.count() > 0) {
|
||||
for (int i = 0; i < parameterNodes.count(); ++i) {
|
||||
QDomElement parameterElement = parameterNodes.at(i).toElement();
|
||||
WBFZAlgComponetXmlParamenterItem* item = new WBFZAlgComponetXmlParamenterItem(¶meterElement,this);
|
||||
this->ParameterList.append(item);
|
||||
qDebug() << "read Parameter Name:" << item->getParaName();
|
||||
if (item->getParaName().isEmpty()) {
|
||||
QMessageBox::warning(nullptr, u8"警告", u8"参数名称为空,可能是xml文件格式错误");
|
||||
qDebug() << "read Parameter Name Error:" << item->getParaName();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug() << "Parameter not found.";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParaseOperator::displayParsedData()
|
||||
{
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParaseOperator::getWorkSpacePath() const
|
||||
{
|
||||
return this->workSpacePath;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParaseOperator::setWorkSpacePath(const QString& path)
|
||||
{
|
||||
this->workSpacePath = path;
|
||||
}
|
||||
|
||||
QList<WBFZAlgComponetXmlParamenterItem*> WBFZAlgComponetXmlParaseOperator::getParameterList() const
|
||||
{
|
||||
return ParameterList;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParaseOperator::setParameterList(const QList<WBFZAlgComponetXmlParamenterItem*>& list)
|
||||
{
|
||||
this->ParameterList = list;
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParamenterItem::getParaName() const
|
||||
{
|
||||
return this->ParaName;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParamenterItem::setParaName(const QString& name)
|
||||
{
|
||||
this->ParaName = name;
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParamenterItem::getParaChsName() const
|
||||
{
|
||||
return this->ParaChsName;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParamenterItem::setParaChsName(const QString& name)
|
||||
{
|
||||
this->ParaChsName = name;
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParamenterItem::getDescription() const
|
||||
{
|
||||
return this->Description;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParamenterItem::setDescription(const QString& description)
|
||||
{
|
||||
this->Description = description;
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParamenterItem::getDatatype() const
|
||||
{
|
||||
return this->Datatype;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParamenterItem::setDatatype(const QString& datatype)
|
||||
{
|
||||
this->Datatype = datatype;
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParamenterItem::getParaType() const
|
||||
{
|
||||
return this->ParaType;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParamenterItem::setParaType(const QString& type)
|
||||
{
|
||||
this->ParaType = type;
|
||||
}
|
||||
|
||||
QString WBFZAlgComponetXmlParamenterItem::getValueStr() const
|
||||
{
|
||||
return this->ValueStr;
|
||||
}
|
||||
|
||||
void WBFZAlgComponetXmlParamenterItem::setValueStr(const QString& value)
|
||||
{
|
||||
this->ValueStr = value;
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
#pragma once
|
||||
#ifndef __WBFZAlgComponetXmlParaseOperator_H__
|
||||
#define __WBFZAlgComponetXmlParaseOperator_H__
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
#include <QtXml>
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QDomDocument>
|
||||
#include <QDomElement>
|
||||
#include <QDomNode>
|
||||
#include <QDomNodeList>
|
||||
#include <QDomText>
|
||||
#include <QDomNamedNodeMap>
|
||||
#include <QDomAttr>
|
||||
#include <QDomEntity>
|
||||
#include <QDomEntityReference>
|
||||
#include "KJ135WBJYAlgWidgetComponet.h" // 算法组件参数界面组件类
|
||||
|
||||
|
||||
// 算法组件参数xml项
|
||||
class WBFZAlgComponetXmlParamenterItem :QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WBFZAlgComponetXmlParamenterItem(QDomElement* itemparameter,QObject* parent=nullptr);
|
||||
~WBFZAlgComponetXmlParamenterItem();
|
||||
private:
|
||||
QString ParaName; // 参数名称
|
||||
QString ParaChsName;// 参数中文名称
|
||||
QString Description;// 参数描述
|
||||
|
||||
QString Datatype;// 数据类型 Value // 决定参数的输入类型
|
||||
QString ParaType;// 参数类型 string
|
||||
|
||||
QString ValueStr;
|
||||
|
||||
public:
|
||||
// 变量操作 get、set 函数
|
||||
QString getParaName() const;
|
||||
void setParaName(const QString& name);
|
||||
QString getParaChsName() const;
|
||||
void setParaChsName(const QString& name);
|
||||
QString getDescription() const;
|
||||
void setDescription(const QString& description);
|
||||
QString getDatatype() const;
|
||||
void setDatatype(const QString& datatype);
|
||||
QString getParaType() const;
|
||||
void setParaType(const QString& type);
|
||||
QString getValueStr() const;
|
||||
void setValueStr(const QString& value);
|
||||
|
||||
};
|
||||
|
||||
// 算法组件xml参数解析主类
|
||||
class WBFZAlgComponetXmlParaseOperator :QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
WBFZAlgComponetXmlParaseOperator(QObject* parent = nullptr);
|
||||
~WBFZAlgComponetXmlParaseOperator();
|
||||
void loadXmlFile(const QString& fileName);
|
||||
|
||||
void writeXmlFile(const QString& formatfilepath, QString outfilepath,QString workspace, QMap<QString, QString> inputParamslist);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
void parseXmlFile();
|
||||
void displayParsedData();
|
||||
|
||||
private:
|
||||
QString workSpacePath;
|
||||
QString xmlFilePath;
|
||||
private:// 参数文件结构
|
||||
QDomDocument doc; // xml文档对象
|
||||
QDomElement rootElement; // 根节点
|
||||
QDomElement workSpaceElement; // 工作空间节点
|
||||
QList<WBFZAlgComponetXmlParamenterItem*> ParameterList; // 参数列表
|
||||
|
||||
public:
|
||||
QString getWorkSpacePath() const;// { return this->workSpacePath; } // 获取工作空间路径
|
||||
void setWorkSpacePath(const QString& path);// { this->workSpacePath = path; } // 设置工作空间路径
|
||||
QList<WBFZAlgComponetXmlParamenterItem*> getParameterList() const; // { return this->ParameterList; } // 获取参数列表
|
||||
void setParameterList(const QList<WBFZAlgComponetXmlParamenterItem*>& list); //{ this->ParameterList = list; } // 设置参数列表
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif// __WBFZAlgComponetXmlParaseOperator_H__
|
||||
|
|
@ -39,7 +39,7 @@ void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWi
|
|||
|
||||
#ifdef __SIMULATIONSARTOOL__SARSATALLITESIMULATIONWORKFLOW__H__
|
||||
|
||||
initSimulationSARToolSARSateSimulationWorkflow(toolbox);
|
||||
// initSimulationSARToolSARSateSimulationWorkflow(toolbox);
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@
|
|||
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||
</CudaCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>cufft.lib;%(AdditionalDependencies);cudart.lib;cudadevrt.lib</AdditionalDependencies>
|
||||
<AdditionalDependencies>cufft.lib;cudart.lib;cudadevrt.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
|
|
Loading…
Reference in New Issue