Browse Source

IDETEC_Almax发生器Linux移植首版代码提交!

lwk 5 days ago
parent
commit
09f8b38d3d

+ 29 - 10
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/CcosGeneralDefine_V3.cpp

@@ -1,30 +1,49 @@
 
-#include "DiosGeneralDefine_V3.h"
+#include "CcosGeneralDefine_V3.h"
+#include <unistd.h>
+#include <limits.h>
+#include <libgen.h>
+#include <cstring>
 
+#ifndef MAX_PATH
+#define MAX_PATH 260
+#endif
 
-//获取当前路径
+// Linux鍏煎�鐨凣etModuleFileName瀹炵幇
+static size_t GetModuleFileNameA(void* hModule, char* lpFilename, size_t nSize)
+{
+	ssize_t len = readlink("/proc/self/exe", lpFilename, nSize - 1);
+	if (len != -1)
+	{
+		lpFilename[len] = '\0';
+		return len;
+	}
+	return 0;
+}
+
+//锟斤拷取锟斤拷前路锟斤拷
 string GetProcessDirectory()
 {
 	string ret = "";
 	char szFilename[MAX_PATH] = { 0 };
-	DWORD res = GetModuleFileNameA(0, szFilename, MAX_PATH);
+	size_t res = GetModuleFileNameA(0, szFilename, MAX_PATH);
 	if (res == 0)
 	{
 		return ret;
 	}
 
 	string fullpath = szFilename;
-	string::size_type firstHit = fullpath.find_last_of('\\');
+	string::size_type firstHit = fullpath.find_last_of('/');
 	if (firstHit == string::npos || firstHit == 0)
 	{
 		return ret;
 	}
 
-	ret = fullpath.substr(0, firstHit);//kick last \
+	ret = fullpath.substr(0, firstHit);//kick last /
 
 	return ret;
 }
-//获取配置文件中指定模块的版本号
+//锟斤拷取锟斤拷锟斤拷锟侥硷拷锟斤拷指锟斤拷模锟斤拷陌姹撅拷锟�
 bool GetVersion(string& version, HMODULE hMyModule)
 {
 	try {
@@ -58,7 +77,7 @@ bool GetVersion(string& version, HMODULE hMyModule)
 			return false;
 		}
 
-		// version 为版本号
+		// version 为锟芥本锟斤拷
 		UINT32 vBitNumber = 0;
 		vBitNumber = HIWORD(fixed_file_info->dwProductVersionMS);
 		version += to_string(vBitNumber);
@@ -133,7 +152,7 @@ bool GetVersion(string& version, ResDataObject& config)
 			return false;
 		}
 
-		// version 为版本号
+		// version 为锟芥本锟斤拷
 		UINT32 vBitNumber = 0;
 		vBitNumber = HIWORD(fixed_file_info->dwProductVersionMS);
 		version += to_string(vBitNumber);
@@ -187,7 +206,7 @@ bool GetVersion(string& version)
 			return false;
 		}
 
-		// version 为版本号
+		// version 为锟芥本锟斤拷
 		UINT32 vBitNumber = 0;
 		vBitNumber = HIWORD(fixed_file_info->dwProductVersionMS);
 		version += to_string(vBitNumber);
@@ -209,7 +228,7 @@ bool GetVersion(string& version)
 	}
 	return false;
 }
-//以指定分隔符截断字符串
+//锟斤拷指锟斤拷锟街革拷锟斤拷锟截讹拷锟街凤拷锟斤拷
 void StrSubstrData(const char* strData, char delimiter, std::vector<string>& array)
 {
 	string strtemp = strData;

+ 6 - 4
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/CcosGeneralDefine_V3.h

@@ -2,16 +2,18 @@
 
 #include <string>
 #include <list>
-#include <windows.h>
 #include "ResDataObject.h"
 using std::string;
 
-//获取日志配置路径
+// Linux鍏煎�绫诲瀷瀹氫箟
+using HMODULE = void*;
+
+//锟斤拷取锟斤拷志锟斤拷锟斤拷路锟斤拷
 string GetProcessDirectory();
-//获取配置文件中指定模块的版本号
+//锟斤拷取锟斤拷锟斤拷锟侥硷拷锟斤拷指锟斤拷模锟斤拷陌姹撅拷锟�
 bool GetVersion(string& version, HMODULE hMyModule);
 bool GetVersion(string& version, ResDataObject& config);
 bool GetVersion(string& version);
-//以指定分隔符截断字符串
+//锟斤拷指锟斤拷锟街革拷锟斤拷锟截讹拷锟街凤拷锟斤拷
 void StrSubstrData(const char* strData, char delimiter, std::vector<string>& array);
 void StrSubstrData(const char* strData, char delimiter, std::list<string>& array);

+ 11 - 7
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/CcosUnitComm_V3.h

@@ -1,6 +1,7 @@
 #pragma once
 
-#include <windows.h>
+#include <functional>
+#include <thread>
 #include "SCF.hpp"
 #include "SyncEvent.hpp"
 
@@ -11,6 +12,9 @@ namespace nsSCF = DIOS::Dev::Communication;
 namespace DIOS::Dev::Communication
 {
 #define CMD_LEN_MAX 1024
+	// Linux鍏煎�绫诲瀷瀹氫箟
+	using DWORD = unsigned long;
+
 	using tbDataFun = std::function <void(const char* Packet, const DWORD Length)>;
 	class DiosConnect
 	{
@@ -26,14 +30,14 @@ namespace DIOS::Dev::Communication
 		bool TryReconnect();
 
 		bool isActDecodeFun{ true };
-		nsSCF::SCF       m_SCF;               //数据收发处理基类
+		nsSCF::SCF       m_SCF;               //锟斤拷锟斤拷锟秸凤拷锟斤拷锟斤拷锟斤拷锟斤拷
 
 	protected:
-		SyncEvent::Auto  m_NewPacket;         //读、处理同步事件
-		//HANDLE           m_DataThread;        //处理数据线程
-		tbDataFun        m_tbFunction;        //处理数据回调函数
-		int              m_iWaitSCFTimeOut;   //处理数据时间间隔
-		std::string      m_tConnectParam;     //连接参数
+		SyncEvent::Auto  m_NewPacket;         //锟斤拷锟斤拷锟斤拷锟斤拷同锟斤拷锟铰硷拷
+		//HANDLE           m_DataThread;        //锟斤拷锟斤拷锟斤拷锟斤拷锟竭筹拷
+		tbDataFun        m_tbFunction;        //锟斤拷锟斤拷锟斤拷锟捷回碉拷锟斤拷锟斤拷
+		int              m_iWaitSCFTimeOut;   //锟斤拷锟斤拷锟斤拷锟斤拷时锟斤拷锟斤拷
+		std::string      m_tConnectParam;     //锟斤拷锟接诧拷锟斤拷
 		tPacketPredate   m_tCallbackFun;
 		std::thread::id  m_TID;               //ThreadID
 	};

+ 77 - 83
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/GEN.DEV.IDETEC_Almax.cpp

@@ -5,7 +5,7 @@
 namespace nsGEN = CCOS::Dev::Detail::Generator;
 #define Almax_LoopDefHBTime 1000
 
-//生成命令校验和:cmdData 为 <CMD> [<,> <ARG>]...<,> 其长度要多出3个字符用于存放 STX、CSUM、ETX
+//锟斤拷锟斤拷锟斤拷锟斤拷校锟斤拷锟�:cmdData 为 <CMD> [<,> <ARG>]...<,> 锟戒长锟斤拷要锟斤拷锟�3锟斤拷锟街凤拷锟斤拷锟节达拷锟� STX锟斤拷CSUM锟斤拷ETX
 char ComputeCheckSum(char* cmdData, int& size)
 {
 	if (size + 3 >= Almax_Com_ReSendLen)
@@ -15,7 +15,7 @@ char ComputeCheckSum(char* cmdData, int& size)
 	int AsciiSum = Almax_STX + Almax_ETX;
 	char TempCMD[Almax_Com_ReSendLen] = { 0 };
 	TempCMD[0] = Almax_STX;
-	for (int i = 0; i < size; i++) //每字节相加
+	for (int i = 0; i < size; i++) //每锟街斤拷锟斤拷锟�
 	{
 		AsciiSum += cmdData[i];
 		TempCMD[i + 1] = cmdData[i];
@@ -46,7 +46,7 @@ CcosAttrKey::UNIT_CTRL_TYPE nsGEN::CGEN_DEV_IDETEC_Almax::m_nNotifyType = CcosAt
 
 nsGEN::CGEN_DEV_IDETEC_Almax::CGEN_DEV_IDETEC_Almax(string configfile)
 {
-	//其余属性初始化
+	//锟斤拷锟斤拷锟斤拷锟皆筹拷始锟斤拷
 	ResDataObject temp;
 	temp.loadFile(configfile.c_str());
 	m_GenConfig = temp["CONFIGURATION"];
@@ -56,15 +56,15 @@ nsGEN::CGEN_DEV_IDETEC_Almax::CGEN_DEV_IDETEC_Almax(string configfile)
 	m_bConnectFlag = true;
 	m_pDevicePath = "UniversalUnit";
 
-	//日志方
+	//锟斤拷志锟斤拷
 	string version;
 	if (GetVersion(version, hMyModule))
 		FINFO("\n===============log begin : version:{$} ===================\n", version.c_str());
 	else
 		FINFO("\n===============log begin : version:0.0.0.0 ===================\n");
 
-	//设置发生器属性集合各个值的范围及精度
-//硬件参数
+	//锟斤拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟皆硷拷锟较革拷锟斤拷值锟侥凤拷围锟斤拷锟斤拷锟斤拷
+//硬锟斤拷锟斤拷锟斤拷
 	m_TubeInfo.reset(new StringMould(CcosAttrKey::TUBEINFO, "unKnow"));        
 	m_TubeTargetMaterial.reset(new StringMould(CcosAttrKey::TUBETARGETMATERIAL, CcosAttrKey::TYPE::MO));
 	m_TubeAngle.reset(new IntMould(CcosAttrKey::TUBEANGLE,0.0, -180.0, 180.0, 1.0));
@@ -76,8 +76,8 @@ nsGEN::CGEN_DEV_IDETEC_Almax::CGEN_DEV_IDETEC_Almax(string configfile)
 	m_GenState.reset(new IntMould(CcosAttrKey::GENSTATE, CcosAttrKey::GENERATOR_STATUS_STANDBY, CcosAttrKey::GENERATOR_STATUS_SHUTDOWN, CcosAttrKey::GENERATOR_STATUS_MAX, 1.0));
 	m_Handswitch.reset(new IntMould(CcosAttrKey::GENHANDSWITCH, CcosAttrKey::HANDSWITCH_STATUS_Release, CcosAttrKey::HANDSWITCH_STATUS_Release, CcosAttrKey::HANDSWITCH_STATUS_MAX, 1.0));
 	m_Footswitch.reset(new IntMould(CcosAttrKey::GENFOOTSWITCH, CcosAttrKey::FOOTSWITCH_STATUS_Release, CcosAttrKey::FOOTSWITCH_STATUS_Release, CcosAttrKey::FOOTSWITCH_STATUS_MAX, 1.0));
-	//点片参数
-	m_RadKV.reset(new FloatMould(CcosAttrKey::RADKV, 40.0, 40.0, 150.0, 1.0)); //接口协议范围:20-49
+	//锟斤拷片锟斤拷锟斤拷
+	m_RadKV.reset(new FloatMould(CcosAttrKey::RADKV, 40.0, 40.0, 150.0, 1.0)); //锟接匡拷协锟介范围:20-49
 	m_RadMA.reset(new FloatMould(CcosAttrKey::RADMA, 10.0, 10.0, 1000.0, 1.0));
 	m_RadMS.reset(new FloatMould(CcosAttrKey::RADMS, 1.0, 1.0, 6300, 1.0));
 	m_RadMAS.reset(new FloatMould(CcosAttrKey::RADMAS, 0.1, 0.1, 1000.0, 1.0));
@@ -93,7 +93,7 @@ nsGEN::CGEN_DEV_IDETEC_Almax::CGEN_DEV_IDETEC_Almax(string configfile)
 	m_PostMAS.reset(new FloatMould(CcosAttrKey::POSTMAS, 0.0, 0.0, 600.0, 0.01));
 	m_ExpMode.reset(new StringMould(CcosAttrKey::EXPMODE, CcosAttrKey::TYPE::Single));
 	m_EXAMMode.reset(new StringMould(CcosAttrKey::EXAMMODE, CcosAttrKey::TYPE::MANUAL));
-	//透视参数
+	//透锟接诧拷锟斤拷
 	m_FluKV.reset(new FloatMould(CcosAttrKey::FLUKV, 40.0, 40.0, 125.0, 1.0));
 	m_FluMA.reset(new FloatMould(CcosAttrKey::FLUMA, 0.5, 0.5, 20.0, 1.0));
 	m_FluMS.reset(new FloatMould(CcosAttrKey::FLUMS, 1.0, 1.0, 1000.0, 1.0));
@@ -105,9 +105,9 @@ nsGEN::CGEN_DEV_IDETEC_Almax::CGEN_DEV_IDETEC_Almax(string configfile)
 	m_FluIntTime.reset(new FloatMould(CcosAttrKey::FLUIntTime, 0.0, 0.0, 300000.0, 1.0));
 	m_FluAccTime.reset(new FloatMould(CcosAttrKey::FLUAccTime, 0.0, 0.0, 300000.0, 1.0));
 
-	//发生器告警及错误消
+	//锟斤拷锟斤拷锟斤拷锟芥警锟斤拷锟斤拷锟斤拷锟斤拷
 	m_MSGUnit.reset(new nsDetail::MSGUnit(m_pDevicePath));
-	//读取配置固定
+	//锟斤拷取锟斤拷锟矫固讹拷
 	GetUnitHWValueFromCFG();
 
 	glo_nCMDType_WaitTime = glo_tDelivermodule.SetPriority(true, false, false, true, 100);
@@ -115,27 +115,27 @@ nsGEN::CGEN_DEV_IDETEC_Almax::CGEN_DEV_IDETEC_Almax(string configfile)
 	glo_nCMDType_WaitACK = glo_tDelivermodule.SetPriority(true, false, 3, false, 0, true, 1000);
 	FINFO("m_nCMDType_WaitTime[{$}]m_nCMDType_HB[{$}] m_nCMDType_WaitACK[{$}]", glo_nCMDType_WaitTime, glo_nCMDType_HB, glo_nCMDType_WaitACK);
 
-	//配置响应操作对照表 供发生器回传的数据触发相应的操作
+	//锟斤拷锟斤拷锟斤拷应锟斤拷锟斤拷锟斤拷锟秸憋拷 锟斤拷锟斤拷锟斤拷锟斤拷锟截达拷锟斤拷锟斤拷锟捷达拷锟斤拷锟斤拷应锟侥诧拷锟斤拷
 	OnCallBack();
 
-	//重置发生器
+	//锟斤拷锟矫凤拷锟斤拷锟斤拷
 	Reset();
 	Sleep(500);
 
-	//以下进行默认设置,需要注意默认值是否正
-	RefreshData(); //刷新初始数
+	//锟斤拷锟铰斤拷锟斤拷默锟斤拷锟斤拷锟矫o拷锟斤拷要注锟斤拷默锟斤拷值锟角凤拷锟斤拷
+	RefreshData(); //刷锟铰筹拷始锟斤拷
 
-	//启动硬件状态轮询进程
+	//锟斤拷锟斤拷硬锟斤拷状态锟斤拷询锟斤拷锟斤拷
 	StartHardwareStatusThread();
 }
 nsGEN::CGEN_DEV_IDETEC_Almax::~CGEN_DEV_IDETEC_Almax()
 {
 	FINFO("\n===============log GEN end ===================\n");
-	
-	if (m_pHardwareStatusThread != NULL)
+
+	if (m_pHardwareStatusThread.joinable())
 	{
-		TerminateThread(m_pHardwareStatusThread, 0);
-		m_pHardwareStatusThread = NULL;
+		m_iLoopTime = 0; // 閫氱煡绾跨▼閫€鍑�
+		m_pHardwareStatusThread.join();
 	}
 	glo_arFrame.clear();
 }
@@ -150,7 +150,7 @@ std::string nsGEN::CGEN_DEV_IDETEC_Almax::GetResource()
 }
 void nsGEN::CGEN_DEV_IDETEC_Almax::GetUnitHWValueFromCFG()
 {
-	//发生器模块消息上报方
+	//锟斤拷锟斤拷锟斤拷模锟斤拷锟斤拷息锟较憋拷锟斤拷
 	if (m_GenConfig.GetKeyCount("NotifyType") > 0)
 	{
 		int tempValue = (int)m_GenConfig["NotifyType"];
@@ -174,7 +174,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::GetUnitHWValueFromCFG()
 				break;
 		}
 	}
-	//同模式
+	//同锟斤拷模式
 	m_arrWSMap.clear();
 	if (m_GenConfig.GetKeyCount("WSTable") > 0)
 	{
@@ -211,7 +211,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::GetUnitHWValueFromCFG()
 		m_arrWSMap[cfgWorkStationKey("Direct", CcosAttrKey::CONVENTIONAL)] = cfgWorkStationData("Direct", WSNamber, WSSYN);
 		FDEBUG("cfg Conventional WS[{$}],SYN[{$}]", WSNamber, (int)WSSYN);
 	}
-	//球管信息
+	//锟斤拷锟斤拷锟较�
 	if (m_GenConfig.GetKeyCount(CcosConfKey::CcosTubeInfo) > 0)
 	{
 		string tempValue = m_GenConfig[CcosConfKey::CcosTubeInfo];
@@ -229,7 +229,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::GetUnitHWValueFromCFG()
 		m_FocusLarge = tempValue;
 	}
 }
-RET_STATUS  nsGEN::CGEN_DEV_IDETEC_Almax::SetWS(const string value) //发生器无此设置
+RET_STATUS  nsGEN::CGEN_DEV_IDETEC_Almax::SetWS(const string value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	FDEBUG("Enter SetWS {$}", value.c_str());
 	int tempws = 1;
@@ -273,11 +273,11 @@ RET_STATUS  nsGEN::CGEN_DEV_IDETEC_Almax::SetExpSYN(EnSYNMode value)
 	sprintf_s(temp, "EXM%1d", tempws);
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpEnable() //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpEnable() //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	return HWSendWaittimeCMD("EXB1", 4);
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpDisable() //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpDisable() //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	return HWSendWaittimeCMD("EXB0", 4);
 }
@@ -286,7 +286,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::Reset()
 	FDEBUG("Enter Reset");
 	//int level = 0;
 	//m_MSGUnit->DelErrorMessage("0", level, "clear all errors");
-	return HWSendWaittimeCMD("ERE", 1);//仅重置错误状态
+	return HWSendWaittimeCMD("ERE", 1);//锟斤拷锟斤拷锟矫达拷锟斤拷状态
 }
 RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::RefreshData()
 {
@@ -296,7 +296,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::RefreshData()
 	//HWSendWaittimeCMD("RF", 2);
 	return RET_STATUS::RET_SUCCEED;
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenSynState(int value) //发生器无此设置:AEC二阶段曝光使用
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenSynState(int value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷:AEC锟斤拷锟阶讹拷锟截癸拷使锟斤拷
 {
 	FDEBUG("Enter SetGenSynState[{$}]->[{$}]", m_GenSynState->Get(), value);
 	switch (value)
@@ -347,7 +347,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenSynState(int value) //
 		{}break;
 		case CcosAttrKey::GENERATOR_FLU_XRAYOFF:
 		{}break;
-		default:
+		default:
 			break;
 	}
 	if (m_GenSynState->Update(value))
@@ -355,7 +355,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenSynState(int value) //
 
 	return RET_STATUS::RET_SUCCEED;
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenState(int value) //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenState(int value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	FDEBUG("Enter SetGenSynState[{$}]->[{$}]", m_GenState->Get(), value);
 	switch (value)
@@ -374,7 +374,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetGenState(int value) //
 		{}break;
 		case CcosAttrKey::GENERATOR_STATUS_ERROR:
 		{}break;
-		default:
+		default:
 			break;
 	}
 	if (m_GenState->Update(value))
@@ -410,7 +410,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::SetNotifyCallBack(callBackFun fun)
 	m_funV2DynamicCallBackFun = fun;
 }
 
-//发生器支持的通用点片命令
+//锟斤拷锟斤拷锟斤拷支锟街碉拷通锟矫碉拷片锟斤拷锟斤拷
 RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::IncRadKV()
 {
 	if (!m_RadKV->CanInc()) return RET_STATUS::RET_FAILED;
@@ -586,7 +586,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetTechmode(int value)
 	sprintf_s(temp, "RET%01d", (int)value);
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECDensity(int value) //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECDensity(int value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	if (!m_RadAECDensity->Verify(value)) return RET_STATUS::RET_FAILED;
 
@@ -601,7 +601,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECDensity(int value) //
 	sprintf_s(temp, "RFN%+1d", value);
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECField(int value) //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECField(int value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	if (!m_RadAECField->Verify(value)) return RET_STATUS::RET_FAILED;
 
@@ -616,7 +616,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECField(int value) //
 	sprintf_s(temp, "RFS%03d", value);
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECFilm(int value) //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAECFilm(int value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	if (!m_RadAECFilm->Verify(value)) return RET_STATUS::RET_FAILED;
 
@@ -725,7 +725,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetAPR(const _tAPRArgs& t)
 	return RET_STATUS::RET_SUCCEED;
 }
 
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostKV(float& value) //实际为主动上报
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostKV(float& value) //实锟斤拷为锟斤拷锟斤拷锟较憋拷
 {
 	if (m_PostKV->Get() > 0)
 	{
@@ -733,7 +733,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostKV(float& value) //实
 	}
 	return RET_STATUS::RET_SUCCEED;
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMA(float& value) //实际为主动上报
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMA(float& value) //实锟斤拷为锟斤拷锟斤拷锟较憋拷
 {
 	if (m_PostMA->Get() > 0)
 	{
@@ -741,7 +741,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMA(float& value) //实
 	}
 	return RET_STATUS::RET_SUCCEED;
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMS(float& value) //实际为主动上报
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMS(float& value) //实锟斤拷为锟斤拷锟斤拷锟较憋拷
 {
 	if (m_PostMS->Get() > 0)
 	{
@@ -749,7 +749,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMS(float& value) //实
 	}
 	return RET_STATUS::RET_SUCCEED;
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMAS(float& value) //实际为主动上报
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMAS(float& value) //实锟斤拷为锟斤拷锟斤拷锟较憋拷
 {
 	if (m_PostMAS->Get() > 0)
 	{
@@ -758,13 +758,13 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::QueryPostMAS(float& value) //实
 	return RET_STATUS::RET_SUCCEED;
 }
 
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetRadFrameRate(FLOAT frameRate) //发生器无此动态设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetRadFrameRate(FLOAT frameRate) //锟斤拷锟斤拷锟斤拷锟睫此讹拷态锟斤拷锟斤拷
 {
 	char temp[50] = { 0 };
 	sprintf_s(temp, "RPS%03d", (int)(frameRate*10));
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpMode(std::string value) //发生器无此设置
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpMode(std::string value) //锟斤拷锟斤拷锟斤拷锟睫达拷锟斤拷锟斤拷
 {
 	FINFO("Enter SetExpMode:[{$}]", value.c_str());
 	int data = atoi(value.c_str());
@@ -772,7 +772,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetExpMode(std::string value) //
 	sprintf_s(temp, "RMM%1d", data * 10);
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
-RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetEXAMMode(std::string value) //DMOC实际是通过此接口设置是否启用AEC
+RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetEXAMMode(std::string value) //DMOC实锟斤拷锟斤拷通锟斤拷锟剿接匡拷锟斤拷锟斤拷锟角凤拷锟斤拷锟斤拷AEC
 {
 	int data = atoi(value.c_str());
 	char temp[50] = { 0 };
@@ -780,7 +780,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetEXAMMode(std::string value) //DMOC实
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
 
-//发生器支持的通用透视命令
+//锟斤拷锟斤拷锟斤拷支锟街碉拷通锟斤拷透锟斤拷锟斤拷锟斤拷
 RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::IncFluKV() 
 {
 	if (!m_FluKV->CanInc()) return RET_STATUS::RET_FAILED;
@@ -1076,7 +1076,7 @@ RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::TransferRadCurve(int ncurve)
 	return HWSendWaittimeCMD(temp, strlen(temp));
 }
 
-//Almax特有指令
+//Almax锟斤拷锟斤拷指锟斤拷
 RET_STATUS nsGEN::CGEN_DEV_IDETEC_Almax::SetPanelField(int value)
 {
 	FDEBUG("Enter SetPanelField:[{$}]", value);
@@ -1223,8 +1223,8 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::FireNotify(string key, const int context)
 				FERROR("V2DynamicCallBackFun:[{$}:{$}] is null", key.c_str(), str.c_str());
 			}
 		}break;
-		default:
-			FERROR("FireNotify:unknow[{$}]m_nNotifyType", (int)m_nNotifyType);
+		default:
+			FERROR("FireNotify:unknow[{$}]m_nNotifyType", (int)m_nNotifyType);
 			break;
 	}
 }
@@ -1259,8 +1259,8 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::FireNotify(string key, const float context)
 				FERROR("V2DynamicCallBackFun:[{$}:{$}] is null", key.c_str(), str.c_str());
 			}
 		}break;
-		default:
-			FERROR("FireNotify:unknow[{$}]m_nNotifyType", (int)m_nNotifyType);
+		default:
+			FERROR("FireNotify:unknow[{$}]m_nNotifyType", (int)m_nNotifyType);
 			break;
 	}
 }
@@ -1294,8 +1294,8 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::FireNotify(string key, const string context)
 				FERROR("V2DynamicCallBackFun:[{$}:{$}] is null", key.c_str(), context.c_str());
 			}
 		}break;
