Exemplo n.º 1
0
        public OscilloscopeJournalViewModel(IValueViewModelFactory valueViewModelFactory,
                                            ILocalizerService localizerService, Func <IBoolValue> boolValueGettingFunc,
                                            ILoadingSequenceLoaderRegistry loadingSequenceLoaderRegistry, IJournalLoaderProvider journalLoaderProvider, OscillogramLoader oscillogramLoader)
        {
            this._valueViewModelFactory    = valueViewModelFactory;
            this._localizerService         = localizerService;
            this._boolValueGettingFunc     = boolValueGettingFunc;
            _loadingSequenceLoaderRegistry = loadingSequenceLoaderRegistry;
            _journalLoaderProvider         = journalLoaderProvider;
            _oscillogramLoader             = oscillogramLoader;
            this.LoadCommand  = new RelayCommand(this.OnLoadExecute);
            this.SelectedRows = new List <int>();
            _loaderHooks      = new LoaderHooks(() =>
            {
                Table = new DynamicDataTable(this.JournalParametersNameList, null, true);
                RaisePropertyChanged(nameof(this.Table));
                RaisePropertyChanged(nameof(this.JournalParametersNameList));
            }, list =>
            {
                List <IFormattedValueViewModel> formattedValueViewModels = new List <IFormattedValueViewModel>();
                int index                   = this.Table.GetCurrentValueCount();
                IBoolValue boolValue        = this._boolValueGettingFunc();
                boolValue.BoolValueProperty = this._oscillogramLoader.TryGetOscillogram(index, out string s, _oscilloscopeViewModel, _oscilloscopeModel, _oscilloscopeViewModel.DeviceContext);
                formattedValueViewModels.Add(this._valueViewModelFactory.CreateFormattedValueViewModel(boolValue));
                formattedValueViewModels.AddRange(list.Select((formattedValue =>
                                                               this._valueViewModelFactory.CreateFormattedValueViewModel(formattedValue))).ToList());

                this.Table.AddFormattedValueViewModel(formattedValueViewModels);
            });
Exemplo n.º 2
0
 public JournalLoader(DeviceContext deviceContext, IUniconJournal uniconJournal, LoaderHooks loaderHooks)
 {
     _deviceContext         = deviceContext;
     _uniconJournal         = uniconJournal;
     _loaderHooks           = loaderHooks;
     _journalRecordFactory  = StaticContainer.Container.Resolve <IJournalRecordFactory>();
     _valueViewModelFactory = StaticContainer.Container.Resolve <IValueViewModelFactory>();
 }
Exemplo n.º 3
0
        public ConnectionStateViewModel(IValueViewModelFactory valueViewModelFactory,
                                        IConnectionService connectionService)
        {
            _valueViewModelFactory  = valueViewModelFactory;
            this._connectionService = connectionService;
            CheckConnectionCommand  = new RelayCommand(OnCheckConnectionExecute);

            _semaphoreSlim   = new SemaphoreSlim(1);
            IndicatorOpacity = 1;
        }
 public DeviceDataPropertyMemorySubscription(IProperty property,
                                             ILocalAndDeviceValueContainingViewModel localAndDeviceValueContainingViewModel,
                                             IValueViewModelFactory valueViewModelFactory, DeviceContext deviceContext, ushort offset)
 {
     _property = property;
     _localAndDeviceValueContainingViewModel = localAndDeviceValueContainingViewModel;
     _valueViewModelFactory = valueViewModelFactory;
     _deviceContext         = deviceContext;
     _offset = offset;
 }
Exemplo n.º 5
0
        public UniconJournalViewModel(ILocalizerService localizerService,
                                      IFragmentOptionsViewModel fragmentOptionsViewModel,
                                      Func <IFragmentOptionGroupViewModel> fragmentOptionGroupViewModelgetFunc,
                                      Func <IFragmentOptionCommandViewModel> fragmentOptionCommandViewModelgetFunc,
                                      IApplicationGlobalCommands applicationGlobalCommands, ITypesContainer typesContainer, ILogService logService
                                      , IApplicationSettingsService applicationSettingsService, IJournalLoaderProvider journalLoaderProvider,
                                      IValueViewModelFactory valueViewModelFactory)

        {
            _localizerService          = localizerService;
            _applicationGlobalCommands = applicationGlobalCommands;
            _typesContainer            = typesContainer;
            _logService = logService;
            _applicationSettingsService = applicationSettingsService;
            _journalLoaderProvider      = journalLoaderProvider;
            _valueViewModelFactory      = valueViewModelFactory;
            IFragmentOptionGroupViewModel fragmentOptionGroupViewModel = fragmentOptionGroupViewModelgetFunc();

            fragmentOptionGroupViewModel.NameKey = "Device";
            IFragmentOptionCommandViewModel fragmentOptionCommandViewModel = fragmentOptionCommandViewModelgetFunc();

            fragmentOptionCommandViewModel.TitleKey = "Load";
            fragmentOptionCommandViewModel.IconKey  = IconResourceKeys.IconInboxIn;
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);
            LoadCommand = new RelayCommand(OnLoadJournal, CanLoadExecute);
            fragmentOptionCommandViewModel.OptionCommand = LoadCommand;
            fragmentOptionsViewModel.FragmentOptionGroupViewModels.Add(fragmentOptionGroupViewModel);

            fragmentOptionCommandViewModel               = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey      = "Open";
            fragmentOptionCommandViewModel.IconKey       = IconResourceKeys.IconDiscUpload;
            fragmentOptionCommandViewModel.OptionCommand = new RelayCommand(OnExecuteLoadJournal);
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);

            fragmentOptionCommandViewModel               = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey      = "Save";
            fragmentOptionCommandViewModel.IconKey       = IconResourceKeys.IconDiscDownload;
            fragmentOptionCommandViewModel.OptionCommand = new RelayCommand(OnExecuteSaveJournal);
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);

            fragmentOptionCommandViewModel               = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey      = ApplicationGlobalNames.UiCommandStrings.SAVE_FOR_PRINT;
            fragmentOptionCommandViewModel.IconKey       = IconResourceKeys.IconPrintText;
            fragmentOptionCommandViewModel.OptionCommand = new RelayCommand(OnExecuteExportJournal);
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);

            _loaderHooks = new LoaderHooks(
                () => { Table.Values.Clear(); }, list =>
            {
                Table.AddFormattedValueViewModel(list.Select(formattedValue =>
                                                             _valueViewModelFactory.CreateFormattedValueViewModel(formattedValue)).ToList());
            });
            FragmentOptionsViewModel = fragmentOptionsViewModel;
            CanExecuteJournalLoading = true;
        }
Exemplo n.º 6
0
 public JournalRecordViewModelFactory(ITypesContainer container, IValueViewModelFactory valueViewModelFactory)
 {
     _container             = container;
     _valueViewModelFactory = valueViewModelFactory;
 }
 public RuntimeConfigurationItemViewModelFactory(ITypesContainer container, DeviceContext deviceContext)
 {
     _container             = container;
     _deviceContext         = deviceContext;
     _valueViewModelFactory = new ValueViewModelFactoryWrapper(_container.Resolve <IValueViewModelFactory>());
 }
 public ValueViewModelFactoryWrapper(IValueViewModelFactory viewModelFactory)
 {
     _viewModelFactory = viewModelFactory;
 }