コード例 #1
0
        public ProgrammingViewModel(ProgramModel model, LogicDeviceProvider logicDeviceProvider,
                                    LogicElementsFactory elementsFactory, IApplicationGlobalCommands globalCommands, ISerializerService serializerService)
        {
            this._programModel = model;
            this._applicationGlobalCommands = globalCommands;
            this._elementsFactory           = elementsFactory;

            this._serializerService   = serializerService;
            this._logicDeviceProvider = logicDeviceProvider;

            this.SchemesCollection    = new ObservableCollection <SchemeTabViewModel>();
            this.ElementsLibrary      = new ObservableCollection <LogicElementViewModel>();
            this.ConnectionCollection = new ObservableCollection <ConnectionViewModel>();

            this.NewSchemeCommand     = new RelayCommand(this.CreateNewScheme);
            this.SaveProjectCommand   = new RelayCommand(this.SaveProject, this.CanSaveProject);
            this.LoadProjectCommand   = new RelayCommand(this.LoadProject);
            this.DeleteCommand        = new RelayCommand(this.DeleteSelectedElements, this.CanDelete);
            this.ZoomIncrementCommand = new RelayCommand(this.ZoomIncrement, this.CanZooming);
            this.ZoomDecrementCommand = new RelayCommand(this.ZoomDecrement, this.CanZooming);

            this.WriteLogicCommand  = new RelayCommand(this.OnWriteCommand, this.CanWriteLogic);
            this.ReadLogicCommand   = new RelayCommand(this.OnReadCommand, this.CanReadLogic);
            this.StopEmulationLogic = new RelayCommand(this.OnStopEmulation);
        }
コード例 #2
0
 public ExcelExportService(ISerializerService serializerService,
                           IApplicationGlobalCommands applicationGlobalCommands, ILocalizerService localizerService)
 {
     _serializerService         = serializerService;
     _applicationGlobalCommands = applicationGlobalCommands;
     _localizerService          = localizerService;
 }
コード例 #3
0
        public DeviceSharedResourcesViewModel(Func <IResourceViewModel> resourceViewModelGettingFunc,
                                              ISharedResourcesEditorFactory sharedResourcesEditorFactory, ISerializerService serializerService,
                                              IApplicationGlobalCommands applicationGlobalCommands, ITypesContainer container)
        {
            ResourcesCollection           = new ObservableCollection <IResourceViewModel>();
            _resourceViewModelGettingFunc = resourceViewModelGettingFunc;
            _sharedResourcesEditorFactory = sharedResourcesEditorFactory;
            CloseCommand = new RelayCommand <object>(OnCloseExecute);
            OpenResourceForEditingCommand = new RelayCommand <object>(OnOpenResourceForEditingExecute);
            SelectResourceCommand         = new RelayCommand <object>(OnSelectExecute, CanExecuteSelectResource);
            DeleteResourceCommand         = new RelayCommand(OnDeleteExecute, CanExecuteDeleteResource);
            RenameResourceCommand         = new RelayCommand(OnRenameResourceExecute, CanExecuteRenameResource);

            _serializerService         = serializerService;
            _applicationGlobalCommands = applicationGlobalCommands;
            _container = container;

            SaveCommand = new RelayCommand(SaveResources);
            LoadCommand = new RelayCommand(LoadResources);

            //_lastPath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), DEFAULT_FOLDER);
            //_lastFileName = DEFAULT_FOLDER;
            //if (_lastPath != null && !Directory.Exists(_lastPath))
            //	{
            //	Directory.CreateDirectory(_lastPath);
            //	}
            //	else
            //	{
            //
            //	}
        }
コード例 #4
0
ファイル: OrViewModel.cs プロジェクト: Pepega-corp/Un2
 public OrViewModel(LogicElement model, IApplicationGlobalCommands globalCommands) : base(model, globalCommands)
 {
     this.ElementName = "ИЛИ";
     this.Description = "Логический элемент ИЛИ";
     this.Symbol      = "|";
     SetModel(_logicElementModel);
 }
コード例 #5
0
ファイル: TriggerViewModel.cs プロジェクト: Pepega-corp/Un2
 public TriggerViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
 {
     base._globalCommands     = globalCommands;
     _logicElementModel       = model;
     this.ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
     SetModel(_logicElementModel);
 }
