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

Info "Unit" shoud be separated from the comment on numerical datas #170

Open
marcgarba opened this issue Jul 1, 2024 · 4 comments
Open

Comments

@marcgarba
Copy link

marcgarba commented Jul 1, 2024

A remark that was made during a presentation and that seems interesting:
for some information, it would be preferable for the unit value to be separated from the comment section:
for example, for an integer, there could be units in: seconds, milli-secs, minutes, km/h, percentage, meter, decimeters, deciTons, degrees Celcius, ... etc ...

@otterdahl
Copy link
Contributor

Thank you for the suggestion. I think we considered something similar about 10 years ago but it was never implemented in the specification.

I think it can make sense to provide this information to the supervision system sometimes. The equipment can clever and send the data using the most suitable unit given the circumstances. It provides flexibility to what the equipment actually sends, but it might make validation harder.

@emiltin
Copy link
Contributor

emiltin commented Jul 3, 2024

I'm a bit concerned it would add too many complicatations.

I think you would always have to document how data is send and you then can specify a suitable unit, like km/h or seconds.

Having to parse arbitrary units like km/day, cm/h, etc. can be very complicated for the receiver. Would cm/h or mm/s be acceptable?

It also increase the number of bytes that has to be send. And as David mentioned, it makes validatating attributes using a schema harder.

It's probably easier for the receiver to always receive using a fixed (implicit) unit and then convert to a different unit afterwards if needed.

Something we could do is allow higher precision anywhere by allowing floats. For example, if the unit is seconds, you can send 0.001 to specify a millisecond.

@marcgarba
Copy link
Author

marcgarba commented Jul 8, 2024

Oh no it really didn't go that far !

It was just the idea to have for the description of a field, a separated "unit" part more easier to identify in the YAML / Excel.

Absolutely no change to the protocol exchanged !!!

Example in YAML:

   arguments:
      speed:
       type: integer
       description: Average speed
       unit: km/h
       min: 0
       max: 65535

Unit information which can then be used for graphical input/visualization interfaces...
We don't necessarily have to use it to validate anything...

@emiltin
Copy link
Contributor

emiltin commented Oct 29, 2024

Ok I see. Yes it makes sense to include the unit in the SXL source in a machine-readable format.

@emiltin emiltin added this to the 3.3 milestone Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants