예제 #1
0
        private void JobConfire(object sender = null, RoutedEventArgs e = null)
        {
            if (!inited)
            {
                return;
            }
            if (HVWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (MVWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (LVWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (HVWindingCapacitanceCheckBox == null)
            {
                return;
            }
            if (MVWindingCapacitanceCheckBox == null)
            {
                return;
            }
            if (LVWindingCapacitanceCheckBox == null)
            {
                return;
            }
            if (HVWindingDCResistanceCheckBox == null)
            {
                return;
            }
            if (MVWindingDCResistanceCheckBox == null)
            {
                return;
            }
            if (LVWindingDCResistanceCheckBox == null)
            {
                return;
            }
            if (BushingDCInsulationCheckBox == null)
            {
                return;
            }
            if (BushingCapacitanceCheckBox == null)
            {
                return;
            }
            if (DCHvResistanceCurrentComboBox == null)
            {
                return;
            }
            if (DCMvResistanceCurrentComboBox == null)
            {
                return;
            }
            if (DCLvResistanceCurrentComboBox == null)
            {
                return;
            }
            if (ZCWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (OLTCCheckBox == null)
            {
                return;
            }
            if (OLTCRangeTextBox == null)
            {
                return;
            }
            if (OLTCDCResistanceCheckBox == null)
            {
                return;
            }
            if (OLTCSwitchingCheckBox == null)
            {
                return;
            }
            if (WorkList == null)
            {
                return;
            }
            if (DCInsulationTestVoltageComboBox == null)
            {
                return;
            }
            if (DCInsulationResThTextBox == null)
            {
                return;
            }
            if (DCInsulationARTextBox == null)
            {
                return;
            }
            if (CapacitanceTestVoltageComboBox == null)
            {
                return;
            }
            if (DCResistanceCurrentComboBox == null)
            {
                return;
            }
            if (BushingDCInsulationTestVoltageComboBox == null)
            {
                return;
            }
            if (BushingCapacitanceTestVoltageComboBox == null)
            {
                return;
            }
            if (Coreinsulation == null)
            {
                return;
            }
            if (Leakagecurrent == null)
            {
                return;
            }
            if (Shortcircuitimpedance == null)
            {
                return;
            }
            changed = true;

            JobList jobList = new JobList();

            jobList.Transformer = currentTransformer;

            jobList.DCInsulation.HVEnabled = (HVWindingDCInsulationCheckBox.IsChecked == true);
            jobList.DCInsulation.MVEnabled = (MVWindingDCInsulationCheckBox.IsChecked == true);
            jobList.DCInsulation.LVEnabled = (LVWindingDCInsulationCheckBox.IsChecked == true);

            jobList.Capacitance.HVEnabled = (HVWindingCapacitanceCheckBox.IsChecked == true);
            jobList.Capacitance.MVEnabled = (MVWindingCapacitanceCheckBox.IsChecked == true);
            jobList.Capacitance.LVEnabled = (LVWindingCapacitanceCheckBox.IsChecked == true);

            jobList.DCResistance.HVEnabled = (HVWindingDCResistanceCheckBox.IsChecked == true);
            jobList.DCResistance.MVEnabled = (MVWindingDCResistanceCheckBox.IsChecked == true);
            jobList.DCResistance.LVEnabled = (LVWindingDCResistanceCheckBox.IsChecked == true);
            jobList.DCResistance.ZcEnable  = (ZCWindingDCInsulationCheckBox.IsChecked == true);

            jobList.Shortcircuitimpedance = (Shortcircuitimpedance.IsChecked == true);
            jobList.CoreDCInsulation      = (Coreinsulation.IsChecked == true);
            jobList.LossDcresistance      = (Leakagecurrent.IsChecked == true);

            jobList.Bushing.DCInsulation = (BushingDCInsulationCheckBox.IsChecked == true);
            jobList.Bushing.Capacitance  = (BushingCapacitanceCheckBox.IsChecked == true);

            jobList.OLTC.Range              = int.Parse(OLTCRangeTextBox.Text);
            jobList.OLTC.MulRange           = int.Parse(OLTCRangeMulTextBox.Text);
            jobList.OLTC.DCResistance       = (OLTCDCResistanceCheckBox.IsChecked == true);
            jobList.OLTC.SwitchingCharacter = (OLTCSwitchingCheckBox.IsChecked == true);

            jobList.Parameter.BushingCapacitanceVoltage   = (int)Convert.ToDouble(BushingCapacitanceTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000;
            jobList.Parameter.BushingDCInsulationVoltage  = (int)Convert.ToDouble(BushingDCInsulationTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000;
            jobList.Parameter.CapacitanceVoltage          = (int)Convert.ToDouble(CapacitanceTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000;
            jobList.Parameter.DCInsulationAbsorptionRatio = 5;
            jobList.Parameter.DCInsulationResistance      = 5;
            jobList.Parameter.DCInsulationVoltage         = (int)Convert.ToDouble(DCInsulationTestVoltageComboBox.SelectionBoxItem.ToString().Replace("kV", "").Trim()) * 1000;
            jobList.Parameter.DCResistanceCurrent         = Getc(DCResistanceCurrentComboBox);
            jobList.Parameter.DCHvResistanceCurrent       = Getc(DCHvResistanceCurrentComboBox);
            jobList.Parameter.DCMvResistanceCurrent       = Getc(DCMvResistanceCurrentComboBox);
            jobList.Parameter.DCLvResistanceCurrent       = Getc(DCLvResistanceCurrentComboBox);
            #region
            var miList = Translator.JobList2MeasurementItems(jobList);
            TestingInfoWindow testingInfo = new TestingInfoWindow(miList);
            JobList           job         = jobList;
            job.id = GetId();
            if (testingInfo.ShowDialog() == true)
            {
                job.Information = testingInfo.Information;
            }
            UseUpanDoWork.LocalUsb.Reinitialize();
            foreach (var mi in miList)
            {
                UseUpanDoWork.LocalUsb.StartBuiltTestData(mi, jobList);
            }
            //自动检索Upan
#if true
            string[] drives = Environment.GetLogicalDrives();
            UpanForWriteToFile.writefile(drives[drives.Length - 1], "List.lis", job, miList, JobNameTextBox.Text.Trim());
#endif
            // UpanForWriteToFile.writefile("D:\\", "List.lis", jobList, miList);
            List <string> miListString = new List <string>();
            foreach (var mi in miList)
            {
                miListString.Add(mi.Description);
            }
            WorkList.ItemsSource = miListString;
            #endregion
        }
        private void JobConfire(object sender = null, RoutedEventArgs e = null)
        {
            if (!inited)
            {
                return;
            }
            if (HVWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (MVWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (LVWindingDCInsulationCheckBox == null)
            {
                return;
            }
            if (HVWindingCapacitanceCheckBox == null)
            {
                return;
            }
            if (MVWindingCapacitanceCheckBox == null)
            {
                return;
            }
            if (LVWindingCapacitanceCheckBox == null)
            {
                return;
            }
            if (HVWindingDCResistanceCheckBox == null)
            {
                return;
            }
            if (MVWindingDCResistanceCheckBox == null)
            {
                return;
            }
            if (LVWindingDCResistanceCheckBox == null)
            {
                return;
            }
            if (BushingDCInsulationCheckBox == null)
            {
                return;
            }
            if (BushingCapacitanceCheckBox == null)
            {
                return;
            }
            if (OLTCCheckBox == null)
            {
                return;
            }
            if (OLTCRangeTextBox == null)
            {
                return;
            }
            if (OLTCDCResistanceCheckBox == null)
            {
                return;
            }
            if (OLTCSwitchingCheckBox == null)
            {
                return;
            }
            if (WorkList == null)
            {
                return;
            }
            if (DCInsulationTestVoltageComboBox == null)
            {
                return;
            }
            if (DCInsulationResThTextBox == null)
            {
                return;
            }
            if (DCInsulationARTextBox == null)
            {
                return;
            }
            if (CapacitanceTestVoltageComboBox == null)
            {
                return;
            }
            if (DCResistanceCurrentComboBox == null)
            {
                return;
            }
            if (BushingDCInsulationTestVoltageComboBox == null)
            {
                return;
            }
            if (BushingCapacitanceTestVoltageComboBox == null)
            {
                return;
            }
            changed = true;

            JobList jobList = new JobList();

            jobList.Transformer = currentTransformer;

            jobList.DCInsulation.HVEnabled = (HVWindingDCInsulationCheckBox.IsChecked == true);
            jobList.DCInsulation.MVEnabled = (MVWindingDCInsulationCheckBox.IsChecked == true);
            jobList.DCInsulation.LVEnabled = (LVWindingDCInsulationCheckBox.IsChecked == true);

            jobList.Capacitance.HVEnabled = (HVWindingCapacitanceCheckBox.IsChecked == true);
            jobList.Capacitance.MVEnabled = (MVWindingCapacitanceCheckBox.IsChecked == true);
            jobList.Capacitance.LVEnabled = (LVWindingCapacitanceCheckBox.IsChecked == true);

            jobList.DCResistance.HVEnabled = (HVWindingDCResistanceCheckBox.IsChecked == true);
            jobList.DCResistance.MVEnabled = (MVWindingDCResistanceCheckBox.IsChecked == true);
            jobList.DCResistance.LVEnabled = (LVWindingDCResistanceCheckBox.IsChecked == true);

            jobList.Bushing.DCInsulation = (BushingDCInsulationCheckBox.IsChecked == true);
            jobList.Bushing.Capacitance  = (BushingCapacitanceCheckBox.IsChecked == true);

            jobList.OLTC.Range              = int.Parse(OLTCRangeTextBox.Text);
            jobList.OLTC.DCResistance       = (OLTCDCResistanceCheckBox.IsChecked == true);
            jobList.OLTC.SwitchingCharacter = (OLTCSwitchingCheckBox.IsChecked == true);

            var miList = Translator.JobList2MeasurementItems(jobList);

            UseUpanDoWork.LocalUsb.Reinitialize();


            foreach (var mi in miList)
            {
                UseUpanDoWork.LocalUsb.StartBuiltTestData(mi, jobList);
            }
            //自动检索Upan
#if true
            String[] drives = Environment.GetLogicalDrives();
            UpanForWriteToFile.writefile(drives[drives.Length - 1], "List.lis", jobList, miList);
#endif
            // UpanForWriteToFile.writefile("D:\\", "List.lis", jobList, miList);



            List <string> miListString = new List <string>();
            foreach (var mi in miList)
            {
                miListString.Add(mi.Description);
            }
            WorkList.ItemsSource = miListString;
        }