コード例 #6
0
        public void EditFormatterByUser(List <IUshortFormattableEditorViewModel> ushortFormattableViewModel, List <IConfigurationItemViewModel> rootConfigurationItemViewModels)
        {
            IApplicationGlobalCommands applicationGlobalCommands =
                _container.Resolve <IApplicationGlobalCommands>();

            applicationGlobalCommands?.ShowWindowModal(() => new FormatterView(),
                                                       new FormatterSelectionViewModel(_container, ushortFormattableViewModel, rootConfigurationItemViewModels));
        }
コード例 #7
0
ファイル: ShellViewModel.cs プロジェクト: Pepega-corp/Un2
        public ShellViewModel
            (ILogService logService,
            ILogServiceViewModel logServiceViewModel,
            IDevicesContainerService devicesContainerService,
            IDialogCoordinator dialogCoordinator,
            IApplicationGlobalCommands applicationGlobalCommands,
            IRegionManager regionManager,
            ILocalizerService localizerService,
            IDeviceViewModelFactory deviceViewModelFactory,
            IFragmentPaneViewModelFactory fragmentPaneViewModelFactory,
            IProjectBrowserViewModel projectBrowserViewModel,
            IUniconProjectService uniconProjectService, ToolBarViewModel toolBarViewModel,
            RecentProjectsViewModelFactory recentProjectsViewModelFactory,
            IMainMenuService mainMenuService,
            DynamicMainMenuViewModel dynamicMainMenuViewModel,
            IFlyoutService flyoutService
            , IGlobalEventManager globalEventManger)
        {
            LogServiceViewModel     = logServiceViewModel;
            ProjectBrowserViewModel = projectBrowserViewModel;
            LogService = logService;
            _devicesContainerService = devicesContainerService;
            _devicesContainerService.ConnectableItemChanged += OnDeviceChanged;
            _dialogCoordinator            = dialogCoordinator;
            _applicationGlobalCommands    = applicationGlobalCommands;
            _regionManager                = regionManager;
            _localizerService             = localizerService;
            _deviceViewModelFactory       = deviceViewModelFactory;
            _fragmentPaneViewModelFactory = fragmentPaneViewModelFactory;
            _uniconProjectService         = uniconProjectService;

            ExitCommand = new RelayCommand(OnExit);
            NavigateToDeviceEditorCommand = new RelayCommand(OnNavigateToDeviceEditor);
            NavigateToDeviceAddingCommand = new RelayCommand(OnNavigateToDeviceAddingExecute);
            NavigateToWebSyncViewCommand  = new RelayCommand(OnNavigateToWebSyncViewExecute);
            AddNewFragmentCommand         = new RelayCommand <IFragmentViewModel>(OnExecuteAddNewFragment);
            _fragmentsOpenedCollection    = new ObservableCollection <IFragmentPaneViewModel>();
            OpenOscillogramCommand        = new RelayCommand(OnOpenOscillogramExecute);
            OnClosingCommand  = new RelayCommand <CancelEventArgs>(OnExecuteClosing);
            AnchorableWindows = new ObservableCollection <IAnchorableWindow>
            {
                ProjectBrowserViewModel, LogServiceViewModel
            };
            ToolBarViewModel                = toolBarViewModel;
            DynamicMainMenuViewModel        = dynamicMainMenuViewModel;
            _recentProjectsViewModelFactory = recentProjectsViewModelFactory;
            _mainMenuService                = mainMenuService;
            StaticOptionsButtonsHelper.InitializeStaticButtons(this);
            NewProjectCommand        = new RelayCommand(OnNewProjectExecute);
            SaveProjectCommand       = new RelayCommand(OnSaveProjectExecute);
            SaveAsProjectCommand     = new RelayCommand(OnSaveAsProjectExecute);
            OpenProjectCommand       = new RelayCommand(OnOpenProjectExecute);
            OpenRecentProjectCommand = new RelayCommand <object>(OnOpenRecentProjectExecute);

            OnLoadedCommand = new RelayCommand(OnLoadedExecute);
            _uniconProjectService.SetDialogContext(this);
            _applicationGlobalCommands.SetGlobalDialogContext(this);
        }
コード例 #8
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;
        }
