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

improve readability of the output of the list subcommand #4

Open
andlaus opened this issue Nov 12, 2021 · 2 comments
Open

improve readability of the output of the list subcommand #4

andlaus opened this issue Nov 12, 2021 · 2 comments
Labels
enhancement New feature or request good first contribution Good for newcomers nice to have Things which improve the quality of life but are not a matter of life and death.

Comments

@andlaus
Copy link
Collaborator

andlaus commented Nov 12, 2021

currently, the list subcommand produces output like this:

$ odxtools list --conformant -a examples/somersault.pdx
BASE-VARIANT 'somersault' (Receive ID: 0x7b, Send ID: 0x1c8)
 num services: 7, num DOPs: 7, num communication parameters: 11.
The services of the BASE-VARIANT 'somersault' are:
 do_backward_flips <ID: somersault.service.do_backward_flips>
  Message format of a request:
           7     6     5     4     3     2     1     0
        +-----+-----+-----+-----+-----+-----+-----+-----+
      0 | sid (8 bits)                                  |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      1 | backward_soberness_check (8 bits)             |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      2 | num_flips (8 bits)                            |
        +-----+-----+-----+-----+-----+-----+-----+-----+
   Parameter(short_name='sid', type='CODED-CONST', semantic=None, byte_position=0, bit_length=8, coded_value='0xbb')
   Parameter(short_name='backward_soberness_check', type='VALUE', semantic=None, byte_position=1, bit_length=8, dop_ref='somersault.DOP.soberness_check')
    DataObjectProperty('soberness_check', category='IDENTICAL', internal_type='A_UINT32', physical_type='A_UINT32')
   Parameter(short_name='num_flips', type='VALUE', semantic=None, byte_position=2, bit_length=8, dop_ref='somersault.DOP.num_flips')
    DataObjectProperty('num_flips', category='IDENTICAL', internal_type='A_UINT32', physical_type='A_UINT32')
  Number of positive responses: 1
  Message format of a positive response:
           7     6     5     4     3     2     1     0
        +-----+-----+-----+-----+-----+-----+-----+-----+
      0 | sid (8 bits)                                  |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      1 | num_flips_done (8 bits)                       |
        +-----+-----+-----+-----+-----+-----+-----+-----+
   Parameter(short_name='sid', type='CODED-CONST', semantic=None, byte_position=0, bit_length=8, coded_value='0xfb')

I think it would be more user friendly if this was something like

Variants:
 somersault:
  Type: 'BASE-VARIANT'
  Receive ID: 0x7b
  Send ID: 0x1c8
  Services:
   do_backward_flips
    Request parameters:
     sid:
      Type: 'CODED-CONST'
      Semantic: None
      Byte position: 0
      Bit length: 8
      Coded value: '0xbb'
   backward_soberness_check:
    Type: 'VALUE'
    Semantic: None
    Byte position=1
    Bit length: 8
    DOP: 'somersault.DOP.soberness_check'
  Message layout:
           7     6     5     4     3     2     1     0
        +-----+-----+-----+-----+-----+-----+-----+-----+
      0 | sid (8 bits)                                  |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      1 | backward_soberness_check (8 bits)             |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      2 | num_flips (8 bits)                            |
        +-----+-----+-----+-----+-----+-----+-----+-----+
  Positive responses:
   [...]
[...]
  DOPs:
    num_flips:
     Category: 'IDENTICAL'
     Internal type: 'A_UINT32'
     Physical type: 'A_UINT32'
[...]

Andreas Lauser <andreas.lauser@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information

@andlaus andlaus added enhancement New feature or request good first contribution Good for newcomers nice to have Things which improve the quality of life but are not a matter of life and death. labels Nov 12, 2021
@kakoeh
Copy link
Contributor

kakoeh commented Jan 5, 2024

Output format was changed with #250
The displayed output is now:

$ odxtools list -a examples/somersault.pdx

Overview of diagnostic layers:
    | Name                | Variant Type | Num. of Services | Num. of DOPs | Num. of comparams
----+---------------------+--------------+------------------+--------------+-------------------
  0 | somersault          | BASE-VARIANT |                7 |           10 |                10
  1 | somersault_lazy     | ECU-VARIANT  |                5 |           10 |                10
  2 | somersault_assiduous| ECU-VARIANT  |                8 |           10 |                10

Diagnostic layer: 'somersault'
 Variant Type: BASE-VARIANT
 Description: Base variant of the somersault ECU & cetera

The global negative responses of 'somersault' are:
 gnr_name_1
 [...]

The services of 'somersault' are:
 do_backward_flips <ID: OdxLinkId('somersault.service.do_backward_flips')>
  Service description: [...]
  Enabled-Audiences: [...]

  Request Properties:
   Request Name: do_backward_flips
   Byte-Array: [...]     
   Hex-String: [...]
   Service Parameters: [sid, backward_soberness_check, num_flips]

    | Name                    | Byte Pos. | Bit Length | Param. Type | Data Type | Value | Value Desc. | Linked DOP
----+-------------------------+-----------+------------+-------------+-----------+-------+-------------+-----------------
  0 | sid                     |         0 |          8 | CODED-CONST | A_UINT32  | 0xBB  | coded value |
  1 | backward_soberness_check|         1 |          8 | VALUE       | A_UINT32  |       |             | soberness_check
  2 | num_flips               |         2 |          8 | VALUE       | A_UINT32  |       |             | num_flips

  Message format of a request:
           7     6     5     4     3     2     1     0
        +-----+-----+-----+-----+-----+-----+-----+-----+
      0 | sid(8 bits)                                   |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      1 | backward_soberness_check (8 bits)               |
        +-----+-----+-----+-----+-----+-----+-----+-----+
      2 | num_flips(8 bits)                             |
        +-----+-----+-----+-----+-----+-----+-----+-----+
   
  Positive Response Properties:
   [...]
   
The DOPs of the ECU-VARIANT 'somersault' are:
 dop_name_1
 [...]

The communication parameters of the ECU-VARIANT 'somersault' are:
 cp_name_1    cp_value
 [...]

The default output does not display all information of the specified objects. If the object should be printed, e.g.
Parameter(short_name='sid', type='CODED-CONST', semantic=None, byte_position=0, bit_length=8, coded_value='0xbb')
choose the parameter --plumbing-output.

A json like output format as suggested above might be still nice.

Katja Köhler <katja.koehler@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information

@kakoeh
Copy link
Contributor

kakoeh commented Jan 5, 2024

More ideas for improvement:

  • change from tabulate to rich tables

Katja Köhler <katja.koehler@mercedes-benz.com>, on behalf of MBition GmbH.
Provider Information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first contribution Good for newcomers nice to have Things which improve the quality of life but are not a matter of life and death.
Projects
None yet
Development

No branches or pull requests

2 participants