Commit b40bc9d 1 parent c530ce7 commit b40bc9d Copy full SHA for b40bc9d
File tree 12 files changed +84
-49
lines changed
12 files changed +84
-49
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,15 @@ const target = '../vehicle_profiles.json'
8
8
const files = await glob ( source_folder + '/**/*.json' ) ;
9
9
const params = JSON . parse ( await readFile ( 'params.json' ) ) ;
10
10
11
+ let param_array = Object . getOwnPropertyNames ( params ) ;
12
+ let schema_file = editJsonFile ( 'schema.json' ) ;
13
+ const PARAM_PATH = "properties.pids.items.properties.parameters.propertyNames.enum" ;
14
+ let existing_params = schema_file . get ( PARAM_PATH ) ;
15
+ if ( existing_params !== param_array ) {
16
+ schema_file . set ( PARAM_PATH , param_array ) ;
17
+ schema_file . save ( ) ;
18
+ }
19
+
11
20
let result = {
12
21
'cars' : [ ]
13
22
} ;
@@ -64,11 +73,3 @@ if(supportedVehiclesListFilepath.length == 0 || supportedVehiclesListFilepath.le
64
73
await writeFile ( supportedVehiclesListFilepath [ 0 ] , supportedVehiclesListContent ) ;
65
74
66
75
67
- let param_array = Object . getOwnPropertyNames ( params ) ;
68
- let schema_file = editJsonFile ( 'schema.json' ) ;
69
- const PARAM_PATH = "properties.pids.items.properties.parameters.propertyNames.enum" ;
70
- let existing_params = schema_file . get ( PARAM_PATH ) ;
71
- if ( existing_params !== param_array ) {
72
- schema_file . set ( PARAM_PATH , param_array ) ;
73
- schema_file . save ( ) ;
74
- }
Original file line number Diff line number Diff line change 258
258
"unit" : " V" ,
259
259
"class" : " battery"
260
260
}
261
+ },
262
+ "KWH_CHARGED" : {
263
+ "description" : " Total kWh Charged" ,
264
+ "settings" : {
265
+ "unit" : " kwh" ,
266
+ "class" : " battery"
267
+ }
268
+ },
269
+ "SOC_MIN" : {
270
+ "description" : " Minimum SOC" ,
271
+ "settings" : {
272
+ "unit" : " %" ,
273
+ "class" : " battery"
274
+ }
275
+ },
276
+ "SOC_MAX" : {
277
+ "description" : " Max SOC" ,
278
+ "settings" : {
279
+ "unit" : " %" ,
280
+ "class" : " battery"
281
+ }
261
282
}
262
283
}
Original file line number Diff line number Diff line change 30
30
"type" : " object" ,
31
31
"propertyNames" : {
32
32
"enum" : [
33
- " SOC"
33
+ " SOC" ,
34
+ " SOC_D" ,
35
+ " HV_V" ,
36
+ " LV_V" ,
37
+ " BATT_TEMP" ,
38
+ " BATT_CAPACITY" ,
39
+ " SOH" ,
40
+ " TYRE_P_FL" ,
41
+ " TYRE_P_FR" ,
42
+ " TYRE_P_RL" ,
43
+ " TYRE_P_RR" ,
44
+ " ODOMETER" ,
45
+ " CHARGER_CONNECTED" ,
46
+ " CHARGING" ,
47
+ " CHARGING_DC" ,
48
+ " HV_CAPACITY" ,
49
+ " HV_CAPACITY_KWH" ,
50
+ " HV_CAPACITY_R" ,
51
+ " HV_AV" ,
52
+ " AC_P" ,
53
+ " RANGE" ,
54
+ " OILCH_DIS" ,
55
+ " ENGINE_RPM" ,
56
+ " SPEED" ,
57
+ " COOLANT_TMP" ,
58
+ " FUEL" ,
59
+ " FUEL_PRESSURE" ,
60
+ " INTAKE_AIR_TMP" ,
61
+ " THROTTLE" ,
62
+ " MAF" ,
63
+ " STFT" ,
64
+ " TMP_A" ,
65
+ " AC_C_C" ,
66
+ " AC_C_V"
34
67
]
35
68
}
36
69
}
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ async function validate_profile(path){
17
17
let data = JSON . parse ( file ) ;
18
18
let valid = validate ( data ) ;
19
19
if ( valid ) return
20
-
21
- console . log ( path )
22
20
console . log ( validate . errors )
23
21
errors ++ ;
24
22
}
Original file line number Diff line number Diff line change 11
11
{
12
12
"pid" : " 220008" ,
13
13
"parameters" : {
14
- "HV_VOLTS " : " [B4:B5]"
14
+ "HV_V " : " [B4:B5]"
15
15
}
16
16
},
17
17
{
Original file line number Diff line number Diff line change 19
19
"TYRE_P_RR" : " B12*0.2-0.22"
20
20
}
21
21
}
22
+ ]
22
23
}
Original file line number Diff line number Diff line change 30
30
"class" : " current"
31
31
},
32
32
{
33
- "name" : " HV_VOLTS " ,
33
+ "name" : " HV_V " ,
34
34
"expression" : " [B19:B20]/10" ,
35
35
"unit" : " V" ,
36
36
"class" : " voltage"
Original file line number Diff line number Diff line change 4
4
"pids" : [
5
5
{
6
6
"pid" : " 224910" ,
7
- "parameters" : [
7
+ "parameters" :
8
8
{
9
- "name" : " batterySOC" ,
10
- "pid_init" : " ATSH7E4;" ,
11
- "expression" : " [B4:B5]/100" ,
12
- "unit" : " %" ,
13
- "class" : " battery"
9
+ "SOC" : " [B4:B5]/100"
14
10
}
15
- ]
16
11
},
17
12
{
18
13
"pid" : " 224911" ,
19
- "parameters" : [
14
+ "pid_init" : " ATSH7E4;" ,
15
+ "parameters" :
20
16
{
21
- "name" : " batterySOCMin" ,
22
- "pid_init" : " ATSH7E4;" ,
23
- "expression" : " [B4:B5]/100" ,
24
- "unit" : " %" ,
25
- "class" : " battery"
17
+ "SOC_MIN" : " [B4:B5]/100"
18
+
26
19
}
27
- ]
28
20
},
29
21
{
30
22
"pid" : " 224914" ,
31
- "parameters" : [
23
+ "pid_init" : " ATSH7E4;" ,
24
+ "parameters" :
32
25
{
33
- "name" : " batterySOCMax" ,
34
- "pid_init" : " ATSH7E4;" ,
35
- "expression" : " [B4:B5]/100" ,
36
- "unit" : " %" ,
37
- "class" : " battery"
26
+ "SOC_MAX" : " [B4:B5]/100" ,
38
27
}
39
- ]
40
28
},
41
29
{
42
30
"pid" : " 224918" ,
43
- "parameters" : [
31
+ "pid_init" : " ATSH7E4;" ,
32
+ "parameters" :
44
33
{
45
- "name" : " batterySoHCapacity" ,
46
- "pid_init" : " ATSH7E4;" ,
47
- "expression" : " B4/2" ,
48
- "unit" : " %" ,
49
- "class" : " battery"
34
+ "SOH" : " B4/2"
50
35
}
51
- ]
52
36
},
53
37
{
54
38
"pid" : " 224919" ,
Original file line number Diff line number Diff line change 13
13
"pid" : " 2101" ,
14
14
"parameters" : {
15
15
"SOC" : " B09/2" ,
16
- "CHARGER_CONNECTED" : " B14:7" ,
16
+ "CHARGER_CONNECTED" : " B14:7"
17
17
}
18
18
}
19
19
]
Original file line number Diff line number Diff line change 31
31
"class" : " current"
32
32
},
33
33
{
34
- "name" : " HV_VOLTS " ,
34
+ "name" : " HV_V " ,
35
35
"expression" : " [B19:B20]/10" ,
36
36
"unit" : " V" ,
37
37
"class" : " voltage"
Original file line number Diff line number Diff line change 60
60
{
61
61
"pid" : " 229243" ,
62
62
"parameters" : {
63
- "name" : " KwhCharged" ,
64
- "pid_init" : " " ,
65
- "expression" : " [B5:B8] * 0.001" ,
66
- "unit" : " kwh" ,
67
- "class" : " battery"
63
+ "KWH_CHARGED" : " [B5:B8] * 0.001"
64
+
68
65
}
69
66
},
70
67
{
Original file line number Diff line number Diff line change 5
5
{
6
6
"pid" :" 2240281" ,
7
7
"pid_init" :" ATSHD01635;ATCP1D;ATCRA1EC6AE80;ATFCSH1DD01635;ATFCSD300000;ATFCSM1;" ,
8
- "parameters" :[
8
+ "parameters" :
9
9
{
10
10
"SOC" : " (B4*0.6554)-0.08"
11
11
}
You can’t perform that action at this time.
0 commit comments