Merge pull request 'RTPC-dev 成像代码合并' (#7) from RTPC-dev into Release
Reviewed-on: http://123.153.4.249:22779/LAMPSARToolSoftware/RasterProcessTool/pulls/7Release
commit
cf988bea12
|
@ -377,3 +377,4 @@ FodyWeavers.xsd
|
|||
/script/landArr.bin.enp
|
||||
/script/landArr.hdr
|
||||
/script/.ipynb_checkpoints
|
||||
/LAMPDataProcessEXE
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!\n";
|
||||
std::cout << "Hello World!\n";
|
||||
}
|
||||
|
||||
// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -45,6 +53,12 @@
|
|||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
|
@ -52,6 +66,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
|
@ -66,9 +87,15 @@
|
|||
<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" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</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" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
|
@ -110,7 +137,38 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -47,6 +55,12 @@
|
|||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
|
@ -54,6 +68,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" Condition="Exists('$(QtMsBuild)\qt_defaults.props')" />
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
|
@ -65,11 +86,19 @@
|
|||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<QtModules>core;gui;widgets</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="QtSettings">
|
||||
<QtModules>core;gui;widgets</QtModules>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<QtModules>core;xml;sql;opengl;gui;svg;xmlpatterns;widgets;location;positioning;openglextensions;charts</QtModules>
|
||||
<QtPlugin>false</QtPlugin>
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtModules>core;xml;sql;opengl;gui;svg;xmlpatterns;widgets;location;positioning;openglextensions;charts</QtModules>
|
||||
<QtPlugin>false</QtPlugin>
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
</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>
|
||||
|
@ -88,16 +117,29 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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)'=='Release|x64'">
|
||||
<IncludePath>./BaseTool;$(IncludePath)</IncludePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>./BaseTool;$(IncludePath)</IncludePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
@ -150,6 +192,22 @@
|
|||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
@ -179,6 +237,35 @@
|
|||
<CodeGeneration>compute_82,sm_82</CodeGeneration>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;BASECOMMONLIBRARY_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;BASECONSTVARIABLE_API;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
<CodeGeneration>compute_82,sm_82</CodeGeneration>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="BaseTool\BaseConstVariable.h" />
|
||||
<ClInclude Include="BaseTool\BaseTool.h" />
|
||||
|
@ -211,8 +298,10 @@
|
|||
<ClCompile Include="dllmain.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ToolAbstract\QToolAbstract.cpp" />
|
||||
|
|
|
@ -66,6 +66,9 @@ inline char* get_cur_time() {
|
|||
#define EARTHWE 0.000072292115
|
||||
#define PI 3.141592653589793238462643383279
|
||||
|
||||
#define WGS84_A 6378137.0 // 长半轴 (m)
|
||||
#define WGS84_F (1.0/298.257223563)
|
||||
#define WGS84_B (WGS84_A*(1-WGS84_F)) // 短半轴 (m)
|
||||
|
||||
|
||||
#define earthRoute 0.000072292115
|
||||
|
@ -140,6 +143,10 @@ struct DemBox {
|
|||
double max_lat;
|
||||
};
|
||||
|
||||
struct Vector3 {
|
||||
double x, y, z;
|
||||
};
|
||||
|
||||
|
||||
/*********************************************** FEKO仿真参数 ********************************************************************/
|
||||
struct SatellitePos {
|
||||
|
@ -290,12 +297,18 @@ struct RadiationPatternGainPoint {
|
|||
|
||||
inline void delArrPtr(void* p)
|
||||
{
|
||||
if (nullptr == p || NULL == p) {
|
||||
return;
|
||||
}
|
||||
delete[] p;
|
||||
p = nullptr;
|
||||
}
|
||||
|
||||
inline void delPointer(void* p)
|
||||
{
|
||||
if (nullptr == p || NULL == p) {
|
||||
return;
|
||||
}
|
||||
delete p;
|
||||
p = nullptr;
|
||||
}
|
||||
|
@ -316,5 +329,11 @@ inline long getBlockRows(long sizeMB, long cols,long sizeMeta,long maxRows) {
|
|||
}
|
||||
|
||||
|
||||
inline long nextpow2(long n) {
|
||||
long en = ceil(log2(n));
|
||||
return pow(2,en);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -130,23 +130,68 @@ void initializeMatrixWithSSE2(Eigen::MatrixXd& mat, const double* data, long row
|
|||
void initializeMatrixWithSSE2(Eigen::MatrixXf& mat, const float* data, long rowcount, long colcount);
|
||||
|
||||
|
||||
|
||||
|
||||
/** 模板函数类 ***********************************************************************************************************/
|
||||
template<typename T>
|
||||
inline void BASECONSTVARIABLEAPI memsetInitArray(std::shared_ptr<T> ptr, long arrcount,T ti) {
|
||||
inline void memsetInitArray(std::shared_ptr<T> ptr, long arrcount,T ti) {
|
||||
for (long i = 0; i < arrcount; i++) {
|
||||
ptr.get()[i] = ti;
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void BASECONSTVARIABLEAPI memcpyArray(std::shared_ptr<T> srct, std::shared_ptr<T> dest, long arrcount) {
|
||||
inline void memcpyArray(std::shared_ptr<T> srct, std::shared_ptr<T> dest, long arrcount) {
|
||||
for (long i = 0; i < arrcount; i++) {
|
||||
dest.get()[i] = srct.get()[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void minValueInArr(T* ptr, long arrcount, T& minvalue) {
|
||||
|
||||
if (arrcount == 0)return;
|
||||
|
||||
minvalue = ptr[0];
|
||||
for (long i = 0; i < arrcount; i++) {
|
||||
if (minvalue > ptr[i]) {
|
||||
minvalue = ptr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void maxValueInArr(T* ptr, long arrcount, T& maxvalue) {
|
||||
|
||||
if (arrcount == 0)return;
|
||||
|
||||
maxvalue = ptr[0];
|
||||
for (long i = 0; i < arrcount; i++) {
|
||||
if (maxvalue < ptr[i]) {
|
||||
maxvalue = ptr[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** 常用SAR工具 ***********************************************************************************************************/
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline T complexAbs(std::complex<T> ccdata) {
|
||||
return T(sqrt(pow(ccdata.real(), 2) + pow(ccdata.imag(), 2)));
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void complex2dB(std::complex<T>* ccdata, T* outdata, long long count) {
|
||||
|
||||
for (long long i = 0; i < count; i++) {
|
||||
outdata[i] = 20 * log10(complexAbs(ccdata[i]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -251,6 +251,16 @@ QString EchoL0Dataset::getEchoDataFilename()
|
|||
return GPSPointFilePath;
|
||||
}
|
||||
|
||||
QString EchoL0Dataset::getGPSPointFilePath()
|
||||
{
|
||||
return this->GPSPointFilePath;
|
||||
}
|
||||
|
||||
QString EchoL0Dataset::getEchoDataFilePath()
|
||||
{
|
||||
return this->echoDataFilePath;
|
||||
}
|
||||
|
||||
void EchoL0Dataset::initEchoArr(std::complex<double> init0)
|
||||
{
|
||||
long blockline = Memory1MB / 8 / 2 / this->PlusePoints * 8000;
|
||||
|
@ -353,21 +363,21 @@ void EchoL0Dataset::setRefPhaseRange(double refRange)
|
|||
this->refPhaseRange = refRange;
|
||||
}
|
||||
|
||||
double EchoL0Dataset::setRefPhaseRange()
|
||||
double EchoL0Dataset::getRefPhaseRange()
|
||||
{
|
||||
return this->refPhaseRange;
|
||||
}
|
||||
|
||||
// 打印信息的实现
|
||||
void EchoL0Dataset::printInfo() {
|
||||
std::cout << "Simulation Task Name: " << this->simulationTaskName.toStdString() << std::endl;
|
||||
std::cout << "Pulse Count: " << this->PluseCount << std::endl;
|
||||
std::cout << "Pulse Points: " << this->PlusePoints << std::endl;
|
||||
std::cout << "Near Range: " << this->NearRange << std::endl;
|
||||
std::cout << "Far Range: " << this->FarRange << std::endl;
|
||||
std::cout << "Center Frequency: " << this->centerFreq << std::endl;
|
||||
std::cout << "Sampling Frequency: " << this->Fs << std::endl;
|
||||
std::cout << "Band width: " << this->bandwidth << std::endl;
|
||||
qDebug() << "Simulation Task Name: " << this->simulationTaskName ;
|
||||
qDebug() << "Pulse Count: " << this->PluseCount ;
|
||||
qDebug() << "Pulse Points: " << this->PlusePoints;
|
||||
qDebug() << "Near Range: " << this->NearRange ;
|
||||
qDebug() << "Far Range: " << this->FarRange;
|
||||
qDebug() << "Center Frequency: " << this->centerFreq ;
|
||||
qDebug() << "Sampling Frequency: " << this->Fs ;
|
||||
qDebug() << "Band width: " << this->bandwidth ;
|
||||
}
|
||||
|
||||
// xml文件读写
|
||||
|
@ -432,12 +442,10 @@ ErrorCode EchoL0Dataset::loadFromXml() {
|
|||
if (xmlReader.isStartElement()) {
|
||||
QString elementName = xmlReader.name().toString();
|
||||
if (elementName == "BandWidth") {
|
||||
this->bandwidth = xmlReader.readElementText().toLong();
|
||||
PluseCountflag = true;
|
||||
this->bandwidth = xmlReader.readElementText().toDouble();
|
||||
}
|
||||
else if (elementName == "PluseCount") {
|
||||
this->PluseCount = xmlReader.readElementText().toLong();
|
||||
PluseCountflag = true;
|
||||
}
|
||||
else if (elementName == "PlusePoints") {
|
||||
this->PlusePoints = xmlReader.readElementText().toLong();
|
||||
|
@ -533,7 +541,7 @@ std::shared_ptr<double> EchoL0Dataset::getAntPos()
|
|||
return temp;
|
||||
}
|
||||
|
||||
std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, long PRFLen)
|
||||
std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, long& PRFLen)
|
||||
{
|
||||
if (!(startPRF < this->PluseCount)) {
|
||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_PRFIDXOUTRANGE))<<startPRF<<" "<<this->PluseCount;
|
||||
|
@ -560,6 +568,9 @@ std::shared_ptr<std::complex<double>> EchoL0Dataset::getEchoArr(long startPRF, l
|
|||
long width = rasterDataset->GetRasterXSize();
|
||||
long height = rasterDataset->GetRasterYSize();
|
||||
long band_num = rasterDataset->GetRasterCount();
|
||||
|
||||
PRFLen = (PRFLen + startPRF) < height ? PRFLen : height - startPRF;
|
||||
|
||||
std::shared_ptr<std::complex<double>> temp = nullptr;
|
||||
if (height != this->PluseCount || width != this->PlusePoints) {
|
||||
qDebug() << QString::fromStdString(errorCode2errInfo(ErrorCode::ECHO_L0DATA_ECHOFILEFORMATERROR));
|
||||
|
@ -631,8 +642,6 @@ ErrorCode EchoL0Dataset::saveEchoArr(std::shared_ptr<std::complex<double>> echoP
|
|||
GDALAllRegister();
|
||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
||||
GDALDataset* rasterDataset = (GDALDataset*)(GDALOpen(this->echoDataFilePath.toUtf8().constData(), GDALAccess::GA_Update));
|
||||
|
||||
|
||||
|
||||
GDALDataType gdal_datatype = rasterDataset->GetRasterBand(1)->GetRasterDataType();
|
||||
GDALRasterBand* poBand = rasterDataset->GetRasterBand(1);
|
||||
|
@ -669,4 +678,69 @@ ErrorCode EchoL0Dataset::saveEchoArr(std::shared_ptr<std::complex<double>> echoP
|
|||
omp_destroy_lock(&lock); //
|
||||
return ErrorCode::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<SatelliteAntPos> SatelliteAntPosOperator::readAntPosFile(QString filepath, long& count)
|
||||
{
|
||||
gdalImage antimg(filepath);
|
||||
long rowcount = count;
|
||||
long colcount = 19;
|
||||
std::shared_ptr<double> antlist = readDataArr<double>(antimg, 0, 0, rowcount, colcount, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<SatelliteAntPos> antpos(new SatelliteAntPos[rowcount], delArrPtr);
|
||||
for (long i = 0; i < rowcount; i++) {
|
||||
antpos.get()[i].time = antlist.get()[i * 19 + 0];
|
||||
antpos.get()[i].Px = antlist.get()[i * 19 + 1];
|
||||
antpos.get()[i].Py = antlist.get()[i * 19 + 2];
|
||||
antpos.get()[i].Pz = antlist.get()[i * 19 + 3];
|
||||
antpos.get()[i].Vx = antlist.get()[i * 19 + 4];
|
||||
antpos.get()[i].Vy = antlist.get()[i * 19 + 5];
|
||||
antpos.get()[i].Vz = antlist.get()[i * 19 + 6]; //7
|
||||
antpos.get()[i].AntDirectX = antlist.get()[i * 19 + 7];
|
||||
antpos.get()[i].AntDirectY = antlist.get()[i * 19 + 8];
|
||||
antpos.get()[i].AntDirectZ = antlist.get()[i * 19 + 9];
|
||||
antpos.get()[i].AVx = antlist.get()[i * 19 + 10];
|
||||
antpos.get()[i].AVy = antlist.get()[i * 19 + 11];
|
||||
antpos.get()[i].AVz = antlist.get()[i * 19 + 12];
|
||||
antpos.get()[i].ZeroAntDiectX = antlist.get()[i * 19 + 13];
|
||||
antpos.get()[i].ZeroAntDiectY = antlist.get()[i * 19 + 14];
|
||||
antpos.get()[i].ZeroAntDiectZ = antlist.get()[i * 19 + 15];
|
||||
antpos.get()[i].lon = antlist.get()[i * 19 + 16];
|
||||
antpos.get()[i].lat = antlist.get()[i * 19 + 17];
|
||||
antpos.get()[i].ati = antlist.get()[i * 19 + 18]; // 19
|
||||
}
|
||||
return antpos;
|
||||
}
|
||||
|
||||
void SatelliteAntPosOperator::writeAntPosFile(QString filepath, std::shared_ptr<SatelliteAntPos> data, const long count)
|
||||
{
|
||||
gdalImage antimg=CreategdalImageDouble(filepath,count,19,1,true,true);
|
||||
long rowcount = count;
|
||||
long colcount = 19;
|
||||
std::shared_ptr<double> antpos(new double[rowcount*19], delArrPtr);
|
||||
for (long i = 0; i < colcount; i++) {
|
||||
antpos.get()[i * 19 + 1] = data.get()[i].time;
|
||||
antpos.get()[i * 19 + 2] = data.get()[i].Px;
|
||||
antpos.get()[i * 19 + 3] = data.get()[i].Py;
|
||||
antpos.get()[i * 19 + 4] = data.get()[i].Pz;
|
||||
antpos.get()[i * 19 + 5] = data.get()[i].Vx;
|
||||
antpos.get()[i * 19 + 6] = data.get()[i].Vy;
|
||||
antpos.get()[i * 19 + 7] = data.get()[i].Vz;
|
||||
antpos.get()[i * 19 + 8] = data.get()[i].AntDirectX;
|
||||
antpos.get()[i * 19 + 9] = data.get()[i].AntDirectY;
|
||||
antpos.get()[i * 19 + 10] = data.get()[i].AntDirectZ;
|
||||
antpos.get()[i * 19 + 11] = data.get()[i].AVx;
|
||||
antpos.get()[i * 19 + 12] = data.get()[i].AVy;
|
||||
antpos.get()[i * 19 + 13] = data.get()[i].AVz;
|
||||
antpos.get()[i * 19 + 14] = data.get()[i].ZeroAntDiectX;
|
||||
antpos.get()[i * 19 + 15] = data.get()[i].ZeroAntDiectY;
|
||||
antpos.get()[i * 19 + 16] = data.get()[i].ZeroAntDiectZ;
|
||||
antpos.get()[i * 19 + 17] = data.get()[i].lon;
|
||||
antpos.get()[i * 19 + 18] = data.get()[i].lat;
|
||||
antpos.get()[i * 19 + 19] = data.get()[i].ati;
|
||||
}
|
||||
antimg.saveImage(antpos, 0,0,rowcount, colcount, 1);
|
||||
|
||||
return ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -92,6 +92,31 @@ struct PluseAntPos {
|
|||
std::shared_ptr<PluseAntPos> BASECONSTVARIABLEAPI CreatePluseAntPosArr(long pluseCount);
|
||||
|
||||
|
||||
class BASECONSTVARIABLEAPI SatelliteAntPosOperator {
|
||||
public:
|
||||
static std::shared_ptr<SatelliteAntPos> readAntPosFile(QString filepath,long& count);
|
||||
static void writeAntPosFile(QString filepath, std::shared_ptr< SatelliteAntPos> data,const long count);
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 定义L0级数据
|
||||
class BASECONSTVARIABLEAPI EchoL0Dataset {
|
||||
|
||||
|
@ -107,7 +132,8 @@ public:
|
|||
QString getxmlName();
|
||||
QString getGPSPointFilename();
|
||||
QString getEchoDataFilename();
|
||||
|
||||
QString getGPSPointFilePath();
|
||||
QString getEchoDataFilePath();
|
||||
void initEchoArr(std::complex<double> init0);
|
||||
|
||||
|
||||
|
@ -159,7 +185,7 @@ public: //
|
|||
SatelliteAntPos getSatelliteAntPos(long plusePRFID);
|
||||
|
||||
void setRefPhaseRange(double refRange);
|
||||
double setRefPhaseRange();
|
||||
double getRefPhaseRange();
|
||||
// 打印信息的成员函数
|
||||
void printInfo() ;
|
||||
|
||||
|
@ -184,7 +210,7 @@ public: //
|
|||
public:
|
||||
// 读取文件
|
||||
std::shared_ptr<double> getAntPos();
|
||||
std::shared_ptr<std::complex<double>> getEchoArr(long startPRF, long PRFLen);
|
||||
std::shared_ptr<std::complex<double>> getEchoArr(long startPRF, long& PRFLen);
|
||||
std::shared_ptr<std::complex<double>> getEchoArr();
|
||||
//保存文件
|
||||
ErrorCode saveAntPos(std::shared_ptr<double> ptr); // 注意这个方法很危险,请写入前检查数据是否正确
|
||||
|
|
|
@ -385,7 +385,7 @@ CartesianCoordinates sphericalToCartesian(const SphericalCoordinates& spherica
|
|||
double getlocalIncAngle(Landpoint& satepoint, Landpoint& landpoint, Landpoint& slopeVector) {
|
||||
Landpoint Rsc = satepoint - landpoint; // AB=B-A
|
||||
//double R = getlength(Rsc);
|
||||
//std::cout << R << endl;
|
||||
//qDebug() << R << endl;
|
||||
double angle = getAngle(Rsc, slopeVector);
|
||||
if (angle >= 180) {
|
||||
return 360 - angle;
|
||||
|
@ -399,7 +399,7 @@ double getlocalIncAngle(Landpoint& satepoint, Landpoint& landpoint, Landpoint& s
|
|||
double getlocalIncAngle(Vector3D& satepoint, Vector3D& landpoint, Vector3D& slopeVector){
|
||||
Vector3D Rsc = satepoint - landpoint; // AB=B-A
|
||||
//double R = getlength(Rsc);
|
||||
//std::cout << R << endl;
|
||||
//qDebug() << R << endl;
|
||||
double angle = getAngle(Rsc, slopeVector);
|
||||
if (angle >= 180) {
|
||||
return 360 - angle;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -27,6 +27,7 @@
|
|||
#include "LogInfoCls.h"
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <functional>
|
||||
|
||||
enum ProjectStripDelta {
|
||||
Strip_6, // 6度带
|
||||
|
@ -227,7 +228,11 @@ public: // 方法
|
|||
~gdalImageComplex();
|
||||
void setData(Eigen::MatrixXcd);
|
||||
void saveImage(Eigen::MatrixXcd data, int start_row, int start_col, int band_ids);
|
||||
void saveImage(std::shared_ptr<std::complex<double>> data, long start_row, long start_col, long rowCount, long colCount, int band_ids);
|
||||
void saveImage(std::complex<double>* data, long start_row, long start_col, long rowcount, long colcount, int banids);
|
||||
|
||||
Eigen::MatrixXcd getDataComplex(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
||||
std::shared_ptr<std::complex<double>> getDataComplexSharePtr(int start_row, int start_col, int rows_count, int cols_count, int band_ids);
|
||||
|
||||
void saveImage() override;
|
||||
void savePreViewImage();
|
||||
|
@ -236,12 +241,14 @@ public:
|
|||
};
|
||||
|
||||
// 创建影像
|
||||
gdalImage BASECONSTVARIABLEAPI CreategdalImageDouble(QString& img_path, int height, int width, int band_num, bool overwrite = false, bool isEnvi = false);
|
||||
gdalImage BASECONSTVARIABLEAPI CreategdalImageDouble(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection, bool need_gt = true, bool overwrite = false, bool isEnvi = false);
|
||||
gdalImage BASECONSTVARIABLEAPI CreategdalImage(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection, bool need_gt = true, bool overwrite = false, bool isEnvi = false);
|
||||
gdalImage BASECONSTVARIABLEAPI CreategdalImage(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection,bool need_gt = true, bool overwrite = false, bool isEnvi = false, GDALDataType datetype = GDT_Float32);
|
||||
|
||||
gdalImage BASECONSTVARIABLEAPI CreategdalImage(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, long espgcode, GDALDataType eType = GDT_Float32, bool need_gt = true, bool overwrite = false, bool isENVI = false);
|
||||
|
||||
gdalImageComplex BASECONSTVARIABLEAPI CreategdalImageComplex(const QString& img_path, int height, int width, int band_num, Eigen::MatrixXd gt, QString projection, bool need_gt = true, bool overwrite = false);
|
||||
gdalImageComplex BASECONSTVARIABLEAPI CreategdalImageComplexNoProj(const QString& img_path, int height, int width, int band_num, bool overwrite = true);
|
||||
|
||||
gdalImageComplex BASECONSTVARIABLEAPI CreateEchoComplex(const QString& img_path, int height, int width, int band_num);
|
||||
|
||||
|
@ -261,6 +268,9 @@ ErrorCode BASECONSTVARIABLEAPI transformCoordinate(double x, double y, int sou
|
|||
|
||||
int BASECONSTVARIABLEAPI alignRaster(QString inputPath, QString referencePath, QString outputPath, GDALResampleAlg eResample);
|
||||
|
||||
|
||||
void BASECONSTVARIABLEAPI ResampleByReferenceRasterB(QString pszSrcFile, QString RefrasterBPath, QString pszOutFile, GDALResampleAlg eResample);
|
||||
|
||||
//--------------------- 保存文博 -------------------------------
|
||||
|
||||
int BASECONSTVARIABLEAPI saveMatrixXcd2TiFF(Eigen::MatrixXcd data, QString out_tiff_path);
|
||||
|
@ -270,7 +280,7 @@ int BASECONSTVARIABLEAPI saveMatrixXcd2TiFF(Eigen::MatrixXcd data, QString o
|
|||
void BASECONSTVARIABLEAPI clipRaster(QString inRasterPath, QString outRasterPath, long minRow, long maxRow, long minCol, long maxCol);
|
||||
|
||||
// 坐标系转换
|
||||
bool BASECONSTVARIABLEAPI ConvertCoordinateSystem(QString inRasterPath, QString outRasterPath, long outepsgcode);
|
||||
void BASECONSTVARIABLEAPI ConvertCoordinateSystem(QString inRasterPath, QString outRasterPath, long outepsgcode);
|
||||
|
||||
//--------------------- 图像合并流程 ------------------------------
|
||||
enum MERGEMODE
|
||||
|
@ -294,11 +304,15 @@ bool BASECONSTVARIABLEAPI saveEigenMatrixXd2Bin(Eigen::MatrixXd data, QString
|
|||
void BASECONSTVARIABLEAPI testOutAntPatternTrans(QString antpatternfilename, double* antPatternArr, double starttheta, double deltetheta, double startphi, double deltaphi, long thetanum, long phinum);
|
||||
void BASECONSTVARIABLEAPI testOutAmpArr(QString filename, float* amp, long rowcount, long colcount);
|
||||
void BASECONSTVARIABLEAPI testOutAmpArr(QString filename, double* amp, long rowcount, long colcount);
|
||||
|
||||
void BASECONSTVARIABLEAPI testOutClsArr(QString filename, long* amp, long rowcount, long colcount);
|
||||
|
||||
void BASECONSTVARIABLEAPI testOutClsArr(QString filename, long* amp, long rowcount, long colcount);
|
||||
void BASECONSTVARIABLEAPI testOutComplexDoubleArr(QString filename, std::complex<double>* data, long rowcount, long colcount);
|
||||
void BASECONSTVARIABLEAPI testOutDataArr(QString filename, double* data, long rowcount, long colcount);
|
||||
void BASECONSTVARIABLEAPI testOutDataArr(QString filename, float* data, long rowcount, long colcount);
|
||||
void BASECONSTVARIABLEAPI testOutDataArr(QString filename, long* data, long rowcount, long colcount);
|
||||
|
||||
|
||||
|
||||
void BASECONSTVARIABLEAPI CreateSARIntensityByLookTable(QString IntensityRasterPath, QString LookTableRasterPath, QString SARIntensityPath, long min_rid, long max_rid, long min_cid, long max_cid, std::function<void(long, long)> processBarShow = {});
|
||||
|
||||
|
||||
//--------------------- 图像文件读写 ------------------------------
|
||||
|
@ -497,7 +511,7 @@ inline std::shared_ptr<T> readDataArr(gdalImage& imgds, long start_row, long sta
|
|||
GDALClose((GDALDatasetH)rasterDataset);
|
||||
omp_unset_lock(&lock); // 锟酵放伙拷斤拷
|
||||
omp_destroy_lock(&lock); // 劫伙拷斤拷
|
||||
// GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -570,7 +584,7 @@ inline std::shared_ptr<T> readDataArrComplex(gdalImageComplex& imgds, long start
|
|||
GDALClose((GDALDatasetH)rasterDataset);
|
||||
omp_unset_lock(&lock); // 锟酵放伙拷斤拷
|
||||
omp_destroy_lock(&lock); // 劫伙拷斤拷
|
||||
// GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
||||
GDALDestroy(); // or, DllMain at DLL_PROCESS_DETACH
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -6,8 +6,31 @@ BASECONSTVARIABLEAPI void PrintMsgToQDebug(char* msg)
|
|||
return ;
|
||||
}
|
||||
|
||||
BASECONSTVARIABLEAPI void PrintfToQDebug(const char* msg)
|
||||
{
|
||||
qDebug() << QString(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
BASECONSTVARIABLEAPI void PrintTipMsgToQDebug(const char* tip, const char* msg)
|
||||
{
|
||||
qDebug() <<QString(tip)<<"\t:\t" << QString(msg);
|
||||
return;
|
||||
}
|
||||
// 自定义的 printf 风格函数
|
||||
BASECONSTVARIABLEAPI void printfinfo(const char* format, ...) {
|
||||
char buffer[256]; // 假设最大输出长度为 256 字节
|
||||
va_list args;
|
||||
|
||||
// 使用 va_start 获取可变参数列表
|
||||
va_start(args, format);
|
||||
|
||||
// 使用 vsnprintf 将格式化字符串写入 buffer
|
||||
vsnprintf(buffer, sizeof(buffer), format, args);
|
||||
|
||||
// 结束可变参数列表的使用
|
||||
va_end(args);
|
||||
|
||||
// 将格式化后的字符串转发给 PrintfToQDebug
|
||||
PrintfToQDebug(buffer);
|
||||
}
|
|
@ -2,9 +2,11 @@
|
|||
#ifndef PRINTMSGTOQDEBUG_H_
|
||||
#define PRINTMSGTOQDEBUG_H_
|
||||
#include "BaseConstVariable.h"
|
||||
|
||||
#include <format>
|
||||
extern "C" BASECONSTVARIABLEAPI void PrintMsgToQDebug(char* msg);
|
||||
extern "C" BASECONSTVARIABLEAPI void PrintfToQDebug(const char* msg);
|
||||
extern "C" BASECONSTVARIABLEAPI void PrintTipMsgToQDebug(const char* tip, const char* msg);
|
||||
extern "C" BASECONSTVARIABLEAPI void printfinfo(const char* format, ...);
|
||||
#endif // !PRINTMSGTOQDEBUG_H_
|
||||
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace RasterToolBase {
|
|||
|
||||
GDALAllRegister();
|
||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES"); // 注册GDAL驱动
|
||||
// std::cout<<filepath.toLocal8Bit().constData()<<std::endl;
|
||||
// qDebug()<<filepath.toLocal8Bit().constData()<<std::endl;
|
||||
// 打开影像文件
|
||||
GDALDataset* poDataset;
|
||||
poDataset = (GDALDataset*)GDALOpen(filepath.toUtf8().data(), GA_ReadOnly);
|
||||
|
@ -176,7 +176,7 @@ namespace RasterToolBase {
|
|||
GDALAllRegister();
|
||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
||||
CPLSetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
|
||||
// std::cout<<filepath.toLocal8Bit().constData()<<std::endl;
|
||||
// qDebug()<<filepath.toLocal8Bit().constData()<<std::endl;
|
||||
GDALDataset* poDataset = (GDALDataset*)GDALOpen(filepath.toUtf8().data(), GA_ReadOnly);
|
||||
if(nullptr==poDataset||NULL==poDataset) {
|
||||
qDebug() << "Could not open dataset";
|
||||
|
|
|
@ -955,6 +955,15 @@ void SARSimulationImageL1Dataset::setLatitudeBottomRight(double value) { latitud
|
|||
double SARSimulationImageL1Dataset::getLongitudeBottomRight() { return longitude_bottomRight; }
|
||||
void SARSimulationImageL1Dataset::setLongitudeBottomRight(double value) { longitude_bottomRight = value; }
|
||||
|
||||
double SARSimulationImageL1Dataset::getdrange() { return this->dr; }
|
||||
void SARSimulationImageL1Dataset::setdrange(double idr) { this->dr = idr; }
|
||||
|
||||
double SARSimulationImageL1Dataset::getdAz() { return this->dAz; }
|
||||
void SARSimulationImageL1Dataset::setdAz(double idAz) { this->dAz = idAz; }
|
||||
|
||||
|
||||
|
||||
|
||||
DemBox SARSimulationImageL1Dataset::getExtend()
|
||||
{
|
||||
double minlon = 0, maxlon = 0;
|
||||
|
|
|
@ -195,5 +195,16 @@ public:
|
|||
void setLongitudeBottomRight(double value);
|
||||
public:
|
||||
DemBox getExtend();
|
||||
|
||||
|
||||
public:
|
||||
double getdrange();
|
||||
void setdrange(double dr);
|
||||
|
||||
double getdAz();
|
||||
void setdAz(double dAz);
|
||||
private:
|
||||
double dr, dAz;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.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>9233788c-bd43-41aa-b157-d77e92616d00</ProjectGuid>
|
||||
<RootNamespace>GPUBPSimulation</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.props" />
|
||||
</ImportGroup>
|
||||
<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" />
|
||||
</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" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalDependencies>cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalDependencies>cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<TargetMachinePlatform>64</TargetMachinePlatform>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<CudaCompile Include="kernel.cu" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.targets" />
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,121 @@
|
|||
|
||||
#include "cuda_runtime.h"
|
||||
#include "device_launch_parameters.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size);
|
||||
|
||||
__global__ void addKernel(int *c, const int *a, const int *b)
|
||||
{
|
||||
int i = threadIdx.x;
|
||||
c[i] = a[i] + b[i];
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
const int arraySize = 5;
|
||||
const int a[arraySize] = { 1, 2, 3, 4, 5 };
|
||||
const int b[arraySize] = { 10, 20, 30, 40, 50 };
|
||||
int c[arraySize] = { 0 };
|
||||
|
||||
// Add vectors in parallel.
|
||||
cudaError_t cudaStatus = addWithCuda(c, a, b, arraySize);
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "addWithCuda failed!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
printf("{1,2,3,4,5} + {10,20,30,40,50} = {%d,%d,%d,%d,%d}\n",
|
||||
c[0], c[1], c[2], c[3], c[4]);
|
||||
|
||||
// cudaDeviceReset must be called before exiting in order for profiling and
|
||||
// tracing tools such as Nsight and Visual Profiler to show complete traces.
|
||||
cudaStatus = cudaDeviceReset();
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaDeviceReset failed!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Helper function for using CUDA to add vectors in parallel.
|
||||
cudaError_t addWithCuda(int *c, const int *a, const int *b, unsigned int size)
|
||||
{
|
||||
int *dev_a = 0;
|
||||
int *dev_b = 0;
|
||||
int *dev_c = 0;
|
||||
cudaError_t cudaStatus;
|
||||
|
||||
// Choose which GPU to run on, change this on a multi-GPU system.
|
||||
cudaStatus = cudaSetDevice(0);
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaSetDevice failed! Do you have a CUDA-capable GPU installed?");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
// Allocate GPU buffers for three vectors (two input, one output) .
|
||||
cudaStatus = cudaMalloc((void**)&dev_c, size * sizeof(int));
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaMalloc failed!");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
cudaStatus = cudaMalloc((void**)&dev_a, size * sizeof(int));
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaMalloc failed!");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
cudaStatus = cudaMalloc((void**)&dev_b, size * sizeof(int));
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaMalloc failed!");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
// Copy input vectors from host memory to GPU buffers.
|
||||
cudaStatus = cudaMemcpy(dev_a, a, size * sizeof(int), cudaMemcpyHostToDevice);
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaMemcpy failed!");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
cudaStatus = cudaMemcpy(dev_b, b, size * sizeof(int), cudaMemcpyHostToDevice);
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaMemcpy failed!");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
// Launch a kernel on the GPU with one thread for each element.
|
||||
addKernel<<<1, size>>>(dev_c, dev_a, dev_b);
|
||||
|
||||
// Check for any errors launching the kernel
|
||||
cudaStatus = cudaGetLastError();
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "addKernel launch failed: %s\n", cudaGetErrorString(cudaStatus));
|
||||
goto Error;
|
||||
}
|
||||
|
||||
// cudaDeviceSynchronize waits for the kernel to finish, and returns
|
||||
// any errors encountered during the launch.
|
||||
cudaStatus = cudaDeviceSynchronize();
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaDeviceSynchronize returned error code %d after launching addKernel!\n", cudaStatus);
|
||||
goto Error;
|
||||
}
|
||||
|
||||
// Copy output vector from GPU buffer to host memory.
|
||||
cudaStatus = cudaMemcpy(c, dev_c, size * sizeof(int), cudaMemcpyDeviceToHost);
|
||||
if (cudaStatus != cudaSuccess) {
|
||||
fprintf(stderr, "cudaMemcpy failed!");
|
||||
goto Error;
|
||||
}
|
||||
|
||||
Error:
|
||||
cudaFree(dev_c);
|
||||
cudaFree(dev_a);
|
||||
cudaFree(dev_b);
|
||||
|
||||
return cudaStatus;
|
||||
}
|
|
@ -1,10 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
|
@ -57,6 +65,12 @@
|
|||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
|
@ -64,6 +78,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
<Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 12.6.props" />
|
||||
|
@ -79,15 +100,26 @@
|
|||
<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" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</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" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<IncludePath>..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary\ToolAbstract;.;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary\ToolAbstract;.;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
@ -128,7 +160,42 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;GPUBASELIB_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<AdditionalDependencies>cufft.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
#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>
|
||||
|
@ -17,13 +20,21 @@
|
|||
#define BLOCK_DIM 1024
|
||||
#define REDUCE_SCALE 4
|
||||
|
||||
// CUDA核函数用于缩放数据
|
||||
__global__ void scaleKernel(cuComplex* data, int size, float scale) {
|
||||
int idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
if (idx < size) {
|
||||
data[idx].x *= scale;
|
||||
data[idx].y *= scale;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 打印GPU参数
|
||||
void printDeviceInfo(int deviceId) {
|
||||
cudaDeviceProp deviceProp;
|
||||
cudaGetDeviceProperties(&deviceProp, deviceId);
|
||||
|
||||
|
||||
std::cout << "Device " << deviceId << ": " << deviceProp.name << std::endl;
|
||||
std::cout << " Compute Capability: " << deviceProp.major << "." << deviceProp.minor << std::endl;
|
||||
std::cout << " Total Global Memory: " << deviceProp.totalGlobalMem / (1024 * 1024) << " MB" << std::endl;
|
||||
|
@ -35,12 +46,12 @@ void printDeviceInfo(int deviceId) {
|
|||
<< deviceProp.maxThreadsDim[1] << ", " << deviceProp.maxThreadsDim[2] << ")" << std::endl;
|
||||
std::cout << " Max Grid Size: (" << deviceProp.maxGridSize[0] << ", "
|
||||
<< deviceProp.maxGridSize[1] << ", " << deviceProp.maxGridSize[2] << ")" << std::endl;
|
||||
std::cout << " Multiprocessor Count: " << deviceProp.multiProcessorCount << std::endl;
|
||||
std::cout << " Clock Rate: " << deviceProp.clockRate / 1000 << " MHz" << std::endl;
|
||||
std::cout << " Memory Clock Rate: " << deviceProp.memoryClockRate / 1000 << " MHz" << std::endl;
|
||||
std::cout << " Memory Bus Width: " << deviceProp.memoryBusWidth << " bits" << std::endl;
|
||||
std::cout << " L2 Cache Size: " << deviceProp.l2CacheSize / 1024 << " KB" << std::endl;
|
||||
std::cout << " Max Texture Dimensions: (" << deviceProp.maxTexture1D << ", "
|
||||
std::cout << " Multiprocessor Count: " << deviceProp.multiProcessorCount << std::endl;
|
||||
std::cout << " Clock Rate: " << deviceProp.clockRate / 1000 << " MHz" << std::endl;
|
||||
std::cout << " Memory Clock Rate: " << deviceProp.memoryClockRate / 1000 << " MHz" << std::endl;
|
||||
std::cout << " Memory Bus Width: " << deviceProp.memoryBusWidth << " bits" << std::endl;
|
||||
std::cout << " L2 Cache Size: " << deviceProp.l2CacheSize / 1024 << " KB" << std::endl;
|
||||
std::cout << " Max Texture Dimensions: (" << deviceProp.maxTexture1D << ", "
|
||||
<< deviceProp.maxTexture2D[0] << "x" << deviceProp.maxTexture2D[1] << ", "
|
||||
<< deviceProp.maxTexture3D[0] << "x" << deviceProp.maxTexture3D[1] << "x" << deviceProp.maxTexture3D[2] << ")" << std::endl;
|
||||
std::cout << " Unified Addressing: " << (deviceProp.unifiedAddressing ? "Yes" : "No") << std::endl;
|
||||
|
@ -202,6 +213,70 @@ __global__ void CUDA_GridPoint_Linear_Interp1(float* v, float* q, float* qv, lon
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 一维FFTShift核函数
|
||||
__global__ void fftshift_1d_kernel(cuComplex* data, int batch_size, int signal_length) {
|
||||
int idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
|
||||
if (idx >= batch_size * signal_length) return;
|
||||
int batch_id = idx / signal_length;
|
||||
int signal_id = idx % signal_length;
|
||||
|
||||
int half = (signal_length + 1) / 2; // 兼容奇偶长度
|
||||
if (signal_id >= half) return;
|
||||
|
||||
int new_pos = (signal_id + half) % signal_length;
|
||||
int src_idx = batch_id * signal_length + new_pos;
|
||||
// 数据交换
|
||||
|
||||
cuComplex temp = data[idx];
|
||||
data[idx] = data[src_idx];
|
||||
data[src_idx] = temp;
|
||||
|
||||
}
|
||||
|
||||
// 批量一维FFTShift函数
|
||||
extern "C" void FFTShift1D(cuComplex* d_data, int batch_size, int signal_length) {
|
||||
if (signal_length <= 1) return; // 无需处理
|
||||
|
||||
// 启动核函数
|
||||
int total_elements = batch_size * signal_length;
|
||||
int threads_per_block = 256;
|
||||
int blocks_per_grid = (total_elements + threads_per_block - 1) / threads_per_block;
|
||||
|
||||
fftshift_1d_kernel << <blocks_per_grid, threads_per_block >> > (d_data, batch_size, signal_length);
|
||||
|
||||
// 错误检查
|
||||
PrintLasterError("FFTShift1D");
|
||||
cudaDeviceSynchronize();
|
||||
}
|
||||
|
||||
extern "C" void shared_complexPtrToHostCuComplex(std::complex<double>* src, cuComplex* dst, size_t len)
|
||||
{
|
||||
for (long i = 0; i < len; i++) {
|
||||
dst[i] = make_cuComplex(src[i].real(), src[i].imag());
|
||||
}
|
||||
return ;
|
||||
}
|
||||
|
||||
extern "C" void HostCuComplexToshared_complexPtr( cuComplex* src, std::complex<double>* dst, size_t len)
|
||||
{
|
||||
double maxvalue = src[0].x;
|
||||
for (long i = 0; i < len; i++) {
|
||||
dst[i] = std::complex<double>(src[i].x, src[i].y);
|
||||
if (maxvalue < src[i].x) {
|
||||
maxvalue = src[i].x;
|
||||
}
|
||||
if (maxvalue < src[i].y) {
|
||||
maxvalue = src[i].y;
|
||||
}
|
||||
}
|
||||
printf("max value %e\n", maxvalue);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
extern __global__ void CUDA_D_sin(double* y, double* X, int n) {
|
||||
int idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
if (idx < n) {
|
||||
|
@ -243,14 +318,14 @@ extern "C" void checkCudaError(cudaError_t err, const char* msg) {
|
|||
}
|
||||
|
||||
// 主机参数内存声明
|
||||
extern "C" void* mallocCUDAHost(long memsize) {
|
||||
extern "C" void* mallocCUDAHost(size_t memsize) {
|
||||
void* ptr;
|
||||
cudaMallocHost(&ptr, memsize);
|
||||
|
||||
#ifdef __CUDADEBUG__
|
||||
cudaError_t err = cudaGetLastError();
|
||||
if (err != cudaSuccess) {
|
||||
printf("mallocCUDAHost CUDA Error: %s\n", cudaGetErrorString(err));
|
||||
printf("mallocCUDAHost CUDA Error: %s, malloc memory : %d byte\n", cudaGetErrorString(err),memsize);
|
||||
exit(2);
|
||||
}
|
||||
#endif // __CUDADEBUG__
|
||||
|
@ -260,25 +335,32 @@ extern "C" void* mallocCUDAHost(long memsize) {
|
|||
|
||||
// 主机参数内存释放
|
||||
extern "C" void FreeCUDAHost(void* ptr) {
|
||||
|
||||
if (nullptr == ptr||NULL==ptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
cudaFreeHost(ptr);
|
||||
#ifdef __CUDADEBUG__
|
||||
cudaError_t err = cudaGetLastError();
|
||||
if (err != cudaSuccess) {
|
||||
printf("FreeCUDAHost CUDA Error: %s\n", cudaGetErrorString(err));
|
||||
printf("FreeCUDAHost CUDA Error: %s,\n", cudaGetErrorString(err));
|
||||
exit(2);
|
||||
}
|
||||
#endif // __CUDADEBUG__
|
||||
cudaDeviceSynchronize();
|
||||
|
||||
ptr = nullptr;
|
||||
}
|
||||
|
||||
// GPU参数内存声明
|
||||
extern "C" void* mallocCUDADevice(long memsize) {
|
||||
extern "C" void* mallocCUDADevice(size_t memsize) {
|
||||
void* ptr;
|
||||
cudaMalloc(&ptr, memsize);
|
||||
#ifdef __CUDADEBUG__
|
||||
cudaError_t err = cudaGetLastError();
|
||||
if (err != cudaSuccess) {
|
||||
printf("mallocCUDADevice CUDA Error: %s\n", cudaGetErrorString(err));
|
||||
printf("mallocCUDADevice CUDA Error: %s, malloc memory : %d byte\n", cudaGetErrorString(err), memsize);
|
||||
exit(2);
|
||||
}
|
||||
#endif // __CUDADEBUG__
|
||||
|
@ -288,6 +370,9 @@ extern "C" void* mallocCUDADevice(long memsize) {
|
|||
|
||||
// GPU参数内存释放
|
||||
extern "C" void FreeCUDADevice(void* ptr) {
|
||||
if (nullptr == ptr || NULL == ptr) {
|
||||
return;
|
||||
}
|
||||
cudaFree(ptr);
|
||||
#ifdef __CUDADEBUG__
|
||||
cudaError_t err = cudaGetLastError();
|
||||
|
@ -297,10 +382,11 @@ extern "C" void FreeCUDADevice(void* ptr) {
|
|||
}
|
||||
#endif // __CUDADEBUG__
|
||||
cudaDeviceSynchronize();
|
||||
ptr = nullptr;
|
||||
}
|
||||
|
||||
// GPU 内存数据转移
|
||||
extern "C" void HostToDevice(void* hostptr, void* deviceptr, long memsize) {
|
||||
extern "C" void HostToDevice(void* hostptr, void* deviceptr, size_t memsize) {
|
||||
cudaMemcpy(deviceptr, hostptr, memsize, cudaMemcpyHostToDevice);
|
||||
|
||||
#ifdef __CUDADEBUG__
|
||||
|
@ -314,7 +400,7 @@ extern "C" void HostToDevice(void* hostptr, void* deviceptr, long memsize) {
|
|||
cudaDeviceSynchronize();
|
||||
}
|
||||
|
||||
extern "C" void DeviceToHost(void* hostptr, void* deviceptr, long memsize) {
|
||||
extern "C" void DeviceToHost(void* hostptr, void* deviceptr, size_t memsize) {
|
||||
cudaMemcpy(hostptr, deviceptr, memsize, cudaMemcpyDeviceToHost);
|
||||
#ifdef __CUDADEBUG__
|
||||
cudaError_t err = cudaGetLastError();
|
||||
|
@ -326,7 +412,7 @@ extern "C" void DeviceToHost(void* hostptr, void* deviceptr, long memsize) {
|
|||
cudaDeviceSynchronize();
|
||||
}
|
||||
|
||||
void DeviceToDevice(void* s_deviceptr, void* t_deviceptr, long memsize)
|
||||
void DeviceToDevice(void* s_deviceptr, void* t_deviceptr, size_t memsize)
|
||||
{
|
||||
cudaMemcpy(t_deviceptr, s_deviceptr, memsize, cudaMemcpyDeviceToDevice);
|
||||
#ifdef __CUDADEBUG__
|
||||
|
@ -485,6 +571,7 @@ long NextBlockPad(long num, long blocksize)
|
|||
|
||||
void PrintLasterError(const char* s)
|
||||
{
|
||||
cudaDeviceSynchronize();
|
||||
cudaError_t err = cudaGetLastError();
|
||||
if (err != cudaSuccess) {
|
||||
//printf("%s: %s\n", s, cudaGetErrorString(err));
|
||||
|
@ -495,6 +582,70 @@ void PrintLasterError(const char* s)
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
extern "C" void CUDAIFFT(cuComplex* inArr, cuComplex* outArr, long InRowCount, long InColCount, long outColCount) {
|
||||
|
||||
cufftHandle plan;
|
||||
cufftResult result;
|
||||
|
||||
// 创建批量IFFT计划
|
||||
int rank = 1;
|
||||
int n[] = { InColCount }; // 每个IFFT处理freqcount点
|
||||
int inembed[] = { InColCount };
|
||||
int onembed[] = { outColCount };
|
||||
int istride = 1;
|
||||
int ostride = 1;
|
||||
int idist = InColCount; // 输入批次间距
|
||||
int odist = outColCount; // 输出批次间距
|
||||
int batch = InRowCount; // 批处理数量
|
||||
|
||||
result = cufftPlanMany(&plan, rank, n,
|
||||
inembed, istride, idist,
|
||||
onembed, ostride, odist,
|
||||
CUFFT_C2C, batch);
|
||||
if (result != CUFFT_SUCCESS) {
|
||||
PrintLasterError("CUDAIFFT");
|
||||
return;
|
||||
}
|
||||
|
||||
// 执行IFFT
|
||||
cuComplex* in_ptr = inArr;
|
||||
cuComplex* out_ptr = outArr;
|
||||
result = cufftExecC2C(plan, (cufftComplex*)in_ptr, (cufftComplex*)out_ptr, CUFFT_INVERSE);
|
||||
|
||||
if (result != CUFFT_SUCCESS) {
|
||||
cufftDestroy(plan);
|
||||
return;
|
||||
}
|
||||
|
||||
// 等待IFFT完成并缩放数据
|
||||
cudaDeviceSynchronize();
|
||||
cufftDestroy(plan);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern "C" void CUDAIFFTScale(cuComplex* inArr, cuComplex* outArr, long InRowCount, long InColCount, long outColCount)
|
||||
{
|
||||
CUDAIFFT(inArr, outArr, InRowCount, InColCount, outColCount);
|
||||
|
||||
float scale = 1.0f / InColCount;
|
||||
int totalElements = InRowCount * InColCount;
|
||||
dim3 block(256);
|
||||
dim3 grid((totalElements + block.x - 1) / block.x);
|
||||
scaleKernel << <grid, block >> > (outArr, totalElements, scale);
|
||||
cudaDeviceSynchronize();
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -75,13 +75,13 @@ extern "C" GPUBASELIBAPI void printDeviceInfo(int deviceId);
|
|||
extern "C" GPUBASELIBAPI void checkCudaError(cudaError_t err, const char* msg);
|
||||
|
||||
// GPU 内存函数
|
||||
extern "C" GPUBASELIBAPI void* mallocCUDAHost(long memsize); // 主机内存声明
|
||||
extern "C" GPUBASELIBAPI void* mallocCUDAHost(size_t memsize); // 主机内存声明
|
||||
extern "C" GPUBASELIBAPI void FreeCUDAHost(void* ptr);
|
||||
extern "C" GPUBASELIBAPI void* mallocCUDADevice(long memsize); // GPU内存声明
|
||||
extern "C" GPUBASELIBAPI void* mallocCUDADevice(size_t memsize); // GPU内存声明
|
||||
extern "C" GPUBASELIBAPI void FreeCUDADevice(void* ptr);
|
||||
extern "C" GPUBASELIBAPI void HostToDevice(void* hostptr, void* deviceptr, long memsize);//GPU 内存数据转移 设备 -> GPU
|
||||
extern "C" GPUBASELIBAPI void DeviceToHost(void* hostptr, void* deviceptr, long memsize);//GPU 内存数据转移 GPU -> 设备
|
||||
extern "C" GPUBASELIBAPI void DeviceToDevice(void* s_deviceptr, void* t_deviceptr, long memsize);//GPU 内存数据转移 GPU -> 设备
|
||||
extern "C" GPUBASELIBAPI void HostToDevice(void* hostptr, void* deviceptr, size_t memsize);//GPU 内存数据转移 设备 -> GPU
|
||||
extern "C" GPUBASELIBAPI void DeviceToHost(void* hostptr, void* deviceptr, size_t memsize);//GPU 内存数据转移 GPU -> 设备
|
||||
extern "C" GPUBASELIBAPI void DeviceToDevice(void* s_deviceptr, void* t_deviceptr, size_t memsize);//GPU 内存数据转移 GPU -> 设备
|
||||
|
||||
extern "C" GPUBASELIBAPI void CUDA_MemsetBlock(cuComplex* data, cuComplex init0, long len);
|
||||
// 矢量基础运算函数
|
||||
|
@ -104,5 +104,12 @@ extern "C" GPUBASELIBAPI long NextBlockPad(long num, long blocksize);
|
|||
extern "C" GPUBASELIBAPI void PrintLasterError(const char* s);
|
||||
|
||||
|
||||
extern "C" GPUBASELIBAPI void CUDAIFFTScale(cuComplex* inArr, cuComplex* outArr,long InRowCount,long InColCount,long outColCount);
|
||||
|
||||
extern "C" GPUBASELIBAPI void CUDAIFFT(cuComplex* inArr, cuComplex* outArr, long InRowCount, long InColCount, long outColCount);
|
||||
|
||||
extern "C" GPUBASELIBAPI void FFTShift1D(cuComplex* d_data, int batch_size, int signal_length);
|
||||
extern "C" GPUBASELIBAPI void shared_complexPtrToHostCuComplex(std::complex<double>* src, cuComplex* dst, size_t len);
|
||||
extern "C" GPUBASELIBAPI void HostCuComplexToshared_complexPtr(cuComplex* src, std::complex<double>* dst, size_t len);
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -36,12 +36,16 @@ ImageShowDialogClass ::ImageShowDialogClass(QWidget *parent)
|
|||
|
||||
|
||||
ImageShowDialogClass::~ImageShowDialogClass()
|
||||
{}
|
||||
{
|
||||
if (nullptr != this->desCursor) {
|
||||
this->desCursor->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void ImageShowDialogClass::on_action_cursor_enable_trigged()
|
||||
{
|
||||
this->desCursor = new ImageShowCursorDesClass(this);
|
||||
this->desCursor = new ImageShowCursorDesClass;
|
||||
|
||||
this->desCursorflag = true;
|
||||
for (size_t i = 0; i < this->getGraphCount(); i++) {
|
||||
|
@ -313,11 +317,14 @@ void ImageShowDialogClass::updateCursor(QMouseEvent *event)
|
|||
QPoint pos = event->pos();
|
||||
double x=this->m_plot->xAxis->pixelToCoord(pos.x()); // 将鼠标位置映射到图表坐标系中
|
||||
double y = this->m_plot->yAxis->pixelToCoord(pos.y());
|
||||
this->statusbar->showMessage(u8"X: "+QString::number(x,'f', 6)+" y: "+QString::number(y, 'f', 6));
|
||||
QCPColorMap* colorMap = dynamic_cast<QCPColorMap*>(this->ui->m_plot->plottable(0));
|
||||
double dataValue = colorMap->data()->data(x, y);
|
||||
this->statusbar->showMessage(u8"X: "+QString::number(x,'f', 6)+" y: "+QString::number(y, 'f', 6)+
|
||||
" value: "+QString::number(dataValue,'e',6));
|
||||
if (this->desCursorflag) {
|
||||
if (this->graphclass == LAMPDATASHOWCLASS::LAMPColorMap) {
|
||||
QCPColorMap* colorMap = dynamic_cast<QCPColorMap*>(this->ui->m_plot->plottable(0));
|
||||
double dataValue = colorMap->data()->data(x, y);
|
||||
|
||||
|
||||
this->desCursor->updateCursorContent(u8"X: " + QString::number(x, 'f', 6) + " y: " + QString::number(y, 'f', 6) +u8"\n" +u8"DataValue: "+QString::number(dataValue));
|
||||
|
||||
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{8C8CA066-A93A-4098-9A46-B855EFEAADF2}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
@ -24,6 +34,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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>
|
||||
|
@ -31,6 +47,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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" />
|
||||
|
@ -40,11 +63,21 @@
|
|||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts;datavisualization</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts;datavisualization</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>
|
||||
|
@ -54,10 +87,18 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
|
@ -68,6 +109,13 @@
|
|||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary\ToolAbstract;..\GPUBaseLib\GPUTool;.\Imageshow;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
|
||||
<TargetName>$(ProjectName)</TargetName>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
|
@ -76,6 +124,14 @@
|
|||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -89,6 +145,19 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>IMAGESHOWTOOL_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>
|
||||
|
@ -106,6 +175,23 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>IMAGESHOWTOOL_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>
|
||||
<ClCompile Include="Imageshow\ImageShowDialogClass.cpp" />
|
||||
<ClCompile Include="Imageshow\qcustomplot.cpp" />
|
||||
|
|
|
@ -40,88 +40,130 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageshowTool", "ImageshowT
|
|||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|ARM = Debug|ARM
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|ARM = Release|ARM
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Debug|x64.Build.0 = Debug|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Debug|x86.Build.0 = Debug|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Release|ARM.Build.0 = Release|ARM
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Release|x64.ActiveCfg = Release|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Release|x64.Build.0 = Release|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Release|x86.ActiveCfg = Release|x64
|
||||
{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}.Release|x86.Build.0 = Release|x64
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Debug|x64.Build.0 = Debug|x64
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Debug|x86.Build.0 = Debug|Win32
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Release|ARM.Build.0 = Release|ARM
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Release|x64.ActiveCfg = Release|x64
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Release|x64.Build.0 = Release|x64
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Release|x86.ActiveCfg = Release|Win32
|
||||
{872ECD6F-30E3-4A1B-B17C-15E87D373FF6}.Release|x86.Build.0 = Release|Win32
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Debug|x64.Build.0 = Debug|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Debug|x86.Build.0 = Debug|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Release|ARM.Build.0 = Release|ARM
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Release|x64.ActiveCfg = Release|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Release|x64.Build.0 = Release|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Release|x86.ActiveCfg = Release|x64
|
||||
{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}.Release|x86.Build.0 = Release|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Debug|x64.Build.0 = Debug|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Debug|x86.Build.0 = Debug|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Release|ARM.Build.0 = Release|ARM
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Release|x64.ActiveCfg = Release|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Release|x64.Build.0 = Release|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Release|x86.ActiveCfg = Release|x64
|
||||
{D603A623-132D-4304-AB03-638FC438F084}.Release|x86.Build.0 = Release|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Debug|x64.Build.0 = Debug|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Debug|x86.Build.0 = Debug|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Release|ARM.Build.0 = Release|ARM
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Release|x64.ActiveCfg = Release|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Release|x64.Build.0 = Release|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Release|x86.ActiveCfg = Release|x64
|
||||
{ED06DFCD-4B9F-41F7-8F25-1823C2398142}.Release|x86.Build.0 = Release|x64
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Debug|x64.Build.0 = Debug|x64
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Debug|x86.Build.0 = Debug|Win32
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Release|ARM.Build.0 = Release|ARM
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Release|x64.ActiveCfg = Release|x64
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Release|x64.Build.0 = Release|x64
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Release|x86.ActiveCfg = Release|Win32
|
||||
{8A71D19D-9AC6-42E9-81EC-9E82AF8075B8}.Release|x86.Build.0 = Release|Win32
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Debug|x64.Build.0 = Debug|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Debug|x86.Build.0 = Debug|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Release|ARM.Build.0 = Release|ARM
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Release|x64.ActiveCfg = Release|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Release|x64.Build.0 = Release|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Release|x86.ActiveCfg = Release|x64
|
||||
{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}.Release|x86.Build.0 = Release|x64
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Debug|x64.Build.0 = Debug|x64
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Debug|x86.Build.0 = Debug|Win32
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Release|ARM.Build.0 = Release|ARM
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Release|x64.ActiveCfg = Release|x64
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Release|x64.Build.0 = Release|x64
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Release|x86.ActiveCfg = Release|Win32
|
||||
{B8B40C54-F7FE-4809-B6FB-8BC014570D7B}.Release|x86.Build.0 = Release|Win32
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Debug|x64.Build.0 = Debug|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Debug|x86.Build.0 = Debug|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Release|ARM.Build.0 = Release|ARM
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Release|x64.ActiveCfg = Release|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Release|x64.Build.0 = Release|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Release|x86.ActiveCfg = Release|x64
|
||||
{E56B3878-A3DC-41A4-ABF3-B628816D0D64}.Release|x86.Build.0 = Release|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Debug|ARM.Build.0 = Debug|ARM
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Debug|x86.ActiveCfg = Debug|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Debug|x86.Build.0 = Debug|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Release|ARM.ActiveCfg = Release|ARM
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Release|ARM.Build.0 = Release|ARM
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Release|x64.Build.0 = Release|x64
|
||||
{8C8CA066-A93A-4098-9A46-B855EFEAADF2}.Release|x86.ActiveCfg = Release|x64
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{4E6E79A3-048C-4FB4-BBB0-43C518A3E6D4}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
@ -24,6 +34,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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>
|
||||
|
@ -31,6 +47,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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" />
|
||||
|
@ -40,11 +63,21 @@
|
|||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;gui;widgets</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;gui;widgets</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>
|
||||
|
@ -54,10 +87,18 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
|
@ -66,6 +107,11 @@
|
|||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary\ToolAbstract;..\GPUBaseLib\GPUTool;..\RasterProcessToolWidget;..\LAMPMainWidget;..\RasterMainWidgetGUI;..\RasterMainWidgetGUI\RasterMainWidget;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
|
@ -73,6 +119,13 @@
|
|||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -85,6 +138,18 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<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>
|
||||
|
@ -101,6 +166,22 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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>
|
||||
<QtRcc Include="LAMPDataProcessEXE.qrc" />
|
||||
<QtUic Include="LAMPDataProcessEXE.ui" />
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="infoLayout"/>
|
||||
<layout class="QGridLayout" name="mapCanvasLayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -164,6 +164,9 @@
|
|||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>图层列表</string>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>1</number>
|
||||
</attribute>
|
||||
|
@ -181,7 +184,7 @@
|
|||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>图层列表</string>
|
||||
<string/>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
|
@ -234,6 +237,9 @@ p, li { white-space: pre-wrap; }
|
|||
</widget>
|
||||
</widget>
|
||||
<widget class="QDockWidget" name="dockWidget_2">
|
||||
<property name="windowTitle">
|
||||
<string>下载任务</string>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>2</number>
|
||||
</attribute>
|
||||
|
@ -357,13 +363,16 @@ p, li { white-space: pre-wrap; }
|
|||
</widget>
|
||||
</widget>
|
||||
<widget class="QDockWidget" name="dockWidget_3">
|
||||
<property name="windowTitle">
|
||||
<string>信息窗口</string>
|
||||
</property>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>1</number>
|
||||
<number>2</number>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="dockWidgetContents_4">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_5">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="mapCanvasLayout"/>
|
||||
<layout class="QGridLayout" name="infoLayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{E56B3878-A3DC-41A4-ABF3-B628816D0D64}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
@ -24,6 +34,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</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>
|
||||
|
@ -31,6 +47,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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" />
|
||||
|
@ -40,11 +63,21 @@
|
|||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;gui;help;xmlpatterns;widgets;location;bluetooth;printsupport;dbus;charts;datavisualization</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;sql;gui;help;xmlpatterns;widgets;location;bluetooth;printsupport;dbus;charts;datavisualization</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>
|
||||
|
@ -54,10 +87,18 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
|
@ -66,11 +107,21 @@
|
|||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>.;.\RasterMainWidget;..\RasterProcessToolWidget;..\RasterProcessToolWidget\ToolBoxManager;..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\BaseCommonLibrary\ToolAbstract;..\GPUBaseLib\GPUTool;..\GPUBaseLib;..\RasterMainWidgetGUI;..\RasterMainWidgetGUI\RasterMainWidget;$(IncludePath)</IncludePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;RASTERMAINWIDGETGUI_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;RASTERMAINWIDGETGUI_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -83,6 +134,18 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<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>
|
||||
|
@ -99,6 +162,22 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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>DebugFull</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="PrintMessage_C.cpp" />
|
||||
<ClCompile Include="RasterMainWidget\crs.cpp" />
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "RasterWidgetMessageShow.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
namespace RasterMessageShow {
|
||||
|
||||
RasterWidgetMessageShow* RasterWidgetMessageShow::_instance = nullptr;
|
||||
|
@ -27,7 +28,10 @@ namespace RasterMessageShow {
|
|||
{
|
||||
if (nullptr != this->textBrowserMessage) {
|
||||
this->textBrowserMessage->append(Message);
|
||||
|
||||
this->textBrowserMessage->moveCursor(QTextCursor::MoveOperation::End);
|
||||
this->textBrowserMessage->repaint();
|
||||
std::cout << Message.toLocal8Bit().constData() << std::endl;
|
||||
|
||||
}
|
||||
else {}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{7EF67DAA-DBC0-4B7F-80E8-11B4D2CB7EC2}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
<ProjectName>RasterProcessToolWidget</ProjectName>
|
||||
</PropertyGroup>
|
||||
|
@ -25,6 +35,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ConfigurationType>Application</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>
|
||||
|
@ -35,6 +51,16 @@
|
|||
<UseILP64Interfaces1A>true</UseILP64Interfaces1A>
|
||||
<UseIntelMPI>false</UseIntelMPI>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseInteloneMKL>Parallel</UseInteloneMKL>
|
||||
<UseILP64Interfaces1A>true</UseILP64Interfaces1A>
|
||||
<UseIntelMPI>false</UseIntelMPI>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
|
@ -44,11 +70,21 @@
|
|||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;gui;help;xmlpatterns;widgets;location;bluetooth;printsupport;dbus;charts;datavisualization</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;sql;gui;help;xmlpatterns;widgets;location;bluetooth;printsupport;dbus;charts;datavisualization</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>
|
||||
|
@ -60,20 +96,37 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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'">
|
||||
<IncludePath>.\SimulationSAR;.\GF3ProcessToolbox;.\BaseTool;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||
<IncludePath>.\SimulationSAR;.\GF3ProcessToolbox;.\BaseTool;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<IncludePath>..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\GPUBaseLib\GPUTool;..\BaseCommonLibrary\ToolAbstract;$(oneMKLIncludeDir);$(IncludePath)</IncludePath>
|
||||
<ReferencePath>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib\x64;$(ReferencePath)</ReferencePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\BaseCommonLibrary;..\BaseCommonLibrary\BaseTool;..\GPUBaseLib\GPUTool;..\BaseCommonLibrary\ToolAbstract;$(oneMKLIncludeDir);$(IncludePath)</IncludePath>
|
||||
<ReferencePath>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\lib\x64;$(ReferencePath)</ReferencePath>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>RASTERPROCESSTOOLWIDGET_LIB;_CRT_SECURE_NO_WARNINGS;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -96,6 +149,28 @@
|
|||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>RASTERPROCESSTOOLWIDGET_LIB;_CRT_SECURE_NO_WARNINGS;_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<WholeProgramOptimization>false</WholeProgramOptimization>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
<FavorSizeOrSpeed>Neither</FavorSizeOrSpeed>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<LinkTimeCodeGeneration>Default</LinkTimeCodeGeneration>
|
||||
<LargeAddressAware>true</LargeAddressAware>
|
||||
<AdditionalDependencies>cublas.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
<CudaCompile>
|
||||
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -108,6 +183,18 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<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>
|
||||
|
@ -124,6 +211,22 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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>DebugFull</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>false</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="QApplicationSettingManager.cpp" />
|
||||
<QtRcc Include="..\RasterMainWidgetGUI\resource\res.qrc" />
|
||||
|
|
|
@ -109,6 +109,8 @@ void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWi
|
|||
emit toolbox->addBoxToolItemSIGNAL(new MergeRasterProcessToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QDEMResampleDialogToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QDEMLLA2XYZToolToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QConvertCoordinateSystemToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QResampleRefrenceRasterToolButton(toolbox));
|
||||
}
|
||||
|
||||
QDEMResampleDialogToolButton::QDEMResampleDialogToolButton(QWidget* parent)
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{070C157E-3C30-4E2B-A80C-CBC7B74DF03F}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
@ -24,6 +34,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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>
|
||||
|
@ -31,6 +47,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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" />
|
||||
|
@ -40,11 +63,21 @@
|
|||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts</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>
|
||||
|
@ -54,10 +87,18 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
|
@ -68,6 +109,13 @@
|
|||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\..\BaseCommonLibrary;..\..\BaseCommonLibrary\BaseTool;..\..\BaseCommonLibrary\ToolAbstract;..\..\GPUBaseLib\GPUTool;.\BaseToolbox;..\..\RasterMainWidgetGUI\RasterMainWidget;..\..\RasterMainWidgetGUI;..\..\RasterProcessToolWidget;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Toolbox\</OutDir>
|
||||
<TargetName>PluginTool_$(ProjectName)</TargetName>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
|
@ -76,6 +124,14 @@
|
|||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -89,6 +145,19 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>BASETOOLBOX_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>
|
||||
|
@ -106,6 +175,23 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>BASETOOLBOX_LIB;BASETOOLBOX_API;_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>
|
||||
<ClCompile Include="BaseToolbox\DEMLLA2XYZTool.cpp" />
|
||||
<ClCompile Include="BaseToolbox\GF3CalibrationAndGeocodingClass.cpp" />
|
||||
|
|
|
@ -38,15 +38,13 @@ void DEMLLA2XYZTool::onaccept()
|
|||
|
||||
//Eigen::MatrixXd demArr = demds.getData(0, 0, demds.height, demds.width, 1);
|
||||
//Eigen::MatrixXd demR = demArr;
|
||||
Landpoint LandP{ 0,0,0 };
|
||||
Point3 GERpoint{ 0,0,0 };
|
||||
|
||||
double R = 0;
|
||||
double dem_row = 0, dem_col = 0, dem_alt = 0;
|
||||
|
||||
long line_invert = Memory1MB/8.0/ demds.width*2000;
|
||||
long line_invert = Memory1MB/8.0/ demds.width*1000;
|
||||
|
||||
|
||||
double rowidx = 0;
|
||||
double colidx = 0;
|
||||
this->ui.label_3->setText("WGS84 : LLA -> XYZ");
|
||||
|
||||
for (int max_rows_ids = 0; max_rows_ids < demds.height; max_rows_ids = max_rows_ids + line_invert) {
|
||||
|
@ -62,6 +60,10 @@ void DEMLLA2XYZTool::onaccept()
|
|||
|
||||
#pragma omp parallel for
|
||||
for (int i = 0; i < datarows; i++) {
|
||||
Landpoint LandP{ 0,0,0 };
|
||||
Point3 GERpoint{ 0,0,0 };
|
||||
double rowidx = 0;
|
||||
double colidx = 0;
|
||||
for (int j = 0; j < datacols; j++) {
|
||||
rowidx = i + max_rows_ids;
|
||||
colidx = j;
|
||||
|
|
|
@ -493,7 +493,7 @@ ErrorCode GF3RDCreateLookTable(QString inxmlPath, QString indemPath, QString out
|
|||
}
|
||||
else {}
|
||||
processNumber = processNumber + blockrows;
|
||||
std::cout << "\rprocess bar:\t" << processNumber * 100.0 / rowcount << " % " << "\t\t\t";
|
||||
qDebug() << "\rprocess bar:\t" << processNumber * 100.0 / rowcount << " % " << "\t\t\t";
|
||||
if (progressDialog.maximum() <= processNumber) {
|
||||
processNumber = progressDialog.maximum() - 1;
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ ErrorCode GF3PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode&
|
|||
double nexttime = node.time + 1e-6;
|
||||
SatelliteOribtNode node1 = this->getSatelliteOribtNode(nexttime, flag);
|
||||
|
||||
//std::cout << "getAntnnaDirection corrdination " << std::endl;
|
||||
//qDebug() << "getAntnnaDirection corrdination " << std::endl;
|
||||
|
||||
double Vx = (node1.Px - node.Px);
|
||||
double Vy = (node1.Py - node.Py);
|
||||
|
@ -252,13 +252,13 @@ ErrorCode GF3PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode&
|
|||
Eigen::Vector3d axisX0 = { Vx,Vy,Vz }; // x 轴 --飞行方向
|
||||
Eigen::Vector3d axisY0 = axisZ0.cross(axisX0); // y 轴 --右手定则 -- 初始坐标系
|
||||
|
||||
//std::cout << "axis_X0=[ " << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Y0=[ " << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Z0=[ " << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_X0=[ " << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Y0=[ " << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Z0=[ " << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
|
||||
double rotateAngle = this->RightLook ? -this->beamAngle : this->beamAngle; // 旋转角度 左(逆时针):theta , 右(顺时针): -theta
|
||||
//std::cout << "rotateAngle=" << rotateAngle << std::endl;
|
||||
//std::cout << "Look side:\t" << (this->RightLook ? "right" : "left") << std::endl;
|
||||
//qDebug() << "rotateAngle=" << rotateAngle << std::endl;
|
||||
//qDebug() << "Look side:\t" << (this->RightLook ? "right" : "left") << std::endl;
|
||||
// 1.2. 根据波位角,确定卫星绕X轴-飞行轴
|
||||
Eigen::Matrix3d rotateMatrixBeam = rotationMatrix(axisX0, rotateAngle * d2r); // 旋转矩阵
|
||||
axisZ0 = rotateMatrixBeam * axisZ0; // 旋转矩阵
|
||||
|
@ -291,10 +291,10 @@ ErrorCode GF3PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode&
|
|||
node.AntZaxisZ = axisZ0[2];
|
||||
|
||||
|
||||
//std::cout << "axis_X=[" << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Y=[" << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Z=[" << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
//std::cout << "------------------------------------" << std::endl;
|
||||
//qDebug() << "axis_X=[" << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Y=[" << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Z=[" << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
//qDebug() << "------------------------------------" << std::endl;
|
||||
return ErrorCode::SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>C:\Users\30453\Desktop\RasterTool\LT1A_S1GBM_20241229\LT1A_S1GBM_20241229WGS84.tif</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
|
@ -73,6 +76,9 @@
|
|||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>C:\Users\30453\Desktop\RasterTool\LT1A_S1GBM_20241229\LT1A_S1GBM_20241229.tif</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "ui_QResampleRefrenceRaster.h"
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
#include "ImageOperatorBase.h"
|
||||
|
||||
QResampleRefrenceRaster::QResampleRefrenceRaster(QWidget *parent)
|
||||
: QDialog(parent),ui(new Ui::QResampleRefrenceRasterClass)
|
||||
|
@ -83,12 +84,26 @@ void QResampleRefrenceRaster::ondialogBtnaccepted()
|
|||
QString RefRasterPath = this->ui->lineEditRefRaster->text();
|
||||
QString OutRasterPath = this->ui->lineEditOutRaster->text();
|
||||
|
||||
std::shared_ptr<double> gt(new double[6], delArrPtr);
|
||||
gdalImage refimage(RefRasterPath);
|
||||
|
||||
gt.get()[0] = refimage.gt(0, 0);
|
||||
gt.get()[1] = refimage.gt(0, 1);
|
||||
gt.get()[2] = refimage.gt(0, 2);
|
||||
gt.get()[3] = refimage.gt(1, 0);
|
||||
gt.get()[4] = refimage.gt(1, 1);
|
||||
gt.get()[5] = refimage.gt(1, 2);
|
||||
|
||||
|
||||
|
||||
ResampleGDAL(inRasterPath.toLocal8Bit().constData(), OutRasterPath.toLocal8Bit().constData(),
|
||||
gt.get(), refimage.width, refimage.height,
|
||||
GDALResampleAlg::GRA_Bilinear);
|
||||
//alignRaster(inRasterPath, RefRasterPath, OutRasterPath,GDALResampleAlg::GRA_Bilinear);
|
||||
|
||||
|
||||
|
||||
QMessageBox::information(this, tr(u8"Ìáʾ"), tr(u8"completed!!!"));
|
||||
}
|
||||
|
||||
void QResampleRefrenceRaster::ondialogBtnrejected()
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输入影像:</string>
|
||||
<string>输出影像:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -127,7 +127,15 @@ PSTNAlgorithm::PSTNAlgorithm(QString infile_path)
|
|||
OrbitPoly orbit(polynum, polySatellitePara, SatelliteModelStartTime);
|
||||
this->orbit = orbit;
|
||||
qDebug() << "sate polynum\t" << polynum ;
|
||||
std::cout << "sate polySatellitePara\n" << polySatellitePara ;
|
||||
qDebug() << "sate polySatellitePara\n" ;
|
||||
for (long i = 0; i < polynum; i++) {
|
||||
qDebug() << polySatellitePara(i, 0) << "\t"
|
||||
<< polySatellitePara(i, 1) << "\t"
|
||||
<< polySatellitePara(i, 2) << "\t"
|
||||
<< polySatellitePara(i, 3) << "\t"
|
||||
<< polySatellitePara(i, 4) << "\t"
|
||||
<< polySatellitePara(i, 5) << "\t";
|
||||
}
|
||||
qDebug() << "sate SatelliteModelStartTime\t" << SatelliteModelStartTime ;
|
||||
|
||||
|
||||
|
@ -142,7 +150,7 @@ PSTNAlgorithm::PSTNAlgorithm(QString infile_path)
|
|||
getline(infile, buf); dd = stod(buf);
|
||||
this->UTC = Eigen::Matrix<double, 1, 3>{ yy,mm,dd };
|
||||
std::cout << "UTC\t" << this->UTC << std::endl;
|
||||
qDebug() << "\nWGS84 to J2000 Params:\t" ;
|
||||
std::cout << "\nWGS84 to J2000 Params:\t" ;
|
||||
getline(infile, buf); this->Xp = stod(buf); qDebug() << "Xp\t" << this->Xp ;
|
||||
getline(infile, buf); this->Yp = stod(buf); qDebug() << "Yp\t" << this->Yp ;
|
||||
getline(infile, buf); this->Dut1 = stod(buf); qDebug() << "dut1\t" << this->Dut1 ;
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{D603A623-132D-4304-AB03-638FC438F084}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
@ -24,6 +34,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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>
|
||||
|
@ -31,6 +47,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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" />
|
||||
|
@ -40,11 +63,21 @@
|
|||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts</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>
|
||||
|
@ -54,10 +87,18 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
|
@ -68,6 +109,13 @@
|
|||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\..\BaseCommonLibrary;..\..\BaseCommonLibrary\BaseTool;..\..\BaseCommonLibrary\ToolAbstract;..\..\GPUBaseLib\GPUTool;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Toolbox\</OutDir>
|
||||
<TargetName>PluginTool_$(ProjectName)</TargetName>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
|
@ -76,6 +124,14 @@
|
|||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
|
@ -89,6 +145,19 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>LAMPSCATTERTOOL_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>
|
||||
|
@ -106,6 +175,23 @@
|
|||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>LAMPSCATTERTOOL_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>
|
||||
<ClCompile Include="LAMPScatterTool\LAMPScatterS1B.cpp" />
|
||||
<ClInclude Include="LAMPScatterTool\LAMPScatterS1B.h" />
|
||||
|
|
|
@ -437,7 +437,7 @@ QMap<QString, QString> LAMPScatterS1BDataset::ReadPolAttribution(int ncid, int p
|
|||
break;
|
||||
}
|
||||
default:
|
||||
std::cout << "Attribute Name: " << att_name << ", Type: Unknown" << std::endl;
|
||||
qDebug() << "Attribute Name: " << att_name << ", Type: Unknown";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,130 @@
|
|||
#include <cstdio>
|
||||
#include <cufft.h>
|
||||
#include <cmath>
|
||||
#include <cuda_runtime.h>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <complex>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include <cufft.h>
|
||||
#include <cufftw.h>
|
||||
#include <cufftXt.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include "GPUBPTool.cuh"
|
||||
#include "BPBasic0_CUDA.cuh"
|
||||
#include "GPUBpSimulation.cuh"
|
||||
#include "GPURFPC.cuh"
|
||||
|
||||
|
||||
|
||||
double* getFreqPoints_mallocHost(double startFreq, double endFreq, long freqpoints)
|
||||
{
|
||||
long double dfreq = (endFreq - startFreq) / (freqpoints - 1);
|
||||
double* freqlist = (double*)mallocCUDAHost(sizeof(double) * freqpoints);
|
||||
for (long i = 0; i < freqpoints; i++) {
|
||||
freqlist[i] = startFreq + dfreq * i;
|
||||
}
|
||||
return freqlist;
|
||||
}
|
||||
|
||||
cuComplex* createEchoPhase_mallocHost(long Np, long Nf)
|
||||
{
|
||||
cuComplex* phdata = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * Np * Nf);
|
||||
for (long i = 0; i < Np; i++) {
|
||||
for (long j = 0; j < Nf; j++) {
|
||||
phdata[i * Nf + j] = make_cuComplex(0, 0);
|
||||
}
|
||||
}
|
||||
return phdata;
|
||||
}
|
||||
|
||||
|
||||
__global__ void kernel_RFPCProcess(
|
||||
double* Sx,double* Sy,double* Sz,
|
||||
double Tx, double Ty,double Tz,
|
||||
double Tslx,double Tsly,double Tslz, // 目标的坡面向量
|
||||
double p1,double p2, double p3, double p4, double p5, double p6,
|
||||
long Np,long Nf,
|
||||
double minF,double dFreq,double RefRange,
|
||||
cuComplex* phdata
|
||||
) {
|
||||
long prfid = blockIdx.x * blockDim.x + threadIdx.x; // 获取当前的线程编码
|
||||
if (prfid >= Np || prfid < 0) { return; }
|
||||
else {}
|
||||
|
||||
// 距离
|
||||
Vector3 S{ Sx[prfid],Sy[prfid],Sz[prfid] };
|
||||
Vector3 T{ Tx,Ty,Tz };
|
||||
Vector3 slp{ Tslx,Tsly,Tslz };
|
||||
//printf("S=(%e,%e,%e)\n", S.x, S.y, S.z);
|
||||
// 入射角
|
||||
Vector3 TS = vec_sub(S, T);//T-->S
|
||||
double localIncAngle = angleBetweenVectors(TS, slp, false);// 入射角
|
||||
double sigma0 = GPU_getSigma0dB(p1, p2, p3, p4, p5, p6, localIncAngle);// 后向散射系数
|
||||
sigma0 = powf(10.0, sigma0 / 10.0);
|
||||
|
||||
// 距离
|
||||
double R = sqrt(vec_dot(TS, TS));
|
||||
|
||||
// 计算增益
|
||||
double amp_echo = sigma0 / (powf(4 * LAMP_CUDA_PI, 2) * powf(R, 4)); // 反射强度
|
||||
double phi = 0;
|
||||
for (long fid = 0; fid < Nf; fid++) {
|
||||
phi = -4.0 * PI / LIGHTSPEED * (minF + dFreq * fid) * (R - RefRange);
|
||||
phdata[prfid * Nf + fid].x += amp_echo * cos(phi);
|
||||
phdata[prfid * Nf + fid].y += amp_echo * sin(phi);
|
||||
//printf("phdata(%d,%d)=complex(%e,%e)\n", prfid, fid, phdata[prfid * Nf + fid].x, phdata[prfid * Nf + fid].y);
|
||||
}
|
||||
//printf("Nf:%d\n", Nf);
|
||||
//printf("amp_echo:%f\n", amp_echo);
|
||||
//printf("sigma0:%f\n", sigma0);
|
||||
//printf("R:%e\n", R);
|
||||
}
|
||||
|
||||
|
||||
void RFPCProcess(double Tx, double Ty, double Tz,
|
||||
double Tslx, double Tsly, double Tslz, // 目标的坡面向量
|
||||
double p1, double p2, double p3, double p4, double p5, double p6,
|
||||
GPUDATA& d_data)
|
||||
{
|
||||
|
||||
|
||||
double* AntX = (double*)mallocCUDADevice(sizeof(double) * d_data.Np);
|
||||
double* AntY = (double*)mallocCUDADevice(sizeof(double) * d_data.Np);
|
||||
double* AntZ = (double*)mallocCUDADevice(sizeof(double) * d_data.Np);
|
||||
|
||||
HostToDevice(d_data.AntX, AntX, sizeof(double) * d_data.Np); printf("antX host to device finished!!\n");
|
||||
HostToDevice(d_data.AntY, AntY, sizeof(double) * d_data.Np); printf("antY host to device finished!!\n");
|
||||
HostToDevice(d_data.AntZ, AntZ, sizeof(double) * d_data.Np); printf("antZ host to device finished!!\n");
|
||||
double minF = d_data.minF[0];
|
||||
long grid_size = (d_data.Np + BLOCK_SIZE - 1) / BLOCK_SIZE;
|
||||
double dfreq = d_data.deltaF;
|
||||
double R0 = d_data.R0;
|
||||
kernel_RFPCProcess<<<grid_size , BLOCK_SIZE >>>(
|
||||
AntX, AntY, AntZ,
|
||||
Tx, Ty, Tz,
|
||||
Tslx, Tsly, Tslz, // 目标的坡面向量
|
||||
p1, p2, p3, p4, p5, p6,
|
||||
d_data.Np, d_data.Nfft,
|
||||
minF, dfreq,R0,
|
||||
d_data.phdata
|
||||
);
|
||||
|
||||
PrintLasterError("RFPCProcess");
|
||||
FreeCUDADevice(AntX);
|
||||
FreeCUDADevice(AntY);
|
||||
FreeCUDADevice(AntZ);
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*****************************************************************//**
|
||||
* \file GPUBpSimulation.cuh
|
||||
* \brief GPU的局部仿真代码
|
||||
*
|
||||
* \author 30453
|
||||
* \date March 2025
|
||||
*********************************************************************/
|
||||
#ifndef _GPUBPSIMUALTION_CUDA_H_
|
||||
#define _GPUBPSIMUALTION_CUDA_H_
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include <cuda_runtime.h>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include "GPUTool.cuh"
|
||||
#include "BPBasic0_CUDA.cuh"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern "C" double* getFreqPoints_mallocHost(double startFreq, double endFreq, long freqpoints);
|
||||
extern "C" cuComplex* createEchoPhase_mallocHost(long Np, long Nf);
|
||||
|
||||
extern "C" void RFPCProcess(
|
||||
double Tx, double Ty, double Tz, // 目标点坐标
|
||||
double Tslx,double Tsly,double Tslz, // 目标的坡面向量
|
||||
double p1, double p2, double p3, double p4, double p5, double p6,// 地面目标后向散射系数与入射角关系 系数
|
||||
GPUDATA& d_data
|
||||
);
|
||||
|
||||
|
||||
|
||||
#endif
|
|
@ -0,0 +1,112 @@
|
|||
#include "QCreateSARIntensityByLookTableDialog.h"
|
||||
#include "ui_QCreateSARIntensityByLookTableDialog.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
#include "ImageOperatorBase.h"
|
||||
|
||||
QCreateSARIntensityByLookTableDialog::QCreateSARIntensityByLookTableDialog(QWidget *parent)
|
||||
: QDialog(parent),ui(new Ui::QCreateSARIntensityByLookTableDialogClass)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
|
||||
connect(ui->dialogBtn, SIGNAL(accepted()), this, SLOT(ondialogBtnaccepted()));
|
||||
connect(ui->dialogBtn, SIGNAL(rejected()), this, SLOT(ondialogBtnrejected()));
|
||||
connect(ui->BtnInRaster, SIGNAL(clicked(bool)), this, SLOT(onBtnInRasterClicked(bool)));
|
||||
connect(ui->BtnOutRaster, SIGNAL(clicked(bool)), this, SLOT(onBtnOutRasterClicked(bool)));
|
||||
connect(ui->BtnRefRaster, SIGNAL(clicked(bool)), this, SLOT(onBtnRefRasterClicked(bool)));
|
||||
|
||||
}
|
||||
|
||||
QCreateSARIntensityByLookTableDialog::~QCreateSARIntensityByLookTableDialog()
|
||||
{}
|
||||
|
||||
|
||||
void QCreateSARIntensityByLookTableDialog::onBtnInRasterClicked(bool)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(
|
||||
this, // 父窗口
|
||||
tr(u8"选择影像"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(u8"tif Files (*.tif);;data Files (*.data);;bin Files (*.bin);;All Files (*)") // 文件过滤器
|
||||
);
|
||||
|
||||
// 如果用户选择了文件
|
||||
if (!fileName.isEmpty()) {
|
||||
this->ui->lineEditInRaster->setText(fileName);
|
||||
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||
}
|
||||
}
|
||||
|
||||
void QCreateSARIntensityByLookTableDialog::onBtnOutRasterClicked(bool)
|
||||
{
|
||||
QString fileName = QFileDialog::getSaveFileName(
|
||||
this, // 父窗口
|
||||
tr(u8"保存影像"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(u8"tif Files (*.tif);;data Files (*.data);;bin Files (*.bin);;All Files (*)") // 文件过滤器
|
||||
);
|
||||
|
||||
// 如果用户选择了文件
|
||||
if (!fileName.isEmpty()) {
|
||||
this->ui->lineEditOutRaster->setText(fileName);
|
||||
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||
}
|
||||
}
|
||||
|
||||
void QCreateSARIntensityByLookTableDialog::onBtnRefRasterClicked(bool)
|
||||
{
|
||||
QString fileName = QFileDialog::getOpenFileName(
|
||||
this, // 父窗口
|
||||
tr(u8"选择参考影像"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(u8"tif Files (*.tif);;data Files (*.data);;bin Files (*.bin);;All Files (*)") // 文件过滤器
|
||||
);
|
||||
|
||||
// 如果用户选择了文件
|
||||
if (!fileName.isEmpty()) {
|
||||
this->ui->lineEditRefRaster->setText(fileName);
|
||||
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||
}
|
||||
}
|
||||
|
||||
void QCreateSARIntensityByLookTableDialog::ondialogBtnaccepted()
|
||||
{
|
||||
QString inRasterPath = this->ui->lineEditInRaster->text();
|
||||
QString RefRasterPath = this->ui->lineEditRefRaster->text();
|
||||
QString OutRasterPath = this->ui->lineEditOutRaster->text();
|
||||
|
||||
long minRid = ui->spinBoxMinRid->value();
|
||||
long maxRid = ui->spinBoxMaxRid->value();
|
||||
long minCid = ui->spinBoxMinCid->value();
|
||||
long maxCid = ui->spinBoxMaxCid->value();
|
||||
this->ui->progressBar->setValue(0);
|
||||
auto func = [this](long v, long maxv) { this->showPrcess(v, maxv); }; // 调用函数
|
||||
CreateSARIntensityByLookTable(inRasterPath, RefRasterPath, OutRasterPath,
|
||||
minRid, maxRid, minCid, maxCid, func);
|
||||
|
||||
//alignRaster(inRasterPath, RefRasterPath, OutRasterPath,GDALResampleAlg::GRA_Bilinear);
|
||||
|
||||
QMessageBox::information(this, tr(u8"提示"), tr(u8"completed!!!"));
|
||||
}
|
||||
|
||||
void QCreateSARIntensityByLookTableDialog::ondialogBtnrejected()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
void QCreateSARIntensityByLookTableDialog::showPrcess(long v, long maxv)
|
||||
{
|
||||
this->ui->progressBar->setMaximum(maxv);
|
||||
this->ui->progressBar->setValue(v);
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class QCreateSARIntensityByLookTableDialogClass;
|
||||
};
|
||||
|
||||
class QCreateSARIntensityByLookTableDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QCreateSARIntensityByLookTableDialog(QWidget *parent = nullptr);
|
||||
~QCreateSARIntensityByLookTableDialog();
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
void onBtnInRasterClicked(bool);
|
||||
void onBtnOutRasterClicked(bool);
|
||||
void onBtnRefRasterClicked(bool);
|
||||
void ondialogBtnaccepted();
|
||||
void ondialogBtnrejected();
|
||||
|
||||
void showPrcess(long v, long maxv);
|
||||
|
||||
private:
|
||||
Ui::QCreateSARIntensityByLookTableDialogClass* ui;
|
||||
};
|
|
@ -0,0 +1,272 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QCreateSARIntensityByLookTableDialogClass</class>
|
||||
<widget class="QDialog" name="QCreateSARIntensityByLookTableDialogClass">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>600</width>
|
||||
<height>400</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QCreateSARIntensityByLookTableDialog</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="2">
|
||||
<widget class="QPushButton" name="BtnInRaster">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="SloperLabel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输出影像:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>输入影像:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="lineEditInRaster">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>查找表影像:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="lineEditRefRaster">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="lineEditOutRaster">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QPushButton" name="BtnOutRaster">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>最小行号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>最小列号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QPushButton" name="BtnRefRaster">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>最大行号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>最大列号</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxMinRid">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxMaxRid">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxMinCid">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxMaxCid">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999999999</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progressBar">
|
||||
<property name="value">
|
||||
<number>24</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="dialogBtn">
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
|
@ -303,6 +303,7 @@ void QSimulationLookTableDialog::LookTableSimulationDopplerProcess(QString DEMPa
|
|||
}
|
||||
|
||||
|
||||
|
||||
// ´ŚŔíˇÖżé
|
||||
long GPUMemoryline = floor((Memory1MB * 2.0 / 8.0 / 3.0 / demimg.width * 2000));//2GB
|
||||
GPUMemoryline = GPUMemoryline < 1 ? 1 : GPUMemoryline;
|
||||
|
@ -341,6 +342,7 @@ void QSimulationLookTableDialog::LookTableSimulationDopplerProcess(QString DEMPa
|
|||
double fact_lamda = 1 / lamda;
|
||||
for (long rid = 0; rid < demimg.height; rid = rid + GPUMemoryline) {
|
||||
qDebug() << "computer read file : " << rid << "~" << rowcount + rid << "\t:" << demimg.height;
|
||||
//double* tmep = new double[rowcount * colcount];
|
||||
std::shared_ptr<double> demX = readDataArr<double>(demimg, rid, 0, rowcount, colcount, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);// ĐĐÁĐĘýĐ޸Ä
|
||||
std::shared_ptr<double> demY = readDataArr<double>(demimg, rid, 0, rowcount, colcount, 2, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demZ = readDataArr<double>(demimg, rid, 0, rowcount, colcount, 3, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
|
|
@ -0,0 +1,301 @@
|
|||
#include <cstdio>
|
||||
#include <cufft.h>
|
||||
#include <cmath>
|
||||
#include <cuda_runtime.h>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <complex>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include <cufft.h>
|
||||
#include <cufftw.h>
|
||||
#include <cufftXt.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include "GPUBPTool.cuh"
|
||||
#include "BPBasic0_CUDA.cuh"
|
||||
#include <PrintMsgToQDebug.h>
|
||||
|
||||
#define c LIGHTSPEED
|
||||
|
||||
__global__ void phaseCompensationKernel(cufftComplex* phdata, const double* Freq, double r, int K, int Na) {
|
||||
int freqIdx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
int pulseIdx = blockIdx.y * blockDim.y + threadIdx.y;
|
||||
|
||||
if (freqIdx >= K || pulseIdx >= Na) return;
|
||||
|
||||
int idx = pulseIdx * K + freqIdx;
|
||||
double phase = 4 * PI * Freq[freqIdx] * r / c;
|
||||
double cos_phase = cos(phase);
|
||||
double sin_phase = sin(phase);
|
||||
|
||||
cufftComplex ph = phdata[idx];
|
||||
double new_real = ph.x * cos_phase - ph.y * sin_phase;
|
||||
double new_imag = ph.x * sin_phase + ph.y * cos_phase;
|
||||
phdata[idx] = make_cuComplex(new_real, new_imag);
|
||||
}
|
||||
|
||||
__global__ void fftshiftKernel(cufftComplex* data, int Nfft, int Np) {
|
||||
int pulse = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
if (pulse >= Np) return;
|
||||
|
||||
int half = Nfft / 2;
|
||||
for (int i = 0; i < half; ++i) {
|
||||
cufftComplex temp = data[pulse * Nfft + i];
|
||||
data[pulse * Nfft + i] = data[pulse * Nfft + i + half];
|
||||
data[pulse * Nfft + i + half] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
__global__ void processPulseKernel(
|
||||
long prfid,
|
||||
int nx, int ny,
|
||||
const double* x_mat, const double* y_mat, const double* z_mat,
|
||||
double AntX, double AntY, double AntZ,
|
||||
double R0, double minF,
|
||||
const cufftComplex* rc_pulse,
|
||||
const double r_start, const double dr, const int nR,
|
||||
cufftComplex* im_final
|
||||
) {
|
||||
//
|
||||
|
||||
long long idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
long long pixelcount = nx * ny;
|
||||
if (idx >= pixelcount) return;
|
||||
|
||||
//printf("processPulseKernel start!!\n");
|
||||
|
||||
//if (x >= nx || y >= ny) return;
|
||||
//int idx = x * ny + y;
|
||||
|
||||
|
||||
double dx = AntX - x_mat[idx];
|
||||
double dy = AntY - y_mat[idx];
|
||||
double dz = AntZ - z_mat[idx];
|
||||
|
||||
//printf("processPulseKernel xmat !!\n");
|
||||
double R = sqrt(dx * dx + dy * dy + dz * dz);
|
||||
double dR = R - R0;
|
||||
|
||||
if (dR < r_start || dR >= (r_start + dr * (nR - 1))) return;
|
||||
// Linear interpolation
|
||||
double pos = (dR - r_start) / dr;
|
||||
int index = (int)floor(pos);
|
||||
double weight = pos - index;
|
||||
|
||||
if (index < 0 || index >= nR - 1) return;
|
||||
|
||||
cufftComplex rc_low = rc_pulse[prfid * nR +index];
|
||||
cufftComplex rc_high = rc_pulse[prfid * nR+index + 1];
|
||||
cufftComplex rc_interp;
|
||||
rc_interp.x = rc_low.x * (1 - weight) + rc_high.x * weight;
|
||||
rc_interp.y = rc_low.y * (1 - weight) + rc_high.y * weight;
|
||||
|
||||
// Phase correction
|
||||
double phase = 4 * PI * minF / c * dR;
|
||||
double cos_phase = cos(phase);
|
||||
double sin_phase = sin(phase);
|
||||
|
||||
cufftComplex phCorr;
|
||||
phCorr.x = rc_interp.x * cos_phase - rc_interp.y * sin_phase;
|
||||
phCorr.y = rc_interp.x * sin_phase + rc_interp.y * cos_phase;
|
||||
|
||||
// Accumulate
|
||||
im_final[idx].x += phCorr.x;
|
||||
im_final[idx].y += phCorr.y;
|
||||
//printf("r_start=%e;dr=%e;nR=%d\n", r_start, dr, nR);
|
||||
if (abs(phCorr.x) > 1e-100 || abs(phCorr.y > 1e-100)) {
|
||||
//printf(
|
||||
// "[DEBUG] prfid=%-4ld | idx=%-8lld\n"
|
||||
// " Ant: X=%-18.10e Y=%-18.10e Z=%-18.10e\n"
|
||||
// " Pix: X=%-18.10e Y=%-18.10e Z=%-18.10e\n"
|
||||
// " R=%-18.10e|dR=%-18.10e | pos=%-8.4f[%-6d+%-8.6f]\n"
|
||||
// " RC: low=(%-18.10e,%-18.10e) high=(%-18.10e,%-18.10e)\n"
|
||||
// " => interp=(%-18.10e,%-18.10e)\n"
|
||||
// " Phase: val=%-18.10e | corr=(%-18.10e,%-18.10e)\n"
|
||||
// " Final: im=(%-18.10e,%-18.10e)\n"
|
||||
// "----------------------------------------\n",
|
||||
// prfid, idx,
|
||||
// AntX, AntY, AntZ,
|
||||
// x_mat[idx], y_mat[idx], z_mat[idx],
|
||||
// R,dR,
|
||||
// pos, index, weight,
|
||||
// rc_low.x, rc_low.y,
|
||||
// rc_high.x, rc_high.y,
|
||||
// rc_interp.x, rc_interp.y,
|
||||
// phase,
|
||||
// phCorr.x, phCorr.y,
|
||||
// im_final[idx].x, im_final[idx].y
|
||||
//);
|
||||
}
|
||||
}
|
||||
|
||||
void bpBasic0CUDA(GPUDATA& data, int flag,double* h_R) {
|
||||
// Phase compensation
|
||||
if (flag == 1) {
|
||||
dim3 block(16, 16);
|
||||
dim3 grid((data.K + 15) / 16, (data.Np + 15) / 16);
|
||||
phaseCompensationKernel << <grid, block >> > (data.phdata, data.Freq, data.R0, data.K, data.Np);
|
||||
PrintLasterError("bpBasic0CUDA Phase compensation");
|
||||
//data.R0 = data.r; // 假设data.r已正确设置
|
||||
}
|
||||
|
||||
// FFT处理
|
||||
cufftHandle plan;
|
||||
cufftPlan1d(&plan, data.Nfft, CUFFT_C2C, data.Np);
|
||||
cufftExecC2C(plan, data.phdata, data.phdata, CUFFT_INVERSE);
|
||||
cufftDestroy(plan);
|
||||
|
||||
// FFT移位
|
||||
dim3 blockShift(256);
|
||||
dim3 gridShift((data.Np + 255) / 256);
|
||||
fftshiftKernel << <gridShift, blockShift >> > (data.phdata, data.Nfft, data.Np);
|
||||
PrintLasterError("bpBasic0CUDA Phase FFT Process");
|
||||
|
||||
printfinfo("fft finished!!\n");
|
||||
// 图像重建
|
||||
|
||||
|
||||
|
||||
double r_start = data.r_vec[0];
|
||||
double dr = (data.r_vec[data.Nfft - 1] - r_start) / (data.Nfft - 1);
|
||||
printfinfo("dr = %f\n",dr);
|
||||
long pixelcount = data.nx* data.ny;
|
||||
long grid_size = (pixelcount + BLOCK_SIZE - 1) / BLOCK_SIZE;
|
||||
printfinfo("grid finished!!\n");
|
||||
|
||||
//double* d_R = (double*)mallocCUDADevice(sizeof(double) * data.nx * data.ny);
|
||||
printfinfo("r_start=%e;dr=%e;nR=%d\n", r_start, dr, data.Nfft);
|
||||
printfinfo("BPimage .....\n");
|
||||
for (long ii = 0; ii < data.Np; ++ii) {
|
||||
processPulseKernel << <grid_size, BLOCK_SIZE >> > (
|
||||
ii,
|
||||
data.nx, data.ny,
|
||||
data.x_mat, data.y_mat, data.z_mat,
|
||||
data.AntX[ii], data.AntY[ii], data.AntZ[ii],
|
||||
data.R0, data.minF[ii],
|
||||
data.phdata,
|
||||
r_start, dr, data.Nfft,
|
||||
data.im_final
|
||||
//,d_R
|
||||
);
|
||||
PrintLasterError("processPulseKernel");
|
||||
if (ii % 1000==0) {
|
||||
printfinfo("\rPRF(%f %) %d / %d\t\t\t\t",(ii*100.0/data.Np), ii,data.Np);
|
||||
}
|
||||
}
|
||||
//FreeCUDADevice(d_R);
|
||||
|
||||
PrintLasterError("bpBasic0CUDA Phase BPimage Process finished!!");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void initGPUData(GPUDATA& h_data, GPUDATA& d_data) {
|
||||
d_data.AntX =h_data.AntX; //(double*)mallocCUDADevice(sizeof(double) * h_data.Np);
|
||||
d_data.AntY = h_data.AntY;//(double*)mallocCUDADevice(sizeof(double) * h_data.Np);
|
||||
d_data.AntZ = h_data.AntZ;// (double*)mallocCUDADevice(sizeof(double) * h_data.Np);
|
||||
d_data.minF = h_data.minF;// (double*)mallocCUDADevice(sizeof(double) * h_data.Np);
|
||||
d_data.x_mat = (double*)mallocCUDADevice(sizeof(double) * h_data.nx * h_data.ny);
|
||||
d_data.y_mat = (double*)mallocCUDADevice(sizeof(double) * h_data.nx * h_data.ny);
|
||||
d_data.z_mat = (double*)mallocCUDADevice(sizeof(double) * h_data.nx * h_data.ny);
|
||||
d_data.r_vec = h_data.r_vec;// (double*)mallocCUDADevice(sizeof(double) * h_data.Nfft);
|
||||
d_data.Freq = (double*)mallocCUDADevice(sizeof(double) * h_data.Nfft);
|
||||
d_data.phdata = (cuComplex*)mallocCUDADevice(sizeof(cuComplex) * h_data.Nfft * h_data.Np);
|
||||
d_data.im_final = (cuComplex*)mallocCUDADevice(sizeof(cuComplex) * h_data.nx * h_data.ny);
|
||||
|
||||
//HostToDevice(h_data.AntX, d_data.AntX,sizeof(double) * h_data.Np);
|
||||
//HostToDevice(h_data.AntY, d_data.AntY,sizeof(double) * h_data.Np);
|
||||
//HostToDevice(h_data.AntZ, d_data.AntZ,sizeof(double) * h_data.Np);
|
||||
//HostToDevice(h_data.minF, d_data.minF,sizeof(double) * h_data.Np);
|
||||
HostToDevice(h_data.x_mat, d_data.x_mat,sizeof(double) * h_data.nx * h_data.ny); printf("image X Copy finished!!!\n");
|
||||
HostToDevice(h_data.y_mat, d_data.y_mat,sizeof(double) * h_data.nx * h_data.ny); printf("image Y Copy finished!!!\n");
|
||||
HostToDevice(h_data.z_mat, d_data.z_mat, sizeof(double) * h_data.nx * h_data.ny); printf("image Z Copy finished!!!\n");
|
||||
HostToDevice(h_data.Freq, d_data.Freq, sizeof(double) * h_data.Nfft);
|
||||
//HostToDevice(h_data.r_vec, d_data.r_vec, sizeof(double) * h_data.Nfft);
|
||||
HostToDevice(h_data.phdata, d_data.phdata, sizeof(cuComplex) * h_data.Nfft * h_data.Np); printf("image echo Copy finished!!!\n");
|
||||
HostToDevice(h_data.im_final, d_data.im_final, sizeof(cuComplex) * h_data.nx * h_data.ny); printf("image data Copy finished!!!\n");
|
||||
|
||||
// 拷贝标量参数
|
||||
d_data.Nfft = h_data.Nfft;
|
||||
d_data.K = h_data.K;
|
||||
d_data.Np = h_data.Np;
|
||||
d_data.nx = h_data.nx;
|
||||
d_data.ny = h_data.ny;
|
||||
d_data.R0 = h_data.R0;
|
||||
d_data.deltaF = h_data.deltaF;
|
||||
}
|
||||
|
||||
void freeGPUData(GPUDATA& d_data) {
|
||||
|
||||
//FreeCUDADevice((d_data.AntX));
|
||||
//FreeCUDADevice((d_data.AntY));
|
||||
//FreeCUDADevice((d_data.AntZ));
|
||||
//FreeCUDADevice((d_data.minF));
|
||||
FreeCUDADevice((d_data.x_mat));
|
||||
FreeCUDADevice((d_data.y_mat));
|
||||
FreeCUDADevice((d_data.z_mat));
|
||||
//FreeCUDADevice((d_data.r_vec));
|
||||
FreeCUDADevice((d_data.Freq));
|
||||
FreeCUDADevice((d_data.phdata));
|
||||
FreeCUDADevice((d_data.im_final));
|
||||
|
||||
}
|
||||
|
||||
void freeHostData(GPUDATA& h_data) {
|
||||
//FreeCUDAHost((h_data.AntX));
|
||||
//FreeCUDAHost((h_data.AntY));
|
||||
//FreeCUDAHost((h_data.AntZ));
|
||||
FreeCUDAHost((h_data.minF));
|
||||
//FreeCUDAHost((h_data.x_mat));
|
||||
//FreeCUDAHost((h_data.y_mat));
|
||||
//FreeCUDAHost((h_data.z_mat));
|
||||
FreeCUDAHost((h_data.r_vec));
|
||||
FreeCUDAHost((h_data.Freq));
|
||||
FreeCUDAHost((h_data.phdata));
|
||||
FreeCUDAHost((h_data.im_final));
|
||||
}
|
||||
|
||||
void BPBasic0(GPUDATA& h_data)
|
||||
{
|
||||
GPUDATA d_data;
|
||||
|
||||
initGPUData(h_data, d_data);
|
||||
|
||||
bpBasic0CUDA(d_data, 0);
|
||||
|
||||
DeviceToHost(h_data.im_final, d_data.im_final, sizeof(cuComplex) * h_data.nx * h_data.ny);
|
||||
freeGPUData(d_data);
|
||||
}
|
||||
|
||||
//int main() {
|
||||
// GPUDATA h_data, d_data;
|
||||
//
|
||||
// // 初始化主机数据
|
||||
// h_data.Nfft = 1024;
|
||||
// h_data.K = 512;
|
||||
// // ... 其他参数初始化
|
||||
//
|
||||
// // 初始化设备内存
|
||||
// initGPUData(h_data, d_data);
|
||||
//
|
||||
// // 执行算法
|
||||
// bpBasic0CUDA(d_data, 0);
|
||||
//
|
||||
// // 拷贝结果回主机
|
||||
// cudaCheckError(cudaMemcpy(h_data.im_final, d_data.im_final,
|
||||
// sizeof(cufftComplex) * h_data.nx * h_data.ny, cudaMemcpyDeviceToHost));
|
||||
//
|
||||
// // 释放资源
|
||||
// freeGPUData(d_data);
|
||||
//
|
||||
// return 0;
|
||||
//}
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
#ifndef _BPBASIC0_CUDA_H_
|
||||
#define _BPBASIC0_CUDA_H_
|
||||
#include <cstdio>
|
||||
#include <cufft.h>
|
||||
#include <cmath>
|
||||
#include <cuda_runtime.h>
|
||||
#include "BaseConstVariable.h"
|
||||
|
||||
//#define cudaCheckError(ans) { gpuAssert((ans), __FILE__, __LINE__); }
|
||||
//inline void gpuAssert(cudaError_t code, const char* file, int line) {
|
||||
// if (code != cudaSuccess) {
|
||||
// fprintf(stderr, "CUDA Error: %s %s %d\n", cudaGetErrorString(code), file, line);
|
||||
// exit(code);
|
||||
// }
|
||||
//}
|
||||
//
|
||||
//#define c LIGHTSPEED
|
||||
|
||||
|
||||
struct GPUDATA {
|
||||
long Nfft, K, Np, nx, ny; // 傅里叶点数、频点数、脉冲数、图像列、图像行
|
||||
double* AntX, * AntY, * AntZ, * minF; // 天线坐标、起始频率
|
||||
double* x_mat, * y_mat, * z_mat;// 地面坐标
|
||||
double* r_vec; // 坐标范围
|
||||
double* Freq;// 频率
|
||||
cuComplex* phdata;// 回波
|
||||
cuComplex* im_final;// 图像
|
||||
double R0; // 参考斜距
|
||||
double deltaF; // 频点范围
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
void bpBasic0CUDA(GPUDATA& data, int flag,double* h_R=nullptr);
|
||||
void initGPUData(GPUDATA& h_data, GPUDATA& d_data);
|
||||
void freeGPUData(GPUDATA& d_data);
|
||||
void freeHostData(GPUDATA& d_data);
|
||||
void BPBasic0(GPUDATA& h_data);
|
||||
};
|
||||
|
||||
#endif
|
|
@ -0,0 +1,255 @@
|
|||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <cmath>
|
||||
#include <complex>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include "GPUBPTool.cuh"
|
||||
|
||||
#include <cmath>
|
||||
#include <stdio.h>
|
||||
#include <cassert>
|
||||
|
||||
#define EPSILON 1e-12
|
||||
#define MAX_ITER 50
|
||||
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
__device__ __host__ double angleBetweenVectors(Vector3 a, Vector3 b, bool returnDegrees ) {
|
||||
// 计算点积
|
||||
double dotProduct = a.x * b.x + a.y * b.y + a.z * b.z;
|
||||
|
||||
// 计算模长
|
||||
double magA = std::sqrt(a.x * a.x + a.y * a.y + a.z * a.z);
|
||||
double magB = std::sqrt(b.x * b.x + b.y * b.y + b.z * b.z);
|
||||
|
||||
// 处理零向量异常
|
||||
if (magA == 0.0 || magB == 0.0) {
|
||||
return NAN;
|
||||
}
|
||||
|
||||
double cosTheta = dotProduct / (magA * magB);
|
||||
cosTheta = cosTheta < -1 ? -1 : cosTheta>1 ? 1 : cosTheta; // 截断到[-1, 1]
|
||||
double angleRad = std::acos(cosTheta);
|
||||
return returnDegrees ? angleRad * 180.0 / M_PI : angleRad;
|
||||
}
|
||||
|
||||
// 向量运算
|
||||
__device__ __host__ Vector3 vec_sub(Vector3 a, Vector3 b) {
|
||||
return { a.x - b.x, a.y - b.y, a.z - b.z };
|
||||
}
|
||||
|
||||
__device__ __host__ double vec_dot(Vector3 a, Vector3 b) {
|
||||
return a.x * b.x + a.y * b.y + a.z * b.z;
|
||||
}
|
||||
|
||||
__device__ __host__ Vector3 vec_cross(Vector3 a, Vector3 b) {
|
||||
return { a.y * b.z - a.z * b.y,
|
||||
a.z * b.x - a.x * b.z,
|
||||
a.x * b.y - a.y * b.x };
|
||||
}
|
||||
|
||||
__device__ __host__ Vector3 vec_normalize(Vector3 v) {
|
||||
double len = sqrt(vec_dot(v, v));
|
||||
return (len > 1e-12) ? Vector3{ v.x / len, v.y / len, v.z / len } : v;
|
||||
}
|
||||
|
||||
|
||||
// 标准正交基底坐标计算
|
||||
__device__ __host__ Vector3 coordinates_orthonormal_basis(Vector3& A,
|
||||
Vector3& e1,
|
||||
Vector3& e2,
|
||||
Vector3& e3) {
|
||||
//// 验证基底正交性和单位长度(容差1e-10)
|
||||
//const double tolerance = 1e-10;
|
||||
//assert(fabs(dot(e1, e2)) < tolerance);
|
||||
//assert(fabs(dot(e1, e3)) < tolerance);
|
||||
//assert(fabs(dot(e2, e3)) < tolerance);
|
||||
//assert(fabs(norm(e1) - 1.0) < tolerance);
|
||||
//assert(fabs(norm(e2) - 1.0) < tolerance);
|
||||
//assert(fabs(norm(e3) - 1.0) < tolerance);
|
||||
|
||||
// 计算投影坐标
|
||||
return Vector3{
|
||||
vec_dot(A, e1),
|
||||
vec_dot(A, e2),
|
||||
vec_dot(A, e3)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 计算视线交点T
|
||||
extern __device__ __host__ Vector3 compute_T(Vector3 S, Vector3 ray, double H) {
|
||||
Vector3 dir = vec_normalize(ray);
|
||||
double a_h = WGS84_A + H;
|
||||
|
||||
double A = (dir.x * dir.x + dir.y * dir.y) / (a_h * a_h) + dir.z * dir.z / (WGS84_B * WGS84_B); // A > 0
|
||||
double B = 2.0 * (S.x * dir.x / (a_h * a_h) + S.y * dir.y / (a_h * a_h) + S.z * dir.z / (WGS84_B * WGS84_B));
|
||||
double C = (S.x * S.x + S.y * S.y) / (a_h * a_h) + S.z * S.z / (WGS84_B * WGS84_B) - 1.0;
|
||||
|
||||
double disc = B * B - 4 * A * C;
|
||||
if (disc < 0) return Vector3{ NAN, NAN, NAN };
|
||||
|
||||
double sqrt_d = sqrt(disc);
|
||||
double t = fmin((-B - sqrt_d) / (2 * A), (-B + sqrt_d) / (2 * A));// 取最小值
|
||||
return (t > 1e-6) ? Vector3{ S.x + dir.x * t, S.y + dir.y * t, S.z + dir.z * t }
|
||||
: Vector3{ NAN, NAN, NAN };
|
||||
}
|
||||
|
||||
// 主计算函数A
|
||||
extern __device__ __host__ Vector3 compute_P(Vector3 S, Vector3 T, double R, double H) {
|
||||
Vector3 ex, ey, ez; // 平面基函数
|
||||
Vector3 ST = vec_normalize(vec_sub(T, S));// S->T
|
||||
Vector3 SO = vec_normalize(vec_sub(Vector3{ 0, 0, 0 }, S)); // S->O
|
||||
Vector3 st1 = vec_sub(T, S);
|
||||
double R0 = sqrt(st1.x * st1.x + st1.y * st1.y + st1.z * st1.z);
|
||||
|
||||
// S (Z .) --------Y
|
||||
// |\
|
||||
// | \
|
||||
// | \
|
||||
// X \
|
||||
// | -> T
|
||||
// | /
|
||||
// | /
|
||||
// | /
|
||||
// |/
|
||||
// O
|
||||
|
||||
|
||||
ez = vec_normalize(vec_cross(SO, ST)); // Z 轴
|
||||
ey = vec_normalize(vec_cross(ez, SO)); // Y 轴 与 ST 同向 --这个结论在星地几何约束,便是显然的;
|
||||
ex = vec_normalize(SO); //X轴
|
||||
// 大致的理论推导
|
||||
// 这里考虑 成像几何,所以点 P 一定在 ex-0-ey 平面上,所以t3=0;
|
||||
// 定义 SP 的向量与 ex的夹角为 theta , 目标长度为 t
|
||||
// t1=t*cos(Q);
|
||||
// t2=t*sin(Q);
|
||||
// h=(a+H)
|
||||
// Xp=Sx+t1*ex.x+t2*ey.x +t3*ez.x; //因为 t3=0;
|
||||
// Yp=Sy+t1*ex.y+t2*ey.y +t3*ez.y;
|
||||
// Zp=Sz+t1*ex.z+t2*ey.z +t3*ez.z;
|
||||
// Xp^2+Yp^2 Zp^2 Xp^2+Yp^2 Zp^2
|
||||
// ---------- + ------- = 1 ==> ---------- + ------- = 1
|
||||
// (a+H)^2 b^2 h^2 b^2
|
||||
double h2 = (WGS84_A + H) * (WGS84_A + H);
|
||||
double b2 = WGS84_B * WGS84_B;
|
||||
double R2 = R * R;
|
||||
double A = R2 * ((ex.x * ex.x + ex.y * ex.y) / h2 + (ex.z * ex.z) / b2);
|
||||
double B = R2 * ((ex.x * ey.x + ex.y * ey.y) / h2 + (ex.z * ey.z) / b2) * 2;
|
||||
double C = R2 * ((ey.x * ey.x + ey.y * ey.y) / h2 + (ey.z * ey.z) / b2);
|
||||
double D = 1 - ((S.x * S.x + S.y * S.y) / h2 + (S.z * S.z) / b2);
|
||||
double E = 2 * R * ((S.x * ex.x + S.y * ex.y) / h2 + (S.z * ex.z) / b2);
|
||||
double F = 2 * R * ((S.x * ey.x + S.y * ey.y) / h2 + (S.z * ey.z) / b2);
|
||||
|
||||
// f(Q)=Acos^2(Q)+Bsin(Q)cos(Q)+Csin^2(Q)+E*cos(Q)+F*sin(Q)-D
|
||||
// f'(Q)=(C−A)sin(2Q)+2Bcos(2Q)-Esin(Q)+Fcos(Q)
|
||||
|
||||
// 牛顿迭代
|
||||
// f(Q)
|
||||
// Q(t+1)=Q - -----------
|
||||
// f'(Q)
|
||||
|
||||
// 求解初始值
|
||||
|
||||
double Q0 = angleBetweenVectors(SO, ST, false);
|
||||
double dQ = 0;
|
||||
double fQ = 0;
|
||||
double dfQ = 0;
|
||||
double Q = R < R0 ? Q0 - 1e-3 : Q0 + 1e-3;
|
||||
|
||||
|
||||
// 牛顿迭代法
|
||||
for (int iter = 0; iter < MAX_ITER * 10; ++iter) {
|
||||
fQ = A * cos(Q) * cos(Q) + B * sin(Q) * cos(Q) + C * sin(Q) * sin(Q) + E * cos(Q) + F * sin(Q) - D;
|
||||
dfQ = (C - A) * sin(2 * Q) + B * cos(2 * Q) - E * sin(Q) + F * cos(Q);
|
||||
dQ = fQ / dfQ;
|
||||
if (abs(dQ) < 1e-8) {
|
||||
break;
|
||||
}
|
||||
else {
|
||||
dQ = abs(dQ) < d2r * 2 ? dQ : abs(dQ) / dQ * d2r;
|
||||
Q = Q - dQ;
|
||||
}
|
||||
}
|
||||
|
||||
double t1 = R * cos(Q);
|
||||
double t2 = R * sin(Q);
|
||||
Vector3 P = {
|
||||
S.x + t1 * ex.x + t2 * ey.x, //因为 t3=0;
|
||||
S.y + t1 * ex.y + t2 * ey.y,
|
||||
S.z + t1 * ex.z + t2 * ey.z,
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 椭球验证
|
||||
double check = (P.x * P.x + P.y * P.y) / ((WGS84_A + H) * (WGS84_A + H))
|
||||
+ P.z * P.z / (WGS84_B * WGS84_B);
|
||||
if (isnan(Q) || isinf(Q) || fabs(check - 1.0) > 1e-6) {
|
||||
return Vector3{ NAN,NAN,NAN };
|
||||
printf("check value =%f\n", fabs(check - 1.0));
|
||||
}
|
||||
|
||||
return P;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//// 参数校验与主函数
|
||||
//int main() {
|
||||
// Vector3 S = { -2.8e6, -4.2e6, 3.5e6 }; // 卫星位置 (m)
|
||||
// Vector3 ray = { 0.6, 0.4, -0.7 }; // 视线方向
|
||||
// double H = 500.0; // 平均高程
|
||||
// double R = 1000.0; // 目标距离
|
||||
//
|
||||
// // 参数校验
|
||||
// if (R <= 0 || H < -WGS84_A * 0.1 || H > WGS84_A * 0.1) {
|
||||
// printf("参数错误:\n H范围:±%.1f km\n R必须>0\n", WGS84_A * 0.1 / 1000);
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// // Step 1: 计算交点T
|
||||
// Vector3 T = compute_T(S, ray, H);
|
||||
// if (isnan(T.x)) {
|
||||
// printf("错误:视线未与椭球相交\n");
|
||||
// return 1;
|
||||
// }
|
||||
//
|
||||
// // Step 2: 计算目标点P
|
||||
// Vector3 P = compute_P(S, T, R, H);
|
||||
//
|
||||
// if (!isnan(P.x)) {
|
||||
// printf("计算结果:\n");
|
||||
// printf("P = (%.3f, %.3f, %.3f) m\n", P.x, P.y, P.z);
|
||||
//
|
||||
// // 验证距离
|
||||
// Vector3 SP = vec_sub(P, S);
|
||||
// double dist = sqrt(vec_dot(SP, SP));
|
||||
// printf("实际距离:%.3f m (期望:%.1f m)\n", dist, R);
|
||||
//
|
||||
// // 验证椭球
|
||||
// double check = (P.x * P.x + P.y * P.y) / ((WGS84_A + H) * (WGS84_A + H))
|
||||
// + P.z * P.z / (WGS84_B * WGS84_B);
|
||||
// printf("椭球验证:%.6f (期望:1.0)\n", check);
|
||||
//
|
||||
// // 验证最近距离
|
||||
// Vector3 PT = vec_sub(P, T);
|
||||
// printf("到T点距离:%.3f m\n", sqrt(vec_dot(PT, PT)));
|
||||
// }
|
||||
// else {
|
||||
// printf("未找到有效解\n");
|
||||
// }
|
||||
//
|
||||
// return 0;
|
||||
//}
|
||||
//
|
|
@ -0,0 +1,19 @@
|
|||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include <cuda_runtime.h>
|
||||
#include <device_launch_parameters.h>
|
||||
#include <cublas_v2.h>
|
||||
#include <cuComplex.h>
|
||||
#include "GPUTool.cuh"
|
||||
|
||||
|
||||
|
||||
extern __device__ __host__ double angleBetweenVectors(Vector3 a, Vector3 b, bool returnDegrees = false);
|
||||
extern __device__ __host__ Vector3 vec_sub(Vector3 a, Vector3 b);
|
||||
extern __device__ __host__ double vec_dot(Vector3 a, Vector3 b);
|
||||
extern __device__ __host__ Vector3 vec_cross(Vector3 a, Vector3 b);
|
||||
extern __device__ __host__ Vector3 vec_normalize(Vector3 v);
|
||||
extern __device__ __host__ Vector3 compute_T(Vector3 S, Vector3 ray_dir, double H);
|
||||
//
|
||||
extern __device__ __host__ Vector3 compute_P(Vector3 S, Vector3 T, double R, double H );
|
||||
|
|
@ -19,13 +19,20 @@
|
|||
/* »úÆ÷º¯Êý ****************************************************************************************************************************/
|
||||
|
||||
|
||||
__device__ double GPU_getSigma0dB(CUDASigmaParam param, double theta) {//ÏßÐÔÖµ
|
||||
extern __host__ __device__ double GPU_getSigma0dB(CUDASigmaParam param, double theta) {//ÏßÐÔÖµ
|
||||
double sigma = param.p1 + param.p2 * exp(-param.p3 * theta) + param.p4 * cos(param.p5 * theta + param.p6);
|
||||
return sigma;
|
||||
}
|
||||
|
||||
extern __host__ __device__ double GPU_getSigma0dB(
|
||||
const double p1, const double p2, const double p3, const double p4, const double p5, const double p6,
|
||||
double theta) {//ÏßÐÔÖµ
|
||||
return p1 + p2 * exp(-p3 * theta) + p4 * cos(p5 * theta + p6);
|
||||
}
|
||||
|
||||
__device__ CUDAVectorEllipsoidal GPU_SatelliteAntDirectNormal(
|
||||
|
||||
|
||||
extern __host__ __device__ CUDAVectorEllipsoidal GPU_SatelliteAntDirectNormal(
|
||||
double RstX, double RstY, double RstZ,
|
||||
double AntXaxisX, double AntXaxisY, double AntXaxisZ,
|
||||
double AntYaxisX, double AntYaxisY, double AntYaxisZ,
|
||||
|
@ -104,7 +111,7 @@ __device__ CUDAVectorEllipsoidal GPU_SatelliteAntDirectNormal(
|
|||
return result;
|
||||
}
|
||||
|
||||
__device__ double GPU_BillerInterpAntPattern(double* antpattern,
|
||||
extern __host__ __device__ double GPU_BillerInterpAntPattern(double* antpattern,
|
||||
double starttheta, double startphi, double dtheta, double dphi,
|
||||
long thetapoints, long phipoints,
|
||||
double searththeta, double searchphi) {
|
||||
|
@ -230,14 +237,14 @@ __global__ void CUDA_Kernel_Computer_R_amp(
|
|||
antVector.phi = antVector.phi * r2d;
|
||||
//printf("theta: %f , phi: %f \n", antVector.theta, antVector.phi);
|
||||
if (antVector.Rho > 0) {
|
||||
double TansantPatternGain = GPU_BillerInterpAntPattern(
|
||||
TransAntpattern,
|
||||
Transtarttheta, Transstartphi, Transdtheta, Transdphi, Transthetapoints, Transphipoints,
|
||||
antVector.theta, antVector.phi);
|
||||
double antPatternGain = GPU_BillerInterpAntPattern(
|
||||
ReceiveAntpattern,
|
||||
Receivestarttheta, Receivestartphi, Receivedtheta, Receivedphi, Receivethetapoints, Receivephipoints,
|
||||
antVector.theta, antVector.phi);
|
||||
//double TansantPatternGain = GPU_BillerInterpAntPattern(
|
||||
// TransAntpattern,
|
||||
// Transtarttheta, Transstartphi, Transdtheta, Transdphi, Transthetapoints, Transphipoints,
|
||||
// antVector.theta, antVector.phi);
|
||||
//double antPatternGain = GPU_BillerInterpAntPattern(
|
||||
// ReceiveAntpattern,
|
||||
// Receivestarttheta, Receivestartphi, Receivedtheta, Receivedphi, Receivethetapoints, Receivephipoints,
|
||||
// antVector.theta, antVector.phi);
|
||||
|
||||
double sigma0 = 0;
|
||||
{
|
||||
|
@ -260,7 +267,8 @@ __global__ void CUDA_Kernel_Computer_R_amp(
|
|||
sigma0 = powf(10.0, sigma / 10.0);
|
||||
}
|
||||
}
|
||||
ampGain = TansantPatternGain * antPatternGain;
|
||||
//ampGain = TansantPatternGain * antPatternGain;
|
||||
ampGain = 1;
|
||||
//if (10 * log10(ampGain / maxReceiveAntPatternValue / maxTransAntPatternValue) < -3) { // СÓÚ-3dB
|
||||
// d_temp_R[idx] = 0;
|
||||
// d_temp_amps[idx] = 0;
|
||||
|
|
|
@ -22,15 +22,24 @@ extern "C" struct CUDASigmaParam {
|
|||
|
||||
|
||||
|
||||
extern __host__ __device__ double GPU_getSigma0dB(
|
||||
const double p1, const double p2, const double p3, const double p4, const double p5, const double p6,
|
||||
double theta);
|
||||
|
||||
extern __host__ __device__ double GPU_getSigma0dB(CUDASigmaParam param, double theta);
|
||||
|
||||
extern __host__ __device__ CUDAVectorEllipsoidal GPU_SatelliteAntDirectNormal(
|
||||
double RstX, double RstY, double RstZ,
|
||||
double AntXaxisX, double AntXaxisY, double AntXaxisZ,
|
||||
double AntYaxisX, double AntYaxisY, double AntYaxisZ,
|
||||
double AntZaxisX, double AntZaxisY, double AntZaxisZ,
|
||||
double AntDirectX, double AntDirectY, double AntDirectZ
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern __host__ __device__ double GPU_BillerInterpAntPattern(double* antpattern,
|
||||
double starttheta, double startphi, double dtheta, double dphi,
|
||||
long thetapoints, long phipoints,
|
||||
double searththeta, double searchphi);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
@ -12,101 +12,445 @@
|
|||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include "GPUTBPImage.cuh"
|
||||
#include "GPUBPTool.cuh"
|
||||
|
||||
#ifdef __CUDANVCC___
|
||||
#define EPSILON 1e-12
|
||||
#define MAX_ITER 50
|
||||
|
||||
// 定义参数
|
||||
__device__ cuComplex cuCexpf(cuComplex d)
|
||||
{
|
||||
float factor = exp(d.x);
|
||||
return make_cuComplex(factor * cos(d.y), factor * sin(d.y));
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.14159265358979323846
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
__global__ void kernel_TimeBPImageGridNet(double* antPx, double* antPy, double* antPz,
|
||||
double* antDirx, double* antDiry, double* antDirz,
|
||||
double* imgx, double* imgy, double* imgz,
|
||||
long prfcount, long freqpoints, double meanH,
|
||||
double Rnear, double dx, double RefRange) {
|
||||
|
||||
long idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
long pixelcount = prfcount * freqpoints;
|
||||
long prfid = idx / freqpoints;
|
||||
long Rid = idx % freqpoints;
|
||||
if (idx < pixelcount) {
|
||||
// 计算坐标
|
||||
Vector3 S = { antPx[prfid], antPy[prfid], antPz[prfid] }; // 卫星位置 (m)
|
||||
Vector3 ray = { antDirx[prfid], antDiry[prfid], antDirz[prfid] }; // 视线方向
|
||||
double H = meanH; // 平均高程
|
||||
double R = Rnear + dx * Rid; // 目标距离
|
||||
// 参数校验
|
||||
if (R <= 0 || H < -WGS84_A * 0.1 || H > WGS84_A * 0.1) {
|
||||
//printf("参数错误:\n H范围:±%.1f km\n R必须>0\n", WGS84_A * 0.1 / 1000);
|
||||
imgx[idx] = NAN;
|
||||
imgy[idx] = NAN;
|
||||
imgz[idx] = NAN;
|
||||
//printf("idx=%d;prfid=%d;Rid=%d;S=[%f , %f ,%f ];ray=[%f ,%f ,%f ];H=%f;R=%f,imgP=[%f ,%f , %f ];Rextend\n",
|
||||
// idx, prfid, Rid, S.x, S.y, S.z, ray.x, ray.y, ray.z, H, R,imgx[idx],imgy[idx],imgz[idx]);
|
||||
// 参数校验
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 1: 计算交点T
|
||||
Vector3 T = compute_T(S, ray, H);
|
||||
if (isnan(T.x)) {
|
||||
imgx[idx] = NAN;
|
||||
imgy[idx] = NAN;
|
||||
imgz[idx] = NAN;
|
||||
//printf("idx=%d;prfid=%d;Rid=%d;Tnan\n",
|
||||
// idx, prfid, Rid, S.x, S.y, S.z, ray.x, ray.y, ray.z, H, R,T.x,T.y,T.z, imgx[idx], imgy[idx], imgz[idx]);
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 2: 计算目标点P
|
||||
|
||||
Vector3 P;// = compute_P(S, T, R, H);
|
||||
{ // 计算P
|
||||
Vector3 ex, ey, ez; // 平面基函数
|
||||
Vector3 ST = vec_normalize(vec_sub(T, S));// S->T
|
||||
Vector3 SO = vec_normalize(vec_sub(Vector3{ 0, 0, 0 }, S)); // S->O
|
||||
|
||||
|
||||
Vector3 st1 = vec_sub(T, S);
|
||||
double R0 = sqrt(st1.x * st1.x + st1.y * st1.y + st1.z * st1.z);
|
||||
ez = vec_normalize(vec_cross(SO, ST)); // Z 轴
|
||||
ey = vec_normalize(vec_cross(ez, SO)); // Y 轴 与 ST 同向 --这个结论在星地几何约束,便是显然的;
|
||||
ex = vec_normalize(SO); //X轴
|
||||
|
||||
|
||||
|
||||
double h2 = (WGS84_A + H) * (WGS84_A + H);
|
||||
double b2 = WGS84_B * WGS84_B;
|
||||
double R2 = R * R;
|
||||
double A = R2 * ((ex.x * ex.x + ex.y * ex.y) / h2 + (ex.z * ex.z) / b2);
|
||||
double B = R2 * ((ex.x * ey.x + ex.y * ey.y) / h2 + (ex.z * ey.z) / b2) * 2;
|
||||
double C = R2 * ((ey.x * ey.x + ey.y * ey.y) / h2 + (ey.z * ey.z) / b2);
|
||||
double D = 1 - ((S.x * S.x + S.y * S.y) / h2 + (S.z * S.z) / b2);
|
||||
double E = 2*R * ((S.x * ex.x + S.y * ex.y) / h2 + (S.z * ex.z) / b2);
|
||||
double F = 2*R * ((S.x * ey.x + S.y * ey.y) / h2 + (S.z * ey.z) / b2);
|
||||
double Q0 = angleBetweenVectors(SO, ST, false);
|
||||
double dQ = 0;
|
||||
double fQ = 0;
|
||||
double dfQ = 0;
|
||||
double Q = R < R0 ? Q0 - 1e-3 : Q0 + 1e-3;
|
||||
|
||||
//printf("A=%f;B=%f;C=%f;D=%f;E=%f;F=%f;Q=%f;\
|
||||
// S=[%f , %f ,%f ];\
|
||||
// T=[%f , %f ,%f ];\
|
||||
// ex=[%f , %f ,%f ];\
|
||||
// ey=[%f , %f ,%f ];\
|
||||
// ez=[%f , %f ,%f ];\
|
||||
//ray=[%f ,%f ,%f ];\
|
||||
//H=%f;R=%f;;\n",A,B,C,D,E,F,Q,
|
||||
// S.x,S.y,S.z,
|
||||
// T.x,T.y,T.z ,
|
||||
// ex.x,ex.y,ex.z,
|
||||
// ey.x,ey.y,ey.z,
|
||||
// ez.x,ez.y,ez.z,
|
||||
// ray.x, ray.y, ray.z,
|
||||
// H, R);
|
||||
// return;
|
||||
|
||||
// 牛顿迭代法
|
||||
for (int iter = 0; iter < MAX_ITER * 10; ++iter) {
|
||||
fQ = A * cos(Q) * cos(Q) + B * sin(Q) * cos(Q) + C * sin(Q) * sin(Q) + E * cos(Q) + F * sin(Q) - D;
|
||||
dfQ = (C - A) * sin(2 * Q) + B * cos(2 * Q) - E * sin(Q) + F * cos(Q);
|
||||
dQ = fQ / dfQ;
|
||||
if (abs(dQ) < 1e-8) {
|
||||
//printf("iter=%d;check Q0=%f;Q=%f;dQ=%f;fQ=%f;dfQ=%f;break\n", iter, Q0, Q, dQ, fQ, dfQ);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
dQ = (abs(dQ) < d2r * 3) ? dQ :( abs(dQ) / dQ * d2r* 3);
|
||||
Q = Q - dQ;
|
||||
//printf("iter=%d;check Q0=%f;Q=%f;dQ=%f;fQ=%f;dfQ=%f;\n", iter, Q0, Q, dQ, fQ, dfQ);
|
||||
}
|
||||
|
||||
}
|
||||
//printf("check Q0=%f;Q=%f;\n", Q0, Q);
|
||||
double t1 = R * cos(Q);
|
||||
double t2 = R * sin(Q);
|
||||
P = Vector3{
|
||||
S.x + t1 * ex.x + t2 * ey.x, //因为 t3=0;
|
||||
S.y + t1 * ex.y + t2 * ey.y,
|
||||
S.z + t1 * ex.z + t2 * ey.z,
|
||||
};
|
||||
double check = (P.x * P.x + P.y * P.y) / ((WGS84_A + H) * (WGS84_A + H))
|
||||
+ P.z * P.z / (WGS84_B * WGS84_B);
|
||||
if (isnan(Q) || isinf(Q) || fabs(check - 1.0) > 1e-6) {
|
||||
P = Vector3{ NAN,NAN,NAN };
|
||||
}
|
||||
}
|
||||
|
||||
double Rt = sqrt(pow(S.x - T.x, 2) + pow(S.y - T.y, 2) + pow(S.z - T.z, 2));
|
||||
double Rp = sqrt(pow(S.x - P.x, 2) + pow(S.y - P.y, 2) + pow(S.z - P.z, 2));
|
||||
double Rop = sqrt(pow( P.x, 2) + pow( P.y, 2) + pow( P.z, 2));
|
||||
|
||||
if (!isnan(P.x)&&( Rop>WGS84_A*0.3)&&(Rop<WGS84_A*3)) {
|
||||
|
||||
imgx[idx] = P.x;
|
||||
imgy[idx] = P.y;
|
||||
imgz[idx] = P.z;
|
||||
|
||||
//printf("idx=%d; S=[%f , %f ,%f ]; H=%f;R=%f;RP=%f;Rr=%f;imgT=[%f ,%f ,%f ];imgP=[%f ,%f , %f ]; \n",
|
||||
// idx, S.x, S.y, S.z, H, R, Rp, Rt,T.x, T.y, T.z, P.x, P.y, P.z);
|
||||
}
|
||||
else {
|
||||
imgx[idx] = NAN;
|
||||
imgy[idx] = NAN;
|
||||
imgz[idx] = NAN;
|
||||
printf("idx=%d; S=[%f , %f ,%f ]; H=%f;R=%f;RP=%f;Rr=%f;imgT=[%f ,%f ,%f ];imgP=[%f ,%f , %f ]; ERROR\n",
|
||||
idx, S.x, S.y, S.z, H, R, Rp, Rt, T.x, T.y, T.z, P.x, P.y, P.z);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
__global__ void CUDA_TBPImage(
|
||||
float* antPx, float* antPy, float* antPz,
|
||||
float* imgx, float* imgy, float* imgz,
|
||||
float* RArr,
|
||||
long* Cids,
|
||||
cuComplex* echoArr,
|
||||
cuComplex* imgArr,
|
||||
cuComplex* imgEchoArr,
|
||||
float freq, float fs, float Rnear, float Rfar,
|
||||
long rowcount, long colcount,
|
||||
long prfid, long freqcount
|
||||
|
||||
|
||||
|
||||
|
||||
__device__ double computerR(double& Px, double& Py, double& Pz, double& Tx, double& Ty, double& Tz) {
|
||||
//double R= sqrt((Px - Tx) * (Px - Tx) + (Py - Ty) * (Py - Ty) + (Pz - Tz) * (Pz - Tz));
|
||||
//if (R > 900000) {
|
||||
// printf("R=%f\n", R);
|
||||
//}
|
||||
//return R;
|
||||
|
||||
return sqrt((Px - Tx) * (Px - Tx) + (Py - Ty) * (Py - Ty) + (Pz - Tz) * (Pz - Tz));
|
||||
}
|
||||
|
||||
|
||||
|
||||
__device__ void updateBPImage(
|
||||
long prfid, long pixelidx,double R,double LRrange,
|
||||
cuComplex* TimeEchoArr, long prfcount, long pointCount,
|
||||
cuComplex* imgArr,
|
||||
double startLamda, double Rnear, double dx, double RefRange, double Rfar
|
||||
) {
|
||||
int idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
//printf("\nidx:\t %d %d %d\n", idx, linecount, plusepoint);
|
||||
if (idx < rowcount * colcount) {
|
||||
double ridx = (R - LRrange) / dx; // 获取范围
|
||||
if (ridx < 0 || ridx >= pointCount) {
|
||||
return;
|
||||
}
|
||||
else {}
|
||||
|
||||
long Ridx0 = floor(ridx);
|
||||
long Ridx1 = ceil(ridx);
|
||||
|
||||
long pid0 = prfid * pointCount + Ridx0;
|
||||
long pid1 = prfid * pointCount + Ridx1;
|
||||
|
||||
cuComplex s0 = TimeEchoArr[pid0];
|
||||
cuComplex s1 = TimeEchoArr[pid1];
|
||||
|
||||
|
||||
float px = antPx[prfid];
|
||||
float py = antPy[prfid];
|
||||
float pz = antPz[prfid];
|
||||
if (isinf(s0.x) || isinf(s0.y) || isinf(s1.x) || isinf(s1.y)) {
|
||||
return;
|
||||
}
|
||||
|
||||
float tx = imgx[idx];
|
||||
float ty = imgy[idx];
|
||||
float tz = imgz[idx];
|
||||
cuComplex s = make_cuComplex(
|
||||
s0.x + (s1.x - s0.x) * (ridx-Ridx0), // real
|
||||
s0.y + (s1.y - s0.y) * (ridx-Ridx0) // imag
|
||||
);
|
||||
double phi = 4 * PI / startLamda * (R - RefRange);
|
||||
|
||||
float R = sqrtf((px-tx) * (px - tx) + (py-ty) * (py-ty) + (pz-tz) * (pz-tz));
|
||||
float Cidf= 2 * (R - Rnear) / LIGHTSPEED * fs;
|
||||
long Cid = floorf(Cidf);
|
||||
RArr[idx] = R;
|
||||
Cids[idx] = Cid;
|
||||
if(Cid <0|| Cid >= freqcount){}
|
||||
else {
|
||||
float factorj = freq * 4 * PI / LIGHTSPEED;
|
||||
cuComplex Rfactorj = make_cuComplex(0, factorj * R);
|
||||
cuComplex Rphi =cuCexpf(Rfactorj);// 校正项
|
||||
cuComplex echotemp = echoArr[prfid * freqcount + Cid];
|
||||
imgEchoArr[idx] = echotemp;
|
||||
imgArr[idx] = cuCaddf(imgArr[idx], cuCmulf(echotemp, Rphi));// 矫正
|
||||
//printf("R=%f;Rid=%d;factorj=%f;Rfactorj=complex(%f,%f);Rphi=complex(%f,%f);\n", R, Rid, factorj,
|
||||
// Rfactorj.x, Rfactorj.y,
|
||||
// Rphi.x, Rphi.y);
|
||||
// exp(ix)=cos(x)+isin(x)
|
||||
cuComplex phiCorr = make_cuComplex(cos(phi), sin(phi));
|
||||
s = cuCmulf(s, phiCorr); // 校正后
|
||||
|
||||
imgArr[pixelidx] = cuCaddf(imgArr[pixelidx], s);
|
||||
//imgArr[pixelidx] = cuCaddf(imgArr[pixelidx], make_cuComplex(1,1));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 分块计算
|
||||
__device__ void segmentBPImage(
|
||||
double* antPx, double* antPy, double* antPz,
|
||||
double Tx, double Ty, double Tz,
|
||||
cuComplex* TimeEchoArr, long prfcount, long pointCount,
|
||||
cuComplex* imgArr,
|
||||
double startLamda, double Rnear, double dx, double RefRange, double Rfar,
|
||||
long startSegmentPrfId,long pixelID // 分段起始prfid
|
||||
) {
|
||||
// 计算单条脉冲范围
|
||||
double Rrange = pointCount * dx;// 成像范围
|
||||
double LRrange = RefRange - Rrange / 2;//左范围
|
||||
double RRrange = RefRange + Rrange / 2;
|
||||
|
||||
long currentprfid = 0;
|
||||
// 0
|
||||
currentprfid = startSegmentPrfId + 0;
|
||||
double Px = antPx[currentprfid];
|
||||
double Py = antPy[currentprfid];
|
||||
double Pz = antPz[currentprfid];
|
||||
double R0 = computerR(Px, Py, Pz, Tx, Ty, Tz);
|
||||
|
||||
|
||||
if (LRrange <= R0 && R0 <= RRrange) {
|
||||
updateBPImage(
|
||||
currentprfid, pixelID, R0, LRrange,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
}
|
||||
|
||||
// 10
|
||||
currentprfid = startSegmentPrfId + 10;
|
||||
Px = antPx[currentprfid];
|
||||
Py = antPy[currentprfid];
|
||||
Pz = antPz[currentprfid];
|
||||
double R10 = computerR(Px, Py, Pz, Tx, Ty, Tz);
|
||||
if (Rnear <= R10 && R10 <= RRrange) {
|
||||
updateBPImage(
|
||||
currentprfid, pixelID, R10, LRrange,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//19
|
||||
currentprfid = startSegmentPrfId + 19;
|
||||
Px = antPx[currentprfid];
|
||||
Py = antPy[currentprfid];
|
||||
Pz = antPz[currentprfid];
|
||||
double R19 = computerR(Px, Py, Pz, Tx, Ty, Tz);
|
||||
if (Rnear <= R19 && R19 <= RRrange) {
|
||||
updateBPImage(
|
||||
currentprfid, pixelID, R19, LRrange,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
}
|
||||
|
||||
// 判断是否需要处理
|
||||
|
||||
if (R0 < LRrange && R10 < LRrange && R19 < LRrange ) { // 越界、不处理
|
||||
return;
|
||||
}
|
||||
else if (R0 > RRrange && R10 > RRrange && R19 > RRrange) {// 越界、不处理
|
||||
return;
|
||||
}
|
||||
else {}
|
||||
|
||||
|
||||
|
||||
|
||||
double R = 0;
|
||||
#pragma unroll
|
||||
for (long i = 1; i < 10; i++) {
|
||||
currentprfid = startSegmentPrfId + i;
|
||||
if (currentprfid < prfcount) {
|
||||
Px = antPx[currentprfid];
|
||||
Py = antPy[currentprfid];
|
||||
Pz = antPz[currentprfid];
|
||||
R = computerR(Px, Py, Pz, Tx, Ty, Tz);
|
||||
updateBPImage(
|
||||
currentprfid, pixelID, R, LRrange,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma unroll
|
||||
for (long i = 11; i < 20; i++) {
|
||||
currentprfid = startSegmentPrfId + i;
|
||||
if (currentprfid < prfcount) {
|
||||
Px = antPx[currentprfid];
|
||||
Py = antPy[currentprfid];
|
||||
Pz = antPz[currentprfid];
|
||||
R = computerR(Px, Py, Pz, Tx, Ty, Tz);
|
||||
updateBPImage(
|
||||
currentprfid, pixelID, R, LRrange,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
extern "C" void CUDATBPImage(float* antPx, float* antPy, float* antPz,
|
||||
float* imgx, float* imgy, float* imgz,
|
||||
float* R,
|
||||
long* Cids,
|
||||
cuComplex* echoArr,
|
||||
cuComplex* imgArr,
|
||||
cuComplex* imgEchoArr,
|
||||
float freq, float fs, float Rnear, float Rfar,
|
||||
long rowcount, long colcount,
|
||||
long prfid, long freqcount)
|
||||
{
|
||||
int blockSize = 256; // 每个块的线程数
|
||||
int numBlocks = (rowcount * colcount + blockSize - 1) / blockSize; // 根据 pixelcount 计算网格大小
|
||||
//printf("\nCUDA_RFPC_SiglePRF blockSize:%d ,numBlock:%d\n",blockSize,numBlocks);
|
||||
// 调用 CUDA 核函数 CUDA_RFPC_Kernel
|
||||
|
||||
CUDA_TBPImage << <numBlocks, blockSize >> > (
|
||||
antPx, antPy, antPz,
|
||||
imgx, imgy, imgz,
|
||||
R, Cids,
|
||||
echoArr, imgArr, imgEchoArr,
|
||||
freq, fs, Rnear, Rfar,
|
||||
rowcount, colcount,
|
||||
prfid, freqcount
|
||||
);
|
||||
|
||||
|
||||
#ifdef __CUDADEBUG__
|
||||
cudaError_t err = cudaGetLastError();
|
||||
if (err != cudaSuccess) {
|
||||
printf("CUDATBPImage CUDA Error: %s\n", cudaGetErrorString(err));
|
||||
exit(2);
|
||||
|
||||
__global__ void kernel_pixelTimeBP(
|
||||
double* antPx, double* antPy, double* antPz,
|
||||
double* imgx, double* imgy, double* imgz,
|
||||
cuComplex* TimeEchoArr, long prfcount, long pointCount,
|
||||
cuComplex* imgArr, long imH, long imW,
|
||||
double startLamda, double Rnear, double dx,double RefRange,double Rfar
|
||||
) {
|
||||
long idx = blockIdx.x * blockDim.x + threadIdx.x;
|
||||
long pixelcount = imH * imW;
|
||||
if (idx < pixelcount) {
|
||||
|
||||
double Tx = imgx[idx]; // 地面坐标点
|
||||
double Ty = imgy[idx];
|
||||
double Tz = imgz[idx];
|
||||
double Rrange = pointCount * dx;// 成像范围
|
||||
double LRrange = RefRange - Rrange / 2;//左范围
|
||||
double RRrange = RefRange + Rrange / 2;
|
||||
|
||||
for (long segid = 0; segid < prfcount; segid = segid + 20) {
|
||||
long seglen = prfcount - segid;
|
||||
if (seglen < 20) {
|
||||
for (long i = 1; i < 10; i++) {
|
||||
long currentprfid = segid + i;
|
||||
if (currentprfid < prfcount) {
|
||||
double Px = antPx[currentprfid];
|
||||
double Py = antPy[currentprfid];
|
||||
double Pz = antPz[currentprfid];
|
||||
double R = computerR(Px, Py, Pz, Tx, Ty, Tz);
|
||||
updateBPImage(
|
||||
currentprfid, idx, R, LRrange,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 判断范围
|
||||
segmentBPImage(
|
||||
antPx, antPy, antPz,
|
||||
Tx, Ty, Tz,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr,
|
||||
startLamda, Rnear, dx, RefRange, Rfar,
|
||||
segid, idx
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#endif // __CUDADEBUG__
|
||||
cudaDeviceSynchronize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern "C" {
|
||||
void TIMEBPCreateImageGrid(double* antPx, double* antPy, double* antPz,
|
||||
double* antDirx, double* antDiry, double* antDirz,
|
||||
double* imgx, double* imgy, double* imgz,
|
||||
long prfcount, long freqpoints, double meanH,
|
||||
double Rnear, double dx, double RefRange
|
||||
)
|
||||
{
|
||||
long pixelcount = prfcount * freqpoints;
|
||||
int grid_size = (pixelcount + BLOCK_SIZE - 1) / BLOCK_SIZE;
|
||||
|
||||
kernel_TimeBPImageGridNet << <grid_size, BLOCK_SIZE >> > (
|
||||
antPx, antPy, antPz,
|
||||
antDirx, antDiry, antDirz,
|
||||
imgx, imgy, imgz,
|
||||
prfcount, freqpoints, meanH,
|
||||
Rnear, dx, RefRange);
|
||||
PrintLasterError("TIMEBPCreateImageGrid");
|
||||
cudaDeviceSynchronize();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TimeBPImage(
|
||||
double* antPx, double* antPy, double* antPz,
|
||||
double* imgx, double* imgy, double* imgz,
|
||||
cuComplex* TimeEchoArr, long prfcount, long pointCount,
|
||||
cuComplex* imgArr, long imH, long imW,
|
||||
double startLamda, double Rnear, double dx, double RefRange,double Rfar
|
||||
)
|
||||
{
|
||||
long pixelcount = imH * imW;
|
||||
int grid_size = (pixelcount + BLOCK_SIZE - 1) / BLOCK_SIZE;
|
||||
|
||||
kernel_pixelTimeBP << <grid_size, BLOCK_SIZE >> > (
|
||||
antPx, antPy, antPz,
|
||||
imgx, imgy, imgz,
|
||||
TimeEchoArr, prfcount, pointCount,
|
||||
imgArr, imH, imW,
|
||||
startLamda, Rnear, dx, RefRange, Rfar
|
||||
);
|
||||
|
||||
PrintLasterError("TimeBPImage");
|
||||
cudaDeviceSynchronize();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -11,30 +11,24 @@
|
|||
|
||||
|
||||
|
||||
extern __global__ void CUDA_TBPImage(
|
||||
float* antPx, float* antPy, float* antPz,
|
||||
float* imgx, float* imgy, float* imgz, float* R,
|
||||
cuComplex* echoArr, cuComplex* imgArr,
|
||||
float freq, float fs, float Rnear, float Rfar,
|
||||
long rowcount, long colcount,
|
||||
long prfid, long freqcount
|
||||
extern "C" void TIMEBPCreateImageGrid(
|
||||
double* antPx,double* antPy,double* antPz, // ÎÀÐÇ×ø±ê S
|
||||
double* antDirx,double* antDiry,double* antDirz, //
|
||||
double* imgx,double* imgy,double* imgz,
|
||||
long prfcount,long freqpoints,double meanH,
|
||||
double Rnear,double dx,double RefRange
|
||||
);
|
||||
|
||||
extern "C" void CUDATBPImage(
|
||||
float* antPx,
|
||||
float* antPy,
|
||||
float* antPz,
|
||||
float* imgx,
|
||||
float* imgy,
|
||||
float* imgz,
|
||||
float* R,
|
||||
long* Cids,
|
||||
cuComplex* echoArr,
|
||||
cuComplex* imgArr,
|
||||
cuComplex* imgEchoArr,
|
||||
float freq, float fs, float Rnear, float Rfar,
|
||||
long rowcount, long colcount,
|
||||
long prfid, long freqcount
|
||||
|
||||
|
||||
extern "C" void TimeBPImage(
|
||||
double* antPx, double* antPy, double* antPz,
|
||||
double* imgx, double* imgy, double* imgz,
|
||||
cuComplex* TimeEchoArr, long prfcount, long pointCount,
|
||||
cuComplex* imgArr, long imH, long imW,
|
||||
double startLamda, double Rnear, double dx, double RefRange,double Rfar
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -177,15 +177,15 @@ void QImageSARRFPC::onBtnaccept()
|
|||
|
||||
// 打印参数
|
||||
// 打印解析的参数
|
||||
std::cout << "GPS XML Path: " << GPSXmlPath.toStdString() << "\n"
|
||||
<< "Task XML Path: " << TaskXmlPath.toStdString() << "\n"
|
||||
<< "DEM TIFF Path: " << demTiffPath.toStdString() << "\n"
|
||||
<< "Land Cover Path: " << landConverPath.toStdString() << "\n"
|
||||
qDebug() << "GPS XML Path: " << GPSXmlPath << "\n"
|
||||
<< "Task XML Path: " << TaskXmlPath << "\n"
|
||||
<< "DEM TIFF Path: " << demTiffPath<< "\n"
|
||||
<< "Land Cover Path: " << landConverPath << "\n"
|
||||
|
||||
<< "Trans AntPattern Path: " << TransAntPatternFilePath.toStdString() << "\n"
|
||||
<< "Reception AntPattern Path: " << ReceiveAntPatternFilePath.toStdString() << "\n"
|
||||
<< "Output Path: " << OutEchoPath.toStdString() << "\n"
|
||||
<< "Simulation Task Name: " << simulationtaskName.toStdString() << "\n";
|
||||
<< "Trans AntPattern Path: " << TransAntPatternFilePath << "\n"
|
||||
<< "Reception AntPattern Path: " << ReceiveAntPatternFilePath << "\n"
|
||||
<< "Output Path: " << OutEchoPath << "\n"
|
||||
<< "Simulation Task Name: " << simulationtaskName << "\n";
|
||||
|
||||
long cpucore_num = std::thread::hardware_concurrency();
|
||||
|
||||
|
|
|
@ -9,14 +9,19 @@
|
|||
|
||||
|
||||
QSimulationBPImage::QSimulationBPImage(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
: QDialog(parent),ui(new Ui::QSimulationBPImageClass)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QObject::connect(ui->pushButtonEchoSelect, SIGNAL(clicked()), this, SLOT(onpushButtonEchoSelectClicked()));
|
||||
QObject::connect(ui->pushButtonImageSelect, SIGNAL(clicked()), this, SLOT(onpushButtonImageSelectClicked()));
|
||||
QObject::connect(ui->GridNetBtn, SIGNAL(clicked()), this, SLOT(onpushButtonGridNetSelectClicked()));
|
||||
QObject::connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(onbtnaccepted()));
|
||||
QObject::connect(ui->buttonBox, SIGNAL(rejected()), this, SLOT(onbtnrejected()));
|
||||
QObject::connect(ui->checkBox, SIGNAL(stateChanged(int)), this, SLOT(oncheckboxTrigged(int)));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -62,6 +67,7 @@ void QSimulationBPImage::onpushButtonImageSelectClicked()
|
|||
|
||||
void QSimulationBPImage::onbtnaccepted()
|
||||
{
|
||||
this->hide();
|
||||
QString echofile = this->ui->lineEditEchoPath->text().trimmed();
|
||||
QString outImageFolder = getParantFromPath(this->ui->lineEditImagePath->text().trimmed());
|
||||
QString imagename = getFileNameFromPath(this->ui->lineEditImagePath->text().trimmed());
|
||||
|
@ -76,7 +82,14 @@ void QSimulationBPImage::onbtnaccepted()
|
|||
imagL1->setFarRange(echoL0ds->getFarRange());
|
||||
imagL1->setFs(echoL0ds->getFs());
|
||||
imagL1->setLookSide(echoL0ds->getLookSide());
|
||||
imagL1->OpenOrNew(outImageFolder, imagename, echoL0ds->getPluseCount(), echoL0ds->getPlusePoints());
|
||||
|
||||
if (ui->checkBox->isChecked()) {
|
||||
gdalImage imgxyzimg(ui->lineEdit->text().trimmed());
|
||||
imagL1->OpenOrNew(outImageFolder, imagename, imgxyzimg.height, imgxyzimg.width);
|
||||
}
|
||||
else {
|
||||
imagL1->OpenOrNew(outImageFolder, imagename, echoL0ds->getPluseCount(), echoL0ds->getPlusePoints());
|
||||
}
|
||||
|
||||
|
||||
TBPImageAlgCls TBPimag;
|
||||
|
@ -84,7 +97,13 @@ void QSimulationBPImage::onbtnaccepted()
|
|||
TBPimag.setImageL1(imagL1);
|
||||
long cpucore_num = std::thread::hardware_concurrency();
|
||||
TBPimag.setGPU(true);
|
||||
TBPimag.Process(cpucore_num);
|
||||
if (ui->checkBox->isChecked()) {
|
||||
TBPimag.ProcessWithGridNet(cpucore_num,ui->lineEdit->text().trimmed());
|
||||
}
|
||||
else {
|
||||
TBPimag.Process(cpucore_num);
|
||||
}
|
||||
this->show();
|
||||
QMessageBox::information(this,u8"³ÉÏñ",u8"³ÉÏñ½áÊø");
|
||||
|
||||
}
|
||||
|
@ -93,3 +112,28 @@ void QSimulationBPImage::onbtnrejected()
|
|||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
void QSimulationBPImage::oncheckboxTrigged(int)
|
||||
{
|
||||
this->ui->lineEdit->setEnabled(this->ui->checkBox->isChecked());
|
||||
this->ui->GridNetBtn->setEnabled(this->ui->checkBox->isChecked());
|
||||
|
||||
}
|
||||
|
||||
void QSimulationBPImage::onpushButtonGridNetSelectClicked( )
|
||||
{
|
||||
QString fileNames = QFileDialog::getOpenFileName(
|
||||
this, // 父窗口
|
||||
tr(u8"选择影像文件"), // 标题
|
||||
QString(), // 默认路径
|
||||
tr(u8"All Files(*);;dat(*.dat);;tif(*.tif);;tiff(*.tiff)") // 文件过滤器
|
||||
);
|
||||
|
||||
// 如果用户选择了文件
|
||||
if (!fileNames.isEmpty()) {
|
||||
this->ui->lineEdit->setText(fileNames);
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(this, tr(u8"没有选择文件"), tr(u8"没有选择任何文件。"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,9 @@ public slots:
|
|||
void onbtnaccepted();
|
||||
void onbtnrejected();
|
||||
|
||||
void oncheckboxTrigged(int);
|
||||
void onpushButtonGridNetSelectClicked( );
|
||||
|
||||
private:
|
||||
Ui::QSimulationBPImageClass* ui;
|
||||
};
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>D:\Programme\vs2022\RasterMergeTest\LAMPCAE_SCANE\GF3_Simulation.xml</string>
|
||||
<string>D:\Programme\vs2022\RasterMergeTest\LAMPCAE_SCANE-all-scane\GF3_Simulation.xml</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -65,6 +65,66 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_3">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>图像网格</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>D:\Programme\vs2022\RasterMergeTest\simulationData\demdataset\demxyz.bin</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="GridNetBtn">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>30</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>选择</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
|
@ -96,7 +156,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>D:\Programme\vs2022\RasterMergeTest\LAMPCAE_SCANE_TBPImage\GF3BPImage</string>
|
||||
<string>D:\Programme\vs2022\RasterMergeTest\LAMPCAE_SCANE-all-scane\BPImage\GF3BPImage</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -301,6 +301,7 @@ ErrorCode RFPCProcessCls::Process(long num_thread)
|
|||
//stateCode = this->RFPCMainProcess(num_thread);
|
||||
// 初始化回波
|
||||
this->EchoSimulationData->initEchoArr(std::complex<double>(0, 0));
|
||||
|
||||
stateCode = this->RFPCMainProcess_GPU();
|
||||
|
||||
if (stateCode != ErrorCode::SUCCESS) {
|
||||
|
@ -329,8 +330,13 @@ ErrorCode RFPCProcessCls::InitParams()
|
|||
double imgStart_end = this->TaskSetting->getSARImageEndTime() - this->TaskSetting->getSARImageStartTime();
|
||||
this->PluseCount = ceil(imgStart_end * this->TaskSetting->getPRF());
|
||||
|
||||
double rangeTimeSample = (this->TaskSetting->getFarRange() - this->TaskSetting->getNearRange()) * 2.0 / LIGHTSPEED;
|
||||
this->PlusePoint = ceil(rangeTimeSample * this->TaskSetting->getFs());
|
||||
// 远斜距
|
||||
//double rangeTimeSample = * 2.0 / LIGHTSPEED;
|
||||
double drange = LIGHTSPEED / 2.0 / this->TaskSetting->getBandWidth();
|
||||
this->PlusePoint = ceil((this->TaskSetting->getFarRange() - this->TaskSetting->getNearRange()) / LIGHTSPEED * 2 * this->TaskSetting->getBandWidth());
|
||||
this->TaskSetting->setFarRange(this->TaskSetting->getNearRange() + (this->PlusePoint-1) * drange);
|
||||
|
||||
//ceil(rangeTimeSample * this->TaskSetting->getFs());
|
||||
|
||||
// 初始化回波存放位置
|
||||
qDebug() << "--------------Echo Data Setting ---------------------------------------";
|
||||
|
@ -343,6 +349,7 @@ ErrorCode RFPCProcessCls::InitParams()
|
|||
this->EchoSimulationData->setCenterAngle(this->TaskSetting->getCenterLookAngle());
|
||||
this->EchoSimulationData->setLookSide(this->TaskSetting->getIsRightLook() ? "R" : "L");
|
||||
this->EchoSimulationData->OpenOrNew(OutEchoPath, TaskFileName, PluseCount, PlusePoint);
|
||||
this->EchoSimulationData->setRefPhaseRange(this->TaskSetting->getRefphaseRange());
|
||||
|
||||
QString tmpfolderPath = QDir(OutEchoPath).filePath("tmp");
|
||||
if (QDir(tmpfolderPath).exists() == false) {
|
||||
|
@ -466,6 +473,7 @@ void RFPCProcessMain(long num_thread,
|
|||
qDebug() << "POLAR: " << task->getPolarType();
|
||||
qDebug() << "NearRange: " << task->getNearRange();
|
||||
qDebug() << "FarRange: " << task->getFarRange();
|
||||
qDebug() << "RefRange: " << task->getRefphaseRange();
|
||||
qDebug() << (task->getFarRange() - task->getNearRange()) * 2 / LIGHTSPEED * task->getFs();
|
||||
qDebug() << "\n\n";
|
||||
}
|
||||
|
@ -693,9 +701,9 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU() {
|
|||
}
|
||||
}
|
||||
|
||||
std::cout << "class id recoding" << std::endl;
|
||||
qDebug() << "class id recoding" ;
|
||||
for (long id : clamap.keys()) {
|
||||
std::cout << id << " -> " << clamap[id] << std::endl;
|
||||
qDebug() << id << " -> " << clamap[id] ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -715,17 +723,17 @@ ErrorCode RFPCProcessCls::RFPCMainProcess_GPU() {
|
|||
}
|
||||
|
||||
// 打印日志
|
||||
std::cout << "sigma params:" << std::endl;
|
||||
std::cout << "classid:\tp1\tp2\tp3\tp4\tp5\tp6" << std::endl;
|
||||
qDebug() << "sigma params:" ;
|
||||
qDebug() << "classid:\tp1\tp2\tp3\tp4\tp5\tp6" ;
|
||||
for (long ii = 0; ii < clamapid; ii++) {
|
||||
std::cout << ii << ":\t" << h_clsSigmaParam[ii].p1;
|
||||
std::cout << "\t" << h_clsSigmaParam[ii].p2;
|
||||
std::cout << "\t" << h_clsSigmaParam[ii].p3;
|
||||
std::cout << "\t" << h_clsSigmaParam[ii].p4;
|
||||
std::cout << "\t" << h_clsSigmaParam[ii].p5;
|
||||
std::cout << "\t" << h_clsSigmaParam[ii].p6 << std::endl;
|
||||
qDebug() << ii << ":\t" << h_clsSigmaParam[ii].p1;
|
||||
qDebug() << "\t" << h_clsSigmaParam[ii].p2;
|
||||
qDebug() << "\t" << h_clsSigmaParam[ii].p3;
|
||||
qDebug() << "\t" << h_clsSigmaParam[ii].p4;
|
||||
qDebug() << "\t" << h_clsSigmaParam[ii].p5;
|
||||
qDebug() << "\t" << h_clsSigmaParam[ii].p6 ;
|
||||
}
|
||||
std::cout << "";
|
||||
qDebug() << "";
|
||||
}
|
||||
|
||||
HostToDevice(h_clsSigmaParam, d_clsSigmaParam, sizeof(CUDASigmaParam) * clamapid);
|
||||
|
|
|
@ -501,7 +501,7 @@ std::vector<RadiationPatternGainPoint> ReadGainFile(QString antPatternFilePath)
|
|||
return dataPoints;
|
||||
}
|
||||
std::string filepath = antPatternFilePath.toLocal8Bit().constData();
|
||||
std::cout << "ant file path:\t" << filepath << std::endl;
|
||||
qDebug() << "ant file path:\t" << QString::fromStdString(filepath);
|
||||
|
||||
std::ifstream file(filepath);
|
||||
|
||||
|
@ -520,18 +520,17 @@ std::vector<RadiationPatternGainPoint> ReadGainFile(QString antPatternFilePath)
|
|||
headers.push_back(header);
|
||||
}
|
||||
|
||||
std::cout << "Headers:";
|
||||
qDebug() << "Headers:";
|
||||
for (const auto& h : headers) {
|
||||
std::cout << " " << h;
|
||||
qDebug() << " " << QString::fromStdString(h);
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
|
||||
if (headers.size() < 3) {
|
||||
file.close();
|
||||
return dataPoints; // ·µ»Ø¿ÕÏòÁ¿
|
||||
}
|
||||
|
||||
std::cout << "Parse ant radiation pattern contains " << std::endl;
|
||||
qDebug() << "Parse ant radiation pattern contains " ;
|
||||
|
||||
long theta_id = -1;
|
||||
long phi_id = -1;
|
||||
|
@ -569,7 +568,7 @@ std::vector<RadiationPatternGainPoint> ReadGainFile(QString antPatternFilePath)
|
|||
lines.push_back(line);
|
||||
}
|
||||
|
||||
std::cout << "Read file over" << std::endl;
|
||||
qDebug() << "Read file over" ;
|
||||
file.close();
|
||||
|
||||
|
||||
|
@ -776,7 +775,7 @@ ErrorCode AbstractRadiationPattern::RecontructGainMatrix(double threshold)
|
|||
Eigen::VectorXd phipoints = linspace(minphi, maxphi, phinum);
|
||||
|
||||
Eigen::MatrixXd gaintemp = Eigen::MatrixXd::Zero(thetanum, phinum);
|
||||
std::cout << "gain init" << std::endl;
|
||||
qDebug() << "gain init" ;
|
||||
for (long i = 0; i < thetanum; i++) {
|
||||
for (long j = 0; j < phinum; j++) {
|
||||
gaintemp(i, j) = this->getGain(thetapoints[i], phipoints[j]);
|
||||
|
|
|
@ -232,7 +232,7 @@ ErrorCode PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode& nod
|
|||
double nexttime = node.time + 1e-6;
|
||||
SatelliteOribtNode node1 = this->getSatelliteOribtNode(nexttime, flag);
|
||||
|
||||
//std::cout << "getAntnnaDirection corrdination " << std::endl;
|
||||
//qDebug() << "getAntnnaDirection corrdination " << std::endl;
|
||||
|
||||
double Vx = (node1.Px - node.Px);
|
||||
double Vy = (node1.Py - node.Py);
|
||||
|
@ -251,13 +251,13 @@ ErrorCode PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode& nod
|
|||
Eigen::Vector3d axisX0 = { Vx,Vy,Vz }; // x 轴 --飞行方向
|
||||
Eigen::Vector3d axisY0 = axisZ0.cross(axisX0); // y 轴 --右手定则 -- 初始坐标系
|
||||
|
||||
//std::cout << "axis_X0=[ " << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Y0=[ " << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Z0=[ " << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_X0=[ " << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Y0=[ " << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Z0=[ " << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
|
||||
double rotateAngle = this->RightLook ? -this->beamAngle : this->beamAngle; // 旋转角度 左(逆时针):theta , 右(顺时针): -theta
|
||||
//std::cout << "rotateAngle=" << rotateAngle << std::endl;
|
||||
//std::cout << "Look side:\t" << (this->RightLook ? "right" : "left") << std::endl;
|
||||
//qDebug() << "rotateAngle=" << rotateAngle << std::endl;
|
||||
//qDebug() << "Look side:\t" << (this->RightLook ? "right" : "left") << std::endl;
|
||||
// 1.2. 根据波位角,确定卫星绕X轴-飞行轴
|
||||
Eigen::Matrix3d rotateMatrixBeam = rotationMatrix(axisX0, rotateAngle*d2r); // 旋转矩阵
|
||||
axisZ0=rotateMatrixBeam*axisZ0; // 旋转矩阵
|
||||
|
@ -290,10 +290,10 @@ ErrorCode PolyfitSatelliteOribtModel::getAntnnaDirection(SatelliteOribtNode& nod
|
|||
node.AntZaxisZ =axisZ0[2];
|
||||
|
||||
|
||||
//std::cout << "axis_X=[" << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Y=[" << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//std::cout << "axis_Z=[" << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
//std::cout << "------------------------------------" << std::endl;
|
||||
//qDebug() << "axis_X=[" << axisX0.x() << "," << axisX0.y() << "," << axisX0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Y=[" << axisY0.x() << "," << axisY0.y() << "," << axisY0.z() << "]" << std::endl;
|
||||
//qDebug() << "axis_Z=[" << axisZ0.x() << "," << axisZ0.y() << "," << axisZ0.z() << "]" << std::endl;
|
||||
//qDebug() << "------------------------------------" << std::endl;
|
||||
return ErrorCode::SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "TBPImageAlgCls.h"
|
||||
#include <QDateTime>
|
||||
#include <QDebug>
|
||||
|
@ -9,10 +9,21 @@
|
|||
#include "GPUTool.cuh"
|
||||
#include "GPUTBPImage.cuh"
|
||||
#include "ImageOperatorBase.h"
|
||||
#include "BPBasic0_CUDA.cuh"
|
||||
#include "BaseTool.h"
|
||||
#include <GPUBpSimulation.cuh>
|
||||
|
||||
|
||||
void CreatePixelXYZ(std::shared_ptr<EchoL0Dataset> echoL0ds, QString outPixelXYZPath)
|
||||
{
|
||||
// 创建坐标系统
|
||||
long bandwidth = echoL0ds->getBandwidth();
|
||||
double Rnear = echoL0ds->getNearRange();
|
||||
double Rfar = echoL0ds->getFarRange();
|
||||
double refRange = echoL0ds->getRefPhaseRange();
|
||||
double dx = LIGHTSPEED / 2.0 / bandwidth; // c/2b
|
||||
|
||||
|
||||
// 创建坐标系统
|
||||
long prfcount = echoL0ds->getPluseCount();
|
||||
long freqcount = echoL0ds->getPlusePoints();
|
||||
Eigen::MatrixXd gt = Eigen::MatrixXd::Zero(2, 3);
|
||||
|
@ -22,64 +33,124 @@ void CreatePixelXYZ(std::shared_ptr<EchoL0Dataset> echoL0ds, QString outPixelXYZ
|
|||
gt(1, 0) = 0;
|
||||
gt(1, 1) = 0;
|
||||
gt(1, 2) = 1;
|
||||
gdalImage xyzRaster = CreategdalImage(outPixelXYZPath, prfcount, freqcount, 3, gt, QString(""), false, true,true);
|
||||
gdalImage xyzRaster = CreategdalImage(outPixelXYZPath, prfcount, freqcount, 3, gt, QString(""), false, true,true,GDT_Float64);
|
||||
std::shared_ptr<double> antpos = echoL0ds->getAntPos();
|
||||
double dx = LIGHTSPEED / 2 / echoL0ds->getFs();
|
||||
double Rnear = echoL0ds->getNearRange();
|
||||
dx = (echoL0ds->getFarRange()-echoL0ds->getNearRange())/(echoL0ds->getPlusePoints()-1);
|
||||
Rnear = echoL0ds->getNearRange();
|
||||
double Rref = echoL0ds->getRefPhaseRange();
|
||||
double centerInc = echoL0ds->getCenterAngle()*d2r;
|
||||
long echocol = Memory1GB * 1.0 / 8 / 4 / prfcount * 6;
|
||||
qDebug() << "echocol:\t " << echocol ;
|
||||
echocol = echocol < 1 ? 1: echocol;
|
||||
|
||||
long echocol = 1073741824 / 8 / 4 / prfcount*8;
|
||||
std::cout << "echocol:\t " << echocol << std::endl;
|
||||
echocol = echocol < 3000 ? 3000 : echocol;
|
||||
long startcolidx = 0;
|
||||
for (startcolidx = 0; startcolidx < freqcount; startcolidx = startcolidx + echocol) {
|
||||
|
||||
std::shared_ptr<double> Pxs((double*)mallocCUDAHost(sizeof(double)*prfcount), FreeCUDAHost);
|
||||
std::shared_ptr<double> Pys((double*)mallocCUDAHost(sizeof(double) * prfcount), FreeCUDAHost);
|
||||
std::shared_ptr<double> Pzs((double*)mallocCUDAHost(sizeof(double) * prfcount), FreeCUDAHost);
|
||||
std::shared_ptr<double> AntDirectX((double*)mallocCUDAHost(sizeof(double) * prfcount), FreeCUDAHost);
|
||||
std::shared_ptr<double> AntDirectY((double*)mallocCUDAHost(sizeof(double) * prfcount), FreeCUDAHost);
|
||||
std::shared_ptr<double> AntDirectZ((double*)mallocCUDAHost(sizeof(double) * prfcount), FreeCUDAHost);
|
||||
|
||||
{
|
||||
std::shared_ptr<double> antpos = echoL0ds->getAntPos();
|
||||
double time = 0;
|
||||
double Px = 0;
|
||||
double Py = 0;
|
||||
double Pz = 0;
|
||||
for (long i = 0; i < prfcount; i++) {
|
||||
|
||||
Pxs.get()[i] = antpos.get()[i * 19 + 1]; // 卫星坐标
|
||||
Pys.get()[i] = antpos.get()[i * 19 + 2];
|
||||
Pzs.get()[i] = antpos.get()[i * 19 + 3];
|
||||
AntDirectX.get()[i] = antpos.get()[i * 19 + 13];// zero doppler
|
||||
AntDirectY.get()[i] = antpos.get()[i * 19 + 14];
|
||||
AntDirectZ.get()[i] = antpos.get()[i * 19 + 15];
|
||||
|
||||
double NormAnt = std::sqrt(AntDirectX.get()[i] * AntDirectX.get()[i] +
|
||||
AntDirectY.get()[i] * AntDirectY.get()[i] +
|
||||
AntDirectZ.get()[i] * AntDirectZ.get()[i]);
|
||||
AntDirectX.get()[i] = AntDirectX.get()[i] / NormAnt;
|
||||
AntDirectY.get()[i] = AntDirectY.get()[i] / NormAnt;
|
||||
AntDirectZ.get()[i] = AntDirectZ.get()[i] / NormAnt;// 归一化
|
||||
}
|
||||
antpos.reset();
|
||||
}
|
||||
|
||||
std::shared_ptr<double> d_Pxs((double*)mallocCUDADevice(sizeof(double) * prfcount), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_Pys((double*)mallocCUDADevice(sizeof(double) * prfcount), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_Pzs((double*)mallocCUDADevice(sizeof(double) * prfcount), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_AntDirectX((double*)mallocCUDADevice(sizeof(double) * prfcount), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_AntDirectY((double*)mallocCUDADevice(sizeof(double) * prfcount), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_AntDirectZ((double*)mallocCUDADevice(sizeof(double) * prfcount), FreeCUDADevice);
|
||||
|
||||
HostToDevice(Pxs.get(), d_Pxs.get(), sizeof(double) * prfcount);
|
||||
HostToDevice(Pys.get(), d_Pys.get(), sizeof(double) * prfcount);
|
||||
HostToDevice(Pzs.get(), d_Pzs.get(), sizeof(double) * prfcount);
|
||||
HostToDevice(AntDirectX.get(), d_AntDirectX.get(), sizeof(double) * prfcount);
|
||||
HostToDevice(AntDirectY.get(), d_AntDirectY.get(), sizeof(double) * prfcount);
|
||||
HostToDevice(AntDirectZ.get(), d_AntDirectZ.get(), sizeof(double) * prfcount);
|
||||
|
||||
|
||||
for (long startcolidx = 0; startcolidx < freqcount; startcolidx = startcolidx + echocol) {
|
||||
|
||||
long tempechocol = echocol;
|
||||
if (startcolidx + tempechocol >= freqcount) {
|
||||
tempechocol = freqcount - startcolidx;
|
||||
}
|
||||
std::cout << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString() << "] imgxyz :\t" << startcolidx << "\t-\t" << startcolidx + tempechocol << " / " << freqcount << std::endl;
|
||||
qDebug() << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz") << "] imgxyz :\t" << startcolidx << "\t-\t" << startcolidx + tempechocol << " / " << freqcount ;
|
||||
|
||||
std::shared_ptr<double> demx = readDataArr<double>(xyzRaster, 0, startcolidx, prfcount, tempechocol, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demy = readDataArr<double>(xyzRaster, 0, startcolidx, prfcount, tempechocol, 2, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demz = readDataArr<double>(xyzRaster, 0, startcolidx, prfcount, tempechocol, 3, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
||||
Eigen::MatrixXd demx = xyzRaster.getData(0, startcolidx, prfcount, tempechocol, 1);
|
||||
Eigen::MatrixXd demy = xyzRaster.getData(0, startcolidx, prfcount, tempechocol, 2);
|
||||
Eigen::MatrixXd demz = xyzRaster.getData(0, startcolidx, prfcount, tempechocol, 3);
|
||||
std::shared_ptr<double> h_demx((double*)mallocCUDAHost(sizeof(double) * prfcount*tempechocol), FreeCUDAHost);
|
||||
std::shared_ptr<double> h_demy((double*)mallocCUDAHost(sizeof(double) * prfcount*tempechocol), FreeCUDAHost);
|
||||
std::shared_ptr<double> h_demz((double*)mallocCUDAHost(sizeof(double) * prfcount*tempechocol), FreeCUDAHost);
|
||||
|
||||
#pragma omp parallel for
|
||||
for (long i = 0; i < prfcount; i++) {
|
||||
|
||||
double Px = 0;
|
||||
double Py = 0;
|
||||
double Pz = 0;
|
||||
|
||||
double AntDirectX = 0;
|
||||
double AntDirectY = 0;
|
||||
double AntDirectZ = 0;
|
||||
double R = 0;
|
||||
double NormAnt = 0;
|
||||
|
||||
Px = antpos.get()[i * 19 + 1];
|
||||
Py = antpos.get()[i * 19 + 2];
|
||||
Pz = antpos.get()[i * 19 + 3];
|
||||
AntDirectX = antpos.get()[i * 19 + 13];// zero doppler
|
||||
AntDirectY = antpos.get()[i * 19 + 14];
|
||||
AntDirectZ = antpos.get()[i * 19 + 15];
|
||||
|
||||
NormAnt = std::sqrt(AntDirectX * AntDirectX + AntDirectY * AntDirectY + AntDirectZ * AntDirectZ);
|
||||
AntDirectX = AntDirectX / NormAnt;
|
||||
AntDirectY = AntDirectY / NormAnt;
|
||||
AntDirectZ = AntDirectZ / NormAnt;// 归一化
|
||||
for (long j = 0; j < tempechocol; j++) {
|
||||
R = (j + startcolidx)*dx + Rnear;
|
||||
demx(i,j) = Px + AntDirectX * R;
|
||||
demy(i,j) = Py + AntDirectY * R;
|
||||
demz(i,j) = Pz + AntDirectZ * R;
|
||||
#pragma omp parallel for
|
||||
for (long ii = 0; ii < prfcount; ii++) {
|
||||
for (long jj = 0; jj < tempechocol; jj++) {
|
||||
h_demx.get()[ii*tempechocol+jj]=demx.get()[ii*tempechocol+jj];
|
||||
h_demy.get()[ii*tempechocol+jj]=demy.get()[ii*tempechocol+jj];
|
||||
h_demz.get()[ii*tempechocol+jj]=demz.get()[ii*tempechocol+jj];
|
||||
}
|
||||
}
|
||||
|
||||
xyzRaster.saveImage(demx, 0, startcolidx, 1);
|
||||
xyzRaster.saveImage(demy, 0, startcolidx, 2);
|
||||
xyzRaster.saveImage(demz, 0, startcolidx, 3);
|
||||
}
|
||||
std::shared_ptr<double> d_demx((double*)mallocCUDADevice(sizeof(double) * prfcount * tempechocol), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_demy((double*)mallocCUDADevice(sizeof(double) * prfcount * tempechocol), FreeCUDADevice);
|
||||
std::shared_ptr<double> d_demz((double*)mallocCUDADevice(sizeof(double) * prfcount * tempechocol), FreeCUDADevice);
|
||||
|
||||
HostToDevice(h_demx.get(), d_demx.get(), sizeof(double) * prfcount * tempechocol);
|
||||
HostToDevice(h_demy.get(), d_demy.get(), sizeof(double) * prfcount * tempechocol);
|
||||
HostToDevice(h_demz.get(), d_demz.get(), sizeof(double) * prfcount * tempechocol);
|
||||
|
||||
|
||||
TIMEBPCreateImageGrid(
|
||||
d_Pxs.get(), d_Pys.get(), d_Pzs.get(),
|
||||
d_AntDirectX.get(), d_AntDirectY.get(), d_AntDirectZ.get(),
|
||||
d_demx.get(), d_demy.get(), d_demz.get(),
|
||||
prfcount, tempechocol, 1000,
|
||||
Rnear+dx* startcolidx, dx, refRange // 更新最近修读
|
||||
);
|
||||
|
||||
DeviceToHost(h_demx.get(), d_demx.get(), sizeof(double) * prfcount * tempechocol);
|
||||
DeviceToHost(h_demy.get(), d_demy.get(), sizeof(double) * prfcount * tempechocol);
|
||||
DeviceToHost(h_demz.get(), d_demz.get(), sizeof(double) * prfcount * tempechocol);
|
||||
|
||||
#pragma omp parallel for
|
||||
for (long ii = 0; ii < prfcount; ii++) {
|
||||
for (long jj = 0; jj < tempechocol; jj++) {
|
||||
demx.get()[ii * tempechocol + jj]=h_demx.get()[ii * tempechocol + jj] ;
|
||||
demy.get()[ii * tempechocol + jj]=h_demy.get()[ii * tempechocol + jj] ;
|
||||
demz.get()[ii * tempechocol + jj]=h_demz.get()[ii * tempechocol + jj] ;
|
||||
}
|
||||
}
|
||||
|
||||
xyzRaster.saveImage(demx, 0, startcolidx,prfcount,tempechocol, 1);
|
||||
xyzRaster.saveImage(demy, 0, startcolidx,prfcount,tempechocol, 2);
|
||||
xyzRaster.saveImage(demz, 0, startcolidx,prfcount,tempechocol, 3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void TBPImageProcess(QString echofile, QString outImageFolder, QString imagePlanePath,long num_thread)
|
||||
|
@ -95,6 +166,7 @@ void TBPImageProcess(QString echofile, QString outImageFolder, QString imagePlan
|
|||
imagL1->setFarRange(echoL0ds->getFarRange());
|
||||
imagL1->setFs(echoL0ds->getFs());
|
||||
imagL1->setLookSide(echoL0ds->getLookSide());
|
||||
|
||||
imagL1->OpenOrNew(outImageFolder, echoL0ds->getSimulationTaskName(), echoL0ds->getPluseCount(), echoL0ds->getPlusePoints());
|
||||
|
||||
|
||||
|
@ -140,18 +212,32 @@ std::shared_ptr<SARSimulationImageL1Dataset> TBPImageAlgCls::getImageL0()
|
|||
|
||||
ErrorCode TBPImageAlgCls::Process(long num_thread)
|
||||
{
|
||||
qDebug() << u8"创建成像平面的XYZ";
|
||||
|
||||
qDebug() << u8"开始成像";
|
||||
|
||||
|
||||
qDebug() << u8"创建成像平面的XYZ";
|
||||
QString outRasterXYZ = JoinPath(this->L1ds->getoutFolderPath(), this->L0ds->getSimulationTaskName() + "_xyz.bin");
|
||||
CreatePixelXYZ(this->L0ds, outRasterXYZ);
|
||||
this->outRasterXYZPath = outRasterXYZ;
|
||||
|
||||
return this->ProcessWithGridNet(num_thread, outRasterXYZ);
|
||||
|
||||
// 初始化Raster
|
||||
qDebug() << u8"初始化影像";
|
||||
}
|
||||
|
||||
ErrorCode TBPImageAlgCls::ProcessWithGridNet(long num_thread,QString xyzRasterPath)
|
||||
{
|
||||
this->outRasterXYZPath = xyzRasterPath;
|
||||
//qDebug() << u8"频域回波-> 时域回波";
|
||||
//this->TimeEchoDataPath = JoinPath(this->L1ds->getoutFolderPath(), this->L0ds->getSimulationTaskName() + "_Timeecho.bin");
|
||||
//this->EchoFreqToTime();
|
||||
|
||||
// 初始化Raster
|
||||
qDebug() << u8"初始化影像";
|
||||
long imageheight = this->L1ds->getrowCount();
|
||||
long imagewidth = this->L1ds->getcolCount();
|
||||
|
||||
|
||||
long blokline = Memory1GB / 8 / 4 / imageheight * 32;
|
||||
|
||||
long blokline = Memory1GB / 8 / 4 / imageheight * 32;
|
||||
blokline = blokline < 1000 ? 1000 : blokline;
|
||||
|
||||
long startline = 0;
|
||||
|
@ -160,323 +246,197 @@ ErrorCode TBPImageAlgCls::Process(long num_thread)
|
|||
if (startline + templine >= imageheight) {
|
||||
templine = imageheight - startline;
|
||||
}
|
||||
std::cout << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString() << "] imgxyz :\t" << startline << "\t-\t" << startline + templine << " / " << imageheight << std::endl;
|
||||
qDebug() << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz") << "] imgxyz :\t" << startline << "\t-\t" << startline + templine << " / " << imageheight;
|
||||
|
||||
std::shared_ptr<std::complex<double>> imageRaster = this->L1ds->getImageRaster(startline, templine);
|
||||
|
||||
for (long i = 0; i < templine; i++) {
|
||||
for (long j = 0; j < imagewidth; j++) {
|
||||
imageRaster.get()[i * imagewidth + j] = std::complex<double>(0,0);
|
||||
imageRaster.get()[i * imagewidth + j] = std::complex<double>(0, 0);
|
||||
}
|
||||
}
|
||||
this->L1ds->saveImageRaster(imageRaster, startline,templine);
|
||||
this->L1ds->saveImageRaster(imageRaster, startline, templine);
|
||||
}
|
||||
qDebug() << u8"开始成像";
|
||||
|
||||
|
||||
qDebug() << u8"频域回波-> 时域回波 结束";
|
||||
|
||||
if (GPURUN) {
|
||||
return this->ProcessGPU();
|
||||
}
|
||||
else {
|
||||
QMessageBox::information(nullptr,u8"提示",u8"目前只支持显卡");
|
||||
QMessageBox::information(nullptr, u8"提示", u8"目前只支持显卡");
|
||||
return ErrorCode::FAIL;
|
||||
}
|
||||
return ErrorCode::SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ErrorCode TBPImageAlgCls::ProcessGPU()
|
||||
{
|
||||
// 常用参数
|
||||
long rowCount = this->L1ds->getrowCount();
|
||||
long colCount = this->L1ds->getcolCount();
|
||||
long pixelCount = rowCount * colCount;
|
||||
long PRFCount = this->L0ds->getPluseCount();
|
||||
long PlusePoints = this->L0ds->getPlusePoints();
|
||||
std::shared_ptr<SARSimulationImageL1Dataset> L1ds=this->L1ds;
|
||||
std::shared_ptr < EchoL0Dataset> L0ds=this->L0ds;
|
||||
QString inGPSPath = L0ds->getGPSPointFilePath();
|
||||
QString echoFilePath = L0ds->getEchoDataFilePath();
|
||||
QString imgXYZPath = this->outRasterXYZPath;
|
||||
QString outimgDataPath = L1ds->getImageRasterPath();
|
||||
|
||||
|
||||
float Rnear = this->L1ds->getNearRange();
|
||||
float Rfar = this->L1ds->getFarRange();
|
||||
float fs = this->L1ds->getFs();
|
||||
double dx = LIGHTSPEED / 2 / fs;
|
||||
float freq = this->L1ds->getCenterFreq();
|
||||
double factorj = freq * 4 * M_PI / LIGHTSPEED ;
|
||||
|
||||
qDebug() << "------------------------------------------------";
|
||||
qDebug() << "TBP params:";
|
||||
qDebug() << "Rnear:\t" << Rnear;
|
||||
qDebug() << "Rfar:\t" << Rfar;
|
||||
qDebug() << "fs:\t" << fs;
|
||||
qDebug() << "freq:\t" << freq;
|
||||
qDebug() << "rowCount:\t" << rowCount;
|
||||
qDebug() << "colCount:\t" << colCount;
|
||||
qDebug() << "PRFCount:\t" << PRFCount;
|
||||
qDebug() << "PlusePoints:\t" << PlusePoints;
|
||||
size_t prfcount = L0ds->getPluseCount();
|
||||
size_t freqpoints = L0ds->getPlusePoints();
|
||||
size_t block_pfrcount = Memory1MB / freqpoints / 8 * 2000;// 4GB -- 可以分配内存
|
||||
|
||||
size_t img_rowCont = L1ds->getrowCount();
|
||||
size_t img_colCont = L1ds->getcolCount();
|
||||
size_t block_imgRowCount = Memory1MB / img_colCont / 8 / 3 * 2000;// 4GB-- 可以分配内存
|
||||
|
||||
std::shared_ptr<float> Pxs (new float[this->L0ds->getPluseCount()]);
|
||||
std::shared_ptr<float> Pys (new float[this->L0ds->getPluseCount()]);
|
||||
std::shared_ptr<float> Pzs (new float[this->L0ds->getPluseCount()]);
|
||||
gdalImage demgridimg(imgXYZPath);
|
||||
gdalImageComplex im_finalds(outimgDataPath);
|
||||
gdalImageComplex echods(echoFilePath);
|
||||
|
||||
|
||||
// 加载 GPS ,it should be same as prfcount;
|
||||
long gpspoints = prfcount;
|
||||
std::shared_ptr<SatelliteAntPos> antpos = SatelliteAntPosOperator::readAntPosFile(inGPSPath, gpspoints);
|
||||
|
||||
|
||||
|
||||
|
||||
GPUDATA h_data{};// 任务参数
|
||||
{
|
||||
std::shared_ptr<double> antpos = this->L0ds->getAntPos();
|
||||
double time = 0;
|
||||
double Px = 0;
|
||||
double Py = 0;
|
||||
double Pz = 0;
|
||||
for (long i = 0; i < rowCount; i++) {
|
||||
time = antpos.get()[i *19 + 0];
|
||||
Px = antpos.get()[i *19 + 1];
|
||||
Py = antpos.get()[i *19 + 2];
|
||||
Pz = antpos.get()[i *19 + 3];
|
||||
Pxs.get()[i] = Px;
|
||||
Pys.get()[i] = Py;
|
||||
Pzs.get()[i] = Pz;
|
||||
//回波 频率参数
|
||||
h_data.Nfft = freqpoints;
|
||||
qDebug() << u8"3.proces echo params:";
|
||||
double centerFreq = L0ds->getCenterFreq();
|
||||
double bandwidth = L0ds->getBandwidth();
|
||||
size_t freqpoints = L0ds->getPlusePoints();
|
||||
h_data.Freq = getFreqPoints_mallocHost(centerFreq - bandwidth / 2, centerFreq + bandwidth / 2, freqpoints);
|
||||
h_data.minF = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
for (long i = 0; i < gpspoints; i++) {
|
||||
h_data.minF[i] = h_data.Freq[0];
|
||||
}
|
||||
antpos.reset();
|
||||
h_data.deltaF = bandwidth / (freqpoints - 1);
|
||||
h_data.K = h_data.Nfft;
|
||||
h_data.R0 = L0ds->getRefPhaseRange();
|
||||
|
||||
double deltaF = h_data.deltaF; // 从输入参数获取
|
||||
double maxWr = 299792458.0 / (2.0 * deltaF);
|
||||
double* r_vec_host = (double*)mallocCUDAHost(sizeof(double) * h_data.Nfft);// new double[data.Nfft];
|
||||
const double step = maxWr / h_data.Nfft;
|
||||
const double start = -1 * h_data.Nfft / 2.0 * step;
|
||||
for (int i = 0; i < h_data.Nfft; ++i) {
|
||||
r_vec_host[i] = start + i * step;
|
||||
}
|
||||
|
||||
h_data.r_vec = r_vec_host;
|
||||
// 处理天线坐标
|
||||
h_data.AntX = (double*)mallocCUDAHost(sizeof(double) * block_pfrcount);
|
||||
h_data.AntY = (double*)mallocCUDAHost(sizeof(double) * block_pfrcount);
|
||||
h_data.AntZ = (double*)mallocCUDAHost(sizeof(double) * block_pfrcount);
|
||||
|
||||
qDebug() << "r_vec [0]:\t" << h_data.r_vec[0];
|
||||
qDebug() << "Range resolution(m):\t" << step;
|
||||
qDebug() << "range Scence(m):\t" << maxWr;
|
||||
qDebug() << "start Freq:\t" << centerFreq - bandwidth / 2;
|
||||
qDebug() << "end Freq:\t" << centerFreq + bandwidth / 2;
|
||||
qDebug() << "freq points:\t" << freqpoints;
|
||||
qDebug() << "delta freq:\t" << h_data.deltaF;
|
||||
qDebug() << "prf count:\t" << gpspoints;
|
||||
qDebug() << "-----------------------------------------------------------";
|
||||
}
|
||||
|
||||
qDebug() << "BP......";
|
||||
for (long img_start_rid = 0; img_start_rid < img_rowCont; img_start_rid = img_start_rid + block_imgRowCount) {
|
||||
long img_blockRowCount = block_imgRowCount;
|
||||
long img_blockColCount = img_colCont;
|
||||
|
||||
// 按照回波分块,图像分块
|
||||
long echoBlockline = Memory1GB / 8 / 2 / PlusePoints * 2;
|
||||
echoBlockline = echoBlockline < 1 ? 1 : echoBlockline;
|
||||
std::shared_ptr<double> demX = readDataArr<double>(demgridimg, img_start_rid, 0, img_blockRowCount, img_blockColCount, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demY = readDataArr<double>(demgridimg, img_start_rid, 0, img_blockRowCount, img_blockColCount, 2, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demZ = readDataArr<double>(demgridimg, img_start_rid, 0, img_blockRowCount, img_blockColCount, 3, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
||||
long imageBlockline = Memory1GB / 8 / 2 / colCount * 2;
|
||||
imageBlockline = imageBlockline < 1 ? 1 : imageBlockline;
|
||||
h_data.x_mat = (double*)mallocCUDAHost(sizeof(double) * img_blockRowCount * img_blockColCount); // 成像网格
|
||||
h_data.y_mat = (double*)mallocCUDAHost(sizeof(double) * img_blockRowCount * img_blockColCount);
|
||||
h_data.z_mat = (double*)mallocCUDAHost(sizeof(double) * img_blockRowCount * img_blockColCount);
|
||||
h_data.nx = img_blockColCount;
|
||||
h_data.ny = img_blockRowCount;
|
||||
|
||||
gdalImage imageXYZ(this->outRasterXYZPath);
|
||||
|
||||
long startimgrowid = 0;
|
||||
for (startimgrowid = 0; startimgrowid < rowCount; startimgrowid = startimgrowid + imageBlockline) {
|
||||
long tempimgBlockline = imageBlockline;
|
||||
if (startimgrowid + imageBlockline >= rowCount) {
|
||||
tempimgBlockline = rowCount - startimgrowid;
|
||||
}
|
||||
std::cout << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz").toStdString() << "] image create :\t" << startimgrowid << "\t-\t" << startimgrowid + tempimgBlockline<<"\t/\t"<< rowCount << std::endl;
|
||||
// 提取局部pixel x,y,z
|
||||
std::shared_ptr<float> img_x = readDataArr<float>(imageXYZ,startimgrowid,0,tempimgBlockline,colCount,1,GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<float> img_y = readDataArr<float>(imageXYZ,startimgrowid,0,tempimgBlockline,colCount,2,GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<float> img_z = readDataArr<float>(imageXYZ,startimgrowid,0,tempimgBlockline,colCount,3,GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
||||
std::shared_ptr<std::complex<double>> imgArr = this->L1ds->getImageRaster(startimgrowid, tempimgBlockline);
|
||||
// 获取回波
|
||||
long startechoid = 0;
|
||||
for (long startechoid = 0; startechoid < PRFCount; startechoid = startechoid + echoBlockline) {
|
||||
long tempechoBlockline = echoBlockline;
|
||||
if (startechoid + tempechoBlockline >= PRFCount) {
|
||||
tempechoBlockline = PRFCount - startechoid;
|
||||
for (long i = 0; i < h_data.ny; i++) {
|
||||
for (long j = 0; j < h_data.nx; j++) {
|
||||
h_data.x_mat[i * h_data.nx + j] = demX.get()[i * h_data.nx + j];
|
||||
h_data.y_mat[i * h_data.nx + j] = demY.get()[i * h_data.nx + j];
|
||||
h_data.z_mat[i * h_data.nx + j] = demZ.get()[i * h_data.nx + j];
|
||||
}
|
||||
std::shared_ptr<std::complex<double>> echoArr = this->L0ds->getEchoArr(startechoid, tempechoBlockline);
|
||||
std::shared_ptr<float> antpx(new float[tempechoBlockline*PlusePoints]);
|
||||
std::shared_ptr<float> antpy(new float[tempechoBlockline* PlusePoints]);
|
||||
std::shared_ptr<float> antpz(new float[tempechoBlockline* PlusePoints]);
|
||||
// 复制
|
||||
for (long anti = 0; anti < tempechoBlockline; anti++) {
|
||||
antpx.get()[anti] = Pxs.get()[anti + startechoid];
|
||||
antpy.get()[anti] = Pys.get()[anti + startechoid];
|
||||
antpz.get()[anti] = Pzs.get()[anti + startechoid];
|
||||
}
|
||||
TBPImageGPUAlg(
|
||||
antpx, antpy, antpz,
|
||||
img_x, img_y, img_z,
|
||||
echoArr, imgArr,
|
||||
freq, fs,
|
||||
Rnear, Rfar,
|
||||
tempimgBlockline, colCount,
|
||||
tempechoBlockline, PlusePoints,
|
||||
startechoid,startimgrowid
|
||||
);
|
||||
|
||||
}
|
||||
this->L1ds->saveImageRaster(imgArr, startimgrowid, tempimgBlockline);
|
||||
|
||||
|
||||
std::shared_ptr<std::complex<double>> imgArr = im_finalds.getDataComplexSharePtr(img_start_rid, 0, img_blockRowCount, img_blockColCount, 1);
|
||||
h_data.im_final = (cuComplex*)mallocCUDAHost(sizeof(cuComplex)* img_blockRowCount* img_blockColCount);
|
||||
|
||||
for (long echo_start_pid = 0; echo_start_pid < prfcount; echo_start_pid = echo_start_pid + block_pfrcount) {
|
||||
long echo_blockPRFCount = block_pfrcount;
|
||||
long echo_blockFreqCount = freqpoints;
|
||||
|
||||
// 读取回波
|
||||
std::shared_ptr<std::complex<double>> echoData = readDataArrComplex<std::complex<double>>(echods, echo_start_pid,0, echo_blockPRFCount, echo_blockFreqCount,1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
size_t echosize = sizeof(cuComplex) * echo_blockPRFCount * echo_blockFreqCount;
|
||||
h_data.phdata = (cuComplex*)mallocCUDAHost(echosize);
|
||||
shared_complexPtrToHostCuComplex(echoData.get(), h_data.phdata, size_t(echo_blockPRFCount * echo_blockFreqCount));
|
||||
|
||||
// 处理天线坐标
|
||||
h_data.Np = echo_blockPRFCount;
|
||||
for (long i = 0; i < h_data.Np; i++) {
|
||||
h_data.AntX[i] = antpos.get()[i+echo_start_pid].Px;
|
||||
h_data.AntY[i] = antpos.get()[i+echo_start_pid].Py;
|
||||
h_data.AntZ[i] = antpos.get()[i+echo_start_pid].Pz;
|
||||
}
|
||||
{
|
||||
qDebug() << "GPS points Count:\t" << gpspoints;
|
||||
qDebug() << "PRF 0:\t " << QString("%1,%2,%3").arg(h_data.AntX[0]).arg(h_data.AntY[0]).arg(h_data.AntZ[0]);
|
||||
qDebug() << "PRF " << gpspoints - 1 << ":\t " << QString("%1,%2,%3")
|
||||
.arg(h_data.AntX[gpspoints - 1])
|
||||
.arg(h_data.AntY[gpspoints - 1])
|
||||
.arg(h_data.AntZ[gpspoints - 1]);
|
||||
}
|
||||
|
||||
|
||||
GPUDATA d_data;
|
||||
initGPUData(h_data, d_data);
|
||||
bpBasic0CUDA(d_data, 0);
|
||||
DeviceToHost(h_data.im_final, d_data.im_final, sizeof(cuComplex) * d_data.nx * d_data.ny);
|
||||
|
||||
freeGPUData(d_data);
|
||||
FreeCUDAHost(h_data.phdata);
|
||||
|
||||
qDebug() << QString(u8"\nimg proces [%1 precent ] , echo process [%2 precess]\t:img row [%3,%4),echo pfr [%5,%6]")
|
||||
.arg((img_start_rid+ img_blockRowCount)*100.0/ img_rowCont)
|
||||
.arg((echo_start_pid + echo_blockPRFCount) * 100.0 / prfcount)
|
||||
.arg(img_start_rid)
|
||||
.arg(img_start_rid + img_blockRowCount)
|
||||
.arg(echo_start_pid)
|
||||
.arg(echo_start_pid + echo_blockPRFCount)
|
||||
;
|
||||
//HostCuComplexToshared_complexPtr(h_data.im_final, imgArr.get(), size_t(h_data.nx)* size_t(h_data.ny));
|
||||
//testOutComplexDoubleArr(QString("im_final.bin"), imgArr.get(), h_data.ny, h_data.nx);
|
||||
}
|
||||
HostCuComplexToshared_complexPtr(h_data.im_final, imgArr.get(), size_t(h_data.nx)* size_t(h_data.ny));
|
||||
im_finalds.saveImage(imgArr, img_start_rid, 0,img_blockRowCount, img_blockColCount, 1);
|
||||
|
||||
}
|
||||
|
||||
qDebug() << "\r[" << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz") << "] image writing:\t" << this->L1ds->getxmlFilePath();
|
||||
this->L1ds->saveToXml();
|
||||
qDebug() << QString("img proces [100 precent ] , echo process [100 precess] ");
|
||||
L1ds->saveToXml();
|
||||
qDebug() << "bp Image Result write to file :\t" << L1ds->getoutFolderPath();
|
||||
return ErrorCode::SUCCESS;
|
||||
}
|
||||
|
||||
void TBPImageGPUAlg(std::shared_ptr<float> antPx, std::shared_ptr<float> antPy, std::shared_ptr<float> antPz,
|
||||
std::shared_ptr<float> imgx, std::shared_ptr<float> imgy, std::shared_ptr<float> imgz,
|
||||
std::shared_ptr<std::complex<double>> echoArr,
|
||||
std::shared_ptr<std::complex<double>> imgArr,
|
||||
float freq, float fs, float Rnear, float Rfar,
|
||||
long rowcount, long colcount,
|
||||
long prfcount, long freqcount,
|
||||
long startPRFId, long startRowID
|
||||
)
|
||||
|
||||
ErrorCode TBPImageAlgCls::BPProcessBlockGPU()
|
||||
{
|
||||
// 声明GPU变量
|
||||
float* h_antPx = (float*)mallocCUDAHost(sizeof(float) * prfcount);
|
||||
float* h_antPy = (float*)mallocCUDAHost(sizeof(float) * prfcount);
|
||||
float* h_antPz = (float*)mallocCUDAHost(sizeof(float) * prfcount);
|
||||
|
||||
float* d_antPx = (float*)mallocCUDADevice(sizeof(float) * prfcount);
|
||||
float* d_antPy = (float*)mallocCUDADevice(sizeof(float) * prfcount);
|
||||
float* d_antPz = (float*)mallocCUDADevice(sizeof(float) * prfcount);
|
||||
|
||||
float* h_imgx = (float*)mallocCUDAHost(sizeof(float) * rowcount * colcount);
|
||||
float* h_imgy = (float*)mallocCUDAHost(sizeof(float) * rowcount * colcount);
|
||||
float* h_imgz = (float*)mallocCUDAHost(sizeof(float) * rowcount * colcount);
|
||||
|
||||
float* d_imgx = (float*)mallocCUDADevice(sizeof(float) * rowcount * colcount);
|
||||
float* d_imgy = (float*)mallocCUDADevice(sizeof(float) * rowcount * colcount);
|
||||
float* d_imgz = (float*)mallocCUDADevice(sizeof(float) * rowcount * colcount);
|
||||
|
||||
cuComplex* h_echoArr = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * prfcount * freqcount);
|
||||
cuComplex* d_echoArr = (cuComplex*)mallocCUDADevice(sizeof(cuComplex) * prfcount * freqcount);
|
||||
|
||||
cuComplex* h_imgArr = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * rowcount * colcount);
|
||||
cuComplex* d_imgArr = (cuComplex*)mallocCUDADevice( sizeof(cuComplex) * rowcount * colcount);
|
||||
|
||||
cuComplex* h_imgEchoArr = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * rowcount * colcount);
|
||||
cuComplex* d_imgEchoArr = (cuComplex*)mallocCUDADevice(sizeof(cuComplex) * rowcount * colcount);
|
||||
|
||||
float* h_R=(float*)mallocCUDAHost(sizeof(float) * rowcount * colcount);
|
||||
float* d_R=(float*)mallocCUDADevice(sizeof(float) * rowcount * colcount);
|
||||
|
||||
long* h_CIdx = (long*)mallocCUDAHost(sizeof(long) * rowcount * colcount);
|
||||
long* d_CIdx = (long*)mallocCUDADevice(sizeof(long) * rowcount * colcount);
|
||||
|
||||
// 初始化
|
||||
// 天线位置
|
||||
for (long i = 0; i < prfcount; i++) {
|
||||
h_antPx[i] = antPx.get()[i];
|
||||
h_antPy[i] = antPy.get()[i];
|
||||
h_antPz[i] = antPz.get()[i];
|
||||
}
|
||||
|
||||
// 成像平面
|
||||
for (long i = 0; i < rowcount; i++) {
|
||||
for (long j = 0; j < colcount; j++) {
|
||||
h_imgx[i * colcount + j]=imgx.get()[i * colcount + j];
|
||||
h_imgy[i * colcount + j]=imgy.get()[i * colcount + j];
|
||||
h_imgz[i * colcount + j]=imgz.get()[i * colcount + j];
|
||||
}
|
||||
}
|
||||
|
||||
// 回波
|
||||
for (long i = 0; i < prfcount; i++) {
|
||||
for (long j = 0; j < freqcount; j++) {
|
||||
h_echoArr[i * freqcount + j] = make_cuComplex(echoArr.get()[i * freqcount + j].real(),
|
||||
echoArr.get()[i * freqcount + j].imag());
|
||||
}
|
||||
}
|
||||
|
||||
// 图像
|
||||
for (long i = 0; i < rowcount; i++) {
|
||||
for (long j = 0; j < colcount; j++) {
|
||||
h_imgArr[i * colcount + j].x = imgArr.get()[i * colcount + j].real();
|
||||
h_imgArr[i * colcount + j].y = imgArr.get()[i * colcount + j].imag();
|
||||
}
|
||||
}
|
||||
|
||||
// Host -> GPU
|
||||
HostToDevice(h_antPx, d_antPx, sizeof(float) * prfcount);
|
||||
HostToDevice(h_antPy, d_antPy, sizeof(float) * prfcount);
|
||||
HostToDevice(h_antPz, d_antPz, sizeof(float) * prfcount);
|
||||
|
||||
HostToDevice(h_imgx, d_imgx, sizeof(float) * rowcount * colcount);
|
||||
HostToDevice(h_imgy, d_imgy, sizeof(float) * rowcount * colcount);
|
||||
HostToDevice(h_imgz, d_imgz, sizeof(float) * rowcount * colcount);
|
||||
HostToDevice(h_R, d_R, sizeof(float) * rowcount * colcount);
|
||||
HostToDevice(h_CIdx, d_CIdx, sizeof(long) * rowcount * colcount);
|
||||
|
||||
HostToDevice(h_echoArr, d_echoArr, sizeof(cuComplex) * prfcount * freqcount);
|
||||
HostToDevice(h_imgArr, d_imgArr, sizeof(cuComplex) * rowcount * colcount);
|
||||
HostToDevice(h_imgEchoArr, d_imgEchoArr, sizeof(cuComplex) * rowcount * colcount);
|
||||
|
||||
#ifdef __TBPIMAGEDEBUG__
|
||||
// 定义采样点
|
||||
long tc[4] = { 6956,6542,7003,6840};
|
||||
long tr[4] = { 1100,9324,9415,11137};
|
||||
|
||||
for (long iii = 0; iii < 4; iii) {
|
||||
tr[iii] = tr[iii] - startRowID;
|
||||
}
|
||||
std::shared_ptr<float> Rlist(new float[4*prfcount], delArrPtr);
|
||||
std::shared_ptr<long> CIdslist(new long[4*prfcount], delArrPtr);
|
||||
|
||||
std::shared_ptr<float> imgchoReal (new float[4 * prfcount], delArrPtr);
|
||||
std::shared_ptr<float> imgchoImag (new float[4 * prfcount], delArrPtr);
|
||||
std::shared_ptr<float> imgdataReal(new float[4 * prfcount], delArrPtr);
|
||||
std::shared_ptr<float> imgdataImag(new float[4 * prfcount], delArrPtr);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
for (long prfid = 0; prfid < prfcount; prfid++) {
|
||||
CUDATBPImage(
|
||||
d_antPx,d_antPy,d_antPz,
|
||||
d_imgx,d_imgy,d_imgz,
|
||||
d_R,
|
||||
d_CIdx,
|
||||
d_echoArr,
|
||||
d_imgArr,
|
||||
d_imgEchoArr,
|
||||
freq, fs, Rnear, Rfar,
|
||||
rowcount, colcount,
|
||||
prfid, freqcount
|
||||
);
|
||||
|
||||
#ifdef __TBPIMAGEDEBUG__
|
||||
DeviceToHost(h_R, d_R, sizeof(float) * rowcount * colcount);
|
||||
DeviceToHost(h_CIdx, d_CIdx, sizeof(float) * rowcount * colcount);
|
||||
DeviceToHost(h_imgEchoArr, d_imgEchoArr, sizeof(cuComplex) * rowcount * colcount);
|
||||
DeviceToHost(h_imgArr, d_imgArr, sizeof(cuComplex) * rowcount * colcount);
|
||||
|
||||
|
||||
for (long iii = 0; iii < 4; iii++) {
|
||||
Rlist.get()[prfid * 4 + iii] = h_R[tr[iii] * colcount + tc[iii]];
|
||||
CIdslist.get()[prfid * 4 + iii] = h_CIdx[tr[iii] * colcount + tc[iii]];
|
||||
|
||||
imgchoReal.get()[prfid * 4 + iii] = h_imgEchoArr[tr[iii] * colcount + tc[iii]].x;
|
||||
imgchoImag.get()[prfid * 4 + iii] = h_imgEchoArr[tr[iii] * colcount + tc[iii]].y;
|
||||
imgdataReal.get()[prfid * 4 + iii] = h_imgArr[tr[iii] * colcount + tc[iii]].x;
|
||||
imgdataImag.get()[prfid * 4 + iii] = h_imgArr[tr[iii] * colcount + tc[iii]].y;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Device -> Host
|
||||
DeviceToHost(h_imgArr, d_imgArr, sizeof(cuComplex) * rowcount * colcount);
|
||||
#ifdef __TBPIMAGEDEBUG__
|
||||
|
||||
testOutAmpArr(QString("Rlist_%1.bin").arg(startPRFId), Rlist.get(), prfcount, 4);
|
||||
testOutAmpArr(QString("imgchoReal_%1.bin").arg(startPRFId), imgchoReal.get(), prfcount, 4);
|
||||
testOutAmpArr(QString("imgchoImag_%1.bin").arg(startPRFId), imgchoImag.get(), prfcount, 4);
|
||||
testOutAmpArr(QString("imgdataReal_%1.bin").arg(startPRFId), imgdataReal.get(), prfcount, 4);
|
||||
testOutAmpArr(QString("imgdataImag_%1.bin").arg(startPRFId), imgdataImag.get(), prfcount, 4);
|
||||
testOutClsArr(QString("CIdslist_%1.bin").arg(startPRFId), CIdslist.get(), prfcount, 4);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for (long i = 0; i < rowcount; i++) {
|
||||
for (long j = 0; j < colcount; j++) {
|
||||
imgArr.get()[i * colcount + j] = std::complex<double>(h_imgArr[i * colcount + j].x,h_imgArr[i * colcount + j].y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FreeCUDAHost(h_antPx); FreeCUDADevice(d_antPx);
|
||||
FreeCUDAHost(h_antPy); FreeCUDADevice(d_antPy);
|
||||
FreeCUDAHost(h_antPz); FreeCUDADevice(d_antPz);
|
||||
|
||||
FreeCUDAHost(h_imgx); FreeCUDADevice(d_imgx);
|
||||
FreeCUDAHost(h_imgy); FreeCUDADevice(d_imgy);
|
||||
FreeCUDAHost(h_imgz); FreeCUDADevice(d_imgz);
|
||||
|
||||
FreeCUDAHost(h_echoArr); FreeCUDADevice(d_echoArr);
|
||||
FreeCUDAHost(h_imgArr); FreeCUDADevice(d_imgArr);
|
||||
FreeCUDAHost(h_R); FreeCUDADevice(d_R);
|
||||
|
||||
return ErrorCode::SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void TBPImageAlgCls::setGPU(bool flag)
|
||||
{
|
||||
|
@ -488,186 +448,92 @@ bool TBPImageAlgCls::getGPU( )
|
|||
return this->GPURUN;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
ErrorCode TBPImageAlgCls::ProcessCPU(long num_thread)
|
||||
void TBPImageAlgCls::EchoFreqToTime()
|
||||
{
|
||||
omp_set_num_threads(num_thread);
|
||||
// 常用参数
|
||||
long rowCount = this->L1ds->getrowCount();
|
||||
long colCount = this->L1ds->getcolCount();
|
||||
long pixelCount = rowCount * colCount;
|
||||
// 读取数据
|
||||
|
||||
long PRFCount = this->L0ds->getPluseCount();
|
||||
long PlusePoints = this->L0ds->getPlusePoints();
|
||||
long inColCount = this->L0ds->getPlusePoints();
|
||||
long outColCount = inColCount;// nextpow2(inColCount);
|
||||
this->TimeEchoRowCount = PRFCount;
|
||||
this->TimeEchoColCount = outColCount;
|
||||
qDebug() << "IFFT : " << this->TimeEchoDataPath;
|
||||
qDebug() << "PRF Count:\t" << PRFCount;
|
||||
qDebug() << "inColCount:\t" << inColCount;
|
||||
qDebug() << "outColCount:\t" << outColCount;
|
||||
// 创建二进制文件
|
||||
gdalImageComplex outTimeEchoImg = CreategdalImageComplexNoProj(this->TimeEchoDataPath, this->TimeEchoRowCount, this->TimeEchoColCount, 1);
|
||||
|
||||
// 分块
|
||||
long echoBlockline = Memory1GB / 8 / 2 / outColCount * 3; //1GB
|
||||
echoBlockline = echoBlockline < 1 ? 1 : echoBlockline;
|
||||
|
||||
|
||||
double Rnear = this->L1ds->getNearRange();
|
||||
double Rfar = this->L1ds->getFarRange();
|
||||
double fs = this->L1ds->getFs();
|
||||
double dx = LIGHTSPEED / 2 / fs;
|
||||
double factorj = this->L1ds->getCenterFreq() * 4 * M_PI / LIGHTSPEED * 1e9;
|
||||
long startechoid = 0;
|
||||
for (long startechoid = 0; startechoid < PRFCount; startechoid = startechoid + echoBlockline) {
|
||||
|
||||
long tempechoBlockline = echoBlockline;
|
||||
if (startechoid + tempechoBlockline >= PRFCount) {
|
||||
tempechoBlockline = PRFCount - startechoid;
|
||||
}
|
||||
std::shared_ptr<std::complex<double>> echoArr = this->L0ds->getEchoArr(startechoid, tempechoBlockline);
|
||||
std::shared_ptr<std::complex<double>> IFFTArr = outTimeEchoImg.getDataComplexSharePtr(startechoid, 0, tempechoBlockline, outColCount, 1);
|
||||
|
||||
Eigen::MatrixXcd echo = Eigen::MatrixXcd::Zero(PRFCount, PlusePoints);
|
||||
{
|
||||
std::shared_ptr<std::complex<double>> echodata = this->L0ds->getEchoArr();
|
||||
for (long i = 0; i < PRFCount; i++) {
|
||||
for (long j = 0; j < PlusePoints; j++) {
|
||||
echo(i, j) = echodata.get()[i * PlusePoints + j];
|
||||
std::shared_ptr<cuComplex> host_echoArr((cuComplex*)mallocCUDAHost(sizeof(cuComplex) * tempechoBlockline * outColCount), FreeCUDAHost);
|
||||
std::shared_ptr<cuComplex> host_IFFTechoArr((cuComplex*)mallocCUDAHost(sizeof(cuComplex) * tempechoBlockline * outColCount), FreeCUDAHost);
|
||||
|
||||
memset(host_echoArr.get(), 0, sizeof(cuComplex) * tempechoBlockline * outColCount);
|
||||
#pragma omp parallel for
|
||||
for (long ii = 0; ii < tempechoBlockline; ii++) {
|
||||
for (long jj = 0; jj < inColCount; jj++) {
|
||||
host_echoArr.get()[ii * outColCount + jj] = make_cuComplex(echoArr.get()[ii * inColCount + jj].real(), echoArr.get()[ii * inColCount + jj].imag());
|
||||
}
|
||||
}
|
||||
echodata.reset();
|
||||
}
|
||||
|
||||
Eigen::MatrixXd pixelX = Eigen::MatrixXd::Zero(rowCount, colCount);
|
||||
Eigen::MatrixXd pixelY = Eigen::MatrixXd::Zero(rowCount, colCount);
|
||||
Eigen::MatrixXd pixelZ = Eigen::MatrixXd::Zero(rowCount, colCount);
|
||||
|
||||
Eigen::MatrixXd Pxs = Eigen::MatrixXd::Zero(this->L0ds->getPluseCount(), 1);
|
||||
Eigen::MatrixXd Pys = Eigen::MatrixXd::Zero(this->L0ds->getPluseCount(), 1);
|
||||
Eigen::MatrixXd Pzs = Eigen::MatrixXd::Zero(this->L0ds->getPluseCount(), 1);
|
||||
|
||||
// 图像网格坐标
|
||||
{
|
||||
std::shared_ptr<double> antpos = this->L0ds->getAntPos();
|
||||
double time = 0;
|
||||
double Px = 0;
|
||||
double Py = 0;
|
||||
double Pz = 0;
|
||||
double Vx = 0;
|
||||
double Vy = 0;
|
||||
double Vz = 0;
|
||||
double AntDirectX = 0;
|
||||
double AntDirectY = 0;
|
||||
double AntDirectZ = 0;
|
||||
double AVx = 0;
|
||||
double AVy = 0;
|
||||
double AVz = 0;
|
||||
|
||||
double R = 0;
|
||||
double NormAnt = 0;
|
||||
|
||||
for (long i = 0; i < rowCount; i++) {
|
||||
time = antpos.get()[i * 19 + 0];
|
||||
Px = antpos.get()[i * 19 + 1];
|
||||
Py = antpos.get()[i * 19 + 2];
|
||||
Pz = antpos.get()[i * 19 + 3];
|
||||
Vx = antpos.get()[i * 19 + 4];
|
||||
Vy = antpos.get()[i * 19 + 5];
|
||||
Vz = antpos.get()[i * 19 + 6];
|
||||
AntDirectX = antpos.get()[i * 19 + 13]; // Zero doppler
|
||||
AntDirectY = antpos.get()[i * 19 + 14];
|
||||
AntDirectZ = antpos.get()[i * 19 + 15];
|
||||
AVx = antpos.get()[i * 19 + 10];
|
||||
AVy = antpos.get()[i * 19 + 11];
|
||||
AVz = antpos.get()[i * 19 + 12];
|
||||
|
||||
NormAnt = std::sqrt(AntDirectX * AntDirectX + AntDirectY * AntDirectY + AntDirectZ * AntDirectZ);
|
||||
AntDirectX = AntDirectX / NormAnt;
|
||||
AntDirectY = AntDirectY / NormAnt;
|
||||
AntDirectZ = AntDirectZ / NormAnt;// 归一化
|
||||
|
||||
antpos.get()[i * 19 + 13] = AntDirectX;
|
||||
antpos.get()[i * 19 + 14] = AntDirectY;
|
||||
antpos.get()[i * 19 + 15] = AntDirectZ;
|
||||
Pxs(i, 0) = Px;
|
||||
Pys(i, 0) = Py;
|
||||
Pzs(i, 0) = Pz;
|
||||
|
||||
for (long j = 0; j < colCount; j++) {
|
||||
R = j * dx + Rnear;
|
||||
pixelX(i, j) = Px + AntDirectX * R;
|
||||
pixelY(i, j) = Py + AntDirectY * R;
|
||||
pixelZ(i, j) = Pz + AntDirectZ * R;
|
||||
}
|
||||
#pragma omp parallel for
|
||||
for (long ii = 0; ii < tempechoBlockline * outColCount; ii++) {
|
||||
host_IFFTechoArr.get()[ii] = make_cuComplex(0, 0);
|
||||
}
|
||||
|
||||
this->L1ds->saveAntPos(antpos);
|
||||
antpos.reset();
|
||||
}
|
||||
std::shared_ptr<cuComplex> device_echoArr((cuComplex*)mallocCUDADevice(sizeof(cuComplex) * tempechoBlockline * inColCount), FreeCUDADevice);
|
||||
std::shared_ptr<cuComplex> device_IFFTechoArr((cuComplex*)mallocCUDADevice(sizeof(cuComplex) * tempechoBlockline * outColCount), FreeCUDADevice);
|
||||
|
||||
// BP成像
|
||||
long BlockLine = Memory1MB * 10 / 16 / rowCount;
|
||||
if (rowCount / BlockLine / num_thread < 3) {
|
||||
BlockLine = rowCount / num_thread / 3;
|
||||
}
|
||||
BlockLine = BlockLine > 10 ? BlockLine : 10;
|
||||
HostToDevice(host_echoArr.get(), device_echoArr.get(), sizeof(cuComplex) * tempechoBlockline * inColCount);
|
||||
HostToDevice(host_IFFTechoArr.get(), device_IFFTechoArr.get(), sizeof(cuComplex) * tempechoBlockline * outColCount);
|
||||
CUDAIFFT(device_echoArr.get(), device_IFFTechoArr.get(), tempechoBlockline, outColCount, outColCount);
|
||||
|
||||
std::shared_ptr<std::complex<double>> imagarr = this->L1ds->getImageRaster();
|
||||
{
|
||||
for (long i = 0; i < pixelCount; i++) {
|
||||
imagarr.get()[i] = imagarr.get()[i];
|
||||
}
|
||||
}
|
||||
omp_lock_t lock; // 定义锁
|
||||
omp_init_lock(&lock); // 初始化锁
|
||||
FFTShift1D(device_IFFTechoArr.get(), tempechoBlockline, outColCount);
|
||||
|
||||
long writeImageCount = 0;
|
||||
qDebug() << "block line:\t" << BlockLine;
|
||||
|
||||
|
||||
long startLine = 0;
|
||||
long processValue = 0;
|
||||
long processNumber = 0;
|
||||
QProgressDialog progressDialog(u8"RFPC回波生成中", u8"终止", 0, rowCount);
|
||||
progressDialog.setWindowTitle(u8"RFPC回波生成中");
|
||||
progressDialog.setWindowModality(Qt::WindowModal);
|
||||
progressDialog.setAutoClose(true);
|
||||
progressDialog.setValue(0);
|
||||
progressDialog.setMaximum(rowCount);
|
||||
progressDialog.setMinimum(0);
|
||||
progressDialog.show();
|
||||
DeviceToHost(host_IFFTechoArr.get(), device_IFFTechoArr.get(), sizeof(cuComplex) * tempechoBlockline * outColCount);
|
||||
|
||||
#pragma omp parallel for
|
||||
for (startLine = 0; startLine < rowCount; startLine = startLine + BlockLine) { // 图像大小
|
||||
long stepLine = startLine + BlockLine < rowCount ? BlockLine : rowCount - startLine;
|
||||
long imageRowID = startLine; //
|
||||
|
||||
//Eigen::MatrixXd R = Eigen::MatrixXd::Zero(rowCount, 1);
|
||||
long pluseId = 0;
|
||||
std::complex<double> factPhas(0, 0);
|
||||
std::complex < double> sign(0, 0);
|
||||
Eigen::MatrixXd R = Eigen::MatrixXd::Zero(rowCount, 1);
|
||||
Eigen::MatrixXcd Rphi = Eigen::MatrixXd::Zero(rowCount, 1);
|
||||
|
||||
long PluseIDs = 0;
|
||||
double mask = 0;
|
||||
|
||||
for (long i = 0; i < stepLine; i++) { // 图像行
|
||||
imageRowID = startLine + i;
|
||||
for (long j = 0; j < colCount; j++) { //图像列
|
||||
R = ((pixelX(i, j) - Pxs.array()).array().pow(2) + (pixelY(i, j) - Pys.array()).array().pow(2) + (pixelZ(i, j) - Pzs.array()).array().pow(2)).array().sqrt();
|
||||
Rphi = Rphi.array() * 0;
|
||||
Rphi.imag() = R.array() * factorj;
|
||||
Rphi = Rphi.array().exp();
|
||||
|
||||
for (long prfid = 0; prfid < rowCount; prfid++) { // 脉冲行
|
||||
PluseIDs = std::floor((R(prfid, 0) - Rnear) / dx);
|
||||
mask = (PluseIDs < 0 || PluseIDs >= PlusePoints) ? 0 : 1;
|
||||
PluseIDs = (PluseIDs < 0 || PluseIDs >= PlusePoints) ? 0 : PluseIDs;
|
||||
imagarr.get()[imageRowID * colCount + j] =
|
||||
imagarr.get()[imageRowID * colCount + j] +
|
||||
mask * echo(prfid, PluseIDs) * Rphi(prfid, 0);// 信号* 相位校正
|
||||
}
|
||||
for (long ii = 0; ii < tempechoBlockline; ii++) {
|
||||
for (long jj = 0; jj < outColCount; jj++) {
|
||||
IFFTArr.get()[ii * outColCount + jj] = std::complex<double>(host_IFFTechoArr.get()[ii * outColCount + jj].x, host_IFFTechoArr.get()[ii * outColCount + jj].y);
|
||||
//IFFTArr.get()[ii * outColCount + jj] = std::complex<double>(host_echoArr.get()[ii * outColCount + jj].x, host_echoArr.get()[ii * outColCount + jj].y);
|
||||
}
|
||||
|
||||
}
|
||||
omp_set_lock(&lock); // 保存文件
|
||||
processValue = processValue + BlockLine;
|
||||
this->L1ds->saveImageRaster(imagarr, 0, rowCount);
|
||||
qDebug() << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz").toUtf8().constData() << "\t" << processValue * 100.0 / rowCount << "%\t" << startLine << "\t-\t" << startLine + BlockLine << "\tend\t\t";
|
||||
processNumber = processNumber + BlockLine;
|
||||
processNumber = processNumber < progressDialog.maximum() ? processNumber : progressDialog.maximum();
|
||||
progressDialog.setValue(processNumber);
|
||||
omp_unset_lock(&lock); // 解锁
|
||||
}
|
||||
omp_destroy_lock(&lock); // 销毁锁
|
||||
|
||||
this->L1ds->saveImageRaster(imagarr, 0, rowCount);
|
||||
this->L1ds->saveToXml();
|
||||
progressDialog.close();
|
||||
return ErrorCode::SUCCESS;
|
||||
outTimeEchoImg.saveImage(IFFTArr, startechoid, 0, tempechoBlockline, outColCount, 1);
|
||||
|
||||
qDebug() << QString(" image block PRF:[%1] \t").arg((startechoid + tempechoBlockline) * 100.0 / PRFCount)
|
||||
<< startechoid << "\t-\t" << startechoid + tempechoBlockline;
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool TBPImageAlgCls::checkZeros(double* data, long long len)
|
||||
{
|
||||
bool flag = true;
|
||||
#pragma omp parallel for
|
||||
for (long long i = 0; i < len; i++) {
|
||||
if (abs(data[i]) < 1e-7) {
|
||||
flag= false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
*/
|
||||
|
|
|
@ -51,26 +51,41 @@ public:
|
|||
|
||||
public:
|
||||
ErrorCode Process(long num_thread);
|
||||
ErrorCode ProcessWithGridNet(long num_thread, QString xyzRasterPath);
|
||||
void setGPU(bool flag);
|
||||
bool getGPU( );
|
||||
bool getGPU();
|
||||
private:
|
||||
//ErrorCode ProcessCPU(long num_thread);
|
||||
ErrorCode ProcessGPU();
|
||||
ErrorCode BPProcessBlockGPU();
|
||||
private://ÁÙʱ³ÉÔ±±äÁ¿
|
||||
QString TimeEchoDataPath;
|
||||
long TimeEchoRowCount;
|
||||
long TimeEchoColCount;
|
||||
|
||||
void EchoFreqToTime();
|
||||
|
||||
|
||||
private:
|
||||
bool checkZeros(double* data, long long len);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
void CreatePixelXYZ(std::shared_ptr<EchoL0Dataset> echoL0ds,QString outPixelXYZPath);
|
||||
|
||||
|
||||
void TBPImageProcess(QString echofile,QString outImageFolder,QString imagePlanePath,long num_thread);
|
||||
void TBPImageGPUAlg(std::shared_ptr<float> antPx, std::shared_ptr<float> antPy, std::shared_ptr<float> antPz,
|
||||
std::shared_ptr<float> img_x, std::shared_ptr<float> img_y, std::shared_ptr<float> img_z,
|
||||
std::shared_ptr<std::complex<double>> echoArr,
|
||||
std::shared_ptr<std::complex<double>> img_arr,
|
||||
float freq, float fs, float Rnear, float Rfar,
|
||||
long rowcount, long colcount,
|
||||
long prfcount,long freqcount,
|
||||
long startPRFId,long startRowID
|
||||
);
|
||||
|
||||
//
|
||||
//void TBPImageGridNet(
|
||||
// std::shared_ptr<double> antPx, std::shared_ptr<double> antPy, std::shared_ptr<double> antPz,
|
||||
// std::shared_ptr<double> img_x, std::shared_ptr<double> img_y, std::shared_ptr<double> img_z,
|
||||
// std::shared_ptr<std::complex<double>> echoArr,
|
||||
// std::shared_ptr<std::complex<double>> img_arr,
|
||||
// double freq, double dx, double Rnear, double Rfar, double refRange,
|
||||
// long rowcount, long colcount,
|
||||
// long prfcount, long freqcount,
|
||||
// long startPRFId, long startRowID
|
||||
//);
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#include "ToolBoxWidget.h"
|
||||
#include "QSimulationSARPolynomialOrbitModel.h"
|
||||
#include "QSimulationLookTableDialog.h"
|
||||
#include "QCreateSARIntensityByLookTableDialog.h"
|
||||
|
||||
SARSimlulationRFPCToolButton::SARSimlulationRFPCToolButton(QWidget* parent)
|
||||
{
|
||||
|
@ -71,6 +72,7 @@ void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWi
|
|||
emit toolbox->addBoxToolItemSIGNAL(new SARSimulationTBPImageToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QSimulationSAROrbitModelToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new LookTableComputerClassToolButton(toolbox));
|
||||
emit toolbox->addBoxToolItemSIGNAL(new QCreateSARIntensityByLookTableToolButton(toolbox));
|
||||
|
||||
|
||||
|
||||
|
@ -91,4 +93,21 @@ void LookTableComputerClassToolButton::excute()
|
|||
{
|
||||
QSimulationLookTableDialog* dialog = new QSimulationLookTableDialog;
|
||||
dialog->show();
|
||||
}
|
||||
}
|
||||
|
||||
QCreateSARIntensityByLookTableToolButton::QCreateSARIntensityByLookTableToolButton(QWidget* parent)
|
||||
{
|
||||
this->toolPath = QVector<QString>(0);
|
||||
this->toolPath.push_back(u8"仿真工具库");
|
||||
this->toolname = QString(u8"生成模拟强度图");
|
||||
}
|
||||
|
||||
QCreateSARIntensityByLookTableToolButton::~QCreateSARIntensityByLookTableToolButton()
|
||||
{
|
||||
}
|
||||
|
||||
void QCreateSARIntensityByLookTableToolButton::excute()
|
||||
{
|
||||
QCreateSARIntensityByLookTableDialog* dialog = new QCreateSARIntensityByLookTableDialog;
|
||||
dialog->show();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,16 @@ public slots:
|
|||
|
||||
};
|
||||
|
||||
class SIMULATIONSARTOOL_EXPORT QCreateSARIntensityByLookTableToolButton : public QToolAbstract {
|
||||
Q_OBJECT
|
||||
public:
|
||||
QCreateSARIntensityByLookTableToolButton(QWidget* parent = nullptr);
|
||||
~QCreateSARIntensityByLookTableToolButton();
|
||||
public slots:
|
||||
|
||||
virtual void excute() override;
|
||||
|
||||
};
|
||||
|
||||
extern "C" SIMULATIONSARTOOL_EXPORT void RegisterPreToolBox(LAMPMainWidget::RasterMainWidget* mainwindows, ToolBoxWidget* toolbox);
|
||||
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
<?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|ARM">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|ARM">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>ARM</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
|
@ -14,7 +22,9 @@
|
|||
<ProjectGuid>{ED06DFCD-4B9F-41F7-8F25-1823C2398142}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">10.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
@ -24,6 +34,12 @@
|
|||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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>
|
||||
|
@ -31,6 +47,13 @@
|
|||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" 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" />
|
||||
|
@ -40,11 +63,21 @@
|
|||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" 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;opengl;gui;xmlpatterns;widgets;location;printsupport;charts</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="QtSettings">
|
||||
<QtInstall>tools_qt5</QtInstall>
|
||||
<QtModules>core;xml;opengl;gui;xmlpatterns;widgets;location;printsupport;charts</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>
|
||||
|
@ -56,10 +89,18 @@
|
|||
<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 Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||
<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>
|
||||
|
@ -70,6 +111,13 @@
|
|||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<IncludePath>..\..\BaseCommonLibrary;..\..\BaseCommonLibrary\BaseTool;..\..\BaseCommonLibrary\ToolAbstract;..\..\GPUBaseLib\GPUTool;.\SimulationSAR;.;..\..\LAMPSARProcessProgram\ToolBoxManager;..\..\RasterMainWidgetGUI\RasterMainWidget;..\..\RasterProcessToolWidget;..\..\RasterMainWidgetGUI;.\PowerSimulationIncoherent;..\..\ImageshowTool;..\..\ImageshowTool\Imageshow;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\Toolbox\</OutDir>
|
||||
<TargetName>PluginTool_$(ProjectName)</TargetName>
|
||||
<CopyLocalProjectReference>true</CopyLocalProjectReference>
|
||||
<CopyCppRuntimeToOutputDir>true</CopyCppRuntimeToOutputDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
|
@ -81,6 +129,21 @@
|
|||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||
</CudaCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>cufft.lib;%(AdditionalDependencies);cudart.lib;cudadevrt.lib</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||
<ClCompile>
|
||||
<EnableParallelCodeGeneration>true</EnableParallelCodeGeneration>
|
||||
<OpenMPSupport>true</OpenMPSupport>
|
||||
<LanguageStandard>stdcpp14</LanguageStandard>
|
||||
<LanguageStandard_C>stdc11</LanguageStandard_C>
|
||||
</ClCompile>
|
||||
<CudaCompile>
|
||||
<GenerateRelocatableDeviceCode>true</GenerateRelocatableDeviceCode>
|
||||
<CodeGeneration>compute_86,sm_86</CodeGeneration>
|
||||
</CudaCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
|
@ -95,7 +158,37 @@
|
|||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>SIMULATIONSARTOOL_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>SIMULATIONSARTOOL_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>Console</SubSystem>
|
||||
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<PreprocessorDefinitions>SIMULATIONSARTOOL_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
|
@ -114,6 +207,7 @@
|
|||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="PowerSimulationIncoherent\OribtModelOperator.cpp" />
|
||||
<ClCompile Include="PowerSimulationIncoherent\QCreateSARIntensityByLookTableDialog.cpp" />
|
||||
<ClCompile Include="PowerSimulationIncoherent\QSimulationLookTableDialog.cpp" />
|
||||
<ClCompile Include="PowerSimulationIncoherent\QSimulationSARPolynomialOrbitModel.cpp" />
|
||||
<ClCompile Include="SimulationSAR\QImageSARRFPC.cpp" />
|
||||
|
@ -126,16 +220,25 @@
|
|||
<ClCompile Include="SimulationSAR\SatelliteOribtModel.cpp" />
|
||||
<ClCompile Include="SimulationSAR\SigmaDatabase.cpp" />
|
||||
<ClCompile Include="SimulationSAR\TBPImageAlgCls.cpp" />
|
||||
<ClCompile Include="UnitTestMain.cpp" />
|
||||
<CudaCompile Include="GPUBpSimulation.cu" />
|
||||
<CudaCompile Include="SimulationSAR\GPUTBPImage.cu" />
|
||||
<QtMoc Include="PowerSimulationIncoherent\QSimulationSARPolynomialOrbitModel.h" />
|
||||
<CudaCompile Include="PowerSimulationIncoherent\LookTableSimulationComputer.cuh" />
|
||||
<ClInclude Include="GPUBpSimulation.cuh" />
|
||||
<ClInclude Include="PowerSimulationIncoherent\OribtModelOperator.h" />
|
||||
<QtMoc Include="PowerSimulationIncoherent\QSimulationLookTableDialog.h" />
|
||||
<QtMoc Include="PowerSimulationIncoherent\QCreateSARIntensityByLookTableDialog.h" />
|
||||
<ClInclude Include="SimulationSARToolAPI.h" />
|
||||
<ClInclude Include="simulationsartool_global.h" />
|
||||
<QtMoc Include="SimulationSAR\QImageSARRFPC.h" />
|
||||
<QtMoc Include="SimulationSAR\QSARLookTableSimualtionGUI.h" />
|
||||
<QtMoc Include="SimulationSAR\QSimulationBPImage.h" />
|
||||
<QtMoc Include="SimulationSAR\QSimulationRFPCGUI.h" />
|
||||
<CudaCompile Include="SimulationSAR\BPBasic0_CUDA.cu" />
|
||||
<CudaCompile Include="SimulationSAR\GPUBPTool.cuh" />
|
||||
<ClInclude Include="SimulationSAR\BPBasic0_CUDA.cuh" />
|
||||
<ClInclude Include="SimulationSAR\GPUTBPImage.cuh" />
|
||||
<ClInclude Include="SimulationSAR\RFPCProcessCls.h" />
|
||||
<ClInclude Include="SimulationSAR\SARSatelliteSimulationAbstractCls.h" />
|
||||
<ClInclude Include="SimulationSAR\SARSimulationTaskSetting.h" />
|
||||
|
@ -147,16 +250,14 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CudaCompile Include="PowerSimulationIncoherent\LookTableSimulationComputer.cu" />
|
||||
<CudaCompile Include="SimulationSAR\GPUBPTool.cu" />
|
||||
<CudaCompile Include="SimulationSAR\GPURFPC.cu">
|
||||
<FileType>Document</FileType>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPURFPC.cuh" />
|
||||
<CudaCompile Include="SimulationSAR\GPUTBPImage.cu">
|
||||
<FileType>Document</FileType>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPUTBPImage.cuh" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="PowerSimulationIncoherent\QCreateSARIntensityByLookTableDialog.ui" />
|
||||
<QtUic Include="PowerSimulationIncoherent\QSimulationLookTableDialog.ui" />
|
||||
<QtUic Include="PowerSimulationIncoherent\QSimulationSARPolynomialOrbitModel.ui" />
|
||||
<QtUic Include="SimulationSAR\QImageSARRFPC.ui" />
|
||||
|
|
|
@ -59,6 +59,15 @@
|
|||
<ClInclude Include="PowerSimulationIncoherent\OribtModelOperator.h">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SimulationSAR\BPBasic0_CUDA.cuh">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="SimulationSAR\GPUTBPImage.cuh">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GPUBpSimulation.cuh">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="SimulationSAR\QImageSARRFPC.cpp">
|
||||
|
@ -100,6 +109,12 @@
|
|||
<ClCompile Include="PowerSimulationIncoherent\QSimulationLookTableDialog.cpp">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PowerSimulationIncoherent\QCreateSARIntensityByLookTableDialog.cpp">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="UnitTestMain.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtUic Include="SimulationSAR\QImageSARRFPC.ui">
|
||||
|
@ -120,6 +135,9 @@
|
|||
<QtUic Include="PowerSimulationIncoherent\QSimulationLookTableDialog.ui">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</QtUic>
|
||||
<QtUic Include="PowerSimulationIncoherent\QCreateSARIntensityByLookTableDialog.ui">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</QtUic>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="SimulationSAR\QImageSARRFPC.h">
|
||||
|
@ -143,6 +161,9 @@
|
|||
<QtMoc Include="PowerSimulationIncoherent\QSimulationLookTableDialog.h">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</QtMoc>
|
||||
<QtMoc Include="PowerSimulationIncoherent\QCreateSARIntensityByLookTableDialog.h">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CudaCompile Include="SimulationSAR\GPURFPC.cu">
|
||||
|
@ -151,17 +172,26 @@
|
|||
<CudaCompile Include="SimulationSAR\GPURFPC.cuh">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPUTBPImage.cu">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPUTBPImage.cuh">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="PowerSimulationIncoherent\LookTableSimulationComputer.cu">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="PowerSimulationIncoherent\LookTableSimulationComputer.cuh">
|
||||
<Filter>PowerSimulationIncoherent</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPUBPTool.cu">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPUBPTool.cuh">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\BPBasic0_CUDA.cu">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="SimulationSAR\GPUTBPImage.cu">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
<CudaCompile Include="GPUBpSimulation.cu">
|
||||
<Filter>SimulationSAR</Filter>
|
||||
</CudaCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,421 @@
|
|||
/*
|
||||
* 仿真测试代码
|
||||
*
|
||||
*
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <QString>
|
||||
|
||||
#include "EchoDataFormat.h"
|
||||
#include "ImageShowDialogClass.h"
|
||||
#include "GPUBaseLibAPI.h"
|
||||
#include "BaseConstVariable.h"
|
||||
#include "GPUTool.cuh"
|
||||
#include "GPUBPTool.cuh"
|
||||
#include "BPBasic0_CUDA.cuh"
|
||||
#include "ImageOperatorBase.h"
|
||||
#include "GPUBpSimulation.cuh"
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
|
||||
void testSimualtionEchoPoint() {
|
||||
GPUDATA h_data{};
|
||||
/** 1. 轨道 **************************************************************************************************/
|
||||
qDebug() << u8"1.轨道文件读取中。。。";
|
||||
QString inGPSPath = u8"C:\\Users\\30453\\Desktop\\script\\data\\GF3_Simulation.gpspos.data";
|
||||
long gpspoints = gdalImage(inGPSPath).height;
|
||||
std::shared_ptr<SatelliteAntPos> antpos = SatelliteAntPosOperator::readAntPosFile(inGPSPath, gpspoints);
|
||||
h_data.AntX = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
h_data.AntY = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
h_data.AntZ = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
|
||||
for (long i = 0; i < gpspoints; i = i + 1) {
|
||||
h_data.AntX[i] = antpos.get()[i].Px;
|
||||
h_data.AntY[i] = antpos.get()[i].Py;
|
||||
h_data.AntZ[i] = antpos.get()[i].Pz;
|
||||
}
|
||||
//gpspoints = gpspoints / 2;
|
||||
qDebug() << "GPS points Count:\t" << gpspoints;
|
||||
qDebug() << "PRF 0:\t " << QString("%1,%2,%3").arg(h_data.AntX[0]).arg(h_data.AntY[0]).arg(h_data.AntZ[0]);
|
||||
qDebug() << "PRF " << gpspoints - 1 << ":\t " << QString("%1,%2,%3")
|
||||
.arg(h_data.AntX[gpspoints - 1])
|
||||
.arg(h_data.AntY[gpspoints - 1])
|
||||
.arg(h_data.AntZ[gpspoints - 1]);
|
||||
/** 2. 成像网格 **************************************************************************************************/
|
||||
qDebug() << u8"轨道文件读取结束\n2.成像网格读取。。。";
|
||||
QString demxyzPath = u8"D:\\Programme\\vs2022\\RasterMergeTest\\simulationData\\demdataset\\demxyz.bin";
|
||||
gdalImage demgridimg(demxyzPath);
|
||||
long dem_rowCount = demgridimg.height;
|
||||
long dem_ColCount = demgridimg.width;
|
||||
std::shared_ptr<double> demX = readDataArr<double>(demgridimg, 0, 0, dem_rowCount, dem_ColCount, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demY = readDataArr<double>(demgridimg, 0, 0, dem_rowCount, dem_ColCount, 2, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demZ = readDataArr<double>(demgridimg, 0, 0, dem_rowCount, dem_ColCount, 3, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
||||
h_data.x_mat = (double*)mallocCUDAHost(sizeof(double) * dem_rowCount * dem_ColCount);
|
||||
h_data.y_mat = (double*)mallocCUDAHost(sizeof(double) * dem_rowCount * dem_ColCount);
|
||||
h_data.z_mat = (double*)mallocCUDAHost(sizeof(double) * dem_rowCount * dem_ColCount);
|
||||
|
||||
for (long i = 0; i < dem_rowCount; i++) {
|
||||
for (long j = 0; j < dem_ColCount; j++) {
|
||||
h_data.x_mat[i * dem_ColCount + j] = demX.get()[i * dem_ColCount + j];
|
||||
h_data.y_mat[i * dem_ColCount + j] = demY.get()[i * dem_ColCount + j];
|
||||
h_data.z_mat[i * dem_ColCount + j] = demZ.get()[i * dem_ColCount + j];
|
||||
}
|
||||
}
|
||||
qDebug() << "dem row Count:\t" << dem_rowCount;
|
||||
qDebug() << "dem col Count:\t" << dem_ColCount;
|
||||
|
||||
qDebug() << u8"成像网格读取结束";
|
||||
/** 3. 频率网格 **************************************************************************************************/
|
||||
qDebug() << u8"3.处理频率";
|
||||
double centerFreq = 5.3e9;
|
||||
double bandwidth = 40e6;
|
||||
long freqpoints = 2048;
|
||||
std::shared_ptr<double> freqlist(getFreqPoints_mallocHost(centerFreq - bandwidth / 2, centerFreq + bandwidth / 2, freqpoints), FreeCUDAHost);
|
||||
std::shared_ptr<double> minF(new double[gpspoints], delArrPtr);
|
||||
for (long i = 0; i < gpspoints; i++) {
|
||||
minF.get()[i] = freqlist.get()[0];
|
||||
}
|
||||
h_data.deltaF = bandwidth / (freqpoints - 1);
|
||||
qDebug() << "start Freq:\t" << centerFreq - bandwidth / 2;
|
||||
qDebug() << "end Freq:\t" << centerFreq + bandwidth / 2;
|
||||
qDebug() << "freq points:\t" << freqpoints;
|
||||
qDebug() << "delta freq:\t" << freqlist.get()[1] - freqlist.get()[0];
|
||||
qDebug() << u8"频率结束";
|
||||
/** 4. 初始化回波 **************************************************************************************************/
|
||||
qDebug() << u8"4.初始化回波";
|
||||
std::shared_ptr<cuComplex> phdata(createEchoPhase_mallocHost(gpspoints, freqpoints), FreeCUDAHost);
|
||||
qDebug() << "Azimuth Points:\t" << gpspoints;
|
||||
qDebug() << "Range Points:\t" << freqpoints;
|
||||
qDebug() << u8"初始化回波结束";
|
||||
/** 5. 初始化图像 **************************************************************************************************/
|
||||
qDebug() << u8"5.初始化图像";
|
||||
h_data.im_final = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * dem_rowCount * dem_ColCount);
|
||||
qDebug() << "Azimuth Points:\t" << gpspoints;
|
||||
qDebug() << "Range Points:\t" << freqpoints;
|
||||
qDebug() << u8"初始化图像结束";
|
||||
|
||||
/** 6. 模型参数初始化 **************************************************************************************************/
|
||||
qDebug() << u8"6.模型参数初始化";
|
||||
|
||||
h_data.nx = dem_ColCount;
|
||||
h_data.ny = dem_rowCount;
|
||||
|
||||
h_data.Np = gpspoints;
|
||||
h_data.Freq = freqlist.get();
|
||||
h_data.minF = minF.get();
|
||||
h_data.Nfft = freqpoints;
|
||||
h_data.K = h_data.Nfft;
|
||||
h_data.phdata = phdata.get();
|
||||
h_data.R0 = 900000;
|
||||
qDebug() << u8"模型参数结束";
|
||||
|
||||
|
||||
/** 7. 目标 **************************************************************************************************/
|
||||
double Tx = -2029086.618142, Ty = 4139594.934504, Tz = 4392846.782027;
|
||||
double Tslx = -2029086.618142, Tsly = 4139594.934504, Tslz = 4392846.782027;
|
||||
double p1 = 33.3, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0;
|
||||
|
||||
/** 7. 构建回波 **************************************************************************************************/
|
||||
GPUDATA d_data;
|
||||
initGPUData(h_data, d_data);
|
||||
|
||||
RFPCProcess(Tx, Ty, Tz,
|
||||
Tslx, Tsly, Tslz, // 目标的坡面向量
|
||||
p1, p2, p3, p4, p5, p6,
|
||||
d_data);
|
||||
|
||||
|
||||
/** 8. 展示回波 **************************************************************************************************/
|
||||
{
|
||||
DeviceToHost(h_data.phdata, d_data.phdata, sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
cuComplex* h_ifftphdata = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
cuComplex* d_ifftphdata = (cuComplex*)mallocCUDADevice(sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
CUDAIFFT(d_data.phdata, d_ifftphdata, d_data.Np, d_data.Nfft, d_data.Nfft);
|
||||
FFTShift1D(d_ifftphdata, d_data.Np, d_data.Nfft);
|
||||
DeviceToHost(h_ifftphdata, d_ifftphdata, sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
std::shared_ptr<std::complex<double>> ifftdata(new std::complex<double>[d_data.Np * d_data.Nfft], delArrPtr);
|
||||
{
|
||||
for (long i = 0; i < d_data.Np; i++) {
|
||||
for (long j = 0; j < d_data.Nfft; j++) {
|
||||
ifftdata.get()[i * d_data.Nfft + j] =
|
||||
std::complex<double>(
|
||||
h_ifftphdata[i * d_data.Nfft + j].x,
|
||||
h_ifftphdata[i * d_data.Nfft + j].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutComplexDoubleArr(QString("echo_ifft.bin"), ifftdata.get(), d_data.Np, d_data.Nfft);
|
||||
|
||||
FreeCUDADevice(d_ifftphdata);
|
||||
FreeCUDAHost(h_ifftphdata);
|
||||
|
||||
}
|
||||
/** 9. 成像 **************************************************************************************************/
|
||||
|
||||
// 计算maxWr(需要先计算deltaF)
|
||||
double deltaF = h_data.deltaF; // 从输入参数获取
|
||||
double maxWr = 299792458.0f / (2.0f * deltaF);
|
||||
qDebug() << "maxWr :\t" << maxWr;
|
||||
double* r_vec_host = (double*)mallocCUDAHost(sizeof(double) * h_data.Nfft);// new double[data.Nfft];
|
||||
const double step = maxWr / h_data.Nfft;
|
||||
const double start = -1 * h_data.Nfft / 2.0f * step;
|
||||
printf("nfft=%d\n", h_data.Nfft);
|
||||
|
||||
for (int i = 0; i < h_data.Nfft; ++i) {
|
||||
r_vec_host[i] = start + i * step;
|
||||
}
|
||||
|
||||
h_data.r_vec = r_vec_host;
|
||||
d_data.r_vec = h_data.r_vec;
|
||||
|
||||
qDebug() << "r_vec [0]:\t" << h_data.r_vec[0];
|
||||
qDebug() << "r_vec step:\t" << step;
|
||||
|
||||
bpBasic0CUDA(d_data, 0);
|
||||
|
||||
DeviceToHost(h_data.im_final, d_data.im_final, sizeof(cuComplex) * d_data.nx * d_data.ny);
|
||||
|
||||
{
|
||||
DeviceToHost(h_data.phdata, d_data.phdata, sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
std::shared_ptr<std::complex<double>> ifftdata(new std::complex<double>[d_data.Np * d_data.Nfft], delArrPtr);
|
||||
{
|
||||
for (long i = 0; i < d_data.Np; i++) {
|
||||
for (long j = 0; j < d_data.Nfft; j++) {
|
||||
ifftdata.get()[i * d_data.Nfft + j] =
|
||||
std::complex<double>(
|
||||
h_data.phdata[i * d_data.Nfft + j].x,
|
||||
h_data.phdata[i * d_data.Nfft + j].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutComplexDoubleArr(QString("echo_ifft_BPBasic.bin"), ifftdata.get(), d_data.Np, d_data.Nfft);
|
||||
|
||||
|
||||
|
||||
std::shared_ptr<std::complex<double>> im_finals(new std::complex<double>[d_data.nx * d_data.ny], delArrPtr);
|
||||
{
|
||||
for (long i = 0; i < d_data.ny; i++) {
|
||||
for (long j = 0; j < d_data.nx; j++) {
|
||||
im_finals.get()[i * d_data.nx + j] = std::complex<double>(
|
||||
h_data.im_final[i * d_data.nx + j].x,
|
||||
h_data.im_final[i * d_data.nx + j].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutComplexDoubleArr(QString("im_finals.bin"), im_finals.get(), d_data.ny, d_data.nx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void testBpImage() {
|
||||
|
||||
GPUDATA h_data{};
|
||||
/** 0. 轨道 **************************************************************************************************/
|
||||
QString echoPath = "D:\\Programme\\vs2022\\RasterMergeTest\\LAMPCAE_SCANE-all-scane\\GF3_Simulation.xml";
|
||||
std::shared_ptr<EchoL0Dataset> echoL0ds(new EchoL0Dataset);
|
||||
echoL0ds->Open(echoPath);
|
||||
qDebug() << u8"加载回拨文件:\t" << echoPath;
|
||||
|
||||
/** 1. 轨道 **************************************************************************************************/
|
||||
qDebug() << u8"1.轨道文件读取中。。。";
|
||||
QString inGPSPath = echoL0ds->getGPSPointFilePath();
|
||||
long gpspoints = gdalImage(inGPSPath).height;
|
||||
std::shared_ptr<SatelliteAntPos> antpos = SatelliteAntPosOperator::readAntPosFile(inGPSPath, gpspoints);
|
||||
h_data.AntX = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
h_data.AntY = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
h_data.AntZ = (double*)mallocCUDAHost(sizeof(double) * gpspoints);
|
||||
|
||||
for (long i = 0; i < gpspoints; i = i + 1) {
|
||||
h_data.AntX[i] = antpos.get()[i].Px;
|
||||
h_data.AntY[i] = antpos.get()[i].Py;
|
||||
h_data.AntZ[i] = antpos.get()[i].Pz;
|
||||
}
|
||||
//gpspoints = gpspoints / 2;
|
||||
qDebug() << "GPS points Count:\t" << gpspoints;
|
||||
qDebug() << "PRF 0:\t " << QString("%1,%2,%3").arg(h_data.AntX[0]).arg(h_data.AntY[0]).arg(h_data.AntZ[0]);
|
||||
qDebug() << "PRF " << gpspoints - 1 << ":\t " << QString("%1,%2,%3")
|
||||
.arg(h_data.AntX[gpspoints - 1])
|
||||
.arg(h_data.AntY[gpspoints - 1])
|
||||
.arg(h_data.AntZ[gpspoints - 1]);
|
||||
/** 2. 成像网格 **************************************************************************************************/
|
||||
qDebug() << u8"轨道文件读取结束\n2.成像网格读取。。。";
|
||||
QString demxyzPath = u8"D:\\Programme\\vs2022\\RasterMergeTest\\simulationData\\demdataset\\demxyz.bin";
|
||||
gdalImage demgridimg(demxyzPath);
|
||||
long dem_rowCount = demgridimg.height;
|
||||
long dem_ColCount = demgridimg.width;
|
||||
std::shared_ptr<double> demX = readDataArr<double>(demgridimg, 0, 0, dem_rowCount, dem_ColCount, 1, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demY = readDataArr<double>(demgridimg, 0, 0, dem_rowCount, dem_ColCount, 2, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
std::shared_ptr<double> demZ = readDataArr<double>(demgridimg, 0, 0, dem_rowCount, dem_ColCount, 3, GDALREADARRCOPYMETHOD::VARIABLEMETHOD);
|
||||
|
||||
h_data.x_mat = (double*)mallocCUDAHost(sizeof(double) * dem_rowCount * dem_ColCount);
|
||||
h_data.y_mat = (double*)mallocCUDAHost(sizeof(double) * dem_rowCount * dem_ColCount);
|
||||
h_data.z_mat = (double*)mallocCUDAHost(sizeof(double) * dem_rowCount * dem_ColCount);
|
||||
|
||||
for (long i = 0; i < dem_rowCount; i++) {
|
||||
for (long j = 0; j < dem_ColCount; j++) {
|
||||
h_data.x_mat[i * dem_ColCount + j] = demX.get()[i * dem_ColCount + j];
|
||||
h_data.y_mat[i * dem_ColCount + j] = demY.get()[i * dem_ColCount + j];
|
||||
h_data.z_mat[i * dem_ColCount + j] = demZ.get()[i * dem_ColCount + j];
|
||||
}
|
||||
}
|
||||
qDebug() << "dem row Count:\t" << dem_rowCount;
|
||||
qDebug() << "dem col Count:\t" << dem_ColCount;
|
||||
|
||||
qDebug() << u8"成像网格读取结束";
|
||||
/** 3. 频率网格 **************************************************************************************************/
|
||||
qDebug() << u8"3.处理频率";
|
||||
double centerFreq = echoL0ds->getCenterFreq();
|
||||
double bandwidth = echoL0ds->getBandwidth();
|
||||
size_t freqpoints = echoL0ds->getPlusePoints();
|
||||
std::shared_ptr<double> freqlist(getFreqPoints_mallocHost(centerFreq - bandwidth / 2, centerFreq + bandwidth / 2, freqpoints), FreeCUDAHost);
|
||||
std::shared_ptr<double> minF(new double[gpspoints], delArrPtr);
|
||||
for (long i = 0; i < gpspoints; i++) {
|
||||
minF.get()[i] = freqlist.get()[0];
|
||||
}
|
||||
h_data.deltaF = bandwidth / (freqpoints - 1);
|
||||
qDebug() << "start Freq:\t" << centerFreq - bandwidth / 2;
|
||||
qDebug() << "end Freq:\t" << centerFreq + bandwidth / 2;
|
||||
qDebug() << "freq points:\t" << freqpoints;
|
||||
qDebug() << "delta freq:\t" << freqlist.get()[1] - freqlist.get()[0];
|
||||
qDebug() << u8"频率结束";
|
||||
/** 4. 初始化回波 **************************************************************************************************/
|
||||
qDebug() << u8"4.初始化回波";
|
||||
std::shared_ptr<std::complex<double>> echoData = echoL0ds->getEchoArr();
|
||||
size_t echosize = sizeof(cuComplex) * gpspoints * freqpoints;
|
||||
qDebug() << "echo data size (byte) :\t" << echosize;
|
||||
h_data.phdata = (cuComplex*)mallocCUDAHost(echosize);
|
||||
shared_complexPtrToHostCuComplex(echoData.get(), h_data.phdata, gpspoints * freqpoints);
|
||||
|
||||
qDebug() << "Azimuth Points:\t" << gpspoints;
|
||||
qDebug() << "Range Points:\t" << freqpoints;
|
||||
qDebug() << u8"初始化回波结束";
|
||||
/** 5. 初始化图像 **************************************************************************************************/
|
||||
qDebug() << u8"5.初始化图像";
|
||||
h_data.im_final = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * dem_rowCount * dem_ColCount);
|
||||
qDebug() << "Azimuth Points:\t" << gpspoints;
|
||||
qDebug() << "Range Points:\t" << freqpoints;
|
||||
qDebug() << u8"初始化图像结束";
|
||||
|
||||
/** 6. 模型参数初始化 **************************************************************************************************/
|
||||
qDebug() << u8"6.模型参数初始化";
|
||||
|
||||
h_data.nx = dem_ColCount;
|
||||
h_data.ny = dem_rowCount;
|
||||
|
||||
h_data.Np = gpspoints;
|
||||
h_data.Freq = freqlist.get();
|
||||
h_data.minF = minF.get();
|
||||
h_data.Nfft = freqpoints;
|
||||
h_data.K = h_data.Nfft;
|
||||
|
||||
h_data.R0 = echoL0ds->getRefPhaseRange();
|
||||
qDebug() << u8"模型参数结束";
|
||||
|
||||
|
||||
/** 7. 目标 **************************************************************************************************/
|
||||
double Tx = -2029086.618142, Ty = 4139594.934504, Tz = 4392846.782027;
|
||||
double Tslx = -2029086.618142, Tsly = 4139594.934504, Tslz = 4392846.782027;
|
||||
double p1 = 33.3, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0;
|
||||
|
||||
/** 7. 构建回波 **************************************************************************************************/
|
||||
GPUDATA d_data;
|
||||
initGPUData(h_data, d_data);
|
||||
|
||||
/** 8. 展示回波 **************************************************************************************************/
|
||||
{
|
||||
DeviceToHost(h_data.phdata, d_data.phdata, sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
cuComplex* h_ifftphdata = (cuComplex*)mallocCUDAHost(sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
cuComplex* d_ifftphdata = (cuComplex*)mallocCUDADevice(sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
CUDAIFFT(d_data.phdata, d_ifftphdata, d_data.Np, d_data.Nfft, d_data.Nfft);
|
||||
FFTShift1D(d_ifftphdata, d_data.Np, d_data.Nfft);
|
||||
DeviceToHost(h_ifftphdata, d_ifftphdata, sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
std::shared_ptr<std::complex<double>> ifftdata(new std::complex<double>[d_data.Np * d_data.Nfft], delArrPtr);
|
||||
{
|
||||
for (long i = 0; i < d_data.Np; i++) {
|
||||
for (long j = 0; j < d_data.Nfft; j++) {
|
||||
ifftdata.get()[i * d_data.Nfft + j] =
|
||||
std::complex<double>(
|
||||
h_ifftphdata[i * d_data.Nfft + j].x,
|
||||
h_ifftphdata[i * d_data.Nfft + j].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutComplexDoubleArr(QString("echo_ifft.bin"), ifftdata.get(), d_data.Np, d_data.Nfft);
|
||||
|
||||
FreeCUDADevice(d_ifftphdata);
|
||||
FreeCUDAHost(h_ifftphdata);
|
||||
|
||||
}
|
||||
/** 9. 成像 **************************************************************************************************/
|
||||
|
||||
// 计算maxWr(需要先计算deltaF)
|
||||
double deltaF = h_data.deltaF; // 从输入参数获取
|
||||
double maxWr = 299792458.0f / (2.0f * deltaF);
|
||||
qDebug() << "maxWr :\t" << maxWr;
|
||||
double* r_vec_host = (double*)mallocCUDAHost(sizeof(double) * h_data.Nfft);// new double[data.Nfft];
|
||||
const double step = maxWr / h_data.Nfft;
|
||||
const double start = -1 * h_data.Nfft / 2.0f * step;
|
||||
printf("nfft=%d\n", h_data.Nfft);
|
||||
|
||||
for (int i = 0; i < h_data.Nfft; ++i) {
|
||||
r_vec_host[i] = start + i * step;
|
||||
}
|
||||
|
||||
h_data.r_vec = r_vec_host;
|
||||
d_data.r_vec = h_data.r_vec;
|
||||
|
||||
qDebug() << "r_vec [0]:\t" << h_data.r_vec[0];
|
||||
qDebug() << "r_vec step:\t" << step;
|
||||
|
||||
bpBasic0CUDA(d_data, 0);
|
||||
|
||||
DeviceToHost(h_data.im_final, d_data.im_final, sizeof(cuComplex) * d_data.nx * d_data.ny);
|
||||
{
|
||||
DeviceToHost(h_data.phdata, d_data.phdata, sizeof(cuComplex) * d_data.Np * d_data.Nfft);
|
||||
std::shared_ptr<std::complex<double>> ifftdata(new std::complex<double>[d_data.Np * d_data.Nfft], delArrPtr);
|
||||
{
|
||||
for (long i = 0; i < d_data.Np; i++) {
|
||||
for (long j = 0; j < d_data.Nfft; j++) {
|
||||
ifftdata.get()[i * d_data.Nfft + j] =
|
||||
std::complex<double>(
|
||||
h_data.phdata[i * d_data.Nfft + j].x,
|
||||
h_data.phdata[i * d_data.Nfft + j].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutComplexDoubleArr(QString("echo_ifft_BPBasic.bin"), ifftdata.get(), d_data.Np, d_data.Nfft);
|
||||
|
||||
std::shared_ptr<std::complex<double>> im_finals(new std::complex<double>[d_data.nx * d_data.ny], delArrPtr);
|
||||
{
|
||||
for (long i = 0; i < d_data.ny; i++) {
|
||||
for (long j = 0; j < d_data.nx; j++) {
|
||||
im_finals.get()[i * d_data.nx + j] = std::complex<double>(
|
||||
h_data.im_final[i * d_data.nx + j].x,
|
||||
h_data.im_final[i * d_data.nx + j].y);
|
||||
}
|
||||
}
|
||||
}
|
||||
testOutComplexDoubleArr(QString("im_finals.bin"), im_finals.get(), d_data.ny, d_data.nx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//int main(int argc, char* argv[]) {
|
||||
//
|
||||
// QApplication a(argc, argv);
|
||||
//
|
||||
// testBpImage();
|
||||
//
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue