Пример #1
0
 public DigitalstromSensorPollingService(ILogger <DigitalstromSensorPollingService> logger, IDigitalstromDbContext databaseContext, DigitalstromDssClient dsClient, IDigitalstromStructureService dsStructure)
 {
     _logger      = logger;
     _dbContext   = databaseContext;
     _dsClient    = dsClient;
     _dsStructure = dsStructure;
 }
Пример #2
0
 public DigitalstromSceneEventViewModel(IDigitalstromDbContext databaseContext, IDigitalstromStructureService dsStructure, IStringLocalizer <DigitalstromSceneEventViewModel> localizer, ILogger <DigitalstromSceneEventViewModel> logger) : base()
 {
     _db          = databaseContext;
     _dsStructure = dsStructure;
     _localizer   = localizer;
     _logger      = logger;
 }
 public DigitalstromZoneSensorViewModel(IDigitalstromDbContext databaseContext, IDigitalstromStructureService dsStructure)
     : base(new Dictionary <Resolution, IQueryable <DigitalstromZoneSensorData> >() {
     { Resolution.LowRes, databaseContext.DsSensorLowresDataSet },
     { Resolution.MidRes, databaseContext.DsSensorDataSet }
 },
            Enumerable.Range(0, 2).ToDictionary(x => x.ToString(), x => x),
            dsStructure.Zones.Where(x => dsStructure.HasZoneSensor(x, SensorType.TemperatureIndoors) ||
                                    dsStructure.HasZoneSensor(x, SensorType.HumidityIndoors)).OrderBy(x => x).ToList(),
            x => x.ZoneId,
            key => { int keyint = key; return(x => x.ZoneId == keyint); })
 {
     _dsStructure = dsStructure;
 }
        public DigitalstromEnergyViewModel(IDigitalstromDbContext databaseContext, IDigitalstromStructureService dsStructure)
            : base(new Dictionary <Resolution, IQueryable <DigitalstromEnergyData> >() {
            { Resolution.LowRes, databaseContext.DsEnergyLowresDataSet },
            { Resolution.MidRes, databaseContext.DsEnergyMidresDataSet }
        },
                   Enumerable.Range(0, 1).ToDictionary(x => x.ToString(), x => x),
                   dsStructure.Circuits.Where(x => dsStructure.IsMeteringCircuit(x)).OrderBy(x => x).ToList(),
                   x => x.CircuitId,
                   key => { string keystr = key; return(x => x.CircuitId == keystr); })
        {
            _db          = databaseContext;
            _dsStructure = dsStructure;

            InvalidateData();
        }