コード例 #9
0
 public AnalogMeasuringElementEditorViewModel(IFormatterEditorFactory formatterEditorFactory,
                                              IApplicationGlobalCommands applicationGlobalCommands,
                                              IDependenciesService dependenciesService, ISharedResourcesGlobalViewModel sharedResourcesGlobalViewModel)
 {
     _formatterEditorFactory         = formatterEditorFactory;
     _applicationGlobalCommands      = applicationGlobalCommands;
     _dependenciesService            = dependenciesService;
     _sharedResourcesGlobalViewModel = sharedResourcesGlobalViewModel;
     ShowFormatterParametersCommand  = new RelayCommand(OnShowFormatterParametersExecute);
     ShowDependenciesCommand         = new RelayCommand(OnShowDependenciesExecute);
 }
コード例 #10
0
ファイル: InversionViewModel.cs プロジェクト: Pepega-corp/Un2
        public InversionViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
        {
            base._globalCommands = globalCommands;
            _logicElementModel   = (Inversion)model;

            this.ElementName         = "НЕ";
            this.Description         = "Елемент инверсии логического сигнала";
            this.Symbol              = "~";
            this.ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
            SetModel(_logicElementModel);
        }
コード例 #11
0
 public SystemJournalViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
 {
     _globalCommands     = globalCommands;
     _model              = (SystemJournal)model;
     _logicElementModel  = _model;
     ElementName         = "Журнал Системы";
     Description         = "Елемент выходного дискретного сигнала Журнал Системы";
     Symbol              = "ЖС";
     ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
     OutputSignals       = new ObservableCollection <string>();
     SetModel(this._model);
 }
コード例 #12
0
ファイル: TimerViewModel.cs プロジェクト: Pepega-corp/Un2
        public TimerViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
        {
            this._globalCommands    = globalCommands;
            this._model             = (Timer)model;
            this._logicElementModel = model;

            this.ElementName         = "Таймер";
            this.Description         = "Логический элемент Таймер";
            this.Symbol              = "T";
            this.ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
            this.SetModel(this._model);
        }
コード例 #13
0
ファイル: OutputViewModel.cs プロジェクト: Pepega-corp/Un2
 public OutputViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
 {
     _globalCommands     = globalCommands;
     _outputModel        = (Output)model;
     _logicElementModel  = _outputModel;
     ElementName         = "Выход";
     Description         = "Елемент выходного дискретного сигнала";
     Symbol              = "Out";
     ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
     OutputSignals       = new ObservableCollection <string>();
     SetModel(this._outputModel);
 }
コード例 #14
0
        public ProgrammingEditorViewModel(IProgrammModelEditor model, IApplicationGlobalCommands globalCommands, ILogicElementEditorFactory logicElementEditorFactory)
        {
            this._model                     = model;
            this._model.LogBinSize          = 4096;
            this._globalCommands            = globalCommands;
            this._logicElementEditorFactory = logicElementEditorFactory;
            this.BooleanElements            = new ObservableCollection <ILogicElementEditorViewModel>(this._logicElementEditorFactory.GetBooleanElementsEditorViewModels());
            this.AnalogElements             = new ObservableCollection <ILogicElementEditorViewModel>(this._logicElementEditorFactory.GetAnalogElementsEditorViewModels());
            this.LibraryElements            = new ObservableCollection <ILogicElementEditorViewModel>();

            this.AddElementCommand    = new RelayCommand(this.OnAddElement);
            this.RemoveElementCommand = new RelayCommand(this.OnRemoveElement);
            this.EditElementCommand   = new RelayCommand <object>(this.OnEditElement);
        }
コード例 #15
0
 public DependentJournalParameterEditorViewModel(IDependentJournalParameter journalParameter,
                                                 IJournalConditionEditorViewModelFactory journalConditionEditorViewModelFactory,
                                                 IApplicationGlobalCommands applicationGlobalCommands, IFormatterEditorFactory formatterEditorFactory) : base(journalParameter)
 {
     this._journalConditionEditorViewModelFactory = journalConditionEditorViewModelFactory;
     this._applicationGlobalCommands = applicationGlobalCommands;
     this._formatterEditorFactory    = formatterEditorFactory;
     this.CancelCommand       = new RelayCommand <object>(this.OnCancel);
     this.SubmitCommand       = new RelayCommand <object>(this.OnSubmit);
     this.AddConditionCommand = new RelayCommand(this.OnAddConditionExecute);
     this.JournalConditionEditorViewModels = new ObservableCollection <IJournalConditionEditorViewModel>();
     this.DeleteConditionCommand           = new RelayCommand <object>(this.OnDeleteConditionExecute);
     this.ShowFormatterParameters          = new RelayCommand(this.OnShowFormatterParameters);
 }
