Example #1
0
        private void doDataLiftWork()
        {
            try
            {
                _log.Debug("+doDataLiftWork()");
                this._registry = new LocalRegistryService();
                if (this._registry.isRegistry())
                {
                    if (this.isGreaterThanADay(_registry.getLastRunDateFromRegistry()) || this._registry.getRunNowBooleanFromRegistry())
                    {
                        this._readingDao = new ReadingDao();
                        this._deviceDao  = new DeviceDao();
                        this._run        = new ScheduledRun(this._registry, this._readingDao, this._deviceDao);
                        this._run.getDataAndPostToWebService();

                        //After use, set date to now and run now to false
                        this._registry.setRegistryValueLastRunDateToNow();
                        this._registry.setRegistryValueRunNowBoolean();
                    }
                }
                else
                {
                    this._registry.CreateRegistryPathAndAllValues();
                }
                _log.Debug("-doDataLiftWork()");
            }
            catch (Exception ex)
            {
                _log.Error("-doDataLiftWork() Message: " + ex.Message + " InnerException: " + ex.InnerException);
            }
        }
Example #2
0
 public PushNotificationRegistrationService(IAccountDao accountDao,
                                            IDeviceDao deviceDao,
                                            ICommandBus commandBus)
 {
     _accountDao = accountDao;
     _deviceDao  = deviceDao;
     _commandBus = commandBus;
 }
 public CityBus(ICityDao cityDao, ILogger <CityBus> logger, IFactoryDao factoryDao, IWorkshopDao workshopDao, IDeviceDao deviceDao)
 {
     this._cityDao     = cityDao;
     this._logger      = logger;
     this._factoryDao  = factoryDao;
     this._workshopDao = workshopDao;
     this._deviceDao   = deviceDao;
 }
Example #4
0
 public ScheduledRun(LocalRegistryService registry, IReadingDao readingDao, IDeviceDao deviceDao)
 {
     _log.Debug("+ScheduledRun()");
     this._registry   = registry;
     this._readingDao = readingDao;
     this._deviceDao  = deviceDao;
     _log.Debug("-ScheduledRun()");
 }
 public ReportJob(IDeviceDataDao deviceDataDao,
                  IDeviceDao deviceDao,
                  IDeviceDailyOnlineTimeDao deviceDailyOnlineTimeDao,
                  ILogger <ReportJob> logger)
 {
     this._deviceDataDao            = deviceDataDao;
     this._deviceDao                = deviceDao;
     this._deviceDailyOnlineTimeDao = deviceDailyOnlineTimeDao;
     this._logger = logger;
 }
Example #6
0
 /*
  * 构造函数
  * 需要注入DeviceDao, FieldDao, Logger
  */
 public DeviceBus(IDeviceDao deviceDao,
                  IFieldDao fieldDao,
                  ICityDao cityDao,
                  IoTHub iotHub,
                  ILogger <DeviceBus> logger)
 {
     this._deviceDao = deviceDao;
     this._fieldDao  = fieldDao;
     this._cityDao   = cityDao;
     this._iotHub    = iotHub;
     this._logger    = logger;
 }
Example #7
0
 public NotificationAdministrationService(
     IAccountDao dao,
     IDeviceDao device,
     INotificationService notificationService,
     IServerSettings serverSettings,
     ILogger logger)
 {
     _dao                 = dao;
     _daoDevice           = device;
     _logger              = logger;
     _notificationService = notificationService;
     _serverSettings      = serverSettings;
 }
 public AlarmInfoJob(IDeviceDataDao deviceDataDao,
                     IAlarmInfoDao alarmInfoDao,
                     IThresholdDao thresholdDao,
                     ISeverityDao severityDao,
                     IDeviceDao deviceDao,
                     IDeviceBus deviceBus,
                     IStateTypeDao stateTypeDao,
                     IFieldBus fieldBus,
                     IFieldDao fieldDao,
                     ILogger <AlarmInfoJob> logger)
 {
     this._deviceDataDao = deviceDataDao;
     this._alarmInfoDao  = alarmInfoDao;
     this._thresholdDao  = thresholdDao;
     this._severityDao   = severityDao;
     this._deviceDao     = deviceDao;
     this._deviceBus     = deviceBus;
     this._stateTypeDao  = stateTypeDao;
     this._fieldBus      = fieldBus;
     this._fieldDao      = fieldDao;
     this._logger        = logger;
 }
Example #9
0
 /*
  * 构造函数
  * 需要注入DeviceDataDao, AlarmInfoDao, DeviceDao, WorkshopDao, StateTypeDao
  */
 public DeviceDataBus(IDeviceDataDao deviceDataDao,
                      IAlarmInfoDao alarmInfoDao,
                      ILogger <DeviceDataBus> logger,
                      IDeviceDao deviceDao,
                      IDeviceBus deviceBus,
                      IWorkshopDao workshopDao,
                      IStateTypeDao stateTypeDao,
                      IDeviceDailyOnlineTimeDao deviceDailyOnlineTimeDao,
                      IThresholdDao thresholdDao,
                      IFieldDao fieldDao
                      )
 {
     this._deviceDataDao            = deviceDataDao;
     this._alarmInfoDao             = alarmInfoDao;
     this._logger                   = logger;
     this._deviceDao                = deviceDao;
     this._deviceBus                = deviceBus;
     this._workshopDao              = workshopDao;
     this._stateTypeDao             = stateTypeDao;
     this._deviceDailyOnlineTimeDao = deviceDailyOnlineTimeDao;
     this._thresholdDao             = thresholdDao;
     this._fieldDao                 = fieldDao;
 }
Example #10
0
 private FaultService()
 {
     _daoManager = ServiceConfig.GetInstance().DaoManager;
     _faultDao   = _daoManager.GetDao(typeof(IFaultDao)) as IFaultDao;
     _deviceDao  = _daoManager.GetDao(typeof(IDeviceDao)) as IDeviceDao;
 }
 public FieldBus(IFieldDao fieldDao, IDeviceDao deviceDao, ILogger <FieldBus> logger)
 {
     this._fieldDao  = fieldDao;
     this._deviceDao = deviceDao;
     this._logger    = logger;
 }
Example #12
0
 public DeviceBus(IDeviceDao deviceDao, IoTHub iotHub, ILogger <DeviceBus> logger)
 {
     this._deviceDao = deviceDao;
     this._iotHub    = iotHub;
     this._logger    = logger;
 }
Example #13
0
 public ThresholdBus(IThresholdDao thresholdDao, ILogger <ThresholdBus> logger, IDeviceDao deviceDao)
 {
     this._thresholdDao = thresholdDao;
     this._logger       = logger;
     this._deviceDao    = deviceDao;
 }
Example #14
0
 public DeviceLogic()
 {
     _dao = new DeviceDao();
 }
Example #15
0
 private DeviceService()
 {
     _daoManager = ServiceConfig.GetInstance().DaoManager;
     _deviceDao = _daoManager.GetDao(typeof(IDeviceDao)) as IDeviceDao;
 }