-		default:
-			FERROR("FireNotify:unknow[{$}]m_nNotifyType", (int)m_nNotifyType);
+		default:
+			FERROR("FireNotify:unknow[{$}]m_nNotifyType", (int)m_nNotifyType);
 			break;
 	}
 }
@@ -1335,13 +1335,13 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::FireWarnMessage(const bool Act, const int Cod
 
 void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 {
-	//无 操作
+	//锟斤拷 锟斤拷锟斤拷
 	auto HWNotProcess = [](const char* value, int length) -> void
 	{
 		FINFO("This commands[{$}] didn't need to process", value);
 	};
 
-	//校验和错误
+	//校锟斤拷痛锟斤拷锟�
 	auto HWERROR_1 = [this](char* value, int length) -> void
 	{
 		char* nextTokenPtr = NULL;
@@ -1357,7 +1357,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 	};
 
 	//3.1 RADIOGRAPHIC COMMANDS
-	auto HWRKV = [this](char* value, int length) -> void //3.1.1  Sets the KV value  KV value * 10)
+	auto HWRKV = [this](char* value, int length) -> void //3.1.1  Sets the KV value  锟斤拷KV value * 10)
 	{
 		assert(value);
 		float tempValue = atof(value) / 10.0;
@@ -2071,12 +2071,12 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 		if (tempValue != 0)
 		{
 			if (value[0] == '0')
-				value[0] = '2';//逆时针
+				value[0] = '2';//锟斤拷时锟斤拷
 			else
-				value[0] = '1';//顺时
+				value[0] = '1';//顺时锟斤拷
 			tempValue = atoi(value);
 		}
-		//else tempValue = 0;//
+		//else tempValue = 0;//锟斤拷
 		
 		FDEBUG("Image Rotate[{$}]", tempValue);
 		FireNotify("ImageRotate", tempValue);
@@ -2164,7 +2164,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 	auto HWEAK = [this](char* value, int length) -> void //3.4.5  Read Air Kerm
 	{
 		assert(value);
-		float tempValue = atof(value) / 10.0;//EAR EAK缩进与协议相
+		float tempValue = atof(value) / 10.0;//EAR EAK锟斤拷锟斤拷锟斤拷协锟斤拷锟洁
 		FDEBUG("Read Air Kerm[{$}]", tempValue);
 		if (m_fAirKerm != tempValue)
 		{
@@ -2547,11 +2547,11 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 		FireNotify("SubsequentRun", tempValue);
 	};
 
-	//初始化指令对照表
+	//锟斤拷始锟斤拷指锟斤拷锟斤拷毡锟�
 	glo_arFrame.clear();
-	//glo_arFrame[""] = tFrameMapItem(HWERROR_1);//命令格式:校验和错误
+	//glo_arFrame[""] = tFrameMapItem(HWERROR_1);//锟斤拷锟斤拷锟绞�:校锟斤拷痛锟斤拷锟�
 	//3.1 RADIOGRAPHIC COMMANDS
-	glo_arFrame["RKV"] = tFrameMapItem(HWRKV); //3.1.1  Sets the KV value  KV value * 10
+	glo_arFrame["RKV"] = tFrameMapItem(HWRKV); //3.1.1  Sets the KV value  锟斤拷KV value * 10
 	glo_arFrame["RMA"] = tFrameMapItem(HWRMA); //3.1.2  Sets the MA value (MA * 100)
 	glo_arFrame["RMS"] = tFrameMapItem(HWRMS); //3.1.3  Sets the Exposure Time in milliseconds (MS * 100)
 	glo_arFrame["RMX"] = tFrameMapItem(HWRMX); //3.1.4  Sets the MAS  1/1000 (milliamp * seconds)
@@ -2667,7 +2667,7 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 	glo_arFrame["GEL"] = tFrameMapItem(HWGEL); //3.7.20 Generator Error Log
 	glo_arFrame["DGC"] = tFrameMapItem(HWDGC); //3.7.21 Detect Grid Config
 	glo_arFrame["SPC"] = tFrameMapItem(HWSPC); //3.7.22 Serail Port Configration
-	//Almax特有指令
+	//Almax锟斤拷锟斤拷指锟斤拷
 	glo_arFrame["PZM"] = tFrameMapItem(HWPZM); //Flat Panel Field Selection
 	glo_arFrame["SSD"] = tFrameMapItem(HWSSD); //System Shut Down
 	glo_arFrame["VNE"] = tFrameMapItem(HWVNE); //Exam Seletcion
@@ -2680,31 +2680,26 @@ void nsGEN::CGEN_DEV_IDETEC_Almax::OnCallBack()
 bool nsGEN::CGEN_DEV_IDETEC_Almax::StartHardwareStatusThread()
 {
 	FINFO("enter Start HardwareStatus Thread ");
-	if (m_pHardwareStatusThread == NULL)
+	if (!m_pHardwareStatusThread.joinable())
 	{
-		DWORD m_HardwareStatusID;
-		m_pHardwareStatusThread = CreateThread(0, 0, HardwareStatusThread, this, 0, &m_HardwareStatusID);
-		if (m_pHardwareStatusThread == NULL)
+		try
 		{
-			FERROR("Start HardwareStatus Thread Failed");
+			m_pHardwareStatusThread = std::thread(HardwareStatusThread, this);
+		}
+		catch (const std::exception& e)
+		{
+			FERROR("Start HardwareStatus Thread Failed: {$}", e.what());
 			return false;
 		}
-		//DWORD m_HardwareReSendID;
-		//m_pHardwareRsSendThread = CreateThread(0, 0, HardwareReSendThread, this, 0, &m_HardwareReSendID);
-		//if (m_pHardwareRsSendThread == NULL)
-		//{
-		//	FERROR("Start HardwareReSend Thread Failed");
-		//	return false;
-		//}
 	}
 	return true;
 }
-DWORD nsGEN::CGEN_DEV_IDETEC_Almax::HardwareStatusThread(LPVOID pParam)
+void nsGEN::CGEN_DEV_IDETEC_Almax::HardwareStatusThread(CGEN_DEV_IDETEC_Almax* pParam)
 {
-	CGEN_DEV_IDETEC_Almax* pCurGen = (CGEN_DEV_IDETEC_Almax*)pParam;
-	if (pCurGen == NULL)
+	CGEN_DEV_IDETEC_Almax* pCurGen = pParam;
+	if (pCurGen == nullptr)
 	{
-		return false;
+		return;
 	}
 	FINFO("HardwareStatusThread start");
 	if ((int)pCurGen->m_GenConfig["loopTime"] >= 0)
@@ -2715,23 +2710,22 @@ DWORD nsGEN::CGEN_DEV_IDETEC_Almax::HardwareStatusThread(LPVOID pParam)
 	int currtTime = pCurGen->m_iLoopTime;
 	while (pCurGen->m_iLoopTime > 0)
 	{
-		//心跳包统计加1
+		//锟斤拷锟斤拷锟斤拷统锟狡硷拷1
 		pCurGen->m_iHeartBeats++;
 		int tempHeartBeat = pCurGen->m_iHeartBeats;
-		if (tempHeartBeat > 10) //无返回信息认为连接断开
+		if (tempHeartBeat > 10) //锟睫凤拷锟斤拷锟斤拷息锟斤拷为锟斤拷锟接断匡拷
 		{
 			pCurGen->m_iHeartBeats = 0;
 			FINFO("AlmaxGEN: lost Connect \n");
 			pCurGen->m_bConnectFlag = false;
 			continue;
 		}
-		//发送心跳
-		//pCurGen->HWSendHBCMD("EEC9", 4); 
-		//轮询发生器温度信
+		//锟斤拷锟斤拷锟斤拷锟斤拷
+		//pCurGen->HWSendHBCMD("EEC9", 4);
+		//锟斤拷询锟斤拷锟斤拷锟斤拷锟铰讹拷锟斤拷
 		pCurGen->HWSendHBCMD("EHE", 3);
 
 	}
 
 	FINFO("HardwareStatusThread stop");
-	return true;
 }

+ 128 - 128
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/GEN.DEV.IDETEC_Almax.h

@@ -12,171 +12,171 @@ namespace CCOS::Dev::Detail::Generator
     public:
         CGEN_DEV_IDETEC_Almax(string configfile);
         ~CGEN_DEV_IDETEC_Almax();
-		//发生器模块通用
-		std::string GetGUID(); //供GUID
-		std::string GetResource(); //提供Device对外的接口、属性
-		void GetUnitHWValueFromCFG(); //读取配置文件设定值
-		RET_STATUS SetWS(const std::string value); //设置工作
-		RET_STATUS SetExpSYN(EnSYNMode value); //设置曝光同步
-		RET_STATUS SetExpEnable(); //曝光使能
+		//锟斤拷锟斤拷锟斤拷模锟斤拷通锟斤拷
+		std::string GetGUID(); //锟结供GUID
+		std::string GetResource(); //锟结供Device锟斤拷锟斤拷慕涌凇锟斤拷锟斤拷锟�
+		void GetUnitHWValueFromCFG(); //锟斤拷取锟斤拷锟斤拷锟侥硷拷锟借定值
+		RET_STATUS SetWS(const std::string value); //锟斤拷锟矫癸拷锟斤拷
+		RET_STATUS SetExpSYN(EnSYNMode value); //锟斤拷锟斤拷锟截癸拷同锟斤拷
+		RET_STATUS SetExpEnable(); //锟截癸拷使锟斤拷
 		RET_STATUS SetExpDisable();
-		RET_STATUS Reset(); //重置发生器错误
-		RET_STATUS RefreshData(); //刷新部分数据
-		RET_STATUS SetGenSynState(int value); //设置发生器曝光状态
-		RET_STATUS SetGenState(int value); //设置发生器设备状态
-		RET_STATUS Clear_DAP(); //清空DAP
-		RET_STATUS GetValue_DAP(float& value); //取DAP
-		RET_STATUS SetDetectorWindow(bool value); //发送TIC
-		RET_STATUS SetExposurePermit(bool value); //发送EXO
-		//指令发送接口
+		RET_STATUS Reset(); //锟斤拷锟矫凤拷锟斤拷锟斤拷锟斤拷锟斤拷
+		RET_STATUS RefreshData(); //刷锟铰诧拷锟斤拷锟斤拷锟斤拷
+		RET_STATUS SetGenSynState(int value); //锟斤拷锟矫凤拷锟斤拷锟斤拷锟截癸拷状态
+		RET_STATUS SetGenState(int value); //锟斤拷锟矫凤拷锟斤拷锟斤拷锟借备状态
+		RET_STATUS Clear_DAP(); //锟斤拷锟紻AP
+		RET_STATUS GetValue_DAP(float& value); //锟斤拷取DAP
+		RET_STATUS SetDetectorWindow(bool value); //锟斤拷锟斤拷TIC
+		RET_STATUS SetExposurePermit(bool value); //锟斤拷锟斤拷EXO
+		//指锟筋发锟酵接匡拷
 		RET_STATUS HWSend(const char* strCommand, int lengh, bool reSend = false, int nTimeOut = TIMEOUTVALUE);
-		void SetNotifyCallBack(callBackFun fun); //设置消息上报回调
-		//发生器支持的通用点片命令
-		RET_STATUS IncRadKV(); //点片KV调节
+		void SetNotifyCallBack(callBackFun fun); //锟斤拷锟斤拷锟斤拷息锟较憋拷锟截碉拷
+		//锟斤拷锟斤拷锟斤拷支锟街碉拷通锟矫碉拷片锟斤拷锟斤拷
+		RET_STATUS IncRadKV(); //锟斤拷片KV锟斤拷锟斤拷
 		RET_STATUS DecRadKV();
 		RET_STATUS SetRadKV(float value);
-		RET_STATUS IncRadMA(); //点片MA调节
+		RET_STATUS IncRadMA(); //锟斤拷片MA锟斤拷锟斤拷
 		RET_STATUS DecRadMA();
 		RET_STATUS SetRadMA(float value);
-		RET_STATUS IncRadMS(); //点片MS调节
+		RET_STATUS IncRadMS(); //锟斤拷片MS锟斤拷锟斤拷
 		RET_STATUS DecRadMS();
 		RET_STATUS SetRadMS(float value);
-		RET_STATUS IncRadMAS(); //点片MAS调节
+		RET_STATUS IncRadMAS(); //锟斤拷片MAS锟斤拷锟斤拷
 		RET_STATUS DecRadMAS();
 		RET_STATUS SetRadMAS(float value);
-		RET_STATUS SetFocus(int value); //设置焦点
-		RET_STATUS SetTechmode(int value); //设置技术模式:1point,2point,3point
-		RET_STATUS SetAECDensity(int value); //设置AEC浓度
-		RET_STATUS SetAECField(int value); //设置AEC取样区域
-		RET_STATUS SetAECFilm(int value); //设置AEC胶
-		RET_STATUS SetAPR(const _tAPRArgs& t); //一次性设置点片参数
-		RET_STATUS QueryPostKV(float& value); //查询曝光后的真实参数
+		RET_STATUS SetFocus(int value); //锟斤拷锟矫斤拷锟斤拷
+		RET_STATUS SetTechmode(int value); //锟斤拷锟矫硷拷锟斤拷模式:1point,2point,3point
+		RET_STATUS SetAECDensity(int value); //锟斤拷锟斤拷AEC浓锟斤拷
+		RET_STATUS SetAECField(int value); //锟斤拷锟斤拷AEC取锟斤拷锟斤拷锟斤拷
+		RET_STATUS SetAECFilm(int value); //锟斤拷锟斤拷AEC锟斤拷
+		RET_STATUS SetAPR(const _tAPRArgs& t); //一锟斤拷锟斤拷锟斤拷锟矫碉拷片锟斤拷锟斤拷
+		RET_STATUS QueryPostKV(float& value); //锟斤拷询锟截癸拷锟斤拷锟斤拷实锟斤拷锟斤拷
 		RET_STATUS QueryPostMA(float& value);
 		RET_STATUS QueryPostMS(float& value);
 		RET_STATUS QueryPostMAS(float& value);
-		RET_STATUS SetRadFrameRate(float frameRate); //设置序列点片帧率
-		RET_STATUS SetExpMode(std::string value); //设置曝光模式:单帧、序列、双能
-		RET_STATUS SetEXAMMode(std::string value); //设置检测模式:手动、自动
-		//发生器支持的通用透视命令
-		RET_STATUS IncFluKV(); //透视KV调节
+		RET_STATUS SetRadFrameRate(float frameRate); //锟斤拷锟斤拷锟斤拷锟叫碉拷片帧锟斤拷
+		RET_STATUS SetExpMode(std::string value); //锟斤拷锟斤拷锟截癸拷模式:锟斤拷帧锟斤拷锟斤拷锟叫★拷双锟斤拷
+		RET_STATUS SetEXAMMode(std::string value); //锟斤拷锟矫硷拷锟侥J�:锟街讹拷锟斤拷锟皆讹拷
+		//锟斤拷锟斤拷锟斤拷支锟街碉拷通锟斤拷透锟斤拷锟斤拷锟斤拷
+		RET_STATUS IncFluKV(); //透锟斤拷KV锟斤拷锟斤拷
 		RET_STATUS DecFluKV();
 		RET_STATUS SetFluKV(float value);
-		RET_STATUS IncFluMA(); //透视MA调节
+		RET_STATUS IncFluMA(); //透锟斤拷MA锟斤拷锟斤拷
 		RET_STATUS DecFluMA();
 		RET_STATUS SetFluMA(float value);
-		RET_STATUS IncFluMS(); //透视MS调节
+		RET_STATUS IncFluMS(); //透锟斤拷MS锟斤拷锟斤拷
 		RET_STATUS DecFluMS();
 		RET_STATUS SetFluMS(float value);
-		RET_STATUS IncFluMAS(); //透视MAS调节
+		RET_STATUS IncFluMAS(); //透锟斤拷MAS锟斤拷锟斤拷
 		RET_STATUS DecFluMAS();
 		RET_STATUS SetFluMAS(float value);
-		RET_STATUS SetPPS(float frameRate); //脉冲透视帧率调节
+		RET_STATUS SetPPS(float frameRate); //锟斤拷锟斤拷透锟斤拷帧锟绞碉拷锟斤拷
 		RET_STATUS GetPPS();
 		RET_STATUS INCPPS();
 		RET_STATUS DECPPS();
-		RET_STATUS SetPluseWidth(float fplusewidth); //设置脉宽
-		RET_STATUS SetABSMode(int nMode); //设置自动亮度调节(ABS)模式
-		RET_STATUS SetABSCurve(); //ABS曲线调节
+		RET_STATUS SetPluseWidth(float fplusewidth); //锟斤拷锟斤拷锟斤拷锟斤拷
+		RET_STATUS SetABSMode(int nMode); //锟斤拷锟斤拷锟皆讹拷锟斤拷锟饺碉拷锟节o拷ABS锟斤拷模式
+		RET_STATUS SetABSCurve(); //ABS锟斤拷锟竭碉拷锟斤拷
 		RET_STATUS IncABSCurve();
 		RET_STATUS DecABSCurve();
 		RET_STATUS SetABSValue(float fABSValue);
 		RET_STATUS SetABSTargetEXI(float fEXIValue);
-		RET_STATUS SetAPF(const _tAPFArgs& t); //一次性设置透视参数
-		RET_STATUS GetFluIntTimer(); //获取透视周期时间
-		RET_STATUS GetFluAccTimer(); //获取透视曝光累计时间
-		RET_STATUS ResetFluTimer(int ntype); //清空透视曝光累计时间
-		RET_STATUS SetFluPre(int bPrepare); //设置透视预备阶段使能
-		RET_STATUS SetFluEXP(int bPrepare); //设置透视曝光阶段使能
-		RET_STATUS SetFluMode(std::string value); //设置透视模式
-		RET_STATUS SetFluMAG(int nsize); //设置MG:0 to 3 - sets Mag size, ASCII character for 255 - Mag selection disabled
+		RET_STATUS SetAPF(const _tAPFArgs& t); //一锟斤拷锟斤拷锟斤拷锟斤拷透锟接诧拷锟斤拷
+		RET_STATUS GetFluIntTimer(); //锟斤拷取透锟斤拷锟斤拷锟斤拷时锟斤拷
+		RET_STATUS GetFluAccTimer(); //锟斤拷取透锟斤拷锟截癸拷锟桔硷拷时锟斤拷
+		RET_STATUS ResetFluTimer(int ntype); //锟斤拷锟酵革拷锟斤拷毓锟斤拷奂锟绞憋拷锟�
+		RET_STATUS SetFluPre(int bPrepare); //锟斤拷锟斤拷透锟斤拷预锟斤拷锟阶讹拷使锟斤拷
+		RET_STATUS SetFluEXP(int bPrepare); //锟斤拷锟斤拷透锟斤拷锟截癸拷锥锟绞癸拷锟�
+		RET_STATUS SetFluMode(std::string value); //锟斤拷锟斤拷透锟斤拷模式
+		RET_STATUS SetFluMAG(int nsize); //锟斤拷锟斤拷MG:0 to 3 - sets Mag size, ASCII character for 255 - Mag selection disabled
 		RET_STATUS DisableMAG();
-		RET_STATUS SetFluDoseLever(int nlever); //设置透视剂量等级( 0,1,2 )
-		RET_STATUS SetHalfDose(int nlever); //设置透视半价剂量
-		RET_STATUS TransferRadCurve(int ncurve); //点片KV跟随透视,0-3 Set curve 0:disable
-		//Almax特有指令
-		RET_STATUS SetPanelField(int value); //用于与客户控制面板平板成像区域选择功能的对应
-		RET_STATUS SetShutDown(int value); //在客户控制台按下关机按钮,DFOC收到“SSD1”,退出软件
-		RET_STATUS SetExamView(int value); //使用该命令将DFOC Profile 与客户操作面板上的检查部位对应起来
-		RET_STATUS SetDSA(int value); //设置血管、心脏的造影模式
-		RET_STATUS SetRoadMap(int value); //设置Road Map
-		RET_STATUS EnterExam(int value); //标识进入检查
+		RET_STATUS SetFluDoseLever(int nlever); //锟斤拷锟斤拷透锟接硷拷锟斤拷锟饺硷拷( 0,1,2 )
+		RET_STATUS SetHalfDose(int nlever); //锟斤拷锟斤拷透锟接帮拷奂锟斤拷锟�
+		RET_STATUS TransferRadCurve(int ncurve); //锟斤拷片KV锟斤拷锟斤拷透锟斤拷,0-3 Set curve 0:disable
+		//Almax锟斤拷锟斤拷指锟斤拷
+		RET_STATUS SetPanelField(int value); //锟斤拷锟斤拷锟斤拷突锟斤拷锟斤拷锟斤拷锟斤拷平锟斤拷锟斤拷锟斤拷锟斤拷锟窖★拷锟斤拷艿亩锟接�
+		RET_STATUS SetShutDown(int value); //锟节客伙拷锟斤拷锟斤拷台锟斤拷锟铰关伙拷锟斤拷钮锟斤拷DFOC锟秸碉拷锟斤拷SSD1锟斤拷锟斤拷锟剿筹拷锟斤拷锟斤拷
+		RET_STATUS SetExamView(int value); //使锟矫革拷锟斤拷锟筋将DFOC Profile 锟斤拷突锟斤拷锟斤拷锟斤拷锟斤拷锟较的硷拷椴课伙拷锟接︼拷锟斤拷锟�
+		RET_STATUS SetDSA(int value); //锟斤拷锟斤拷血锟杰★拷锟斤拷锟斤拷锟斤拷锟接澳J�
+		RET_STATUS SetRoadMap(int value); //锟斤拷锟斤拷Road Map
+		RET_STATUS EnterExam(int value); //锟斤拷识锟斤拷锟斤拷锟斤拷
 
 	public:
-		ResDataObject                m_GenConfig; //配置文件
-		string                       m_pDevicePath; //Container需要的设备路径
-		static CcosAttrKey::UNIT_CTRL_TYPE m_nNotifyType; //消息上报方
-		//线程变量互斥锁
-		static atomic<int>           m_iLoopTime; //循环间隔时间(毫秒)轮询线程使用
-		atomic<int>                  m_iHeartBeats;	//心跳统计
-		atomic<bool>                 m_bConnectFlag; //连接标记
-		//硬件参数
-		std::unique_ptr<StringMould> m_TubeInfo; //球管描述,多为型号
-		std::unique_ptr<StringMould> m_TubeTargetMaterial; //阳极靶材
-		std::unique_ptr<IntMould>    m_TubeAngle; //球管角度,有的发生器可随时调整
-		std::unique_ptr<FloatMould>  m_TubeHE; //球管温度
-		std::unique_ptr<FloatMould>  m_GenHE; //逆变器(升压装置)温度
-		std::unique_ptr<IntMould>    m_BatteryChargeState; //电池状态:充电、未充电、未安装
-		std::unique_ptr<IntMould>    m_BatteryPowerState; //电池电量
-		std::unique_ptr<IntMould>    m_GenSynState; //发生器曝光状态:阳极旋转、阴阳两极加压、出线、停止旋转加
-		std::unique_ptr<IntMould>    m_GenState; //发生器设备状态:断电、休眠、初始化、待机、曝光中、冷却、有错等
-		std::unique_ptr<IntMould>    m_Handswitch; //手闸状态:一档按下、二档按下、一档松开、二档松开
-		std::unique_ptr<IntMould>    m_Footswitch; //脚闸状态:踩下、抬起
-		map<cfgWorkStationKey, cfgWorkStationData> m_arrWSMap; //工作位标记码查找表
-		cfgWorkStationKey            m_strCurrentWSName; //当前工作位名称; //工作位:站位、卧
+		ResDataObject                m_GenConfig; //锟斤拷锟斤拷锟侥硷拷
+		string                       m_pDevicePath; //Container锟斤拷要锟斤拷锟借备路锟斤拷
+		static CcosAttrKey::UNIT_CTRL_TYPE m_nNotifyType; //锟斤拷息锟较憋拷锟斤拷
+		//锟竭程憋拷锟斤拷锟斤拷锟斤拷锟斤拷
+		static atomic<int>           m_iLoopTime; //循锟斤拷锟斤拷锟绞憋拷洌�拷锟斤拷耄╋拷锟窖�拷叱锟绞癸拷锟�
+		atomic<int>                  m_iHeartBeats;	//锟斤拷锟斤拷统锟斤拷
+		atomic<bool>                 m_bConnectFlag; //锟斤拷锟接憋拷锟�
+		//硬锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<StringMould> m_TubeInfo; //锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟轿�拷秃锟�
+		std::unique_ptr<StringMould> m_TubeTargetMaterial; //锟斤拷锟斤拷锟叫诧拷
+		std::unique_ptr<IntMould>    m_TubeAngle; //锟斤拷芙嵌龋锟斤拷械姆锟斤拷锟斤拷锟斤拷锟斤拷锟绞憋拷锟斤拷锟�
+		std::unique_ptr<FloatMould>  m_TubeHE; //锟斤拷锟斤拷露锟�
+		std::unique_ptr<FloatMould>  m_GenHE; //锟斤拷锟斤拷锟斤拷锟斤拷锟窖棺帮拷茫锟斤拷露锟�
+		std::unique_ptr<IntMould>    m_BatteryChargeState; //锟斤拷锟阶刺�拷锟斤拷锟界、未锟斤拷纭⑽达拷锟阶�
+		std::unique_ptr<IntMould>    m_BatteryPowerState; //锟斤拷氐锟斤拷锟�
+		std::unique_ptr<IntMould>    m_GenSynState; //锟斤拷锟斤拷锟斤拷锟截癸拷状态锟斤拷锟斤拷锟斤拷锟斤拷转锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷压锟斤拷锟斤拷锟竭★拷停止锟斤拷转锟斤拷
+		std::unique_ptr<IntMould>    m_GenState; //锟斤拷锟斤拷锟斤拷锟借备状态锟斤拷锟较电、锟斤拷锟竭★拷锟斤拷始锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟截癸拷锟叫★拷锟斤拷却锟斤拷锟叫达拷锟斤拷
+		std::unique_ptr<IntMould>    m_Handswitch; //锟斤拷闸状态锟斤拷一锟斤拷锟斤拷锟铰★拷锟斤拷锟斤拷锟斤拷锟铰★拷一锟斤拷锟缴匡拷锟斤拷锟斤拷锟斤拷锟缴匡拷
+		std::unique_ptr<IntMould>    m_Footswitch; //锟斤拷闸状态锟斤拷锟斤拷锟铰★拷抬锟斤拷
+		map<cfgWorkStationKey, cfgWorkStationData> m_arrWSMap; //锟斤拷锟斤拷位锟斤拷锟斤拷锟斤拷锟揭憋拷
+		cfgWorkStationKey            m_strCurrentWSName; //锟斤拷前锟斤拷锟斤拷位锟斤拷锟斤拷; //锟斤拷锟斤拷位锟斤拷站位锟斤拷锟斤拷
 		float                        m_fAirKerm{ 0 }; //
 		float                        AirKermRate{ 0 }; //
-		//点片参数
-		std::unique_ptr<FloatMould>  m_RadKV; //阳极电
-		std::unique_ptr<FloatMould>  m_RadMA; //阴极电流
-		std::unique_ptr<FloatMould>  m_RadMS; //加压时间
-		std::unique_ptr<FloatMould>  m_RadMAS; //电流时间积
-		std::unique_ptr<IntMould>    m_RadTechmode; //参数设置模式:一点、两点、三点
-		std::unique_ptr<IntMould>    m_RadFocus; //焦点类型
-		std::unique_ptr<IntMould>    m_RadAECField; //AEC取样区域
-		std::unique_ptr<IntMould>    m_RadAECFilm; //AEC
-		std::unique_ptr<FloatMould>  m_RadAECDensity; //AEC浓
-		std::unique_ptr<IntMould>    m_RadFrameRate; //序列点片帧率
-		std::unique_ptr<FloatMould>  m_PostKV; //曝光实际电
-		std::unique_ptr<FloatMould>  m_PostMA; //曝光实际电流
-		std::unique_ptr<FloatMould>  m_PostMS; //曝光实际时间
-		std::unique_ptr<FloatMould>  m_PostMAS; //曝光实际电流时间积
-		std::unique_ptr<StringMould> m_ExpMode; //曝光模式:点片、序列点片、双能
-		std::unique_ptr<StringMould> m_EXAMMode; //检查模式:手动、自动
-		float                        m_FocusSmall{ 0 }; //小灯丝尺寸(配置文件获取)
-		float                        m_FocusLarge{ 1 }; //大灯丝尺寸(配置文件获取)
-		//透视参数
-		std::unique_ptr<FloatMould>  m_FluKV; //阳极电压(动态发生器点片、透视的KV要分别设置)
-		std::unique_ptr<FloatMould>  m_FluMA; //阴极电流(动态发生器点片、透视的MA要分别设置)
-		std::unique_ptr<FloatMould>  m_FluMS; //加压时间(透视过程中的单个周期、脉宽)
-		std::unique_ptr<FloatMould>  m_FluMAS; //电流时间积(动态发生器点片、透视的MAS要分别设置)
-		std::unique_ptr<IntMould>    m_FluPPS; //帧率(脉冲频率,与序列点片不一样)
-		std::unique_ptr<IntMould>    m_FluABSStatus; //自动亮度调节开关
-		std::unique_ptr<IntMould>    m_FluDoseLever; //剂量等级
-		std::unique_ptr<IntMould>    m_FluFMode; //透视模式:连续、脉冲、高剂量连续、高剂量脉冲
-		std::unique_ptr<FloatMould>  m_FluIntTime; //透视周期时间:单次曝光时间+距离下一次曝光的间隔时间
-		std::unique_ptr<FloatMould>  m_FluAccTime; //透视累计时间:整个透视过程中,产生X-ray的累计时间
+		//锟斤拷片锟斤拷锟斤拷
+		std::unique_ptr<FloatMould>  m_RadKV; //锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<FloatMould>  m_RadMA; //锟斤拷锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<FloatMould>  m_RadMS; //锟斤拷压时锟斤拷
+		std::unique_ptr<FloatMould>  m_RadMAS; //锟斤拷锟斤拷时锟斤拷锟�
+		std::unique_ptr<IntMould>    m_RadTechmode; //锟斤拷锟斤拷锟斤拷锟斤拷模式锟斤拷一锟姐、锟斤拷锟姐、锟斤拷锟斤拷
+		std::unique_ptr<IntMould>    m_RadFocus; //锟斤拷锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<IntMould>    m_RadAECField; //AEC取锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<IntMould>    m_RadAECFilm; //AEC锟斤拷
+		std::unique_ptr<FloatMould>  m_RadAECDensity; //AEC浓锟斤拷
+		std::unique_ptr<IntMould>    m_RadFrameRate; //锟斤拷锟叫碉拷片帧锟斤拷
+		std::unique_ptr<FloatMould>  m_PostKV; //锟截癸拷实锟绞碉拷
+		std::unique_ptr<FloatMould>  m_PostMA; //锟截癸拷实锟绞碉拷锟斤拷
+		std::unique_ptr<FloatMould>  m_PostMS; //锟截癸拷实锟斤拷时锟斤拷
+		std::unique_ptr<FloatMould>  m_PostMAS; //锟截癸拷实锟绞碉拷锟斤拷时锟斤拷锟�
+		std::unique_ptr<StringMould> m_ExpMode; //锟截癸拷模式锟斤拷锟斤拷片锟斤拷锟斤拷锟叫碉拷片锟斤拷双锟斤拷
+		std::unique_ptr<StringMould> m_EXAMMode; //锟斤拷锟侥J斤拷锟斤拷侄锟斤拷锟斤拷远锟�
+		float                        m_FocusSmall{ 0 }; //小锟斤拷丝锟竭寸(锟斤拷锟斤拷锟侥硷拷锟斤拷取锟斤拷
+		float                        m_FocusLarge{ 1 }; //锟斤拷锟剿匡拷叽纾�拷锟斤拷锟斤拷募锟斤拷锟饺★拷锟�
+		//透锟接诧拷锟斤拷
+		std::unique_ptr<FloatMould>  m_FluKV; //锟斤拷锟斤拷锟斤拷压(锟斤拷态锟斤拷锟斤拷锟斤拷锟斤拷片锟斤拷透锟接碉拷KV要锟街憋拷锟斤拷锟斤拷)
+		std::unique_ptr<FloatMould>  m_FluMA; //锟斤拷锟斤拷锟斤拷锟斤拷(锟斤拷态锟斤拷锟斤拷锟斤拷锟斤拷片锟斤拷透锟接碉拷MA要锟街憋拷锟斤拷锟斤拷)
+		std::unique_ptr<FloatMould>  m_FluMS; //锟斤拷压时锟戒(透锟接癸拷锟斤拷锟叫的碉拷锟斤拷锟斤拷锟节★拷锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<FloatMould>  m_FluMAS; //锟斤拷锟斤拷时锟斤拷锟�(锟斤拷态锟斤拷锟斤拷锟斤拷锟斤拷片锟斤拷透锟接碉拷MAS要锟街憋拷锟斤拷锟斤拷)
+		std::unique_ptr<IntMould>    m_FluPPS; //帧锟绞o拷锟斤拷锟斤拷频锟斤拷,锟斤拷锟斤拷锟叫碉拷片锟斤拷一锟斤拷锟斤拷
+		std::unique_ptr<IntMould>    m_FluABSStatus; //锟皆讹拷锟斤拷锟饺碉拷锟节匡拷锟斤拷
+		std::unique_ptr<IntMould>    m_FluDoseLever; //锟斤拷锟斤拷锟饺硷拷
+		std::unique_ptr<IntMould>    m_FluFMode; //透锟斤拷模式锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟藉、锟竭硷拷锟斤拷锟斤拷锟斤拷锟斤拷锟竭硷拷锟斤拷锟斤拷锟斤拷
+		std::unique_ptr<FloatMould>  m_FluIntTime; //透锟斤拷锟斤拷锟斤拷时锟斤拷:锟斤拷锟斤拷锟截癸拷时锟斤拷+锟斤拷锟斤拷锟斤拷一锟斤拷锟截癸拷募锟斤拷时锟斤拷
+		std::unique_ptr<FloatMould>  m_FluAccTime; //透锟斤拷锟桔硷拷时锟斤拷:锟斤拷锟斤拷透锟接癸拷锟斤拷锟叫o拷锟斤拷锟斤拷X-ray锟斤拷锟桔硷拷时锟斤拷
 
 	private:
-		RET_STATUS HWSendWaittimeCMD(char* strCommand, int lengh, int headLengh = 3); //发送"指令类型1"指令
-		RET_STATUS HWSendHBCMD(char* strCommand, int lengh, int headLengh = 3); //发送"指令类型2"指令
-		RET_STATUS HWSendWaitACKCMD(char* strCommand, int lengh, int headLengh = 3); //发送"指令类型3"指令
-		void OnCallBack(); //定义指令回调函数
-		bool StartHardwareStatusThread(); //启动轮询线程
-		static DWORD HardwareStatusThread(LPVOID pParam); //定时查询状态信
-		void FireNotify(std::string key, const int context); //向上层上报整型消
-		void FireNotify(std::string key, const float context); //向上层上报浮点型消
-		void FireNotify(std::string key, const std::string context); //向上层上报字符串型消
-		void FireErrorMessage(const bool Act, const int Code, const char* ResInfo = ""); //上报错误消
-		void FireWarnMessage(const bool Act, const int Code, const char* ResInfo = "");  //上报告警消
+		RET_STATUS HWSendWaittimeCMD(char* strCommand, int lengh, int headLengh = 3); //锟斤拷锟斤拷"指锟斤拷锟斤拷锟斤拷1"指锟斤拷
+		RET_STATUS HWSendHBCMD(char* strCommand, int lengh, int headLengh = 3); //锟斤拷锟斤拷"指锟斤拷锟斤拷锟斤拷2"指锟斤拷
+		RET_STATUS HWSendWaitACKCMD(char* strCommand, int lengh, int headLengh = 3); //锟斤拷锟斤拷"指锟斤拷锟斤拷锟斤拷3"指锟斤拷
+		void OnCallBack(); //锟斤拷锟斤拷指锟斤拷氐锟斤拷锟斤拷锟�
+		bool StartHardwareStatusThread(); //锟斤拷锟斤拷锟斤拷询锟竭筹拷
+		static void HardwareStatusThread(CGEN_DEV_IDETEC_Almax* pParam); //锟斤拷时锟斤拷询状态锟斤拷
+		void FireNotify(std::string key, const int context); //锟斤拷锟较诧拷锟较憋拷锟斤拷锟斤拷锟斤拷
+		void FireNotify(std::string key, const float context); //锟斤拷锟较诧拷锟较憋拷锟斤拷锟斤拷锟斤拷锟斤拷
+		void FireNotify(std::string key, const std::string context); //锟斤拷锟较诧拷锟较憋拷锟街凤拷锟斤拷锟斤拷锟斤拷
+		void FireErrorMessage(const bool Act, const int Code, const char* ResInfo = ""); //锟较憋拷锟斤拷锟斤拷锟斤拷
+		void FireWarnMessage(const bool Act, const int Code, const char* ResInfo = "");  //锟较憋拷锟芥警锟斤拷
 
 	private:
-		callBackFun                        m_funV2DynamicCallBackFun{ nullptr };//V2动态消息处理回调
-		HANDLE                             m_pHardwareStatusThread;          //轮询线程句柄
-		atomic<bool>                       m_bExpEnable;	                 //曝光使能
-		EnSYNMode                          m_bExpSYN{ EnSYNMode::EXPOSURE_SYNMODE_HARDWARE_SYNBOX }; //曝光同步:软、
-		atomic<bool>                       m_bSoftExpPermit{ 0 };	         //软曝光确认
-		std::unique_ptr<nsDetail::MSGUnit> m_MSGUnit;                        //错误消息处理类
-		std::unique_ptr <IOEventCenter>    m_EventCenter;                    //设置消息上报Center
+		callBackFun                        m_funV2DynamicCallBackFun{ nullptr };//V2锟斤拷态锟斤拷息锟斤拷锟斤拷锟截碉拷
+		std::thread                        m_pHardwareStatusThread;          //锟斤拷询锟竭程撅拷锟�
+		atomic<bool>                       m_bExpEnable;	                 //锟截癸拷使锟斤拷
+		EnSYNMode                          m_bExpSYN{ EnSYNMode::EXPOSURE_SYNMODE_HARDWARE_SYNBOX }; //锟截癸拷同锟斤拷:锟斤拷锟斤拷
+		atomic<bool>                       m_bSoftExpPermit{ 0 };	         //锟斤拷锟截癸拷确锟斤拷
+		std::unique_ptr<nsDetail::MSGUnit> m_MSGUnit;                        //锟斤拷锟斤拷锟斤拷息锟斤拷锟斤拷锟斤拷
+		std::unique_ptr <IOEventCenter>    m_EventCenter;                    //锟斤拷锟斤拷锟斤拷息锟较憋拷Center
 		int                                m_IPM{ 0 };
 		int                                m_IPF{ 0 };
 		int                                m_IPL{ 0 };

+ 5 - 7
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/framework.h

@@ -1,9 +1,5 @@
 #pragma once
 
-#define WIN32_LEAN_AND_MEAN             // 从 Windows 头文件中排除极少使用的内容
-// Windows 头文件
-#include <windows.h>
-
 namespace CCOS
 {
 	namespace Dev
@@ -12,7 +8,9 @@ namespace CCOS
 	}
 }
 
+// Linux兼容的导出定义
+#define EXPORT_API __attribute__((visibility("default")))
 
-extern "C"  __declspec(dllexport) CCOS::Dev::IODriver * __cdecl GetIODriver();
-extern "C"   __declspec(dllexport) CCOS::Dev::IODriver * __cdecl CreateIODriver();
-//extern "C"  __declspec(dllexport) int __cdecl GetDeviceManager ();
+extern "C" EXPORT_API CCOS::Dev::IODriver* GetIODriver();
+extern "C" EXPORT_API CCOS::Dev::IODriver* CreateIODriver();
+//extern "C" EXPORT_API int GetDeviceManager();

+ 19 - 11
Generator/IDETEC/CCOS.Dev.Generator.IDETEC_Almax/stdafx.h

@@ -9,13 +9,13 @@
 #ifndef PCH_H
 #define PCH_H
 
-// 添加要在此处预编译的标头
-#include "targetver.h"
-
-#define WIN32_LEAN_AND_MEAN             // 从 Windows 头文件中排除极少使用的内容
-// Windows 头文件
+// C++ 标准库头文件
 #include <mutex>
 #include <map>
+#include <thread>
+#include <atomic>
+#include <condition_variable>
+#include <chrono>
 
 //V3需要用到的公共定义
 #include "CcosGeneralDefine_V3.h"
@@ -29,13 +29,21 @@
 #include "Log4CPP.TLSLog.Tracing.hpp"
 #include "mLog.Log4CPP.hpp"
 
-extern HMODULE hMyModule;
+// Linux兼容的导出定义
+#define _CCOS_GEN_IDETEC_Almax_API __attribute__((visibility("default")))
 
-#ifdef CCOS_GEN_IDETEC_Almax_EXPORTS
-#define _CCOS_GEN_IDETEC_Almax_API __declspec(dllexport)
-#else
-#define _CCOS_GEN_IDETEC_Almax_API __declspec(dllimport)
-#endif
+// Linux兼容的数据类型定义
+using DWORD = unsigned long;
+using LPVOID = void*;
+using BOOL = int;
+using HANDLE = void*;
+#define TRUE 1
+#define FALSE 0
+
+// Sleep函数的兼容实现
+inline void Sleep(unsigned int milliseconds) {
+	std::this_thread::sleep_for(std::chrono::milliseconds(milliseconds));
+}
 
 //设置相关常量
 #define msTimeOut_Lock      500 //通讯接口锁定时间