Refactored
This commit is contained in:
+5
-5
@@ -248,8 +248,8 @@ if __name__ == '__main__':
|
|||||||
ep_range = find_ep_by_name(end_points, name="range")
|
ep_range = find_ep_by_name(end_points, name="range")
|
||||||
|
|
||||||
# define observation interval
|
# define observation interval
|
||||||
dt_start = datetime(2024, 10, 15, 0, 0, 0)
|
dt_start = datetime(settings.sel_years[0], settings.sel_month[0], settings.sel_days[0], 0, 0, 0)
|
||||||
dt_stop = datetime(2024, 10, 28, 23, 59, 59)
|
dt_stop = datetime(settings.sel_years[1], settings.sel_month[1], settings.sel_days[1], 23, 59, 59)
|
||||||
td_step = timedelta(seconds=5*60)
|
td_step = timedelta(seconds=5*60)
|
||||||
|
|
||||||
# resample values to equidistant time interval
|
# resample values to equidistant time interval
|
||||||
@@ -265,9 +265,9 @@ if __name__ == '__main__':
|
|||||||
speed.append(dv/dt*60*60)
|
speed.append(dv/dt*60*60)
|
||||||
|
|
||||||
# Convert x-axis
|
# Convert x-axis
|
||||||
dt_odo_h = (np.array(t_odo) - t_odo[0])/3600
|
dt_odo_h = (np.array(t_odo) - t_odo[0])/3600/24 + settings.sel_days[0]
|
||||||
dt_soc_h = (np.array(t_soc) - t_soc[0])/3600
|
dt_soc_h = (np.array(t_soc) - t_soc[0])/3600/24 + settings.sel_days[0]
|
||||||
dt_range_h = (np.array(t_range) - t_range[0])/3600
|
dt_range_h = (np.array(t_range) - t_range[0])/3600/24 + settings.sel_days[0]
|
||||||
|
|
||||||
# plot data
|
# plot data
|
||||||
plot.subplot(4, 1, 1)
|
plot.subplot(4, 1, 1)
|
||||||
|
|||||||
@@ -6,25 +6,24 @@ VIN = 'WVWZZZE1ZMP010760'
|
|||||||
USER = 'alex'
|
USER = 'alex'
|
||||||
|
|
||||||
# Default show data of today
|
# Default show data of today
|
||||||
sel_days = (15,)
|
sel_years = (2024, time.gmtime().tm_year)
|
||||||
|
sel_month = (10, time.gmtime().tm_mon)
|
||||||
|
sel_days = (15, time.gmtime().tm_mday)
|
||||||
|
|
||||||
eps = {
|
eps = {
|
||||||
"odo":
|
"odo":
|
||||||
{
|
{
|
||||||
"values": "data/measurements/odometerStatus/value/odometer",
|
"values": "data/measurements/odometerStatus/value/odometer",
|
||||||
"timestamps": "data/measurements/odometerStatus/value/carCapturedTimestamp"
|
"timestamps": "data/measurements/odometerStatus/value/carCapturedTimestamp"
|
||||||
# "timestamps": "info/timestamp"
|
|
||||||
},
|
},
|
||||||
"soc":
|
"soc":
|
||||||
{
|
{
|
||||||
"values": "data/measurements/fuelLevelStatus/value/currentSOC_pct",
|
"values": "data/measurements/fuelLevelStatus/value/currentSOC_pct",
|
||||||
"timestamps": "data/measurements/fuelLevelStatus/value/carCapturedTimestamp"
|
"timestamps": "data/measurements/fuelLevelStatus/value/carCapturedTimestamp"
|
||||||
# "timestamps": "info/timestamp"
|
|
||||||
},
|
},
|
||||||
"range":
|
"range":
|
||||||
{
|
{
|
||||||
"values": "data/fuelStatus/rangeStatus/value/totalRange_km",
|
"values": "data/fuelStatus/rangeStatus/value/totalRange_km",
|
||||||
"timestamps": "data/fuelStatus/rangeStatus/value/carCapturedTimestamp"
|
"timestamps": "data/fuelStatus/rangeStatus/value/carCapturedTimestamp"
|
||||||
# "timestamps": "info/timestamp"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user