Skip to content

Commit 689050f

Browse files
authored
Removed all outer parameters for sensors display (#514)
* removed all outer parameters Signed-off-by: Nabil YOUSSEF <nabil.youssef@metroscope.tech> * Update CHANGELOG.md --------- Signed-off-by: Nabil YOUSSEF <nabil.youssef@metroscope.tech>
1 parent e400d09 commit 689050f

File tree

15 files changed

+25
-41
lines changed

15 files changed

+25
-41
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Use [gitmoji](https://gitmoji.dev/) to identify your changes.
1313

1414
### 💥 Changed <!--Make sure to add a link to the PR and issues related to your change-->
1515
- Breaking change: added a parameter `nominal_DT_default` to set the nominal temperature differences in heat exchanger to the maximum possible temperature difference [#513](https://github.com/Metroscope-dev/metroscope-modeling-library/pull/513)
16+
- Removed outer parameters from sensors. Not breaking, declared inner paramters won't block the model's compilation. [#514](https://github.com/Metroscope-dev/metroscope-modeling-library/pull/514)
1617

1718
### 🔥 Removed
1819

MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_direct.mo

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ within MetroscopeModelingLibrary.Examples.CCGT.MetroscopiaCCGT;
22
model MetroscopiaCCGT_direct
33
import MetroscopeModelingLibrary.Utilities.Units;
44

5-
inner parameter Boolean show_causality = true "true to show causality, false to hide it";
6-
inner parameter Boolean display_output = true "Used to switch ON or OFF output display";
7-
85
// Boundary conditions
96

107
// Air source

MetroscopeModelingLibrary/Examples/CCGT/MetroscopiaCCGT/MetroscopiaCCGT_reverse.mo

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ within MetroscopeModelingLibrary.Examples.CCGT.MetroscopiaCCGT;
22
model MetroscopiaCCGT_reverse
33
import MetroscopeModelingLibrary.Utilities.Units;
44

5-
inner parameter Boolean show_causality = true "true to show causality, false to hide it";
6-
inner parameter Boolean display_output = true "Used to switch ON or OFF output display";
7-
85
// Boundary conditions
96

107
// Air source
@@ -265,7 +262,7 @@ model MetroscopiaCCGT_reverse
265262
annotation (Placement(transformation(extent={{-636,-32},{-624,-20}})));
266263
MetroscopeModelingLibrary.Sensors.FlueGases.TemperatureSensor T_source_air_sensor(sensor_function="BC")
267264
annotation (Placement(transformation(extent={{-618,-32},{-606,-20}})));
268-
MetroscopeModelingLibrary.Sensors.FlueGases.FlowSensor Q_source_air_sensor(sensor_function="BC")
265+
MetroscopeModelingLibrary.Sensors.FlueGases.FlowSensor Q_source_air_sensor(sensor_function="BC", display_output=true)
269266
annotation (Placement(transformation(extent={{-600,-32},{-588,-20}})));
270267
MetroscopeModelingLibrary.Sensors.WaterSteam.TemperatureSensor T_circulating_water_in_sensor(sensor_function="BC")
271268
annotation (Placement(transformation(

MetroscopeModelingLibrary/Examples/CCGT/airCompressor_with_fogging_direct.mo

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ model airCompressor_with_fogging_direct
55

66
package RefMoistAirMedium = MetroscopeModelingLibrary.Utilities.Media.RefMoistAirMedium;
77

8-
inner parameter Boolean show_causality = true "true to show causality, false to hide it";
9-
inner parameter Boolean display_output = true "Used to switch ON or OFF output display";
10-
118
// Boundary conditinos
129
input Real source_P(start=1) "bar";
1310
input Units.Temperature source_T(start=20) "degC";

MetroscopeModelingLibrary/Examples/Nuclear/MetroscopiaNPP/MetroscopiaNPP_reverse.mo

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
within MetroscopeModelingLibrary.Examples.Nuclear.MetroscopiaNPP;
22
model MetroscopiaNPP_reverse
33

4-
inner parameter Boolean show_causality = true "true to show causality, false to hide it";
5-
inner parameter Boolean display_output = true "Used to switch ON or OFF output display";
6-
74
// Boundary Conditions
85

96
input Real P_steam(start = 50, unit="bar", min=0, nominal=50) "barA"; // Steam generator steam pressure

MetroscopeModelingLibrary/Partial/Sensors/BaseAbstractSensor.mo

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ model BaseAbstractSensor
66
parameter String sensor_function = "Unidentified" "Specify if the sensor is a BC or used for calibration"
77
annotation(choices(choice="Unidentified" "No specific function", choice="BC" "Boundary condition", choice="Calibration" "Used for calibration"));
88
parameter String causality = "" "Specify which parameter is calibrated by this sensor";
9-
outer parameter Boolean show_causality = true "Used to show or not the causality";
109

1110
WaterSteam.Connectors.Inlet C_in annotation (Placement(transformation(extent={{-30,-150},{-10,-130}}), iconTransformation(extent={{-30,-150},{-10,-130}})));
1211
WaterSteam.Connectors.Outlet C_out annotation (Placement(transformation(extent={{10,-150},{30,-130}}), iconTransformation(extent={{10,-150},{30,-130}})));
@@ -25,13 +24,13 @@ model BaseAbstractSensor
2524
Text(
2625
extent={{-100,200},{100,160}},
2726
textColor={107,175,17},
28-
textString=if show_causality then "%causality" else ""),
27+
textString=if causality <> "" then "%causality" else ""),
2928
Line(
3029
points={{100,0},{140,0},{140,180},{100,180}},
3130
color={107,175,17},
32-
arrow=if causality == "" or show_causality == false then {Arrow.None,Arrow.None} else {Arrow.None,Arrow.Filled},
31+
arrow=if causality == "" then {Arrow.None,Arrow.None} else {Arrow.None,Arrow.Filled},
3332
thickness=0.5,
34-
pattern=if causality == "" or show_causality == false then LinePattern.None else LinePattern.Solid,
33+
pattern=if causality == "" then LinePattern.None else LinePattern.Solid,
3534
smooth=Smooth.Bezier)}));
3635

3736
end BaseAbstractSensor;

MetroscopeModelingLibrary/Partial/Sensors/BaseSensor.mo

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ partial model BaseSensor
2525
parameter String sensor_function = "Unidentified" "Specify if the sensor is a BC or used for calibration"
2626
annotation(choices(choice="Unidentified" "No specific function", choice="BC" "Boundary condition", choice="Calibration" "Used for calibration"));
2727
parameter String causality = "" "Specify which parameter is calibrated by this sensor";
28-
outer parameter Boolean show_causality = true "Used to show or not the causality";
2928

3029
replaceable Connectors.FluidInlet C_in(Q(start=Q_0, nominal=Q_0), P(start=P_0, nominal=P_0), redeclare package Medium = Medium) annotation (Placement(transformation(extent={{-110,-10},{-90,10}})));
3130
replaceable Connectors.FluidOutlet C_out(Q(start=-Q_0, nominal=Q_0), P(start=P_0, nominal=P_0), redeclare package Medium = Medium) annotation (Placement(transformation(extent={{90,-10},{110,10}})));
@@ -60,12 +59,12 @@ equation
6059
Text(
6160
extent={{-100,-120},{100,-160}},
6261
textColor={107,175,17},
63-
textString=if show_causality then "%causality" else ""),
62+
textString=if causality <> "" then "%causality" else ""),
6463
Line(
6564
points={{100,-60},{140,-60},{140,-140},{100,-140}},
6665
color={107,175,17},
67-
arrow=if causality == "" or show_causality == false then {Arrow.None,Arrow.None} else {Arrow.None,Arrow.Filled},
66+
arrow=if causality == "" then {Arrow.None,Arrow.None} else {Arrow.None,Arrow.Filled},
6867
thickness=0.5,
69-
pattern=if causality == "" or show_causality == false then LinePattern.None else LinePattern.Solid,
68+
pattern=if causality == "" then LinePattern.None else LinePattern.Solid,
7069
smooth=Smooth.Bezier)}));
7170
end BaseSensor;

