-
Notifications
You must be signed in to change notification settings - Fork 170
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
Signal references inside structs? #741
Comments
The reasoning when creating the struct concept was that signals can be seen as something similar to variables in many programming languages, and you cannot reuse/reference a variable when creating a struct or class. VSS signals also specifies if they are sensors/actuators/attributes, but that information does not make any sense inside a struct. Technically in vss-tools it would have been possibly to allow signals inside structs, as they contain the information needed. When we introduced the structs we discussed hypothetically that the current It could also be good to know that there have been other proposals to separate data representation from signals, like presented in a presentation from Ford on the links below. https://wiki.covesa.global/display/WIK4/Data+Models+and+Ontologies That would result in something like below, and with that approach it would be easy to reuse
The advantage would be that we only would need to specify min/max for longitude in a single location, compared to today when we have multiple. |
Cheers. A facility for being able to reference already defined signals (or as in the case of the above suggestion In our use-case(s) we have a number of complex objects that we foresee as needing to contain multiple signals, initially we were hoping we could use Is the working group interested in having the above type of initiative driven? |
Now I think that I understand your use-case - you want to aggregate/derive larger objects from other signals, which could be useful if you for instance want to have a struct containing vehicle speed, position and fuel-level or an identifier to be able to get/set/transmit those 3 signals in a single operation. A possible solution to this could be to use a special field like
There have been some discussion on this long time ago, but then the conclusion was that it is something that should not be part of "core VSS" but rather something defined/used by downstream implementation projects. We are always interested in new ideas on how to extend/improve VSS. If you have a rough idea we could reserve 10-15 minutes in an upcoming VSS meeting (Tuesdays 16.00 CET/CEST) for you to present the idea and for discussion. |
Thanks @erikbosch this idea with Re: improvements/extensions my hope is that something like this will come out of our project for the community. WIP. Cheers. |
I think this issue origines from the fact that one tree hierarchy is not expressive enough. So, you might need to work around and increase the features of One option (not the only one) is evolving VSS with GraphQL schema language. Check out the slides, they contain plenty of examples. |
MoM:
|
Hi All,
I am building some
struct
data types and would find it useful/convenient to be able to compose it from signals defined in the rest of the tree. However, it seems thatstruct
datatypes can only contain items of typeproperty
orstruct
whereas signals in the tree need to be one ofsensor
actuator
attribute
branch
and indeed attempting to include these in the definition of thestruct
throws an error in the tooling.To take a simple example mentioned in the
struct
docs, to define astruct
for GPS location one could define:But it seems one cannot compose the
struct
out of signals in the broader tree eg. from signals in theVehicle.CurrentLocation
path eg. using an#include
.Is there a way to do what I am describing above? If no, is there a reason its a bad idea and/or why it was prohibited?
The text was updated successfully, but these errors were encountered: