From 353400e7e6a1b68944b76ac086e626c83ce914d2 Mon Sep 17 00:00:00 2001
From: LAPTOP-SNT8I5JK\Boounion <Chenluhua@qq.com>
Date: 星期一, 06 一月 2025 16:42:19 +0800
Subject: [PATCH] 1.初步将PLC调机功能驳离为独立App.
---
SourceCode/Bond/BoounionPLC/BoounionPLC.cpp | 143 +++++
.gitignore | 1
SourceCode/Bond/BoounionPLC/BoounionPLC.rc | 0
SourceCode/Bond/BoounionPLC/Log.cpp | 214 +++++++
SourceCode/Bond/BoounionPLC/res/BoounionPLC.ico | 0
SourceCode/Bond/GangBond2860.sln | 10
SourceCode/Bond/BoounionPLC/Model.cpp | 288 ++++++++++
SourceCode/Bond/BoounionPLC/stdafx.cpp | 8
SourceCode/Bond/BoounionPLC/Common.h | 6
SourceCode/Bond/BoounionPLC/Resource.h | 21
SourceCode/Bond/BoounionPLC/Configuration.cpp | 105 +++
SourceCode/Bond/BoounionPLC/Configuration.h | 31 +
SourceCode/Bond/BoounionPLC/stdafx.h | 55 ++
SourceCode/Bond/BoounionPLC/ReadMe.txt | 67 ++
SourceCode/Bond/BoounionPLC/targetver.h | 8
SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp | 154 +++++
SourceCode/Bond/BoounionPLC/BoounionPLCDlg.h | 34 +
SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj.filters | 84 +++
SourceCode/Bond/BoounionPLC/Model.h | 44 +
SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj | 227 ++++++++
SourceCode/Bond/BoounionPLC/Log.h | 61 ++
SourceCode/Bond/BoounionPLC/BoounionPLC.h | 42 +
SourceCode/Bond/BoounionPLC/res/BoounionPLC.rc2 | 0
23 files changed, 1,603 insertions(+), 0 deletions(-)
diff --git a/.gitignore b/.gitignore
index df2c187..0688f72 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@
SourceCode/Bond/x64/Release/BEQ.exp
SourceCode/Bond/x64/Release/Bonder.dat
SourceCode/Bond/Servo/x64/
+SourceCode/Bond/BoounionPLC/x64/
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLC.cpp b/SourceCode/Bond/BoounionPLC/BoounionPLC.cpp
new file mode 100644
index 0000000..ea8cc72
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLC.cpp
@@ -0,0 +1,143 @@
+
+// BoounionPLC.cpp : 定义应用程序的类行为。
+//
+
+#include "stdafx.h"
+#include "BoounionPLC.h"
+#include "BoounionPLCDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+// CBoounionPLCApp
+
+BEGIN_MESSAGE_MAP(CBoounionPLCApp, CWinApp)
+ ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
+END_MESSAGE_MAP()
+
+
+// CBoounionPLCApp 构造
+
+CBoounionPLCApp::CBoounionPLCApp()
+{
+ // 支持重新启动管理器
+ m_dwRestartManagerSupportFlags = AFX_RESTART_MANAGER_SUPPORT_RESTART;
+
+ // TODO: 在此处添加构造代码,
+ // 将所有重要的初始化放置在 InitInstance 中
+}
+
+
+// 唯一的一个 CBoounionPLCApp 对象
+
+CBoounionPLCApp theApp;
+
+
+// CBoounionPLCApp 初始化
+
+BOOL CBoounionPLCApp::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("应用程序向导生成的本地应用程序"));
+
+
+ // 本程序文件目录
+ TCHAR sDrive[_MAX_DRIVE];
+ TCHAR sDir[_MAX_DIR];
+ TCHAR sFilename[_MAX_FNAME], sAppFilename[_MAX_FNAME];
+ TCHAR sExt[_MAX_EXT];
+ GetModuleFileName(AfxGetInstanceHandle(), sAppFilename, _MAX_FNAME);
+ _tsplitpath_s(sAppFilename, sDrive, sDir, sFilename, sExt);
+ m_strAppDir = CString(sDrive) + CString(sDir);
+ m_strAppFile = CString(sFilename);
+ m_model.setWorkDir((LPTSTR)(LPCTSTR)m_strAppDir);
+
+
+ CString strIniFile;
+ strIniFile.Format(_T("%s\\BoounionPLCconfiguration.ini"), (LPTSTR)(LPCTSTR)m_strAppDir);
+ int plcTimeout = GetPrivateProfileInt("PLC", "Timeout", 700, strIniFile);
+ int plcBufSize = GetPrivateProfileInt("PLC", "BufSize", 20, strIniFile);
+ int plcPacketSize = GetPrivateProfileInt("PLC", "PacketSize", 80, strIniFile);
+ MCL_Initialize();
+ MCL_SetTimeout(plcTimeout);
+ MCL_SetMaxActionSize(plcBufSize);
+ MCL_SetPacketSize(plcPacketSize);
+ RX_Init();
+
+
+ m_hAppMutex = CreateMutexA(NULL, FALSE, _T("BoounionPLC"));
+ if (GetLastError() == ERROR_ALREADY_EXISTS) {
+ AfxMessageBox(_T("已经运行了一个实例,启动失败!"));
+ return FALSE;
+ }
+
+
+ CBoounionPLCDlg 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 != NULL)
+ {
+ delete pShellManager;
+ }
+
+ // 由于对话框已关闭,所以将返回 FALSE 以便退出应用程序,
+ // 而不是启动应用程序的消息泵。
+ return FALSE;
+}
+
+int CBoounionPLCApp::ExitInstance()
+{
+ m_model.term();
+ RX_Term();
+ MCL_Term();
+ CloseHandle(m_hAppMutex);
+
+ return CWinApp::ExitInstance();
+}
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLC.h b/SourceCode/Bond/BoounionPLC/BoounionPLC.h
new file mode 100644
index 0000000..94ff2c0
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLC.h
@@ -0,0 +1,42 @@
+
+// BoounionPLC.h : PROJECT_NAME 应用程序的主头文件
+//
+
+#pragma once
+
+#ifndef __AFXWIN_H__
+ #error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件"
+#endif
+
+#include "resource.h" // 主符号
+#include "Model.h"
+
+
+// CBoounionPLCApp:
+// 有关此类的实现,请参阅 BoounionPLC.cpp
+//
+
+class CBoounionPLCApp : public CWinApp
+{
+public:
+ CBoounionPLCApp();
+
+public:
+ CModel m_model;
+ HANDLE m_hAppMutex;
+ CString m_strAppDir;
+ CString m_strAppFile;
+ int m_nVersionNumber;
+ CString m_strVersionName;
+
+// 重写
+public:
+ virtual BOOL InitInstance();
+
+// 实现
+
+ DECLARE_MESSAGE_MAP()
+ virtual int ExitInstance();
+};
+
+extern CBoounionPLCApp theApp;
\ No newline at end of file
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLC.rc b/SourceCode/Bond/BoounionPLC/BoounionPLC.rc
new file mode 100644
index 0000000..90b8244
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLC.rc
Binary files differ
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj b/SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj
new file mode 100644
index 0000000..5fb4565
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj
@@ -0,0 +1,227 @@
+锘�<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="14.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">
+ <ProjectGuid>{6DC0600E-5588-4033-A281-3626A4F74B67}</ProjectGuid>
+ <RootNamespace>BoounionPLC</RootNamespace>
+ <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
+ <Keyword>MFCProj</Keyword>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>true</UseDebugLibraries>
+ <PlatformToolset>v140</PlatformToolset>
+ <CharacterSet>Unicode</CharacterSet>
+ <UseOfMfc>Dynamic</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</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>v140</PlatformToolset>
+ <CharacterSet>MultiByte</CharacterSet>
+ <UseOfMfc>Dynamic</UseOfMfc>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <UseDebugLibraries>false</UseDebugLibraries>
+ <PlatformToolset>v140</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>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </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>
+ <PreprocessorDefinitions>_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </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>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <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>
+ <WarningLevel>Level3</WarningLevel>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <Optimization>MaxSpeed</Optimization>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <PreprocessorDefinitions>_WINDOWS;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <SDLCheck>true</SDLCheck>
+ </ClCompile>
+ <Link>
+ <SubSystem>Windows</SubSystem>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <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>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="BoounionPLC.h" />
+ <ClInclude Include="BoounionPLCDlg.h" />
+ <ClInclude Include="Common.h" />
+ <ClInclude Include="Configuration.h" />
+ <ClInclude Include="Log.h" />
+ <ClInclude Include="Model.h" />
+ <ClInclude Include="Resource.h" />
+ <ClInclude Include="stdafx.h" />
+ <ClInclude Include="targetver.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="BoounionPLC.cpp" />
+ <ClCompile Include="BoounionPLCDlg.cpp" />
+ <ClCompile Include="Configuration.cpp" />
+ <ClCompile Include="Log.cpp" />
+ <ClCompile Include="Model.cpp" />
+ <ClCompile Include="stdafx.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="BoounionPLC.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\BoounionPLC.rc2" />
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="res\BoounionPLC.ico" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj.filters b/SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj.filters
new file mode 100644
index 0000000..deb74ad
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLC.vcxproj.filters
@@ -0,0 +1,84 @@
+锘�<?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;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>
+ <Text Include="ReadMe.txt" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="BoounionPLC.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="BoounionPLCDlg.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="stdafx.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="targetver.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="Resource.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="Model.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="Common.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="Configuration.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ <ClInclude Include="Log.h">
+ <Filter>澶存枃浠�</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="BoounionPLC.cpp">
+ <Filter>婧愭枃浠�</Filter>
+ </ClCompile>
+ <ClCompile Include="BoounionPLCDlg.cpp">
+ <Filter>婧愭枃浠�</Filter>
+ </ClCompile>
+ <ClCompile Include="stdafx.cpp">
+ <Filter>婧愭枃浠�</Filter>
+ </ClCompile>
+ <ClCompile Include="Model.cpp">
+ <Filter>婧愭枃浠�</Filter>
+ </ClCompile>
+ <ClCompile Include="Configuration.cpp">
+ <Filter>婧愭枃浠�</Filter>
+ </ClCompile>
+ <ClCompile Include="Log.cpp">
+ <Filter>婧愭枃浠�</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="BoounionPLC.rc">
+ <Filter>璧勬簮鏂囦欢</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="res\BoounionPLC.rc2">
+ <Filter>璧勬簮鏂囦欢</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <Image Include="res\BoounionPLC.ico">
+ <Filter>璧勬簮鏂囦欢</Filter>
+ </Image>
+ </ItemGroup>
+</Project>
\ No newline at end of file
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
new file mode 100644
index 0000000..f2d77ba
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.cpp
@@ -0,0 +1,154 @@
+
+// BoounionPLCDlg.cpp : 实现文件
+//
+
+#include "stdafx.h"
+#include "BoounionPLC.h"
+#include "BoounionPLCDlg.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()
+
+
+// CBoounionPLCDlg 对话框
+
+
+
+CBoounionPLCDlg::CBoounionPLCDlg(CWnd* pParent /*=NULL*/)
+ : CDialogEx(IDD_BOOUNIONPLC_DIALOG, pParent)
+{
+ m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
+}
+
+void CBoounionPLCDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialogEx::DoDataExchange(pDX);
+}
+
+BEGIN_MESSAGE_MAP(CBoounionPLCDlg, CDialogEx)
+ ON_WM_SYSCOMMAND()
+ ON_WM_PAINT()
+ ON_WM_QUERYDRAGICON()
+END_MESSAGE_MAP()
+
+
+// CBoounionPLCDlg 消息处理程序
+
+BOOL CBoounionPLCDlg::OnInitDialog()
+{
+ CDialogEx::OnInitDialog();
+
+ // 将“关于...”菜单项添加到系统菜单中。
+
+ // IDM_ABOUTBOX 必须在系统命令范围内。
+ ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
+ ASSERT(IDM_ABOUTBOX < 0xF000);
+
+ CMenu* pSysMenu = GetSystemMenu(FALSE);
+ if (pSysMenu != NULL)
+ {
+ 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 CBoounionPLCDlg::OnSysCommand(UINT nID, LPARAM lParam)
+{
+ if ((nID & 0xFFF0) == IDM_ABOUTBOX)
+ {
+ CAboutDlg dlgAbout;
+ dlgAbout.DoModal();
+ }
+ else
+ {
+ CDialogEx::OnSysCommand(nID, lParam);
+ }
+}
+
+// 如果向对话框添加最小化按钮,则需要下面的代码
+// 来绘制该图标。 对于使用文档/视图模型的 MFC 应用程序,
+// 这将由框架自动完成。
+
+void CBoounionPLCDlg::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 CBoounionPLCDlg::OnQueryDragIcon()
+{
+ return static_cast<HCURSOR>(m_hIcon);
+}
+
diff --git a/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.h b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.h
new file mode 100644
index 0000000..76cf545
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/BoounionPLCDlg.h
@@ -0,0 +1,34 @@
+
+// BoounionPLCDlg.h : 头文件
+//
+
+#pragma once
+
+
+// CBoounionPLCDlg 对话框
+class CBoounionPLCDlg : public CDialogEx
+{
+// 构造
+public:
+ CBoounionPLCDlg(CWnd* pParent = NULL); // 标准构造函数
+
+// 对话框数据
+#ifdef AFX_DESIGN_TIME
+ enum { IDD = IDD_BOOUNIONPLC_DIALOG };
+#endif
+
+ protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
+
+
+// 实现
+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()
+};
diff --git a/SourceCode/Bond/BoounionPLC/Common.h b/SourceCode/Bond/BoounionPLC/Common.h
new file mode 100644
index 0000000..4f5420d
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Common.h
@@ -0,0 +1,6 @@
+#pragma once
+
+
+/* Rx Code */
+#define RX_CODE_TEST 0
+#define RX_CODE_LOG 1000
diff --git a/SourceCode/Bond/BoounionPLC/Configuration.cpp b/SourceCode/Bond/BoounionPLC/Configuration.cpp
new file mode 100644
index 0000000..b8529b6
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Configuration.cpp
@@ -0,0 +1,105 @@
+#include "stdafx.h"
+#include "Configuration.h"
+
+
+CConfiguration::CConfiguration()
+{
+}
+
+CConfiguration::CConfiguration(const char* pszFilepath)
+{
+ m_strFilepath = pszFilepath;
+}
+
+CConfiguration::~CConfiguration()
+{
+}
+
+void CConfiguration::setFilepath(const char* pszFilepath)
+{
+ m_strFilepath = pszFilepath;
+}
+
+void CConfiguration::getUnitId(CString& strUnitId)
+{
+ char szTemp[256];
+ GetPrivateProfileString("App", _T("UnitId"), _T(""), szTemp, 256, m_strFilepath);
+ strUnitId = szTemp;
+}
+
+void CConfiguration::getBond1(CString& strIp, UINT& port, UINT& doorCount)
+{
+ char szTemp[256];
+
+ // 读IP和端口
+ GetPrivateProfileString("Bond1", _T("IP"), _T(""), szTemp, 256, m_strFilepath);
+ strIp = szTemp;
+ port = GetPrivateProfileInt("Bond1", _T("Port"), 0, m_strFilepath);
+ doorCount = GetPrivateProfileInt("Bond1", _T("DoorCount"), 0, m_strFilepath);
+}
+
+int CConfiguration::getLogcatLevel()
+{
+ return GetPrivateProfileInt(_T("Logcat"), _T("Level"), 0, m_strFilepath);
+}
+
+void CConfiguration::setLogcatLevel(int level)
+{
+ WritePrivateProfileString(_T("Logcat"), _T("Level"),
+ std::to_string(level).c_str(), m_strFilepath);
+}
+
+int CConfiguration::setLogcatIncludeText(CString& strInclude)
+{
+ WritePrivateProfileString(_T("Logcat"), _T("IncludeText"),
+ strInclude, m_strFilepath);
+ return 0;
+}
+
+int CConfiguration::getLogcatIncludeText(CString& strInclude)
+{
+ char szTemp[256];
+ GetPrivateProfileString("Logcat", _T("IncludeText"), _T(""), szTemp, 256, m_strFilepath);
+ strInclude = szTemp;
+ return 0;
+}
+
+void CConfiguration::setLogcatIncludeRegex(BOOL bRegex)
+{
+ WritePrivateProfileString(_T("Logcat"), _T("IncludeRegex"),
+ bRegex ? "1" : "0", m_strFilepath);
+}
+
+BOOL CConfiguration::isLogcatIncludeRegex()
+{
+ return GetPrivateProfileInt(_T("Logcat"), _T("IncludeRegex"), 0, m_strFilepath);
+}
+
+int CConfiguration::getCustomLogcatIncludeTexts(std::vector<std::string>& texts)
+{
+ char szSection[256], szTemp[256];
+
+ for (int i = 0; i < 10; i++) {
+ sprintf_s(szSection, 256, "CustomInclude%d", i + 1);
+ GetPrivateProfileString("Logcat", szSection, _T(""),
+ szTemp, 256, m_strFilepath);
+ std::string strInclude(szTemp);
+ if (!strInclude.empty()) {
+ texts.push_back(strInclude);
+ }
+ }
+
+ return (int)texts.size();
+}
+
+int CConfiguration::getP2RemoteEqReconnectInterval()
+{
+ return GetPrivateProfileInt(_T("P2"), _T("RemoteEqReconnectInterval"), 20, m_strFilepath);
+}
+
+void CConfiguration::setP2RemoteEqReconnectInterval(int second)
+{
+ WritePrivateProfileString(_T("P2"), _T("RemoteEqReconnectInterval"),
+ std::to_string(second).c_str(), m_strFilepath);
+}
+
diff --git a/SourceCode/Bond/BoounionPLC/Configuration.h b/SourceCode/Bond/BoounionPLC/Configuration.h
new file mode 100644
index 0000000..95d00e2
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Configuration.h
@@ -0,0 +1,31 @@
+#pragma once
+#include <vector>
+#include <string>
+
+class CConfiguration
+{
+public:
+ CConfiguration();
+ CConfiguration(const char* pszFilepath);
+ ~CConfiguration();
+
+public:
+ void setFilepath(const char* pszFilepath);
+ void getUnitId(CString& strUnitId);
+ void getBond1(CString& strIp, UINT& port, UINT& doorCount);
+ int getLogcatLevel();
+ void setLogcatLevel(int level);
+ int setLogcatIncludeText(CString& strInclude);
+ int getLogcatIncludeText(CString& strInclude);
+ void setLogcatIncludeRegex(BOOL bRegex);
+ BOOL isLogcatIncludeRegex();
+ int getCustomLogcatIncludeTexts(std::vector<std::string>& texts);
+
+public:
+ void setP2RemoteEqReconnectInterval(int second);
+ int getP2RemoteEqReconnectInterval();
+
+private:
+ CString m_strFilepath;
+};
+
diff --git a/SourceCode/Bond/BoounionPLC/Log.cpp b/SourceCode/Bond/BoounionPLC/Log.cpp
new file mode 100644
index 0000000..8f2ce20
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Log.cpp
@@ -0,0 +1,214 @@
+#include "stdafx.h"
+#include "Log.h"
+
+
+static const char* pszLevel[] = {" [Debug] ", " [Info] ", " [Warn] ", " [Error] "};
+
+CLog::CLog()
+{
+ m_nLevel = 0;
+ m_nOutputTarget = OT_TRACE;
+ m_bAutoAppendTime = TRUE;
+ m_strEquipmentId = _T("Unknown");
+ m_nDay = 0;
+ m_funOnLog = nullptr;
+ InitializeCriticalSection(&m_criticalSection);
+}
+
+
+CLog::~CLog()
+{
+ DeleteCriticalSection(&m_criticalSection);
+}
+
+CLog *CLog::GetLog(void)
+{
+ static CLog* pLog = NULL;
+ if (pLog == NULL) {
+ static CLog log;
+ pLog = &log;
+ }
+
+ return pLog;
+}
+
+void CLog::SetOnLogCallback(ONLOG funOnLog)
+{
+ m_funOnLog = funOnLog;
+}
+
+void CLog::SetOutputTarget(int flag)
+{
+ m_nOutputTarget = flag;
+}
+
+void CLog::SetEquipmentId(const char* pszEquipmentId)
+{
+ m_strEquipmentId = pszEquipmentId;
+}
+
+void CLog::SetAutoAppendTimeString(BOOL bAutoAppendTime)
+{
+ m_bAutoAppendTime = bAutoAppendTime;
+}
+
+void CLog::Batch()
+{
+ if (m_file.m_hFile != CFile::hFileNull) {
+ m_file.Close();
+ }
+}
+
+BOOL CLog::BatchAndNew(int& nDay)
+{
+ Batch();
+ if ( (m_nOutputTarget & OT_FILE) && m_file.m_hFile == CFile::hFileNull) {
+ CString strFilepath;
+ BOOL bRet = m_file.Open(MakeFilepathD(strFilepath, nDay), CFile::modeCreate | CFile::modeNoTruncate | CFile::modeWrite | CFile::shareDenyWrite);
+ if (bRet) {
+ m_file.SeekToEnd();
+ }
+ return bRet;
+ }
+
+ return FALSE;
+}
+
+#define BUFFERSIZE 1024*10
+void CLog::LogFormat(int nLevel, const char* pszTag, char* szMessage, ...)
+{
+ // 检查日期是否有变化,有变化则结批
+ Lock();
+ _SYSTEMTIME sysTime;
+ GetLocalTime(&sysTime);
+ if(m_nDay != sysTime.wDay) {
+ int nDay = 0;
+ if (BatchAndNew(nDay)) {
+ m_nDay = nDay;
+ }
+ }
+ Unlock();
+
+ if (nLevel < m_nLevel) {
+ return;
+ }
+
+ char szFullMessage[BUFFERSIZE];
+ char szFormatMessage[BUFFERSIZE];
+
+ // format message
+ va_list ap;
+ va_start(ap, szMessage);
+ _vsnprintf_s(szFormatMessage, BUFFERSIZE, szMessage, ap);
+ va_end(ap);
+
+ if (m_bAutoAppendTime) {
+ CString strTime;
+ strcpy_s(szFullMessage, BUFFERSIZE, (LPTSTR)(LPCTSTR)GetCurTime(strTime));
+ }
+ strcat_s(szFullMessage, BUFFERSIZE, pszLevel[nLevel]);
+ strcat_s(szFullMessage, szFormatMessage);
+ strcat_s(szFullMessage, BUFFERSIZE, "\n");
+
+ if (m_nOutputTarget & OT_FILE) {
+ Lock();
+ if (m_file.m_hFile != CFile::hFileNull) {
+ m_file.WriteString(szFullMessage);
+ }
+ Unlock();
+ }
+ if (m_nOutputTarget & OT_ODSTRING) {
+ OutputDebugStringA(szFullMessage);
+ }
+ else if(m_nOutputTarget & OT_TRACE) {
+ TRACE(szFormatMessage);
+ }
+
+ if (m_funOnLog != nullptr) {
+ m_funOnLog(nLevel, szFullMessage);
+ }
+}
+
+void CLog::Log(int nLevel, const char* pszTag, const char* szMessage)
+{
+ // 检查日期是否有变化,有变化则结批
+ Lock();
+ _SYSTEMTIME sysTime;
+ GetLocalTime(&sysTime);
+ if (m_nDay != sysTime.wDay) {
+ int nDay = 0;
+ if (BatchAndNew(nDay)) {
+ m_nDay = nDay;
+ }
+ }
+ Unlock();
+
+ if (nLevel < m_nLevel) {
+ return;
+ }
+
+ CString strMsg;
+ if (m_bAutoAppendTime) {
+ CString strTime;
+ GetCurTime(strTime);
+ strMsg.Append(strTime);
+ }
+ strMsg.Append(pszTag);
+ strMsg.Append(szMessage);
+ strMsg.Append("\n");
+
+ if (m_nOutputTarget & OT_FILE) {
+ Lock();
+ if (m_file.m_hFile != CFile::hFileNull) {
+ m_file.WriteString(strMsg);
+ }
+ Unlock();
+ }
+ if (m_nOutputTarget & OT_ODSTRING) {
+ OutputDebugStringA(strMsg);
+ }
+ else if (m_nOutputTarget & OT_TRACE) {
+ TRACE(strMsg);
+ }
+
+ if (m_funOnLog != nullptr) {
+ m_funOnLog(nLevel, strMsg);
+ }
+}
+
+CString& CLog::GetCurTime(CString& strTime)
+{
+ _SYSTEMTIME sysTime;
+ GetLocalTime(&sysTime);
+ strTime.Format(_T("%d/%02d/%02d %02d:%02d:%02d.%03d"), sysTime.wYear, sysTime.wMonth, sysTime.wDay,
+ sysTime.wHour, sysTime.wMinute, sysTime.wSecond, sysTime.wMilliseconds);
+ return strTime;
+}
+
+CString& CLog::MakeFilepath(CString& strFilepath)
+{
+ _SYSTEMTIME sysTime;
+ GetLocalTime(&sysTime);
+ strFilepath.Format(_T("%s\\Log(%s)_%d_%02d_%02d.log"), (LPTSTR)(LPCTSTR)m_strLogsDir,
+ (LPTSTR)(LPCTSTR)m_strEquipmentId,
+ sysTime.wYear, sysTime.wMonth, sysTime.wDay);
+
+ return strFilepath;
+}
+
+CString& CLog::MakeFilepathD(CString& strFilepath, int& day)
+{
+ _SYSTEMTIME sysTime;
+ GetLocalTime(&sysTime);
+ strFilepath.Format(_T("%s\\Log(%s)_%d_%02d_%02d.log"), (LPTSTR)(LPCTSTR)m_strLogsDir,
+ (LPTSTR)(LPCTSTR)m_strEquipmentId,
+ sysTime.wYear, sysTime.wMonth, sysTime.wDay);
+ day = sysTime.wDay;
+
+ return strFilepath;
+}
+
+void CLog::SetLogsDir(CString strDir)
+{
+ m_strLogsDir = strDir;
+}
diff --git a/SourceCode/Bond/BoounionPLC/Log.h b/SourceCode/Bond/BoounionPLC/Log.h
new file mode 100644
index 0000000..ee28e15
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Log.h
@@ -0,0 +1,61 @@
+#pragma once
+#include <functional>
+
+
+#define LEVEL_DEBUG 0
+#define LEVEL_INFO 1
+#define LEVEL_WARN 2
+#define LEVEL_ERROR 3
+
+
+#define LOGD(msg, ...) CLog::GetLog()->LogFormat(LEVEL_DEBUG, "", msg, __VA_ARGS__)
+#define LOGI(msg, ...) CLog::GetLog()->LogFormat(LEVEL_INFO, "", msg, __VA_ARGS__)
+#define LOGW(msg, ...) CLog::GetLog()->LogFormat(LEVEL_WARN, "", msg, __VA_ARGS__)
+#define LOGE(msg, ...) CLog::GetLog()->LogFormat(LEVEL_ERROR, "", msg, __VA_ARGS__)
+
+
+#define OT_FILE 0x01
+#define OT_ODSTRING 0x02
+#define OT_TRACE 0x04
+#define LOGBATHCH() CLog::GetLog()->Batch()
+#define LOGNEW() CLog::GetLog()->BatchAndNew()
+
+typedef std::function<void(int level, const char* pszMessage)> ONLOG;
+
+class CLog
+{
+public:
+ CLog();
+ ~CLog();
+
+public:
+ void SetOnLogCallback(ONLOG funOnLog);
+ static CLog *GetLog(void);
+ void SetOutputTarget(int flag);
+ void SetEquipmentId(const char* pszEquipmentId);
+ static CString& GetCurTime(CString& strTime);
+ CString& MakeFilepath(CString& strFilepath);
+ CString& MakeFilepathD(CString& strFilepath, int& day);
+ void LogFormat(int nLevel, const char* pszTag, char* szMessage, ...);
+ void Log(int nLevel, const char* pszTag, const char* szMessage);
+ void SetAutoAppendTimeString(BOOL bAutoAppendTime);
+ void SetLogsDir(CString strDir);
+ void Batch();
+ BOOL BatchAndNew(int& nDay);
+
+private:
+ inline void Lock() { EnterCriticalSection(&m_criticalSection); }
+ inline void Unlock() { LeaveCriticalSection(&m_criticalSection); }
+
+private:
+ ONLOG m_funOnLog;
+ int m_nOutputTarget;
+ int m_nLevel;
+ BOOL m_bAutoAppendTime;
+ CString m_strLogsDir;
+ CString m_strEquipmentId;
+ CStdioFile m_file;
+ int m_nDay; // 按日保存一条记录,比较此数字,以决定是否结批并创建新文件
+ CRITICAL_SECTION m_criticalSection;
+};
+
diff --git a/SourceCode/Bond/BoounionPLC/Model.cpp b/SourceCode/Bond/BoounionPLC/Model.cpp
new file mode 100644
index 0000000..307a16a
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Model.cpp
@@ -0,0 +1,288 @@
+#include "stdafx.h"
+#include "Model.h"
+#include "Log.h"
+#include "Common.h"
+
+
+CModel* g_pModel = NULL;
+void CALLBACK ModerTimerProc(HWND hWnd, UINT nMsg, UINT nTimerid, DWORD dwTime)
+{
+ if (g_pModel != NULL) {
+ g_pModel->onTimer(nTimerid);
+ }
+}
+
+
+CModel::CModel()
+{
+ m_pObservableEmitter = nullptr;
+ m_pObservable = nullptr;
+ m_nTimerID = 0;
+}
+
+
+CModel::~CModel()
+{
+}
+
+IObservable* CModel::getObservable()
+{
+ return m_pObservable;
+}
+
+void CModel::setWorkDir(const char* pszWorkDir)
+{
+ m_strWorkDir = pszWorkDir;
+}
+
+int CModel::init()
+{
+ CString strIniFile;
+ CString strUnitId;
+ strIniFile.Format(_T("%s\\Configuration.ini"), (LPTSTR)(LPCTSTR)m_strWorkDir);
+ m_configuration.setFilepath((LPTSTR)(LPCTSTR)strIniFile);
+ m_configuration.getUnitId(strUnitId);
+
+
+ // Log
+ CString strLogDir;
+ strLogDir.Format(_T("%s\\BoounionPLCLog"), (LPTSTR)(LPCTSTR)m_strWorkDir);
+ ::CreateDirectory(strLogDir, NULL);
+ CLog::GetLog()->SetOnLogCallback([&](int level, const char* pszMessage) -> void {
+ notifyTextAndInt(RX_CODE_LOG, pszMessage, level);
+ });
+ CLog::GetLog()->SetAutoAppendTimeString(TRUE);
+ CLog::GetLog()->SetOutputTarget(OT_FILE);
+ CLog::GetLog()->SetLogsDir(strLogDir);
+ CLog::GetLog()->SetEquipmentId((LPTSTR)(LPCTSTR)strUnitId);
+ LOGI("\r\n\r\n~~~ Prog Start! ~~~");
+
+
+
+ m_pObservable = RX_AllocaObservable([&](IObservableEmitter* e) -> void {
+ m_pObservableEmitter = e; // 保存发射器
+ });
+
+
+ m_nTimerID = (int)SetTimer(NULL, 1, 1000, (TIMERPROC)ModerTimerProc);
+ g_pModel = this;
+
+
+ return 0;
+}
+
+int CModel::term()
+{
+ CLog::GetLog()->SetOnLogCallback(nullptr);
+ return 0;
+}
+
+int CModel::notify(int code)
+{
+ /* code */
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 1;
+}
+
+int CModel::notifyPtr(int code, void* ptr/* = NULL*/)
+{
+ /* code */
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setPtrValue("ptr", ptr);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 1;
+}
+
+int CModel::notifyObj(int code, IRxObject* pObj)
+{
+ /* code */
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setObject("obj", pObj);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 1;
+}
+
+int CModel::notifyObjAndPtr(int code, IRxObject* pObj, void* ptr)
+{
+ /* code */
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setObject("obj", pObj);
+ pAny->setPtrValue("ptr", ptr);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 1;
+}
+
+int CModel::notifyInt(int code, int exCode)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setIntValue("exCode", exCode);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyInt2(int code, int exCode, int exCode2)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setIntValue("exCode", exCode);
+ pAny->setIntValue("exCode2", exCode2);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyDouble(int code, double dValue)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setDoubleValue("value", dValue);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyObjAndInt(int code, IRxObject* pObj1, IRxObject* pObj2, int exCode)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ if (pObj1 != nullptr) pAny->setObject("obj", pObj1);
+ if (pObj2 != nullptr) pAny->setObject("obj2", pObj2);
+ pAny->setIntValue("exCode", exCode);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyText(int code, const char* pszText)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setStringValue("text", pszText);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyTextAndInt(int code, const char* pszText, int exCode)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setStringValue("text", pszText);
+ pAny->setIntValue("exCode", exCode);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyPtrAndInt(int code, void* ptr1, void* ptr2, int exCode)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setPtrValue("ptr", ptr1);
+ pAny->setPtrValue("ptr1", ptr1);
+ pAny->setPtrValue("ptr2", ptr2);
+ pAny->setIntValue("exCode", exCode);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+int CModel::notifyMesMsg(int code, int stream, int function, const char* pszText)
+{
+ if (m_pObservableEmitter != NULL) {
+ IAny* pAny = RX_AllocaAny();
+ if (pAny != NULL) {
+ pAny->addRef();
+ pAny->setCode(code);
+ pAny->setIntValue("stream", stream);
+ pAny->setIntValue("function", function);
+ pAny->setStringValue("text", pszText);
+ m_pObservableEmitter->onNext(pAny);
+ pAny->release();
+ }
+ }
+
+ return 0;
+}
+
+void CModel::onTimer(UINT nTimerid)
+{
+
+}
diff --git a/SourceCode/Bond/BoounionPLC/Model.h b/SourceCode/Bond/BoounionPLC/Model.h
new file mode 100644
index 0000000..b4a4992
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Model.h
@@ -0,0 +1,44 @@
+#pragma once
+#include "Configuration.h"
+
+
+class CModel
+{
+public:
+ CModel();
+ ~CModel();
+
+public:
+ IObservable* getObservable();
+ void setWorkDir(const char* pszWorkDir);
+ int init();
+ int term();
+ void onTimer(UINT nTimerid);
+
+public:
+ int notify(int code);
+ int notifyPtr(int code, void* ptr = NULL);
+ int notifyObj(int code, IRxObject* pObj);
+ int notifyObjAndPtr(int code, IRxObject* pObj, void* ptr);
+ int notifyObjAndInt(int code, IRxObject* pObj1, IRxObject* pObj2, int exCode);
+ int notifyInt(int code, int exCode);
+ int notifyInt2(int code, int exCode, int exCode2);
+ int notifyDouble(int code, double dValue);
+ int notifyText(int code, const char* pszText);
+ int notifyPtrAndInt(int code, void* ptr1, void* ptr2, int exCode);
+ int notifyTextAndInt(int code, const char* pszText, int exCode);
+ int notifyMesMsg(int code, int stream, int function, const char* pszText);
+
+public:
+ CConfiguration m_configuration;
+
+
+private:
+ IObservable* m_pObservable;
+ IObservableEmitter* m_pObservableEmitter;
+ CString m_strWorkDir;
+
+private:
+ int m_nTimerID;
+};
+
diff --git a/SourceCode/Bond/BoounionPLC/ReadMe.txt b/SourceCode/Bond/BoounionPLC/ReadMe.txt
new file mode 100644
index 0000000..098f05c
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/ReadMe.txt
@@ -0,0 +1,67 @@
+锘�================================================================================
+ MICROSOFT 鍩虹绫诲簱 : BoounionPLC 椤圭洰姒傝堪
+===============================================================================
+
+搴旂敤绋嬪簭鍚戝宸蹭负鎮ㄥ垱寤轰簡姝� BoounionPLC 搴旂敤绋嬪簭銆傛搴旂敤绋嬪簭涓嶄粎婕旂ず Microsoft 鍩虹绫荤殑鍩烘湰浣跨敤鏂规硶锛岃繕鍙綔涓烘偍缂栧啓搴旂敤绋嬪簭鐨勮捣鐐广��
+
+鏈枃浠舵瑕佷粙缁嶇粍鎴� BoounionPLC 搴旂敤绋嬪簭鐨勬瘡涓枃浠剁殑鍐呭銆�
+
+BoounionPLC.vcxproj
+ 杩欐槸浣跨敤搴旂敤绋嬪簭鍚戝鐢熸垚鐨� VC++ 椤圭洰鐨勪富椤圭洰鏂囦欢锛屽叾涓寘鍚敓鎴愯鏂囦欢鐨� Visual C++ 鐨勭増鏈俊鎭紝浠ュ強鏈夊叧浣跨敤搴旂敤绋嬪簭鍚戝閫夋嫨鐨勫钩鍙般�侀厤缃拰椤圭洰鍔熻兘鐨勪俊鎭��
+
+BoounionPLC.vcxproj.filters
+ 杩欐槸浣跨敤鈥滃簲鐢ㄧ▼搴忓悜瀵尖�濈敓鎴愮殑 VC++ 椤圭洰绛涢�夊櫒鏂囦欢銆傚畠鍖呭惈鏈夊叧椤圭洰鏂囦欢涓庣瓫閫夊櫒涔嬮棿鐨勫叧鑱斾俊鎭�傚湪 IDE 涓紝閫氳繃杩欑鍏宠仈锛屽湪鐗瑰畾鑺傜偣涓嬩互鍒嗙粍褰㈠紡鏄剧ず鍏锋湁鐩镐技鎵╁睍鍚嶇殑鏂囦欢銆備緥濡傦紝鈥�.cpp鈥濇枃浠朵笌鈥滄簮鏂囦欢鈥濈瓫閫夊櫒鍏宠仈銆�
+
+BoounionPLC.h
+ 杩欐槸搴旂敤绋嬪簭鐨勪富澶存枃浠躲��
+ 鍏朵腑鍖呮嫭鍏朵粬椤圭洰鐗瑰畾鐨勬爣澶达紙鍖呮嫭 Resource.h锛夛紝骞跺0鏄� CBoounionPLCApp 搴旂敤绋嬪簭绫汇��
+
+BoounionPLC.cpp
+ 杩欐槸鍖呭惈搴旂敤绋嬪簭绫� CBoounionPLCApp 鐨勪富搴旂敤绋嬪簭婧愭枃浠躲��
+
+BoounionPLC.rc
+ 杩欐槸绋嬪簭浣跨敤鐨勬墍鏈� Microsoft Windows 璧勬簮鐨勫垪琛ㄣ�傚畠鍖呮嫭 RES 瀛愮洰褰曚腑瀛樺偍鐨勫浘鏍囥�佷綅鍥惧拰鍏夋爣銆傛鏂囦欢鍙互鐩存帴鍦� Microsoft Visual C++ 涓繘琛岀紪杈戙�傞」鐩祫婧愬寘鍚湪 2052 涓��
+
+res\BoounionPLC.ico
+ 杩欐槸鐢ㄤ綔搴旂敤绋嬪簭鍥炬爣鐨勫浘鏍囨枃浠躲�傛鍥炬爣鍖呮嫭鍦ㄤ富璧勬簮鏂囦欢 BoounionPLC.rc 涓��
+
+res\BoounionPLC.rc2
+ 姝ゆ枃浠跺寘鍚笉鍦� Microsoft Visual C++ 涓繘琛岀紪杈戠殑璧勬簮銆傛偍搴旇灏嗕笉鍙敱璧勬簮缂栬緫鍣ㄧ紪杈戠殑鎵�鏈夎祫婧愭斁鍦ㄦ鏂囦欢涓��
+
+
+/////////////////////////////////////////////////////////////////////////////
+
+搴旂敤绋嬪簭鍚戝鍒涘缓涓�涓璇濇绫伙細
+
+BoounionPLCDlg.h銆丅oounionPLCDlg.cpp - 瀵硅瘽妗�
+ 杩欎簺鏂囦欢鍖呭惈 CBoounionPLCDlg 绫汇�傛绫诲畾涔夊簲鐢ㄧ▼搴忕殑涓诲璇濇鐨勮涓恒�傚璇濇妯℃澘鍖呭惈鍦� BoounionPLC.rc 涓紝璇ユ枃浠跺彲浠ュ湪 Microsoft Visual C++ 涓紪杈戙��
+
+/////////////////////////////////////////////////////////////////////////////
+
+鍏朵粬鍔熻兘锛�
+
+ActiveX 鎺т欢
+ 璇ュ簲鐢ㄧ▼搴忓寘鍚浣跨敤 ActiveX 鎺т欢鐨勬敮鎸併��
+
+/////////////////////////////////////////////////////////////////////////////
+
+鍏朵粬鏍囧噯鏂囦欢:
+
+StdAfx.h, StdAfx.cpp
+ 杩欎簺鏂囦欢鐢ㄤ簬鐢熸垚鍚嶄负 BoounionPLC.pch 鐨勯缂栬瘧澶� (PCH) 鏂囦欢鍜屽悕涓� StdAfx.obj 鐨勯缂栬瘧绫诲瀷鏂囦欢銆�
+
+Resource.h
+ 杩欐槸鏍囧噯澶存枃浠讹紝鍙敤浜庡畾涔夋柊鐨勮祫婧� ID銆侻icrosoft Visual C++ 灏嗚鍙栧苟鏇存柊姝ゆ枃浠躲��
+
+BoounionPLC.manifest
+ Windows XP 浣跨敤搴旂敤绋嬪簭娓呭崟鏂囦欢鏉ユ弿杩扮壒瀹氱増鏈殑骞惰绋嬪簭闆嗙殑搴旂敤绋嬪簭渚濊禆椤广�傚姞杞界▼搴忎娇鐢ㄨ繖浜涗俊鎭潵浠庣▼搴忛泦缂撳瓨涓姞杞界浉搴旂殑绋嬪簭闆嗭紝骞朵繚鎶ゅ叾涓嶈搴旂敤绋嬪簭璁块棶銆傚簲鐢ㄧ▼搴忔竻鍗曞彲鑳戒細鍖呭惈鍦ㄥ唴锛屼互浣滀负涓庡簲鐢ㄧ▼搴忓彲鎵ц鏂囦欢瀹夎鍦ㄥ悓涓�鏂囦欢澶逛腑鐨勫閮� .manifest 鏂囦欢杩涜閲嶆柊鍒嗗彂锛屽畠杩樺彲鑳戒互璧勬簮鐨勫舰寮忓寘鍚湪鍙墽琛屾枃浠朵腑銆�
+/////////////////////////////////////////////////////////////////////////////
+
+鍏朵粬娉ㄩ噴:
+
+搴旂敤绋嬪簭鍚戝浣跨敤鈥淭ODO:鈥濇潵鎸囩ず搴旀坊鍔犳垨鑷畾涔夌殑婧愪唬鐮侀儴鍒嗐��
+
+濡傛灉搴旂敤绋嬪簭浣跨敤鍏变韩 DLL 涓殑 MFC锛屾偍灏嗛渶瑕侀噸鏂板垎鍙� MFC DLL銆傚鏋滃簲鐢ㄧ▼搴忔墍浣跨敤鐨勮瑷�涓庢搷浣滅郴缁熺殑鍖哄煙璁剧疆涓嶅悓锛屽垯杩橀渶瑕侀噸鏂板垎鍙戠浉搴旂殑鏈湴鍖栬祫婧� mfc110XXX.DLL銆�
+鏈夊叧涓婅堪璇濋鐨勬洿澶氫俊鎭紝璇峰弬瑙� MSDN 鏂囨。涓湁鍏抽噸鏂板垎鍙� Visual C++ 搴旂敤绋嬪簭鐨勯儴鍒嗐��
+
+/////////////////////////////////////////////////////////////////////////////
diff --git a/SourceCode/Bond/BoounionPLC/Resource.h b/SourceCode/Bond/BoounionPLC/Resource.h
new file mode 100644
index 0000000..ef4556f
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/Resource.h
@@ -0,0 +1,21 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ 生成的包含文件。
+// 由 BoounionPLC.rc 使用
+//
+#define IDR_MAINFRAME 128
+#define IDM_ABOUTBOX 0x0010
+#define IDD_ABOUTBOX 100
+#define IDS_ABOUTBOX 101
+#define IDD_BOOUNIONPLC_DIALOG 102
+
+// 新对象的下一组默认值
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+
+#define _APS_NEXT_RESOURCE_VALUE 129
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 32771
+#endif
+#endif
diff --git a/SourceCode/Bond/BoounionPLC/res/BoounionPLC.ico b/SourceCode/Bond/BoounionPLC/res/BoounionPLC.ico
new file mode 100644
index 0000000..d56fbcd
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/res/BoounionPLC.ico
Binary files differ
diff --git a/SourceCode/Bond/BoounionPLC/res/BoounionPLC.rc2 b/SourceCode/Bond/BoounionPLC/res/BoounionPLC.rc2
new file mode 100644
index 0000000..f5964c2
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/res/BoounionPLC.rc2
Binary files differ
diff --git a/SourceCode/Bond/BoounionPLC/stdafx.cpp b/SourceCode/Bond/BoounionPLC/stdafx.cpp
new file mode 100644
index 0000000..21bedf7
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/stdafx.cpp
@@ -0,0 +1,8 @@
+
+// stdafx.cpp : 只包括标准包含文件的源文件
+// BoounionPLC.pch 将作为预编译头
+// stdafx.obj 将包含预编译类型信息
+
+#include "stdafx.h"
+
+
diff --git a/SourceCode/Bond/BoounionPLC/stdafx.h b/SourceCode/Bond/BoounionPLC/stdafx.h
new file mode 100644
index 0000000..d43089c
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/stdafx.h
@@ -0,0 +1,55 @@
+
+// stdafx.h : 标准系统包含文件的包含文件,
+// 或是经常使用但不常更改的
+// 特定于项目的包含文件
+
+#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 支持
+
+
+
+
+#include "..\RxWindows1.0\include\RxWindowsLib.h"
+#include "..\McLibrarySDK\include\McLib.h"
+
+
+
+
+#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
+
+
diff --git a/SourceCode/Bond/BoounionPLC/targetver.h b/SourceCode/Bond/BoounionPLC/targetver.h
new file mode 100644
index 0000000..416cebf
--- /dev/null
+++ b/SourceCode/Bond/BoounionPLC/targetver.h
@@ -0,0 +1,8 @@
+#pragma once
+
+// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
+
+// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
+// 将 _WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
+
+#include <SDKDDKVer.h>
diff --git a/SourceCode/Bond/GangBond2860.sln b/SourceCode/Bond/GangBond2860.sln
index af13cf8..4b90a5f 100644
--- a/SourceCode/Bond/GangBond2860.sln
+++ b/SourceCode/Bond/GangBond2860.sln
@@ -13,6 +13,8 @@
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Servo", "Servo\Servo.vcxproj", "{66ADACE5-3166-4D1F-B30B-DE5E01FB01A2}"
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BoounionPLC", "BoounionPLC\BoounionPLC.vcxproj", "{6DC0600E-5588-4033-A281-3626A4F74B67}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -61,6 +63,14 @@
{66ADACE5-3166-4D1F-B30B-DE5E01FB01A2}.Release|x64.Build.0 = Release|x64
{66ADACE5-3166-4D1F-B30B-DE5E01FB01A2}.Release|x86.ActiveCfg = Release|Win32
{66ADACE5-3166-4D1F-B30B-DE5E01FB01A2}.Release|x86.Build.0 = Release|Win32
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Debug|x64.ActiveCfg = Debug|x64
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Debug|x64.Build.0 = Debug|x64
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Debug|x86.ActiveCfg = Debug|Win32
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Debug|x86.Build.0 = Debug|Win32
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Release|x64.ActiveCfg = Release|x64
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Release|x64.Build.0 = Release|x64
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Release|x86.ActiveCfg = Release|Win32
+ {6DC0600E-5588-4033-A281-3626A4F74B67}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
--
Gitblit v1.9.3