|
@@ -14,7 +14,7 @@ void CGUIConsoleEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPoin
|
|
|
m_FSM.Init(this);
|
|
|
auto rc = SubscribeEntitysEvents();
|
|
|
if (rc != Error_Succeed)
|
|
|
- Dbg("subscribe MaintainWatcher event fail, 0x%x", rc);
|
|
|
+ Dbg("subscribe MaintainWatcher event fail, %s", SpStrError(rc));
|
|
|
else
|
|
|
Dbg("subscribe MaintainWatcher event succeed");
|
|
|
|
|
@@ -23,7 +23,6 @@ void CGUIConsoleEntity::OnPreStart(CAutoArray<CSimpleStringA> strArgs,CSmartPoin
|
|
|
|
|
|
void CGUIConsoleEntity::OnPreClose(EntityCloseCauseEnum eCloseCause,CSmartPointer<ITransactionContext> pTransactionContext)
|
|
|
{
|
|
|
- //m_task.Close();
|
|
|
m_FSM.PostExitEvent();
|
|
|
UnsubscribeEntitysEvents();
|
|
|
pTransactionContext->SendAnswer(Error_Succeed);
|
|
@@ -38,21 +37,21 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogI
|
|
|
const DWORD dwSysError,const DWORD dwUserCode,const DWORD dwEntityInstanceID, const WORD wEntityDevelID,
|
|
|
const CAutoArray<DWORD> &Param, const char *pszEntityName, const char *pszModuleName,const char *pszMessage)
|
|
|
{
|
|
|
- //Dbg("OnLog(entity = %s, syscode = 0x%X, usercode = 0x%X", pszEntityName, dwSysError, dwUserCode);
|
|
|
+ Dbg("OnLog(entity = %s, syscode = 0x%X, usercode = 0x%X", pszEntityName, dwSysError, dwUserCode);
|
|
|
|
|
|
if (dwUserCode == EVENT_MACHINE_COVER_OPEN) // 机盖打开
|
|
|
{
|
|
|
- Dbg("机盖打开");
|
|
|
+ Dbg("the machine cover open!!");
|
|
|
m_FSM.PostEventFIFO(new FSMEvent(CGUIConsoleFSM::Event_CoverOpen));
|
|
|
}
|
|
|
else if (dwUserCode == EVENT_MACHINE_COVER_CLOSE) // 机盖关闭
|
|
|
{
|
|
|
- Dbg("机盖关闭");
|
|
|
+ Dbg("the machine cover close.");
|
|
|
m_FSM.PostEventFIFO(new FSMEvent(CGUIConsoleFSM::Event_CoverClose));
|
|
|
}
|
|
|
else if (dwUserCode == EVENT_UKEY_INSERTED) // 证书插入
|
|
|
{
|
|
|
- Dbg("证书插入");
|
|
|
+ Dbg("the key inserted");
|
|
|
m_FSM.PostEventFIFO(new FSMEvent(CGUIConsoleFSM::Event_UKeyInserted));
|
|
|
}
|
|
|
else if ((dwUserCode == EVENT_UKEY_LOW_LEVEL) // 具有维护权
|
|
@@ -61,9 +60,9 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogI
|
|
|
bool bLowLevel = dwUserCode == EVENT_UKEY_LOW_LEVEL;
|
|
|
|
|
|
if (bLowLevel)
|
|
|
- Dbg("低级维护权限");
|
|
|
+ Dbg("lower priviledge");
|
|
|
else
|
|
|
- Dbg("高级维护权限");
|
|
|
+ Dbg("higher priviledge");
|
|
|
|
|
|
// 调用UKey接口取维护人员信息
|
|
|
m_strUserID = "";
|
|
@@ -76,6 +75,7 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogI
|
|
|
if (rc != Error_Succeed)
|
|
|
{
|
|
|
Dbg("connect to MaintainWatcher entity fail: %d", rc);
|
|
|
+ pClient->SafeDelete();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -84,7 +84,7 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogI
|
|
|
rc = pClient->GetUserInfo(req, ans, 10000);
|
|
|
if (rc != Error_Succeed)
|
|
|
{
|
|
|
- Dbg("get userinfo fail from MaintainWatcher: %d", rc);
|
|
|
+ Dbg("get userinfo fail from MaintainWatcher: %s", SpStrError(rc));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -109,10 +109,11 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogI
|
|
|
m_strAuthTime = arr2[1];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ pClient->GetFunction()->CloseSession();
|
|
|
|
|
|
- pClient->SafeDelete();
|
|
|
- pClient = NULL;
|
|
|
}
|
|
|
+ pClient = NULL;
|
|
|
|
|
|
m_strCurRight = bLowLevel ? "Low" : "High";
|
|
|
m_dwBeginTime = CSmallDateTime::GetNow();
|
|
@@ -130,13 +131,13 @@ void CGUIConsoleEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogI
|
|
|
m_strCurRight = "";
|
|
|
m_dwBeginTime = 0;
|
|
|
|
|
|
- Dbg("证书拨出");
|
|
|
+ Dbg("certificate key pull out");
|
|
|
m_FSM.PostEventFIFO(new FSMEvent(CGUIConsoleFSM::Event_UKeyPulled));
|
|
|
}
|
|
|
else if (dwUserCode == LOG_EVT_HEALTH_FIRST_ENTER_MAINPADE)
|
|
|
{
|
|
|
// IE首页打开, 关闭运行输出
|
|
|
- Dbg("IE首页加载成功,关闭输出控制台");
|
|
|
+ Dbg("IE main page has been loaded successfully, close console terminal!");
|
|
|
GetFunction()->GetPrivilegeFunction()->CloseOuputConsole();
|
|
|
}
|
|
|
}
|
|
@@ -271,7 +272,7 @@ ErrorCodeEnum CGUIConsoleEntity::AddMaterialCounter(const char *pszMaterialCode)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("连接物料服务失败");
|
|
|
+ Dbg("Connect to MaterialMgrEntity failed!");
|
|
|
rc = Error_NetBroken;
|
|
|
}
|
|
|
|
|
@@ -280,7 +281,7 @@ ErrorCodeEnum CGUIConsoleEntity::AddMaterialCounter(const char *pszMaterialCode)
|
|
|
|
|
|
if (rc == Error_Succeed)
|
|
|
{
|
|
|
- Dbg("递增物料{%s}计数成功", pszMaterialCode);
|
|
|
+ Dbg("Add material counter for %s succ.", pszMaterialCode);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -313,7 +314,7 @@ ErrorCodeEnum CGUIConsoleEntity::QueryMaterialInfo(const char *pszDeviceNo, unsi
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("连接物料服务失败");
|
|
|
+ Dbg("Connect to MaterialMgr failed!");
|
|
|
rc = Error_NetBroken;
|
|
|
}
|
|
|
|
|
@@ -340,7 +341,7 @@ ErrorCodeEnum CGUIConsoleEntity::GetMaterialCounter(const char *pszMaterial, uns
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- Dbg("连接物料服务失败");
|
|
|
+ Dbg("Connect to MaterialMgrEntity failed!");
|
|
|
rc = Error_NetBroken;
|
|
|
}
|
|
|
|
|
@@ -392,19 +393,18 @@ ErrorCodeEnum CGUIConsoleEntity::ResetMaterialCounter(const char *pszMaterial, u
|
|
|
else
|
|
|
{
|
|
|
Dbg("连接CardIssuer失败");
|
|
|
+ pClient->SafeDelete();
|
|
|
}
|
|
|
-
|
|
|
- pClient->SafeDelete();
|
|
|
- }
|
|
|
+ }
|
|
|
else
|
|
|
{
|
|
|
- rc = Error_Unexpect;
|
|
|
- Dbg("未知物料: {%s}", (const char*)strMaterialCode);
|
|
|
+ rc = Error_NoTarget;
|
|
|
+ Dbg("Unknow material code: {%s}", (const char*)strMaterialCode);
|
|
|
}
|
|
|
|
|
|
if (rc != Error_Succeed)
|
|
|
{
|
|
|
- LogError(Severity_Middle, rc, 0, CSimpleStringA::Format("重置终端计数失败: %s", SpStrError(rc)));
|
|
|
+ LogError(Severity_Middle, rc, 0, CSimpleStringA::Format("Reset teminal material counter failed: %s", SpStrError(rc)));
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
@@ -413,24 +413,27 @@ ErrorCodeEnum CGUIConsoleEntity::ResetMaterialCounter(const char *pszMaterial, u
|
|
|
if (pCnn->ConnectFromCentralSetting() && pCnn->IsConnectionOK())
|
|
|
{
|
|
|
CSystemStaticInfo sysInfo;
|
|
|
- auto rc = GetFunction()->GetSystemStaticInfo(sysInfo);
|
|
|
+ rc = GetFunction()->GetSystemStaticInfo(sysInfo);
|
|
|
assert(rc == Error_Succeed);
|
|
|
|
|
|
rc = pCnn->ResetMaterialCounter(strMaterialCode, sysInfo.strTerminalID, GetCurMaintainer(),
|
|
|
dwResetCapacity, dwUsedCounter, dwRemainCounter, pszComment);
|
|
|
pCnn->Close();
|
|
|
}
|
|
|
+ else {
|
|
|
+ rc = Error_NetBroken;
|
|
|
+ }
|
|
|
|
|
|
pCnn->DecRefCount();
|
|
|
pCnn = NULL;
|
|
|
|
|
|
if (rc == Error_Succeed)
|
|
|
{
|
|
|
- Dbg("重置物料{%s}计数成功", (const char*)strMaterialCode);
|
|
|
+ Dbg("Reset teminal material counter succ: %s", (const char*)strMaterialCode);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- LogError(Severity_Middle, rc, 0, CSimpleStringA::Format("重置后端计数失败(0x%X)", rc));
|
|
|
+ LogError(Severity_Middle, rc, 0, CSimpleStringA::Format("Reset teminal material counter from server failed:%s", SpStrError(rc)));
|
|
|
}
|
|
|
|
|
|
return rc;
|
|
@@ -457,6 +460,9 @@ ErrorCodeEnum CGUIConsoleEntity::RegistSwallowedCard(const char *pszCardNo, cons
|
|
|
rc = pCnn->RegistSwallowedCard(sysInfo.strMachineType, sysInfo.strTerminalID, pszCardNo, pszReasonCode, pszDate, pszTime, pszDeviceSciNo);
|
|
|
pCnn->Close();
|
|
|
}
|
|
|
+ else {
|
|
|
+ rc = Error_NetBroken;
|
|
|
+ }
|
|
|
|
|
|
pCnn->DecRefCount();
|
|
|
pCnn = NULL;
|
|
@@ -480,9 +486,9 @@ ErrorCodeEnum CGUIConsoleEntity::RegistSwallowedCard(const char *pszCardNo, cons
|
|
|
|
|
|
|
|
|
if (rc == Error_Succeed)
|
|
|
- Dbg("吞卡登记成功,cardno: %s, reason: %s", tempCardNo, pszReasonCode);
|
|
|
+ Dbg("Register swallow card succ,cardno: %s, reason: %s", tempCardNo, pszReasonCode);
|
|
|
else
|
|
|
- Dbg("吞卡登记失败(%s),cardno: %s, reason: %s", SpStrError(rc), tempCardNo, pszReasonCode);
|
|
|
+ Dbg("Register swallow card failed(%s),cardno: %s, reason: %s", SpStrError(rc), tempCardNo, pszReasonCode);
|
|
|
|
|
|
return rc;
|
|
|
}
|
|
@@ -533,6 +539,9 @@ ErrorCodeEnum CGUIConsoleEntity::SyncMaterialCount(const char *pszDeviceNo, DWOR
|
|
|
arrCardBoxNo, arrPsbCode, arrPsbName, arrCardInit, arrCardRemains, arrCardIssued, arrCardMixed, arrCardPercent);
|
|
|
pCnn->Close();
|
|
|
}
|
|
|
+ else {
|
|
|
+ rc = Error_NetBroken;
|
|
|
+ }
|
|
|
|
|
|
pCnn->DecRefCount();
|
|
|
pCnn = NULL;
|