Ejemplo n.º 1
0
        public DispParamViewModel(
            string displayName,
            IRecvParam <TReceive> parameterModel,
            IThreadNotifier uiNotifier,
            Func <TReceive, TDisplay> displayValueGetter,
            TDisplay fallbackValue,
            TDisplay unknownValue)
        {
            //UniqueName = fullNamePreffix + ": " + displayName;
            //DisplayName = uniqNamePrefix + ": " + displayName;
            DisplayName = displayName;

            _parameterModel     = parameterModel;
            _uiNotifier         = uiNotifier;
            _displayValueGetter = displayValueGetter;
            _fallbackValue      = fallbackValue;

            _unknownValue   = unknownValue;
            _displayValue   = unknownValue;
            _isValueUnknown = true;

            _isValueFallback = false;

            _parameterModel.NotifyDataReceived += ParameterModelOnNotifyDataReceived;
        }
Ejemplo n.º 2
0
        public ParameterVMsHolder(IParametersPresenterXmlBuilder ppBuilder, IPsnParamsList psnParamsList,
                                  IParamListener paramListener, IThreadNotifier uiNotifier, IParameterLogger parameterLogger,
                                  IParameterSetter parameterSetter)
        {
            var paramsPresenter = ppBuilder.BuildParametersPresentationFromXml();
            var parameters      = new Dictionary <string, IParameterViewModel>();

            foreach (var paramDescriptionAndKey in paramsPresenter.Parameters)
            {
                var key           = paramDescriptionAndKey.Key;
                var description   = paramDescriptionAndKey.Value;
                var configuration = psnParamsList.PsnProtocolConfigurationParams[description.Identifier];

                parameters.Add(
                    key, new ParameterViewModelSimple(description.CustomName, configuration.Item2.Name,
                                                      new ParameterGetterViewModelSimple(
                                                          description.Identifier, paramListener, uiNotifier, description.View,
                                                          parameterLogger, configuration.Item2.IsBitSignal,
                                                          configuration.Item1.PartName + ": " + configuration.Item2.Name),
                                                      description.Injection == null
                            ? null
                            : new ParameterSetterViewModelSimple(parameterSetter, uiNotifier, description.Injection)));
            }

            Parameters = parameters;
        }
Ejemplo n.º 3
0
        public MainWindowViewModel(IThreadNotifier notifier, IWindowSystem windows)
        {
            _notifier = notifier;
            _windows  = windows;

            _loader      = new Loader();
            _repository  = _loader.GetLocalDirectoryRepository("C:\\Users\\aj01\\rpd.storage");
            _locomotives = new ObservableCollection <LocomotiveViewModel>();

            /*
             * var importRepo = _loader.GetZippedRepository("C:\\Users\\aj01\\Downloads\\Mout.rpd");
             * importRepo.Open(cea => {
             *      Console.WriteLine("Zip repo opened");
             * }, pea => { });
             */
            _repository.Open(ea => _notifier.Notify(() => {
                if (ea.ResultCode == OnCompleteEventArgs.CompleteResult.Ok)
                {
                    foreach (var loc in _repository.Locomotives)
                    {
                        _locomotives.Add(new LocomotiveViewModel(loc));
                    }
                }
                else
                {
                    _windows.ShowMessageBox(ea.Message, "Error on repo opening");
                }
            }), e => { Console.WriteLine(e.ProgressPercent.ToString("f2") + "%"); });

            WindowTitle = "Max RPD Id = " + _loader.AvailablePsnConfigruations.Max(pc => pc.RpdId) + " TOTAL CONFIGS: " + _loader.AvailablePsnConfigruations.Count();
        }
