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

Deep Modifications #9

Open
xogeny opened this issue Feb 26, 2013 · 0 comments
Open

Deep Modifications #9

xogeny opened this issue Feb 26, 2013 · 0 comments

Comments

@xogeny
Copy link

xogeny commented Feb 26, 2013

I've come across several cases where "deep modifications" are used. An example would be this fragment from OpenHydraulics.Circuits.PressureCompensated:

OpenHydraulics.Components.Valves.DirectionalValves.V4_3CC v4_3CC(
  portA(p(start=101325, fixed=true)),
  portB(p(start=101325, fixed=false)),
  portP(p(start=101325)),
  P2A(table=[0,0; 1,1]),
  B2T(table=[0,0; 1,1]),
  P2B(table=[-1,1; 0,0; 1,0]),
  A2T(table=[-1,1; 0,0]));

A better approach would be to "propagate" the parameters like portA.p.start and P2A.table up one level. This has two advantages. First, it adds those parameters to the dialog for V4_3CC (and potentially others, depending on where in the inheritance tree they the parameters are introduced) and it avoids having to remember how to make these deep modifications each time you create a new instance of V4_3CC. Otherwise, users have to do something like "Show Component" in Dymola and explore the whole hierarchy for these important parameters.

Ideally, the above code should really look like:

OpenHydraulics.Components.Valves.DirectionalValves.V4_3CC v4_3CC(
  p_A=101325, p_A_fixed=true,
  p_B=101325, p_B_fixed=false,
  p_P=101325,
  P2A_table=[0,0; 1,1],
  B2T_table=[0,0; 1,1],
  P2B_table=[-1,1; 0,0; 1,0],
  A2T_table=[-1,1; 0,0]);

Of course, these should be organized into tabs and groups.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant