Пример #1
0
        public Group22SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                        IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                        IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                        IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("22.01. Темп нарастания частоты задатчика интенсивности [Гц/с]",
                                                       "f1", -3276.7m, 3276.7m);
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("22.02. Темп спада частоты задатчика интенсивности [Гц/с]", "f1",
                                                       -3276.8m, 3276.7m);
            Parameter03Vm = new ParameterDecimalEditCheckViewModel(
                "22.03. Темп спада частоты при аварийном останове привода [Гц/с]", "f1", -3276.8m, 3276.7m);

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
        public Group104SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                         IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                         IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            //Parameter01Vm = new ParameterDoubleEditCheckViewModel("104.01. Максимально возможная компенсация потока", "f3", -10000, 10000, null) {Increment = 0.1};
            //Parameter02Vm = new ParameterDoubleEditCheckViewModel("104.02. Минимальный возможный поток (в % от номинала)", "f0", -10000, 10000, null);
            //Parameter03Vm = new ParameterDoubleEditCheckViewModel("104.03. Постоянная времени регулятора компенсации напр-я, мс", "f4", -3.2768, 3.2767, null) { Increment = 0.0001 };
            //Parameter04Vm = new ParameterDoubleEditCheckViewModel("104.04. Порог компенсации напряжения DC за счет потока", "f3", -10000, 10000, null) { Increment = 0.1 };

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
Пример #3
0
        public Group107SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, IAinSettingsStorage storage,
                                         IAinSettingsStorageUpdatedNotify storageUpdatedNotify, IAinsCounter ainsCounter)
        {
            _uiRoot               = uiRoot;
            _logger               = logger;
            _readerWriter         = readerWriter;
            _storage              = storage;
            _storageUpdatedNotify = storageUpdatedNotify;
            _ainsCounter          = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("107.01. Мин. напряжение в режиме чоппера", "f0", -10000, 10000);
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("107.02. Макс. напряжение в режиме чоппера", "f0", -10000,
                                                       10000);

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            //_ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
                AinSettingsReadNotifyOnAinSettingsReadComplete(zbAinNuber,
                                                               settings == null ? new Exception("Настройки недоступны") : null, settings);
            };
        }
Пример #4
0
        public Group26SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                        IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                        IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                        IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            Parameter01Vm = new ParameterDecimalEditCheckViewModel("26.01. Режим работы", "f0", -10000, 10000);

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
        public Group105SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, /*IAinSettingsReadNotify ainSettingsReadNotify,*/
                                         IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                         IAinsCounter ainsCounter)
        {
            _uiRoot       = uiRoot;
            _logger       = logger;
            _readerWriter = readerWriter;
            //_ainSettingsReadNotify = ainSettingsReadNotify;
            _storage = storage;
            _storageUpdatedNotify = storageUpdatedNotify;
            _ainsCounter          = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("105.01. Калибровка нуля тока фазы A", "f0", -10000, 10000);
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("105.02. Калибровка нуля тока фазы B", "f0", -10000, 10000);
            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("105.03. Калибровка нуля тока фазы C", "f0", -10000, 10000);
            Parameter04Vm =
                new ParameterDecimalEditCheckViewModel("105.04. Калибровка нуля напряжения шины DC", "f0", -10000,
                                                       10000);

            Parameter101Vm =
                new ParameterDecimalEditCheckViewModel("105.01. Калибровка нуля тока фазы A", "f0", -10000, 10000);
            Parameter102Vm =
                new ParameterDecimalEditCheckViewModel("105.02. Калибровка нуля тока фазы B", "f0", -10000, 10000);
            Parameter103Vm =
                new ParameterDecimalEditCheckViewModel("105.03. Калибровка нуля тока фазы C", "f0", -10000, 10000);
            Parameter104Vm =
                new ParameterDecimalEditCheckViewModel("105.04. Калибровка нуля напряжения шины DC", "f0", -10000,
                                                       10000);

            Parameter201Vm =
                new ParameterDecimalEditCheckViewModel("105.01. Калибровка нуля тока фазы A", "f0", -10000, 10000);
            Parameter202Vm =
                new ParameterDecimalEditCheckViewModel("105.02. Калибровка нуля тока фазы B", "f0", -10000, 10000);
            Parameter203Vm =
                new ParameterDecimalEditCheckViewModel("105.03. Калибровка нуля тока фазы C", "f0", -10000, 10000);
            Parameter204Vm =
                new ParameterDecimalEditCheckViewModel("105.04. Калибровка нуля напряжения шины DC", "f0", -10000,
                                                       10000);

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            //_ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
                AinSettingsReadNotifyOnAinSettingsReadComplete(zbAinNuber,
                                                               settings == null ? new Exception("Настройки недоступны") : null, settings);
            };
        }
