public TestingInfoWindow(TestingWorkerSender sender)
 {
     InitializeComponent();
     IsUsb = false;
     MeasurementItemsListBox.ItemsSource = sender.GetList();
     testingTime.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
 }
Esempio n. 2
0
        private void redo_Click(object sender, RoutedEventArgs e)
        {
            var index = TestItemListBox.SelectedIndex;

            if (worker.CurrentItemIndex > index)
            {
                worker.MeasurementItems[index].redo      = true;
                worker.MeasurementItems[index].completed = false;
                worker.MeasurementItems[index].failed    = false;
                worker.MeasurementItems[index].state     = 0;
                TestItemListBox.ItemsSource = worker.GetList();
            }
        }
Esempio n. 3
0
        private void StatusRefresh(TestingWorkerSender status)
        {
            WorkingStatusLabel.Text = status.StatusText;
            int itemIndex = TestItemListBox.SelectedIndex;

            TestItemListBox.ItemsSource = status.GetList();
            ResultListBox.ItemsSource   = TestingWorkerUtility.getFinalResultsText(status);
            if (itemIndex < TestItemListBox.Items.Count)
            {
                TestItemListBox.SelectedIndex = itemIndex;
            }

            progressBar.Value = status.ProgressPercent;

            RemainingTestNumLabel.Text = status.RemainingItemsCount.ToString();
            WorkingSets.local.status   = status;
            GC.Collect();
        }
Esempio n. 4
0
        private void StatusRefresh(TestingWorkerSender status)
        {
            if (WorkingSets.local.IsVisible == true && WorkingSets.local.IsVisible1 == true)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    ConfireIsOk.Visibility = Visibility;
                });
            }
            WorkingStatusLabel.Text = status.StatusText;
            int itemIndex = TestItemListBox.SelectedIndex;

            TestItemListBox.ItemsSource = status.GetList();
            ResultListBox.ItemsSource   = TestingWorkerUtility.getFinalResultsText(status);
            if (itemIndex < TestItemListBox.Items.Count)
            {
                TestItemListBox.SelectedIndex = itemIndex;
            }
            if (status.MeasurementItems[status.CurrentItemIndex].Result != null && status.MeasurementItems[status.CurrentItemIndex].Result.values != null)
            {
                if (status.MeasurementItems[status.CurrentItemIndex].Function == MeasurementFunction.DCResistance)
                {
                    SetgroupboxVisible(Whichgroupbox.DCR);
                    WindingTerimal[] terminal = status.MeasurementItems[status.CurrentItemIndex].Terimal;
                    var testResult            = status.MeasurementItems[status.CurrentItemIndex].Result.values;
                    if (terminal == null)
                    {
                        if (threeDcr.Visibility != Visibility.Visible)
                        {
                            threeDcr.Visibility  = Visibility.Visible;
                            signalDcr.Visibility = Visibility.Hidden;
                        }
                        else
                        {
                            threeDcr.Visibility  = Visibility.Visible;
                            signalDcr.Visibility = Visibility.Hidden;
                        }

                        if (testResult != null)
                        {
                            threeDcr.ThreeResistanceValue = testResult;
                        }
                    }
                    else
                    {
                        if (signalDcr.Visibility != Visibility.Visible)
                        {
                            threeDcr.Visibility  = Visibility.Hidden;
                            signalDcr.Visibility = Visibility.Visible;
                        }
                        if (terminal[0] == WindingTerimal.A)
                        {
                            signalDcr.location    = new Tuple <string, string>("A相电流", "A相电阻");
                            signalDcr.SignalValue = new PhysicalVariable[] { testResult[1], testResult[2] };
                        }
                        else if (terminal[0] == WindingTerimal.B)
                        {
                            signalDcr.location    = new Tuple <string, string>("B相电流", "B相电阻");
                            signalDcr.SignalValue = new PhysicalVariable[] { testResult[4], testResult[5] };
                        }
                        else
                        {
                            signalDcr.location    = new Tuple <string, string>("C相电流", "C相电阻");
                            signalDcr.SignalValue = new PhysicalVariable[] { testResult[7], testResult[8] };
                        }
                    }
                }
                if (status.MeasurementItems[status.CurrentItemIndex].Function == MeasurementFunction.DCInsulation ||
                    status.MeasurementItems[status.CurrentItemIndex].Function == MeasurementFunction.BushingDCInsulation)
                {
                    SetgroupboxVisible(Whichgroupbox.DCI);
                    var testResult = status.MeasurementItems[status.CurrentItemIndex].Result.values;
                    if (testResult != null)
                    {
                        DciRe.SignalValue = new PhysicalVariable[] { testResult[0], testResult[1] };
                    }
                }
                if (status.MeasurementItems[status.CurrentItemIndex].Function == MeasurementFunction.Capacitance ||
                    status.MeasurementItems[status.CurrentItemIndex].Function == MeasurementFunction.BushingCapacitance)
                {
                    SetgroupboxVisible(Whichgroupbox.CAP);
                    var testResult = status.MeasurementItems[status.CurrentItemIndex].Result.values;
                    if (testResult != null && testResult[1] != null && testResult[1].value != null)
                    {
                        Capui.tuple     = new Tuple <string, string>("电压(kV)", testResult[1].OriginText);
                        Capui.NextValue = (double)(testResult[1].value / 1000);
                    }
                }
                if (status.MeasurementItems[status.CurrentItemIndex].Function == MeasurementFunction.OLTCSwitchingCharacter)
                {
                    var testResult = status.MeasurementItems[status.CurrentItemIndex].Result.values;
                    if (!WorkingSets.local.TestDCI)
                    {
                        SetgroupboxVisible(Whichgroupbox.OLTC);
                        WorkingSets.local.TestDCI = true;
                    }

                    if (testResult != null)
                    {
                        Oltcui.ThreeResistanceValue = testResult;
                    }

                    if (status.MeasurementItems[status.CurrentItemIndex].Result.waves != null)
                    {
                        if (!WorkingSets.local.Testwave)
                        {
                            SetgroupboxVisible(Whichgroupbox.NONE);
                            threechart.shortWave       = status.MeasurementItems[status.CurrentItemIndex].Result.waves;
                            WorkingSets.local.Testwave = true;
                        }
                    }
                }
            }
            progressBar.Value          = status.ProgressPercent;
            RemainingTestNumLabel.Text = status.RemainingItemsCount.ToString();
            WorkingSets.local.status   = status;
            GC.Collect();
        }