コード例 #16
0
 public InputViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
 {
     this._globalCommands     = globalCommands;
     this._inputModel         = (Input)model;
     this._logicElementModel  = model;
     this._bases              = new List <string>();
     this._allInputSignals    = new List <Dictionary <int, string> >();
     this.ElementName         = "Вход";
     this.Description         = "Елемент входного дискретного сигнала";
     this.Symbol              = "In";
     this.Signals             = new ObservableCollection <string>();
     this.ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
     this.SetModel(this._inputModel);
 }
コード例 #17
0
 protected SimpleLogicElementViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
 {
     _logicElementModel   = model;
     this._globalCommands = globalCommands;
     AddInputCommand      = new RelayCommand(AddInput, CanAddInput);
     RemoveInputCommand   = new RelayCommand(RemoveInput, CanRemove);
     Inputs                   = new ObservableCollection <ConnectorViewModel>();
     Outputs                  = new ObservableCollection <ConnectorViewModel>();
     InputsForSettings        = new ObservableCollection <ConnectorViewModel>();
     OutputsForSettings       = new ObservableCollection <ConnectorViewModel>();
     this.ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
     this.ConnectorViewModels.CollectionChanged += OnConnectorsCollectionChanged;
     SetModel(model);
 }
コード例 #18
0
 public MeasuringGroupEditorViewModel(IMeasuringElementEditorViewModelFactory measuringElementEditorViewModelFactory, IApplicationGlobalCommands applicationGlobalCommands, ILogService logService)
 {
     _measuringElementEditorViewModelFactory = measuringElementEditorViewModelFactory;
     _applicationGlobalCommands = applicationGlobalCommands;
     _logService = logService;
     MeasuringElementEditorViewModels       = new ObservableCollection <IMeasuringElementEditorViewModel>();
     AddDiscretMeasuringElementCommand      = new RelayCommand(OnAddDiscretMeasuringElementExecute);
     AddDiscretMeasuringElementGroupCommand = new RelayCommand(OnAddDiscretMeasuringElementGroupCommandExecute);
     AddAnalogMeasuringElementCommand       = new RelayCommand(OnAddAnalogMeasuringElementExecute);
     DeleteMeasuringElementCommand          = new RelayCommand <object>(OnDeleteMeasuringElementExecute);
     AddControlSignalCommand         = new RelayCommand(OnAddControlSignalExecute);
     OpenPresentationSettingsCommand = new RelayCommand(OnOpenPresentationSettingsCommand);
     PresentationSettingsViewModel   = new PresentationSettingsViewModel(this, new Dictionary <Guid, PositioningInfoViewModel>());
     AddDateTimeCommand = new RelayCommand(OnAddDateTimeExecute);
 }
コード例 #19
0
        public void OpenResourceForEdit(IResourceViewModel resource, object _owner)
        {
            IApplicationGlobalCommands applicationGlobalCommands = _container.Resolve <IApplicationGlobalCommands>();

            if (applicationGlobalCommands != null)
            {
                IResourceEditingViewModel resourceEditingViewModel = _container.Resolve <IResourceEditingViewModel>();

                if (resource.RelatedEditorItemViewModel is IUshortsFormatter
                    formatter)
                {
                    //todo
                }
            }
        }
コード例 #20
0
 public DeviceViewModel(IDevicesContainerService devicesContainerService,
                        IConnectionStateViewModel connectionStateViewModel,
                        IDeviceLoggerViewModel deviceLoggerViewModel, IApplicationGlobalCommands applicationGlobalCommands,
                        ILoadAllService loadAllService, ISerializerService serializerService)
 {
     _devicesContainerService           = devicesContainerService;
     _applicationGlobalCommands         = applicationGlobalCommands;
     _loadAllService                    = loadAllService;
     _serializerService                 = serializerService;
     _fragmentViewModels                = new ObservableCollection <IFragmentViewModel>();
     NavigateToDeviceEditingCommand     = new RelayCommand(OnNavigateToDeviceEditing);
     DeleteSelectedDeviceCommand        = new RelayCommand(OnDeleteSelectedDevice);
     ConnectionStateViewModel           = connectionStateViewModel;
     DeviceLoggerViewModel              = deviceLoggerViewModel;
     NavigateToLoadAllFromDeviceCommand = new RelayCommand(OnNavigateToLoadAllWindow);
 }
