Skip to content

Commit

Permalink
fix: default signal scale
Browse files Browse the repository at this point in the history
  • Loading branch information
FerroO2000 committed Mar 3, 2024
1 parent 650e055 commit c52a8e0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jsondbc convert --in my_model.dbc --out my_dbc_model.json
| ---------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| id | number | The message's id in decimal | true |
| period_ms (deprecated) | number | The message's period in ms. If set, it creates an int attribute named "MsgPeriodMS" with the corrisponding period | false |
| cycle_time | number | The message's cycle time. If set, an int attribute named "GenMsgCycleTime" is created in the dbc file | false |
| cycle_time | number | The message's cycle time in ms. If set, an int attribute named "GenMsgCycleTime" is created in the dbc file | false |
| send_type | NoMsgSendType \| Cyclic \| IfActive \| cyclicIfActive \| NotUsed | The message's send type. If set, an enum attribute named "GenMsgSendType" is created in the dbc file | false |
| description | string | The message's description | false |
| length | number | The message's length (bytes count) | true |
Expand All @@ -107,7 +107,7 @@ jsondbc convert --in my_model.dbc --out my_dbc_model.json
| offset | number | The signal's offset | false | 0 |
| min | number | The signal's minimum value | false | 0 |
| max | number | The signal's maximum value | true |
| enum | map[string]number | A map with key the _uman readable_ name corrisponding to a signal's vlue | false |
| enum | map[string]number | A map with key the _human readable_ name corrisponding to a signal value | false |
| mux_group | map[string]Signal | A map with key the name of a multiplexed signal and a Signal as value. If set, the signal becomes a multiplexor | false |
| mux_switch | number | The value a multiplexor signal as to be in order to map to the multiplexed signal | Only if part of mux_group |
| attributes | map[string]any | A map with key the attribute name and a value to assign as map's value. The value must be an int if the attribute is of type int, string for type string, an enum value (string) for type enum | false |
2 changes: 1 addition & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)

const version = "v0.4.1"
const version = "v0.4.2"

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Expand Down
4 changes: 4 additions & 0 deletions pkg/signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ func (s *Signal) initSignal(sigName string, source sourceType) {

s.handleCustomAttributes()

if s.Scale == 0 {
s.Scale = 1
}

if len(s.Endianness) > 0 {
switch s.Endianness {
case "big":
Expand Down

0 comments on commit c52a8e0

Please sign in to comment.