第一次提交
This commit is contained in:
41
CDlgInform.cpp
Normal file
41
CDlgInform.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
// CDlgInform.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "IrisFODIS_CalibrationTool.h"
|
||||
#include "CDlgInform.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
|
||||
// CDlgInform 对话框
|
||||
|
||||
IMPLEMENT_DYNAMIC(CDlgInform, CDialogEx)
|
||||
|
||||
CDlgInform::CDlgInform(CWnd* pParent /*=nullptr*/)
|
||||
: CDialogEx(IDD_DIALOG_INFORM, pParent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
CDlgInform::~CDlgInform()
|
||||
{
|
||||
}
|
||||
|
||||
void CDlgInform::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogEx::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_STATIC_INFORMATION, m_staInfo);
|
||||
}
|
||||
|
||||
LRESULT CDlgInform::OnInformUpdate(WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
UpdateData(FALSE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDlgInform, CDialogEx)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CDlgInform 消息处理程序
|
25
CDlgInform.h
Normal file
25
CDlgInform.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
// CDlgInform 对话框
|
||||
|
||||
class CDlgInform : public CDialogEx
|
||||
{
|
||||
DECLARE_DYNAMIC(CDlgInform)
|
||||
|
||||
public:
|
||||
CDlgInform(CWnd* pParent = nullptr); // 标准构造函数
|
||||
virtual ~CDlgInform();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_DIALOG_INFORM };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
LRESULT OnInformUpdate(WPARAM wParam, LPARAM lParam);
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
CStatic m_staInfo;
|
||||
};
|
BIN
IrisFODISCalibrationTool.aps
Normal file
BIN
IrisFODISCalibrationTool.aps
Normal file
Binary file not shown.
BIN
IrisFODISCalibrationTool.rc
Normal file
BIN
IrisFODISCalibrationTool.rc
Normal file
Binary file not shown.
107
IrisFODIS_CalibrationTool.cpp
Normal file
107
IrisFODIS_CalibrationTool.cpp
Normal file
@ -0,0 +1,107 @@
|
||||
|
||||
// IrisFODIS_CalibrationTool.cpp: 定义应用程序的类行为。
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "framework.h"
|
||||
#include "IrisFODIS_CalibrationTool.h"
|
||||
#include "IrisFODIS_CalibrationToolDlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
|
||||
// CIrisFODISCalibrationToolApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CIrisFODISCalibrationToolApp, CWinApp)
|
||||
ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CIrisFODISCalibrationToolApp 构造
|
||||
|
||||
CIrisFODISCalibrationToolApp::CIrisFODISCalibrationToolApp()
|
||||
{
|
||||
// 支持重新启动管理器
|
||||
m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
|
||||
|
||||
// TODO: 在此处添加构造代码,
|
||||
// 将所有重要的初始化放置在 InitInstance 中
|
||||
}
|
||||
|
||||
|
||||
// 唯一的 CIrisFODISCalibrationToolApp 对象
|
||||
|
||||
CIrisFODISCalibrationToolApp theApp;
|
||||
|
||||
|
||||
// CIrisFODISCalibrationToolApp 初始化
|
||||
|
||||
BOOL CIrisFODISCalibrationToolApp::InitInstance()
|
||||
{
|
||||
// 如果一个运行在 Windows XP 上的应用程序清单指定要
|
||||
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
|
||||
//则需要 InitCommonControlsEx()。 否则,将无法创建窗口。
|
||||
INITCOMMONCONTROLSEX InitCtrls;
|
||||
InitCtrls.dwSize = sizeof(InitCtrls);
|
||||
// 将它设置为包括所有要在应用程序中使用的
|
||||
// 公共控件类。
|
||||
InitCtrls.dwICC = ICC_WIN95_CLASSES;
|
||||
InitCommonControlsEx(&InitCtrls);
|
||||
|
||||
CWinApp::InitInstance();
|
||||
|
||||
|
||||
AfxEnableControlContainer();
|
||||
|
||||
// 创建 shell 管理器,以防对话框包含
|
||||
// 任何 shell 树视图控件或 shell 列表视图控件。
|
||||
CShellManager *pShellManager = new CShellManager;
|
||||
|
||||
// 激活“Windows Native”视觉管理器,以便在 MFC 控件中启用主题
|
||||
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerWindows));
|
||||
|
||||
// 标准初始化
|
||||
// 如果未使用这些功能并希望减小
|
||||
// 最终可执行文件的大小,则应移除下列
|
||||
// 不需要的特定初始化例程
|
||||
// 更改用于存储设置的注册表项
|
||||
// TODO: 应适当修改该字符串,
|
||||
// 例如修改为公司或组织名
|
||||
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
|
||||
|
||||
CIrisFODISCalibrationToolDlg dlg;
|
||||
m_pMainWnd = &dlg;
|
||||
INT_PTR nResponse = dlg.DoModal();
|
||||
if (nResponse == IDOK)
|
||||
{
|
||||
// TODO: 在此放置处理何时用
|
||||
// “确定”来关闭对话框的代码
|
||||
}
|
||||
else if (nResponse == IDCANCEL)
|
||||
{
|
||||
// TODO: 在此放置处理何时用
|
||||
// “取消”来关闭对话框的代码
|
||||
}
|
||||
else if (nResponse == -1)
|
||||
{
|
||||
TRACE(traceAppMsg, 0, "警告: 对话框创建失败,应用程序将意外终止。\n");
|
||||
TRACE(traceAppMsg, 0, "警告: 如果您在对话框上使用 MFC 控件,则无法 #define _AFX_NO_MFC_CONTROLS_IN_DIALOGS。\n");
|
||||
}
|
||||
|
||||
// 删除上面创建的 shell 管理器。
|
||||
if (pShellManager != nullptr)
|
||||
{
|
||||
delete pShellManager;
|
||||
}
|
||||
|
||||
#if !defined(_AFXDLL) && !defined(_AFX_NO_MFC_CONTROLS_IN_DIALOGS)
|
||||
ControlBarCleanUp();
|
||||
#endif
|
||||
|
||||
// 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
|
||||
// 而不是启动应用程序的消息泵。
|
||||
return FALSE;
|
||||
}
|
||||
|
32
IrisFODIS_CalibrationTool.h
Normal file
32
IrisFODIS_CalibrationTool.h
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
// IrisFODIS_CalibrationTool.h: PROJECT_NAME 应用程序的主头文件
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error "include 'pch.h' before including this file for PCH"
|
||||
#endif
|
||||
|
||||
#include "resource.h" // 主符号
|
||||
|
||||
|
||||
// CIrisFODISCalibrationToolApp:
|
||||
// 有关此类的实现,请参阅 IrisFODIS_CalibrationTool.cpp
|
||||
//
|
||||
|
||||
class CIrisFODISCalibrationToolApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CIrisFODISCalibrationToolApp();
|
||||
|
||||
// 重写
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
|
||||
// 实现
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
extern CIrisFODISCalibrationToolApp theApp;
|
31
IrisFODIS_CalibrationTool.sln
Normal file
31
IrisFODIS_CalibrationTool.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.28307.1433
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IrisFODIS_CalibrationTool", "IrisFODIS_CalibrationTool.vcxproj", "{AFAC84D1-5AA4-4A09-B9B4-671323044546}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Debug|x86 = Debug|x86
|
||||
Release|x64 = Release|x64
|
||||
Release|x86 = Release|x86
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Debug|x64.Build.0 = Debug|x64
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Debug|x86.Build.0 = Debug|Win32
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Release|x64.ActiveCfg = Release|x64
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Release|x64.Build.0 = Release|x64
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Release|x86.ActiveCfg = Release|Win32
|
||||
{AFAC84D1-5AA4-4A09-B9B4-671323044546}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {CD311250-AD82-4A76-89EF-4442BF8F0D59}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
221
IrisFODIS_CalibrationTool.vcxproj
Normal file
221
IrisFODIS_CalibrationTool.vcxproj
Normal file
@ -0,0 +1,221 @@
|
||||
<?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|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<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">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{AFAC84D1-5AA4-4A09-B9B4-671323044546}</ProjectGuid>
|
||||
<Keyword>MFCProj</Keyword>
|
||||
<RootNamespace>IrisFODISCalibrationTool</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<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|Win32'">
|
||||
<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)'=='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|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0804</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0804</Culture>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0804</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
<Midl>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
<ValidateAllParameters>true</ValidateAllParameters>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</Midl>
|
||||
<ResourceCompile>
|
||||
<Culture>0x0804</Culture>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CDlgInform.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="IrisFODIS_CalibrationTool.h" />
|
||||
<ClInclude Include="IrisFODIS_CalibrationToolDlg.h" />
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="CDlgInform.cpp" />
|
||||
<ClCompile Include="IrisFODIS_CalibrationTool.cpp" />
|
||||
<ClCompile Include="IrisFODIS_CalibrationToolDlg.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="IrisFODISCalibrationTool.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\IrisFODISCalibrationTool.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="res\IrisFODIS_CalibrationTool.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
69
IrisFODIS_CalibrationTool.vcxproj.filters
Normal file
69
IrisFODIS_CalibrationTool.vcxproj.filters
Normal file
@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="IrisFODIS_CalibrationTool.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IrisFODIS_CalibrationToolDlg.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="pch.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CDlgInform.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="IrisFODIS_CalibrationTool.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="IrisFODIS_CalibrationToolDlg.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="pch.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CDlgInform.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="IrisFODISCalibrationTool.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\IrisFODISCalibrationTool.rc2">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="res\IrisFODIS_CalibrationTool.ico">
|
||||
<Filter>资源文件</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
6
IrisFODIS_CalibrationTool.vcxproj.user
Normal file
6
IrisFODIS_CalibrationTool.vcxproj.user
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<RESOURCE_FILE>IrisFODISCalibrationTool.rc</RESOURCE_FILE>
|
||||
</PropertyGroup>
|
||||
</Project>
|
429
IrisFODIS_CalibrationToolDlg.cpp
Normal file
429
IrisFODIS_CalibrationToolDlg.cpp
Normal file
@ -0,0 +1,429 @@
|
||||
|
||||
// IrisFODIS_CalibrationToolDlg.cpp: 实现文件
|
||||
//
|
||||
|
||||
#include "pch.h"
|
||||
#include "framework.h"
|
||||
#include "IrisFODIS_CalibrationTool.h"
|
||||
#include "IrisFODIS_CalibrationToolDlg.h"
|
||||
#include "afxdialogex.h"
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
|
||||
// 用于应用程序“关于”菜单项的 CAboutDlg 对话框
|
||||
|
||||
class CAboutDlg : public CDialogEx
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
|
||||
// 实现
|
||||
protected:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialogEx(IDD_ABOUTBOX)
|
||||
{
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogEx::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialogEx)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CIrisFODISCalibrationToolDlg 对话框
|
||||
|
||||
|
||||
|
||||
CIrisFODISCalibrationToolDlg::CIrisFODISCalibrationToolDlg(CWnd* pParent /*=nullptr*/)
|
||||
: CDialogEx(IDD_IRISFODIS_CALIBRATIONTOOL_DIALOG, pParent)
|
||||
{
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
|
||||
m_vecFodisFile.clear();
|
||||
}
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialogEx::DoDataExchange(pDX);
|
||||
DDX_Control(pDX, IDC_EDIT_FODISDATA, m_ceFODISFilePath);
|
||||
DDX_Control(pDX, IDC_LIST_DATAPATH, m_lbFilePath);
|
||||
DDX_Control(pDX, IDC_EDIT_OUTPUTDATA, m_ceOutputPath);
|
||||
DDX_Control(pDX, IDC_EDIT_CALDATA, m_ceCalFilePath);
|
||||
}
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::ShowFileDialog(long lResID, LPCTSTR lpszDefExt, LPCTSTR lpszFilter, int iType)
|
||||
{
|
||||
CFileDialog *cfdSave;
|
||||
CString csFileExt;
|
||||
cfdSave = new CFileDialog(true, lpszDefExt, NULL, OFN_FILEMUSTEXIST, lpszFilter, GetParent());
|
||||
if (IDOK == cfdSave->DoModal())
|
||||
{
|
||||
csFileExt = cfdSave->GetFileExt();
|
||||
CString cstrSavePath = cfdSave->GetPathName();
|
||||
if (iType == 0)
|
||||
{
|
||||
((CEdit *)GetDlgItem(lResID))->SetWindowText(cstrSavePath);
|
||||
}
|
||||
else if (iType == 1)
|
||||
{
|
||||
((CListBox *)GetDlgItem(lResID))->AddString(cstrSavePath);
|
||||
}
|
||||
}
|
||||
delete cfdSave;
|
||||
}
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::ShowFolderDialog(long lResID, LPCTSTR lpszDefExt)
|
||||
{
|
||||
BROWSEINFO bi;
|
||||
char name[MAX_PATH];
|
||||
ZeroMemory(&bi, sizeof(BROWSEINFO));
|
||||
bi.hwndOwner = AfxGetMainWnd()->GetSafeHwnd();
|
||||
bi.pszDisplayName = (LPWSTR)name;
|
||||
bi.lpszTitle = lpszDefExt;
|
||||
bi.ulFlags = BIF_RETURNFSANCESTORS;
|
||||
LPITEMIDLIST idl = SHBrowseForFolder(&bi);
|
||||
CString strDirectoryPath;
|
||||
SHGetPathFromIDList(idl, strDirectoryPath.GetBuffer(MAX_PATH));
|
||||
strDirectoryPath.ReleaseBuffer();
|
||||
if (strDirectoryPath.IsEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
int iPos = strDirectoryPath.GetLength();
|
||||
if (iPos == 3)
|
||||
{
|
||||
((CEdit *)GetDlgItem(lResID))->SetWindowTextW(strDirectoryPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
((CEdit *)GetDlgItem(lResID))->SetWindowTextW(strDirectoryPath + _T("\\"));
|
||||
}
|
||||
|
||||
UpdateData(false);
|
||||
}
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::ResetListBoxHScrollBar(long lResID)
|
||||
{
|
||||
CDC * dc = GetDC();
|
||||
SIZE s;
|
||||
int index;
|
||||
CString str;
|
||||
long temp;
|
||||
|
||||
for (index = 0; index < m_lbFilePath.GetCount(); index++)
|
||||
{
|
||||
m_lbFilePath.GetText(index, str);
|
||||
s = dc->GetTextExtent(str, str.GetLength() + 1); // 获取字符串的像素大小
|
||||
temp = (long)SendDlgItemMessage(lResID, LB_GETHORIZONTALEXTENT, 0, 0); //temp得到滚动条的宽度
|
||||
if (s.cx > temp)
|
||||
{
|
||||
SendDlgItemMessage(lResID, LB_SETHORIZONTALEXTENT, (WPARAM)s.cx, 0);
|
||||
}
|
||||
|
||||
}
|
||||
ReleaseDC(dc);
|
||||
}
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::CreateInformDialog(CString cstrInformation, int iShow)
|
||||
{
|
||||
if (m_pdlgInfo != NULL)
|
||||
{
|
||||
delete m_pdlgInfo;
|
||||
m_pdlgInfo = NULL;
|
||||
}
|
||||
|
||||
m_pdlgInfo = new CDlgInform;
|
||||
m_pdlgInfo->Create(IDD_DIALOG_INFORM, this);
|
||||
m_pdlgInfo->m_staInfo.SetWindowTextW(cstrInformation);
|
||||
m_pdlgInfo->CenterWindow(this);
|
||||
m_pdlgInfo->ShowWindow(iShow);
|
||||
m_pdlgInfo->m_staInfo.UpdateData(FALSE);
|
||||
m_pdlgInfo->UpdateData(FALSE);
|
||||
}
|
||||
|
||||
UINT CIrisFODISCalibrationToolDlg::ThreadProcessFODISCal(LPVOID pParam)
|
||||
{
|
||||
CIrisFODISCalibrationToolDlg *pCaller = (CIrisFODISCalibrationToolDlg *)pParam;
|
||||
|
||||
CalFrame FPODISCalDataFrame;
|
||||
tagDataFrame OneDataFrame;
|
||||
CalDataFrame OneCalDataFrame;
|
||||
CFile cfFPODISCal,cfOriFODISData,cfCalFODISData;
|
||||
CString cstrOneOutputFilePath;
|
||||
|
||||
if (cfFPODISCal.Open(pCaller->m_cstrCalFilePath, CFile::modeRead))
|
||||
{
|
||||
//cfFPODISCal.Read(&FPODISCalDataFrame, sizeof(FPODISCalDataFrame));
|
||||
|
||||
cfFPODISCal.Read((char *)&FPODISCalDataFrame.uiExposureTimeInMS, sizeof(UINT));//U32
|
||||
cfFPODISCal.Read((char*)&FPODISCalDataFrame.fTemperature, sizeof(float));
|
||||
cfFPODISCal.Read((char*)&FPODISCalDataFrame.iPixels, sizeof(int));
|
||||
cfFPODISCal.Read((char*)FPODISCalDataFrame.fWaveLength, sizeof(float)*FPODISCalDataFrame.iPixels);
|
||||
cfFPODISCal.Read((char*)FPODISCalDataFrame.dCal_Gain, sizeof(double)*FPODISCalDataFrame.iPixels);
|
||||
cfFPODISCal.Read((char*)FPODISCalDataFrame.dCal_Offset, sizeof(double)*FPODISCalDataFrame.iPixels);
|
||||
//bReadIS2Cal = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
AfxMessageBox(L"Open cal file Err!!!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (UINT ui = 0; ui < pCaller->m_vecFodisFile.size(); ui++)
|
||||
{
|
||||
|
||||
CString cstrInfo;
|
||||
int iTempFileCount = (int)pCaller->m_vecFodisFile.size();
|
||||
cstrInfo.Format(_T("正在处理第%d个FODIS文件。。。共有%d个文件"), ui + 1, iTempFileCount);
|
||||
|
||||
pCaller->m_pdlgInfo->m_staInfo.SetWindowText(cstrInfo);
|
||||
pCaller->m_pdlgInfo->PostMessageW(MYWM_INFORM_UPDATE);
|
||||
|
||||
if (cfOriFODISData.Open(pCaller->m_vecFodisFile[ui], CFile::modeRead))
|
||||
{
|
||||
int iPos = pCaller->m_vecFodisFile[ui].ReverseFind('\\');
|
||||
cstrOneOutputFilePath = pCaller->m_cstrOutputFilePath + pCaller->m_vecFodisFile[ui].Right(pCaller->m_vecFodisFile[ui].GetLength()-iPos - 1);
|
||||
iPos = cstrOneOutputFilePath.ReverseFind('.');
|
||||
cstrOneOutputFilePath = cstrOneOutputFilePath.Left(iPos) + L".is2r";
|
||||
|
||||
cfCalFODISData.Open(cstrOneOutputFilePath, CFile::modeCreate | CFile::modeWrite);
|
||||
|
||||
while (cfOriFODISData.Read(&OneDataFrame, sizeof(OneDataFrame)))
|
||||
{
|
||||
OneCalDataFrame.dSyncTimes = OneDataFrame.dTimes;
|
||||
OneCalDataFrame.fTemperature = OneDataFrame.fTemperature;
|
||||
OneCalDataFrame.usExposureTime = OneDataFrame.usExposureTimeInMS;
|
||||
for (int i=0;i< FPODISCalDataFrame.iPixels;i++)
|
||||
{
|
||||
OneCalDataFrame.fData[i] = (float)((float)OneDataFrame.lData[i] * FPODISCalDataFrame.dCal_Gain[i] * ((float)FPODISCalDataFrame.uiExposureTimeInMS / (float)OneDataFrame.usExposureTimeInMS));
|
||||
}
|
||||
cfCalFODISData.Write(&OneCalDataFrame, sizeof(OneCalDataFrame));
|
||||
}
|
||||
cfCalFODISData.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
AfxMessageBox(L"Open FODIS data file Err!!!");
|
||||
return -2;
|
||||
}
|
||||
cfOriFODISData.Close();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CIrisFODISCalibrationToolDlg, CDialogEx)
|
||||
ON_WM_SYSCOMMAND()
|
||||
ON_WM_PAINT()
|
||||
ON_WM_QUERYDRAGICON()
|
||||
ON_BN_CLICKED(IDC_BUTTON_FODISDATA, &CIrisFODISCalibrationToolDlg::OnBnClickedButtonFodisdata)
|
||||
ON_BN_CLICKED(IDC_BUTTON_CALDATA, &CIrisFODISCalibrationToolDlg::OnBnClickedButtonCaldata)
|
||||
ON_BN_CLICKED(IDC_BUTTON_OUTPUTDATA, &CIrisFODISCalibrationToolDlg::OnBnClickedButtonOutputdata)
|
||||
ON_BN_CLICKED(IDC_BUTTON_STARTCALC, &CIrisFODISCalibrationToolDlg::OnBnClickedButtonStartcalc)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CIrisFODISCalibrationToolDlg 消息处理程序
|
||||
|
||||
BOOL CIrisFODISCalibrationToolDlg::OnInitDialog()
|
||||
{
|
||||
CDialogEx::OnInitDialog();
|
||||
|
||||
// 将“关于...”菜单项添加到系统菜单中。
|
||||
|
||||
// IDM_ABOUTBOX 必须在系统命令范围内。
|
||||
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != nullptr)
|
||||
{
|
||||
BOOL bNameValid;
|
||||
CString strAboutMenu;
|
||||
bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||
ASSERT(bNameValid);
|
||||
if (!strAboutMenu.IsEmpty())
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// 设置此对话框的图标。 当应用程序主窗口不是对话框时,框架将自动
|
||||
// 执行此操作
|
||||
SetIcon(m_hIcon, TRUE); // 设置大图标
|
||||
SetIcon(m_hIcon, FALSE); // 设置小图标
|
||||
|
||||
// TODO: 在此添加额外的初始化代码
|
||||
|
||||
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
|
||||
}
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||
{
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialogEx::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
// 如果向对话框添加最小化按钮,则需要下面的代码
|
||||
// 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序,
|
||||
// 这将由框架自动完成。
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // 用于绘制的设备上下文
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
|
||||
|
||||
// 使图标在工作区矩形中居中
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// 绘制图标
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialogEx::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
//当用户拖动最小化窗口时系统调用此函数取得光标
|
||||
//显示。
|
||||
HCURSOR CIrisFODISCalibrationToolDlg::OnQueryDragIcon()
|
||||
{
|
||||
return static_cast<HCURSOR>(m_hIcon);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::OnBnClickedButtonFodisdata()
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
ShowFolderDialog(IDC_EDIT_FODISDATA, L"请选择数据路径");
|
||||
|
||||
m_vecFodisFile.clear();
|
||||
m_lbFilePath.ResetContent();
|
||||
bool bWorking = true;
|
||||
|
||||
UpdateData(1);
|
||||
m_ceFODISFilePath.GetWindowTextW(m_cstrFODISFilePath);
|
||||
int iPos = m_cstrFODISFilePath.ReverseFind('\\');
|
||||
m_cstrFODISFilePath = m_cstrFODISFilePath.Left(iPos + 1);
|
||||
|
||||
m_ceOutputPath.SetWindowTextW(m_cstrFODISFilePath+L"Cal\\");
|
||||
|
||||
CFileFind cfFinder;
|
||||
bWorking = true;
|
||||
CString cstrPath = m_cstrFODISFilePath + _T("*.dat");
|
||||
bool bRes = cfFinder.FindFile(cstrPath);
|
||||
if (!bRes)
|
||||
{
|
||||
return;
|
||||
}
|
||||
while (bWorking)
|
||||
{
|
||||
bWorking = cfFinder.FindNextFile();
|
||||
|
||||
if (cfFinder.IsDots())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (cfFinder.IsDirectory())
|
||||
{
|
||||
CString str = cfFinder.GetFilePath();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
CString str = cfFinder.GetFilePath();
|
||||
m_vecFodisFile.push_back(str);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (UINT ui = 0; ui < m_vecFodisFile.size(); ui++)
|
||||
{
|
||||
m_lbFilePath.AddString(m_vecFodisFile[ui]);
|
||||
}
|
||||
|
||||
ResetListBoxHScrollBar(IDC_LIST_DATAPATH);
|
||||
}
|
||||
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::OnBnClickedButtonCaldata()
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
ShowFileDialog(IDC_EDIT_CALDATA, _T(".cal"), _T("Data Times Files (*.cal)|*.cal|"), 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::OnBnClickedButtonOutputdata()
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
ShowFolderDialog(IDC_EDIT_OUTPUTDATA, L"请选择保存数据路径");
|
||||
}
|
||||
|
||||
|
||||
void CIrisFODISCalibrationToolDlg::OnBnClickedButtonStartcalc()
|
||||
{
|
||||
// TODO: 在此添加控件通知处理程序代码
|
||||
if (m_vecFodisFile.size()==0)
|
||||
{
|
||||
AfxMessageBox(L"No FODIS Data File Found!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
m_ceCalFilePath.GetWindowTextW(m_cstrCalFilePath);
|
||||
if( m_cstrCalFilePath == L"")
|
||||
{
|
||||
AfxMessageBox(L"No Cal Data File Found!!!");
|
||||
return;
|
||||
}
|
||||
|
||||
m_ceOutputPath.GetWindowTextW(m_cstrOutputFilePath);
|
||||
if (m_cstrOutputFilePath == L"")
|
||||
{
|
||||
AfxMessageBox(L"No Output Filepath!!!");
|
||||
return;
|
||||
}
|
||||
if (!PathIsDirectory(m_cstrOutputFilePath))
|
||||
{
|
||||
CreateDirectory(m_cstrOutputFilePath, NULL);
|
||||
}
|
||||
|
||||
|
||||
CreateInformDialog(L"开始校准数据。。。", 1);
|
||||
m_ptrdProcess = AfxBeginThread(ThreadProcessFODISCal, this);
|
||||
}
|
95
IrisFODIS_CalibrationToolDlg.h
Normal file
95
IrisFODIS_CalibrationToolDlg.h
Normal file
@ -0,0 +1,95 @@
|
||||
|
||||
// IrisFODIS_CalibrationToolDlg.h: 头文件
|
||||
//
|
||||
|
||||
#pragma once
|
||||
#include <vector>
|
||||
#include "CDlgInform.h"
|
||||
|
||||
|
||||
typedef struct tagFODISCALDATAFRAME
|
||||
{
|
||||
int iExposureTime;
|
||||
int iPixels;
|
||||
double dTemperature;
|
||||
float pfWaveLength[2048];
|
||||
double pdGain[2048];
|
||||
double pdOffset[2048];
|
||||
}FPODISCalData;
|
||||
|
||||
typedef struct tagCalibrationFrame
|
||||
{
|
||||
UINT uiExposureTimeInMS;
|
||||
float fTemperature;
|
||||
int iPixels;
|
||||
float fWaveLength[4096] = { 0 };
|
||||
double dCal_Gain[4096] = { 0 };
|
||||
double dCal_Offset[4096] = { 0 };
|
||||
}CalFrame;
|
||||
|
||||
typedef struct tagDataFrame
|
||||
{
|
||||
UINT usExposureTimeInMS;
|
||||
int lData[4096];
|
||||
float fTemperature = 0;
|
||||
double dTimes = 0;
|
||||
}DataFrame;
|
||||
|
||||
typedef struct tagCalDataFrame
|
||||
{
|
||||
USHORT usExposureTime;
|
||||
float fData[2048];
|
||||
float fTemperature;
|
||||
double dSyncTimes;
|
||||
|
||||
}CalDataFrame;
|
||||
|
||||
// CIrisFODISCalibrationToolDlg 对话框
|
||||
class CIrisFODISCalibrationToolDlg : public CDialogEx
|
||||
{
|
||||
// 构造
|
||||
public:
|
||||
CIrisFODISCalibrationToolDlg(CWnd* pParent = nullptr); // 标准构造函数
|
||||
|
||||
// 对话框数据
|
||||
#ifdef AFX_DESIGN_TIME
|
||||
enum { IDD = IDD_IRISFODIS_CALIBRATIONTOOL_DIALOG };
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
|
||||
|
||||
private:
|
||||
std::vector<CString> m_vecFodisFile;
|
||||
CString m_cstrFODISFilePath,m_cstrCalFilePath,m_cstrOutputFilePath;
|
||||
CWinThread * m_ptrdProcess;
|
||||
CDlgInform * m_pdlgInfo;
|
||||
private:
|
||||
void ShowFileDialog(long lResID, LPCTSTR lpszDefExt, LPCTSTR lpszFilter, int iType);
|
||||
void ShowFolderDialog(long lResID, LPCTSTR lpszDefExt);
|
||||
void ResetListBoxHScrollBar(long lResID);
|
||||
|
||||
void CreateInformDialog(CString cstrInformation, int iShow);
|
||||
public:
|
||||
static UINT ThreadProcessFODISCal(LPVOID pParam);
|
||||
|
||||
// 实现
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
|
||||
// 生成的消息映射函数
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
afx_msg void OnBnClickedButtonFodisdata();
|
||||
CEdit m_ceFODISFilePath;
|
||||
CListBox m_lbFilePath;
|
||||
afx_msg void OnBnClickedButtonCaldata();
|
||||
afx_msg void OnBnClickedButtonOutputdata();
|
||||
CEdit m_ceOutputPath;
|
||||
afx_msg void OnBnClickedButtonStartcalc();
|
||||
CEdit m_ceCalFilePath;
|
||||
};
|
49
framework.h
Normal file
49
framework.h
Normal file
@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN // 从 Windows 头中排除极少使用的资料
|
||||
#endif
|
||||
|
||||
#include "targetver.h"
|
||||
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // 某些 CString 构造函数将是显式的
|
||||
|
||||
// 关闭 MFC 的一些常见且经常可放心忽略的隐藏警告消息
|
||||
#define _AFX_ALL_WARNINGS
|
||||
|
||||
#include <afxwin.h> // MFC 核心组件和标准组件
|
||||
#include <afxext.h> // MFC 扩展
|
||||
|
||||
|
||||
#include <afxdisp.h> // MFC 自动化类
|
||||
|
||||
|
||||
|
||||
#ifndef _AFX_NO_OLE_SUPPORT
|
||||
#include <afxdtctl.h> // MFC 对 Internet Explorer 4 公共控件的支持
|
||||
#endif
|
||||
#ifndef _AFX_NO_AFXCMN_SUPPORT
|
||||
#include <afxcmn.h> // MFC 对 Windows 公共控件的支持
|
||||
#endif // _AFX_NO_AFXCMN_SUPPORT
|
||||
|
||||
#include <afxcontrolbars.h> // MFC 支持功能区和控制条
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef _UNICODE
|
||||
#if defined _M_IX86
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#elif defined _M_X64
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#else
|
||||
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
5
pch.cpp
Normal file
5
pch.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
// pch.cpp: 与预编译标头对应的源文件
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
// 当使用预编译的头时,需要使用此源文件,编译才能成功。
|
16
pch.h
Normal file
16
pch.h
Normal file
@ -0,0 +1,16 @@
|
||||
// pch.h: 这是预编译标头文件。
|
||||
// 下方列出的文件仅编译一次,提高了将来生成的生成性能。
|
||||
// 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。
|
||||
// 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。
|
||||
// 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。
|
||||
|
||||
#ifndef PCH_H
|
||||
#define PCH_H
|
||||
|
||||
// 添加要在此处预编译的标头
|
||||
#include "framework.h"
|
||||
#include <afxcontrolbars.h>
|
||||
|
||||
#endif //PCH_H
|
||||
#define PI 3.1415926
|
||||
#define MYWM_INFORM_UPDATE WM_USER+100
|
BIN
res/IrisFODISCalibrationTool.rc2
Normal file
BIN
res/IrisFODISCalibrationTool.rc2
Normal file
Binary file not shown.
BIN
res/IrisFODIS_CalibrationTool.ico
Normal file
BIN
res/IrisFODIS_CalibrationTool.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 66 KiB |
30
resource.h
Normal file
30
resource.h
Normal file
@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ 生成的包含文件。
|
||||
// 供 IrisFODISCalibrationTool.rc 使用
|
||||
//
|
||||
#define IDM_ABOUTBOX 0x0010
|
||||
#define IDD_ABOUTBOX 100
|
||||
#define IDS_ABOUTBOX 101
|
||||
#define IDD_IRISFODIS_CALIBRATIONTOOL_DIALOG 102
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_DIALOG_INFORM 130
|
||||
#define IDC_EDIT_FODISDATA 1000
|
||||
#define IDC_BUTTON_FODISDATA 1001
|
||||
#define IDC_EDIT_CALDATA 1002
|
||||
#define IDC_LIST_DATAPATH 1003
|
||||
#define IDC_EDIT_OUTPUTDATA 1004
|
||||
#define IDC_BUTTON_STARTCALC 1006
|
||||
#define IDC_BUTTON_CALDATA 1007
|
||||
#define IDC_BUTTON_OUTPUTDATA 1008
|
||||
#define IDC_STATIC_INFORMATION 1017
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 132
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
8
targetver.h
Normal file
8
targetver.h
Normal file
@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
|
||||
|
||||
// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
|
||||
// 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
|
||||
|
||||
#include <SDKDDKVer.h>
|
Reference in New Issue
Block a user