Пример #6
0
        public Group100SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                         IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                         IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("100.01. Пропорциональный коэф. регулятора тока D , ID Kp", "f8",
                                                       -128.0m, 127.99609375m)
            {
                Increment = 0.00390625m
            };
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("100.02. Интегральный коэф. регулятора тока D , ID Ki", "f6",
                                                       -128.0m, 128.0m)
            {
                Increment = 0.000001m
            };                                                // min step = 1 / 16777216.0 = 0,000000059604644775390625

            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("100.03. Пропорциональный коэф. регулятора тока Q , IQ Kp", "f8",
                                                       -128.0m, 127.99609375m)
            {
                Increment = 0.00390625m
            };
            Parameter04Vm =
                new ParameterDecimalEditCheckViewModel("100.04. Интегральный коэф. регулятора тока Q , IQ Ki", "f6",
                                                       -128.0m, 128.0m)
            {
                Increment = 0.000001m
            };                                                // min step = 1 / 16777216.0 = 0,000000059604644775390625


            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
Пример #7
0
        public Group103SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                         IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                         IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("103.01. Постоянная времени фильтра ОС вычислителя момента [мс]",
                                                       "f4", -3.2768m, 3.2767m)
            {
                Increment = 0.0001m
            };
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel(
                    "103.02. Постоянная времени фильтра ОС измеренной/вычисленной частоты [мс]", "f4", -3.2768m,
                    3.2767m)
            {
                Increment = 0.0001m
            };
            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("103.03. Постоянная времени фильтра ОС вычислителя потока [мс]",
                                                       "f4", -3.2768m, 3.2767m)
            {
                Increment = 0.0001m
            };
            Parameter04Vm =
                new ParameterDecimalEditCheckViewModel("103.04. Постоянная времени фильтра канала задания частоты [мс]",
                                                       "f4", -3.2768m, 3.2767m)
            {
                Increment = 0.0001m
            };

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
        public Group106SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                         IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                         IAinsCounter ainsCounter,
                                         ImcwParameterViewModel imcwParameterVm)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;

            Parameter01Vm = new ParameterHexEditableViewModel("106.01. Каналы ЦАП", "X4", 0, 65535, null);
            Parameter02Vm = imcwParameterVm;
            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("106.03. Таймаут по системной линии связи", "f0", -10000, 10000);

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true);  // TODO: read only when connected to COM
            WriteSettingsCmd = new RelayCommand(WriteSettings, () => true); // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
        }
        public Group99SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                        IAinSettingsReaderWriter ainSettingsReaderWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                        IAinSettingsStorage ainSettingsStorage, IAinSettingsStorageUpdatedNotify ainSettingsStorageUpdatedNotify,
                                        IAinsCounter ainsCounter,
                                        IEngineSettingsReader engineSettingsReader, IEngineSettingsWriter engineSettingsWriter,
                                        IEngineSettingsReadNotify engineSettingsReadNotify, IEngineSettingsStorage engineSettingsStorage,
                                        IEngineSettingsStorageUpdatedNotify engineSettingsStorageUpdatedNotify,
                                        ImcwParameterViewModel imcwParameterVm)
        {
            _uiRoot = uiRoot;
            _logger = logger;

            _ainSettingsReaderWriter         = ainSettingsReaderWriter;
            _ainSettingsReadNotify           = ainSettingsReadNotify;
            _ainSettingsStorage              = ainSettingsStorage;
            _ainSettingsStorageUpdatedNotify = ainSettingsStorageUpdatedNotify;
            _ainsCounter = ainsCounter;

            _engineSettingsReader               = engineSettingsReader;
            _engineSettingsWriter               = engineSettingsWriter;
            _engineSettingsReadNotify           = engineSettingsReadNotify;
            _engineSettingsStorage              = engineSettingsStorage;
            _engineSettingsStorageUpdatedNotify = engineSettingsStorageUpdatedNotify;

            _imcwParameterVm = imcwParameterVm;


            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel(
                    "99.01. Номинальное напряжение обмотки статора (действующее) [В]", "f0", 0, 10000);
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("99.02. Номинальный ток обмотки статора [А]", "f0", 0, 10000);
            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("99.03. Номинальная частота напряжения питающей сети [Гц]", "f1",
                                                       8, 300);
            Parameter04Vm =
                new ParameterDecimalEditCheckViewModel("99.04. Номинальная скорость вращения двигателя [об/мин]", "f0",
                                                       0, 18000);
            Parameter05Vm =
                new ParameterDecimalEditCheckViewModel("99.05. Максимальная скорость вращения двигателя [об/мин]", "f0",
                                                       0, 18000);
            Parameter06Vm =
                new ParameterDecimalEditCheckViewModel("99.06. Номинальная мощность на валу двигателя [кВт]", "f3", 0,
                                                       9000);
            Parameter07Vm = new ParameterComboEditableViewModel <int>("99.07. Режим управления двигателем",
                                                                      new[]
            {
                new ComboItemViewModel <int> {
                    ComboText = "Скалярный", ComboValue = 0
                },
                new ComboItemViewModel <int> {
                    ComboText = "Векторный", ComboValue = 1
                }
            });
            Parameter07Vm.PropertyChanged += Parameter07VmOnPropertyChanged;

            _imcwParameterVm.PropertyChanged += ImcwParameterVmOnPropertyChanged;

            Parameter08Vm =
                new ParameterDecimalEditCheckViewModel("99.08. Номинальный коэффициент мощности cos(ϕ)", "f2", 0, 1.0m);
            Parameter09Vm =
                new ParameterDecimalEditCheckViewModel("99.09. Номинальный КПД двигателя [%]", "f1", 0, 100.0m);
            Parameter10Vm = new ParameterDecimalEditCheckViewModel("99.10. Масса двигателя [кг]", "f0", 0, 10000);
            Parameter11Vm = new ParameterDecimalEditCheckViewModel("99.11. Кратность максимального момента (Mmax/Mnom)",
                                                                   "f0", 0, 10000);
            Parameter12Vm = new ParameterDecimalEditCheckViewModel("99.12. Конструктивная высота [мм]", "f0", 0, 10000);

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete      += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _ainSettingsStorageUpdatedNotify.AinSettingsUpdated += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };

            _engineSettingsReadNotify.EngineSettingsReadComplete +=
                EngineSettingsReadNotifyOnEngineSettingsReadComplete;
            _engineSettingsStorageUpdatedNotify.EngineSettingsUpdated += settings =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
        public Group102SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                         IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                         IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                         IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("102.01. Постоянная времени обмотки ротора, Tr [мс]", "f4",
                                                       -3.2768m, 3.2767m)
            {
                Increment = 0.0001m
            };
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("102.02. Индуктивность намагничивания, Lm [мкГн]", "f5",
                                                       -0.32768m, 0.32767m)
            {
                Increment = 0.00001m
            };
            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("102.03. Индуктивность рассеяния обмотки статора, Lsl [мкГн]",
                                                       "f6", -0.032768m, 0.032768m)
            {
                Increment = 0.000001m
            };
            Parameter04Vm =
                new ParameterDecimalEditCheckViewModel("102.04. Индуктивность рассеяния обмотки ротора, Lrl [мкГн]",
                                                       "f6", -0.032768m, 0.032768m)
            {
                Increment = 0.000001m
            };
            Parameter05Vm =
                new ParameterDecimalEditCheckViewModel("102.05. Активное сопротивление обмотки статора, Rs [Ом]", "f4",
                                                       -3.2768m, 3.2767m)
            {
                Increment = 0.0001m
            };
            Parameter06Vm = new ParameterDecimalEditCheckViewModel("102.06. Число пар полюсов", "f0", 0, 31);

            Parameter07Vm = new ParameterComboEditableViewModel <int>("102.07. Число импульсов датчика частоты вращения",
                                                                      new[]
            {
                new ComboItemViewModel <int> {
                    ComboText = "256", ComboValue = 0
                },
                new ComboItemViewModel <int> {
                    ComboText = "512", ComboValue = 1
                },
                new ComboItemViewModel <int> {
                    ComboText = "1024", ComboValue = 2
                },
                new ComboItemViewModel <int> {
                    ComboText = "2048", ComboValue = 3
                },
                new ComboItemViewModel <int> {
                    ComboText = "4096", ComboValue = 4
                },
                new ComboItemViewModel <int> {
                    ComboText = "8192", ComboValue = 5
                },
                new ComboItemViewModel <int> {
                    ComboText = "16384", ComboValue = 6
                },
                new ComboItemViewModel <int> {
                    ComboText = "32768", ComboValue = 7
                }
            });

            Parameter08Vm = new ParameterComboEditableViewModel <AinTelemetryFanWorkmode>(
                "102.08. Режим работы вентилятора",
                new[]
            {
                new ComboItemViewModel <AinTelemetryFanWorkmode>
                {
                    ComboText  = AinTelemetryFanWorkmode.AllwaysOff.ToHumanString(),
                    ComboValue = AinTelemetryFanWorkmode.AllwaysOff
                },
                new ComboItemViewModel <AinTelemetryFanWorkmode>
                {
                    ComboText = AinTelemetryFanWorkmode.SwitchOnSyncToPwmSwtichOffTwoMinutesLaterAfterPwmOff
                                .ToHumanString(),
                    ComboValue = AinTelemetryFanWorkmode.SwitchOnSyncToPwmSwtichOffTwoMinutesLaterAfterPwmOff
                },
                new ComboItemViewModel <AinTelemetryFanWorkmode>
                {
                    ComboText = AinTelemetryFanWorkmode.SwitchOnSyncToPwmSwtichOffAfterPwmOffAndTempGoesDownBelow45C
                                .ToHumanString(),
                    ComboValue = AinTelemetryFanWorkmode
                                 .SwitchOnSyncToPwmSwtichOffAfterPwmOffAndTempGoesDownBelow45C
                },
                new ComboItemViewModel <AinTelemetryFanWorkmode>
                {
                    ComboText  = AinTelemetryFanWorkmode.AllwaysOn.ToHumanString(),
                    ComboValue = AinTelemetryFanWorkmode.AllwaysOn
                }
            });
            Parameter09Vm =
                new ParameterBooleanEditCheckViewModel("102.09. Намагничивание постоянным током", "Нет", "Да");


            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
        public Group20SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                        IAinSettingsReaderWriter ainSettingsReaderWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                        IAinSettingsStorage ainSettingsStorage, IAinSettingsStorageUpdatedNotify ainSettingsStorageUpdatedNotify,
                                        IAinsCounter ainsCounter,
                                        IEngineSettingsReader engineSettingsReader, IEngineSettingsWriter engineSettingsWriter,
                                        IEngineSettingsReadNotify engineSettingsReadNotify, IEngineSettingsStorage engineSettingsStorage,
                                        IEngineSettingsStorageUpdatedNotify engineSettingsStorageUpdatedNotify)
        {
            _uiRoot = uiRoot;
            _logger = logger;

            _ainSettingsReaderWriter         = ainSettingsReaderWriter;
            _ainSettingsReadNotify           = ainSettingsReadNotify;
            _ainSettingsStorage              = ainSettingsStorage;
            _ainSettingsStorageUpdatedNotify = ainSettingsStorageUpdatedNotify;
            _ainsCounter = ainsCounter;

            _engineSettingsReader               = engineSettingsReader;
            _engineSettingsWriter               = engineSettingsWriter;
            _engineSettingsReadNotify           = engineSettingsReadNotify;
            _engineSettingsStorage              = engineSettingsStorage;
            _engineSettingsStorageUpdatedNotify = engineSettingsStorageUpdatedNotify;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("20.01. Максимальная частота [Гц]", "f1", 0, 6553.5m);

            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("20.02. Ограничение тока (амплитуда) [А]", "f0", -10000, 10000);
            Parameter03Vm = new ParameterDecimalEditCheckViewModel("20.03. Минимальная частота (электрическая) [Гц]",
                                                                   "f1", -3276.8m, 3276.7m);

            Parameter04Vm = new ParameterDecimalEditCheckViewModel("20.04. Максимальный ток (амплитуда) для защиты [А]",
                                                                   "f0", -32768, 32767);
            Parameter05Vm =
                new ParameterDecimalEditCheckViewModel("20.05. Максимальное напряжение шины DC для защиты [В]", "f0",
                                                       -1000, 1000);
            Parameter06Vm =
                new ParameterDecimalEditCheckViewModel("20.06. Минимальное напряжение шины DC [В]", "f0", -1000, 1000);
            Parameter07Vm = new ParameterDecimalEditCheckViewModel("20.07. Порог защиты по внешней температуре [⁰С]",
                                                                   "f0", -32768, 32767);


            Parameter08Vm =
                new ParameterDecimalEditCheckViewModel("20.08. Тепловая защита: граница перегрева [А² × 0.1сек]", "f0",
                                                       -10000, 10000);
            Parameter09Vm =
                new ParameterDecimalEditCheckViewModel("20.09. Тепловая защита: I(RMS) [А]", "f0", -10000, 10000);
            Parameter10Vm = new ParameterDecimalEditCheckViewModel(
                "20.10. Скорость вращения двигателя (электрическая) ниже нулевого предела (ZERO_SPEED) [Гц]", "f0",
                -10000, 10000);

            Parameter11Vm =
                new ParameterDecimalEditCheckViewModel("20.11. Минимальный момент", "f0", -10000, 10000);  // TODO: WTF?
            Parameter12Vm =
                new ParameterDecimalEditCheckViewModel("20.12. Максимальный момент", "f0", -10000, 10000); // TODO: WTF?

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true);                                 // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);                                     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete      += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _ainSettingsStorageUpdatedNotify.AinSettingsUpdated += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };

            _engineSettingsReadNotify.EngineSettingsReadComplete +=
                EngineSettingsReadNotifyOnEngineSettingsReadComplete;
            _engineSettingsStorageUpdatedNotify.EngineSettingsUpdated += settings =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
Пример #12
0
        public Group27SettingsViewModel(IUserInterfaceRoot uiRoot, ILogger logger,
                                        IAinSettingsReaderWriter readerWriter, IAinSettingsReadNotify ainSettingsReadNotify,
                                        IAinSettingsStorage storage, IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
                                        IAinsCounter ainsCounter)
        {
            _uiRoot                = uiRoot;
            _logger                = logger;
            _readerWriter          = readerWriter;
            _ainSettingsReadNotify = ainSettingsReadNotify;
            _storage               = storage;
            _storageUpdatedNotify  = storageUpdatedNotify;
            _ainsCounter           = ainsCounter;

            Parameter01Vm =
                new ParameterDecimalEditCheckViewModel("27.01. Номинальный поток без ослабления поля [мВб]", "f3",
                                                       -32.768m, 32.767m)
            {
                Increment = 0.001m
            };
            Parameter02Vm =
                new ParameterDecimalEditCheckViewModel("27.02. Минимальный поток с ослаблением поля [мВб]", "f3",
                                                       -32.768m, 32.767m)
            {
                Increment = 0.001m
            };
            Parameter03Vm =
                new ParameterDecimalEditCheckViewModel("27.03. Максимально возможная компенсация потока [мВб]", "f3",
                                                       -32.768m, 32.767m)
            {
                Increment = 0.001m
            };
            Parameter04Vm =
                new ParameterDecimalEditCheckViewModel(
                    "27.04. Минимально возможный поток (коэф. от номинального потока) [мВб]", "f3", -32.768m,
                    32.767m)
            {
                Increment = 0.001m
            };
            Parameter05Vm =
                new ParameterDecimalEditCheckViewModel(
                    "27.05. Постоянная времени регулятора компенсации напряжения [мс]", "f3", -3.2768m, 3.2767m)
            {
                Increment = 0.0001m
            };
            Parameter06Vm =
                new ParameterDecimalEditCheckViewModel("27.06. Порог компенсации напряжения DC за счет потока [В]",
                                                       "f3", -32.768m, 32.767m)
            {
                Increment = 0.001m
            };

            ReadSettingsCmd  = new RelayCommand(ReadSettings, () => true); // TODO: read only when connected to COM
            WriteSettingsCmd =
                new RelayCommand(WriteSettings, () => IsWriteEnabled);     // TODO: read only when connected to COM

            _ainSettingsReadNotify.AinSettingsReadComplete += AinSettingsReadNotifyOnAinSettingsReadComplete;
            _storageUpdatedNotify.AinSettingsUpdated       += (zbAinNuber, settings) =>
            {
                _uiRoot.Notifier.Notify(() => WriteSettingsCmd.RaiseCanExecuteChanged());
            };
        }
