Beispiel #1
0
        /// <summary>
        /// 窗口加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void VolveTestForm_Load(object sender, EventArgs e)
        {
            try
            {
                m_ChanelIDList.Clear();
                Commonfunction.GetAllChannelID(GlobalDataInterface.globalOut_SysConfig.nChannelInfo, ref m_ChanelIDList);

                for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM * ConstPreDefine.MAX_CHANNEL_NUM; i++)
                {
                    tempExitInfo[i] = new stExitInfo(true);
                }
                for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM * ConstPreDefine.MAX_CHANNEL_NUM; i++)
                {
                    tempExitInfo[i].ToCopy(GlobalDataInterface.globalOut_ExitInfo[i]);
                }

                for (int i = 0; i < m_ChanelIDList.Count; i++)
                {
                    this.ChannelcomboBox.Items.Add(m_resourceManager.GetString("Lanelabel.Text") + string.Format(" {0}", i + 1));
                    this.ChannelSeleccomboBox.Items.Add(m_resourceManager.GetString("Lanelabel.Text") + string.Format(" {0}", i + 1));
                }
                if (m_ChanelIDList.Count > 0)
                {
                    this.ChannelcomboBox.SelectedIndex      = 0;
                    m_ChannelcomboBoxSelectedIndex          = 0;
                    this.ChannelSeleccomboBox.SelectedIndex = 0;
                    m_ChannelSeleccomboBoxSelectedIndex     = 0;
                }

                this.StartTestbutton.Text = m_resourceManager.GetString("StartTestbutton.Text");
                ExitEditors = new Control[] { OffsetnumericUpDown, DistancenumericUpDown };  //Modify by ChengSk - 20180402
                SetExitlistViewEx();
            }
            catch (Exception ex)
            {
                Trace.WriteLine("VolveTestForm中函数VolveTestForm_Load出错" + ex);
#if REALEASE
                GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数VolveTestForm_Load出错" + ex);
#endif
            }
        }
Beispiel #2
0
        /// <summary>
        /// 窗口加载
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ElectromagnetictestForm_Load(object sender, EventArgs e)
        {
            try
            {
                m_ChanelIDList.Clear();
                Commonfunction.GetAllChannelID(GlobalDataInterface.globalOut_SysConfig.nChannelInfo, ref m_ChanelIDList);

                //for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM * ConstPreDefine.MAX_CHANNEL_NUM; i++)
                //{
                //    tempExitInfo[i] = new stExitInfo(true);
                //}
                //for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM; i++)
                //{
                //    tempGlobalExitInfo[i] = new stGlobalExitInfo(true);

                //}
                //for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM * ConstPreDefine.MAX_CHANNEL_NUM; i++)
                //{
                //    tempExitInfo[i].ToCopy(GlobalDataInterface.globalOut_ExitInfo[i]);
                //}
                for (int i = 0; i < ConstPreDefine.MAX_SUBSYS_NUM; i++)
                {
                    tempGlobalExitInfo[i].ToCopy(GlobalDataInterface.globalOut_GlobalExitInfo[i]);
                }
                //GlobalDataInterface.globalOut_GlobalExitInfo.CopyTo(tempGlobalExitInfo, 0);
                //this.AllEnablingbutton.Text = m_resourceManager.GetString("StartTestbutton.Text");
                ExitEditors = new Control[] { OffsetnumericUpDown, DistancenumericUpDown };  //Modify by ChengSk - 20180402
                SetExitlistViewEx();
            }
            catch (Exception ex)
            {
                Trace.WriteLine("VolveTestForm中函数VolveTestForm_Load出错" + ex);
#if REALEASE
                GlobalDataInterface.WriteErrorInfo("VolveTestForm中函数VolveTestForm_Load出错" + ex);
#endif
            }
        }
Beispiel #3
0
        /// <summary>
        /// 确认按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OKbutton_Click(object sender, EventArgs e)
        {
            switch (LanguageSelectcomboBox.SelectedIndex)
            {
            case (int)LANGUAGE_TYPE.Chinese:
                GlobalDataInterface.selectLanguage = "zh";
                break;

            case (int)LANGUAGE_TYPE.English:
                GlobalDataInterface.selectLanguage = "en";
                break;

            case (int)LANGUAGE_TYPE.Spanish:
                GlobalDataInterface.selectLanguage = "es";
                break;

            default:
                return;
            }

            Common.Commonfunction.SetAppSetting("选择的语言", GlobalDataInterface.selectLanguage);    //Note by ChengSk - 20190926

            if (bChangeLanguageFlags == true && GlobalDataInterface.selectLanguage != strCurrentLangeage)
            {
                //MessageBox.Show("版本语言切换成功,重启软件后生效!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                DialogResult result = MessageBox.Show(LanguageContainer.LanguageSelectFormMessagebox1Text[GlobalDataInterface.selectLanguageIndex],
                                                      LanguageContainer.LanguageSelectFormMessageboxQuestionCaption[GlobalDataInterface.selectLanguageIndex],
                                                      MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result == DialogResult.Yes)
                {
                    List <int> ChanelIDList = new List <int>();
                    Commonfunction.GetAllChannelID(GlobalDataInterface.globalOut_SysConfig.nChannelInfo, ref ChanelIDList);
                    if (ChanelIDList.Count > 0)
                    {
                        if (GlobalDataInterface.global_IsTestMode)
                        {
                            GlobalDataInterface.TransmitParam(-1, (int)HC_FSM_COMMAND_TYPE.HC_CMD_DISPLAY_OFF, null);
                        }
                    }
                    Common.Commonfunction.SetAppSetting("选择的语言", GlobalDataInterface.selectLanguage); //Add by ChengSk - 20190926
                    try
                    {
                        if (GlobalDataInterface.usedSeparationLogFlags)
                        {
                            DataBaseOperation databaseOperation = new DataBaseOperation();
                            DataSet           dst = databaseOperation.GetRunningTimeInfoByStopTime("");
                            if (dst.Tables[0].Rows.Count > 0)
                            {
                                DateTime dt = DateTime.Now;
                                databaseOperation.UpdateRunningStopTime(int.Parse(dst.Tables[0].Rows[0]["ID"].ToString()), dt.ToString("HH:mm:ss"));
                            }
                        }
                    }
                    catch (Exception ex) { }

                    //Application.ExitThread();
                    //Thread thtmp = new Thread(new ParameterizedThreadStart(run));
                    //object appName = Application.ExecutablePath;
                    //Thread.Sleep(1);
                    //thtmp.Start(appName);//软件关闭重启 Add by ChengSk - 20180723

                    //Common.Commonfunction.SetAppSetting("选择的语言", GlobalDataInterface.selectLanguage); //Add by ChengSk - 20190926

                    ////方法1
                    //Application.Restart(); //软件自动重启 Modify by ChengSk - 20190926

                    //方法2
                    //开启新的实例
                    Process.Start(Application.ExecutablePath);
                    //关闭当前实例
                    Process.GetCurrentProcess().Kill();
                }
                else
                {
                    GlobalDataInterface.selectLanguage = strCurrentLangeage;     //Add by xcw - 20191031
                    Common.Commonfunction.SetAppSetting("选择的语言", GlobalDataInterface.selectLanguage);
                    this.Close();
                }
            }
            //else if(bChangeLanguageFlags == false) //Add by ChengSk - 20191104
            //{
            //    Common.Commonfunction.SetAppSetting("选择的语言", GlobalDataInterface.selectLanguage);
            //}

            ClearTxt(); //Add by xcw - 20191031
            text(GlobalDataInterface.selectLanguage);

            this.Close();
        }