Example #1
0
def init_data_for_month(date_time):   
   for i in range(get_days(date_time.year, date_time.month)):
      index_data.append(i)
   for sensor_id in sensors:
      # process days
      for i in index_data:
         dt = datetime(date_time.year, date_time.month, i+1)  
         value_data.append(bco.day_object(dt, sensor_id, i))
         label_data.append("%d.%d.%d" % (i+1, date_time.month, date_time.year))
      # process month for sum values
      dt = datetime(date_time.year, date_time.month, 1)  
      sum_data.append(bco.month_object(dt, sensor_id))
Example #2
0
 def init_data_for_month(self):
     for i in range(self.get_days(self.date_time.year, self.date_time.month)):
         self.index_data.append(i)
         self.label_data.append(self.get_day_label(i + 1))
         self.chart_label.append(str(i + 1))
         self.url_data.append(self.get_day_url(i + 1))
     # print self.chart_label
     for sensor_id in self.sensors:
         # process days
         for i in self.index_data:
             dt = datetime(self.date_time.year, self.date_time.month, i + 1)
             self.value_data.append(bco.day_object(dt, sensor_id, i))
         # process month for sum values
         dt = datetime(self.date_time.year, self.date_time.month, 1)
         self.sum_data.append(bco.month_object(dt, sensor_id))
Example #3
0
def init_array(date_time, sensor_id):
   data_array.append(bco.month_object(date_time, sensor_id))