Esempio n. 1
0
        private void AddingRedresseur(AddingNewItemEventArgs arg)
        {
            foreach (Redresseur redresseur in ListRedresseur)
            {
                SimpleIoc.Default.GetInstance <IRedresseurService>().Update(redresseur);
            }

            SimpleIoc.Default.GetInstance <IRedresseurService>().Insert();
            ListAutomate = AutomateService.GetAllData();
        }
Esempio n. 2
0
        public MainViewModel(IProcessService _processService)
        {
            ListAutomate   = AutomateService.GetAllData();
            ListProcess    = SimpleIoc.Default.GetInstance <IProcessService>().GetAllData();
            ListHistorique = SimpleIoc.Default.GetInstance <IHistoriqueService>().GetAllData();
            ListRedresseur = new ObservableCollection <Redresseur>();

            pulseVisibilityParam = new Visibility();
            PulseVisibilityParam = Visibility.Visible;

            tempoVisibilityParam = new Visibility();
            TempoVisibilityParam = Visibility.Visible;
            imageSource          = "../Resources/log_in1.png";

            foreach (DataService.Automate automate in ListAutomate)
            {
                foreach (Redresseur redresseur in ListAutomate[ListAutomate.IndexOf(automate)].Redresseurs)
                {
                    ListRedresseur.Add(redresseur);
                }
            }


            ListEtats = new ObservableCollection <AcoreApplication.Model.Constantes.MODES>();
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "LocalRecette"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "LocalManuel"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "RemoteManuel"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "Supervision"));
            ListEtats.Add((AcoreApplication.Model.Constantes.MODES)Enum.Parse(typeof(AcoreApplication.Model.Constantes.MODES), "RemoteRecette"));


            RedresseurSelected        = null;
            ProcessSelected           = ListProcess[0];
            RecetteSelected           = ProcessSelected.Recettes[0];
            historiqueSelectedSegment = null;

            AddingProcessCommand             = new RelayCommand <Object>(AddingProcess);
            AddingRecetteCommand             = new RelayCommand <AddingNewItemEventArgs>(AddingRecette);
            AddingSegmentCommand             = new RelayCommand <AddingNewItemEventArgs>(AddingSegment);
            AddingRedresseurCommand          = new RelayCommand <AddingNewItemEventArgs>(AddingRedresseur);
            LoadingSegmentCommand            = new RelayCommand <DataGridRowEventArgs>(LoadingSegment);
            EditingSegmentCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingSegment);
            EditingRecetteCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingRecette);
            EditingProcessCommand            = new RelayCommand <DataGridRowEditEndingEventArgs>(EditingProcess);
            RegistreLoadingRowCommand        = new RelayCommand <DataGridRowEventArgs>(RegistreLoadingRow);
            SelectedProcessChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(SelectedProcessChanged);
            SelectedRecetteChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(SelectedRecetteChanged);
            SelectedHistoriqueChangedCommand = new RelayCommand <SelectionChangedEventArgs>(SelectedHistoriqueChanged);
            ValideButton = new RelayCommand <Object>(valideButton);
        }
Esempio n. 3
0
        public OperatorPageViewModel(
            ITalkTimerService timerService,
            ITalkScheduleService scheduleService,
            IAdaptiveTimerService adaptiveTimerService,
            IOptionsService optionsService,
            ICommandLineService commandLineService,
            IBellService bellService,
            ILocalTimingDataStoreService timingDataService,
            ISnackbarService snackbarService)
        {
            _scheduleService                 = scheduleService;
            _optionsService                  = optionsService;
            _adaptiveTimerService            = adaptiveTimerService;
            _commandLineService              = commandLineService;
            _bellService                     = bellService;
            _timerService                    = timerService;
            _snackbarService                 = snackbarService;
            _timingDataService               = timingDataService;
            _timerService.TimerChangedEvent += TimerChangedHandler;
            _countUp = _optionsService.Options.CountUp;

            SelectFirstTalk();

            _timerService.TimerStartStopFromApiEvent += HandleTimerStartStopFromApi;

            // commands...
            StartCommand            = new RelayCommand(StartTimer, () => IsNotRunning && IsValidTalk, true);
            StopCommand             = new RelayCommand(StopTimer, () => IsRunning);
            SettingsCommand         = new RelayCommand(NavigateSettings, () => IsNotRunning && !_commandLineService.NoSettings);
            HelpCommand             = new RelayCommand(LaunchHelp);
            NewVersionCommand       = new RelayCommand(DisplayNewVersionPage);
            IncrementTimerCommand   = new RelayCommand(IncrementTimer, CanIncreaseTimerValue);
            IncrementTimer15Command = new RelayCommand(IncrementTimer15Secs, CanIncreaseTimerValue);
            IncrementTimer5Command  = new RelayCommand(IncrementTimer5Mins, CanIncreaseTimerValue);
            DecrementTimerCommand   = new RelayCommand(DecrementTimer, CanDecreaseTimerValue);
            DecrementTimer15Command = new RelayCommand(DecrementTimer15Secs, CanDecreaseTimerValue);
            DecrementTimer5Command  = new RelayCommand(DecrementTimer5Mins, CanDecreaseTimerValue);
            BellToggleCommand       = new RelayCommand(BellToggle);
            CountUpToggleCommand    = new RelayCommand(CountUpToggle);
            CloseCountdownCommand   = new RelayCommand(CloseCountdownWindow);

            // subscriptions...
            Messenger.Default.Register <OperatingModeChangedMessage>(this, OnOperatingModeChanged);
            Messenger.Default.Register <AutoMeetingChangedMessage>(this, OnAutoMeetingChanged);
            Messenger.Default.Register <CountdownWindowStatusChangedMessage>(this, OnCountdownWindowStatusChanged);
            Messenger.Default.Register <ShowCircuitVisitToggleChangedMessage>(this, OnShowCircuitVisitToggleChanged);
            Messenger.Default.Register <AutoBellSettingChangedMessage>(this, OnAutoBellSettingChanged);

            if (IsInDesignMode)
            {
                IsNewVersionAvailable = true;
            }

            GetVersionData();

            if (commandLineService.Automate)
            {
#if DEBUG
                var automationService = new AutomateService(_optionsService, _timerService, scheduleService);
                automationService.Execute();
#endif
            }
        }