def fillMeasurementPoint(self, cursor, uid, pointTime, name, value, context=None): curveProvider = MongoTimeCurve(mdbpool.get_db(), 'generationkwh.production.measurement') curveProvider.fillPoint( datetime=toLocal(asUtc(naiveisodatetime(pointTime))), name=name, ae=value)
def setupPointsByDay(self, points): for meter, start, end, values in points: daterange = datespan( localisodate(start), localisodate(end)+datetime.timedelta(days=1) ) for date, value in zip(daterange, values): self.helper.fillMeasurementPoint(str(asUtc(date))[:-6],meter,value)
def setupPointsByHour(self, points): for meter, date, value in points: self.helper.fillMeasurementPoint(str(asUtc(localTime(date)))[:-6],meter,value)