|
|
@@ -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;
|
|
|
}
|