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

Use real enumeration in e.g. Modelica.Mechanics.Rotational.Interfaces.PartialFriction! #3387

Open
HansOlsson opened this issue Feb 3, 2020 · 4 comments
Assignees
Labels
L: Mechanics.Rotational Issue addresses Modelica.Mechanics.Rotational L: Mechanics.Translational Issue addresses Modelica.Mechanics.Translational
Milestone

Comments

@HansOlsson
Copy link
Contributor

The following constants and their use could be replaced by an enumeration:

constant Integer Unknown=3 "Value of mode is not known";
 constant Integer Free=2 "Element is not active";
 constant Integer Forward=1 "w_relfric > 0 (forward sliding)";
 constant Integer Stuck=0
   "w_relfric = 0 (forward sliding, locked or backward sliding)";
 constant Integer Backward=-1 "w_relfric < 0 (backward sliding)";
 Integer mode(
   final min=Backward,
   final max=Unknown,
   start=Unknown,
   fixed=true)
   "Mode of friction (-1: backward sliding, 0: stuck, 1: forward sliding, 2: inactive, 3: unknown)";

The constants seem to occur in
Modelica.Mechanics.Rotational.Components.LossyGear
Modelica.Mechanics.Rotational.Interfaces.PartialFriction
Modelica.Mechanics.Translational.Interfaces.PartialFriction
Modelica.Mechanics.Translational.Components.PartialFrictionWithStop
Modelica.Mechanics.Translational.Components.MassWithStopAndFriction

That was what you meant @DagBruck ?

@HansOlsson HansOlsson added L: Mechanics.Rotational Issue addresses Modelica.Mechanics.Rotational L: Mechanics.Translational Issue addresses Modelica.Mechanics.Translational labels Feb 3, 2020
@tobolar
Copy link
Contributor

tobolar commented Oct 25, 2023

Would a conversion script "type conversion from Integer to enumeration" work seamlessly?

And, the range of integer value of mode would change from [-1, 3] to [0, 4] - which probably is no problem, except for regression.

@MartinOtter What do you mean?

@HansOlsson
Copy link
Contributor Author

Would a conversion script "type conversion from Integer to enumeration" work seamlessly?

I will have to investigate.
However, as far as I understand conversion scripts wont be this time, but for version 5.

@tobolar
Copy link
Contributor

tobolar commented Oct 26, 2023

However, as far as I understand conversion scripts wont be this time, but for version 5.

I understand the same way. So set the milestone to 5.0.0?

@DagBruck
Copy link
Contributor

That was what you meant @DagBruck ?

@HansOlsson indeed it was.

@tobolar tobolar added this to the MSL5.0.0 milestone Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L: Mechanics.Rotational Issue addresses Modelica.Mechanics.Rotational L: Mechanics.Translational Issue addresses Modelica.Mechanics.Translational
Projects
None yet
Development

No branches or pull requests

3 participants