private void btnConveyorIO_Click(object sender, EventArgs e) { if (Machine.Instance.Setting.MachineSelect == MachineSelection.AD19) { FormMgr.Show <Drive.Conveyor.LeadShine.Forms.IOForms.IOForm>(this); } }
private void Cms_ItemClicked(object sender, ToolStripItemClickedEventArgs e) { string itemText = e.ClickedItem.Text; if (itemText == lngResources[strIO]) { FormMgr.Show <IOForm>(this); } else if (itemText == lngResources[strConveyorIO]) { if (Machine.Instance.Setting.MachineSelect == MachineSelection.AD19) { new Drive.Conveyor.LeadShine.Forms.IOForms.IOForm().ShowDialog(); } } else if (itemText == lngResources[strScale]) { new FormWeight().Setup().ShowDialog(); } else if (itemText == lngResources[strHeight]) { new DialogHeight().ShowDialog(); } else if (itemText == lngResources[strHeater]) { new FormThermostat().ShowDialog(); } else if (itemText == lngResources[strCamera]) { new TriggerDemo().ShowDialog(); //new StatisticsForm().ShowDialog(); } }
/// <summary> /// 全局数据终止任务。 /// </summary> /// <returns> /// 异步任务运行状态。 /// </returns> public static async Task Terminate() { await ThreadMgr.Terminate(); await FormMgr.Terminate(); Buffer.Clear(); }
public void ShowAlarms(bool reShow = false) { if (reShow) { FormMgr.GetForm <AlarmForm>().Visible = false; } if (FormMgr.GetForm <AlarmForm>().Visible) { return; } FormMgr.GetForm <AlarmForm>().AddControl(this.alarmControl).Show(this); }
private void BeginBroadcastRunning() { this.BeginInvoke(new Action(() => { if (Machine.Instance.Valve1.RunMode == Drive.ValveSystem.ValveRunMode.Look || Machine.Instance.Valve1.RunMode == Drive.ValveSystem.ValveRunMode.InspectDot) { FormMgr.Show <CameraForm>(this); } MsgCenter.Broadcast(MsgType.RUNNING, this, null); })); }
private async void ThisAddIn_Startup(object sender, System.EventArgs e) { TaskPaneDict = new Dictionary <PowerPoint.DocumentWindow, CustomTaskPane>(); Rigel.PluginDir = Regditer.GetValue(Regditer.RootKey.CurrentUser, Rigel.UserRegKey, "InstallPath"); Rigel.UserName = Regditer.GetValue(Regditer.RootKey.CurrentUser, Rigel.UserRegKey, "UserName"); Rigel.UserToken = Regditer.GetValue(Regditer.RootKey.CurrentUser, Rigel.UserRegKey, "UserToken"); /*if(String.IsNullOrEmpty(Rigel.PluginDir)) * { * PromptBox.Error("没有找到安装目录!"); * }*/ //Rigel.PluginDir += "/"; Rigel.InitWorkConfig(); FormShower = new FormMgr(new IntPtr(this.Application.HWND)); App.ResourceType = ResourceType.None; this.Application.WindowActivate += WindowActivate_Event; Rigel.PluginVersion = "1.0.0.25"; var aaaa = System.Reflection.Assembly.GetExecutingAssembly(); if (ApplicationDeployment.IsNetworkDeployed) { try { ApplicationDeployment applicationDeployment = ApplicationDeployment.CurrentDeployment; Logger.LogInfo("UpdatedVersion:" + applicationDeployment.UpdatedVersion.ToString()); Logger.LogInfo("CurrentVersion" + applicationDeployment.CurrentVersion.ToString()); Rigel.PluginVersion = applicationDeployment.CurrentVersion.ToString(); } catch (Exception ex) { Console.WriteLine(ex.Message); } } VSTOUpdater.CheckUpdate().Wait(); /*if (VSTOUpdater.NeedUpdate) * { * UpdateWidget updateWidget = new UpdateWidget(); * updateWidget.setNeedUpdate(VSTOUpdater.NeedUpdate); * updateWidget.setVersion(Rigel.PluginVersion, VSTOUpdater.ServerVersion); * VSTOUpdater.UpdateLog.TryGetValue("slogan", out string slogan); * VSTOUpdater.UpdateLog.TryGetValue("content", out string content); * updateWidget.setInfo(slogan, content); * DialogResult result = ThisAddIn.FormShower.ShowDialog(updateWidget); * if (result == DialogResult.OK) * { * VSTOUpdater.Update(); ; * } * }*/ }
private void BtnCamera_Click(object sender, EventArgs e) { FormMgr.Show <CameraForm>(this); }
private void BtnJog_Click(object sender, EventArgs e) { FormMgr.Show <JogForm>(this); FormMgr.GetForm <JogForm>().UpdateUI(); }
public void HandleMsg(string msgName, IMsgSender sender, params object[] args) { // 更新硬件信息 if (msgName == MachineMsg.SETUP_INFO) { OnSetupInfo(); } // 加载程序 else if (msgName == Constants.MSG_LOAD_PROGRAM) { string programPath = args[0] as string; OnLoadProgram(programPath); } // 退出AFM else if (msgName == MsgType.EXIT) { this.Close(); } // 进入主界面 else if (msgName == MsgType.ENTER_MAIN) { OnEnterMainPage(); } // 进入编程界面 else if (msgName == MsgType.ENTER_EDIT) { OnEnterEditPage(); } // 初始化相机 else if (msgName == MachineMsg.INIT_VISION) { //this.CameraCtl.SetupCamera(Machine.Instance.Camera); //this.CameraCtl.UpdateUI(); } // 切换语言 else if (msgName == LngMsg.SWITCH_LNG) { this.Config.Lang = (LanguageType)args[0]; this.SwitchConfig(); this.SaveConfig(); //this.CameraCtl.UpdateUI(); CameraForm cameraForm = FormMgr.GetForm <CameraForm>(); JogForm jogForm = FormMgr.GetForm <JogForm>(); cameraForm.UpdateUI(); jogForm.UpdateUI(); if (!cameraForm.Visible) { cameraForm.Close(); } if (!jogForm.Visible) { jogForm.Close(); } this.ReadLanguageResources(); } //切换了用户或修改了权限表需要更新界面 else if (msgName == MsgConstants.SWITCH_USER || msgName == MsgConstants.MODIFY_ACCESS) { //只有Jog和Camera2个非模态窗口,相机界面无运行时参数,所以只需要更新Jog界面。 JogForm jogForm = FormMgr.GetForm <JogForm>(); jogForm.UpdateUI(); if (!jogForm.Visible) { jogForm.Close(); } } else if (msgName == Domain.MsgType.MSG_FIND_MARK_FIALED) { this.onFindMarkFailed(args[0] as Pattern, args[1] as Mark); } else if (msgName == Domain.MsgType.MSG_BLOBS_FIALED) { this.onFindBlobsFailed(args[0] as Blobs); } else if (msgName == Domain.MsgType.MSG_FIND_BARCODE_FIALED) { if (args[1] is Barcode) { this.onFindBarcodeFailed(args[0] as Pattern, args[1] as Barcode); } else if (args[1] is ConveyorBarcode) { this.onFindBarcodeFailed(args[0] as Pattern, args[1] as ConveyorBarcode); } } }
private void btnIO_Click(object sender, EventArgs e) { FormMgr.Show <IOForm>(this); }
private void btnGlueManage_Click(object sender, EventArgs e) { FormMgr.Show <GlueManageForm>(this); }
private void btnConveyor_Click(object sender, EventArgs e) { FormMgr.Show <ConveyorControlForm>(this); }