Beispiel #1
0
        /// <summary>
        ///保存
        /// </summary>
        private void save()
        {
            try
            {
                string modelPath = string.Empty;

                string fileDirectry = string.Empty;

                if (CGlobalPara.SysPara.Report.ModelPath == "")
                {
                    fileDirectry = Application.StartupPath + "\\Model";
                    if (!Directory.Exists(fileDirectry))
                    {
                        Directory.CreateDirectory(fileDirectry);
                    }
                }
                else
                {
                    fileDirectry = CGlobalPara.SysPara.Report.ModelPath;
                }

                saveFiledlg.InitialDirectory = fileDirectry;
                saveFiledlg.Filter           = "HP files (*.hp)|*.hp";
                saveFiledlg.FileName         = txtModel.Text;

                if (saveFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }

                modelPath = saveFiledlg.FileName;

                CModelPara modelPara = new CModelPara();

                modelPara.Base.Model   = txtModel.Text;
                modelPara.Base.Custom  = txtCustom.Text;
                modelPara.Base.Version = txtVersion.Text;

                modelPara.Base.ReleaseName = txtReleaseName.Text;
                modelPara.Base.ReleaseDate = pickerDate.Value.Date.ToString();
                modelPara.Base.HPModel     = txtHPModel.Text;

                modelPara.Para.HpCH = hpChan.mHpChan;
                modelPara.Para.IoCH = hpChan.mIoChan;

                modelPara.Para.Step = step;

                CSerializable <CModelPara> .WriteXml(modelPath, modelPara);

                MessageBox.Show(CLanguage.Lan("机种参数保存成功."), "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #2
0
        /// <summary>
        /// 保存设置
        /// </summary>
        private void save()
        {
            try
            {
                CGlobalPara.SysPara.Dev.PlcIp        = txtPlcIP.Text;
                CGlobalPara.SysPara.Dev.IdCom        = cmbIdCom.Text;
                CGlobalPara.SysPara.Dev.TcpPort      = System.Convert.ToInt16(txtTestPort.Text);
                CGlobalPara.SysPara.Dev.TcpMode      = cmbTcpMode.SelectedIndex;
                CGlobalPara.SysPara.Dev.MonInterval  = System.Convert.ToInt16(txtMonDelay.Text);
                CGlobalPara.SysPara.Dev.IdRecordMode = cmbDbMode.SelectedIndex;
                CGlobalPara.SysPara.Dev.AteDevMax    = cmbATEMax.SelectedIndex;

                CGlobalPara.SysPara.Para.ChkHPFail     = chkHPFail.Checked;
                CGlobalPara.SysPara.Para.ChkATEFail    = chkATEFail.Checked;
                CGlobalPara.SysPara.Para.ChkNoHP       = chkNoHipot.Checked;
                CGlobalPara.SysPara.Para.ChkNoATE      = chkNoATE.Checked;
                CGlobalPara.SysPara.Para.ChkInHP       = chkInHipot.Checked;
                CGlobalPara.SysPara.Para.ChkInATE      = chkInATE.Checked;
                CGlobalPara.SysPara.Para.ChkLockFail   = chkLockFail.Checked;
                CGlobalPara.SysPara.Para.LockHPPwr     = txtLockPwr.Text;
                CGlobalPara.SysPara.Para.IdReTimes     = System.Convert.ToInt32(txtIdTimes.Text);
                CGlobalPara.SysPara.Para.ChkModel      = chkChangeModel.Checked;
                CGlobalPara.SysPara.Para.FailGoNum     = System.Convert.ToInt32(txtFailGoNum.Text);
                CGlobalPara.SysPara.Para.ChkGoPass     = chkDebugMode.Checked;
                CGlobalPara.SysPara.Para.ChkATEToGJWeb = chkATEToWeb.Checked;

                CGlobalPara.SysPara.Alarm.ChkPassRate[0]      = chkPassRate1.Checked;
                CGlobalPara.SysPara.Alarm.PassRateLimit[0]    = System.Convert.ToDouble(txtPassRateLimit1.Text) / 100;
                CGlobalPara.SysPara.Alarm.PassRateStartNum[0] = System.Convert.ToInt32(txtStartNumber1.Text);
                CGlobalPara.SysPara.Alarm.ChkPassRate[1]      = chkPassRate2.Checked;
                CGlobalPara.SysPara.Alarm.PassRateLimit[1]    = System.Convert.ToDouble(txtPassRateLimit2.Text) / 100;
                CGlobalPara.SysPara.Alarm.PassRateStartNum[1] = System.Convert.ToInt32(txtStartNumber2.Text);
                CGlobalPara.SysPara.Alarm.PassRateAlarmTime   = System.Convert.ToInt32(txtPassRateInterval.Text);
                CGlobalPara.SysPara.Alarm.ChkClrDay           = chkClrDay.Checked;
                CGlobalPara.SysPara.Alarm.ChkClrNight         = chkClrNight.Checked;
                CGlobalPara.SysPara.Alarm.ClrDayTime          = txtClrDay.Text;
                CGlobalPara.SysPara.Alarm.ClrNightTime        = txtClrNight.Text;


                CGlobalPara.SysPara.Report.ModelPath       = txtModelPath.Text;
                CGlobalPara.SysPara.Report.SaveReport      = chkSaveReport.Checked;
                CGlobalPara.SysPara.Report.ReportPath      = txtReportPath.Text;
                CGlobalPara.SysPara.Report.SaveReportTimes = System.Convert.ToDouble(txtReportSaveTimes.Text);
                CGlobalPara.SysPara.Report.DailyFolder     = txtDailyFolder.Text;

                CGlobalPara.SysPara.Mes.ChkWebSn = chkGJWeb.Checked ? 1 : 0;
                CGlobalPara.SysPara.Mes.Connect  = chkMesCon.Checked;
                CGlobalPara.SysPara.Mes.ChkStat  = chkStatMes.Checked;

                CSerializable <CSysPara> .WriteXml(CGlobalPara.SysFile, CGlobalPara.SysPara);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #3
0
        /// <summary>
        /// 打开
        /// </summary>
        private void open()
        {
            try
            {
                string modelPath    = string.Empty;
                string fileDirectry = string.Empty;
                fileDirectry = CGlobalPara.SysPara.Report.ModelPath;
                openFiledlg.InitialDirectory = fileDirectry;
                openFiledlg.Filter           = "spec files (*.pwr)|*.pwr";
                if (openFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                modelPath = openFiledlg.FileName;
                CSerializable <CModelPara> .ReadXml(modelPath, ref modelPara);

                txtModel.Text       = modelPara.Base.Model;
                txtCustom.Text      = modelPara.Base.Custom;
                txtVersion.Text     = modelPara.Base.Version;
                txtReleaseName.Text = modelPara.Base.ReleaseName;
                //pickerDate.Value = System.Convert.ToDateTime(modelPara.Base.ReleaseDate);

                cmbACV.Text  = modelPara.OutPut.ACVolt.ToString();
                txtACVL.Text = modelPara.OutPut.ACvMin.ToString();
                txtACVH.Text = modelPara.OutPut.ACvMax.ToString();

                txtVname.Text         = modelPara.OutPut.Vname;
                txtVmin.Text          = modelPara.OutPut.Vmin.ToString();
                txtVmax.Text          = modelPara.OutPut.Vmax.ToString();
                cmbMode.SelectedIndex = modelPara.OutPut.LoadMode;
                txtVon.Text           = modelPara.OutPut.LoadVon.ToString();
                txtLoadSet.Text       = modelPara.OutPut.LoadSet.ToString();
                txtLoadmin.Text       = modelPara.OutPut.LoadMin.ToString();
                txtLoadmax.Text       = modelPara.OutPut.LoadMax.ToString();
                txtVOffset.Text       = modelPara.OutPut.VOffSet.ToString();

                chkQCM.Checked = modelPara.OutPut.ChkQCM;
                cmbQCM.Text    = ((EQCM)modelPara.OutPut.QCM).ToString();
                txtQCV.Text    = modelPara.OutPut.QCV.ToString();
                chkDD.Checked  = modelPara.OutPut.ChkDD;
                chkDV1.Checked = modelPara.OutPut.ChkDG[0];
                chkDV2.Checked = modelPara.OutPut.ChkDG[1];
                chkDV3.Checked = modelPara.OutPut.ChkDG[2];
                chkDV4.Checked = modelPara.OutPut.ChkDG[3];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #4
0
        private void save()
        {
            try
            {
                CGlobalPara.SysPara.Dev.SerIP        = txtSerTcpIP.Text;
                CGlobalPara.SysPara.Dev.SerPort      = System.Convert.ToInt32(txtSerTcpPort.Text);
                CGlobalPara.SysPara.Dev.SerStat      = txtSerStatName.Text;
                CGlobalPara.SysPara.Dev.TcpMode      = cmbTcpMode.SelectedIndex;
                CGlobalPara.SysPara.Dev.Ate_Languge  = cmbATELanguage.SelectedIndex;
                CGlobalPara.SysPara.Dev.InternalTime = System.Convert.ToInt32(txtMonDelay.Text);
                CGlobalPara.SysPara.Dev.DevMax       = System.Convert.ToInt16(cmbDevMax.Text);
                CGlobalPara.SysPara.Dev.ChanMax      = System.Convert.ToInt16(cmbChanMax.Text);
                CGlobalPara.SysPara.Dev.ChkIoEnable  = chkIoEnable.Checked;
                CGlobalPara.SysPara.Dev.IoCom        = cmbIO.Text;
                CGlobalPara.SysPara.Dev.IoDelayMs    = System.Convert.ToInt32(txtIoDelayMs.Text);

                CGlobalPara.SysPara.Para.Ate_Title_Name     = txtATEPrg.Text;
                CGlobalPara.SysPara.Para.Ate_Result_Folder  = txtATEResultPath.Text;
                CGlobalPara.SysPara.Para.Ate_scanSn_Enable  = chkBarForm.Checked;
                CGlobalPara.SysPara.Para.Ate_ScanSn_Name    = txtBarFormName.Text;
                CGlobalPara.SysPara.Para.Ate_Result_Delay   = System.Convert.ToInt32(txtATEDelay.Text);
                CGlobalPara.SysPara.Para.Ate_Result_Repeats = System.Convert.ToInt32(txtATERepeats.Text);
                CGlobalPara.SysPara.Para.Ate_getImg_handler = chkImg.Checked;
                CGlobalPara.SysPara.Para.Ate_Mon            = System.Convert.ToInt32(txtATEMon.Text);
                CGlobalPara.SysPara.Para.FailNumLock        = System.Convert.ToInt16(txtFailLock.Text);
                CGlobalPara.SysPara.Para.ATE_TestData       = chkGetTestData.Checked;

                CGlobalPara.SysPara.Report.ModelPath       = txtModelPath.Text;
                CGlobalPara.SysPara.Report.SaveReport      = chkSaveReport.Checked;
                CGlobalPara.SysPara.Report.ReportPath      = txtReportPath.Text;
                CGlobalPara.SysPara.Report.SaveReportTimes = System.Convert.ToDouble(txtReportSaveTimes.Text);

                CGlobalPara.SysPara.Mes.ChkWebSn      = chkGJWeb.Checked ? 1 : 0;
                CGlobalPara.SysPara.Mes.Connect       = chkMesCon.Checked;
                CGlobalPara.SysPara.Mes.FailNoTranNum = System.Convert.ToInt16(txtFailNoTran.Text);

                CSerializable <CSysPara> .WriteXml(CGlobalPara.SysFile, CGlobalPara.SysPara);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #5
0
        /// <summary>
        /// 打开
        /// </summary>
        private void open()
        {
            try
            {
                string modelPath    = string.Empty;
                string fileDirectry = string.Empty;
                fileDirectry = CGlobalPara.SysPara.Report.ModelPath;
                openFiledlg.InitialDirectory = fileDirectry;
                openFiledlg.Filter           = "HP files (*.hp)|*.hp";
                if (openFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                modelPath = openFiledlg.FileName;

                CModelPara modelPara = new CModelPara();

                CSerializable <CModelPara> .ReadXml(modelPath, ref modelPara);

                txtModel.Text   = modelPara.Base.Model;
                txtCustom.Text  = modelPara.Base.Custom;
                txtVersion.Text = modelPara.Base.Version;

                txtReleaseName.Text = modelPara.Base.ReleaseName;

                if (modelPara.Base.ReleaseDate != null && modelPara.Base.ReleaseDate != string.Empty)
                {
                    pickerDate.Value = System.Convert.ToDateTime(modelPara.Base.ReleaseDate);
                }
                txtHPModel.Text = modelPara.Base.HPModel;

                hpChan.mHpChan = modelPara.Para.HpCH;
                hpChan.mIoChan = modelPara.Para.IoCH;

                step = modelPara.Para.Step;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #6
0
        private void save()
        {
            try
            {
                CGlobalPara.SysPara.Dev.HPCom[0]    = cmbHPCom1.Text;
                CGlobalPara.SysPara.Dev.HPCom[1]    = cmbHPCom2.Text;
                CGlobalPara.SysPara.Dev.ChkIoEnable = chkIoEnable.Checked;
                CGlobalPara.SysPara.Dev.IoCom       = cmbIoCom.Text;
                CGlobalPara.SysPara.Dev.SerIP       = txtSerIP.Text;
                CGlobalPara.SysPara.Dev.SerPort     = System.Convert.ToInt16(txtSerPort.Text);
                CGlobalPara.SysPara.Dev.SerStat     = txtSerStat.Text;
                CGlobalPara.SysPara.Dev.TcpMode     = cmbTcpMode.SelectedIndex;
                CGlobalPara.SysPara.Dev.MonInterval = System.Convert.ToInt32(txtMonDelay.Text);
                CGlobalPara.SysPara.Dev.IoDelayMs   = System.Convert.ToInt32(txtIoDelayMs.Text);
                CGlobalPara.SysPara.Dev.HPType      = (EHPType)Enum.Parse(typeof(EHPType), cmbHPType.Text);
                CGlobalPara.SysPara.Dev.HPBaud      = txtHpBaud.Text;
                CGlobalPara.SysPara.Dev.HPChanMax   = System.Convert.ToInt16(cmbHPChanMax.Text);
                CGlobalPara.SysPara.Dev.HPDevMax    = System.Convert.ToInt16(cmbHPMax.Text);

                CGlobalPara.SysPara.Para.ChkAutoModel = chkAutoModel.Checked;
                CGlobalPara.SysPara.Para.ChkImpPrg    = chkImpPrg.Checked;
                CGlobalPara.SysPara.Para.ChkReTest    = chkReTest.Checked;

                CGlobalPara.SysPara.Report.ModelPath       = txtModelPath.Text;
                CGlobalPara.SysPara.Report.SaveReport      = chkSaveReport.Checked;
                CGlobalPara.SysPara.Report.ReportPath      = txtReportPath.Text;
                CGlobalPara.SysPara.Report.SaveReportTimes = System.Convert.ToDouble(txtReportSaveTimes.Text);

                CGlobalPara.SysPara.Mes.ChkWebSn      = chkGJWeb.Checked ? 1 : 0;
                CGlobalPara.SysPara.Mes.Connect       = chkMesCon.Checked;
                CGlobalPara.SysPara.Mes.FailNoTranNum = System.Convert.ToInt16(txtFailNoTran.Text);

                CSerializable <CSysPara> .WriteXml(CGlobalPara.SysFile, CGlobalPara.SysPara);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #7
0
        /// <summary>
        ///保存
        /// </summary>
        private void save()
        {
            try
            {
                string modelPath    = string.Empty;
                string fileDirectry = string.Empty;
                if (CGlobalPara.SysPara.Report.ModelPath == "")
                {
                    fileDirectry = Application.StartupPath + "\\Model";
                    if (!Directory.Exists(fileDirectry))
                    {
                        Directory.CreateDirectory(fileDirectry);
                    }
                }
                else
                {
                    fileDirectry = CGlobalPara.SysPara.Report.ModelPath;
                }
                saveFiledlg.InitialDirectory = fileDirectry;
                saveFiledlg.Filter           = "Spec files (*.pwr)|*.pwr";
                saveFiledlg.FileName         = txtModel.Text;
                if (saveFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                modelPath = saveFiledlg.FileName;

                modelPara.Base.Model       = txtModel.Text;
                modelPara.Base.Custom      = txtCustom.Text;
                modelPara.Base.Version     = txtVersion.Text;
                modelPara.Base.ReleaseName = txtReleaseName.Text;
                modelPara.Base.ReleaseDate = pickerDate.Value.Date.ToString();

                modelPara.OutPut.ACVolt = System.Convert.ToInt16(cmbACV.Text);
                modelPara.OutPut.ACvMin = System.Convert.ToDouble(txtACVL.Text);
                modelPara.OutPut.ACvMax = System.Convert.ToDouble(txtACVH.Text);

                modelPara.OutPut.Vname    = txtVname.Text;
                modelPara.OutPut.Vmin     = System.Convert.ToDouble(txtVmin.Text);
                modelPara.OutPut.Vmax     = System.Convert.ToDouble(txtVmax.Text);
                modelPara.OutPut.LoadMode = cmbMode.SelectedIndex;
                modelPara.OutPut.LoadVon  = System.Convert.ToDouble(txtVon.Text);
                modelPara.OutPut.LoadSet  = System.Convert.ToDouble(txtLoadSet.Text);
                modelPara.OutPut.LoadMin  = System.Convert.ToDouble(txtLoadmin.Text);
                modelPara.OutPut.LoadMax  = System.Convert.ToDouble(txtLoadmax.Text);
                modelPara.OutPut.VOffSet  = System.Convert.ToDouble(txtVOffset.Text);

                modelPara.OutPut.ChkQCM   = chkQCM.Checked;
                modelPara.OutPut.QCM      = (int)((EQCM)Enum.Parse(typeof(EQCM), cmbQCM.Text));
                modelPara.OutPut.QCV      = System.Convert.ToDouble(txtQCV.Text);
                modelPara.OutPut.ChkDD    = chkDD.Checked;
                modelPara.OutPut.ChkDG[0] = chkDV1.Checked;
                modelPara.OutPut.ChkDG[1] = chkDV2.Checked;
                modelPara.OutPut.ChkDG[2] = chkDV3.Checked;
                modelPara.OutPut.ChkDG[3] = chkDV4.Checked;

                CSerializable <CModelPara> .WriteXml(modelPath, modelPara);

                MessageBox.Show(CLanguage.Lan("机种参数保存成功."), "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #8
0
 /// <summary>
 /// 加载系统参数
 /// </summary>
 public static void LoadSysXml()
 {
     CSerializable <CSysPara> .ReadXml(SysFile, ref SysPara);
 }
Beispiel #9
0
        private void save()
        {
            try
            {
                CGlobalPara.SysPara.Dev.PlcIP       = txtPlcIP.Text;
                CGlobalPara.SysPara.Dev.IdCom       = cmbIdCom.Text;
                CGlobalPara.SysPara.Dev.EloadCom    = cmbEloadCom.Text;
                CGlobalPara.SysPara.Dev.FCMBCom     = cmbFCMB.Text;
                CGlobalPara.SysPara.Dev.MeterCom    = cmbMutiCom.Text;
                CGlobalPara.SysPara.Dev.SnCom[0]    = cmbSnCom1.Text;
                CGlobalPara.SysPara.Dev.SnCom[1]    = cmbSnCom2.Text;
                CGlobalPara.SysPara.Dev.SnMode      = cmbScanner.Text;
                CGlobalPara.SysPara.Dev.SnBaud      = txtSnBaud.Text;
                CGlobalPara.SysPara.Dev.MonInterval = System.Convert.ToInt16(txtScanTimes.Text);

                CGlobalPara.SysPara.Para.AcDelayTimes = System.Convert.ToInt32(txtACDelay.Text);
                CGlobalPara.SysPara.Para.ReTestTimes  = System.Convert.ToInt32(txtReTestTimes.Text);
                CGlobalPara.SysPara.Para.ReTestDelay  = System.Convert.ToInt32(txtReDelayMs.Text);
                CGlobalPara.SysPara.Para.IdReTimes    = System.Convert.ToInt32(txtIdTimes.Text);
                CGlobalPara.SysPara.Para.ReadSnTimes  = System.Convert.ToInt32(txtReadSnNum.Text);
                CGlobalPara.SysPara.Para.ChkFailWait  = chkFailWait.Checked;
                CGlobalPara.SysPara.Para.ChkVSenor    = chkVSenor.Checked;
                CGlobalPara.SysPara.Para.ChkACON      = chkACON.Checked;
                CGlobalPara.SysPara.Para.ChkIdleLoad  = chkIdleLoad.Checked;
                CGlobalPara.SysPara.Para.IdleLoad     = System.Convert.ToDouble(txtIdleLoad.Text);

                CGlobalPara.SysPara.Alarm.StatTimes         = System.Convert.ToInt32(txtStatTimes.Text);
                CGlobalPara.SysPara.Alarm.StatFailTimes     = System.Convert.ToInt32(txtStatFailNum.Text);
                CGlobalPara.SysPara.Alarm.StatPassRate      = System.Convert.ToDouble(txtStatPassRate.Text);
                CGlobalPara.SysPara.Alarm.FixtureTimes      = System.Convert.ToInt32(txtFixTimes.Text);
                CGlobalPara.SysPara.Alarm.FixFailTimes      = System.Convert.ToInt32(txtFixFailTimes.Text);
                CGlobalPara.SysPara.Alarm.FixPassRate       = System.Convert.ToInt32(txtFixPassRate.Text);
                CGlobalPara.SysPara.Alarm.ChkPassRate       = chkPassRate.Checked;
                CGlobalPara.SysPara.Alarm.PassRateLimit     = System.Convert.ToDouble(txtPassRateLimit.Text) / 100;
                CGlobalPara.SysPara.Alarm.PassRateStartNum  = System.Convert.ToInt32(txtStartNumber.Text);
                CGlobalPara.SysPara.Alarm.PassRateAlarmTime = System.Convert.ToInt32(txtPassRateInterval.Text);
                CGlobalPara.SysPara.Alarm.ChkClrDay         = chkClrDay.Checked;
                CGlobalPara.SysPara.Alarm.ChkClrNight       = chkClrNight.Checked;
                CGlobalPara.SysPara.Alarm.ClrDayTime        = txtClrDay.Text;
                CGlobalPara.SysPara.Alarm.ClrNightTime      = txtClrNight.Text;

                CGlobalPara.SysPara.Report.ModelPath       = txtModelPath.Text;
                CGlobalPara.SysPara.Report.SaveReport      = chkSaveReport.Checked;
                CGlobalPara.SysPara.Report.SaveReportTimes = System.Convert.ToInt16(txtSaveTimes.Text);
                CGlobalPara.SysPara.Report.ReportPath      = txtReportPath.Text;
                CGlobalPara.SysPara.Report.DailyFolder     = txtDailyFolder.Text;

                CGlobalPara.SysPara.Mes.ChkWebSn      = chkGJWeb.Checked ? 1 : 0;
                CGlobalPara.SysPara.Mes.Connect       = chkMesCon.Checked;
                CGlobalPara.SysPara.Mes.TranDataToMes = chkTranData.Checked;
                CGlobalPara.SysPara.Mes.SnMode        = (ESnMode)cmbSnMode.SelectedIndex;
                CGlobalPara.SysPara.Mes.SnLen         = System.Convert.ToInt16(txtSnLen.Text);
                CGlobalPara.SysPara.Mes.SnSpec        = txtSnSpec.Text;
                CGlobalPara.SysPara.Mes.ChkSnBI       = chkBISn.Checked;
                CGlobalPara.SysPara.Mes.ChkSnHP       = chkHPSn.Checked;
                CGlobalPara.SysPara.Mes.ChkSnATE      = chkATESn.Checked;

                CSerializable <CSysPara> .WriteXml(CGlobalPara.SysFile, CGlobalPara.SysPara);
            }
            catch (Exception)
            {
                throw;
            }
        }
Beispiel #10
0
        /// <summary>
        ///保存
        /// </summary>
        private void save()
        {
            try
            {
                string modelPath    = string.Empty;
                string fileDirectry = string.Empty;
                if (CGlobalPara.SysPara.Report.ModelPath == "")
                {
                    fileDirectry = Application.StartupPath + "\\Model";
                    if (!Directory.Exists(fileDirectry))
                    {
                        Directory.CreateDirectory(fileDirectry);
                    }
                }
                else
                {
                    fileDirectry = CGlobalPara.SysPara.Report.ModelPath;
                }
                saveFiledlg.InitialDirectory = fileDirectry;
                saveFiledlg.Filter           = "BI files (*.bi)|*.bi";
                saveFiledlg.FileName         = txtModel.Text;
                if (saveFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                modelPath = saveFiledlg.FileName;

                modelPara.Base.Model       = txtModel.Text;
                modelPara.Base.Custom      = txtCustom.Text;
                modelPara.Base.Version     = txtVersion.Text;
                modelPara.Base.ReleaseName = txtReleaseName.Text;
                modelPara.Base.ReleaseDate = pickerDate.Value.Date.ToString();

                modelPara.Temp.TSet    = System.Convert.ToDouble(txtTSet.Text);
                modelPara.Temp.TLP     = System.Convert.ToDouble(txtTLP.Text);
                modelPara.Temp.THP     = System.Convert.ToDouble(txtTHP.Text);
                modelPara.Temp.THAlarm = System.Convert.ToDouble(txtHAlarm.Text);
                modelPara.Temp.TOPEN   = System.Convert.ToDouble(txtTOpen.Text);
                modelPara.Temp.TCLOSE  = System.Convert.ToDouble(txtTClose.Text);

                modelPara.Para.BITime      = System.Convert.ToDouble(txtBITime.Text);
                modelPara.Para.ACV         = System.Convert.ToInt32(cmbACV.Text);
                modelPara.Para.QCV_Type    = (int)((EQCM)Enum.Parse(typeof(EQCM), cmbQCVType.Text));
                modelPara.Para.OutPut_Chan = System.Convert.ToInt32(cmbDCVNum.Text);
                modelPara.Para.OutPut_Num  = _outPutNum;
                modelPara.Para.OnOff_Num   = _onOffNum;
                modelPara.Para.AC_110V     = System.Convert.ToInt16(txt110V.Text);
                modelPara.Para.AC_220V     = System.Convert.ToInt16(txt220V.Text);
                modelPara.Para.AC_264V     = System.Convert.ToInt16(txt250V.Text);
                modelPara.Para.AC_380V     = System.Convert.ToInt16(txt360V.Text);

                modelPara.Para.VOffset = System.Convert.ToDouble(txtVOffSet.Text);

                for (int i = 0; i < modelPara.Para.OutPut_Num; i++)
                {
                    modelPara.OutPut[i] = _outPut[i].Clone();
                }

                for (int i = 0; i < modelPara.Para.OnOff_Num; i++)
                {
                    modelPara.OnOff[i] = _onOff[i].Clone();
                }

                CSerializable <CModelPara> .WriteXml(modelPath, modelPara);

                MessageBox.Show(CLanguage.Lan("机种参数保存成功."), CLanguage.Lan("机种保存"), MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #11
0
        /// <summary>
        /// 打开
        /// </summary>
        private void open()
        {
            try
            {
                string modelPath    = string.Empty;
                string fileDirectry = string.Empty;
                fileDirectry = CGlobalPara.SysPara.Report.ModelPath;
                openFiledlg.InitialDirectory = fileDirectry;
                openFiledlg.Filter           = "BI files (*.bi)|*.bi";
                if (openFiledlg.ShowDialog() != DialogResult.OK)
                {
                    return;
                }
                modelPath = openFiledlg.FileName;
                CSerializable <CModelPara> .ReadXml(modelPath, ref modelPara);

                txtModel.Text       = modelPara.Base.Model;
                txtCustom.Text      = modelPara.Base.Custom;
                txtVersion.Text     = modelPara.Base.Version;
                txtReleaseName.Text = modelPara.Base.ReleaseName;
                //pickerDate.Value = System.Convert.ToDateTime(modelPara.Base.ReleaseDate);

                txtTSet.Text   = modelPara.Temp.TSet.ToString();
                txtTLP.Text    = modelPara.Temp.TLP.ToString();
                txtTHP.Text    = modelPara.Temp.THP.ToString();
                txtHAlarm.Text = modelPara.Temp.THAlarm.ToString();
                txtTOpen.Text  = modelPara.Temp.TOPEN.ToString();
                txtTClose.Text = modelPara.Temp.TCLOSE.ToString();

                txtBITime.Text  = modelPara.Para.BITime.ToString();
                cmbACV.Text     = modelPara.Para.ACV.ToString();
                cmbDCVNum.Text  = modelPara.Para.OutPut_Chan.ToString();
                cmbQCVType.Text = ((EQCM)modelPara.Para.QCV_Type).ToString();
                txt110V.Text    = modelPara.Para.AC_110V.ToString();
                txt220V.Text    = modelPara.Para.AC_220V.ToString();
                txt250V.Text    = modelPara.Para.AC_264V.ToString();
                txt360V.Text    = modelPara.Para.AC_380V.ToString();

                txtVOffSet.Text = modelPara.Para.VOffset.ToString();

                _outPutNum = modelPara.Para.OutPut_Num;

                _outPutChan = modelPara.Para.OutPut_Chan;

                _onOffNum = modelPara.Para.OnOff_Num;

                for (int i = 0; i < modelPara.Para.OutPut_Num; i++)
                {
                    _outPut[i] = modelPara.OutPut[i].Clone();
                }

                for (int i = 0; i < modelPara.Para.OnOff_Num; i++)
                {
                    _onOff[i] = modelPara.OnOff[i].Clone();
                }

                refreshOutPutView();

                refreshOnOffView();

                refreshChart();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Beispiel #12
0
        private void save()
        {
            try
            {
                CGlobalPara.SysPara.Dev.Bi_plc       = txtBIPLC.Text;
                CGlobalPara.SysPara.Dev.MonCom[0]    = cmbMonCom1.Text;
                CGlobalPara.SysPara.Dev.MonCom[1]    = cmbMonCom2.Text;
                CGlobalPara.SysPara.Dev.MonCom[2]    = cmbMonCom3.Text;
                CGlobalPara.SysPara.Dev.MonCom[3]    = cmbMonCom4.Text;
                CGlobalPara.SysPara.Dev.MonCom[4]    = cmbMonCom5.Text;
                CGlobalPara.SysPara.Dev.ErsCom[0]    = cmbERSCom1.Text;
                CGlobalPara.SysPara.Dev.ErsBaud      = txtERSBaud.Text;
                CGlobalPara.SysPara.Dev.MonInterval  = System.Convert.ToInt16(txtMonInterval.Text);
                CGlobalPara.SysPara.Dev.VoltPos      = cmbVoltPos.SelectedIndex;
                CGlobalPara.SysPara.Dev.CtrlACMode   = (ECtrlACMode)cmbCtrlACMode.SelectedIndex;
                CGlobalPara.SysPara.Dev.CtrlTimeMode = (ECtrlTimeMode)cmbRunTimeMode.SelectedIndex;
                CGlobalPara.SysPara.Dev.ChkFCMBVer   = chkFMCBVer.Checked;
                CGlobalPara.SysPara.Dev.FCMBVer      = txtFCMBVer.Text;
                CGlobalPara.SysPara.Dev.FCMBQCI      = System.Convert.ToDouble(txtQCI.Text);

                CGlobalPara.SysPara.Para.ChkNoJugdeCur  = chkNoJugdeCur.Checked;
                CGlobalPara.SysPara.Para.ChkHandIn      = chkHandIn.Checked;
                CGlobalPara.SysPara.Para.ChkNoLockFail  = chkNoLockFail.Checked;
                CGlobalPara.SysPara.Para.ChkForbitOut   = chkForbitOut.Checked;
                CGlobalPara.SysPara.Para.VHP            = System.Convert.ToDouble(txtVHP.Text);
                CGlobalPara.SysPara.Para.VLP            = System.Convert.ToDouble(txtVLP.Text);
                CGlobalPara.SysPara.Para.ILP            = System.Convert.ToDouble(txtILP.Text);
                CGlobalPara.SysPara.Para.IHP            = System.Convert.ToDouble(txtIHP.Text);
                CGlobalPara.SysPara.Para.ERSVon         = System.Convert.ToDouble(txtERSVon.Text);
                CGlobalPara.SysPara.Para.IOFFSET        = System.Convert.ToDouble(txtIOFFSET.Text);
                CGlobalPara.SysPara.Para.IdleLoad       = System.Convert.ToDouble(txtFirstLoad.Text);
                CGlobalPara.SysPara.Para.LoadDelayS     = System.Convert.ToInt16(txtLoadDelayS.Text);
                CGlobalPara.SysPara.Para.IdTimes        = System.Convert.ToInt16(txtIdTimes.Text);
                CGlobalPara.SysPara.Para.ChkAutoModel   = chkAutoModel.Checked;
                CGlobalPara.SysPara.Para.ChkSameModel   = chkSameMode.Checked;
                CGlobalPara.SysPara.Para.ModelTimes     = System.Convert.ToInt16(txtSameTimes.Text);
                CGlobalPara.SysPara.Para.ChkNullAutoOut = chkAutoNull.Checked;
                CGlobalPara.SysPara.Para.NoShowAlarm    = chkNoShow.Checked;
                CGlobalPara.SysPara.Para.ChkACVolt      = chkACVolt.Checked;
                CGlobalPara.SysPara.Para.BITimeRate     = System.Convert.ToDouble(txtBITimeRate.Text);
                CGlobalPara.SysPara.Para.BackUpDBTime   = System.Convert.ToInt32(txtBackTime.Text);
                CGlobalPara.SysPara.Para.ChkFastOnOff   = chkFastOnOff.Checked;
                CGlobalPara.SysPara.Para.ChkAutoSelf    = chkAutoSelf.Checked;

                CGlobalPara.SysPara.Alarm.FailTimes      = System.Convert.ToInt16(txtFailTimes.Text);
                CGlobalPara.SysPara.Alarm.FailCurTimes   = System.Convert.ToInt16(txtCurFailAlarm.Text);
                CGlobalPara.SysPara.Alarm.ComFailTimes   = System.Convert.ToInt16(txtComFails.Text);
                CGlobalPara.SysPara.Alarm.FixUserTimes   = System.Convert.ToInt16(txtFixUseNum.Text);
                CGlobalPara.SysPara.Alarm.FixFailLockNum = System.Convert.ToInt16(txtFixFailLockNum.Text);
                CGlobalPara.SysPara.Alarm.Chk_qcv_times  = System.Convert.ToInt32(txtChkQCVTimes.Text);
                CGlobalPara.SysPara.Alarm.OP_AlarmDelayS = System.Convert.ToInt16(txtOpDelayS.Text);
                CGlobalPara.SysPara.Alarm.PassRateLimit  = System.Convert.ToDouble(txtPassRateLimit.Text);

                CGlobalPara.SysPara.Alarm.ChkPassRate       = chkPassRate.Checked;
                CGlobalPara.SysPara.Alarm.PassRateLimit     = System.Convert.ToDouble(txtPassRateLimit.Text);
                CGlobalPara.SysPara.Alarm.PassRateStartNum  = System.Convert.ToInt32(txtStartNum.Text);
                CGlobalPara.SysPara.Alarm.PassRateAlarmTime = System.Convert.ToInt32(txtAlarmInterval.Text);
                CGlobalPara.SysPara.Alarm.ChkClrDay         = chkClrDay.Checked;
                CGlobalPara.SysPara.Alarm.ChkClrNight       = chkClrNight.Checked;
                CGlobalPara.SysPara.Alarm.ClrDayTime        = txtClrDayTime.Text;
                CGlobalPara.SysPara.Alarm.ClrNightTime      = txtClrNightTime.Text;

                CGlobalPara.SysPara.Report.ModelPath       = txtModelPath.Text;
                CGlobalPara.SysPara.Report.SaveReport      = chkSaveReport.Checked;
                CGlobalPara.SysPara.Report.ReportPath      = txtReportPath.Text;
                CGlobalPara.SysPara.Report.SaveReportTimes = System.Convert.ToDouble(txtReportSaveTimes.Text);
                CGlobalPara.SysPara.Report.DayRecordPath   = txtDayRecord.Text;
                CGlobalPara.SysPara.Report.TempScanTime    = System.Convert.ToInt16(txtTemTimes.Text);
                CGlobalPara.SysPara.Report.TempPath        = txtTempFolder.Text;

                CGlobalPara.SysPara.Mes.ChkWebSn   = chkGJWeb.Checked ? 1 : 0;
                CGlobalPara.SysPara.Mes.Connect    = chkMesCon.Checked;
                CGlobalPara.SysPara.Mes.ChkSn      = chkChkSn.Checked;
                CGlobalPara.SysPara.Mes.ChkGoPass  = chkGoPass.Checked;
                CGlobalPara.SysPara.Mes.CurStation = txtCurStation.Text;
                CGlobalPara.SysPara.Mes.PCName     = txtPCName.Text;

                CSerializable <CSysPara> .WriteXml(CGlobalPara.SysFile, CGlobalPara.SysPara);
            }
            catch (Exception)
            {
                throw;
            }
        }