|
@@ -336,7 +336,7 @@ def change_new(df_sts_chrg,chrg_last):
|
|
if len(chrg_last)>0:
|
|
if len(chrg_last)>0:
|
|
time_last=chrg_last['time_end']
|
|
time_last=chrg_last['time_end']
|
|
time_first=df_sts_chrg.loc[0,'time_st']
|
|
time_first=df_sts_chrg.loc[0,'time_st']
|
|
- time_last=datetime.datetime.strptime(time_last,'%Y-%m-%d %H:%M:%S')
|
|
|
|
|
|
+ time_last=datetime.datetime.strptime(str(time_last),'%Y-%m-%d %H:%M:%S')
|
|
if (chrg_last['status']==df_sts_chrg.loc[0,'status']) & ((time_first-time_last).total_seconds()/60<10) & \
|
|
if (chrg_last['status']==df_sts_chrg.loc[0,'status']) & ((time_first-time_last).total_seconds()/60<10) & \
|
|
(round(chrg_last['gps_lat'],2)==round(df_sts_chrg.loc[0,'gps_lat'],2)) & \
|
|
(round(chrg_last['gps_lat'],2)==round(df_sts_chrg.loc[0,'gps_lat'],2)) & \
|
|
(round(chrg_last['gps_lon'],2)==round(df_sts_chrg.loc[0,'gps_lon'],2)) :
|
|
(round(chrg_last['gps_lon'],2)==round(df_sts_chrg.loc[0,'gps_lon'],2)) :
|
|
@@ -349,8 +349,6 @@ def change_new(df_sts_chrg,chrg_last):
|
|
chrg_last['temp_min']=np.min([df_sts_chrg.loc[0,'temp_min'],chrg_last['temp_min']])
|
|
chrg_last['temp_min']=np.min([df_sts_chrg.loc[0,'temp_min'],chrg_last['temp_min']])
|
|
chrg_last['temp_incr']=df_sts_chrg.loc[0,'temp_incr']+chrg_last['temp_incr']
|
|
chrg_last['temp_incr']=df_sts_chrg.loc[0,'temp_incr']+chrg_last['temp_incr']
|
|
chrg_last['temp_mean']=round(np.mean([df_sts_chrg.loc[0,'temp_mean'],chrg_last['temp_mean']]),1)
|
|
chrg_last['temp_mean']=round(np.mean([df_sts_chrg.loc[0,'temp_mean'],chrg_last['temp_mean']]),1)
|
|
- #chrg_last['temp_end_max']=df_sts_chrg.loc[0,'temp_end_max']
|
|
|
|
- #chrg_last['temp_end_min']=df_sts_chrg.loc[0,'temp_end_min']
|
|
|
|
chrg_last['temp_end_mean']=df_sts_chrg.loc[0,'temp_end_mean']
|
|
chrg_last['temp_end_mean']=df_sts_chrg.loc[0,'temp_end_mean']
|
|
chrg_last['difftem_max']=np.max([df_sts_chrg.loc[0,'difftem_max'],chrg_last['difftem_max']])
|
|
chrg_last['difftem_max']=np.max([df_sts_chrg.loc[0,'difftem_max'],chrg_last['difftem_max']])
|
|
delta_soc=chrg_last['soc_end']-chrg_last['soc_st']
|
|
delta_soc=chrg_last['soc_end']-chrg_last['soc_st']
|
|
@@ -425,7 +423,13 @@ def mkdf_chrg(chrg,data_new,param):
|
|
df_sts_chrg=df_sts_chrg.append(df_sts_chrg_temp)
|
|
df_sts_chrg=df_sts_chrg.append(df_sts_chrg_temp)
|
|
return df_sts_chrg
|
|
return df_sts_chrg
|
|
|
|
|
|
-def pro_output(df_merge,sn,gpscity,chrg_last):
|
|
|
|
|
|
+def pro_output(df_merge,sn,gpscity,df_diag_ram_sn):
|
|
|
|
+ chrg_last=pd.Series()
|
|
|
|
+ if len(df_diag_ram_sn)>0:
|
|
|
|
+ df_diag_ram_sn['time_end']=list(map(lambda x: datetime.datetime.strptime(str(x),'%Y-%m-%d %H:%M:%S'),list(df_diag_ram_sn['time_end'])))
|
|
|
|
+ df_diag_ram_sn = df_diag_ram_sn.sort_values(by = 'time_end')
|
|
|
|
+ df_diag_ram_sn.reset_index(inplace=True,drop=True)
|
|
|
|
+ chrg_last=df_diag_ram_sn.iloc[-1]
|
|
new=pd.DataFrame()
|
|
new=pd.DataFrame()
|
|
change=pd.DataFrame()
|
|
change=pd.DataFrame()
|
|
if len(df_merge)>0:
|
|
if len(df_merge)>0:
|