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

motorola byte order in dbc file makes layout dispaly incorrectly #143

Open
Jimmy-drod opened this issue Jan 4, 2024 · 2 comments
Open

Comments

@Jimmy-drod
Copy link

when use this command :dbcppp dbc2 --dbc=file.dbc --format=human, and the signals is motorola byte order in file.dbc, the layout does not display correctly, It no longer plots the signal position.

@Jimmy-drod
Copy link
Author

Jimmy-drod commented Jan 4, 2024

another problem is :
it seems in function bool bit_is_inbetween(const ISignal& sig, std::size_t i_bit, uint64_t switch_value = -1)
(called by auto iter = std::find_if(beg, end, [&](const ISignal& sig) { return bit_is_inbetween(sig, i_bit, mux_value); });)

case ISignal::EByteOrder::BigEndian:
    {
        std::size_t start = sig.StartBit();
        std::size_t n = sig.BitSize();
        while (n)
        {
            if (start == i_bit)
            {
                return true;
            }
            if (start % 8 == 0)
            {
                start += 15;
            }
            else
            {
                start--;
            }
            n--;
        }
        return true;
    }

No matter what the value of i_bit is, it will always return true on this branch, resulting in only the first signal being parsed.

@Jimmy-drod
Copy link
Author

I made a PR,please confirm.

BR

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