Ejemplo n.º 4
0
        public ComPortControlViewModel(ISharedAppAbilities appAbilities, ILogger logger, IThreadNotifier notifier, IWindowSystem windowSystem, string channelName)
        {
            _appAbilities            = appAbilities;
            _logger                  = logger;
            _notifier                = notifier;
            _windowSystem            = windowSystem;
            _openPortCommand         = new RelayCommand(OpenPort, () => !_isPortOpened);
            _closePortCommand        = new RelayCommand(ClosePort, () => _isPortOpened);
            GetPortsAvailableCommand = new RelayCommand(GetPortsAvailable);
            RecordVm                 = new RecordViewModel(_notifier, _windowSystem);


            //TODO: unsubscribe
            _channel = _appAbilities.CreateChannel(channelName);
            _channel.Channel.CommandHeared += SerialChannelOnCommandHeared;
            _channel.Channel.CommandHearedWithReplyPossibility   += SerialChannelOnCommandHearedWithReplyPossibility;
            _channel.TimeoutMonitor.SomeCommandWasHeared         += CommandHearedTimeoutMonitorOnSomeCommandWasHeared;
            _channel.TimeoutMonitor.NoAnyCommandWasHearedTooLong += CommandHearedTimeoutMonitorOnNoAnyCommandWasHearedTooLong;

            _channelWithIoProgress = _channel.Channel as ISerialChannelWithIoProgress;
            if (_channelWithIoProgress != null)
            {
                _channelWithIoProgress.ProgressChanged += ChannelWithIoProgressOnProgressChanged;
            }


            GetPortsAvailable();

            _logger.Log("Канал обмена добавлен");
        }
Ejemplo n.º 5
0
 public SearchViewModel(IThreadNotifier uiNotifier)
 {
     _uiNotifier    = uiNotifier;
     _rootGroups    = new List <IDisplayGroup>();
     ResultParamsVm = new GroupParamViewModel("Результаты поиска");
     _searchWorker  = new SingleThreadedRelayQueueWorkerProceedAllItemsBeforeStopNoLog <Action>("SearchTw", a => a(), ThreadPriority.BelowNormal, true, null);
 }
