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

Replace "fake" enumerations with enumerations in VehicleInterfaces.Types #25

Closed
harmanpa opened this issue Jun 7, 2018 · 2 comments
Closed
Assignees
Labels
enhancement New feature or enhancement wontfix Issue that will not be fixed
Milestone

Comments

@harmanpa
Copy link
Member

harmanpa commented Jun 7, 2018

The classes VehicleInterfaces.Types.GearMode and VehicleInterfaces.Types.IgnitionSetting use Integer constants and a choices annotation in order to behave like an enumeration. This is due to enumerations not being fully supported at the time of original development.

Enumerations are now generally supported in tools so these should be updated (at a major release).

@harmanpa harmanpa added the enhancement New feature or enhancement label Jun 7, 2018
@harmanpa harmanpa added this to the v2.0.0 milestone Jun 7, 2018
@tobolar tobolar self-assigned this Jun 8, 2018
@tobolar
Copy link
Contributor

tobolar commented Jun 21, 2018

Actually, work on this issue shall be coupled with #28 as well.

The GearMode and IgnitionSetting are both used in DriverEnvironments.Internal.StandardBus which shall be reintroduced again. This StandardBus is marked obsolete in current v1.2.4 but this must be reverted in the next major version.
In contrast, busses in e.g. DriverEnvironments.Interfaces shall be marked obsolete and no more used.

Here are listed classes where concerned "fake" enumerations are used:

  • VehicleInterfaces.Types.GearMode

    • DriverEnvironments.DriveByWireAutomatic as selectedGearboxMode
    • DriverEnvironments.Interfaces.BusForAutomaticTransmission as gearboxMode
    • DriverEnvironments.Internal.StandardBus as gearboxMode
    • Drivers.Interfaces.BusForAutomaticTransmission as gearboxMode
    • Drivers.MinimalDriver as selectedGearboxMode
  • VehicleInterfaces.Types.IgnitionSetting

    • DriverEnvironments.Interfaces.MinimalBus as ignition
    • DriverEnvironments.Internal.StandardBus as ignition
    • Drivers.Interfaces.MinimalBus as ignition

@tobolar
Copy link
Contributor

tobolar commented Jun 22, 2018

Well I have analysed this and it doesn't seem to be feasible at the moment. The problem is that the "enumerations" are mainly used in control busses. And to work with the busses in Diagrams would require particular graphical blocks for enumerations, which are not available. See also comment modelica/ModelicaStandardLibrary#91 (comment).

It would be possible to use the enumeration for the parameter selectedGearboxMode in driver models. But I see no benefit of doing so because then there have to be some transformation of enumeration parameter to integer on control bus. So rather tricky and confusing solution.

@tobolar tobolar added the wontfix Issue that will not be fixed label Feb 4, 2019
@tobolar tobolar closed this as completed Feb 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement wontfix Issue that will not be fixed
Projects
None yet
Development

No branches or pull requests

2 participants