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

update exporters to export static UIDs if available #373

Closed
wants to merge 24 commits into from

Conversation

nwesem
Copy link
Contributor

@nwesem nwesem commented Jul 4, 2024

Changes:

  • update binary exporter, c parser, and go parser such that staticUID can be used (and is shown while travsersing)
  • update csv exporter to export extended attributes
  • update franca exporter to export extended attributes
  • update graphql exporter to export extended attributes
  • update idl exporter to export extended attributes
  • update json exporter to export extended attributes
  • update protobuf exporter to export extended attributes
  • update yaml exporter to export extended attributes

How to verify:

First you have to create an ID file with

poetry run vspec2id ../vehicle_signal_specification/spec/VehicleSignalSpecification.vspec out_id.vspec

Now we check all exporters:

  1. try binary export (there are a few more steps needed here, but should be working now)
cd binary/
make # this will make current version of the `binarytool.so` library used by the vspec2binary exporter
cd ..
poetry run vspec2binary -u ../vehicle_signal_specification/spec/units.yaml out_id.vspec vss_no_val.bin
# now go to cparser and compile it
cd binary/c_parser
cc testparser.c cparserlib.c -o ctestparser
./ctestparser ../../vss_no_val.bin
# now you should be able to traverse the tree and see all staticUIDs using the ctestparser
# for go
cd ../go_parser
go build -o gotestparser testparser.go
./gotestparser ../../vss_no_val.bin

If you want to test that it still works without staticUIDs:

cd ../../ # to vss-tools base dir
poetry run vspec2binary ../vehicle_signal_specification/spec/VehicleSignalSpecification.vspec out.bin
cd  binary/c_parser
./ctestparser ../../out.bin
  1. try csv export and check results
poetry run vspec2csv out_id.vspec out.csv -u ../vehicle_signal_specification/spec/units.yaml -e staticUID
  1. try idl export
poetry run vspec2ddsidl out_id.vspec out.idl -u ../vehicle_signal_specification/spec/units.yaml -e staticUID
# then try parsing it with idlc
# on this branch we still need to add cyclonedds to run idlc
poetry add --group dev cyclonedds
poetry run idlc -l py ./out.idl
  1. try franca export
poetry run vspec2franca out_id.vspec out.franca -u ../vehicle_signal_specification/spec/units.yaml -e staticUID
  1. try graphql export
poetry run vspec2graphql out_id.vspec out.graphql -u ../vehicle_signal_specification/spec/units.yaml -e staticUID
  1. try json export
poetry run vspec2json out_id.vspec out.json -u ../vehicle_signal_specification/spec/units.yaml --json-pretty -e staticUID
  1. try protobuf export and check results
poetry run vspec2protobuf out_id.vspec out.pb -u ../vehicle_signal_specification/spec/units.yaml -e staticUID
  1. try yaml export
poetry run vspec2yaml out_id.vspec out.yaml -u ../vehicle_signal_specification/spec/units.yaml -e staticUID

@nwesem nwesem marked this pull request as draft July 4, 2024 10:10
@nwesem nwesem force-pushed the feat/update-exporters-uids branch from f031077 to 5295c89 Compare July 4, 2024 10:13
@nwesem
Copy link
Contributor Author

nwesem commented Jul 8, 2024

Would this be valid .idl output including staticUIDs? for leaves it should be correct, but I'm currently wondering how to attach the static UIDs to branches, would it work like shown below?
Sadly, I can't get the idlc parser to run it even seg faults from a file generated from master branch..

module Vehicle
{
const string staticUID ="0x35AFD7A7";
module ADAS
{
const string staticUID ="0x206A4E82";
module ABS
{
const string staticUID ="0xCE6D5634";
struct IsEnabled
{
boolean value;
const string type ="actuator";
const string description ="Indicates if ABS is enabled. True = Enabled. False = Disabled.";
const string staticUID ="0x6BAFEF4E";
};
struct IsEngaged
{
boolean value;
const string type ="sensor";
const string description ="Indicates if ABS is currently regulating brake pressure. True = Engaged. False = Not Engaged.";
const string staticUID ="0xAAF08F7B";
};
struct IsError
{
boolean value;
const string type ="sensor";
const string description ="Indicates if ABS incurred an error condition. True = Error. False = No Error.";
const string staticUID ="0x75B9DC6A";
};
};

@nwesem nwesem force-pushed the feat/update-exporters-uids branch 8 times, most recently from c90a68c to 633ffcb Compare July 9, 2024 12:46
@adobekan
Copy link
Collaborator

adobekan commented Jul 9, 2024

MoM: Let's have a look.. We need time to review this.

@nwesem nwesem force-pushed the feat/update-exporters-uids branch 5 times, most recently from 5d0640a to e5b8b0e Compare July 11, 2024 14:17
@nwesem
Copy link
Contributor Author

nwesem commented Jul 15, 2024

hi @erikbosch, do you have any info on the (dds)idl exporter? could you take a quick look at my comment above? Maybe you have an idea how to add attributes to branches in idl files? For me there is no way to check if my implementation is correct as I can't get the idlc parser running (seems like the documentation is outdated)..

Edit: In case you are not that familiar with the (dds)idl related code maybe there is somebody else in covesa that is?

@erikbosch
Copy link
Collaborator

hi @erikbosch, do you have any info on the (dds)idl exporter? could you take a quick look at my comment above? Maybe you have an idea how to add attributes to branches in idl files? For me there is no way to check if my implementation is correct as I can't get the idlc parser running (seems like the documentation is outdated)..

Edit: In case you are not that familiar with the (dds)idl related code maybe there is somebody else in covesa that is?

I do not think that anyone has worked on DDSIDL lately. I do not think the structs support const, that is why they add that as comment in generator

struct Minor
{
unsigned long value;
//const string type ="attribute";
//const string description="Supported Version of VSS - Minor version.";
};

I created a simple test case in #379 to update instructions, they seemed to be mashed up. Also a simple test case to verify that output is accepted. I honestly do not know if the ddsidl generator is useful as of today, or if it rather should be deprecated.

@nwesem nwesem marked this pull request as ready for review July 18, 2024 09:44
franca exporter now exports staticUID if available

Signed-off-by: Niclas Wesemann <[email protected]>
such that it exports static UIDs if available

Signed-off-by: Niclas Wesemann <[email protected]>
such that it exports static UID if available

Signed-off-by: Niclas Wesemann <[email protected]>
such that it exports staticUID if available

Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>

fix binary exporter and parser

now working including staticUIDs if available

Signed-off-by: Niclas Wesemann <[email protected]>
such that it exports staticUID if available

Signed-off-by: Niclas Wesemann <[email protected]>
nwesem added 13 commits July 18, 2024 12:59
…staticUID a core attribute"

This reverts commit 86d9587.

Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
such that it exports staticUID if available

Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
Signed-off-by: Niclas Wesemann <[email protected]>
@nwesem nwesem force-pushed the feat/update-exporters-uids branch from 8cc5659 to 5c40468 Compare July 18, 2024 12:13
@@ -24,13 +24,17 @@
# Write the header line


def print_csv_header(file, uuid, entry_type: AnyStr, include_instance_column: bool):
def print_csv_header(file, uuid, entry_type: AnyStr, include_instance_column: bool, extended_arrtributes: dict = {}):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo arrtributes

@erikbosch erikbosch requested a review from UlfBj July 22, 2024 11:47
@erikbosch
Copy link
Collaborator

Conflicts! Also added @UlfBj as reviewer as it concerns the "binary" tool quite a lot. Ulf - could you check how much implications this would have for VISSR. As it is for a major VSS(tools) release I guess that some required changes in VISSR is acceptable.

@nwesem
Copy link
Contributor Author

nwesem commented Jul 22, 2024

Conflicts!

Yes I already rebased once will do it again later today

@erikbosch
Copy link
Collaborator

@nwesem - still conflicts

@erikbosch
Copy link
Collaborator

MoM:

  • To be reworked when the other PR is done

@erikbosch erikbosch added the Status:Rework Committer must refactor or address comments label Sep 2, 2024
@erikbosch erikbosch marked this pull request as draft October 1, 2024 14:30
@sschleemilch
Copy link
Collaborator

To be reopened when needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status:Rework Committer must refactor or address comments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants