modelica / VehicleInterfaces

Free (standard conforming) library for interface definitions and architectures for vehicle system modeling
Other
43 stars 22 forks source link

Hide usingMultiBodyXXX when the corresponding includeXXXBearing is set to true #88

Closed dariomangoni closed 3 years ago

dariomangoni commented 4 years ago

The usingMultiBodyXXX parameters are always used in combination in an OR statement with their close friends includeXXXBearing. Because of this, if the developer sets includeXXXBearing (that is protected) to true, automatically the user choice on usingMultiBodyXXX will make no difference: because of the OR statement the logical results will always be true.

Because of this, leaving usingMultiBodyXXX exposed to the user might mislead him to think that he can still disable the Bearings by setting usingMultiBodyXXX=false while he actually cannot. Wouldn't be better to hide usingMultiBodyXXX using annotation(Dialog(enable=not includeXXXBearing))?

tobolar commented 4 years ago

Your idea is good. Thinking about, I only see two drawbacks.

  1. Setting includeXXXBearing=true, the user could not directly recognise why usingMultiBodyXXX is disabled. This could be solved by additonal comment in the parameter descripton and/or documentation. And it is probably better then the current situation.
  2. There could be a crash when user - for some (wrong) reasons - uses usingMultiBodyXXX when developing his/her own model, i.e. being a developer. Properly, only includeXXXBearing shall be used.
dariomangoni commented 4 years ago
  1. yes, I think so; I think that is better that the user asks himself why usingMultiBodyXXX is disabled and goes to the documentation, rather than leaving it available that does nothing. The user might indeed set usingMultiBodyXXX=true and then could enable some includeBearingConnector accordingly, thus being disappointed when the compiler warns against a connection of incompatible connectors.

  2. that would cause a failure even now, wouldn't it? if the user-that-tries-to-become-a-developer would develop something it will then see that usingMultiBodyXXX is not visible to the user and hopefully asks himself the same question as above!