コード例 #21
0
 public ComplexPropertyEditorViewModel(ITypesContainer container, IRangeViewModel rangeViewModel,
                                       ILocalizerService localizerService, IApplicationGlobalCommands applicationGlobalCommands,
                                       Func <ISharedBitViewModel> sharedBitViewModelGettingFunc) : base(container, rangeViewModel, localizerService)
 {
     _applicationGlobalCommands     = applicationGlobalCommands;
     _sharedBitViewModelGettingFunc = sharedBitViewModelGettingFunc;
     SubPropertyEditorViewModels    = new ObservableCollection <ISubPropertyEditorViewModel>();
     SubmitCommand = new RelayCommand <object>(OnSubmit);
     CancelCommand = new RelayCommand <object>(OnCancel);
     MainBitNumbersInWordCollection = new ObservableCollection <ISharedBitViewModel>();
     for (int i = 15; i >= 0; i--)
     {
         ISharedBitViewModel sharedBitViewModel = sharedBitViewModelGettingFunc();
         sharedBitViewModel.NumberOfBit = i;
         MainBitNumbersInWordCollection.Add(sharedBitViewModel);
     }
 }
コード例 #22
0
 public ComplexJournalParameterEditorViewModel(IComplexJournalParameter journalParameter,
                                               IJournalParametersEditorViewModelFactory journalParametersEditorViewModelFactory,
                                               IApplicationGlobalCommands applicationGlobalCommands, Func <ISharedBitViewModel> sharedBitViewModelGettingFunc) : base(journalParameter)
 {
     this._journalParametersEditorViewModelFactory = journalParametersEditorViewModelFactory;
     this._applicationGlobalCommands          = applicationGlobalCommands;
     this.SubJournalParameterEditorViewModels = new ObservableCollection <ISubJournalParameterEditorViewModel>();
     this.AddSubParameterCommand         = new RelayCommand(this.OnAddSubParameterExecute);
     this.SubmitCommand                  = new RelayCommand <object>(this.OnSubmit);
     this.CancelCommand                  = new RelayCommand <object>(this.OnCancel);
     this.DeleteParameterCommand         = new RelayCommand(this.OnDeleteParameterExecute, this.CanExecuteDeleteParameter);
     this.MainBitNumbersInWordCollection = new ObservableCollection <ISharedBitViewModel>();
     for (int i = 0; i < 16; i++)
     {
         ISharedBitViewModel sharedBitViewModel = sharedBitViewModelGettingFunc();
         sharedBitViewModel.NumberOfBit = i;
         this.MainBitNumbersInWordCollection.Add(sharedBitViewModel);
     }
 }
コード例 #23
0
        public ResultingDeviceViewModel(IDevice device, ITypesContainer container, ILocalizerService localizerService,
                                        IDeviceSharedResources deviceSharedResources, IApplicationGlobalCommands applicationGlobalCommands,
                                        ISharedResourcesGlobalViewModel sharedResourcesGlobalViewModel,
                                        IFragmentEditorViewModelFactory fragmentEditorViewModelFactory,
                                        IConnectionStateViewModelFactory connectionStateViewModelFactory, ISerializerService serializerService)
        {
            _device                          = device;
            _container                       = container;
            _deviceSharedResources           = deviceSharedResources;
            _applicationGlobalCommands       = applicationGlobalCommands;
            _sharedResourcesGlobalViewModel  = sharedResourcesGlobalViewModel;
            _fragmentEditorViewModelFactory  = fragmentEditorViewModelFactory;
            _connectionStateViewModelFactory = connectionStateViewModelFactory;
            _serializerService               = serializerService;

            DeviceName =
                localizerService.GetLocalizedString(ApplicationGlobalNames.DefaultStringsForUi.NEW_DEVICE_STRING);
            FragmentEditorViewModels = new ObservableCollection <IFragmentEditorViewModel>();
            sharedResourcesGlobalViewModel.InitializeFromResources(deviceSharedResources);
            NavigateToConnectionTestingCommand = new RelayCommand(OnNavigateToConnectionTestingExecute);
        }
コード例 #24
0
        public MeasuringMonitorEditorViewModel(ITypesContainer container,
                                               IMeasuringGroupEditorViewModelFactory measuringGroupEditorViewModelFactory,
                                               IMeasuringMonitor measuringMonitor, IApplicationGlobalCommands applicationGlobalCommands)
        {
            _container = container;
            _measuringGroupEditorViewModelFactory = measuringGroupEditorViewModelFactory;
            _measuringMonitor              = measuringMonitor;
            _applicationGlobalCommands     = applicationGlobalCommands;
            MeasuringGroupEditorViewModels = new ObservableCollection <IMeasuringGroupEditorViewModel>();
            AddMeasuringGroupCommand       = new RelayCommand(OnAddMeasuringGroupExecute);
            DeleteGroupCommand             = new RelayCommand <object>(OnDeleteGroupExecute);
            SetElementLeftCommand          = new RelayCommand <object>(OnSetElementLeftExecute, CanExecuteSetElementLeft);
            SetElementRightCommand         = new RelayCommand <object>(OnSetElementRightExecute, CanExecuteSetElementRight);
            CheckElementsPositionCommand   = new RelayCommand(() =>
            {
                (SetElementLeftCommand as RelayCommand <object>)?.RaiseCanExecuteChanged();
                (SetElementRightCommand as RelayCommand <object>)?.RaiseCanExecuteChanged();
            });
            var r = new GongSolutions.Wpf.DragDrop.DefaultDragHandler();

            OpenConfigurationSettingsCommand = new RelayCommand(OnOpenConfigurationSettingsExecute);
        }
コード例 #25
0
 public DeviceEditorViewModel(ILocalizerService localizerService, IDialogCoordinator dialogCoordinator,
                              IResultingDeviceViewModel resultingDeviceViewModel, IDevicesContainerService devicesContainerService,
                              IApplicationGlobalCommands applicationGlobalCommands,
                              IDeviceEditorViewModelValidator deviceEditorViewModelValidator)
 {
     _localizerService            = localizerService;
     _dialogCoordinator           = dialogCoordinator;
     _resultingDeviceViewModel    = resultingDeviceViewModel;
     _devicesContainerService     = devicesContainerService;
     _applicationGlobalCommands   = applicationGlobalCommands;
     LoadExistingDevice           = new RelayCommand(OnLoadExistingDevice);
     CreateDeviceCommand          = new RelayCommand(OnCreateDeviceExecute);
     SaveInFileCommand            = new RelayCommand(OnSaveInFileExecute);
     OpenSharedResourcesCommand   = new RelayCommand(OnOpenSharedResourcesExecute);
     DeleteFragmentCommand        = new RelayCommand <object>(OnDeleteFragmentExecute);
     OpenAddFragmentWindowCommand = new RelayCommand(OnOpenAddFragmentWindowCommand);
     _currentFolder =
         Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), DEFAULT_FOLDER);
     DeviceEditorValidationViewModel = new DeviceEditorValidationViewModel(() =>
                                                                           deviceEditorViewModelValidator.ValidateDeviceEditor(ResultingDeviceViewModel.FragmentEditorViewModels
                                                                                                                               .ToList()));
     _applicationGlobalCommands.SetGlobalDialogContext(this);
 }
