Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplexed signals duplicated in overwrite view #451

Open
driftregion opened this issue Jan 25, 2022 · 0 comments
Open

Multiplexed signals duplicated in overwrite view #451

driftregion opened this issue Jan 25, 2022 · 0 comments

Comments

@driftregion
Copy link

Hi @collin80 . Thanks for SavvyCAN.

I observe on 37e8ad5 (Jan 19 2022) that the multiplexed signals present on the incoming frame are prepended to the cached information, resulting in the display of some duplicated signals.

before

The changing position of the signals makes them difficult to read.

So I made a change such that the signals look like this:

after

Searching issues, I found that you put in work in early 2021 to implement multiplexors of arbitrary depth.
#301
I've not tested whether my change is compatible with multiplexors of arbitrary depth.

Pull Request:
#450

I tested this on Ubuntu as follows:

pip3 install python-can cantools
sudo ip link add vcan0 type vcan
sudo ip link set vcan0 up
python3 simNode.py

dbc.dbc

VERSION ""


NS_ : 
	NS_DESC_
	CM_
	BA_DEF_
	BA_
	VAL_
	CAT_DEF_
	CAT_
	FILTER
	BA_DEF_DEF_
	EV_DATA_
	ENVVAR_DATA_
	SGTYPE_
	SGTYPE_VAL_
	BA_DEF_SGTYPE_
	BA_SGTYPE_
	SIG_TYPE_REF_
	VAL_TABLE_
	SIG_GROUP_
	SIG_VALTYPE_
	SIGTYPE_VALTYPE_
	BO_TX_BU_
	BA_DEF_REL_
	BA_REL_
	BA_DEF_DEF_REL_
	BU_SG_REL_
	BU_EV_REL_
	BU_BO_REL_
	SG_MUL_VAL_

BS_:

BU_: NODE1 NODE2

BO_ 700 NODE1_Msg: 8 NODE1
 SG_ NODE1_Msg_m M : 0|8@1+ (1,0) [0|0] "" Vector__XXX
 SG_ NODE1_Msg_m0Sig0 m0 : 32|16@1+ (1,0) [0|0] ""  NODE2
 SG_ NODE1_Msg_m0Sig1 m0 : 48|16@1+ (1,0) [0|0] ""  NODE2
 SG_ NODE1_Msg_m0Sig2 m0 : 16|16@1+ (1,0) [0|0] "" Vector__XXX
 SG_ NODE1_Msg_m1Sig0 m1 : 16|32@1+ (1,0) [0|0] "" Vector__XXX
 SG_ NODE1_Msg_m1Sig1 m1 : 8|8@1+ (1,0) [0|0] "" Vector__XXX

simNode.py

#!/usr/bin/env python3

import can
from cantools import db
import time

bus = can.interfaces.socketcan.SocketcanBus("vcan0")
dbc = db.load_file("dbc.dbc")

def sendMsg(msgname, data):
    db_msg = dbc.get_message_by_name(msgname)
    bus.send(
        can.Message(
            arbitration_id=db_msg.frame_id, 
            is_extended_id=False, 
            data=db_msg.encode(data)
        )
    )
    


if __name__ == "__main__":
    i = 0
    while True:
        sendMsg("NODE1_Msg", {
            "NODE1_Msg_m": 0,
            "NODE1_Msg_m0Sig0": i + 2 & 0xff,
            "NODE1_Msg_m0Sig1": i + 4 & 0xff,
            "NODE1_Msg_m0Sig2": i + 6 & 0xff,
            }
        )
        time.sleep(0.5)
        sendMsg("NODE1_Msg", {
            "NODE1_Msg_m": 1,
            "NODE1_Msg_m1Sig0": i + 1 & 0xff,
            "NODE1_Msg_m1Sig1": i + 3 & 0xff,
            }
        )
        time.sleep(0.5)
        i+=1
        
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant