diff --git a/ThermofluidStream/Sensors/DifferenceSensorSelect.mo b/ThermofluidStream/Sensors/DifferenceSensorSelect.mo index 896428d0..3b2e02a5 100644 --- a/ThermofluidStream/Sensors/DifferenceSensorSelect.mo +++ b/ThermofluidStream/Sensors/DifferenceSensorSelect.mo @@ -16,7 +16,7 @@ model DifferenceSensorSelect "Sensor for selectable quantatiy difference" Documentation(info="
Medium Model for the negative input of the sensor. Make sure it is the same for the stream the sensors inputs are connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter SI.Density rho_min = dropOfCommons.rho_min "Minimum density" annotation(Dialog(tab="Advanced", group="Regularization")); parameter Quantities quantity "Measured quantity"; @@ -51,15 +51,11 @@ model DifferenceSensorSelect "Sensor for selectable quantatiy difference" annotation(Dialog(group="Output", enable=outputValue and filter_output and init==InitMode.state)); Interfaces.Inlet inletA(redeclare package Medium=MediumA) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,0}), - iconTransformation(extent={{-120,-20},{-80,20}}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Interfaces.Inlet inletB(redeclare package Medium=MediumB) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={136,-10}), - iconTransformation(extent={{120,-20},{80,20}}))); + annotation (Placement(transformation(extent={{120,-20},{80,20}}))); Modelica.Blocks.Interfaces.RealOutput value_out(unit=Internal.getUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement(transformation(extent={{4,-78},{24,-58}}), iconTransformation(extent={{-10,-10},{10,10}}, - rotation=270, - origin={0,-90}))); + annotation (Placement(transformation(extent={{-10,-10},{10,10}},rotation=270,origin={0,-90}))); output Real value(unit=Internal.getUnit(quantity)) "Computed difference in the selected quantity"; @@ -101,38 +97,32 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="differentialSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,80},{150,40}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,24},{66,-36}}, + extent={{-74,24},{86,-36}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{100,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,30},{60,-30}}, + extent={{-80,30},{80,-30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-60,30},{60,-30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String( - value, - format="1."+String(digits)+"f"))), + extent={{-80,26},{80,-26}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), Text( extent={{-150,-40},{150,-70}}, textColor={0,0,0}, textString=quantityString), Ellipse( - extent={{70,30},{90,10}}, + extent={{90,40},{110,20}}, lineColor={28,108,200}, lineThickness=0.5), Line(visible=outputValue, @@ -142,22 +132,22 @@ equation points={{0,-30},{0,-40}}, color={0,0,127}), Line( - points={{72,20},{88,20}}, + points={{92,30},{108,30}}, color={28,108,200}, thickness=0.5), Ellipse( - extent={{-90,30},{-70,10}}, + extent={{-110,40},{-90,20}}, lineColor={28,108,200}, lineThickness=0.5), Line( - points={{-88,20},{-72,20}}, + points={{-108,30},{-92,30}}, color={28,108,200}, thickness=0.5), Line( points={{-8,0},{8,0}}, color={28,108,200}, thickness=0.5, - origin={-80,20}, + origin={-100,30}, rotation=90)}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/DifferenceSensor_Tp.mo b/ThermofluidStream/Sensors/DifferenceSensor_Tp.mo index 65c208e1..da8911cb 100644 --- a/ThermofluidStream/Sensors/DifferenceSensor_Tp.mo +++ b/ThermofluidStream/Sensors/DifferenceSensor_Tp.mo @@ -15,7 +15,7 @@ model DifferenceSensor_Tp "Sensor for Temperature and pressure difference" Documentation(info="Medium Model for the negative input of the sensor. Make sure it is the same for the stream the sensors inputs are connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter ThermofluidStream.Sensors.Internal.Types.TemperatureUnit temperatureUnit = "K" "Temperature unit (display and output)" annotation(choicesAllMatching = true, Evaluate = true); parameter ThermofluidStream.Sensors.Internal.Types.PressureUnit pressureUnit = "Pa" "Pressure unit (display and output)" @@ -42,13 +42,13 @@ model DifferenceSensor_Tp "Sensor for Temperature and pressure difference" annotation(Dialog(group="Output", enable=outputPressure and filter_output and init==InitMode.state)); Interfaces.Inlet inletA(redeclare package Medium=MediumA) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,80}), iconTransformation(extent={{-120,40},{-80,80}}))); + annotation (Placement(transformation(extent={{-120,40},{-80,80}}))); Interfaces.Inlet inletB(redeclare package Medium=MediumB) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,-80}), iconTransformation(extent={{-120,-80},{-80,-40}}))); + annotation (Placement(transformation(extent={{-120,-80},{-80,-40}}))); Modelica.Blocks.Interfaces.RealOutput T_out(final quantity="ThermodynamicTemperature", final unit=temperatureUnit) = T if outputTemperature "Temperature difference output connector" - annotation (Placement(transformation(extent={{70,30},{90,50}}), iconTransformation(extent={{70,30},{90,50}}))); + annotation (Placement(transformation(extent={{100,30},{120,50}}))); Modelica.Blocks.Interfaces.RealOutput p_out(final quantity="Pressure", final unit=pressureUnit) = p if outputPressure "Pressure difference output connector" - annotation (Placement(transformation(extent={{70,-50},{90,-30}}), iconTransformation(extent={{70,-50},{90,-30}}))); + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); output Real p(final quantity="Pressure", final unit=pressureUnit); output Real T(final quantity="ThermodynamicTemperature", final unit=temperatureUnit); @@ -102,62 +102,50 @@ equation T = direct_T; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="differentialSensorTp",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,140},{150,100}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,54},{66,-66}}, + extent={{-74,54},{86,-66}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-80,0},{0,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,60},{60,-60}}, + extent={{-80,60},{80,-60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-60,55},{60,5}}, - textColor={28,108,200}, - textString=DynamicSelect("T", String( - T, - format="1."+String(digits)+"f"))), + extent={{-80,56},{80,6}}, + textColor={0,0,0}, + textString=DynamicSelect(" T ", " "+String(T,significantDigits=digits)+" ")), Text( - extent={{-60,-5},{60,-55}}, - textColor={28,108,200}, - textString=DynamicSelect("p", String( - p, - format="1."+String(digits)+"f"))), - Text(visible=not outputTemperature, - extent={{70,45},{130,15}}, + extent={{-80,-6},{80,-56}}, + textColor={0,0,0}, + textString=DynamicSelect(" p ", " "+String(p,significantDigits=digits)+" ")), + Text(visible= not outputTemperature, + extent={{90,46},{150,16}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=not outputPressure, - extent={{70,-15},{130,-45}}, + Text(visible= not outputPressure, + extent={{90,-16},{150,-46}}, textColor={0,0,0}, horizontalAlignment=TextAlignment.Left, textString="%pressureUnit"), Text(visible= outputTemperature, - extent={{75,78},{135,48}}, + extent={{95,78},{155,48}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=outputPressure, - extent={{75,-2},{135,-32}}, + Text(visible= outputPressure, + extent={{95,-2},{155,-32}}, textColor={0,0,0}, textString="%pressureUnit", horizontalAlignment=TextAlignment.Left), - Line( - points={{-80,60},{-80,-60}}, - color={28,108,200}, - thickness=0.5), Line( points={{-100,-60},{-80,-60}}, color={28,108,200}, @@ -175,10 +163,10 @@ equation lineColor={28,108,200}, lineThickness=0.5), Line(visible=outputTemperature, - points={{60,40},{78,40}}, + points={{80,40},{100,40}}, color={0,0,127}), Line(visible=outputPressure, - points={{60,-40},{78,-40}}, + points={{80,-40},{100,-40}}, color={0,0,127}), Line( points={{-108,90},{-92,90}}, diff --git a/ThermofluidStream/Sensors/DifferenceTwoPhaseSensorSensorSelect.mo b/ThermofluidStream/Sensors/DifferenceTwoPhaseSensorSensorSelect.mo index d7b5e076..8c39f4ff 100644 --- a/ThermofluidStream/Sensors/DifferenceTwoPhaseSensorSensorSelect.mo +++ b/ThermofluidStream/Sensors/DifferenceTwoPhaseSensorSensorSelect.mo @@ -17,7 +17,7 @@ model DifferenceTwoPhaseSensorSensorSelect "Sensor for selectable quantatiy diffMedium Model for the negative input of the sensor. Make sure it is the same for the stream the sensors inputs are connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter Quantities quantity "Measured quantity"; final parameter String quantityString= @@ -43,16 +43,11 @@ model DifferenceTwoPhaseSensorSensorSelect "Sensor for selectable quantatiy diff annotation(Dialog(group="Output", enable=outputValue and filter_output and init==InitMode.state)); Interfaces.Inlet inletA(redeclare package Medium=MediumA) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,80}), - iconTransformation(extent={{-120,-20},{-80,20}}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Interfaces.Inlet inletB(redeclare package Medium=MediumB) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,-80}), - iconTransformation(extent={{120,-20},{80,20}}))); + annotation (Placement(transformation(extent={{120,-20},{80,20}}))); Modelica.Blocks.Interfaces.RealOutput value_out(unit=Internal.getTwoPhaseUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement(transformation(extent={{28,-90},{48,-70}}), iconTransformation( - extent={{-10,-10},{10,10}}, - rotation=270, - origin={0,-90}))); + annotation (Placement(transformation(extent={{-10,-10},{10,10}},rotation=270,origin={0,-90}))); output Real value(unit=Internal.getTwoPhaseUnit(quantity)) "Computed difference in the selected quantity"; @@ -94,32 +89,26 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="differentialSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,120},{150,80}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,24},{66,-36}}, + extent={{-74,24},{86,-36}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{100,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,30},{60,-30}}, + extent={{-80,30},{80,-30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-60,30},{60,-30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String( - value, - format="1."+String(digits)+"f"))), + extent={{-80,26},{80,-26}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), Text( extent={{-150,-70},{150,-40}}, textColor={0,0,0}, @@ -131,25 +120,25 @@ equation points={{0,-70},{0,-80}}, color={0,0,127}), Ellipse( - extent={{-90,30},{-70,10}}, + extent={{-110,40},{-90,20}}, lineColor={28,108,200}, lineThickness=0.5), Line( - points={{-88,20},{-72,20}}, + points={{-108,30},{-92,30}}, color={28,108,200}, thickness=0.5), Line( points={{-8,0},{8,0}}, color={28,108,200}, thickness=0.5, - origin={-80,20}, + origin={-100,30}, rotation=90), Line( - points={{72,20},{88,20}}, + points={{92,30},{108,30}}, color={28,108,200}, thickness=0.5), Ellipse( - extent={{70,30},{90,10}}, + extent={{90,40},{110,20}}, lineColor={28,108,200}, lineThickness=0.5)}), Diagram(coordinateSystem(preserveAspectRatio=true)), diff --git a/ThermofluidStream/Sensors/MultiSensor_Tp.mo b/ThermofluidStream/Sensors/MultiSensor_Tp.mo index c8502b92..77eece2d 100644 --- a/ThermofluidStream/Sensors/MultiSensor_Tp.mo +++ b/ThermofluidStream/Sensors/MultiSensor_Tp.mo @@ -10,7 +10,7 @@ model MultiSensor_Tp "Temperature and pressure sensor" Documentation(info="Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter ThermofluidStream.Sensors.Internal.Types.TemperatureUnit temperatureUnit = "K" "Temperature unit (display and output)" annotation(choicesAllMatching = true, Evaluate = true); parameter ThermofluidStream.Sensors.Internal.Types.PressureUnit pressureUnit = "Pa" "Pressure unit (display and output)" @@ -35,11 +35,11 @@ model MultiSensor_Tp "Temperature and pressure sensor" annotation(Dialog(group="Output", enable=outputPressure and filter_output and init==InitMode.state)); Interfaces.Inlet inlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,0}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Modelica.Blocks.Interfaces.RealOutput T_out(final quantity="ThermodynamicTemperature", final unit=temperatureUnit) = T if outputTemperature "Temperature output connector" - annotation (Placement(transformation(extent={{70,30},{90,50}}), iconTransformation(extent={{70,30},{90,50}}))); + annotation (Placement(transformation(extent={{100,30},{120,50}}))); Modelica.Blocks.Interfaces.RealOutput p_out(final quantity="Pressure", final unit=pressureUnit) = p if outputPressure "Pressure output connector" - annotation (Placement(transformation(extent={{72,-50},{92,-30}}), iconTransformation(extent={{72,-50},{92,-30}}))); + annotation (Placement(transformation(extent={{100,-50},{120,-30}}))); output Real p(final quantity="Pressure", final unit=pressureUnit); output Real T(final quantity="ThermodynamicTemperature", final unit=temperatureUnit); @@ -78,63 +78,55 @@ equation T = direct_T; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensorTp",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,120},{150,80}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,54},{66,-66}}, + extent={{-74,54},{86,-66}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{0,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,60},{60,-60}}, + extent={{-80,60},{80,-60}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-60,55},{60,5}}, - textColor={28,108,200}, - textString=DynamicSelect("T", String( - T, - format="1."+String(digits)+"f"))), + extent={{-80,56},{80,6}}, + textColor={0,0,0}, + textString=DynamicSelect(" T ", " "+String(T,significantDigits=digits)+" ")), Text( - extent={{-60,-5},{60,-55}}, - textColor={28,108,200}, - textString=DynamicSelect("p", String( - p, - format="1."+String(digits)+"f"))), - Text(visible=not outputTemperature, - extent={{70,45},{130,15}}, + extent={{-80,-6},{80,-56}}, + textColor={0,0,0}, + textString=DynamicSelect(" p ", " "+String(p,significantDigits=digits)+" ")), + Text(visible= not outputTemperature, + extent={{90,46},{150,16}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=not outputPressure, - extent={{70,-15},{130,-45}}, + Text(visible= not outputPressure, + extent={{90,-16},{150,-46}}, textColor={0,0,0}, horizontalAlignment=TextAlignment.Left, textString="%pressureUnit"), Text(visible= outputTemperature, - extent={{75,78},{135,48}}, + extent={{95,78},{155,48}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=outputPressure, - extent={{75,-2},{135,-32}}, + Text(visible= outputPressure, + extent={{95,-2},{155,-32}}, textColor={0,0,0}, textString="%pressureUnit", horizontalAlignment=TextAlignment.Left), Line(visible=outputTemperature, - points={{60,40},{78,40}}, + points={{80,40},{100,40}}, color={0,0,127}), Line(visible=outputPressure, - points={{60,-40},{78,-40}}, + points={{80,-40},{100,-40}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/MultiSensor_Tpm.mo b/ThermofluidStream/Sensors/MultiSensor_Tpm.mo index fed56c7c..897b5138 100644 --- a/ThermofluidStream/Sensors/MultiSensor_Tpm.mo +++ b/ThermofluidStream/Sensors/MultiSensor_Tpm.mo @@ -11,7 +11,7 @@ model MultiSensor_Tpm "Sensor for temperature, pressure and mass flow rate" Documentation(info="Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter ThermofluidStream.Sensors.Internal.Types.TemperatureUnit temperatureUnit = "K" "Temperature unit (display and output)" annotation(choicesAllMatching = true, Evaluate = true); parameter ThermofluidStream.Sensors.Internal.Types.PressureUnit pressureUnit = "Pa" "Pressure unit (display and output)" @@ -50,11 +50,11 @@ model MultiSensor_Tpm "Sensor for temperature, pressure and mass flow rate" Interfaces.Outlet outlet(redeclare package Medium=Medium) annotation (Placement(transformation(extent={{80,-120},{120,-80}}))); Modelica.Blocks.Interfaces.RealOutput T_out(final quantity="ThermodynamicTemperature", final unit=temperatureUnit) = T if outputTemperature "Temperature output connector" - annotation (Placement(transformation(extent={{72,50},{92,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); Modelica.Blocks.Interfaces.RealOutput p_out(final quantity="Pressure", final unit=pressureUnit) = p if outputPressure "Pressure output connector" - annotation (Placement(transformation(extent={{72,-10},{92,10}}))); + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); Modelica.Blocks.Interfaces.RealOutput m_flow_out(unit="kg/s") = m_flow if outputMassFlowRate "Mass flow rate output connector" - annotation (Placement(transformation(extent={{72,-70},{92,-50}}))); + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); output Real p(final quantity="Pressure", final unit=pressureUnit); output Real T(final quantity="ThermodynamicTemperature", final unit=temperatureUnit); @@ -109,43 +109,43 @@ equation m_flow = direct_m_flow; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensorTpm",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-160},{150,-120}}, textString="%name", textColor=dropOfCommons.instanceNameColor), - Text(visible=not outputTemperature, - extent={{150,70},{68,40}}, + Text(visible= not outputTemperature, + extent={{150,77},{90,47}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=not outputPressure, - extent={{150,20},{68,-10}}, + Text(visible= not outputPressure, + extent={{150,25},{90,-5}}, textColor={0,0,0}, textString=pressureUnit, horizontalAlignment=TextAlignment.Left), - Text(visible=not outputMassFlowRate, - extent={{150,-30},{68,-60}}, + Text(visible= not outputMassFlowRate, + extent={{150,-27},{90,-57}}, textColor={0,0,0}, textString=massFlowString, horizontalAlignment=TextAlignment.Left), - Text(visible=outputTemperature, - extent={{150,98},{75,68}}, + Text(visible= outputTemperature, + extent={{155,98},{95,68}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=outputPressure, - extent={{150,38},{75,8}}, + Text(visible= outputPressure, + extent={{155,38},{95,8}}, textColor={0,0,0}, textString=pressureUnit, horizontalAlignment=TextAlignment.Left), - Text(visible=outputMassFlowRate, - extent={{150,-20},{75,-50}}, + Text(visible= outputMassFlowRate, + extent={{155,-20},{95,-50}}, textColor={0,0,0}, textString=massFlowString, horizontalAlignment=TextAlignment.Left), Rectangle( - extent={{-54,74},{66,-86}}, + extent={{-74,84},{86,-76}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, @@ -155,11 +155,11 @@ equation color={28,108,200}, thickness=0.5), Rectangle( - extent={{-60,80},{60,-80}}, + extent={{-80,90},{80,-70}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Line(points={{0,-80},{0,-100}}, color={0,0,0}), + Line(points={{0,-70},{0,-100}}, color={0,0,0}), Ellipse( extent={{-6,-94},{6,-106}}, lineColor={28,108,200}, @@ -167,31 +167,25 @@ equation fillPattern=FillPattern.Solid, lineThickness=0.5), Text( - extent={{-60,80},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("T", String( - T, - format="1."+String(digits)+"f"))), + extent={{-80,86},{80,38}}, + textColor={0,0,0}, + textString=DynamicSelect(" T ", " "+String(T,significantDigits=digits)+" ")), Text( - extent={{-60,30},{60,-20}}, - textColor={28,108,200}, - textString=DynamicSelect("p", String( - p, - format="1."+String(digits)+"f"))), + extent={{-80,34},{80,-14}}, + textColor={0,0,0}, + textString=DynamicSelect(" p ", " "+String(p,significantDigits=digits)+" ")), Text( - extent={{-60,-20},{60,-70}}, - textColor={28,108,200}, - textString=DynamicSelect("m", String( - m_flow, - format="1."+String(digits)+"f"))), + extent={{-80,-18},{80,-66}}, + textColor={0,0,0}, + textString=DynamicSelect(" m ", " "+String(m_flow,significantDigits=digits)+" ")), Line(visible=outputTemperature, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127}), Line(visible=outputPressure, - points={{60,0},{78,0}}, + points={{80,0},{100,0}}, color={0,0,127}), Line(visible=outputMassFlowRate, - points={{60,-60},{78,-60}}, + points={{80,-60},{100,-60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/SensorState.mo b/ThermofluidStream/Sensors/SensorState.mo index 2a6879e7..a1086e83 100644 --- a/ThermofluidStream/Sensors/SensorState.mo +++ b/ThermofluidStream/Sensors/SensorState.mo @@ -9,41 +9,37 @@ model SensorState "Sensor for thermodynamic state"Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); Interfaces.Inlet inlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,0}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Interfaces.StateOutput state_out(redeclare package Medium = Medium) "State output connector" - annotation (Placement(transformation(extent={{70,-10},{90,10}}), iconTransformation(extent={{70,-10},{90,10}}))); + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); equation inlet.m_flow = 0; state_out.state = inlet.state; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="stateSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,80},{150,40}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,24},{66,-36}}, + extent={{-74,24},{86,-36}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{0,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,30},{60,-30}}, + extent={{-80,30},{80,-30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-60,30},{60,-30}}, - textColor={28,108,200}, - textString="state"), + extent={{-80,15},{80,-15}}, + textColor={0,0,0}, + textString=" state "), Line( - points={{60,0},{78,0}}, + points={{80,0},{100,0}}, color={162,29,33})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/SingleFlowSensor.mo b/ThermofluidStream/Sensors/SingleFlowSensor.mo index 15dfbe24..13189c6b 100644 --- a/ThermofluidStream/Sensors/SingleFlowSensor.mo +++ b/ThermofluidStream/Sensors/SingleFlowSensor.mo @@ -12,7 +12,7 @@ model SingleFlowSensor "Flow rate sensor"Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter Quantities quantity "Measured quantity"; final parameter String quantityString= @@ -24,6 +24,8 @@ model SingleFlowSensor "Flow rate sensor" elseif quantity == ThermofluidStream.Sensors.Internal.Types.MassFlowQuantities.S_flow_JpKs then "S_flow in W/K" elseif quantity == ThermofluidStream.Sensors.Internal.Types.MassFlowQuantities.Cp_flow_JpKs then "Cp_flow in W/K" else "error"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter SI.Density rho_min = dropOfCommons.rho_min "Minimum density" annotation(Dialog(tab="Advanced", group="Regularization")); @@ -39,14 +41,11 @@ model SingleFlowSensor "Flow rate sensor" annotation(Dialog(group="Output", enable=outputValue and filter_output and init==InitMode.state)); Interfaces.Inlet inlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{-120,-20},{-80,20}}), - iconTransformation(extent={{-120,-20},{-80,20}}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Interfaces.Outlet outlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{80,-20},{120,20}}), - iconTransformation(extent={{80,-20},{120,20}}))); + annotation (Placement(transformation(extent={{80,-20},{120,20}}))); Modelica.Blocks.Interfaces.RealOutput value_out(unit=Internal.getFlowUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement(transformation(extent={{70,50},{90,70}}), - iconTransformation(extent={{70,50},{90,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); output Real value(unit=Internal.getFlowUnit(quantity)); @@ -79,13 +78,13 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="flowSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-25},{150,-65}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,84},{66,24}}, + extent={{-74,84},{86,24}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, @@ -102,22 +101,29 @@ equation fillPattern=FillPattern.Solid, lineThickness=0.5), Rectangle( - extent={{-60,90},{60,30}}, + extent={{-80,90},{80,30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,90},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String( - value, - format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,86},{80,34}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,130},{150,100}}, textColor={0,0,0}, textString=quantityString), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,75},{250,45}}, + textColor={0,0,0}, + textString=quantityString), + Text(visible = adaptDisplay and outputValue, + extent={{-80,75},{80,45}}, + textColor={0,0,0}, + textString=" "+quantityString+" "), Line(visible=outputValue, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/SingleSensorSelect.mo b/ThermofluidStream/Sensors/SingleSensorSelect.mo index 337c1b7a..497b4adb 100644 --- a/ThermofluidStream/Sensors/SingleSensorSelect.mo +++ b/ThermofluidStream/Sensors/SingleSensorSelect.mo @@ -11,7 +11,7 @@ model SingleSensorSelect "Selectable sensor" Documentation(info="Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter SI.Density rho_min = dropOfCommons.rho_min "Minimum density" annotation(Dialog(tab="Advanced", group="Regularization")); parameter Quantities quantity "Measured quantity"; @@ -35,6 +35,8 @@ model SingleSensorSelect "Selectable sensor" elseif quantity == ThermofluidStream.Sensors.Internal.Types.Quantities.p_total_Pa then "(p+r) in Pa" elseif quantity == ThermofluidStream.Sensors.Internal.Types.Quantities.p_total_bar then "(p+r) in bar" else "error"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter Boolean outputValue = false "= true, if sensor output is enabled" annotation(Dialog(group="Output"),Evaluate=true, HideResult=true, choices(checkBox=true)); @@ -48,9 +50,9 @@ model SingleSensorSelect "Selectable sensor" annotation(Dialog(group="Output", enable= outputValue and filter_output and init==InitMode.state)); Interfaces.Inlet inlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,0}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Modelica.Blocks.Interfaces.RealOutput value_out(unit=Internal.getUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement(transformation(extent={{72,-10},{92,10}}), iconTransformation(extent={{72,-10},{92,10}}))); + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); output Real value(unit=Internal.getUnit(quantity)) "Computed value of the selected quantity"; @@ -79,38 +81,41 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensor", Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,80},{150,40}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,24},{66,-36}}, + extent={{-74,24},{86,-36}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{0,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,30},{60,-30}}, + extent={{-80,30},{80,-30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,30},{60,-30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String( - value, - format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,26},{80,-26}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,-70},{150,-40}}, textColor={0,0,0}, textString=quantityString), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,15},{250,-15}}, + textColor={0,0,0}, + textString=quantityString), + Text(visible = adaptDisplay and outputValue, + extent={{-80,15},{80,-15}}, + textColor={0,0,0}, + textString=" "+quantityString+" "), Line(visible=outputValue, - points={{60,0},{78,0}}, + points={{80,0},{100,0}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/SingleSensorX.mo b/ThermofluidStream/Sensors/SingleSensorX.mo index 39f344af..069f16ac 100644 --- a/ThermofluidStream/Sensors/SingleSensorX.mo +++ b/ThermofluidStream/Sensors/SingleSensorX.mo @@ -10,7 +10,7 @@ model SingleSensorX "Sensor for mass fraction" Documentation(info="Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter Boolean outputValue = false "= true, if sensor output is enabled" annotation(Dialog(group="Output"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter Boolean filter_output = false "= true, if sensor output is filtered (to break algebraic loops)" @@ -24,10 +24,13 @@ model SingleSensorX "Sensor for mass fraction" parameter Integer row(min=1, max=Medium.nX) = 1 "Row of meassured mass fraction"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); + Interfaces.Inlet inlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,0}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Modelica.Blocks.Interfaces.RealOutput value_out[Medium.nX](each unit="kg/kg") = value if outputValue "Mass fraction output connector" - annotation (Placement(transformation(extent={{70,-10},{90,10}}), iconTransformation(extent={{70,-10},{90,10}}))); + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); output Real value[Medium.nX](each unit="kg/kg") "Computed value of the selected quantity"; output Real display_value(unit="kg/kg") = value[row] "Row of the value vector to display"; @@ -61,38 +64,41 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="massFractionSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,80},{150,40}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,24},{66,-36}}, + extent={{-74,24},{86,-36}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{0,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,30},{60,-30}}, + extent={{-80,30},{80,-30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,30},{60,-30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String( - display_value, - format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,26},{80,-26}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(display_value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,-70},{150,-40}}, textColor={0,0,0}, textString="X[%row] in kg/kg"), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,15},{250,-15}}, + textColor={0,0,0}, + textString="X[%row] in kg/kg"), + Text(visible = adaptDisplay and outputValue, + extent={{-80,15},{80,-15}}, + textColor={0,0,0}, + textString=" X[%row] in kg/kg "), Line(visible=outputValue, - points={{60,0},{78,0}}, + points={{80,0},{100,0}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Sensors/TwoPhaseSensorSelect.mo b/ThermofluidStream/Sensors/TwoPhaseSensorSelect.mo index 9f34f557..73c2145e 100644 --- a/ThermofluidStream/Sensors/TwoPhaseSensorSelect.mo +++ b/ThermofluidStream/Sensors/TwoPhaseSensorSelect.mo @@ -11,7 +11,7 @@ model TwoPhaseSensorSelect "Selectable Sensor for two phase medium" Documentation(info="Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter Quantities quantity "Measured quantity"; final parameter String quantityString= @@ -24,6 +24,8 @@ model TwoPhaseSensorSelect "Selectable Sensor for two phase medium" elseif quantity == ThermofluidStream.Sensors.Internal.Types.TwoPhaseQuantities.p_oversat_Pa then "p - p_sat in Pa" elseif quantity == ThermofluidStream.Sensors.Internal.Types.TwoPhaseQuantities.p_oversat_bar then "p - p_sat in bar" else "error"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter Boolean outputValue = false "= true, if sensor output is enabled" annotation(Dialog(group="Output"),Evaluate=true, HideResult=true, choices(checkBox=true)); @@ -37,9 +39,9 @@ model TwoPhaseSensorSelect "Selectable Sensor for two phase medium" annotation(Dialog(group="Output", enable=outputValue and filter_output and init==InitMode.state)); Interfaces.Inlet inlet(redeclare package Medium=Medium) - annotation (Placement(transformation(extent={{-20, -20},{20, 20}}, origin={-100,0}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Modelica.Blocks.Interfaces.RealOutput value_out(unit=Internal.getTwoPhaseUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement(transformation(extent={{70,-10},{90,10}}), iconTransformation(extent={{70,-10},{90,10}}))); + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); output Real value(unit=Internal.getTwoPhaseUnit(quantity)) "Computed value of the selected quantity [variable]"; @@ -68,38 +70,41 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,80},{150,40}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,24},{66,-36}}, + extent={{-74,24},{86,-36}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), - Line( - points={{-100,0},{0,0}}, - color={28,108,200}, - thickness=0.5), Rectangle( - extent={{-60,30},{60,-30}}, + extent={{-80,30},{80,-30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,30},{60,-30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String( - value, - format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,26},{80,-26}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,-70},{150,-40}}, textColor={0,0,0}, textString=quantityString), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,15},{250,-15}}, + textColor={0,0,0}, + textString=quantityString), + Text(visible = adaptDisplay and outputValue, + extent={{-80,15},{80,-15}}, + textColor={0,0,0}, + textString=" "+quantityString+" "), Line(visible=outputValue, - points={{60,0},{78,0}}, + points={{80,0},{100,0}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Undirected/Sensors/Internal/PartialSensor.mo b/ThermofluidStream/Undirected/Sensors/Internal/PartialSensor.mo index ffd1c1fd..10561053 100644 --- a/ThermofluidStream/Undirected/Sensors/Internal/PartialSensor.mo +++ b/ThermofluidStream/Undirected/Sensors/Internal/PartialSensor.mo @@ -8,15 +8,15 @@ partial model PartialSensor "Partial undirected sensor" info="Replaceable medium package for the sensor.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits" + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed" annotation(Dialog(group="Sensor display")); parameter SI.MassFlowRate m_flow_reg = dropOfCommons.m_flow_reg "Regularization threshold of mass flow rate" annotation(Dialog(tab="Advanced", group="Regularization")); Interfaces.Rear rear(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, origin={-100,-80}), iconTransformation(extent={{-120,-20},{-80,20}}))); + annotation (Placement(transformation(extent={{-120,-20},{-80,20}}))); Interfaces.Fore fore(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, origin={100,-80}), iconTransformation(extent={{80,-20},{120,20}}))); + annotation (Placement(transformation(extent={{80,-20},{120,20}}))); /* function regStepSt = Undirected.Internal.regStepState ( redeclare package Medium = Medium) "RegStep function for a state" diff --git a/ThermofluidStream/Undirected/Sensors/MultiSensor_Tpm.mo b/ThermofluidStream/Undirected/Sensors/MultiSensor_Tpm.mo index 200ac674..f5f5d2c8 100644 --- a/ThermofluidStream/Undirected/Sensors/MultiSensor_Tpm.mo +++ b/ThermofluidStream/Undirected/Sensors/MultiSensor_Tpm.mo @@ -9,15 +9,15 @@ model MultiSensor_Tpm "Undirected sensor for Temperature, pressure and mass flowReplaceable medium package for the sensor.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits" + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed" annotation(Dialog(group="Sensor display")); parameter SI.MassFlowRate m_flow_reg = dropOfCommons.m_flow_reg "Regularization threshold of mass flow rate" annotation(Dialog(tab="Advanced", group="Regularization")); Interfaces.Rear rear(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, origin={-100,-100}),iconTransformation(extent={{-120,-120},{-80,-80}}))); + annotation (Placement(transformation(extent={{-120,-120},{-80,-80}}))); Interfaces.Fore fore(redeclare package Medium = Medium) - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, origin={100,-100}),iconTransformation(extent={{80,-120},{120,-80}}))); + annotation (Placement(transformation(extent={{80,-120},{120,-80}}))); /* function regStepSt = Undirected.Internal.regStepState ( redeclare package Medium = Medium) "RegStep function for a state" @@ -73,14 +73,11 @@ public Modelica.Blocks.Interfaces.RealOutput T_out(final quantity="ThermodynamicTemperature", final unit=temperatureUnit) = T if outputTemperature "Temperature output connector" - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, origin={100,60}), - iconTransformation(extent={{70,50},{90,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); Modelica.Blocks.Interfaces.RealOutput p_out(final quantity="Pressure", final unit=pressureUnit) = p if outputPressure "Pressure output connector" - annotation (Placement(transformation(extent={{-10,-10},{10,10}}, origin={82,0}), - iconTransformation(extent={{72,-10},{92,10}}))); + annotation (Placement(transformation(extent={{100,-10},{120,10}}))); Modelica.Blocks.Interfaces.RealOutput m_flow_out(unit="kg/s") = m_flow if outputMassFlowRate "Mass flow rate output connector" - annotation (Placement(transformation(extent={{-20,-20},{20,20}}, origin={100,-60}), - iconTransformation(extent={{72,-70},{92,-50}}))); + annotation (Placement(transformation(extent={{100,-70},{120,-50}}))); output Real p(final quantity="Pressure", final unit=pressureUnit); output Real T(final quantity="ThermodynamicTemperature", final unit=temperatureUnit); @@ -141,71 +138,65 @@ equation m_flow = direct_m_flow; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensorTpm",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-160},{150,-120}}, textString="%name", textColor=dropOfCommons.instanceNameColor), - Text(visible=not outputTemperature, - extent={{150,70},{68,40}}, + Text(visible= not outputTemperature, + extent={{150,77},{90,47}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=not outputPressure, - extent={{150,20},{68,-10}}, + Text(visible= not outputPressure, + extent={{150,25},{90,-5}}, textColor={0,0,0}, textString=pressureUnit, horizontalAlignment=TextAlignment.Left), - Text(visible=not outputMassFlowRate, - extent={{150,-30},{68,-60}}, + Text(visible= not outputMassFlowRate, + extent={{150,-27},{90,-57}}, textColor={0,0,0}, textString=massFlowString, horizontalAlignment=TextAlignment.Left), - Text(visible=outputTemperature, - extent={{150,98},{75,68}}, + Text(visible= outputTemperature, + extent={{155,98},{95,68}}, textColor={0,0,0}, textString=temperatureString, horizontalAlignment=TextAlignment.Left), - Text(visible=outputPressure, - extent={{150,38},{75,8}}, + Text(visible= outputPressure, + extent={{155,38},{95,8}}, textColor={0,0,0}, textString=pressureUnit, horizontalAlignment=TextAlignment.Left), - Text(visible=outputMassFlowRate, - extent={{150,-22},{75,-52}}, + Text(visible= outputMassFlowRate, + extent={{155,-22},{95,-52}}, textColor={0,0,0}, textString=massFlowString, horizontalAlignment=TextAlignment.Left), Rectangle( - extent={{-54,74},{66,-86}}, + extent={{-74,84},{86,-76}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), Rectangle( - extent={{-60,80},{60,-80}}, + extent={{-80,90},{80,-70}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Line(points={{0,-80},{0,-100}},color={0,0,0}), + Line(points={{0,-70},{0,-100}},color={0,0,0}), Text( - extent={{-60,80},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("T", String( - T, - format="1."+String(digits)+"f"))), + extent={{-80,86},{80,38}}, + textColor={0,0,0}, + textString=DynamicSelect(" T ", " "+String(T,significantDigits=digits)+" ")), Text( - extent={{-60,30},{60,-20}}, - textColor={28,108,200}, - textString=DynamicSelect("p", String( - p, - format="1."+String(digits)+"f"))), + extent={{-80,34},{80,-14}}, + textColor={0,0,0}, + textString=DynamicSelect(" p ", " "+String(p,significantDigits=digits)+" ")), Text( - extent={{-60,-20},{60,-70}}, - textColor={28,108,200}, - textString=DynamicSelect("m", String( - m_flow, - format="1."+String(digits)+"f"))), + extent={{-80,-18},{80,-66}}, + textColor={0,0,0}, + textString=DynamicSelect(" m ", " "+String(m_flow,significantDigits=digits)+" ")), Line( points={{-100,-100},{100,-100}}, color={28,108,200}, @@ -217,13 +208,13 @@ equation fillPattern=FillPattern.Solid, lineThickness=0.5), Line(visible=outputTemperature, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127}), Line(visible=outputPressure, - points={{60,0},{78,0}}, + points={{80,0},{100,0}}, color={0,0,127}), Line(visible=outputMassFlowRate, - points={{60,-60},{78,-60}}, + points={{80,-60},{100,-60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Undirected/Sensors/SensorState.mo b/ThermofluidStream/Undirected/Sensors/SensorState.mo index e29254e8..96c027a0 100644 --- a/ThermofluidStream/Undirected/Sensors/SensorState.mo +++ b/ThermofluidStream/Undirected/Sensors/SensorState.mo @@ -10,33 +10,33 @@ model SensorState "State sensor" ")); ThermofluidStream.Interfaces.StateOutput state_out(redeclare package Medium = Medium) "State output connector" - annotation (Placement(transformation(extent={{70,50},{90,70}}), iconTransformation(extent={{70,50},{90,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); equation state_out.state = state; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="stateSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-25},{150,-65}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,84},{66,24}}, + extent={{-74,84},{86,24}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), Line(points={{0,34},{0,0}}, color={0,0,0}), Rectangle( - extent={{-60,90},{60,30}}, + extent={{-80,90},{80,30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), Text( - extent={{-60,90},{60,30}}, - textColor={28,108,200}, - textString="state"), + extent={{-80,75},{80,45}}, + textColor={0,0,0}, + textString=" state "), Ellipse( extent={{-5,5},{5,-5}}, lineColor={28,108,200}, @@ -44,7 +44,7 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.Solid), Line( - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={162,29,33})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Undirected/Sensors/SingleFlowSensor.mo b/ThermofluidStream/Undirected/Sensors/SingleFlowSensor.mo index ce0f1944..7a567fff 100644 --- a/ThermofluidStream/Undirected/Sensors/SingleFlowSensor.mo +++ b/ThermofluidStream/Undirected/Sensors/SingleFlowSensor.mo @@ -17,6 +17,8 @@ model SingleFlowSensor "Flow sensor" elseif quantity == ThermofluidStream.Sensors.Internal.Types.MassFlowQuantities.S_flow_JpKs then "S_flow in J/(K.s)" elseif quantity == ThermofluidStream.Sensors.Internal.Types.MassFlowQuantities.Cp_flow_JpKs then "Cp_flow in J/(K.s)" else "error"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter SI.Density rho_min = dropOfCommons.rho_min "Minimum Density" annotation(Dialog(tab="Advanced", group="Regularization")); @@ -32,8 +34,7 @@ model SingleFlowSensor "Flow sensor" annotation(Dialog(group="Output", enable=outputValue and filter_output and init==InitMode.state)); Modelica.Blocks.Interfaces.RealOutput value_out(unit=ThermofluidStream.Sensors.Internal.getFlowUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement(transformation(extent={{70,50},{90,70}}), - iconTransformation(extent={{70,50},{90,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); output Real value(unit=ThermofluidStream.Sensors.Internal.getFlowUnit(quantity)); @@ -62,30 +63,39 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="flowSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-25},{150,-65}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,84},{66,24}}, + extent={{-74,84},{86,24}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), Rectangle( - extent={{-60,90},{60,30}}, + extent={{-80,90},{80,30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,90},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String(value, format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,86},{80,34}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,130},{150,100}}, textColor={0,0,0}, textString=quantityString), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,75},{250,45}}, + textColor={0,0,0}, + textString=quantityString), + Text(visible = adaptDisplay and outputValue, + extent={{-80,75},{80,45}}, + textColor={0,0,0}, + textString=" "+quantityString+" "), Line(points={{0,30},{0,0}}, color={0,0,0}), Ellipse( extent={{-6,6},{6,-6}}, @@ -94,7 +104,7 @@ equation fillPattern=FillPattern.Solid, lineThickness=0.5), Line(visible=outputValue, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Undirected/Sensors/SingleSensorSelect.mo b/ThermofluidStream/Undirected/Sensors/SingleSensorSelect.mo index 87a8b641..7d3df65b 100644 --- a/ThermofluidStream/Undirected/Sensors/SingleSensorSelect.mo +++ b/ThermofluidStream/Undirected/Sensors/SingleSensorSelect.mo @@ -26,6 +26,8 @@ model SingleSensorSelect "Selectable sensor" elseif quantity == ThermofluidStream.Sensors.Internal.Types.Quantities.p_total_Pa then "(p+r) in Pa" elseif quantity == ThermofluidStream.Sensors.Internal.Types.Quantities.p_total_bar then "(p+r) in bar" else "error"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter SI.Density rho_min = dropOfCommons.rho_min "Minimum density" annotation(Dialog(tab="Advanced", group="Regularization")); @@ -44,9 +46,7 @@ model SingleSensorSelect "Selectable sensor" Modelica.Blocks.Interfaces.RealOutput value_out(unit=ThermofluidStream.Sensors.Internal.getUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement( - transformation(extent={{70,50},{90,70}}), - iconTransformation(extent={{70,50},{90,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); function getQuantity = ThermofluidStream.Sensors.Internal.getQuantity ( redeclare package Medium = Medium) "Quantity compute function" @@ -77,31 +77,40 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensor", Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-25},{150,-65}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,84},{66,24}}, + extent={{-74,84},{86,24}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), Line(points={{0,34},{0,0}}, color={0,0,0}), Rectangle( - extent={{-60,90},{60,30}}, + extent={{-80,90},{80,30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,90},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String(value, format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,86},{80,34}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,130},{150,100}}, textColor={0,0,0}, textString=quantityString), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,75},{250,45}}, + textColor={0,0,0}, + textString=quantityString), + Text(visible = adaptDisplay and outputValue, + extent={{-80,75},{80,45}}, + textColor={0,0,0}, + textString=" "+quantityString+" "), Ellipse( extent={{-5,5},{5,-5}}, lineColor={28,108,200}, @@ -109,7 +118,7 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.Solid), Line(visible=outputValue, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Undirected/Sensors/SingleSensorX.mo b/ThermofluidStream/Undirected/Sensors/SingleSensorX.mo index 88af3279..be1aaa96 100644 --- a/ThermofluidStream/Undirected/Sensors/SingleSensorX.mo +++ b/ThermofluidStream/Undirected/Sensors/SingleSensorX.mo @@ -10,7 +10,7 @@ model SingleSensorX "Mass fractions sensor"Medium Model for the sensor. Make sure it is the same as for all lines the sensors input is connected.
")); - parameter Integer digits(min=0) = 1 "Number of displayed digits"; + parameter Integer digits(final min=0) = 3 "Number of significant digits to be displayed"; parameter Boolean outputValue = false "= true, if sensor output is enabled" annotation(Dialog(group="Output"),Evaluate=true, HideResult=true, choices(checkBox=true)); @@ -25,8 +25,11 @@ model SingleSensorX "Mass fractions sensor" parameter Integer row(min=1, max=Medium.nX) = 1 "Row of mass fraction vector to display"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); + Modelica.Blocks.Interfaces.RealOutput value_out[Medium.nX](each unit="kg/kg") = value if outputValue "Measured value [variable]" - annotation (Placement(transformation(extent={{72,50},{92,70}}), iconTransformation(extent={{72,50},{92,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); output Real value[Medium.nX](each unit="kg/kg") "Computed value of the selected Quantity"; output Real display_value(unit="kg/kg") = value[row] "Row of the value vector to display"; @@ -63,31 +66,40 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="massFractionSensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-25},{150,-65}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,84},{66,24}}, + extent={{-74,84},{86,24}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), Line(points={{0,34},{0,0}}, color={0,0,0}), Rectangle( - extent={{-60,90},{60,30}}, + extent={{-80,86},{80,34}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,90},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String(display_value, format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,86},{80,34}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(display_value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,130},{150,100}}, textColor={0,0,0}, textString="X[%row] in kg/kg"), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,75},{250,45}}, + textColor={0,0,0}, + textString="X[%row] in kg/kg"), + Text(visible = adaptDisplay and outputValue, + extent={{-80,75},{80,45}}, + textColor={0,0,0}, + textString=" X[%row] in kg/kg "), Ellipse( extent={{-5,5},{5,-5}}, lineColor={28,108,200}, @@ -95,7 +107,7 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.Solid), Line(visible=outputValue, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info=" diff --git a/ThermofluidStream/Undirected/Sensors/TwoPhaseSensorSelect.mo b/ThermofluidStream/Undirected/Sensors/TwoPhaseSensorSelect.mo index b1379aae..e78a2032 100644 --- a/ThermofluidStream/Undirected/Sensors/TwoPhaseSensorSelect.mo +++ b/ThermofluidStream/Undirected/Sensors/TwoPhaseSensorSelect.mo @@ -23,6 +23,9 @@ model TwoPhaseSensorSelect "Selectable sensor for two phase medium" elseif quantity == ThermofluidStream.Sensors.Internal.Types.TwoPhaseQuantities.p_oversat_Pa then "p - p_sat in Pa" elseif quantity == ThermofluidStream.Sensors.Internal.Types.TwoPhaseQuantities.p_oversat_bar then "p - p_sat in bar" else "error"; + parameter Boolean adaptDisplay = false "=false, for standard display, =true if display is adapted" + annotation(Dialog(tab="Layout",group="Display parameters"),Evaluate=true, HideResult=true, choices(checkBox=true)); + parameter Boolean outputValue = false "= true, if sensor output is enabled" annotation(Dialog(group="Output"),Evaluate=true, HideResult=true, choices(checkBox=true)); parameter Boolean filter_output = false "= true, if sensor output is filtered (to break algebraic loops)" @@ -35,9 +38,7 @@ model TwoPhaseSensorSelect "Selectable sensor for two phase medium" annotation(Dialog(group="Output", enable=outputValue and filter_output and init==InitMode.state)); Modelica.Blocks.Interfaces.RealOutput value_out(unit=ThermofluidStream.Sensors.Internal.getTwoPhaseUnit(quantity)) = value if outputValue "Sensor output connector" - annotation (Placement( - transformation(extent={{70,50},{90,70}}), - iconTransformation(extent={{70,50},{90,70}}))); + annotation (Placement(transformation(extent={{100,50},{120,70}}))); Real value(unit=ThermofluidStream.Sensors.Internal.getTwoPhaseUnit(quantity)); @@ -67,31 +68,40 @@ equation value = direct_value; end if; - annotation (Icon(coordinateSystem(preserveAspectRatio=true), graphics={ + annotation (defaultComponentName ="sensor",Icon(coordinateSystem(preserveAspectRatio=true), graphics={ Text(visible=displayInstanceName, extent={{-150,-25},{150,-65}}, textString="%name", textColor=dropOfCommons.instanceNameColor), Rectangle( - extent={{-54,84},{66,24}}, + extent={{-74,84},{86,24}}, lineColor={0,0,0}, fillColor={215,215,215}, fillPattern=FillPattern.Solid, pattern=LinePattern.None), Line(points={{0,34},{0,0}}, color={0,0,0}), Rectangle( - extent={{-60,90},{60,30}}, + extent={{-80,90},{80,30}}, lineColor={0,0,0}, fillColor={255,255,255}, fillPattern=FillPattern.Solid), - Text( - extent={{-60,90},{60,30}}, - textColor={28,108,200}, - textString=DynamicSelect("value", String(value, format="1."+String(digits)+"f"))), - Text( + Text(visible = not outputValue or (outputValue and not adaptDisplay), + extent={{-80,86},{80,34}}, + textColor={0,0,0}, + textString=DynamicSelect(" 0.0 ", " "+String(value,significantDigits=digits)+" ")), + Text(visible = not adaptDisplay, extent={{-150,130},{150,100}}, textColor={0,0,0}, textString=quantityString), + Text(visible = adaptDisplay and not outputValue, + horizontalAlignment=TextAlignment.Left, + extent={{90,75},{250,45}}, + textColor={0,0,0}, + textString=quantityString), + Text(visible = adaptDisplay and outputValue, + extent={{-80,75},{80,45}}, + textColor={0,0,0}, + textString=" "+quantityString+" "), Ellipse( extent={{-5,5},{5,-5}}, lineColor={28,108,200}, @@ -99,7 +109,7 @@ equation fillColor={255,255,255}, fillPattern=FillPattern.Solid), Line(visible=outputValue, - points={{60,60},{78,60}}, + points={{80,60},{100,60}}, color={0,0,127})}), Diagram(coordinateSystem(preserveAspectRatio=true)), Documentation(info="