Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed descriptions for Knock params #5

Merged
merged 10 commits into from
Sep 25, 2021
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SC8S5031_C_OEM.a2l.xdf
SC8S5031_C_OEM.a2ldb
SC8S5031_C_OEM.a2l
108 changes: 35 additions & 73 deletions a2l2xdf.csv
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Airflow,,ip_prs_loss_aic_1,Air Intake Pressure Drop,,
Airflow,,ip_put_max_cap_h_diag,,,
Airflow,,ip_put_min_cap_l_diag,,,
Airflow,,lc_put_sp_tol_ena_amp,Pressure Ratio Calc Toggle 1=AMP 0=PRS_CHA_UP,,
Airflow,,c_prs_im_sp_lim,,,
Airflow,,c_prs_im_sp_max,,,
Airflow,,c_prs_im_sp_lim,Maximum Intake Manifold Pressure,,
Airflow,,c_prs_im_sp_max,Maximum Requested Intake Manifold Pressure,,
Airflow,,ip_tps_sp_mdl_max,,,
Fuel,Flex Fuel,c_fac_afu_ratio_man,Manual E content value,,
Fuel,Flex Fuel,c_mff_sp_afu_int,Sensor Volume/Delay (set to 0),,
Expand Down Expand Up @@ -131,11 +131,11 @@ Limiter,Speed,DATA_LMVLim.LMVLim_vMax_vLim_C_VW.VehSpdl2NotAcv,,,
Limiter,,c_m_air_cyl_sp_max,,,
Limiter,,c_temp_cop_act_thd[0],,,
Limiter,,c_temp_cop_act_thd[1],,,
Limiter,,c_tia_thr_tcha_max,,,
Limiter,,c_tia_thr_tcha_max_sp,,,
Turbocharger,,c_tia_thr_tcha_max,Compressor Outlet Temp for Maximum Torque Management,,
Turbocharger,,c_tia_thr_tcha_max_sp,Compressor Outlet Temp to Start Torque Mangement,,
Limiter,,ip_m_air_cyl_max_stnd_vvl[0],,,
Limiter,,ip_m_air_cyl_max_stnd_vvl[1],,,
Limiter,,ip_prs_up_thr_dif_wide_open_thr,,,
Airflow,,ip_prs_up_thr_dif_wide_open_thr,,,
Limiter,,ip_teg_tur_up_sp,,,
Limiter,,ip_teg_tur_up_sp[0],,,
Limiter,,ip_teg_tur_up_sp[1],,,
Expand All @@ -146,73 +146,35 @@ Misc,,c_ctr_temp_poil_h_pump_oil_el,,,
Misc,,c_n_pvs_bls_bts_plaus,,,
Misc,,c_pv_av_pvs_bls_bts_plaus,,,
Misc,,c_tco_max_pump_oil_el,,,
Misc,,id_poil_h_pump_oil_el_maf_grd,,,
Misc,,id_poil_h_pump_oil_el_maf_sp,,,
Misc,,c_n_32_poil_h_pump_oil_el,,,
Misc,,c_vs_pvs_bls_bts_plaus,,,
Misc,,id_eff_scc_sp_min,,,
Misc,,id_eff_scc_sp_min_spt,,,
Misc,,id_gear_max_ef_lock_open[0][0][0],,,
Misc,,id_gear_max_ef_lock_open[0][0][1],,,
Misc,,id_gear_max_ef_lock_open[0][0][2],,,
Misc,,id_gear_max_ef_lock_open[0][1][0],,,
Misc,,id_gear_max_ef_lock_open[0][1][1],,,
Misc,,id_gear_max_ef_lock_open[0][1][2],,,
Misc,,id_gear_max_ef_lock_open[0][2][0],,,
Misc,,id_gear_max_ef_lock_open[0][2][1],,,
Misc,,id_gear_max_ef_lock_open[0][2][2],,,
Misc,,id_gear_max_ef_lock_open[1][0][0],,,
Misc,,id_gear_max_ef_lock_open[1][0][1],,,
Misc,,id_gear_max_ef_lock_open[1][0][2],,,
Misc,,id_gear_max_ef_lock_open[1][1][0],,,
Misc,,id_gear_max_ef_lock_open[1][1][1],,,
Misc,,id_gear_max_ef_lock_open[1][1][2],,,
Misc,,id_gear_max_ef_lock_open[1][2][0],,,
Misc,,id_gear_max_ef_lock_open[1][2][1],,,
Misc,,id_gear_max_ef_lock_open[1][2][2],,,
Misc,,id_poil_h_pump_oil_el_maf_sp,,,
Misc,,id_state_gear_ef_mod_sel[0][0],,,
Misc,,id_state_gear_ef_mod_sel[0][1],,,
Misc,,id_state_gear_ef_mod_sel[0][2],,,
Misc,,id_state_gear_ef_mod_sel[1][0],,,
Misc,,id_state_gear_ef_mod_sel[1][1],,,
Misc,,id_state_gear_ef_mod_sel[1][2],,,
Misc,,id_state_gear_ef_mod_sel[2][0],,,
Misc,,id_state_gear_ef_mod_sel[2][1],,,
Misc,,id_state_gear_ef_mod_sel[2][2],,,
Misc,,id_state_sp_ef_aux[0][0][0],,,
Misc,,id_state_sp_ef_aux[0][0][1],,,
Misc,,id_state_sp_ef_aux[0][0][2],,,
Misc,,id_state_sp_ef_aux[0][1][0],,,
Misc,,id_state_sp_ef_aux[0][1][1],,,
Misc,,id_state_sp_ef_aux[0][1][2],,,
Misc,,id_state_sp_ef_aux[0][2][0],,,
Misc,,id_state_sp_ef_aux[0][2][1],,,
Misc,,id_state_sp_ef_aux[0][2][2],,,
Misc,,id_state_sp_ef_aux[1][0][0],,,
Misc,,id_state_sp_ef_aux[1][0][1],,,
Misc,,id_state_sp_ef_aux[1][0][2],,,
Misc,,id_state_sp_ef_aux[1][1][0],,,
Misc,,id_state_sp_ef_aux[1][1][1],,,
Misc,,id_state_sp_ef_aux[1][1][2],,,
Misc,,id_state_sp_ef_aux[1][2][0],,,
Misc,,id_state_sp_ef_aux[1][2][1],,,
Misc,,id_state_sp_ef_aux[1][2][2],,,
Misc,,id_state_sp_ef[0][0][0],,,
Misc,,id_state_sp_ef[0][0][1],,,
Misc,,id_state_sp_ef[0][0][2],,,
Misc,,id_state_sp_ef[0][1][0],,,
Misc,,id_state_sp_ef[0][1][1],,,
Misc,,id_state_sp_ef[0][1][2],,,
Misc,,id_state_sp_ef[0][2][0],,,
Misc,,id_state_sp_ef[0][2][1],,,
Misc,,id_state_sp_ef[0][2][2],,,
Misc,,id_state_sp_ef[1][0][0],,,
Misc,,id_state_sp_ef[1][0][1],,,
Misc,,id_state_sp_ef[1][0][2],,,
Misc,,id_state_sp_ef[1][1][0],,,
Misc,,id_state_sp_ef[1][1][1],,,
Misc,,id_state_sp_ef[1][1][2],,,
Misc,,id_state_sp_ef[1][2][0],,,
Misc,,id_state_sp_ef[1][2][1],,,
Misc,,id_state_sp_ef[1][2][2],,,
Misc,,id_gear_max_ef_lock_open[0][2][0],Lock Left Exhaust Flap by Gear for Silent mode,,
Misc,,id_gear_max_ef_lock_open[0][2][1],Lock Left Exhaust Flap by Gear for Dynamic mode,,
Misc,,id_gear_max_ef_lock_open[0][2][2],Lock Left Exhaust Flap by Gear for Normal mode,,
Misc,,id_gear_max_ef_lock_open[1][2][0],Lock Right Exhaust Flap by Gear for Silent mode,,
Misc,,id_gear_max_ef_lock_open[1][2][1],Lock Right Exhaust Flap by Gear for Dynamic mode,,
Misc,,id_gear_max_ef_lock_open[1][2][2],Lock Right Exhaust Flap by Gear for Normal mode,,
Misc,,id_state_gear_ef_mod_sel[2][0],Selection between AUX (0) and Normal (1) Maps for Silent mode,,
Misc,,id_state_gear_ef_mod_sel[2][1],Selection between AUX (0) and Normal (1) Maps for Dynamic mode,,
Misc,,id_state_gear_ef_mod_sel[2][2],Selection between AUX (0) and Normal (1) Maps for Normal mode,,
Misc,,id_state_sp_ef_aux[0][2][0],Left Exhaust Flap AUX map for Silent mode,,
Misc,,id_state_sp_ef_aux[0][2][1],Left Exhaust Flap AUX map for Dynamic mode,,
Misc,,id_state_sp_ef_aux[0][2][2],Left Exhaust Flap AUX map for Normal mode,,
Misc,,id_state_sp_ef_aux[1][2][0],Right Exhaust Flap AUX map for Silent mode,,
Misc,,id_state_sp_ef_aux[1][2][1],Right Exhaust Flap AUX map for Dynamic mode,,
Misc,,id_state_sp_ef_aux[1][2][2],Right Exhaust Flap AUX map for Normal mode,,
Misc,,id_state_sp_ef[0][2][0],Left Exhaust Flap map for Silent mode,,
Misc,,id_state_sp_ef[0][2][1],Left Exhaust Flap map for Dynamic mode,,
Misc,,id_state_sp_ef[0][2][2],Left Exhaust Flap map for Normal mode,,
Misc,,id_state_sp_ef[1][2][0],Right Exhaust Flap map for Silent mode,,
Misc,,id_state_sp_ef[1][2][1],Right Exhaust Flap map for Dynamic mode,,
Misc,,id_state_sp_ef[1][2][2],Right Exhaust Flap map for Normal mode,,
Misc,,id_idx_var_pow_clas_ef,Power Class Mapping for Exhaust Flaps,,
Misc,,id_idx_noise_mod_aut_ef,Driving Mode Mapping for Exhaust Flaps,,
Misc,,ip_cam_sp_is_vcp[0],,,
Misc,,ip_cam_sp_is_vcp[1],,,
Misc,,ip_cam_sp_vcp[0][0][0],,,
Expand Down Expand Up @@ -312,9 +274,9 @@ MPI Inhibitors,,id_tia_toil_mpi_inh,,,
MPI Inhibitors,,ip_fup_efp_thd,,,
MPI Inhibitors,,ip_maf_int_ast_mpi_inh_thd,,,
MPI Inhibitors,,ip_maf_int_thd_clr_mpi_inh,,,
Spark,Knock,ip_dly_inc_ad_1_knk,,,
Spark,Knock,ip_dly_inc_ad_1_knk,Cyl Strokes Between Knock Decay Steps AD1,,
Spark,Knock,ip_fac_iga_dec_knk,Knock Energy Muliplier,,
Spark,Knock,ip_dly_inc_fast_knk,,,
Spark,Knock,ip_dly_inc_fast_knk,Cyl Strokes Between Knock Decay Steps,,
Spark,Knock,ip_iga_dec_knk,Initial Knock Correction,,
Spark,Knock,ip_iga_inc_knk,Knock Correction Decay Amount,,
Spark,Knock,ip_knks_gain_1[0],,,
Expand Down Expand Up @@ -572,5 +534,5 @@ Turbocharger,Wastegate,ip_fac_kp_bpa_ctl_cor_pos_1,,,
Turbocharger,,ip_fac_eff_cmpr,Turbo Compressor Efficiency,,
Turbocharger,,ip_fac_put_sp_bol_atjs,Boost Pressure Launch Control,,
Turbocharger,,ip_pq_cha_surge_dl,Turbo Compressor Surge Line,,
Turbocharger,,c_n_tcha_max,,,
Turbocharger,,c_n_tcha_max_sp,,,
Turbocharger,,c_n_tcha_max,Turbocharger Speed for Maximum Toruqe Management,,
Turbocharger,,c_n_tcha_max_sp,Turbocharger Speed to Start Torque Mangement,,
14 changes: 8 additions & 6 deletions a2l2xdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
from sys import argv
from xml.etree.ElementTree import Element, SubElement, Comment, ElementTree

