Esempio n. 1
0
        private void EditDevice_Click(object sender, RoutedEventArgs e)
        {
            string header = $"{SelectedDevice.Header.ShieldName} {SelectedDevice.Header.ShieldNumber}, " +
                            $"{SelectedDevice.Header.DeviceType} (ID { SelectedDevice.Header.DeviceAddress}, " +
                            $"{SelectedDevice.Header.DeviceBaudRate}, {SelectedDevice.Header.DeviceParity})";

            editSignalWindow = new EditSignalWindow
            {
                Title       = header,
                DataContext = SelectedDevice.Signal,
                Name        = "secondWindow"
            };
            editSignalWindow.addSignal = AddSignal;
            editSignalWindow.delSignal = DelSignal;
            editSignalWindow.Pattern   = Pattern.Find(p => p.DeviceType == SelectedDevice.Header.DeviceType);
            // Изменение видимости элементов в автогенерации
            if (SelectedDevice.Header.ShieldName != "ШОЛ" || SelectedDevice.Header.DeviceType != "МВ110")
            {
                editSignalWindow.numFirstQF.Visibility       = Visibility.Hidden;
                editSignalWindow.numFirstQFlabelL.Visibility = Visibility.Hidden;
                editSignalWindow.numFirstQFlabelH.Visibility = Visibility.Hidden;
                editSignalWindow.countQF.Visibility          = Visibility.Hidden;
                editSignalWindow.countQFlabelL.Visibility    = Visibility.Hidden;
                editSignalWindow.countQFlabelH.Visibility    = Visibility.Hidden;
                editSignalWindow.btnOK.Visibility            = Visibility.Hidden;
            }
            if (((SelectedDevice.Header.ShieldName == "ШВА" && SelectedDevice.Header.DeviceType == "БМРЗ-АВ") ||
                 (SelectedDevice.Header.ShieldName == "ШВЛ" && SelectedDevice.Header.DeviceType == "БМРЗ-ВВ") ||
                 (SelectedDevice.Header.ShieldName == "ШВП" && SelectedDevice.Header.DeviceType == "БМРЗ-ВВ")) == false)
            {
                editSignalWindow.numPowerInput.Visibility       = Visibility.Hidden;
                editSignalWindow.numPowerInputLabelH.Visibility = Visibility.Hidden;
                editSignalWindow.numPowerInputLabelL.Visibility = Visibility.Hidden;
            }

            editSignalWindow.ShowDialog();
            SelectedDevice.ChangeFace();
        }