Ejemplo n.º 6
0
        public MukVaporizerSetParamsViewModel(IThreadNotifier uiNotifier, IParameterSetter parameterSetter)
        {
            SettableParam324 = new SettableParameterViewModel(324, "Zone зона нечувствительности ПИДа", 65535.0, 0.0,
                                                              null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam325 = new SettableParameterViewModel(325, "Td дифференциальная составляющая", 65535.0, 0.0,
                                                              null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam326 = new SettableParameterViewModel(326, "Kp коеффициент пропорциональности", 65535.0, 0.0,
                                                              null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam327 = new SettableParameterViewModel(327, "T_i интегральная составляющая", 65535.0, 0.0, null,
                                                              "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam328 = new SettableParameterViewModel(328, "T_0 время вызова ПИДа", 65535.0, 0.0, null, "f0",
                                                              new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);

            SettableParam329 = new SettableParameterViewModel(329, "Ручной/автоматический режим. 1 = ручной режим", 1.0,
                                                              0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam330 = new SettableParameterViewModel(330, "Уставка уровень вентилир.в ручном режиме 0 - 4",
                                                              4.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);

            SettableParam331 = new SettableParameterViewModel(331, "Уровень вентилирования 1 в режиме настройки; 0-255",
                                                              255.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam332 = new SettableParameterViewModel(332, "Уровень вентилирования 2 в режиме настройки; 0-255",
                                                              255.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam333 = new SettableParameterViewModel(333, "Уровень вентилирования 3 в режиме настройки; 0-255",
                                                              255.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam334 = new SettableParameterViewModel(334, "Уровень вентилирования 4 в режиме настройки; 0-255",
                                                              255.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam335 = new SettableParameterViewModel(335, "Настроечный параметр регулятора отопления", 65535.0,
                                                              0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
        }
Ejemplo n.º 7
0
        public ParameterSetterViewModelSimple(IParameterSetter parameterSetter, IThreadNotifier uiNotifier,
                                              IParameterInjectionConfiguration injectionConfiguration)
        {
            _uiNotifier     = uiNotifier;
            CustomValueList = injectionConfiguration.PreselectedValueList;

            _lastSet = LastSetStateResult.Unknown;

            // TODO: follow https://reactiveui.net/docs/guidelines/framework/prefer-oaph-over-properties
            var x = this.WhenAnyValue(vm => vm.SelectedValue).Subscribe(val => Value = val.Value);

            _setValue = ReactiveCommand.Create(() =>
            {
                Console.WriteLine($"Setting for param {injectionConfiguration.ZeroBasedParameterNumber} value " +
                                  injectionConfiguration.GetValue(_value));
                parameterSetter.SetParameterAsync(injectionConfiguration.ZeroBasedParameterNumber,
                                                  injectionConfiguration.GetValue(_value), ex =>
                {
                    _uiNotifier.Notify(() =>
                    {
                        if (ex != null)
                        {
                            LastSet = LastSetStateResult.Unsuccess;
                        }
                        else
                        {
                            LastSet = LastSetStateResult.Success;
                        }
                    });
                });
            });
        }
 public MukWarmFloorSetParamsViewModel(IThreadNotifier uiNotifier, IParameterSetter parameterSetter)
 {
     SettableParam519 = new SettableParameterViewModel(519, "5.19 Резерв", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
     SettableParam520 = new SettableParameterViewModel(520, "5.20 Резерв", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
     SettableParam521 = new SettableParameterViewModel(521, "5.21 Резерв", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
     SettableParam522 = new SettableParameterViewModel(522, "5.22 Резерв", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
 }
Ejemplo n.º 9
0
 public TabInterfaceBuilder(IThreadNotifier mainWindowUiUiNotifier, ICmdListener <IList <byte> > cmdListenerWinSum03Reply, ICmdListener <IMukFlapAirWinterSummerRequest16Data> cmdListener16Request, IParameterLogger parameterLogger, IParameterSetter parameterSetter)
 {
     _uiNotifier = mainWindowUiUiNotifier;
     _cmdListenerWinSum03Reply = cmdListenerWinSum03Reply;
     _cmdListener16Request     = cmdListener16Request;
     _parameterLogger          = parameterLogger;
     _parameterSetter          = parameterSetter;
 }
Ejemplo n.º 10
0
        /// <summary>
        /// Инициализирует новый экземпляр класса
        /// </summary>
        public Loader()
        {
            _psnInternalConfigurations = new Lazy <List <IPsnInternalConfiguration> >(() => LoadPsnConfigurations(Path.Combine(typeof(Loader).GetAssemblyDirectoryPath(), "defaults")).ToList());
            var bqw = new BackgroundQueueWorker <Action>(a => a());

            _backWorker = bqw;
            _uiNotifier = bqw;
        }
Ejemplo n.º 11
0
        public BvsDataViewModel(IThreadNotifier notifier, ICmdListener <IBvsReply65Telemetry> cmdListenerBvsReply65)
        {
            _notifier = notifier;
            _cmdListenerBvsReply65 = cmdListenerBvsReply65;
            BvsReply41TextVm       = new AnyCommandPartViewModel();

            _cmdListenerBvsReply65.DataReceived += CmdListenerBvsReply65OnDataReceived;
        }
Ejemplo n.º 12
0
        public SdTabInterfaceBuilder(IThreadNotifier mainWindowUiUiNotifier, ICmdListener <IList <BytesPair> > cmdListenerKsmParams, IParameterLogger parameterLogger, IParameterSetter parameterSetter, AppVersion version)
        {
            _uiNotifier           = mainWindowUiUiNotifier;
            _cmdListenerKsmParams = cmdListenerKsmParams;

            _parameterLogger = parameterLogger;
            _parameterSetter = parameterSetter;
            _version         = version;
        }
Ejemplo n.º 13
0
        public SystemDiagCabinViewModel(
            bool isFullVersion,
            bool isHalfOrFullVersion,
            bool appAbilitiesIsHourCountersVisible,
            IThreadNotifier uiNotifier,
            CmdListenerBase <IMukFlapAirReply03Telemetry> cmdListenerMukFlapAirReply03,
            CmdListenerBase <IMukFanVaporizerDataReply03> cmdListenerMukVaporizerReply03,
            CmdListenerBase <IMukFanVaporizerDataRequest16> cmdListenerMukVaporizerRequest16,
            CmdListenerBase <IMukWarmFloorReply03Data> cmdListenerMukWarmFloorReply03,
            CmdListenerBase <IList <BytesPair> > cmdListenerKsmParams,
            CmdListenerBase <IBsSmRequest32Data> cmdListenerBsSm32Request,
            CmdListenerBase <IBsSmReply32Data> cmdListenerBsSm32Reply,
            CmdListenerBase <IBvsReply65Telemetry> cmdListenerBvsReply65)
        {
            IsFullVersion       = isFullVersion;
            IsHalfOrFullVersion = isHalfOrFullVersion;

            _uiNotifier = uiNotifier;
            _cmdListenerMukFlapAirReply03     = cmdListenerMukFlapAirReply03;
            _cmdListenerMukVaporizerReply03   = cmdListenerMukVaporizerReply03;
            _cmdListenerMukVaporizerRequest16 = cmdListenerMukVaporizerRequest16;
            _cmdListenerMukWarmFloorReply03   = cmdListenerMukWarmFloorReply03;
            _cmdListenerKsm           = cmdListenerKsmParams;
            _cmdListenerBsSm32Request = cmdListenerBsSm32Request;
            _cmdListenerBsSm32Reply   = cmdListenerBsSm32Reply;
            _cmdListenerBvs1Reply65   = cmdListenerBvsReply65;


            _cmdListenerMukFlapAirReply03.DataReceived   += CmdListenerMukFlapAirReply03OnDataReceived;
            _cmdListenerMukVaporizerReply03.DataReceived += CmdListenerMukVaporizerReply03OnDataReceived;
            _cmdListenerMukWarmFloorReply03.DataReceived += CmdListenerMukWarmFloorReply03OnDataReceived;
            _cmdListenerKsm.DataReceived           += CmdListenerKsmOnDataReceived;
            _cmdListenerBsSm32Request.DataReceived += CmdListenerBsSm32RequestDataReceived;
            _cmdListenerBsSm32Reply.DataReceived   += CmdListenerBsSm32ReplyDataReceived;
            _cmdListenerBvs1Reply65.DataReceived   += CmdListenerBvs1Reply65OnDataReceived;

            ResetVmPropsToDefaultValues();
            AutoVm1 = new AutoViewModel("Контроль термостата предельной температуры в нагнетательной линии компрессора");
            AutoVm2 = new AutoViewModel("Контроль включения автомата компрессора к сети 380В");
            AutoVm3 = new AutoViewModel("Контроль включения автомата питания вентилятора конденсатора 110В");
            AutoVm4 = new AutoViewModel("Контроль включения автомата питания калорифера к сети 380В");
            AutoVm5 = new AutoViewModel("Контроль включения автомата питания пола к сети 380 в");
            AutoVm6 = new AutoViewModel("Контроль включения автомата питания вентилятора испарителя к сети 110В");
            AutoVm7 = new AutoViewModel("Контроль срабатывания термостата предельной температуры 120°С калорифера");

            AutoVm8  = new AutoViewModel("Контроль включения управляющего контактора подачи напряжения 380В на калорифер");
            AutoVm9  = new AutoViewModel("Контроль срабатывания контактора подачи 380В на обогрев пола");
            AutoVm10 = new AutoViewModel("Контроль срабатывания пускового контактора компрессора");

            BsSmFaultVm1 = new BsSmFaultViewModel();
            BsSmFaultVm2 = new BsSmFaultViewModel();
            BsSmFaultVm3 = new BsSmFaultViewModel();
            BsSmFaultVm4 = new BsSmFaultViewModel();
            BsSmFaultVm5 = new BsSmFaultViewModel();
        }
Ejemplo n.º 14
0
        public CommandPartViewModelSimple(ICommandPartListener listener, IThreadNotifier uiNotifier,
                                          IPsnProtocolCommandPartConfiguration config)
        {
            _listener   = listener;
            _uiNotifier = uiNotifier;
            _config     = config;

            _listener.CommandPartReceived += ListenerValueReceived;
            _dataText       = "?";
            ReceiveTimeText = "?";
        }
		public MukFlapWinterSummerSetParamsViewModel(IThreadNotifier uiNotifier, IParameterSetter parameterSetter) {
			SettableParam827 = new SettableParameterViewModel(827, "Ручной/автоматический режим. 1 = ручной режим", 1.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam828 = new SettableParameterViewModel(828, "Уставка ШИМ на заслонку в ручном режиме 0 - 255", 255.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam829 = new SettableParameterViewModel(829, "H – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam830 = new SettableParameterViewModel(830, "I – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam831 = new SettableParameterViewModel(831, "J – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam832 = new SettableParameterViewModel(832, "A – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam833 = new SettableParameterViewModel(833, "E – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam834 = new SettableParameterViewModel(834, "C – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
			SettableParam835 = new SettableParameterViewModel(835, "D – параметр драйвера 1w", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
		}
Ejemplo n.º 16
0
 public RelayRepository(Func <IReposetoryOpenedResult> openStorageFunc, IKeyValueStorageHolder kvStorageHolder, IThreadNotifier uiNotifier, IWorker <Action> bgNotifier, string repoName)
 {
     _openStorageFunc = openStorageFunc;
     _kvStorageHolder = kvStorageHolder;
     _sync            = new object();
     _backWorker      = bgNotifier;
     _repoName        = repoName;
     _uiNotifier      = uiNotifier;
     _locomotives     = new ObservableCollection <ILocomotive>();        // we assumed that ctor called from UI
     _locomotives.CollectionChanged += LocomotivesOnCollectionChanged;
 }
Ejemplo n.º 17
0
 public RecordViewModel(IThreadNotifier notifier, IWindowSystem windowSystem)
 {
     _notifier           = notifier;
     _windowSystem       = windowSystem;
     _isRecording        = false;
     _recordedData       = new List <IList <byte> >();
     _startRecordCommand = new DependedCommand(StartRecord, () => !IsRecording);
     _stopRecordCommand  = new DependedCommand(StopRecord, () => IsRecording);
     _startRecordCommand.AddDependOnProp(this, () => IsRecording);
     _stopRecordCommand.AddDependOnProp(this, () => IsRecording);
 }
Ejemplo n.º 18
0
        public BsSmDataViewModel(IThreadNotifier notifier, ICmdListener <IBsSmRequest32Data> cmdListenerBsSmRequest32, ICmdListener <IBsSmReply32Data> cmdListenerBsSmReply32)
        {
            _notifier = notifier;
            _cmdListenerBsSmRequest32 = cmdListenerBsSmRequest32;
            _cmdListenerBsSmReply32   = cmdListenerBsSmReply32;

            BsSmRequest32DataBytes = new AnyCommandPartViewModel();
            BsSmReply32DataBytes   = new AnyCommandPartViewModel();

            _cmdListenerBsSmRequest32.DataReceived += CmdListenerBsSmRequest32OnDataReceived;
            _cmdListenerBsSmReply32.DataReceived   += CmdListenerBsSmReply32OnDataReceived;
        }
        public MukVaporizerFanDataViewModelParamcentric(IThreadNotifier notifier,
                                                        IParameterSetter parameterSetter, IReceiverModbusRtu rtuReceiver,
                                                        ICmdListener <IMukFanVaporizerDataReply03> cmdListenerMukVaporizerReply03,
                                                        ICmdListener <IMukFanVaporizerDataRequest16> cmdListenerMukVaporizerRequest16)
        {
            _notifier = notifier;

            _cmdListenerMukVaporizerReply03 = cmdListenerMukVaporizerReply03;
            _cmdListenerMukVaporizerReply03.DataReceived += CmdListenerMukVaporizerReply03OnDataReceived;

            _cmdListenerMukVaporizerRequest16 = cmdListenerMukVaporizerRequest16;
            _cmdListenerMukVaporizerRequest16.DataReceived += CmdListenerMukVaporizerRequest16OnDataReceived;

            _children = new List <IGroupItem>();

            var pwmParameter = new ReceivableModbusRtuParameterSimpleViewModel("Уставка ШИМ на вентилятор", 3, 3, 0,
                                                                               new BytesPairNullableToStringThroughDoubleConverter(1.0, 0.0, false, true, "f0"));
            var t1Parameter = new ReceivableModbusRtuParameterSimpleViewModel("Температура 1wire адрес 1", 3, 3, 1,
                                                                              new BytesPairNullableToStringThroughOneWireConverter(0.01, 0.0, "f2", new BytesPair(0x85, 0x00)));
            var t2Parameter = new ReceivableModbusRtuParameterSimpleViewModel("Температура 1wire адрес 2", 3, 3, 2,
                                                                              new BytesPairNullableToStringThroughOneWireConverter(0.01, 0.0, "f2", new BytesPair(0x85, 0x00)));
            var inputSignals = new ReceivableModbusRtuParameterSimpleViewModel("Байт входных сигналов (резерв)", 3, 3,
                                                                               3, new BytesPairNullableToStringThroughDoubleConverter(1.0, 0.0, false, true, "f0"));
            var outputSignals = new ReceivableModbusRtuParameterSimpleViewModel("Байт выходных сигналов (резерв)", 3, 3,
                                                                                4, new BytesPairNullableToStringThroughDoubleConverter(1.0, 0.0, false, true, "f0"));
            var pwmCalorifer = new ReceivableModbusRtuParameterSimpleViewModel("ШИМ на калорифер", 3, 3, 5,
                                                                               new BytesPairNullableToStringThroughDoubleConverter(1.0, 0.0, false, true, "f0"));
            var workStage = new ReceivableModbusRtuParameterSimpleViewModel("Этап работы", 3, 3, 6,
                                                                            new BytesPairNullableToStringThroughVaporizerFanWorkstageConverter());


            rtuReceiver.RegisterParamToReceive(pwmParameter);
            rtuReceiver.RegisterParamToReceive(t1Parameter);
            rtuReceiver.RegisterParamToReceive(t2Parameter);
            rtuReceiver.RegisterParamToReceive(inputSignals);
            rtuReceiver.RegisterParamToReceive(outputSignals);
            rtuReceiver.RegisterParamToReceive(pwmCalorifer);
            rtuReceiver.RegisterParamToReceive(workStage);

            _children.Add(pwmParameter);
            _children.Add(t1Parameter);
            _children.Add(t2Parameter);

            _children.Add(inputSignals);
            _children.Add(outputSignals);
            _children.Add(pwmCalorifer);
            _children.Add(workStage);

            MukFanVaporizerDataReply03Text = new AnyCommandPartViewModel();
            Request16TelemetryText         = new AnyCommandPartViewModel();
            MukVaporizerSetParamsVm        = new MukVaporizerSetParamsViewModel(notifier, parameterSetter);
        }
Ejemplo n.º 20
0
        public BsSmDataViewModel(IThreadNotifier notifier, ICmdListener <IBsSmAndKsm1DataCommand32Request> cmdListenerBsSmRequest32, ICmdListener <IBsSmAndKsm1DataCommand32Reply> cmdListenerBsSmReply32)
        {
            _notifier = notifier;

            BsSmAndKsm1RequestDataTextVm = new AnyCommandPartViewModel();
            BsSmAndKsm1ReplyDataTextVm   = new AnyCommandPartViewModel();

            _cmdListenerBsSmRequest32 = cmdListenerBsSmRequest32;
            _cmdListenerBsSmReply32   = cmdListenerBsSmReply32;

            _cmdListenerBsSmRequest32.DataReceived += CmdListenerBsSmRequest32OnDataReceived;
            _cmdListenerBsSmReply32.DataReceived   += CmdListenerBsSmReply32OnDataReceived;
        }
Ejemplo n.º 21
0
 public TabInterfaceBuilder(
     IThreadNotifier mainWindowUiUiNotifier,
     ICmdListener <IMukFanVaporizerDataReply03> cmdListenerEvaporator03Reply,
     ICmdListener <IMukFanVaporizerDataRequest16> cmdListenerEvaporator16Request,
     IParameterLogger parameterLogger,
     IParameterSetter parameterSetter)
 {
     _uiNotifier = mainWindowUiUiNotifier;
     _cmdListenerEvaporator03Reply   = cmdListenerEvaporator03Reply;
     _cmdListenerEvaporator16Request = cmdListenerEvaporator16Request;
     _parameterLogger = parameterLogger;
     _parameterSetter = parameterSetter;
 }
        public MukAirExhausterDataViewModel(IThreadNotifier notifier, IParameterSetter parameterSetter, ICmdListener <IMukAirExhausterReply03Data> cmdListenerMukAirExhausterReply03, ICmdListener <IMukFanAirExhausterRequest16Data> cmdListenerMukAirExhausterRequest16)
        {
            _notifier = notifier;
            _cmdListenerMukAirExhausterReply03   = cmdListenerMukAirExhausterReply03;
            _cmdListenerMukAirExhausterRequest16 = cmdListenerMukAirExhausterRequest16;

            Reply03TelemetryText   = new AnyCommandPartViewModel();
            Request16TelemetryText = new AnyCommandPartViewModel();

            MukAirExhausterSetParamsVm = new MukAirExhausterSetParamsViewModel(notifier, parameterSetter);

            _cmdListenerMukAirExhausterReply03.DataReceived   += CmdListenerMukAirExhausterReply03OnDataReceived;
            _cmdListenerMukAirExhausterRequest16.DataReceived += CmdListenerMukAirExhausterRequest16OnDataReceived;
        }
Ejemplo n.º 23
0
        public MukWarmFloorDataViewModel(IThreadNotifier notifier, IParameterSetter parameterSetter, ICmdListener <IMukWarmFloorReply03Data> reply03Listener, ICmdListener <IMukWarmFloorRequest16Data> request16Listener)
        {
            _notifier          = notifier;
            _reply03Listener   = reply03Listener;
            _request16Listener = request16Listener;

            Reply03BytesTextVm   = new AnyCommandPartViewModel();
            Request16BytesTextVm = new AnyCommandPartViewModel();

            MukWarmFloorSetParamsVm = new MukWarmFloorSetParamsViewModel(notifier, parameterSetter);

            _reply03Listener.DataReceived   += Reply03ListenerOnDataReceived;
            _request16Listener.DataReceived += Request16ListenerOnDataReceived;
        }
 public SettableDropdownParameterViewModel(
     int paramIndex,
     string name,
     TRaw?defaultValue,
     IBuilderOneToOne <TRaw, string> stringBuilder,
     List <IRawAndConvertedValues <TRaw, string> > dropItems,
     string toolTipText,
     IParameterSetter parameterSetter,
     IThreadNotifier uiNotifier,
     IBuilderOneToOne <TRaw, BytesPair> sendConverter)
     : base(paramIndex, name, defaultValue, stringBuilder, toolTipText, parameterSetter, uiNotifier, sendConverter)
 {
     DropItems = dropItems;
 }
Ejemplo n.º 25
0
        public MukFridgeSetParamsViewModel(IThreadNotifier uiNotifier, IParameterSetter parameterSetter)
        {
            SettableParam415 = new SettableParameterViewModel(415, "Zone зона нечувствительности ПИДа", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam416 = new SettableParameterViewModel(416, "Td дифференциальная составляющая", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam417 = new SettableParameterViewModel(417, "Kp коеффициент пропорциональности", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam418 = new SettableParameterViewModel(418, "T_i интегральная составляющая", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam419 = new SettableParameterViewModel(419, "T_0 время вызова ПИДа", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);

            SettableParam420 = new SettableParameterViewModel(420, "Ручной/автоматический режим. 1 = ручной режим", 1.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam421 = new SettableParameterViewModel(421, "Уставка уровень вентилир.в ручном режиме 0 - 3", 3.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);

            SettableParam422 = new SettableParameterViewModel(422, "Ограничение  максимального ШИМа в режиме настройки", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam423 = new SettableParameterViewModel(423, "Ограничение  максимального ШИМа стоянки в режиме настройки", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
            SettableParam424 = new SettableParameterViewModel(424, "Ограничение  минимального ШИМа", 65535.0, 0.0, null, "f0", new DoubleBytesPairConverterSimpleUshort(), parameterSetter, uiNotifier, null);
        }
Ejemplo n.º 26
0
        public TabInterfaceBuilderFc(
            IThreadNotifier mainWindowUiUiNotifier,
            ICmdListener <IRequestF0> cmdListenerFcRequest,
            ICmdListener <IReplyF0> cmdListenerFcReply,
            IParameterLogger parameterLogger,
            IParameterSetter parameterSetter)
        {
            _uiNotifier = mainWindowUiUiNotifier;

            _cmdListenerFcRequest = cmdListenerFcRequest;
            _cmdListenerFcReply   = cmdListenerFcReply;

            _parameterLogger = parameterLogger;
            _parameterSetter = parameterSetter;
        }
Ejemplo n.º 27
0
        public TestSystemViewModel(IThreadNotifier uiNotifier, string testName, ITestSysAsync asyncTest, Colors testCompleteColor)
        {
            _uiNotifier             = uiNotifier;
            TestName                = testName;
            AssociatedWithModelTest = asyncTest;
            TestCompleteColor       = testCompleteColor;


            _runTestAsync = new DependedCommand(RunTest, () => !IsRunningTest);
            _runTestAsync.AddDependOnProp(this, () => IsRunningTest);

            _cancelTestAsync = new DependedCommand(CancelTest, () => IsRunningTest);
            _cancelTestAsync.AddDependOnProp(this, () => IsRunningTest);

            TestLogLines = new ObservableCollection <LogLineColored>();
        }
Ejemplo n.º 28
0
        public ChartViewModel(IThreadNotifier uiNotifier, List <Color> colors)
        {
            _uiNotifier = uiNotifier;
            _colors     = colors;
            _usedColors = new List <Color>();
            _logs       = new Dictionary <string, PointsSeriesAndAdditionalData>();


            AnalogSeries   = new ObservableCollection <IChartSeriesViewModel>();
            DiscreteSeries = new ObservableCollection <IChartSeriesViewModel>();

            AnalogSeriesAdditionalData   = new ObservableCollection <ISeriesAdditionalData>();
            DiscreteSeriesAdditionalData = new ObservableCollection <ISeriesAdditionalData>();

            AnalogSeries.CollectionChanged   += AnalogSeriesOnCollectionChanged;
            DiscreteSeries.CollectionChanged += DiscreteSeriesOnCollectionChanged;
        }
Ejemplo n.º 29
0
        private void QueueBackgroundWorkerTest()
        {
            Log("QueueBackgroundWorkerTest");
            var bw = new QueueBackWorker <Action>(action => action());

            _queueWorker = bw;
            _uiNotifier  = bw;

            for (int i = 0; i < 10; ++i)
            {
                var i1 = i;
                _queueWorker.AddToExecutionQueue(() => {
                    Log("Hello" + i1);
                    _uiNotifier.Notify(() => Log("World" + i1));
                });
            }
        }
Ejemplo n.º 30
0
        public MukFridgeFanDataViewModel(
            IThreadNotifier notifier,
            IParameterSetter parameterSetter,
            ICmdListener <IMukCondensorFanReply03Data> cmdListenerMukFridgeFanReply03,
            ICmdListener <IMukCondenserRequest16Data> cmdListenerMukCondenserRequest16)
        {
            _notifier = notifier;
            _cmdListenerMukFridgeFanReply03   = cmdListenerMukFridgeFanReply03;
            _cmdListenerMukCondenserRequest16 = cmdListenerMukCondenserRequest16;

            Reply03DataText = new AnyCommandPartViewModel();

            Request16DataText    = new AnyCommandPartViewModel();
            MukFridgeSetParamsVm = new MukFridgeSetParamsViewModel(notifier, parameterSetter);

            _cmdListenerMukFridgeFanReply03.DataReceived   += CmdListenerMukFridgeFanReply03OnDataReceived;
            _cmdListenerMukCondenserRequest16.DataReceived += CmdListenerMukCondenserRequest16OnDataReceived;
        }