private void FormMain_Load(object sender, EventArgs e) { Machine.Instance.SetupFSM(); //MsgCenter.Broadcast(LngMsg.SWITCH_LNG, this, this.Config.Lang); //显示系统配置信息 this.OnSetupInfo(); //弹出加载进度条 LoadingForm loadingForm = new LoadingForm(); MsgCenter.Broadcast(MsgType.BUSY, this, null); Task.Factory.StartNew(() => { Machine.Instance.InitAll(); this.BeginInvoke(new MethodInvoker(() => { MsgCenter.Broadcast(MsgType.IDLE, this); MsgCenter.Broadcast(MachineMsg.INIT_VISION, this); })); //setup conveyors ConveyorMsgCenter.Instance.Program.SendMessage(FluProgramMsg.轨道状态机启动); }); loadingForm.ShowDialog(); //AccountMgr.Instance.SwitchUser(AccountMgr.Instance.FindBy(RoleType.Operator.ToString())); AccountMgr.Instance.SwitchUser(AccountMgr.Instance.FindBy(RoleType.Operator.ToString())); //初始化点胶program this.InitFluProgram(); //胶水管控参数初始化 GlueManagerMgr.Instance.Setup(); GlueManagerMgr.Instance.Start(); //安装全局热键 HookHotKeyMgr.Instance.SetEnable(HotKeySortEnum.JogKey, true); HookHotKeyMgr.Instance.Setup(); this.setupHotKeys(); //阀参数数据库初始化 this.externalButtonAction(); }