public void execInvoke(opeOrderType opeType, WinMsg msg = null)
 {
     this.Dispatcher.BeginInvoke(new execEvent(execFunc), new object[] { opeType, msg });
 }
        public void execMsgFunc(WinMsg msg)
        {
            switch (msg.type)
            {
                case WinMsgType.msJumpHeartStart:

                    break;
                case WinMsgType.mwLinkPlcOK:
                    {
                        topPanel.sendMsgToWinFunc(msg);
                    }
                    break;
                case WinMsgType.mwLinkPlcError:
                    {
                        SCharKeyPanel.hide();
                        SUserPanel.hide();
                        SCalcPanel.hide();
                        SLoadConfFilePanel.hide();
                        SSaveConfFilePanel.hide();
                        topPanel.sendMsgToWinFunc(msg);
                    }
                    break;
                case WinMsgType.mwAccessLower:
                    {
                        topPanel.sendMsgToWinFunc(msg);
                    }
                    break;
                case WinMsgType.mwUserNull:
                    {
                        //toolPanel.getWinMsgHandle(WinMsgType.mwUserNull, null);
                        topPanel.sendMsgToWinFunc(msg);
                    }
                    break;
                case WinMsgType.mwLogInOK:
                    {
                        //toolPanel.getWinMsgHandle(WinMsgType.mwLogInOK, null);
                        //toolPanel.setCurUser();
                        SUserSetPanel.setUserState();
                        topPanel.sendMsgToWinFunc(msg);
                        recUnit ergObj = new recUnit("LogIn", DateTime.Now, recType.logType);
                        valmoWin.eventMgr.msgSave(ergObj);
                        valmoWin.refresh();
                        SUserPanel.LoginInit();
                        //if (dv.users.curUser.accessLevel >= 3)
                        //    mainPanel.interpretorPage1.getAccessFunc();
                        //Program.ctrls.mainPanel.interpretor.interpretorPage.loadOkHandle();
                    }
                    break;
                case WinMsgType.mwNoDog:
                    {
                        MessageBox.Show("请插入超级狗!");
                    }
                    break;
                case WinMsgType.mwLogOut:
                    {
                        recUnit ergObj = new recUnit("LogOut", msg.pStr, DateTime.Now, recType.logType);
                        valmoWin.eventMgr.msgSave(ergObj);
                        //toolPanel.setCurUser();
                        SUserSetPanel.setUserState();
                        topPanel.sendMsgToWinFunc(msg);
                        valmoWin.refresh();
                        //mainPanel.quitToNewPage();
                        UserCtrl.LogOut();
                    }
                    break;
                case WinMsgType.mwPidClear:
                    {

                    }
                    break;
                case WinMsgType.mwMsgNull:
                    {

                    }
                    break;
                case WinMsgType.mwJumpHeartErr:
                    {
                        topPanel.sendMsgToWinFunc(msg);
                    }
                    break;
                case WinMsgType.mwJumpHeartRetart:
                    {
                        topPanel.sendMsgToWinFunc(msg);
                    }
                    break;
                case WinMsgType.mwMsg:
                    {
                        mainPanel.overViewPage1.eventRecord.refreshEvent();
                    }
                    break;
                case WinMsgType.mwRelink:
                    linkPlcPanel.active = true;
                    topPanel.sendMsgToWinFunc(msg);
                    break;
                #region //保存信息
                case WinMsgType.mwMsgSave:
                    {
                        eventMgr.saveToFile();
                        //valmoWin.ds.SPCSave();
                    }
                    break;
                #endregion
            }
        }
        public void execFunc(opeOrderType opeType, WinMsg msg = null)
        {
            switch (opeType)
            {
                case opeOrderType.closeSysPanelShow:
                    #region 弹出系统关闭窗口
                    {
                        SSysExitPanel.show();
                        break;
                    }
                    #endregion
                case opeOrderType.lockSysPanelShow:
                    #region 弹出系统锁定窗口
                    {
                        if (valmoWin.dv.users.curUser.accessLevel > 2)
                        {
                            valmoWin.dv.users.unload();
                        }

                        SLockScreenPanel.show();
                        break;
                    }
                    #endregion
                case opeOrderType.userLoadPanelShow:
                    #region 显示用户登录界面
                    {
                        SUserPanel.show();
                        //ctrlType = 0;
                        break;
                    }
                    #endregion
                case opeOrderType.calcPanelShow:
                    #region 显示计算器界面
                    {
                        SCalcPanel.show();
                        break;
                    }
                    #endregion
                case opeOrderType.lanChange:
                    #region 显示节目语言切换
                    {
                        //SIprCtrl.refreshLan();
                        ////topPanelCtrl1.setCtrlsLanFunc();
                        foreach (nullEvent func in lstLanRefresh)
                        {
                            func();
                        }
                        break;
                    }
                    #endregion
                case opeOrderType.userSleep:
                    #region //用户进入sleep状态
                    {
                        //toolPanel.userLoad.state = nsVicoClient.ctrls.userLoadState.USERBEGINTOQUIT;
                        SUserSetPanel.state = nsVicoClient.ctrls.userLoadState.USERBEGINTOQUIT;
                        break;
                    }
                    #endregion
                case opeOrderType.userUnSleep:
                    #region //用户进入unsleep状态
                    {
                        //toolPanel.userLoad.state = nsVicoClient.ctrls.userLoadState.USERLOAD;
                        SUserSetPanel.state = nsVicoClient.ctrls.userLoadState.USERLOAD;
                        break;
                    }
                    #endregion
                case opeOrderType.winMsg:
                    #region //系统消息
                    {
                        execMsgFunc(msg);
                        break;
                    }
                    #endregion
                case opeOrderType.unitChange:
                    #region 单位切换
                    {
                        unitChangeToFunc(msg.pStr);
                        break;
                    }
                    #endregion
                case opeOrderType.clientLinkOk:
                    #region 客户端成功连接到服务器端
                    {
                        //topPanelCtrl1.helpStateOn = true;
                        //if (SHelpSerPanel != null)
                        //{

                        //    SHelpSerPanel.clientIpAddr = serObj.clientAddr;
                        //    SHelpSerPanel.clientLinkState = true;

                        //}
                    }
                    break;
                    #endregion
                case opeOrderType.clientLinkBreak:
                    #region 客户端断开连接
                    {
                        //topPanelCtrl1.helpStateOn = false;
                        //if(SHelpSerPanel != null)
                        //    SHelpSerPanel.clientLinkState = false;
                        //MessageBox.Show("client Quit!");
                    }
                    break;
                    #endregion
                case opeOrderType.ipLinkOk:
                    #region 外网连接成功
                    //topPanelCtrl1.ipLinkState = true;
                    break;
                    #endregion
                case opeOrderType.ipLinkBreak:
                    #region 外网连接断开
                    //topPanelCtrl1.ipLinkState = false;
                    break;
                    #endregion
                case opeOrderType.layoutType:
                    break;

            }
        }