private void barButton_Setup_ItemClick(object sender, ItemClickEventArgs e) { //采样版调试 if (e.Item.Name == nameof(barButton_Debug) || e.Item.Name == nameof(ToolButton_Debug)) { var theApp = CETCManagerApp.Instance; switch (theApp.m_nLinkStatus) { case 0: { IDD_ETC_SEARCH pageOptionETC = new IDD_ETC_SEARCH(); if (pageOptionETC.ShowDialog() == DialogResult.OK) { theApp.m_ETETC.m_nComID = pageOptionETC.GetComID(); if (pageOptionETC.m_IsHaveETC) { theApp.m_nLinkStatus = 1; m_strDeviceName = pageOptionETC.m_strDeviceName; OpenETCDevice(); } else { m_strDeviceName = ""; theApp.m_nLinkStatus = 2; // 选择了型号,但是没有设备。 } main_TempChart.CreateAnalyseChart(); } else { m_strDeviceName = ""; theApp.m_nLinkStatus = 0; } } break; case 1: { // TODO: 在此添加命令处理程序代码 m_nCommandType = 2; theApp.m_IsTestCommand = true; IDD_OPTION_ETC pageOptionETC = new IDD_OPTION_ETC(); if (pageOptionETC.ShowDialog() == DialogResult.OK) { m_nCommandType = 2; theApp.m_nLinkStatus = 1; if (pageOptionETC.SampleRate == 0) { theApp.m_ETETC.m_nSampleRate = 1; } else if (pageOptionETC.SampleRate == 1) { theApp.m_ETETC.m_nSampleRate = 2; } else if (pageOptionETC.SampleRate == 2) { theApp.m_ETETC.m_nSampleRate = 5; } else if (pageOptionETC.SampleRate == 3) { theApp.m_ETETC.m_nSampleRate = 10; } else if (pageOptionETC.SampleRate == 4) { theApp.m_ETETC.m_nSampleRate = 20; } else { theApp.m_ETETC.m_nSampleRate = 20; } theApp.m_pETETCStage.m_nSampleRate = theApp.m_ETETC.m_nSampleRate; } theApp.m_IsTestCommand = false; } break; case 2: { new BoxMsg("采样板没有连接,请确认采样板已经连接上USB端口", "提示").ShowDialog(); } break; } } //产品管理 else if (e.Item.Name == nameof(barButton_ProductManager)) { IDD_OPTION_PRODUCT dlg = new IDD_OPTION_PRODUCT(); //MultiLanguage.LoadLanguage(dlg, typeof(IDD_OPTION_REFLOWER)); dlg.ShowDialog(); } //回流炉管理 else if (e.Item.Name == nameof(barButton_ReflowManager)) { IDD_OPTION_REFLOWER iDD_OPTION_REFLOWER = new IDD_OPTION_REFLOWER(); MultiLanguage.LoadLanguage(iDD_OPTION_REFLOWER, typeof(IDD_OPTION_REFLOWER)); if (iDD_OPTION_REFLOWER.ShowDialog() == DialogResult.OK) { main_TempChart.CreateAnalyseChart(); RefreshPanes(true); } } //简体中文 else if (e.Item.Name == nameof(barButton_LanguageCHS)) { dockManager1.BeginUpdate(); main_DataManagement.MaximumSize = new Size(272, 1080); //修改默认语言 MultiLanguage.SetDefaultLanguage("zh-CN"); //对所有打开的窗口重新加载语言 foreach (Form form in Application.OpenForms) { LoadAll(form); } dockPanelManagement.Size = main_DataManagement.MaximumSize; dockManager1.EndUpdate(); } //繁体中文 else if (e.Item.Name == nameof(barButton_LanguageCHT)) { dockManager1.BeginUpdate(); main_DataManagement.MaximumSize = new Size(272, 1080); //修改默认语言 MultiLanguage.SetDefaultLanguage("zh-CHT"); //对所有打开的窗口重新加载语言 foreach (Form form in Application.OpenForms) { LoadAll(form); } dockPanelManagement.Size = main_DataManagement.MaximumSize; dockManager1.EndUpdate(); } //英文 else if (e.Item.Name == nameof(barButton_LanguageENG)) { dockManager1.BeginUpdate(); main_DataManagement.MaximumSize = new Size(300, 1080); //修改默认语言 MultiLanguage.SetDefaultLanguage("en-US"); //对所有打开的窗口重新加载语言 foreach (Form form in Application.OpenForms) { LoadAll(form); } dockPanelManagement.Size = main_DataManagement.MaximumSize; dockManager1.EndUpdate(); } }
private void barButton_DataManager_ItemClick(object sender, ItemClickEventArgs e) { //实时监控 if (e.Item.Name == nameof(barButton_Monitor)) { var theApp = CETCManagerApp.Instance; switch (theApp.m_nLinkStatus) { case 0: { IDD_ETC_SEARCH pageOptionETC = new IDD_ETC_SEARCH(); MultiLanguage.LoadLanguage(pageOptionETC, typeof(IDD_ETC_SEARCH)); if (pageOptionETC.ShowDialog() == DialogResult.OK) { theApp.m_ETETC.m_nComID = pageOptionETC.GetComID(); if (pageOptionETC.m_IsHaveETC) { theApp.m_nLinkStatus = 1; m_strDeviceName = pageOptionETC.m_strDeviceName; OpenETCDevice(); } else { m_strDeviceName = ""; theApp.m_nLinkStatus = 2; // 选择了型号,但是没有设备。 } main_TempChart.CreateAnalyseChart(); } else { m_strDeviceName = ""; theApp.m_nLinkStatus = 0; } } break; case 1: { IDD_OPTION_MONITOR dlg = new IDD_OPTION_MONITOR(); if (dlg.ShowDialog() == DialogResult.OK) { IDD_SETUP_PROJECTINFO pageOptionProduct = new IDD_SETUP_PROJECTINFO(); theApp.m_pETETCStage.m_ETProjectInfo.m_strMeasureTime = DateTime.Now.ToString("%y%M%d-%h%m%s"); if (pageOptionProduct.ShowDialog() == DialogResult.OK) { theApp.m_pETETCStage.LoadFileRealTime(m_strTempFile); theApp.m_pETETCStage.m_ETProjectInfo.m_strProjectName = pageOptionProduct.strProductName; theApp.m_pETETCStage.m_ETProduct.m_strName = pageOptionProduct.strProductName; theApp.m_pETETCStage.m_ETProduct.m_strProductCode = pageOptionProduct.strProductID; theApp.m_pETETCStage.m_ETProjectInfo.m_strCustomer = pageOptionProduct.strCustomor; theApp.m_pETETCStage.m_ETProduct.m_strDescription = pageOptionProduct.strProductDesc; theApp.m_pETETCStage.m_ETProjectInfo.m_strTinCream = pageOptionProduct.strTinCreamName; theApp.m_pETETCStage.m_ETTinCream.m_strName = pageOptionProduct.strTinCreamName; theApp.m_pETETCStage.m_ETTinCream.m_strManufacturers = pageOptionProduct.strTinCreamPara; theApp.m_pETETCStage.m_ETProjectInfo.m_strProductionline = pageOptionProduct.strProductLine; theApp.m_pETETCStage.m_ETProjectInfo.m_strHaiqiLongdu = pageOptionProduct.strHaiqiLongdu; theApp.m_pETETCStage.m_ETTinCream.m_strType = pageOptionProduct.strTinCream; theApp.m_pETETCStage.m_ETProjectInfo.m_strOperator = pageOptionProduct.strMeasureOperator; theApp.m_pETETCStage.m_ETProjectInfo.m_strMeasureTime = pageOptionProduct.strMeasureTime; theApp.m_pETETCStage.m_ETProjectInfo.m_strMeasureDesc = pageOptionProduct.strMeasureDesc; theApp.m_pETETCStage.m_ETProjectInfo.m_nSampleRate = pageOptionProduct.nSampleRate; theApp.m_pETETCStage.m_ETProjectInfo.m_nMeasureCount = pageOptionProduct.nMeasureCount; theApp.m_pETETCStage.m_ETProjectInfo.m_nDataTotalTime = pageOptionProduct.nMearsureLength; theApp.m_pETETCStage.m_ETProjectInfo.m_strDataDesc = pageOptionProduct.strDataDesc; RefreshPanes(true); main_TempChart.ShowChart(true); main_TempChart.CreateAnalyseChart(); main_DataManagement.RefreshProjectInfo(); } } } break; case 2: { new BoxMsg("采样板没有连接,请确认采样板已经连接上USB端口", "提示").ShowDialog(); } break; } } //数据下载 else if (e.Item.Name == nameof(barButton_Download)) { IDD_ETC_SEARCH iDD_ETC_SEARCH = new IDD_ETC_SEARCH(); MultiLanguage.LoadLanguage(iDD_ETC_SEARCH, typeof(IDD_ETC_SEARCH)); iDD_ETC_SEARCH.ShowDialog(); } //无线下载 else if (e.Item.Name == nameof(barButton_WifiDownload)) { } //项目信息 else if (e.Item.Name == nameof(barButton_Info)) { IDD_SETUP_PROJECTINFO iDD_OPTION_PROJECTINFO = new IDD_SETUP_PROJECTINFO(); MultiLanguage.LoadLanguage(iDD_OPTION_PROJECTINFO, typeof(IDD_SETUP_PROJECTINFO)); iDD_OPTION_PROJECTINFO.ShowDialog(); } }