Skip to content

Commit

Permalink
Test Alt fields 01
Browse files Browse the repository at this point in the history
  • Loading branch information
Notice-Jeroen-Meijer committed Oct 23, 2019
1 parent e16caf2 commit c57b85e
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 42 deletions.
32 changes: 17 additions & 15 deletions app/src/main/assets/_FieldsAlt.csv
@@ -1,22 +1,23 @@
# SID (defaults to ID.startBit.[responseId]), ID (hex), startBit, endBit, resolution, offset (aplied BEFORE resolution multiplication), decimals, unit, requestID (hex string), responseID (hex string), options (hex, see MainActivity for definitions), optional name, optional list
# 130,44,55,-3,4094,0,Nm,,,ff,DriverBrakeWheelTq_Req
130.44,7bc,28,39,1,4096,0,Nm,224B7E,624B7E,ff,DriverBrakeWheelTq_Req
# 186,16,27,0.5,800,1,Nm,,,ff,MeanEffectiveTorque
186.16,7bc,24,39,0.03125,32768,1,Nm,,,ff,MeanEffectiveTorque (qqqq)
,186,16,27,0.5,800,1,Nm,,,ff,MeanEffectiveTorque
# 186.16,7bc,24,39,0.03125,32768,1,Nm,,,ff,MeanEffectiveTorque (qqqq) ??? Already figured out
# 186,40,49,0.125,0,1,%,,,ff,Throttle
186.40,7ec,24,49,0.125,0,,1,%,22202E,62202E,ff,Accelerator pedal position
# 18a,27,38,0.5,800,1,Nm,,,ff,Coasting Torque - FrictionTorque
18a.40,7bc, (qqqq)
# 1f8,16,27,1,4096,0,Nm,,,ff,TotalPotentialResistiveWheelsTorque
1f8.16,7bc, (qqqq)
186.40,7ec,24,49,0.125,0,1,%,22202E,62202E,ff,Accelerator pedal position
,18a,27,38,0.5,800,1,Nm,,,ff,Coasting Torque - FrictionTorque
# 18a.27, (qqqq)
,1f8,16,27,1,4096,0,Nm,,,ff,TotalPotentialResistiveWheelsTorque
# 1f8.16,7bc, (qqqq)
# 1f8,28,39,-1,4096,0,Nm,,,ff,ElecBrakeWheelsTorqueApplied
1f8.28,7bc,28,39,-1,4096,0,Nm,,,ff,ElecBrakeWheelsTorqueApplied (qqqq)
1f8.28,7bc,28,39,-1,4096,0,Nm,,,ff,ElecBrakeWheelsTorqueApplied
# 1f8,40,50,10,0,0,Rpm,,,ff,ElecEngineRPM
1f8.40,7bc,24,39,10,32768,0,0,223045,623045,ff,ElecEngineRPM
# 1fd,0,7,0.390625,0,1,%,,,ff,12V Battery Current?
1fd.0,7ec,24,31,1,0,1,A,223025,623025,ff,14V DCDC current measure
# 1fd,48,55,1,80,0,kW,,,ff,Consumption
1fd.48,7bc, (qqqq)
# Possible to use a virtual computer field here? No, so this really needs to be changed in the code
# 1fd.48,800,24,55,1,0,0,kW,,,ff,Consumption
# 35c,5,7,1,0,0,,,,ff,Vehicle state
35c.5,765,152,159,1,0,0,,210D,610D,ff,Vehicle state
# 427,40,47,0.3,0,0,kW,,,e2,Available Charging Power (UCP)
Expand All @@ -32,7 +33,7 @@
# 42e,20,24,5,0,0,%,,,e2,Engine Fan Speed
42e.20,7ec,24,31,5,0,0,%,223471,613471,e2,Engine Fan Speed
# 42e,38,43,1,0,1,A,,,e3,Charging Pilot Current
42e.38,7bc, (qqqq)
42e.38,793,24,31,.1,0,0,A,223109,623109,ff,EVSECurrentLimit
# 42e,44,50,1,40,0,°C,,,e3,HV Battery Temp
42e.44,7ec,24,31,1,40,0,°C,222001,622001,e3,HV Battery Temp
# 430,38,39,1,0,0,,,,e2,HV Battery Cooling State
Expand All @@ -50,15 +51,16 @@
# 654,25,31,1,0,0,,,,ff,State of Charge
654.25,7ec,24,39,0.02,0,2,222002,622002,State of Charge (SOC) HV Battery
# 654,32,41,1,0,0,min,,,ff,Time to Full
654.32,7ec, (qqqq)
# through TCU, could be very experimental!
654.32,7da,8,23,1,0,0,,23121DFD02,63121DFD02,ff,MMI_SCH_CANHS.SlowChargeRemainingTime
# 654,42,51,1,0,0,km,,,ff,Available Distance
654.42,7ec,24,39,1,0,0,km,223458,623458,ff,Temporary estimated minimum kilometric cruising range sent to MMI
# 656,48,55,1,40,0,°C,,,e2,External Temp
656.48,763,110,117,1,40,0,°C,2143,6143,e2,External Temp
# 658,33,39,1,0,0,%,,,ff,Battery Health
658.33,7bc,72,79,0.5,0,0,%,2161,6161,ff,Battery Health
# 65b,41,43,1,0,0,,,,ff,Charging Status Display
65b.41,7bc, (qqqq)
,65b,41,43,1,0,0,,,,ff,Charging Status Display
# 65b.41,7bc, (qqqq) => comes from the EVC (MMI_SCH_CANHS_R_04), but a corresponding field can not be found. Used in Charging tech, auxbat and prediction
# 673,0,0,1,0,0,,,,ff,Speed pressure misadaptation
673.0,765,66,66,1,0,0,,2174,6174,ff,SpeedPressureMisadaptation
# 673,2,4,1,0,0,,,,ff,Rear right wheel state
Expand All @@ -77,8 +79,8 @@
673.32,765,128,135,13.725,0,0,mbar,2174,6174,ff,FrontRightWheelPressure
# 673,40,47,13.725,0,0,mbar,2174,6174,ff,Front left wheel pressure
673.40,765,136,143,13.725,0,0,mbar,2174,6174,ff,FrontLeftWheelPressure
# 699,8,15,0.5,0,0,°C,,,e2,Heater setpoint
699.8,764, (qqqq)
,699,8,15,0.5,0,0,°C,,,e2,Heater setpoint
# 699.8,764, (qqqq)
#
#
#
Expand Down
102 changes: 102 additions & 0 deletions app/src/main/assets/_FramesAlt.csv
@@ -0,0 +1,102 @@
#Frame ID,interval ZOE, interval FLUKAN, Sending ECU
#023,4,4,AIBAG
#0C6,10,10,EPS
#12E,10,10,ESC
#130,10,10,UBP
#17A,10,10,EVC
#17E,10,10,EVC
186,10,10,EVC
18A,10,10,EVC
#1F6,10,10,EVC
1F8,10,10,EVC
#1FD,100,100,EVC
#212,20,20,USM
#242,20,20,ESC
#29A,20,20,ESC
#29C,20,20,ESC
#2B7,20,20,ESC
#352,40,200,ESC
#354,40,40,ESC
#35C,100,100,BCM
#391,50,50,CLIM
#3B7,100,100,CLUSTER
#3F7,60,60,EVC
#427,100,100,EVC
#42A,100,100,CLIM
#42E,100,100,EVC
#430,100,100,CLIM
#432,100,100,EVC
#433,1000,1000,CLUSTER
#4F8,100,100,CLUSTER
#500,100,100,BCM
#505,100,100,BCM
#511,100,100,EVC
#534,100,100,BCM
#552,100,100,BCM
#563,100,100,EPS
#5D1,60000,60000,CLUSTER # this frame is AFAIK only sent at bootup
#5D7,100,100,ESC
#5DA,100,100,EVC
#5DE,100,100,BCM
#5E9,100,100,UPA
#5EE,100,100,BCM
#62C,100,100,EPS
#62D,500,500,EVC
#634,100,100,TCU
#637,500,500,EVC
#638,100,100,EVC
#646,500,500,CLUSTER
#650,100,300,EVC
#653,100,100,AIRBAG
#654,500,500,EVC
#656,100,100,CLUSTER
#657,100,100,BCM
#658,3000,3000,EVC
65B,100,100,EVC
#665,3000,3000,CLUSTER
#666,100,200,ESC
#668,100,100,CLIMA
#66A,100,100,EVC
#66D,100,100,UBP
#671,9999,100,
#673,100,100,BCM
#68B,100,100,CLUSTER
#68C,1000,1000,CLUSTER
699,1000,1000,CLIMA
#69F,1000,1000,BCM
#6F8,100,100,USM
#6FB,3000,3000,CLUSTER
702,100,100, # LINSCH
722,100,100,LINSCH
740,100,100, # ESC
742,100,100, # EPS
743,100,100, # CLUSTER
744,100,100, # CLIM
745,100,100, # BCM
74D,100,100, # USM
74E,100,100, # UPA
752,100,100, # AIBAG
75A,100,100, # PEB
760,100,100,ESC
762,100,100,EPS
763,100,100,CLUSTER
764,100,100,CLIM
765,100,100,BCM
76D,100,100,USM
76E,100,100,UPA
772,100,100,AIBAG
77E,100,100,PEB
792,100,100, # BCB
793,100,100,BCB
796,100,100, # LBC2
79B,100,100, # LBC
79C,100,100, # UBP
7B6,100,100,LBC2
7BB,100,100,LBC
7BC,100,100,UBP
7CA,100,100, # TCU
7DA,100,100,TCU
7DF,100,100, # Broadcast
7E4,100,100, # EVC
7EC,100,100,EVC
800,100,100,VFC
Expand Up @@ -48,7 +48,7 @@ public class DrivingActivity extends CanzeActivity implements FieldListener, Deb
// for ISO-TP optimization to work, group all identical CAN ID's together when calling addListener

// free data
private static final String SID_DcPower = "1fd.48"; //EVC
private static final String SID_DcPower = "800.61.3.24"; // "1fd.48"; //EVC
private static final String SID_Pedal = "186.40"; //EVC
private static final String SID_MeanEffectiveTorque = "186.16"; //EVC
private static final String SID_Coasting_Torque = "18a.27"; //10ms Friction torque means EMULATED friction, what we'd call coasting
Expand Down
Expand Up @@ -31,7 +31,7 @@ protected void onCreate(Bundle savedInstanceState) {
final Spinner field = findViewById(R.id.field);
arrayFieldAdapter = new ArrayAdapter<>(this,android.R.layout.simple_list_item_1);
arrayFieldAdapter.add(Fields.getInstance().getBySID("5d7.0")); // speed
arrayFieldAdapter.add(Fields.getInstance().getBySID("1fd.48")); // power
arrayFieldAdapter.add(Fields.getInstance().getBySID("800.6103.24")); // power
field.setAdapter(arrayFieldAdapter);

ArrayAdapter<String> arrayStringAdapter;
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/lu/fisch/canze/actors/Fields.java
Expand Up @@ -485,7 +485,7 @@ public void load(String assetName) {
fields.clear();
fieldsBySid.clear();
if (assetName.equals("")) {
fillFromAsset("_Fields.csv");
fillFromAsset("_FieldsAlt.csv");
addVirtualFields();
} else {
fillFromAsset(assetName);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/lu/fisch/canze/actors/Frames.java
Expand Up @@ -112,7 +112,7 @@ public void load (String assetName)
{
frames.clear();
if (assetName.equals("")) {
fillFromAsset("_Frames.csv");
fillFromAsset("_FramesAlt.csv");
} else {
fillFromAsset(assetName);
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/lu/fisch/canze/classes/DataLogger.java
Expand Up @@ -45,7 +45,7 @@ public static DataLogger getInstance() {
// -------- Data Definitions copied from Driving Activity -- start ---
// for ISO-TP optimization to work, group all identical CAN ID's together when calling addListener
// free data
private static final String SID_Consumption = "1fd.48"; //EVC
private static final String SID_Consumption = "800.6103.24"; //EVC
private static final String SID_Pedal = "186.40"; //EVC
private static final String SID_MeanEffectiveTorque = "186.16"; //EVC
private static final String SID_RealSpeed = "5d7.0"; //ESC-ABS
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_consumption.xml
Expand Up @@ -215,22 +215,22 @@
custom:maxAlt="100"
custom:majorTicks="15"
custom:minorTicks="5"
custom:fieldSID="1fd.48,654.25"
custom:fieldSID="800.6103.24,654.25"
custom:widget="timeplot"
custom:colorRanges="[
{'sid':'1fd.48','color':'#cc00ff','from':-100,'to':-1},
{'sid':'1fd.48','color':'#3ee9ff','from':-1,'to':1},
{'sid':'1fd.48','color':'#008a1d','from':1,'to':20},
{'sid':'1fd.48','color':'#ffaa17','from':20,'to':33},
{'sid':'1fd.48','color':'#FF0000','from':33,'to':100},
{'sid':'800.6103.24','color':'#cc00ff','from':-100,'to':-1},
{'sid':'800.6103.24','color':'#3ee9ff','from':-1,'to':1},
{'sid':'800.6103.24','color':'#008a1d','from':1,'to':20},
{'sid':'800.6103.24','color':'#ffaa17','from':20,'to':33},
{'sid':'800.6103.24','color':'#FF0000','from':33,'to':100},
{'sid':'654.25','color':'?android:attr/colorForeground','from':0, 'to':100}
]"
custom:text="@string/graph_PowerSoc"
custom:intervals="{
'654.25':10000
}"
custom:options="{
'1fd.48':'gradient',
'800.6103.24':'gradient',
'654.25':'alt,dot'
}"
custom:backgroundColor="?android:attr/colorBackground"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_consumption_dash.xml
Expand Up @@ -215,14 +215,14 @@
custom:maxAlt="25"
custom:majorTicks="15"
custom:minorTicks="5"
custom:fieldSID="1fd.48,800.6108.24"
custom:fieldSID="800.6103.24,800.6108.24"
custom:widget="timeplot"
custom:colorRanges="[
{'sid':'1fd.48','color':'#cc00ff','from':-100,'to':-1},
{'sid':'1fd.48','color':'#3ee9ff','from':-1,'to':1},
{'sid':'1fd.48','color':'#008a1d','from':1,'to':20},
{'sid':'1fd.48','color':'#ffaa17','from':20,'to':33},
{'sid':'1fd.48','color':'#FF0000','from':33,'to':100},
{'sid':'800.6103.24','color':'#cc00ff','from':-100,'to':-1},
{'sid':'800.6103.24','color':'#3ee9ff','from':-1,'to':1},
{'sid':'800.6103.24','color':'#008a1d','from':1,'to':20},
{'sid':'800.6103.24','color':'#ffaa17','from':20,'to':33},
{'sid':'800.6103.24','color':'#FF0000','from':33,'to':100},
{'sid':'800.6108.24','color':'#017720','from':-20,'to':0},
{'sid':'800.6108.24','color':'#77011d','from':0,'to':20}
]"
Expand All @@ -231,7 +231,7 @@
'800.6108.24':2000
}"
custom:options="{
'1fd.48':'gradient',
'800.6103.24':'gradient',
'800.6108.24':'alt'
}"
custom:backgroundColor="?android:attr/colorBackground"
Expand Down
14 changes: 7 additions & 7 deletions app/src/main/res/layout/activity_consumption_mi.xml
Expand Up @@ -215,21 +215,21 @@
custom:maxAlt="100"
custom:majorTicks="15"
custom:minorTicks="5"
custom:fieldSID="1fd.48,654.25"
custom:fieldSID="800.6103.24,654.25"
custom:widget="timeplot"
custom:colorRanges="[
{'sid':'1fd.48','color':'#cc00ff','from':-100,'to':-1},
{'sid':'1fd.48','color':'#3ee9ff','from':-1,'to':1},
{'sid':'1fd.48','color':'#008a1d','from':1,'to':20},
{'sid':'1fd.48','color':'#ffaa17','from':20,'to':33},
{'sid':'1fd.48','color':'#FF0000','from':33,'to':100}
{'sid':'800.6103.24','color':'#cc00ff','from':-100,'to':-1},
{'sid':'800.6103.24','color':'#3ee9ff','from':-1,'to':1},
{'sid':'800.6103.24','color':'#008a1d','from':1,'to':20},
{'sid':'800.6103.24','color':'#ffaa17','from':20,'to':33},
{'sid':'800.6103.24','color':'#FF0000','from':33,'to':100}
]"
custom:text="Power (kWh), SOC (%)"
custom:intervals="{
'654.25':10000
}"
custom:options="{
'1fd.48':'gradient',
'800.6103.24':'gradient',
'654.25':'alt,dot'
}"
custom:backgroundColor="?android:attr/colorBackground"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_dash.xml
Expand Up @@ -132,7 +132,7 @@
custom:max="70"
custom:majorTicks="10"
custom:minorTicks="5"
custom:fieldSID="1fd.48"
custom:fieldSID="800.6103.24"
custom:widget="tacho"
custom:text="Power (kWh)"
custom:backgroundColor="?android:attr/colorBackground"
Expand Down

0 comments on commit c57b85e

Please sign in to comment.