Пример #13
0
        public SettingsViewModel(
            IUserInterfaceRoot userInterfaceRoot,
            ILogger logger,
            IAinSettingsReaderWriter ainSettingsReadedWriter,
            IAinSettingsReadNotify ainSettingsReadNotify,
            IAinSettingsReadNotifyRaisable ainSettingsReadNotifyRaisable,
            IAinSettingsStorage ainSettingsStorage,
            IAinSettingsStorageSettable ainSettingsStorageSettable,
            IAinSettingsStorageUpdatedNotify storageUpdatedNotify,
            IAinsCounter ainsCounter,
            ICommandSenderHost commandSenderHost,
            ITargetAddressHost targetAddressHost,
            INotifySendingEnabled notifySendingEnabled,
            IEngineSettingsReader engineSettingsReader,
            IEngineSettingsWriter engineSettingsWriter,
            IEngineSettingsReadNotify engineSettingsReadNotify,
            IEngineSettingsReadNotifyRaisable engineSettingsReadNotifyRaisable,
            IEngineSettingsStorage engineSettingsStorage,
            IEngineSettingsStorageSettable engineSettingsStorageSettable,
            IEngineSettingsStorageUpdatedNotify engineSettingsStorageUpdatedNotify,
            IMultiLoggerWithStackTrace <int> debugLogger)
        {
            Group20SettingsVm = new Group20SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter,
                                                             engineSettingsReader, engineSettingsWriter, engineSettingsReadNotify, engineSettingsStorage,
                                                             engineSettingsStorageUpdatedNotify);

            Group22SettingsVm = new Group22SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group23SettingsVm = new Group23SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group24SettingsVm = new Group24SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group25SettingsVm = new Group25SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group26SettingsVm = new Group26SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group27SettingsVm = new Group27SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);

            var imcwParamViewModel = new ImcwParameterViewModel();

            Group99SettingsVm = new Group99SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                             ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter,
                                                             engineSettingsReader, engineSettingsWriter, engineSettingsReadNotify, engineSettingsStorage,
                                                             engineSettingsStorageUpdatedNotify,
                                                             imcwParamViewModel);

            Group100SettingsVm = new Group100SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                               ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group101SettingsVm = new Group101SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                               ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group102SettingsVm = new Group102SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                               ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group103SettingsVm = new Group103SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                               ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            //Group104SettingsVm = new Group104SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter, ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter);
            Group105SettingsVm = new Group105SettingsViewModel(userInterfaceRoot, logger,
                                                               ainSettingsReadedWriter, /*ainSettingsReadNotify, */ ainSettingsStorage, storageUpdatedNotify,
                                                               ainsCounter);
            Group106SettingsVm = new Group106SettingsViewModel(userInterfaceRoot, logger, ainSettingsReadedWriter,
                                                               ainSettingsReadNotify, ainSettingsStorage, storageUpdatedNotify, ainsCounter, imcwParamViewModel);
            Group107SettingsVm = new Group107SettingsViewModel(userInterfaceRoot, logger,
                                                               ainSettingsReadedWriter, /*ainSettingsReadNotify, */ ainSettingsStorage, storageUpdatedNotify,
                                                               ainsCounter);

            ImportExportVm = new ImportExportViewModel(ainSettingsStorageSettable, ainSettingsReadNotifyRaisable,
                                                       engineSettingsStorageSettable, engineSettingsReadNotifyRaisable, debugLogger);
        }