mirror of
https://github.com/FAUSheppy/ths-datenlogger
synced 2025-12-06 12:11:35 +01:00
remove timestamp wrapper func
This commit is contained in:
@@ -39,11 +39,11 @@ def legend_box_contents(name, y):
|
|||||||
|
|
||||||
def general_background_setup(tup,ymin,ymax,x):
|
def general_background_setup(tup,ymin,ymax,x):
|
||||||
|
|
||||||
unix_x = list(map(plot_timeutils.unix,x))
|
unix_x = [ el.timestamp() for el in x ]
|
||||||
|
|
||||||
### SET AXIS LIMITS ###
|
### SET AXIS LIMITS ###
|
||||||
tup[AXIS].set_ylim([ymin,ymax])
|
tup[AXIS].set_ylim( [ ymin, ymax ] )
|
||||||
tup[AXIS].set_xlim([plot_timeutils.unix(min(x)),plot_timeutils.unix(max(x))])
|
tup[AXIS].set_xlim( [ min(x).timestamp(), max(x).timestamp() ] )
|
||||||
|
|
||||||
if CFG("draw_thresholds"):
|
if CFG("draw_thresholds"):
|
||||||
hcrit=CFG("humidity_critical")
|
hcrit=CFG("humidity_critical")
|
||||||
@@ -223,7 +223,7 @@ def gen_xticks_from_timeseries(x):
|
|||||||
xticks = []
|
xticks = []
|
||||||
xmax += step*CFG("add_x_labels_at_end")
|
xmax += step*CFG("add_x_labels_at_end")
|
||||||
while cur < xmax:
|
while cur < xmax:
|
||||||
xticks += [plot_timeutils.unix(cur)]
|
xticks += [cur.timestamp()]
|
||||||
cur+=step
|
cur+=step
|
||||||
return xticks
|
return xticks
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def __plot(tup, datapoints, path, date1=None, date2=None, forcePath=False):
|
|||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
NO_SERIES = False
|
NO_SERIES = False
|
||||||
unix_x = list(map(plot_timeutils.unix,x))
|
unix_x = [ el.timestamp() for el in x]
|
||||||
ymin,ymax = plot_graphutils.getlimits_y(y)
|
ymin,ymax = plot_graphutils.getlimits_y(y)
|
||||||
|
|
||||||
#### GET LINE STYLES ####
|
#### GET LINE STYLES ####
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ def time_from_dbf(l, timeformat):
|
|||||||
def time_from_csv(l, timeformat):
|
def time_from_csv(l, timeformat):
|
||||||
return datetime.strptime(l, timeformat)
|
return datetime.strptime(l, timeformat)
|
||||||
|
|
||||||
def unix(dt):
|
|
||||||
return dt.timestamp()
|
|
||||||
|
|
||||||
def round_time_to_step(start,step):
|
def round_time_to_step(start,step):
|
||||||
start += step / 2
|
start += step / 2
|
||||||
discard = timedelta(days=0)
|
discard = timedelta(days=0)
|
||||||
|
|||||||
Reference in New Issue
Block a user