USE_CONSTANTS = (
False
) # Should we use "constants" / "scalars" in the XDF? They kind of aren't good at all...
USE_CONSTANTS = False # Should we use "constants" / "scalars" in the XDF? They kind of aren't good at all...

db = DB()
session = (
Expand Down Expand Up @@ -79,7 +77,11 @@ def xdf_root_with_configuration(title):

def xdf_embeddeddata(element: Element, id, axis_def):
embeddeddata = SubElement(element, "EMBEDDEDDATA")
embeddeddata.set("mmedtypeflags", "0x02" if id != "z" else "0x06")
mmedtypeflags = 0x02 if id != "z" else 0x06
if axis_def["dataSize"] == "FLOAT32_IEEE":
mmedtypeflags += 0x10000

embeddeddata.set("mmedtypeflags", hex(mmedtypeflags))
embeddeddata.set("mmedaddress", str(axis_def["address"]))
embeddeddata.set("mmedelementsizebits", str(data_sizes[axis_def["dataSize"]] * 8))
embeddeddata.set(
Expand Down Expand Up @@ -346,14 +348,14 @@ def coefficients_to_equation(coefficients):

if "x" in table_def:
xdf_axis_with_table(table, "x", table_def["x"])
if row["Generate X Axis"] == "True":
if row["Generate X Axis"].lower() == "true":
xdf_table_from_axis(root, table_def, "x")
else:
fake_xdf_axis_with_size(table, "x", 1)

if "y" in table_def:
xdf_axis_with_table(table, "y", table_def["y"])
if row["Generate Y Axis"] == "True":
if row["Generate Y Axis"].lower() == "true":
xdf_table_from_axis(root, table_def, "y")
else:
fake_xdf_axis_with_size(table, "y", 1)
Expand Down