From 422cf1ad17ae08e9d064a81cd5c91c4d158acaa0 Mon Sep 17 00:00:00 2001 From: FerroO2000 <30318301+FerroO2000@users.noreply.github.com> Date: Fri, 17 May 2024 19:02:19 +0200 Subject: [PATCH] updated mcb --- examples/markdown/MCB.dbc | 12 +-- examples/markdown/SC24.md | 170 ++++++++++++++++++++++++++++---------- md_exporter.go | 6 +- 3 files changed, 136 insertions(+), 52 deletions(-) diff --git a/examples/markdown/MCB.dbc b/examples/markdown/MCB.dbc index 86670d8..656d027 100644 --- a/examples/markdown/MCB.dbc +++ b/examples/markdown/MCB.dbc @@ -350,12 +350,12 @@ CM_ SG_ 1024 COLDPLATE_R_NTC_resistance "The resistance of the right coldplate N CM_ SG_ 1024 SPARE_NTC_0_resistance "The resistance of the spare NTC #0 expressed in Ohm."; CM_ SG_ 1024 SPARE_NTC_1_resistance "The resistance of the spare NTC #1 expressed in Ohm."; -CM_ SG_ 1024 JACKET_RL_NTC_resistance "The resistance of the rear left jacket NTC expressed in Ohm."; -CM_ SG_ 1024 JACKET_RR_NTC_resistance "The resistance of the rear right jacket NTC expressed in Ohm."; -CM_ SG_ 1024 RAD_RL_IN_NTC_resistance "The resistance of the rear left IN radiator NTC expressed in Ohm."; -CM_ SG_ 1024 RAD_RL_OUT_NTC_resistance "The resistance of the rear left OUT radiator NTC expressed in Ohm."; -CM_ SG_ 1024 RAD_RR_IN_NTC_resistance "The resistance of the rear right IN radiator NTC expressed in Ohm."; -CM_ SG_ 1024 RAD_RR_OUT_NTC_resistance "The resistance of the rear right OUT radiator NTC expressed in Ohm."; +CM_ SG_ 1025 JACKET_RL_NTC_resistance "The resistance of the rear left jacket NTC expressed in Ohm."; +CM_ SG_ 1025 JACKET_RR_NTC_resistance "The resistance of the rear right jacket NTC expressed in Ohm."; +CM_ SG_ 1025 RAD_RL_IN_NTC_resistance "The resistance of the rear left IN radiator NTC expressed in Ohm."; +CM_ SG_ 1025 RAD_RL_OUT_NTC_resistance "The resistance of the rear left OUT radiator NTC expressed in Ohm."; +CM_ SG_ 1025 RAD_RR_IN_NTC_resistance "The resistance of the rear right IN radiator NTC expressed in Ohm."; +CM_ SG_ 1025 RAD_RR_OUT_NTC_resistance "The resistance of the rear right OUT radiator NTC expressed in Ohm."; CM_ SG_ 48 SDC_POST_BSPD_isClosed "States whether the SDC post BSPD is closed."; CM_ SG_ 48 SDC_PRE_PUSH_BTNS_isClosed "States whether the SDC per push buttons (hoop right/left) is closed."; diff --git a/examples/markdown/SC24.md b/examples/markdown/SC24.md index f0895c9..1bea2f1 100644 --- a/examples/markdown/SC24.md +++ b/examples/markdown/SC24.md @@ -5,16 +5,19 @@ ## Main CAN Bus Baudrate: - -### BMS_LV +### BMS_LV/int0 The battery-management-system low-voltage. Node ID: **0** #### BMS_LV_hello CAN-ID: **20** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-----------------|-----------|------|-----|-----|--------|-------|------|-------------------------------------------| @@ -24,9 +27,12 @@ Receivers: [DSPACE](#DSPACE) #### BMS_LV_lvCellVoltage0 CAN-ID: **256** + Size: **8** bytes + Cycle Time: **100** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-------------------|-----------|------|-----|---------|--------|-------|------|------------------------------------------------| @@ -37,9 +43,12 @@ Receivers: [DSPACE](#DSPACE) #### BMS_LV_lvCellVoltage1 CAN-ID: **257** + Size: **6** bytes + Cycle Time: **100** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-------------------|-----------|------|-----|---------|--------|-------|------|------------------------------------------------| @@ -49,9 +58,12 @@ Receivers: [DSPACE](#DSPACE) #### BMS_LV_lvBatGeneral CAN-ID: **258** + Size: **6** bytes + Cycle Time: **100** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------------------|-----------|------|-----|-----------|--------|-------|------|---------------------------------------------------------------------------------------------------| @@ -61,9 +73,12 @@ Receivers: [DSPACE](#DSPACE) #### BMS_LV_status CAN-ID: **259** + Size: **4** bytes + Cycle Time: **100** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |----------------------|-----------|------|-----|-----|--------|-------|------|--------------------------------------------------------------------------------| @@ -97,9 +112,12 @@ Receivers: [DSPACE](#DSPACE) #### BMS_LV_lvCellNTCResistance0 CAN-ID: **260** + Size: **8** bytes + Cycle Time: **2000** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------------------|-----------|------|-----|----------|--------|-------|------|--------------------------------------------------------------------| @@ -112,9 +130,12 @@ Receivers: [DSPACE](#DSPACE) #### BMS_LV_lvCellNTCResistance1 CAN-ID: **261** + Size: **8** bytes + Cycle Time: **2000** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------------------|-----------|------|-----|----------|--------|-------|------|---------------------------------------------------------------------| @@ -126,16 +147,19 @@ Receivers: [DSPACE](#DSPACE) | LV_CELL_NTC_11_resistance | 50 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the NTC #11 in the battery pack expressed in Ohm. | --- -### DASH +### DASH/int0 The dashboard ECU. Node ID: **1** #### DASH_hello CAN-ID: **23** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-----------------|-----------|------|-----|-----|--------|-------|------|----------------------------------------------| @@ -145,9 +169,12 @@ Receivers: [DSPACE](#DSPACE) #### DASH_rtd CAN-ID: **38** + Size: **1** bytes + Cycle Time: **500** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------|-----------|------|-----|-----|--------|-------|------|------------------| @@ -155,9 +182,12 @@ Receivers: [DSPACE](#DSPACE) #### DASH_motorStatus CAN-ID: **1280** + Size: **1** bytes + Cycle Time: - -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------|-----------|------|-----|-----|--------|-------|------|---------------------------------------------| @@ -167,16 +197,19 @@ Receivers: [DSPACE](#DSPACE) | MOTOR_RR_isON | 3 | 1 | 0 | 1 | 0 | 1 | - | States whether the rear right motor is ON. | --- -### DSPACE +### DSPACE/int0 An automotive ECU. Node ID: **2** #### DSPACE_hello CAN-ID: **25** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-----------------|-----------|------|-----|-----|--------|-------|------|-------------------------------------------| @@ -186,9 +219,12 @@ Receivers: [DSPACE](#DSPACE) #### dSpace_RTD_ACK CAN-ID: **37** + Size: **1** bytes + Cycle Time: - -Receivers: [DASH](#DASH) + +Receivers: [DASH/int0](#DASH/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------|-----------|------|-----|-----|--------|-------|------|-------------| @@ -196,9 +232,12 @@ Receivers: [DASH](#DASH) #### BMSLV_RelayOverride CAN-ID: **255** + Size: **2** bytes + Cycle Time: - -Receivers: [BMS_LV](#BMS_LV) + +Receivers: [BMS_LV/int0](#BMS_LV/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-------------|-----------|------|-----|-------|--------|-------|------|-------------| @@ -207,9 +246,12 @@ Receivers: [BMS_LV](#BMS_LV) #### dSpace_PeripheralsCTRL CAN-ID: **512** + Size: **3** bytes + Cycle Time: - -Receivers: [DASH](#DASH) + +Receivers: [DASH/int0](#DASH/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-------------------|-----------|------|-----|-----|--------|-------|------|-------------| @@ -218,16 +260,19 @@ Receivers: [DASH](#DASH) | BattHVFan_CTRL | 16 | 8 | 0 | 255 | 0 | 1 | - | - | --- -### SB_FRONT +### SB_FRONT/int0 The sensorboard front ECU. Node ID: **3** #### SB_FRONT_analog CAN-ID: **5** + Size: **8** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------------------|-----------|------|-----|-------|--------|-------|------|-----------------------------------------------------------------| @@ -238,9 +283,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_FRONT_potentiometer CAN-ID: **16** + Size: **4** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-------------------------|-----------|------|-----|-------|--------|-------|------|---------------------------------------------------------------------------------------| @@ -249,9 +297,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_FRONT_hello CAN-ID: **21** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-----------------|-----------|------|-----|-----|--------|-------|------|------------------------------------------------------| @@ -261,9 +312,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_FRONT_sdcStatus CAN-ID: **49** + Size: **1** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------------------|-----------|------|-----|-----|--------|-------|------|------------------------------------------------------------| @@ -274,9 +328,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_FRONT_ntcResistance CAN-ID: **1024** + Size: **8** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |----------------------------|-----------|------|-----|----------|--------|-------|------|----------------------------------------------------------------| @@ -288,16 +345,19 @@ Receivers: [DSPACE](#DSPACE) | SPARE_NTC_1_resistance | 50 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the spare NTC #1 expressed in Ohm. | --- -### SB_REAR +### SB_REAR/int0 The sensorboard rear ECU. Node ID: **4** #### SB_REAR_potentiometer CAN-ID: **17** + Size: **4** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-------------------------|-----------|------|-----|-------|--------|-------|------|--------------------------------------------------------------------------------------| @@ -306,9 +366,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_REAR_hello CAN-ID: **22** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-----------------|-----------|------|-----|-----|--------|-------|------|-----------------------------------------------------| @@ -318,9 +381,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_REAR_sdcStatus CAN-ID: **48** + Size: **1** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |----------------------------|-----------|------|-----|-----|--------|-------|------|----------------------------------------------------------------------| @@ -332,9 +398,12 @@ Receivers: [DSPACE](#DSPACE) #### SB_REAR_dischargeStatus CAN-ID: **50** + Size: **1** bytes + Cycle Time: - -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |------------------|-----------|------|-----|-----|--------|-------|------|---------------------------------------| @@ -342,24 +411,30 @@ Receivers: [DSPACE](#DSPACE) #### SB_REAR_ntcResistance CAN-ID: **1025** + Size: **8** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) - -| Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | -|---------------------------|-----------|------|-----|----------|--------|-------|------|-------------| -| JACKET_RL_NTC_resistance | 0 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | - | -| JACKET_RR_NTC_resistance | 10 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | - | -| RAD_RL_IN_NTC_resistance | 20 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | - | -| RAD_RL_OUT_NTC_resistance | 30 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | - | -| RAD_RR_IN_NTC_resistance | 40 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | - | -| RAD_RR_OUT_NTC_resistance | 50 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | - | + +Receivers: [DSPACE/int0](#DSPACE/int0) + +| Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | +|---------------------------|-----------|------|-----|----------|--------|-------|------|---------------------------------------------------------------------| +| JACKET_RL_NTC_resistance | 0 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the rear left jacket NTC expressed in Ohm. | +| JACKET_RR_NTC_resistance | 10 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the rear right jacket NTC expressed in Ohm. | +| RAD_RL_IN_NTC_resistance | 20 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the rear left IN radiator NTC expressed in Ohm. | +| RAD_RL_OUT_NTC_resistance | 30 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the rear left OUT radiator NTC expressed in Ohm. | +| RAD_RR_IN_NTC_resistance | 40 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the rear right IN radiator NTC expressed in Ohm. | +| RAD_RR_OUT_NTC_resistance | 50 | 10 | 0 | 31968.75 | 1000 | 31.25 | Ohm | The resistance of the rear right OUT radiator NTC expressed in Ohm. | #### SB_REAR_analog CAN-ID: **1026** + Size: **6** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |--------------------------|-----------|------|-----|-------|--------|-------|------|-------------------------------------------------------------------| @@ -368,16 +443,19 @@ Receivers: [DSPACE](#DSPACE) | BRAKE_PRESS_REAR_voltage | 32 | 16 | 0 | 65535 | 0 | 1 | mV | The voltage of the rear brake pressure sensor expressed in mV. | --- -### TLB_BAT +### TLB_BAT/int0 The tsal-latch-board battery ECU. Node ID: **5** #### TLB_Battery_ShutStatus CAN-ID: **18** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |----------------------------------|-----------|------|-----|-----|--------|-------|------|-------------| @@ -393,9 +471,12 @@ Receivers: [DSPACE](#DSPACE) #### TLB_Battery_TSALStatus CAN-ID: **19** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |---------------------------------|-----------|------|-----|-----|--------|-------|------|-------------| @@ -419,9 +500,12 @@ Receivers: [DSPACE](#DSPACE) #### TLB_BAT_hello CAN-ID: **24** + Size: **3** bytes + Cycle Time: **10** ms -Receivers: [DSPACE](#DSPACE) + +Receivers: [DSPACE/int0](#DSPACE/int0) | Name | Start Bit | Size | Min | Max | Offset | Scale | Unit | Description | |-----------------|-----------|------|-----|-----|--------|-------|------|------------------------------------------------| diff --git a/md_exporter.go b/md_exporter.go index a8a3502..ad5d075 100644 --- a/md_exporter.go +++ b/md_exporter.go @@ -89,14 +89,14 @@ func (e *mdExporter) exportMessage(msg *Message) { e.w.PlainText(msg.desc).LF() } - e.w.PlainTextf("CAN-ID: %s", md.Bold(fmt.Sprintf("%d", msg.id))) - e.w.PlainTextf("Size: %s bytes", md.Bold(fmt.Sprintf("%d", msg.sizeByte))) + e.w.PlainTextf("CAN-ID: %s", md.Bold(fmt.Sprintf("%d", msg.id))).LF() + e.w.PlainTextf("Size: %s bytes", md.Bold(fmt.Sprintf("%d", msg.sizeByte))).LF() cycleTimeStr := "-" if msg.cycleTime > 0 { cycleTimeStr = fmt.Sprintf("%s ms", md.Bold(strconv.Itoa(msg.cycleTime))) } - e.w.PlainTextf("Cycle Time: %s", cycleTimeStr) + e.w.PlainTextf("Cycle Time: %s", cycleTimeStr).LF() recStr := "Receivers: " for idx, rec := range msg.Receivers() {