|
@@ -604,7 +604,7 @@ class CCommDevFSM : public FSMImpl<TFSM>
|
|
|
public:
|
|
|
CCommDevFSM() : m_iInWhatPage(PageType_Init),m_bOpened(false), m_bOpening(true), m_eDevState(DEVICE_STATUS_NOT_READY),m_contiErrTimes(0), m_preUIState('X')
|
|
|
{
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
ErrorCodeEnum GetAndSplitDevErrInfo(
|
|
@@ -850,17 +850,7 @@ public:
|
|
|
void OnUIState4SetWhatPage(const char* pcszValue) {
|
|
|
if (pcszValue != NULL && strlen(pcszValue) > 0) {
|
|
|
bool trigger(false);
|
|
|
- //增加页面位置判断
|
|
|
- if (_strnicmp(pcszValue, "M", strlen("M")) == 0) {
|
|
|
- SetInWhatPage(PageType_MainPage);
|
|
|
- }
|
|
|
- else if (_strnicmp(pcszValue, "U", strlen("U")) == 0) {
|
|
|
- SetInWhatPage(PageType_UserDesktop);
|
|
|
- }
|
|
|
- else {
|
|
|
- SetInWhatPage(PageType_Other);
|
|
|
- }
|
|
|
-
|
|
|
+ UiState2WhatPage(pcszValue);
|
|
|
if (m_preUIState != pcszValue[0]) {
|
|
|
if (pcszValue[0] == 'M') {
|
|
|
trigger = true;
|
|
@@ -898,6 +888,18 @@ protected:
|
|
|
AdapterInfo m_adapterInfo;
|
|
|
DevStateEnum m_eDevState;
|
|
|
|
|
|
+ void __PostInit() override
|
|
|
+ {
|
|
|
+ if (m_pEntity != NULL) {
|
|
|
+ CSimpleStringA uiState(true);
|
|
|
+ auto err = m_pEntity->GetFunction()->GetSysVar("UIState", uiState);
|
|
|
+ DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("get uistate: %s,%s",SpStrError(err), uiState.GetData());
|
|
|
+ if (err == Error_Succeed && !uiState.IsNullOrEmpty()) {
|
|
|
+ UiState2WhatPage(uiState);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
void UpdateEntityIDIfZero()
|
|
|
{
|
|
|
if (m_entCode.dwEntityId == 0) {
|
|
@@ -986,6 +988,22 @@ protected:
|
|
|
|
|
|
virtual void OnHardwareShakeHand(CSmartPointer<ITransactionContext> pTransactionContext);
|
|
|
|
|
|
+private:
|
|
|
+
|
|
|
+ void UiState2WhatPage(const char* pcszValue)
|
|
|
+ {
|
|
|
+ //增加页面位置判断
|
|
|
+ if (_strnicmp(pcszValue, "M", strlen("M")) == 0) {
|
|
|
+ SetInWhatPage(PageType_MainPage);
|
|
|
+ }
|
|
|
+ else if (_strnicmp(pcszValue, "U", strlen("U")) == 0) {
|
|
|
+ SetInWhatPage(PageType_UserDesktop);
|
|
|
+ }
|
|
|
+ else if (_strnicmp(pcszValue, "X", strlen("X")) != 0) {
|
|
|
+ SetInWhatPage(PageType_Other);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private:
|
|
|
char m_preUIState;
|
|
|
};
|