Esempio n. 1
0
def init_data_for_day(date_time):
    for i in range(24):
        index_data.append(i)
    for sensor_id in sensors:
        # process hours
        for i in index_data:
            dt = datetime(date_time.year, date_time.month, date_time.day, i)
            value_data.append(bco.hour_object(dt, sensor_id, i))
            label_data.append(get_time_label(i))
        # process day for sum values
        dt = datetime(date_time.year, date_time.month, date_time.day)
        sum_data.append(bco.day_object(dt, sensor_id))
Esempio n. 2
0
def init_data_for_day(date_time):
   for i in range(24):
      index_data.append(i)
   for sensor_id in sensors:
      # process hours
      for i in index_data:
         dt = datetime(date_time.year, date_time.month, date_time.day, i)  
         value_data.append(bco.hour_object(dt, sensor_id, i))
         label_data.append(get_time_label(i))
      # process day for sum values
      dt = datetime(date_time.year, date_time.month, date_time.day)  
      sum_data.append(bco.day_object(dt, sensor_id))
Esempio n. 3
0
 def init_data_for_day(self):
    for i in range(24):
       self.index_data.append(i)
       self.label_data.append(self.get_time_label(i))
       self.chart_label.append(str(i))
    for sensor_id in self.sensors:
       # process hours
       for i in self.index_data:
          dt = datetime(self.date_time.year, self.date_time.month, self.date_time.day, i)  
          self.value_data.append(bco.hour_object(dt, sensor_id, i))
       # process day for sum values
       dt = datetime(self.date_time.year, self.date_time.month, self.date_time.day)  
       self.sum_data.append(bco.day_object(dt, sensor_id))
Esempio n. 4
0
 def init_data_for_day(self):
     for i in range(24):
         self.index_data.append(i)
         self.label_data.append(self.get_time_label(i))
         self.chart_label.append(str(i))
     for sensor_id in self.sensors:
         # process hours
         for i in self.index_data:
             dt = datetime(self.date_time.year, self.date_time.month, self.date_time.day, i)
             self.value_data.append(bco.hour_object(dt, sensor_id, i))
         # process day for sum values
         dt = datetime(self.date_time.year, self.date_time.month, self.date_time.day)
         self.sum_data.append(bco.day_object(dt, sensor_id))
Esempio n. 5
0
 def init_data_for_last24(self):
    new_dt = datetime.now()-timedelta(days=1, hours=1) 
    for i in range(24):
       new_dt = new_dt + timedelta(hours=1)
       hour = new_dt.hour
       self.index_data.append(hour)
       self.label_data.append(self.get_time_label(hour))
       self.chart_label.append(str(hour))
       print new_dt
    for sensor_id in self.sensors:
       # process hours
       for i in self.index_data:
          dt = datetime(new_dt.year, new_dt.month, new_dt.day, i)  
          print dt
          self.value_data.append(bco.hour_object(dt, sensor_id, i))
       # process day for sum values
       dt = datetime(self.date_time.year, self.date_time.month, self.date_time.day)  
       self.sum_data.append(bco.day_object(dt, sensor_id))
Esempio n. 6
0
 def init_data_for_last24(self):
     new_dt = datetime.now() - timedelta(days=1, hours=1)
     for i in range(24):
         new_dt = new_dt + timedelta(hours=1)
         hour = new_dt.hour
         self.index_data.append(hour)
         self.label_data.append(self.get_time_label(hour))
         self.chart_label.append(str(hour))
         print new_dt
     for sensor_id in self.sensors:
         # process hours
         for i in self.index_data:
             dt = datetime(new_dt.year, new_dt.month, new_dt.day, i)
             print dt
             self.value_data.append(bco.hour_object(dt, sensor_id, i))
         # process day for sum values
         dt = datetime(self.date_time.year, self.date_time.month, self.date_time.day)
         self.sum_data.append(bco.day_object(dt, sensor_id))
Esempio n. 7
0
def init_day_data(date_time, sensor_id):
   for i in range(24):
      dt = datetime(date_time.year, date_time.month, date_time.day, i)  
      day_data.append(bco.hour_object(dt, sensor_id))