MetroscopeModelingLibrary/Partial/Sensors/DeltaPressureSensor.mo

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ partial model DeltaPressureSensor
1616
parameter String sensor_function = "Unidentified" "Specify if the sensor is a BC or used for calibration"
1717
annotation(choices(choice="Unidentified" "No specific function", choice="BC" "Boundary condition", choice="Calibration" "Used for calibration"));
1818
parameter String causality = "" "Specify which parameter is calibrated by this sensor";
19-
outer parameter Boolean show_causality = true "Used to show or not the causality";
20-
outer parameter Boolean display_output = false "Used to switch ON or OFF output display";
19+
parameter Boolean display_output = true "Used to switch ON or OFF output display";
2120
parameter String display_unit = "bar" "Specify the display unit"
2221
annotation(choices(choice="bar", choice="mbar", choice="psi", choice="Pa"));
2322

@@ -63,12 +62,12 @@ equation
6362
Text(
6463
extent={{-100,-120},{100,-160}},
6564
textColor={107,175,17},
66-
textString=if show_causality then "%causality" else ""),
65+
textString=if causality <> "" then "%causality" else ""),
6766
Line(
6867
points={{100,-60},{140,-60},{140,-140},{100,-140}},
6968
color={107,175,17},
70-
arrow=if causality == "" or show_causality == false then {Arrow.None,Arrow.None} else {Arrow.None,Arrow.Filled},
69+
arrow=if causality == "" then {Arrow.None,Arrow.None} else {Arrow.None,Arrow.Filled},
7170
thickness=0.5,
72-
pattern=if causality == "" or show_causality == false then LinePattern.None else LinePattern.Solid,
71+
pattern=if causality == "" then LinePattern.None else LinePattern.Solid,
7372
smooth=Smooth.Bezier)}));
7473
end DeltaPressureSensor;

MetroscopeModelingLibrary/Partial/Sensors/FlowSensor.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ partial model FlowSensor
2323

2424
parameter String display_unit = "kg/s" "Specify the display unit"
2525
annotation(choices(choice="kg/s", choice="m3/s", choice="l/m", choice="t/h", choice="lb/s", choice="Mlb/h"));
26-
outer parameter Boolean display_output = false "Used to switch ON or OFF output display";
26+
parameter Boolean display_output = true "Used to switch ON or OFF output display";
2727

2828
equation
2929
Qv = Q / Medium.density(state);

MetroscopeModelingLibrary/Partial/Sensors/PressureSensor.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ partial model PressureSensor
2323
Real P_inH2O(nominal = P_0*Constants.Pa_to_inH2O, start = P_0*Constants.Pa_to_inH2O); // Absolute pressure in inches of H2O
2424
Real P_mbar(nominal = P_0*Constants.Pa_to_mbar, start = P_0*Constants.Pa_to_mbar, unit="mbar"); // Absolute pressure in milibar
2525

26-
outer parameter Boolean display_output = false "Used to switch ON or OFF output display";
26+
parameter Boolean display_output = true "Used to switch ON or OFF output display";
2727
parameter String display_unit = "barA" "Specify the display unit"
2828
annotation(choices(choice="barA", choice="barG", choice="mbar", choice="MPaA", choice="kPaA"));
2929

0 commit comments

Comments
 (0)