コード例 #26
0
        public OscilloscopeViewModel(ITypesContainer container, IApplicationGlobalCommands applicationGlobalCommands, IFragmentOptionsViewModel fragmentOptionsViewModel,
                                     Func <IFragmentOptionGroupViewModel> fragmentOptionGroupViewModelgetFunc,
                                     Func <IFragmentOptionCommandViewModel> fragmentOptionCommandViewModelgetFunc
                                     , OscillogramLoader oscillogramLoader)
        {
            this._container = container;
            this._applicationGlobalCommands = applicationGlobalCommands;
            _oscillogramLoader = oscillogramLoader;
            this.OscilloscopeJournalViewModel    = this._container.Resolve <IOscilloscopeJournalViewModel>();
            this.LoadSelectedOscillogramsCommand = new RelayCommand(this.OnLoadSelectedOscillogramsExecute);
            this.ShowOscillogramCommand          = new RelayCommand <object>(this.OnShowOscillogramExecute);
            this.MaxLoadingProgress              = 1;
            this.CurrentLoadingProgress          = 0;
            this._loadingCancellationTokenSource = new CancellationTokenSource();
            this.StopLoadingCommand              = new RelayCommand(this.OnStopLoadingExecute);

            IFragmentOptionGroupViewModel fragmentOptionGroupViewModel = fragmentOptionGroupViewModelgetFunc();

            fragmentOptionGroupViewModel.NameKey = OscilloscopeKeys.OSCILLOSCOPE_JOURNAL;
            IFragmentOptionCommandViewModel fragmentOptionCommandViewModel = fragmentOptionCommandViewModelgetFunc();

            fragmentOptionCommandViewModel.TitleKey = "Load";
            fragmentOptionCommandViewModel.IconKey  = IconResourceKeys.IconInboxIn;
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);
            fragmentOptionCommandViewModel.OptionCommand = this.OscilloscopeJournalViewModel.LoadCommand;

            fragmentOptionCommandViewModel          = fragmentOptionCommandViewModelgetFunc();
            fragmentOptionCommandViewModel.TitleKey = OscilloscopeKeys.LOAD_SELECTED_OSCILLOGRAMS;
            fragmentOptionCommandViewModel.IconKey  = IconResourceKeys.IconDiscDownload;
            fragmentOptionGroupViewModel.FragmentOptionCommandViewModels.Add(fragmentOptionCommandViewModel);
            fragmentOptionCommandViewModel.OptionCommand = this.LoadSelectedOscillogramsCommand;

            fragmentOptionsViewModel.FragmentOptionGroupViewModels.Add(fragmentOptionGroupViewModel);
            this.FragmentOptionsViewModel = fragmentOptionsViewModel;
            Oscillograms = new List <Oscillogram>();
        }
コード例 #27
0
 public ModbusMemoryViewModel(IModbusMemorySettingsViewModel modbusMemorySettingsViewModel,
                              ITypesContainer container, Func <IMemoryBitViewModel> memoryBitViewModelGettingFunc,
                              Func <IModbusMemoryEntity> modbusMemoryEntityGettingFunc,
                              IApplicationGlobalCommands applicationGlobalCommands)
 {
     _container = container;
     _memoryBitViewModelGettingFunc        = memoryBitViewModelGettingFunc;
     _modbusMemoryEntityGettingFunc        = modbusMemoryEntityGettingFunc;
     _applicationGlobalCommands            = applicationGlobalCommands;
     ModbusMemoryEntityViewModels          = new ObservableCollection <IModbusMemoryEntityViewModel>();
     _modbusConversionParametersViewModels = new List <IModbusConversionParametersViewModel>(32);
     ModbusMemorySettingsViewModel         = modbusMemorySettingsViewModel;
     ExecuteOneQueryCommand = new RelayCommand(async() =>
     {
         if (DeviceContext.DataProviderContainer == null)
         {
             return;
         }
         await OnExecuteOneQuery();
     });
     EditEntityCommand  = new RelayCommand <IModbusMemoryEntityViewModel>(OnExecuteEditEntity);
     SetTrueBitCommand  = new RelayCommand <object>(OnSetTrueBitExecute);
     SetFalseBitCommand = new RelayCommand <object>(OnSetFalseBitExecute);
 }
コード例 #28
0
 public BaseValuesViewModelFactory(IApplicationGlobalCommands applicationGlobalCommands,
                                   ILocalizerService localizerService)
 {
     _applicationGlobalCommands = applicationGlobalCommands;
     _localizerService          = localizerService;
 }
コード例 #29
0
 public DependenciesService(Func <DependenciesViewModel> depVmFunc, Func <AddDependencyViewModel> addDepVmFunc, IApplicationGlobalCommands applicationGlobalCommands)
 {
     _depVmFunc    = depVmFunc;
     _addDepVmFunc = addDepVmFunc;
     _applicationGlobalCommands = applicationGlobalCommands;
 }
コード例 #30
0
 public SrTriggerViewModel(LogicElement model, IApplicationGlobalCommands globalCommands) : base(model, globalCommands)
 {
     this.ElementName = "SR-триггер";
     this.Description = "Логический элемент SR-триггер";
     this.Symbol      = "SRT";
 }