Beispiel #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);
        }
Beispiel #2
0
 public ExcelExportService(ISerializerService serializerService,
                           IApplicationGlobalCommands applicationGlobalCommands, ILocalizerService localizerService)
 {
     _serializerService         = serializerService;
     _applicationGlobalCommands = applicationGlobalCommands;
     _localizerService          = localizerService;
 }
        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
            //	{
            //
            //	}
        }
Beispiel #4
0
 public OrViewModel(LogicElement model, IApplicationGlobalCommands globalCommands) : base(model, globalCommands)
 {
     this.ElementName = "ИЛИ";
     this.Description = "Логический элемент ИЛИ";
     this.Symbol      = "|";
     SetModel(_logicElementModel);
 }
Beispiel #5
0
 public TriggerViewModel(LogicElement model, IApplicationGlobalCommands globalCommands)
 {
     base._globalCommands     = globalCommands;
     _logicElementModel       = model;
     this.ConnectorViewModels = new ObservableCollection <ConnectorViewModel>();
     SetModel(_logicElementModel);
 }
Beispiel #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));
        }
Beispiel #7
0
        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);
        }
Beispiel #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;
        }
 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);
 }
Beispiel #10
0
        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);
        }
Beispiel #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);
 }
Beispiel #12
0
        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);
        }
Beispiel #13
0
 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);
 }
Beispiel #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);
        }
 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);
 }
Beispiel #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);
 }
 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);
 }
 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);
 }
        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
                }
            }
        }
Beispiel #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);
 }
 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);
     }
 }
 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);
     }
 }
        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);
        }
        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);
        }
 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);
 }
        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>();
        }
 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);
 }
Beispiel #28
0
 public BaseValuesViewModelFactory(IApplicationGlobalCommands applicationGlobalCommands,
                                   ILocalizerService localizerService)
 {
     _applicationGlobalCommands = applicationGlobalCommands;
     _localizerService          = localizerService;
 }
Beispiel #29
0
 public DependenciesService(Func <DependenciesViewModel> depVmFunc, Func <AddDependencyViewModel> addDepVmFunc, IApplicationGlobalCommands applicationGlobalCommands)
 {
     _depVmFunc    = depVmFunc;
     _addDepVmFunc = addDepVmFunc;
     _applicationGlobalCommands = applicationGlobalCommands;
 }
Beispiel #30
0
 public SrTriggerViewModel(LogicElement model, IApplicationGlobalCommands globalCommands) : base(model, globalCommands)
 {
     this.ElementName = "SR-триггер";
     this.Description = "Логический элемент SR-триггер";
     this.Symbol      = "SRT";
 }