diff --git a/cangen/README.md b/cangen/README.md index 54568e8..e0c4196 100644 --- a/cangen/README.md +++ b/cangen/README.md @@ -17,6 +17,7 @@ Ex. If there are 5 messages of size one (booleans), add a 3 bit filler before ad 8. Unsent messages should only contain the size parameter 9. Make the topic of an EncodableCANMsg be `"Calypso/Bidir/State/{key}/{field_name}"` 10. The description field must be only letters and spaces, upper or lowercase +11. Sim enum frrquencies must add up to 1 or they will not be respected. Message guide: 1. Use previous examples for most things @@ -84,6 +85,10 @@ Occassionally you may want Calypso to also send a message on the CAN network. Us - `is_ext`, boolean representing whether the CAN ID is extended or standard (`false` by default) It is recommended that the decoding of the message be done to the topic `"Calypso/Bidir/State/{key}/{field_name}"`. Note decoding works exactly the same with these messages, so serves as an accurate representation of what Calypso is current sending out to the car. +Also, you should allow for simulation of the data point whenever possible. + - `sim_freq`, integer frequency of which this message is usually emitted, in ms + + #### NetField @@ -93,6 +98,7 @@ Within the `fields` member of a Message object, there is a list of NetField obje - `points`, a list of Point objects to be used for this MQTT message - `send` (optional), boolean representing whether this message should be send over the network (`true` by default) - `topic_append` (optional), boolean representing whether to append the topic name with the value of the first CANPoint in `points` (`false` by default) +- `sim` (optional) a sim object to define simulation parameters #### Point @@ -102,7 +108,21 @@ Within the `points` member of a NetField object, there is a list of Point object - `signed` (optional), boolean representing whether or not the number is signed in two's complement form (`false` by default) - `endianness` (optional), string representing the byte endianness of the bits being read, either `"big"` or `"little"` (`"big"` by default) - `format` (optional, not recommended), string representing the final type of the data (`"f32"` by default) -- `default` (optional, only for Encodable Messages), float representing the default value to be sent before a command is received or when an empty command is received. This is ignored when decoding the Point (`0` by default) +- `default_value` (optional, only for Encodable Messages), float representing the default value to be sent before a command is received or when an empty command is received. This is ignored when decoding the Point (`0` by default) + +#### Sim +Within the `sim` member of a NetField object, there is a single sim object. This object is one of two types, either `sweep` or `enum`. However these types are implied, not written in the JSON, just use them correctly! + +`sweep`: sweep a certain range of values +- `min`, float, the minium value to emit +- `max`, float, the maximum value to emit +- `inc_min`, float, the minimum increment +- `inc_max`, float, the maximum increment +- `round`, bool, whether to round values to a whole number (more precise rounding is not supported) + +or +`enum`: choose from a certain list of values +- `options`, list[[`value`, `freq`]...], a list containing lists of length two. Each inner list's first item is the value to be emitted, and the second item is the probability the item should be emitted. **These probabilities must add to 1, or they won't be obeyed.** ### Directory Structure diff --git a/cangen/can-messages/bms.json b/cangen/can-messages/bms.json index 8f72369..4e9c34a 100644 --- a/cangen/can-messages/bms.json +++ b/cangen/can-messages/bms.json @@ -1,773 +1,996 @@ [ - { - "id": "0x80", - "desc": "accumulator status", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Pack/Voltage", - "unit": "V", - "sim_min": 400, - "sim_max": 505, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 16, - "format": "divide10" - } - ] - }, - { - "name": "BMS/Pack/Current", - "unit": "A", - "sim_min": 0, - "sim_max": 50, - "sim_inc_min": 0, - "sim_inc_max": 3, - "send": false, - "points": [ - { - "size": 16 - } - ] - }, - { - "name": "BMS/Pack/Amp-hours", - "unit": "Ah", - "sim_min": 0, - "sim_max": 100, - "sim_inc_min": 0, - "sim_inc_max": 0.1, - "points": [ - { - "size": 16 - } - ] - }, - { - "name": "BMS/Pack/SOC", - "unit": "%", - "sim_min": 0, - "sim_max": 100, - "sim_inc_min": 0.01, - "sim_inc_max": 0.1, - "points": [ - { - "size": 8 - } - ] - }, - { - "name": "BMS/Pack/Health", - "unit": "%", - "sim_min": 0, - "sim_max": 100, - "sim_inc_min": 0, - "sim_inc_max": 0.1, - "points": [ - { - "size": 8 - } - ] - } - ] - }, - { - "id": "0x81", - "desc": "BMS Status", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Status/State", - "unit": "", - "sim_min": 0, - "sim_max": 4, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 8 - } - ] - }, - { - "name": "BMS/Status/F/Extra", - "unit": "", - "send": false, - "points": [ - { - "size": 13 - } - ] - }, - { - "name": "BMS/Status/F/Open_Wire", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/CCL_Enforce", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Charger_Can", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Battery_Therm", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Charger_Safety", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/DCL_Enforce", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/External_Can", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Weak_Pack", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Low_Cell_Volts", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Charge_Reading", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Current_Sense", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/IC_Comm", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Thermal_Err", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Software", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Open_Wire", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Pack_Overheat", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Cell_Undervoltage", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Cell_Overvoltage", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/F/Cells_Not_Balancing", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 1 - } - ] - }, - { - "name": "BMS/Status/Temp_Average", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.5, - "points": [ - { - "size": 8 - } - ] - }, - { - "name": "BMS/Status/Temp_Internal", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 8 - } - ] - }, - { - "name": "BMS/Status/Balancing", - "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 0, - "sim_inc_max": 1, - "points": [ - { - "size": 8 - } - ] - } - ] - }, - { - "id": "0x83", - "desc": "Cell Data", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Cells/Volts_High_Value", - "unit": "V", - "sim_min": 2.5, - "sim_max": 4.25, - "sim_inc_min": 0.001, - "sim_inc_max": 0.1, - "points": [ - { - "size": 16, - "format": "divide10000" - } - ] - }, - { - "name": "BMS/Cells/Volts_High_Chip", - "unit": "", - "sim_min": 1, - "sim_max": 12, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Volts_High_Cell", - "unit": "", - "sim_min": 1, - "sim_max": 120, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Volts_Low_Value", - "unit": "V", - "sim_min": 2.5, - "sim_max": 4.25, - "sim_inc_min": 0.001, - "sim_inc_max": 0.1, - "points": [ - { - "size": 16, - "format": "divide10000" - } - ] - }, - { - "name": "BMS/Cells/Volts_Low_Chip", - "unit": "", - "sim_min": 1, - "sim_max": 12, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Volts_Low_Cell", - "unit": "", - "sim_min": 1, - "sim_max": 120, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Volts_Avg_Value", - "unit": "V", - "sim_min": 2.5, - "sim_max": 4.25, - "sim_inc_min": 0.001, - "sim_inc_max": 0.1, - "points": [ - { - "size": 16, - "format": "divide10000" - } - ] - } - ] - }, - { - "id": "0x84", - "desc": "Cell Temperatures", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Cells/Temp_High_Value", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 16 - } - ] - }, - { - "name": "BMS/Cells/Temp_High_Cell", - "unit": "", - "sim_min": 1, - "sim_max": 120, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Temp_High_Chip", - "unit": "", - "sim_min": 1, - "sim_max": 12, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Temp_Low_Value", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 16 - } - ] - }, - { - "name": "BMS/Cells/Temp_Low_Cell", - "unit": "", - "sim_min": 1, - "sim_max": 120, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Temp_Low_Chip", - "unit": "", - "sim_min": 1, - "sim_max": 12, - "sim_inc_min": 1, - "sim_inc_max": 1, - "points": [ - { - "size": 4 - } - ] - }, - { - "name": "BMS/Cells/Temp_Avg_Value", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 16 - } - ] - } - ] - }, - { - "id": "0x85", - "desc": "Segment Temperatures", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Segment_Temp/1", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 8, - "signed": true - } - ] - }, - { - "name": "BMS/Segment_Temp/2", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 8, - "signed": true - } - ] - }, - { - "name": "BMS/Segment_Temp/3", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 8, - "signed": true - } - ] - }, - { - "name": "BMS/Segment_Temp/4", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 8, - "signed": true - } - ] - }, - { - "name": "BMS/Segment_Temp/5", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 8, - "signed": true - } - ] - }, - { - "name": "BMS/Segment_Temp/6", - "unit": "C", - "sim_min": 10, - "sim_max": 50, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, - "points": [ - { - "size": 8, - "signed": true - } - ] - } - ] - }, - { - "id": "0x86", - "desc": "Current Limits", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Pack/DCL", - "unit": "", - "sim_min": 20, - "sim_max": 520, - "sim_inc_min": 0.1, - "sim_inc_max": 4, - "points": [ - { - "size": 16 - } - ] - }, - { - "name": "BMS/Pack/CCL", - "unit": "", - "sim_min": 0, - "sim_max": 25, - "sim_inc_min": 0, - "sim_inc_max": 2, - "points": [ - { - "size": 16, - "signed": true - } - ] - }, - { - "name": "BMS/Pack/Current", - "unit": "", - "sim_min": 0, - "sim_max": 100, - "sim_inc_min": 0, - "sim_inc_max": 5, - "points": [ - { - "size": 16, - "signed": true - } - ] - } - ] - }, - { - "id": "0x702", - "desc": "BMS Debug", - "sim_freq": 700, - "fields": [ - { - "name": "BMS/Debug/Spare0", - "unit": "", - "points": [ - { - "size": 8 - } - ] - }, - { - "name": "BMS/Debug/Spare1", - "unit": "", - "points": [ - { - "size": 8 - } - ] - }, - { - "name": "BMS/Debug/Spare2", - "unit": "", - "points": [ - { - "size": 16 - } - ] - }, - { - "name": "BMS/Debug/Spare3", - "unit": "", - "points": [ - { - "size": 32 - } - ] - } - ] - } + { + "id": "0x80", + "desc": "accumulator status", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Pack/Voltage", + "unit": "V", + "sim": { + "min": 400, + "max": 505, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 16, + "format": "divide10" + } + ] + }, + { + "name": "BMS/Pack/Current", + "unit": "A", + "sim": { + "min": 0, + "max": 50, + "inc_min": 0, + "inc_max": 3 + }, + "send": false, + "points": [ + { + "size": 16 + } + ] + }, + { + "name": "BMS/Pack/Amp-hours", + "unit": "Ah", + "sim": { + "min": 0, + "max": 100, + "inc_min": 0, + "inc_max": 0.1 + }, + "points": [ + { + "size": 16 + } + ] + }, + { + "name": "BMS/Pack/SOC", + "unit": "%", + "sim": { + "min": 0, + "max": 100, + "inc_min": 0.01, + "inc_max": 0.1 + }, + "points": [ + { + "size": 8 + } + ] + }, + { + "name": "BMS/Pack/Health", + "unit": "%", + "sim": { + "min": 0, + "max": 100, + "inc_min": 0, + "inc_max": 0.1 + }, + "points": [ + { + "size": 8 + } + ] + } + ] + }, + { + "id": "0x81", + "desc": "BMS Status", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Status/State", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.01 + ], + [ + 1, + 0.80 + ], + [ + 2, + 0.15 + ], + [ + 3, + 0.04 + ] + ] + }, + "points": [ + { + "size": 8 + } + ] + }, + { + "name": "BMS/Status/F/Extra", + "unit": "", + "send": false, + "points": [ + { + "size": 14 + } + ] + }, + { + "name": "BMS/Status/F/CCL_Enforce", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Charger_Can", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Battery_Therm", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Charger_Safety", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/DCL_Enforce", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/External_Can", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Weak_Pack", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Low_Cell_Volts", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Charge_Reading", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Current_Sense", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/IC_Comm", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Thermal_Err", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Software", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Open_Wire", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Pack_Overheat", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Cell_Undervoltage", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Cell_Overvoltage", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/F/Cells_Not_Balancing", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.5 + ], + [ + 1, + 0.5 + ] + ] + }, + "points": [ + { + "size": 1 + } + ] + }, + { + "name": "BMS/Status/Temp_Average", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.5 + }, + "points": [ + { + "size": 8 + } + ] + }, + { + "name": "BMS/Status/Temp_Internal", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 1, + "inc_max": 1 + }, + "points": [ + { + "size": 8 + } + ] + }, + { + "name": "BMS/Status/Balancing", + "unit": "", + "sim": { + "options": [ + [ + 0, + 0.40 + ], + [ + 1, + 0.60 + ] + ] + }, + "points": [ + { + "size": 8 + } + ] + } + ] + }, + { + "id": "0x83", + "desc": "Cell Data", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Cells/Volts_High_Value", + "unit": "V", + "sim": { + "min": 2.5, + "max": 4.25, + "inc_min": 0.001, + "inc_max": 0.1 + }, + "points": [ + { + "size": 16, + "format": "divide10000" + } + ] + }, + { + "name": "BMS/Cells/Volts_High_Chip", + "unit": "", + "sim": { + "min": 1, + "max": 12, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Volts_High_Cell", + "unit": "", + "sim": { + "min": 1, + "max": 120, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Volts_Low_Value", + "unit": "V", + "sim": { + "min": 2.5, + "max": 4.25, + "inc_min": 0.001, + "inc_max": 0.1 + }, + "points": [ + { + "size": 16, + "format": "divide10000" + } + ] + }, + { + "name": "BMS/Cells/Volts_Low_Chip", + "unit": "", + "sim": { + "min": 1, + "max": 12, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Volts_Low_Cell", + "unit": "", + "sim": { + "min": 1, + "max": 120, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Volts_Avg_Value", + "unit": "V", + "sim": { + "min": 2.5, + "max": 4.25, + "inc_min": 0.001, + "inc_max": 0.1 + }, + "points": [ + { + "size": 16, + "format": "divide10000" + } + ] + } + ] + }, + { + "id": "0x84", + "desc": "Cell Temperatures", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Cells/Temp_High_Value", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 16 + } + ] + }, + { + "name": "BMS/Cells/Temp_High_Cell", + "unit": "", + "sim": { + "min": 1, + "max": 120, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Temp_High_Chip", + "unit": "", + "sim": { + "min": 1, + "max": 12, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Temp_Low_Value", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 16 + } + ] + }, + { + "name": "BMS/Cells/Temp_Low_Cell", + "unit": "", + "sim": { + "min": 1, + "max": 120, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Temp_Low_Chip", + "unit": "", + "sim": { + "min": 1, + "max": 12, + "inc_min": 1, + "inc_max": 1, + "round": true + }, + "points": [ + { + "size": 4 + } + ] + }, + { + "name": "BMS/Cells/Temp_Avg_Value", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 16 + } + ] + } + ] + }, + { + "id": "0x85", + "desc": "Segment Temperatures", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Segment_Temp/1", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 8, + "signed": true + } + ] + }, + { + "name": "BMS/Segment_Temp/2", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 8, + "signed": true + } + ] + }, + { + "name": "BMS/Segment_Temp/3", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 8, + "signed": true + } + ] + }, + { + "name": "BMS/Segment_Temp/4", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 8, + "signed": true + } + ] + }, + { + "name": "BMS/Segment_Temp/5", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 8, + "signed": true + } + ] + }, + { + "name": "BMS/Segment_Temp/6", + "unit": "C", + "sim": { + "min": 10, + "max": 50, + "inc_min": 0.01, + "inc_max": 0.3 + }, + "points": [ + { + "size": 8, + "signed": true + } + ] + } + ] + }, + { + "id": "0x86", + "desc": "Current Limits", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Pack/DCL", + "unit": "", + "sim": { + "min": 20, + "max": 520, + "inc_min": 0.1, + "inc_max": 4 + }, + "points": [ + { + "size": 16 + } + ] + }, + { + "name": "BMS/Pack/CCL", + "unit": "", + "sim": { + "min": 0, + "max": 25, + "inc_min": 0, + "inc_max": 2 + }, + "points": [ + { + "size": 16, + "signed": true + } + ] + }, + { + "name": "BMS/Pack/Current", + "unit": "", + "sim": { + "min": 0, + "max": 100, + "inc_min": 0, + "inc_max": 5 + }, + "points": [ + { + "size": 16, + "signed": true + } + ] + } + ] + }, + { + "id": "0x702", + "desc": "BMS Debug", + "sim_freq": 700, + "fields": [ + { + "name": "BMS/Debug/Spare0", + "unit": "", + "points": [ + { + "size": 8 + } + ] + }, + { + "name": "BMS/Debug/Spare1", + "unit": "", + "points": [ + { + "size": 8 + } + ] + }, + { + "name": "BMS/Debug/Spare2", + "unit": "", + "points": [ + { + "size": 16 + } + ] + }, + { + "name": "BMS/Debug/Spare3", + "unit": "", + "points": [ + { + "size": 32 + } + ] + } + ] + } ] diff --git a/cangen/can-messages/calypso_cmd.json b/cangen/can-messages/calypso_cmd.json index d21bea8..9884bda 100644 --- a/cangen/can-messages/calypso_cmd.json +++ b/cangen/can-messages/calypso_cmd.json @@ -8,10 +8,12 @@ { "name": "Calypso/Bidir/State/FirstOff/A", "unit": "Z", - "sim_min": 1, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 2, + "sim": { + "min": 1, + "max": 100, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 32, @@ -19,15 +21,16 @@ "default": 18.443 } ] - } - , + }, { "name": "Calypso/Bidir/State/FirstOff/B", "unit": "G", - "sim_min": 1, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 2, + "sim": { + "min": 1, + "max": 100, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 8, @@ -35,30 +38,32 @@ "default": 35.4 } ] - } - , + }, { "name": "Calypso/Bidir/State/FirstOff/C", "unit": "G", - "sim_min": 1, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 2, + "sim": { + "min": 1, + "max": 100, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 8, "default": 19 } ] - } - , + }, { "name": "Calypso/Bidir/State/FirstOff/D", "unit": "G", - "sim_min": 1, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 2, + "sim": { + "min": 1, + "max": 100, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 16, @@ -70,8 +75,7 @@ ] } ] - } - , + }, { "id": "0xFFFFF", "desc": "Example Enc Msg Ext", @@ -82,10 +86,12 @@ { "name": "Calypso/Bidir/State/SecondOff/A", "unit": "GG", - "sim_min": 1, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 2, + "sim": { + "min": 1, + "max": 100, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 32, @@ -94,8 +100,7 @@ ] } ] - } - , + }, { "id": "0x7FF", "desc": "Calypso bidir unknown key", @@ -104,10 +109,12 @@ { "name": "Calypso/Bidir/Unknown", "unit": "pts", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 0, - "sim_inc_max": 1, + "sim": { + "min": 1, + "max": 100, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 8 @@ -116,4 +123,4 @@ } ] } -] +] \ No newline at end of file diff --git a/cangen/can-messages/charger.json b/cangen/can-messages/charger.json index d81c033..0dea159 100644 --- a/cangen/can-messages/charger.json +++ b/cangen/can-messages/charger.json @@ -7,47 +7,56 @@ { "name": "BMS/Charging/Voltage", "unit": "V", - "sim_min": 400, - "sim_max": 505, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, + "sim": { + "min": 400, + "max": 505, + "inc_min": 0.01, + "inc_max": 0.3 + }, "points": [ { "size": 16, "format": "divide10" } ] - } - , + }, { "name": "BMS/Charging/Current", "unit": "A", - "sim_min": 0, - "sim_max": 12, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": 0, + "max": 12, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 16, "format": "divide10" } ] - } - , + }, { "name": "BMS/Charging/Control", "unit": "", - "sim_min": 0, - "sim_max": 255, - "sim_inc_min": 255, - "sim_inc_max": 255, + "sim": { + "options": [ + [ + 0, + 0.9 + ], + [ + 255, + 0.1 + ] + ] + }, "points": [ { "size": 8 } ] - } - , + }, { "name": "BMS/Charging/UnimplementedData", "unit": "", @@ -59,8 +68,7 @@ ] } ] - } - , + }, { "id": "0x18FF50E5", "desc": "Charger Box Status", @@ -69,25 +77,28 @@ { "name": "Charger/Box/Voltage", "unit": "V", - "sim_min": 400, - "sim_max": 505, - "sim_inc_min": 0.01, - "sim_inc_max": 0.3, + "sim": { + "min": 400, + "max": 505, + "inc_min": 0.01, + "inc_max": 0.3 + }, "points": [ { "size": 16, "format": "divide10" } ] - } - , + }, { "name": "Charger/Box/Current", "unit": "A", - "sim_min": 0, - "sim_max": 12, - "sim_inc_min": 0.1, - "sim_inc_max": 1, + "sim": { + "min": 0, + "max": 12, + "inc_min": 0.1, + "inc_max": 1 + }, "points": [ { "size": 16, @@ -95,78 +106,112 @@ "format": "divide10" } ] - } - , + }, { "name": "Charger/Box/F_CommTimeout", "unit": "bool", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "Charger/Box/F_WrongBatConnection", "unit": "bool", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "Charger/Box/F_VoltageWrong", "unit": "bool", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "Charger/Box/F_OverTemp", "unit": "bool", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "Charger/Box/F_HardwareFailure", "unit": "bool", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "Charger/Box/UnimplementedData", "unit": "", @@ -179,4 +224,4 @@ } ] } -] +] \ No newline at end of file diff --git a/cangen/can-messages/dti.json b/cangen/can-messages/dti.json index 8753759..5303520 100644 --- a/cangen/can-messages/dti.json +++ b/cangen/can-messages/dti.json @@ -7,25 +7,28 @@ { "name": "DTI/RPM/ERPM", "unit": "ERPM", - "sim_min": -2147483648, - "sim_max": 2147483648, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": -1000000, + "max": 1000000, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 32, "signed": true } ] - } - , + }, { "name": "DTI/Power/Duty_Cycle", "unit": "%", - "sim_min": -32768, - "sim_max": 32767, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": -4000, + "max": 4000, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 16, @@ -33,15 +36,16 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Power/Input_Voltage", "unit": "V", - "sim_min": 0, - "sim_max": 505, - "sim_inc_min": 0.01, - "sim_inc_max": 10, + "sim": { + "min": 0, + "max": 505, + "inc_min": 0.01, + "inc_max": 10 + }, "points": [ { "size": 16, @@ -50,8 +54,7 @@ ] } ] - } - , + }, { "id": "0x436", "desc": "Currents_Status", @@ -60,10 +63,12 @@ { "name": "DTI/Power/AC_Current", "unit": "A", - "sim_min": -125, - "sim_max": 250, - "sim_inc_min": 0.01, - "sim_inc_max": 20, + "sim": { + "min": -125, + "max": 250, + "inc_min": 0.01, + "inc_max": 20 + }, "points": [ { "size": 16, @@ -71,15 +76,16 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Power/DC_Current", "unit": "A", - "sim_min": -300, - "sim_max": 300, - "sim_inc_min": 2, - "sim_inc_max": 5, + "sim": { + "min": -300, + "max": 300, + "inc_min": 2, + "inc_max": 5 + }, "points": [ { "size": 16, @@ -87,8 +93,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Reserved", "unit": "", @@ -100,8 +105,7 @@ ] } ] - } - , + }, { "id": "0x456", "desc": "Temps_Fault_Code_Status", @@ -110,10 +114,12 @@ { "name": "DTI/Temps/Controller_Temperature", "unit": "C", - "sim_min": 5, - "sim_max": 80, - "sim_inc_min": 0.05, - "sim_inc_max": 0.5, + "sim": { + "min": 5, + "max": 80, + "inc_min": 0.05, + "inc_max": 0.5 + }, "points": [ { "size": 16, @@ -121,15 +127,16 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Temps/Motor_Temperature", "unit": "C", - "sim_min": 5, - "sim_max": 80, - "sim_inc_min": 0.05, - "sim_inc_max": 0.5, + "sim": { + "min": 5, + "max": 80, + "inc_min": 0.05, + "inc_max": 0.5 + }, "points": [ { "size": 16, @@ -137,22 +144,64 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Fault/Fault_Code", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.90 + ], + [ + 1, + 0.01 + ], + [ + 2, + 0.01 + ], + [ + 3, + 0.01 + ], + [ + 4, + 0.01 + ], + [ + 5, + 0.01 + ], + [ + 6, + 0.01 + ], + [ + 7, + 0.01 + ], + [ + 8, + 0.01 + ], + [ + 9, + 0.01 + ], + [ + 10, + 0.01 + ] + ] + }, "points": [ { "size": 8 } ] - } - , + }, { "name": "DTI/Unused/Reserved", "unit": "", @@ -164,8 +213,7 @@ ] } ] - } - , + }, { "id": "0x476", "desc": "MC_FOC_Algorithm", @@ -174,10 +222,12 @@ { "name": "DTI/FOC/Component_Id", "unit": "A", - "sim_min": -2147483648, - "sim_max": 2147483648, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": -1000000, + "max": 1000000, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 32, @@ -185,15 +235,16 @@ "format": "divide100" } ] - } - , + }, { "name": "DTI/FOC/Component_Iq", "unit": "A", - "sim_min": -2147483648, - "sim_max": 2147483648, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": -1000000, + "max": 1000000, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 32, @@ -203,8 +254,7 @@ ] } ] - } - , + }, { "id": "0x496", "desc": "MC_General_Data", @@ -213,313 +263,455 @@ { "name": "DTI/General/Throttle_Signal", "unit": "%", - "sim_min": -100, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": -100, + "max": 100, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 8, "signed": true } ] - } - , + }, { "name": "DTI/General/Brake_Signal", "unit": "%", - "sim_min": -100, - "sim_max": 100, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "min": -100, + "max": 100, + "inc_min": 1, + "inc_max": 1 + }, "points": [ { "size": 8, "signed": true } ] - } - , + }, { "name": "DTI/General/Digital_Out_4", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_Out_3", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_Out_2", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_Out_1", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_In_4", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_In_3", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_In_2", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Digital_In_1", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/General/Drive_Enable", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.80 + ], + [ + 1, + 0.20 + ] + ] + }, "points": [ { "size": 8 } ] - } - , + }, { "name": "DTI/Limit/Motor_Temp_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/Motor_Acc_Temp_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/Input_Voltage_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/IGBT_Temp_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/IGBT_Acc_Temp_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/Drive_Enable_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.80 + ], + [ + 1, + 0.20 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/DC_Current_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/Cap_Temp_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/Power_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/RPM_Max_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Limit/RPM_Min_Limit", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Unused/Reserved", "unit": "", @@ -529,8 +721,7 @@ "size": 5 } ] - } - , + }, { "name": "DTI/Unused/Reserved", "unit": "", @@ -540,15 +731,34 @@ "size": 8 } ] - } - , + }, { "name": "DTI/General/CAN_Map_Version", "unit": "", - "sim_min": 20, - "sim_max": 24, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 20, + 0.01 + ], + [ + 21, + 0.01 + ], + [ + 22, + 0.01 + ], + [ + 23, + 0.01 + ], + [ + 24, + 0.96 + ] + ] + }, "points": [ { "size": 8 @@ -556,8 +766,7 @@ ] } ] - } - , + }, { "id": "0x036", "desc": "AC_Current_Command", @@ -566,10 +775,12 @@ { "name": "MPU/Commands/AC_Current_Target", "unit": "A", - "sim_min": 0, - "sim_max": 380, - "sim_inc_min": 0.01, - "sim_inc_max": 25, + "sim": { + "min": 0, + "max": 380, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16, @@ -579,8 +790,7 @@ ] } ] - } - , + }, { "id": "0x056", "desc": "Brake_Current_Command", @@ -589,10 +799,12 @@ { "name": "MPU/Commands/Brake_Current_Target", "unit": "A", - "sim_min": 0, - "sim_max": 150, - "sim_inc_min": 0.01, - "sim_inc_max": 10, + "sim": { + "min": 0, + "max": 150, + "inc_min": 0.01, + "inc_max": 10 + }, "points": [ { "size": 16, @@ -600,8 +812,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -613,8 +824,7 @@ ] } ] - } - , + }, { "id": "0x076", "desc": "ERPM_Command", @@ -623,18 +833,19 @@ { "name": "DTI/Commands/ERPM_Target", "unit": "A", - "sim_min": -2147483648, - "sim_max": 2147483648, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": -100000, + "max": 100000, + "inc_min": 100, + "inc_max": 400 + }, "points": [ { "size": 32, "signed": true } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -646,8 +857,7 @@ ] } ] - } - , + }, { "id": "0x096", "desc": "Position_Command", @@ -656,10 +866,12 @@ { "name": "DTI/Commands/Position_Target", "unit": "degree", - "sim_min": 0, - "sim_max": 360, - "sim_inc_min": 0.05, - "sim_inc_max": 5, + "sim": { + "min": 0, + "max": 360, + "inc_min": 0.05, + "inc_max": 5 + }, "points": [ { "size": 16, @@ -667,8 +879,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -680,8 +891,7 @@ ] } ] - } - , + }, { "id": "0x0B6", "desc": "Relative_Current_Command", @@ -690,10 +900,12 @@ { "name": "DTI/Commands/Relative_Current_Target", "unit": "A", - "sim_min": -100, - "sim_max": 100, - "sim_inc_min": 0.01, - "sim_inc_max": 5, + "sim": { + "min": -100, + "max": 100, + "inc_min": 0.01, + "inc_max": 5 + }, "points": [ { "size": 16, @@ -701,8 +913,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -714,8 +925,7 @@ ] } ] - } - , + }, { "id": "0x0D6", "desc": "Relative_Brake_Current_Command", @@ -724,10 +934,12 @@ { "name": "DTI/Commands/Relative_Brake_Current_Target", "unit": "A", - "sim_min": -100, - "sim_max": 100, - "sim_inc_min": 0.01, - "sim_inc_max": 5, + "sim": { + "min": -100, + "max": 100, + "inc_min": 0.01, + "inc_max": 5 + }, "points": [ { "size": 16, @@ -735,8 +947,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -748,8 +959,7 @@ ] } ] - } - , + }, { "id": "0x0F6", "desc": "Digital_Output_Command", @@ -758,59 +968,87 @@ { "name": "DTI/Commands/Digital_Output_1_Target", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Commands/Digital_Output_2_Target", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Commands/Digital_Output_3_Target", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Commands/Digital_Output_4_Target", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -822,8 +1060,7 @@ ] } ] - } - , + }, { "id": "0x116", "desc": "Max_AC_Current_Command", @@ -832,10 +1069,12 @@ { "name": "BMS/Commands/Max_AC_Current_Target", "unit": "A", - "sim_min": 0, - "sim_max": 250, - "sim_inc_min": 0.01, - "sim_inc_max": 25, + "sim": { + "min": 0, + "max": 250, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16, @@ -843,8 +1082,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -856,8 +1094,7 @@ ] } ] - } - , + }, { "id": "0x136", "desc": "Max_AC_Brake_Current_Command", @@ -866,10 +1103,12 @@ { "name": "BMS/Commands/Max_AC_Brake_Current_Target", "unit": "A", - "sim_min": -250, - "sim_max": 0, - "sim_inc_min": 0.01, - "sim_inc_max": 25, + "sim": { + "min": -250, + "max": 0, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16, @@ -877,8 +1116,7 @@ "format": "divide10" } ] - } - , + }, { "name": "DTI/Unused/Unused", "unit": "", @@ -890,8 +1128,7 @@ ] } ] - } - , + }, { "id": "0x156", "desc": "Max_DC_Current_Command", @@ -900,10 +1137,12 @@ { "name": "BMS/Commands/Max_DC_Current_Target", "unit": "A", - "sim_min": 0, - "sim_max": 505, - "sim_inc_min": 0.05, - "sim_inc_max": 5, + "sim": { + "min": 0, + "max": 505, + "inc_min": 0.05, + "inc_max": 5 + }, "points": [ { "size": 16, @@ -913,8 +1152,7 @@ ] } ] - } - , + }, { "id": "0x176", "desc": "Max_DC_Brake_Current_Command", @@ -923,10 +1161,12 @@ { "name": "BMS/Commands/Max_DC_Brake_Current_Target", "unit": "A", - "sim_min": -250, - "sim_max": 0, - "sim_inc_min": 0.01, - "sim_inc_max": 10, + "sim": { + "min": -250, + "max": 0, + "inc_min": 0.01, + "inc_max": 10 + }, "points": [ { "size": 16, @@ -936,8 +1176,7 @@ ] } ] - } - , + }, { "id": "0x196", "desc": "Drive_Enable_Command", @@ -946,10 +1185,18 @@ { "name": "MPU/Commands/Drive_Enable_Target", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.80 + ], + [ + 1, + 0.20 + ] + ] + }, "points": [ { "size": 8 @@ -958,4 +1205,4 @@ } ] } -] +] \ No newline at end of file diff --git a/cangen/can-messages/mpu.json b/cangen/can-messages/mpu.json index 8e6a100..41216d4 100644 --- a/cangen/can-messages/mpu.json +++ b/cangen/can-messages/mpu.json @@ -7,58 +7,129 @@ { "name": "MPU/State/Mode", "unit": "", - "sim_min": 0, - "sim_max": 4, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.01 + ], + [ + 1, + 0.80 + ], + [ + 2, + 0.10 + ], + [ + 3, + 0.10 + ], + [ + 4, + 0.00 + ] + ] + }, "points": [ { "size": 8 } ] - } - , + }, { "name": "MPU/State/ModeIndex", "unit": "", - "sim_min": 0, - "sim_max": 6, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.20 + ], + [ + 1, + 0.20 + ], + [ + 2, + 0.40 + ], + [ + 3, + 0.10 + ], + [ + 4, + 0.10 + ], + [ + 5, + 0.10 + ], + [ + 6, + 0.10 + ] + ] + }, "points": [ { "size": 8 } ] - } - , + }, { "name": "MPU/State/Speed", "unit": "mph", - "sim_min": 0, - "sim_max": 88, - "sim_inc_min": 0, - "sim_inc_max": 2, + "sim": { + "min": 0, + "max": 88, + "inc_min": 0, + "inc_max": 2 + }, "points": [ { "size": 8, "signed": true } ] - } - , + }, { "name": "MPU/State/TSMS", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.80 + ], + [ + 1, + 0.20 + ] + ] + }, "points": [ { "size": 8 } ] + }, + { + "name": "MPU/State/TorqueLimit", + "unit": "percentage", + "sim": { + "min": 0, + "max": 1, + "inc_min": 0.1, + "inc_max": 0.1 + }, + "points": [ + { + "size": 8, + "format": "divide100" + } + ] } , { @@ -76,8 +147,7 @@ ] } ] - } - , + }, { "id": "0x500", "desc": "MPU Sense Acceleromter", @@ -86,57 +156,54 @@ { "name": "MPU/Sense/Accel", "unit": "g", - "sim_min": 0, - "sim_max": 2, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 2, + "inc_min": 0.01, + "inc_max": 0.25 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x506", "desc": "MPU Sense Gyro", "sim_freq": 250, - "fields": [ { "name": "MPU/Sense/Gyro", "unit": "", - "sim_min": 0, - "sim_max": 7, - "sim_inc_min": 0.01, - "sim_inc_max": 0.5, + "sim": { + "min": 0, + "max": 7, + "inc_min": 0.01, + "inc_max": 0.5 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x507", "desc": "MPU Sense Temp", @@ -145,10 +212,12 @@ { "name": "MPU/Sense/Temp_IMU", "unit": "C", - "sim_min": 0, - "sim_max": 70, - "sim_inc_min": 1, - "sim_inc_max": 2, + "sim": { + "min": 0, + "max": 70, + "inc_min": 1, + "inc_max": 2 + }, "points": [ { "size": 16, @@ -157,8 +226,7 @@ ] } ] - } - , + }, { "id": "0x502", "desc": "MPU Fault", @@ -167,24 +235,115 @@ { "name": "MPU/Fault/Code", "unit": "", - "sim_min": 0, - "sim_max": 2048, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.84 + ], + [ + 1, + 0.01 + ], + [ + 2, + 0.01 + ], + [ + 4, + 0.01 + ], + [ + 8, + 0.01 + ], + [ + 16, + 0.01 + ], + [ + 32, + 0.01 + ], + [ + 64, + 0.01 + ], + [ + 128, + 0.01 + ], + [ + 256, + 0.01 + ], + [ + 512, + 0.01 + ], + [ + 1024, + 0.01 + ], + [ + 2048, + 0.01 + ], + [ + 3840, + 0.01 + ], + [ + 4096, + 0.01 + ], + [ + 8192, + 0.01 + ], + [ + 16384, + 0.01 + ] + ] + }, "points": [ { "size": 32 } ] - } - , + }, { "name": "MPU/Fault/Severity", "unit": "", - "sim_min": 0, - "sim_max": 5, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.75 + ], + [ + 1, + 0.05 + ], + [ + 2, + 0.05 + ], + [ + 3, + 0.05 + ], + [ + 4, + 0.05 + ], + [ + 5, + 0.05 + ] + ] + }, "points": [ { "size": 8 @@ -192,8 +351,7 @@ ] } ] - } - , + }, { "id": "0x503", "desc": "MPU Sense Voltage", @@ -202,10 +360,12 @@ { "name": "MPU/Sense/Voltage", "unit": "V", - "sim_min": 22.5, - "sim_max": 29, - "sim_inc_min": 0.02, - "sim_inc_max": 0.15, + "sim": { + "min": 22.5, + "max": 29, + "inc_min": 0.02, + "inc_max": 0.15 + }, "points": [ { "size": 32, @@ -215,8 +375,7 @@ ] } ] - } - , + }, { "id": "0x504", "desc": "MPU Accel Pedals", @@ -225,24 +384,27 @@ { "name": "MPU/Pedals/Accelerator_1", "unit": "", - "sim_min": 800, - "sim_max": 1900, - "sim_inc_min": 1, - "sim_inc_max": 24, + "sim": { + "min": 800, + "max": 1900, + "inc_min": 1, + "inc_max": 24 + }, "points": [ { "size": 32 } ] - } - , + }, { "name": "MPU/Pedals/Accelerator_2", "unit": "", - "sim_min": 1200, - "sim_max": 2300, - "sim_inc_min": 1, - "sim_inc_max": 24, + "sim": { + "min": 1200, + "max": 2300, + "inc_min": 1, + "inc_max": 24 + }, "points": [ { "size": 32 @@ -250,8 +412,7 @@ ] } ] - } - , + }, { "id": "0x505", "desc": "MPU Brake Pedals", @@ -260,24 +421,27 @@ { "name": "MPU/Pedals/Brake_1", "unit": "", - "sim_min": 580, - "sim_max": 990, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": 580, + "max": 990, + "inc_min": 1, + "inc_max": 10 + }, "points": [ { "size": 32 } ] - } - , + }, { "name": "MPU/Pedals/Brake_2", "unit": "", - "sim_min": 580, - "sim_max": 990, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": 580, + "max": 990, + "inc_min": 1, + "inc_max": 10 + }, "points": [ { "size": 32 @@ -285,8 +449,7 @@ ] } ] - } - , + }, { "id": "0x701", "desc": "MPU Debug", @@ -295,54 +458,59 @@ { "name": "MPU/Debug/Spare0", "unit": "", - "sim_min": 580, - "sim_max": 990, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": 580, + "max": 990, + "inc_min": 1, + "inc_max": 10 + }, "points": [ { "size": 8 } ] - } - , + }, { "name": "MPU/Debug/Spare1", "unit": "", - "sim_min": 580, - "sim_max": 990, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": 580, + "max": 990, + "inc_min": 1, + "inc_max": 10 + }, "points": [ { "size": 8, "signed": true } ] - } - , + }, { "name": "MPU/Debug/Spare2", "unit": "", - "sim_min": 580, - "sim_max": 990, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": 580, + "max": 990, + "inc_min": 1, + "inc_max": 10 + }, "points": [ { "size": 16, "endianness": "little" } ] - } - , + }, { "name": "MPU/Debug/Spare3", "unit": "", - "sim_min": 580, - "sim_max": 990, - "sim_inc_min": 1, - "sim_inc_max": 10, + "sim": { + "min": 580, + "max": 990, + "inc_min": 1, + "inc_max": 10 + }, "points": [ { "size": 32, @@ -352,8 +520,7 @@ ] } ] - } - , + }, { "id": "0x123", "desc": "MPU Shutdown", @@ -362,129 +529,192 @@ { "name": "MPU/Shutdown/CockpitBRB", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/BMS", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/Inertia", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/Spare_GPIO_1", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/IMD", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/BSPD", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/BOTS", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/HVD_Interlock", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/HVC_Interlock", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Shutdown/Reserved", "unit": "", @@ -496,8 +726,7 @@ ] } ] - } - , + }, { "id": "0x111", "desc": "MPU Fuses", @@ -506,129 +735,192 @@ { "name": "MPU/Fuses/Battbox", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/LVBox", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/FanRadiator", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/MC", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/FanBattbox", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/Pump", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/Dashboard", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/Brakelight", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/BRB", "unit": "", - "sim_min": 0, - "sim_max": 1, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.95 + ], + [ + 1, + 0.05 + ] + ] + }, "points": [ { "size": 1 } ] - } - , + }, { "name": "MPU/Fuses/Reserved", "unit": "", @@ -641,4 +933,4 @@ } ] } -] +] \ No newline at end of file diff --git a/cangen/can-messages/msb.json b/cangen/can-messages/msb.json index 30636e3..545c4db 100644 --- a/cangen/can-messages/msb.json +++ b/cangen/can-messages/msb.json @@ -7,24 +7,27 @@ { "name": "MSB/FL/Temp", "unit": "C", - "sim_min": 0, - "sim_max": 80, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 } ] - } - , + }, { "name": "MSB/FL/Humidity", "unit": "", - "sim_min": 20, - "sim_max": 80, - "sim_inc_min": 1, - "sim_inc_max": 2.5, + "sim": { + "min": 20, + "max": 80, + "inc_min": 1, + "inc_max": 2.5 + }, "points": [ { "size": 16 @@ -32,8 +35,7 @@ ] } ] - } - , + }, { "id": "0x603", "desc": "Front Left MSB Accel", @@ -42,27 +44,26 @@ { "name": "MSB/FL/Accel", "unit": "g", - "sim_min": 0, - "sim_max": 2, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 2, + "inc_min": 0.01, + "inc_max": 0.25 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x604", "desc": "Front Left MSB Gyro", @@ -70,28 +71,27 @@ "fields": [ { "name": "MSB/FL/Gyro", - "sim_min": 0, - "sim_max": 15, - "sim_inc_min": 0.1, - "sim_inc_max": 0.5, + "sim": { + "min": 0, + "max": 15, + "inc_min": 0.1, + "inc_max": 0.5 + }, "unit": "", "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x605", "desc": "Front Left MSB Strain", @@ -100,23 +100,23 @@ { "name": "MSB/FL/Strain", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 - } - , + }, { "size": 32 } ] } ] - } - , + }, { "id": "0x606", "desc": "Front Left Shockpot", @@ -125,10 +125,12 @@ { "name": "MSB/FL/Shock", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 @@ -136,8 +138,7 @@ ] } ] - } - , + }, { "id": "0x607", "desc": "Front Left Ride Height", @@ -146,10 +147,12 @@ { "name": "MSB/FL/RideHeight", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 16, @@ -158,8 +161,7 @@ ] } ] - } - , + }, { "id": "0x608", "desc": "Front Left Wheel Temp", @@ -168,10 +170,12 @@ { "name": "MSB/FL/WheelTemp", "unit": "C", - "sim_min": 0, - "sim_max": 110, - "sim_inc_min": 0.5, - "sim_inc_max": 1.5, + "sim": { + "min": 0, + "max": 110, + "inc_min": 0.5, + "inc_max": 1.5 + }, "points": [ { "size": 16 @@ -179,8 +183,7 @@ ] } ] - } - , + }, { "id": "0x622", "desc": "Front Right MSB Env", @@ -189,24 +192,27 @@ { "name": "MSB/FR/Temp", "unit": "C", - "sim_min": 0, - "sim_max": 80, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 } ] - } - , + }, { "name": "MSB/FR/Humidity", "unit": "", - "sim_min": 20, - "sim_max": 80, - "sim_inc_min": 1, - "sim_inc_max": 2.5, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 @@ -214,8 +220,7 @@ ] } ] - } - , + }, { "id": "0x623", "desc": "Front Right MSB Accel", @@ -224,27 +229,26 @@ { "name": "MSB/FR/Accel", "unit": "g", - "sim_min": 0, - "sim_max": 2, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 2, + "inc_min": 0.01, + "inc_max": 0.25 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x624", "desc": "Front Right MSB Gyro", @@ -253,27 +257,26 @@ { "name": "MSB/FR/Gyro", "unit": "", - "sim_min": 0, - "sim_max": 15, - "sim_inc_min": 0.1, - "sim_inc_max": 0.5, + "sim": { + "min": 0, + "max": 15, + "inc_min": 0.1, + "inc_max": 0.5 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x625", "desc": "Front Right MSB Strain", @@ -282,23 +285,23 @@ { "name": "MSB/FR/Strain", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 - } - , + }, { "size": 32 } ] } ] - } - , + }, { "id": "0x626", "desc": "Front Right Shockpot", @@ -307,10 +310,12 @@ { "name": "MSB/FR/Shock", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 @@ -318,8 +323,7 @@ ] } ] - } - , + }, { "id": "0x627", "desc": "Front Right Ride Height", @@ -328,10 +332,12 @@ { "name": "MSB/FR/RideHeight", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 16, @@ -340,8 +346,7 @@ ] } ] - } - , + }, { "id": "0x628", "desc": "Front Right Wheel Temp", @@ -350,10 +355,12 @@ { "name": "MSB/FR/WheelTemp", "unit": "C", - "sim_min": 0, - "sim_max": 110, - "sim_inc_min": 0.5, - "sim_inc_max": 1.5, + "sim": { + "min": 0, + "max": 110, + "inc_min": 0.5, + "inc_max": 1.5 + }, "points": [ { "size": 16 @@ -361,8 +368,7 @@ ] } ] - } - , + }, { "id": "0x642", "desc": "Back Left MSB Env", @@ -371,24 +377,27 @@ { "name": "MSB/BL/Temp", "unit": "C", - "sim_min": 0, - "sim_max": 80, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 } ] - } - , + }, { "name": "MSB/BL/Humidity", "unit": "", - "sim_min": 20, - "sim_max": 80, - "sim_inc_min": 1, - "sim_inc_max": 2.5, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 @@ -396,8 +405,7 @@ ] } ] - } - , + }, { "id": "0x643", "desc": "Back Left MSB Accel", @@ -406,27 +414,26 @@ { "name": "MSB/BL/Accel", "unit": "g", - "sim_min": 0, - "sim_max": 2, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 2, + "inc_min": 0.01, + "inc_max": 0.25 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x644", "desc": "Back Left MSB Gyro", @@ -435,27 +442,26 @@ { "name": "MSB/BL/Gyro", "unit": "", - "sim_min": 0, - "sim_max": 15, - "sim_inc_min": 0.1, - "sim_inc_max": 0.5, + "sim": { + "min": 0, + "max": 15, + "inc_min": 0.1, + "inc_max": 0.5 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x645", "desc": "Back Left MSB Strain", @@ -464,23 +470,23 @@ { "name": "MSB/BL/Strain", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 - } - , + }, { "size": 32 } ] } ] - } - , + }, { "id": "0x646", "desc": "Back Left Shockpot", @@ -489,10 +495,12 @@ { "name": "MSB/BL/Shock", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 @@ -500,8 +508,7 @@ ] } ] - } - , + }, { "id": "0x647", "desc": "Front Back Ride Height", @@ -510,10 +517,12 @@ { "name": "MSB/BL/RideHeight", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 16, @@ -522,8 +531,7 @@ ] } ] - } - , + }, { "id": "0x648", "desc": "Back Left Wheel Temp", @@ -532,10 +540,12 @@ { "name": "MSB/BL/WheelTemp", "unit": "C", - "sim_min": 0, - "sim_max": 110, - "sim_inc_min": 0.5, - "sim_inc_max": 1.5, + "sim": { + "min": 0, + "max": 110, + "inc_min": 0.5, + "inc_max": 1.5 + }, "points": [ { "size": 16 @@ -543,8 +553,7 @@ ] } ] - } - , + }, { "id": "0x662", "desc": "Back Right MSB Env", @@ -553,24 +562,27 @@ { "name": "MSB/BR/Temp", "unit": "C", - "sim_min": 0, - "sim_max": 80, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 } ] - } - , + }, { "name": "MSB/BR/Humidity", "unit": "", - "sim_min": 20, - "sim_max": 80, - "sim_inc_min": 1, - "sim_inc_max": 2.5, + "sim": { + "min": 0, + "max": 80, + "inc_min": 0.01, + "inc_max": 25 + }, "points": [ { "size": 16 @@ -578,8 +590,7 @@ ] } ] - } - , + }, { "id": "0x663", "desc": "Back Right MSB Accel", @@ -588,27 +599,26 @@ { "name": "MSB/BR/Accel", "unit": "g", - "sim_min": 0, - "sim_max": 2, - "sim_inc_min": 0.01, - "sim_inc_max": 0.25, + "sim": { + "min": 0, + "max": 2, + "inc_min": 0.01, + "inc_max": 0.25 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x664", "desc": "Back Right MSB Gyro", @@ -617,27 +627,26 @@ { "name": "MSB/BR/Gyro", "unit": "", - "sim_min": 0, - "sim_max": 15, - "sim_inc_min": 0.1, - "sim_inc_max": 0.5, + "sim": { + "min": 0, + "max": 15, + "inc_min": 0.1, + "inc_max": 0.5 + }, "points": [ { "size": 16 - } - , + }, { "size": 16 - } - , + }, { "size": 16 } ] } ] - } - , + }, { "id": "0x665", "desc": "Back Right MSB Strain", @@ -646,23 +655,23 @@ { "name": "MSB/BR/Strain", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 - } - , + }, { "size": 32 } ] } ] - } - , + }, { "id": "0x666", "desc": "Back Right Shockpot", @@ -671,10 +680,12 @@ { "name": "MSB/BR/Shock", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 32 @@ -682,8 +693,7 @@ ] } ] - } - , + }, { "id": "0x667", "desc": "Back Right Ride Height", @@ -692,10 +702,12 @@ { "name": "MSB/BR/RideHeight", "unit": "", - "sim_min": 0, - "sim_max": 10, - "sim_inc_min": 0.001, - "sim_inc_max": 0.020, + "sim": { + "min": 0, + "max": 10, + "inc_min": 0.001, + "inc_max": 0.020 + }, "points": [ { "size": 16, @@ -704,8 +716,7 @@ ] } ] - } - , + }, { "id": "0x668", "desc": "Back Right Wheel Temp", @@ -714,10 +725,12 @@ { "name": "MSB/BR/WheelTemp", "unit": "C", - "sim_min": 0, - "sim_max": 110, - "sim_inc_min": 0.5, - "sim_inc_max": 1.5, + "sim": { + "min": 0, + "max": 110, + "inc_min": 0.5, + "inc_max": 1.5 + }, "points": [ { "size": 16 @@ -726,4 +739,4 @@ } ] } -] +] \ No newline at end of file diff --git a/cangen/can-messages/wheel.json b/cangen/can-messages/wheel.json index dc79dab..57891e1 100644 --- a/cangen/can-messages/wheel.json +++ b/cangen/can-messages/wheel.json @@ -7,24 +7,34 @@ { "name": "WHEEL/Buttons/1", "unit": "", - "sim_min": 0, - "sim_max": 8, - "sim_inc_min": 1, - "sim_inc_max": 8, - "points": [ - { - "size": 8 - } - ] - } - , - { - "name": "WHEEL/Buttons/2", - "unit": "", - "sim_min": 0, - "sim_max": 2, - "sim_inc_min": 1, - "sim_inc_max": 1, + "sim": { + "options": [ + [ + 0, + 0.25 + ], + [ + 1, + 0.15 + ], + [ + 2, + 0.15 + ], + [ + 3, + 0.15 + ], + [ + 4, + 0.15 + ], + [ + 5, + 0.15 + ] + ] + }, "points": [ { "size": 8 @@ -33,4 +43,4 @@ } ] } -] +] \ No newline at end of file