Esempio n. 1
0
        public DeviceDetailViewModel(
            IDevicesConfigurationProvider devicesConfiguration,
            IStorage storage,
            ISurveyService surveyService)
        {
            this.devicesConfiguration = devicesConfiguration;
            this.storage       = storage;
            this.surveyService = surveyService;

            this.devicesConfiguration.Saved += (s, e) => this.UpdateDeviceData();
        }
Esempio n. 2
0
        public DeviceWallViewModel(IDevicesConfigurationProvider configurationProvider, ISurveyService surveyService, IDevicesConfigurationProvider devicesConfiguration)
        {
            this.devices              = new ObservableCollection <DeviceDescription>(configurationProvider.Devices);
            this.surveyService        = surveyService;
            this.devicesConfiguration = devicesConfiguration;
            this.surveyStarted        = this.surveyService.SurveyStarted;

            this.surveyService.SurveyStartedChanged += (s, e) =>
            {
                this.SurveyStarted = this.surveyService.SurveyStarted;
            };
        }
Esempio n. 3
0
        public EditRegisterViewModel(IDevicesConfigurationProvider devicesConfiguration)
        {
            this.devicesConfiguration = devicesConfiguration;
            this.PropertyChanged     += (s, e) =>
            {
                var canSaveName = nameof(this.CanSave);

                if (e.PropertyName != canSaveName)
                {
                    this.RaisePropertyChanged(nameof(this.CanSave));
                }
            };

            this.registerDescription = new RegisterDescription();
        }
Esempio n. 4
0
        public DataManager(
            IDataTransferService dataTransferService,
            ISurveyService surveyService,
            IStorage storage,
            IDevicesConfigurationProvider configurationProvider)
        {
            this.dataTransferService   = dataTransferService;
            this.surveyService         = surveyService;
            this.storage               = storage;
            this.configurationProvider = configurationProvider;

            this.surveyService.DeviceDataReceived += this.HandleDataReceive;

            this.dataTransferService.WriteRequested  += this.HandleWriteRequest;
            this.dataTransferService.ConfigRequested += this.HandleConfigRequest;
        }
Esempio n. 5
0
        public SurveyService(
            IDeviceIoDriver ioDriver,
            IDevicesConfigurationProvider configurationProvider,
            ISurveySettingsProvider surveySettingsProvider,
            ILogger logger)
        {
            this.ioDriver = ioDriver;
            this.configurationProvider  = configurationProvider;
            this.surveySettingsProvider = surveySettingsProvider;
            this.logger     = logger;
            this.writeQueue = new Queue <Tuple <RegisterWriteRequest, Action <bool> > >();

            this.surveyStarted           = false;
            this.surveyCompleted         = true;
            this.writeOperationRequested = false;
            this.forceSurveyEvent        = new ManualResetEvent(false);
        }
        public SettingsViewModel(ISurveyService surveyService, ISurveySettingsProvider surveySettingsProvider, IDataManager dataManager, IDevicesConfigurationProvider configurationProvider)
        {
            this.surveyService          = surveyService;
            this.surveySettingsProvider = surveySettingsProvider;
            this.dataManager            = dataManager;
            this.configurationProvider  = configurationProvider;

            surveyService.SurveyStarted = surveySettingsProvider.SurveyEnabled;
            this.surveyEnabled          = surveySettingsProvider.SurveyEnabled;

            this.surveyPeriod = surveySettingsProvider.SurveyPeriodSeconds;
            this.portName     = surveySettingsProvider.ConnectionString;

            this.ServerUrl = Settings.Default.SeverURL;
            this.UserName  = Settings.Default.UserName;
            this.Password  = Settings.Default.Password;

            this.mappers = new ObservableCollection <DeviceMapper>(this.configurationProvider.Mappers);

            this.SetWebTransfer();
        }
 public SignalRHostImplementation(IDevicesConfigurationProvider devicesConfigurationProvider, IDevicesStateProvider devicesStateProvider)
 {
     _devicesConfigurationProvider = devicesConfigurationProvider;
     _devicesStateProvider         = devicesStateProvider;
 }