瀏覽代碼

Z991239-891 #comment other: Pure分支移到develop分支 在windows编译成功

翟俊伟80258120 5 年之前
父節點
當前提交
a2c4f9592a

+ 23 - 0
Module/mod_FingerPrint/CMakeLists.txt

@@ -0,0 +1,23 @@
+#实体名
+define_module("FingerPrint")
+
+file(GLOB ${MODULE_PREFIX}_SRCS RELATIVE 
+		 ${CMAKE_CURRENT_SOURCE_DIR}
+		 ${CMAKE_CURRENT_SOURCE_DIR}/*.h
+		 ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
+
+set(MOD_VERSION_STRING "1.0.0-dev1")
+add_module_libraries(${MODULE_PREFIX} ${MODULE_NAME} ${MOD_VERSION_STRING})
+
+target_include_directories(${MODULE_NAME} PRIVATE
+	${RVC_COMMOM_INCLUDE_DIR}
+	${DevHeadPath}
+	${ModuleCommonHeadPath}
+	${MODULE_BASE_DIR}/mod_cardswiper
+)
+
+# 添加实体需要依赖的其他共享库(包括系统库)
+set(${MODULE_PREFIX}_LIBS ${MODULE_BASE_ALL_LIBS})
+target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
+
+deploy_module(${MODULE_PREFIX} ${MODULE_NAME})

+ 12 - 9
Module/mod_FingerPrint/FingerPrintFSM.cpp

@@ -3,6 +3,7 @@
 #include "EventCode.h"
 #include "FingerPrint_UserErrorCode.h"
 #include "GetDevInfoHelper.h"
+#include "path.h"
 
 #define FINGERPRINT_SCAN_TIMEOUT 15000
 #define FINGERPRINT_SCAN_INTERNAL 100
@@ -197,7 +198,7 @@ ErrorCodeEnum CFingerPrintFSM::OnInit()
 	ErrorCodeEnum errDev = SpGetDevAdaptorPath(m_pEntity, GetEntityBase()->GetEntityName(), dllName);
 	if (errDev != Error_Succeed)
 	{
-		Dbg("Get vendor dll(%s) name failed.", (LPCTSTR)dllName);
+		Dbg("Get vendor dll(%s) name failed.", (const char*)dllName);
 		LogError(Severity_High, Error_DevLoadFileFailed, LOG_ERR_FINGERPRINT_GET_DLLNAME_FAILED_ONINIT, "get dllname failed while init");
 		return Error_DevLoadFileFailed;
 	}
@@ -221,7 +222,7 @@ ErrorCodeEnum CFingerPrintFSM::OnInit()
 		LogError(Severity_High, Error_DevLoadFileFailed, LOG_ERR_FINGERPRINT_OPEN_ROOT_FAILED_ONINIT, "get dllname failed while init");
 		return errDev;
 	}
-	Dbg("Load library: %s", (LPCTSTR)dllName);
+	Dbg("Load library: %s", (const char*)dllName);
 	m_hVendordDll = LoadLibrary(dllName);
 	DWORD lastError = GetLastError();
 	BOOL triedFlag = FALSE;
@@ -280,7 +281,7 @@ ErrorCodeEnum CFingerPrintFSM::OnInit()
 				if(strDepPath.IsNullOrEmpty()) {
 					Dbg("Get Dep path failed!");
 				} else {
-					CSimpleStringA fullFilePath = strDepPath + "\\" + newFileName;
+					CSimpleStringA fullFilePath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strDepPath, (const char*)newFileName);
 					triedFlag = TRUE;
 					dllName = fullFilePath;
 					Dbg("Load library again: %s", (LPCTSTR)dllName);
@@ -493,22 +494,24 @@ int CFingerPrintFSM::GetImageAndFeature(SpReqAnsContext<FingerPrintService_GetIm
 	{
 	case 1:
 		fileName = "finger1.bmp";
-		m_strPath1 = strPath + "\\" + fileName;
+		m_strPath1 = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, (const char*)fileName);
 		break;
 	case 2:
 		fileName = "finger2.bmp";
-		m_strPath2 = strPath + "\\" + fileName;
+		m_strPath2 = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, (const char*)fileName);
 		break;
 	case 3:
 		fileName = "finger3.bmp";
-		m_strPath3 = strPath + "\\" + fileName;
+		m_strPath3 = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, (const char*)fileName);
 		break;
 	default:
 		fileName = "finger.bmp";
 		break;
 	}
-	strPath = strPath + "\\" + fileName;
+	strPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, (const char*)fileName);
+	
 	Dbg("get imageName success: %s", strPath);
+	
 	bool bScanSuccess = false;
 	m_bCancelRegister = false;
 	bool bGetTemplateSuc = true;
@@ -681,7 +684,7 @@ ErrorCodeEnum CFingerPrintFSM::DeleteFileIfExisted(LPCTSTR fileName)
 	}
 	CSimpleStringA strPath, strObjPath;
 	ErrorCodeEnum errCode = m_pEntity->GetFunction()->GetPath("Dep", strPath);
-	strObjPath = strPath + "\\" + fileName;
+	strObjPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, (const char*)fileName);
 	WIN32_FIND_DATA findData;
 	if (FindFirstFileA((LPCTSTR)strObjPath, &findData) != INVALID_HANDLE_VALUE)
 	{
@@ -740,7 +743,7 @@ ErrorCodeEnum CFingerPrintFSM::Match(SpReqAnsContext<FingerPrintService_Match_Re
 		return Error_Param;
 	}
 	CSimpleStringA fileName = "finger.bmp";
-	strPath = strPath + "\\" + fileName;
+	strPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strPath, (const char*)fileName);
 	Dbg("get imageName success: %s", strPath);
 	bool bScanSuccess = false;
 	bool bNotFindImage = false;

+ 1 - 1
Module/mod_FingerPrint/FingerPrintFSM.h

@@ -3,7 +3,7 @@
 
 #include "SpFSM.h"
 #include "FingerPrintClass.h"
-#include "..\mod_cardswiper\CardSwiper_client_g.h"
+#include "CardSwiper_client_g.h"
 
 using namespace CardSwiper;
 

+ 0 - 19
Module/mod_FingerPrint/dllmain.cpp

@@ -1,19 +0,0 @@
-// dllmain.cpp : 定义 DLL 应用程序的入口点。
-#include "stdafx.h"
-
-BOOL APIENTRY DllMain( HMODULE hModule,
-                       DWORD  ul_reason_for_call,
-                       LPVOID lpReserved
-					 )
-{
-	switch (ul_reason_for_call)
-	{
-	case DLL_PROCESS_ATTACH:
-	case DLL_THREAD_ATTACH:
-	case DLL_THREAD_DETACH:
-	case DLL_PROCESS_DETACH:
-		break;
-	}
-	return TRUE;
-}
-

+ 0 - 117
Module/mod_FingerPrint/mod_FingerPrint.vcxproj

@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.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>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{DDFB1511-3517-4A71-AB35-3364EC158134}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>mod_FingerPrint</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </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>
-  <PropertyGroup Label="UserMacros" />
-  <Import Project="..\modmake.setting" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
-    <CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
-    <CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
-    <CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;MOD_FINGERPRINT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <AdditionalIncludeDirectories>$(FrameworkHeadRoot)\Common;$(DevHeadPath);$(ModuleCommonHeadPath);$(ThirdPartyHeadRoot)\opencv\include\opencv;$(OtherHeadPath)\libimageproc</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <TargetMachine>MachineX86</TargetMachine>
-      <AdditionalDependencies>$(FrameworkLib)\spbase.lib;$(ThirdPartyLib)\opencv_video230.lib;$(ThirdPartyLib)\opencv_highgui230.lib;$(ThirdPartyLib)\opencv_imgproc230.lib;$(ThirdPartyLib)\opencv_objdetect230.lib;$(ThirdPartyLib)\opencv_core230.lib</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;MOD_IDCERTIFICATE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <PrecompiledHeader>Use</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <AdditionalIncludeDirectories>$(FrameworkHeadRoot)\Common;$(DevHeadPath);$(ModuleCommonHeadPath);$(OtherHeadPath)\libimageproc</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <TargetMachine>MachineX86</TargetMachine>
-      <AdditionalDependencies>$(FrameworkLib)\spbase.lib</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="$(FrameworkHeadRoot)\Common\stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-    </ClCompile>
-    <ClCompile Include="FingerPrintFSM.cpp" />
-    <ClCompile Include="mod_FingerPrint.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="$(FrameworkHeadRoot)\Common\stdafx.h" />
-    <ClInclude Include="FingerPrintFSM.h" />
-    <ClInclude Include="FingerPrint_client_g.h" />
-    <ClInclude Include="FingerPrint_def_g.h" />
-    <ClInclude Include="FingerPrint_server_g.h" />
-    <ClInclude Include="FingerPrint_UserErrorCode.h" />
-    <ClInclude Include="mod_FingerPrint.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\Version.rc" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

+ 0 - 65
Module/mod_FingerPrint/mod_FingerPrint.vcxproj.filters

@@ -1,65 +0,0 @@
-<?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;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>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="FingerPrint_client_g.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="FingerPrint_def_g.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="FingerPrint_server_g.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="FingerPrintFSM.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="mod_FingerPrint.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-    <ClInclude Include="FingerPrint_UserErrorCode.h">
-      <Filter>头文件</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="mod_FingerPrint.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="dllmain.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-    <ClCompile Include="FingerPrintFSM.cpp">
-      <Filter>源文件</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="..\..\Version.rc">
-      <Filter>资源文件</Filter>
-    </ResourceCompile>
-  </ItemGroup>
-</Project>

+ 0 - 8
Module/mod_FingerPrint/stdafx.cpp

@@ -1,8 +0,0 @@
-// stdafx.cpp : 只包括标准包含文件的源文件
-// mod_FingerPrint.pch 将作为预编译头
-// stdafx.obj 将包含预编译类型信息
-
-#include "stdafx.h"
-
-// TODO: 在 STDAFX.H 中
-// 引用任何所需的附加头文件,而不是在此文件中引用

+ 0 - 16
Module/mod_FingerPrint/stdafx.h

@@ -1,16 +0,0 @@
-// stdafx.h : 标准系统包含文件的包含文件,
-// 或是经常使用但不常更改的
-// 特定于项目的包含文件
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#define WIN32_LEAN_AND_MEAN             //  从 Windows 头文件中排除极少使用的信息
-// Windows 头文件:
-#include <windows.h>
-
-
-
-// TODO: 在此处引用程序需要的其他头文件

+ 0 - 8
Module/mod_FingerPrint/targetver.h

@@ -1,8 +0,0 @@
-#pragma once
-
-// 包括 SDKDDKVer.h 将定义可用的最高版本的 Windows 平台。
-
-// 如果要为以前的 Windows 平台生成应用程序,请包括 WinSDKVer.h,并将
-// WIN32_WINNT 宏设置为要支持的平台,然后再包括 SDKDDKVer.h。
-
-#include <SDKDDKVer.h>

+ 2 - 0
Module/mod_FingerPrint/test/testFingerPrintEntity.cpp

@@ -0,0 +1,2 @@
+#include "mod_FingerPrint.h"
+

+ 34 - 34
README.md

@@ -1,34 +1,34 @@
-# 招行可视柜台终端应用程序
-
-**可视柜台终端应用程序(Remote Video Counter Terminal Application)**是基于C/C++实现的运行在Windows平台上的异步调用、多进程通信的 Win32 位 Debug 版应用程序。
-
-## 目标
-
-重构和移植可视柜台终端框架以实现跨平台化,并新增特性最终打造成一个轻便的分布式容器类框架
-
-* 轻量级的架构和通信机制,能够按需伸缩
-* 每个实体运行在自己的进程中,模块间相对独立,结构间松耦合,而在功能上表现为统一的整体
-* 前端界面与后台独立,聚合后台服务,提供统一服务入口,让后台服务对前台透明(API 网关)
-
-* 
-
-## 依赖情况
-
-### libtoolkit
-
-### spbase
-
-依赖 scew 而 scew 依赖 libexpat
-
-### RvcComm
-
-### spshell
-
-### sphost
-
-
-
-
-
-## 规范准则
-
+# 招行可视柜台终端应用程序
+
+**可视柜台终端应用程序(Remote Video Counter Terminal Application)**是基于C/C++实现的运行在Windows平台上的异步调用、多进程通信的 Win32 位 Debug 版应用程序。
+
+## 目标
+
+重构和移植可视柜台终端框架以实现跨平台化,并新增特性最终打造成一个轻便的分布式容器类框架
+
+* 轻量级的架构和通信机制,能够按需伸缩
+* 每个实体运行在自己的进程中,模块间相对独立,结构间松耦合,而在功能上表现为统一的整体
+* 前端界面与后台独立,聚合后台服务,提供统一服务入口,让后台服务对前台透明(API 网关)
+
+* 
+
+## 依赖情况
+
+### libtoolkit
+
+### spbase
+
+依赖 scew 而 scew 依赖 libexpat
+
+### RvcComm
+
+### spshell
+
+### sphost
+
+
+
+
+
+## 规范准则
+