From 2b643d4a67c5b946cf8e625f3fc136718e5877bd Mon Sep 17 00:00:00 2001 From: HOS Date: Thu, 2 Nov 2023 13:50:57 +0100 Subject: [PATCH] Use protected as a heading for a number of declarations. I believe that the previous formatting in Digitial is due to someone having protected A protected B protected C (which would be another style). Then the subsequent protected were lost, and first protected formatted on a separate line. --- .../RealSignals/TimeBasedSources/Sine.mo | 3 +- Modelica/Electrical/Digital.mo | 42 +++++++++---------- 2 files changed, 20 insertions(+), 25 deletions(-) diff --git a/Modelica/Clocked/RealSignals/TimeBasedSources/Sine.mo b/Modelica/Clocked/RealSignals/TimeBasedSources/Sine.mo index 65204c38ee..cb69ebef89 100644 --- a/Modelica/Clocked/RealSignals/TimeBasedSources/Sine.mo +++ b/Modelica/Clocked/RealSignals/TimeBasedSources/Sine.mo @@ -10,8 +10,7 @@ block Sine "Generate sine signal" "Output = offset for time < startTime"; protected constant Real pi=Modelica.Constants.pi; -protected - SI.Time simTime; + SI.Time simTime; equation simTime = sample(time); y = offset + (if simTime < startTime then 0 else amplitude* diff --git a/Modelica/Electrical/Digital.mo b/Modelica/Electrical/Digital.mo index ecd490a3c6..f4a6d9542a 100644 --- a/Modelica/Electrical/Digital.mo +++ b/Modelica/Electrical/Digital.mo @@ -6112,9 +6112,9 @@ NC = no change annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); protected - D.Interfaces.Logic nextstate(start=L.'U'); - D.Interfaces.DigitalOutput yy(start=L.'U'); - D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL,y(start=L.'U', fixed=true)); + D.Interfaces.Logic nextstate(start=L.'U'); + D.Interfaces.DigitalOutput yy(start=L.'U'); + D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL,y(start=L.'U', fixed=true)); algorithm nextstate := T.NXferTable[enable, x]; yy := nextstate; @@ -6194,9 +6194,9 @@ UX: if dataIn == U then U else X annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); protected - D.Interfaces.Logic nextstate(start=L.'U'); - D.Interfaces.DigitalOutput yy(start=L.'U'); - D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL, y(start=L.'U', fixed=true)); + D.Interfaces.Logic nextstate(start=L.'U'); + D.Interfaces.DigitalOutput yy(start=L.'U'); + D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL, y(start=L.'U', fixed=true)); algorithm nextstate := T.NRXferTable[enable, x]; yy := nextstate; @@ -6276,9 +6276,9 @@ Strength Reduced: 0 -> L, 1 -> H, X -> W annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); protected - D.Interfaces.Logic nextstate(start=L.'U'); - D.Interfaces.DigitalOutput yy(start=L.'U'); - D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL); + D.Interfaces.Logic nextstate(start=L.'U'); + D.Interfaces.DigitalOutput yy(start=L.'U'); + D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL); algorithm nextstate := T.PXferTable[enable, x]; yy := nextstate; @@ -6357,8 +6357,7 @@ UX: if dataIn == U then U else X D.Interfaces.DigitalOutput y annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); - protected - D.Interfaces.Logic nextstate(start=L.'U'); + protected D.Interfaces.Logic nextstate(start=L.'U'); D.Interfaces.DigitalOutput yy(start=L.'U'); D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL); algorithm @@ -6439,8 +6438,7 @@ UX: if dataIn == U then U else X D.Interfaces.DigitalOutput y annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); - protected - D.Interfaces.Logic nextstate(start=L.'U'); + protected D.Interfaces.Logic nextstate(start=L.'U'); D.Interfaces.DigitalOutput yy(start=L.'U'); D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL, y(start=L.'U', fixed=true)); algorithm @@ -6518,8 +6516,7 @@ DataOut*: Strength map for DataOut according to tristate table Buf3sTable D.Interfaces.DigitalOutput y annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); - protected - D.Interfaces.Logic nextstate(start=L.'U'); + protected D.Interfaces.Logic nextstate(start=L.'U'); D.Interfaces.DigitalOutput yy(start=L.'U'); D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL); algorithm @@ -6597,8 +6594,7 @@ DataOut*: Strength map for DataOut according to tristate table Buf3slTable D.Interfaces.DigitalOutput y annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); - protected - D.Interfaces.Logic nextstate(start=L.'U'); + protected D.Interfaces.Logic nextstate(start=L.'U'); D.Interfaces.DigitalOutput yy(start=L.'U'); D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL, y(start=L.'U',fixed=true)); algorithm @@ -6682,9 +6678,9 @@ DataOut*: Strength map for DataOut according to tristate table Buf3sTable annotation (Placement(transformation(extent={{80,-20},{100,0}}), iconTransformation(extent={{80,-20},{100,0}}))); protected - D.Interfaces.Logic nextstate(start=L.'U'); - D.Interfaces.DigitalOutput yy(start=L.'U'); - D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL); + D.Interfaces.Logic nextstate(start=L.'U'); + D.Interfaces.DigitalOutput yy(start=L.'U'); + D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL); algorithm nextstate := T.Buf3sTable[strength, T.UX01Conv[T.NotTable[enable]], T.UX01Conv[T.NotTable[x]]]; yy := nextstate; @@ -7004,9 +7000,9 @@ Z = L.'Z' iconTransformation(extent={{80,-10},{100,10}}))); protected - D.Interfaces.Logic nextstate(start=L.'U'); - D.Interfaces.DigitalOutput yy(start=L.'U'); - D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL, y(start=L.'U',fixed=true)); + D.Interfaces.Logic nextstate(start=L.'U'); + D.Interfaces.DigitalOutput yy(start=L.'U'); + D.Delay.InertialDelaySensitive inertialDelaySensitive(tLH=tLH, tHL=tHL, y(start=L.'U',fixed=true)); algorithm nextstate := T.MUX2x1Table[T.UX01Conv[in1], T.UX01Conv[sel], T.UX01Conv[in0]];