Skip to content

Commit

Permalink
Formal clean up of all code files:
Browse files Browse the repository at this point in the history
 * applied svn:eol-style native to all files except Compiler/*.mo --> LF
 * unified the eol-style of ALL files (this was necessary in order to set the svn properties
 * unification was done by a script which also removed all trailing whitespaces (except for all files in testsuite as white spaces are necessary to successful compare the results, could be improved maybe)
 * make clean all test --> success on Ubuntu Linux 8.10, proably a good idea to run it for the other platforms as well.
 * FYI: script to remove trailing white spaces: http://is.gd/5A6B

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk/OMNotebook/DrModelica@3732 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
dietmarw committed Nov 2, 2008
1 parent 06ca1bc commit 6e72648
Show file tree
Hide file tree
Showing 143 changed files with 673 additions and 673 deletions.
4 changes: 2 additions & 2 deletions AccessControl/AccessDemo.onb
Expand Up @@ -25,12 +25,12 @@
parameter Real w, u;
Real u2;
public Real u3;
equation
equation
x = 2; // Legal, since code inside the class
z = 5; // Legal, since code inside the class
u2 = 5; // Legal, since code inside the class
u3 = 8; // Legal, since code inside the class
end AccessDemo;
end AccessDemo;
</Input>
<Output>Ok</Output>
</InputCell>
Expand Down
2 changes: 1 addition & 1 deletion AccessControl/Exercise1.onb
Expand Up @@ -47,7 +47,7 @@ equation
b = 2.0;
c = 1.3;
d = 5;
e = 7;
e = 7;
end Access;</Input>
<Output>Ok</Output>
</InputCell>
Expand Down
2 changes: 1 addition & 1 deletion AccessControl/MoonLanding.onb
Expand Up @@ -69,7 +69,7 @@ end Rocket; </Input>
<Input>class MoonLanding
parameter Real force1 = 36350; // These variables are by default public
parameter Real force2 = 1308;
protected // These variables are protected
protected // These variables are protected
parameter Real thrustEndTime = 210;
parameter Real thrustDecreaseTime = 43.2;
public // These variables are public
Expand Down
2 changes: 1 addition & 1 deletion Algorithms/Assert.onb
Expand Up @@ -14,7 +14,7 @@
parameter Real highlimit;
Real x = 5;
algorithm
assert(x >= lowlimit and x &lt;= highlimit, "Variable x out of limit");
assert(x >= lowlimit and x &lt;= highlimit, "Variable x out of limit");
end AssertTest;</Input>
<Output>Ok</Output>
</InputCell>
Expand Down
18 changes: 9 additions & 9 deletions Algorithms/Exercise1.onb
Expand Up @@ -45,7 +45,7 @@
algorithm
for i in 1:size(x,1) loop
sum := sum + x[i];
end for;
end for;
end mySum;</Input>
<Output>Ok</Output>
</InputCell>
Expand All @@ -61,7 +61,7 @@ end mySum;</Input>
<InputCell style="Input" closed="false" >
<Input>function average
input Real[:] x;
output Real average;
output Real average;
algorithm
average := mySum(x) / size(x,1);
end average;</Input>
Expand All @@ -70,11 +70,11 @@ end average;</Input>
<InputCell style="Input" closed="false" >
<Input>average({2.0,3.0,4.0}) // ??Works, even though it gives an error message</Input>
<Output>3.0
OMC-ERROR:
OMC-ERROR:
"Class mySum (its type) not found in scope average.
No matching function found for mySum, candidates are
No matching function found for mySum, candidates are
Class mySum not found in scope average.
No matching function found for mySum, candidates are
No matching function found for mySum, candidates are
Class mySum not found in scope average.
Class mySum not found in scope global scope.
"</Output>
Expand Down Expand Up @@ -111,13 +111,13 @@ end LargestAverage; </Input>
<Output>record
resultFile = "Simulation failed.
Class mySum (its type) not found in scope average.
No matching function found for mySum, candidates are
No matching function found for mySum, candidates are
Class mySum not found in scope average.
No matching function found for mySum, candidates are
No matching function found for mySum, candidates are
Class mySum not found in scope average.
No matching function found for mySum, candidates are
No matching function found for mySum, candidates are
Class mySum not found in scope average.
No matching function found for mySum, candidates are
No matching function found for mySum, candidates are
Class mySum not found in scope average.
"
end record</Output>
Expand Down
8 changes: 4 additions & 4 deletions Algorithms/Exercise2.onb
Expand Up @@ -44,10 +44,10 @@ algorithm
place := 1;
for i in 2:size(A, 1) loop
if A[i] &lt; smallest then
smallest := A[i];
place := i;
end if;
end for;
smallest := A[i];
place := i;
end if;
end for;
end FindSmallest;</Input>
<Output>Ok</Output>
</InputCell>
Expand Down
4 changes: 2 additions & 2 deletions Algorithms/Exercise3.onb
Expand Up @@ -40,10 +40,10 @@
constant Real e = 0.000001;
Real sum(start = 0);
Real next(start = 1.0);
Integer k(start = 1);
Integer k(start = 1);
Integer posneg(start = 1); // if the sign in front of the term is + or -
algorithm
while noEvent(abs(next)) >= e loop
while noEvent(abs(next)) >= e loop
sum := sum + next; // Add the sum to the next term
k := k + 1; // calculate a new next
posneg := - posneg;
Expand Down
14 changes: 7 additions & 7 deletions Algorithms/Exercise4.onb
Expand Up @@ -44,12 +44,12 @@
Boolean on;
algorithm
when sample(5, 5) then
if rem(time, 5) == 0 then
if rem(time, 5) == 0 then
on := true;
else
on := false;
on := false;
end if;
end when;
end when;
end LightSwitch;</Input>
<Output></Output>
</InputCell>
Expand Down Expand Up @@ -85,12 +85,12 @@ algorithm
when time &lt; 5 or time >= 25 then
on := false;
elsewhen sample(5, 1) then
if rem(time, 5) == 0 then
if rem(time, 5) == 0 then
on := true;
else
on := false;
end if;
end when;
on := false;
end if;
end when;
end LightSwitchExtended;</Input>
<Output></Output>
</InputCell>
Expand Down
4 changes: 2 additions & 2 deletions Algorithms/Exercise5.onb
Expand Up @@ -47,8 +47,8 @@ equation
algorithm
when position1 >= position2 then
reinit(velocity1, -c*velocity1);
reinit(velocity2, -c*velocity2);
end when;
reinit(velocity2, -c*velocity2);
end when;
end BilliardBalls;</Input>
<Output></Output>
</InputCell>
Expand Down
8 changes: 4 additions & 4 deletions Algorithms/ForStat.onb
Expand Up @@ -21,8 +21,8 @@ algorithm
sum := 0;
for i in 1:n loop
sum := sum + z[i];
end for;
end SumZ;
end for;
end SumZ;
</Input>
<Output></Output>
</InputCell>
Expand Down Expand Up @@ -53,8 +53,8 @@ end SumZ;
algorithm
for k in 1:k+1 loop // The iteration variable k gets values 1, 2, 3, 4, 5
z[k] := k;
end for;
end HideVariable;
end for;
end HideVariable;
</Input>
<Output></Output>
</InputCell>
Expand Down
20 changes: 10 additions & 10 deletions Algorithms/IfStat.onb
Expand Up @@ -42,10 +42,10 @@ algorithm
elseif v[i] > -1 then
sum := sum + v[i] - 1;
else
sum := sum - v[i];
sum := sum - v[i];
end if;
end for;
end SumVector;
end SumVector;
</Input>
<Output></Output>
</InputCell>
Expand Down Expand Up @@ -90,13 +90,13 @@ end SumVector;
Real y(start = 45);
parameter Real z := 0;
algorithm
if x > 5 then
x := 400;
end if;
if z > 10 then
y := 500;
end if;
end CondAssign;
if x > 5 then
x := 400;
end if;
if z > 10 then
y := 500;
end if;
end CondAssign;
</Input>
<Output></Output>
</InputCell>
Expand Down Expand Up @@ -132,7 +132,7 @@ algorithm
if z > 10 then
y := 500;
end if;
end CondAssignFunc;
end CondAssignFunc;
</Input>
<Output>Ok</Output>
</InputCell>
Expand Down
2 changes: 1 addition & 1 deletion Algorithms/MultRes.onb
Expand Up @@ -32,7 +32,7 @@ end f; </Input>
equation
(a, b, c) = f(1.0, 2.0);
(x[1], x[2], x[3]) = f(3.0, 4.0);
end fCall;
end fCall;
</Input>
<Output>Ok</Output>
</InputCell>
Expand Down
16 changes: 8 additions & 8 deletions Algorithms/Reinit.onb
Expand Up @@ -26,8 +26,8 @@
equation
der(height) = velocity;
der(velocity) = -g;
algorithm
when height &lt;= 0 then
algorithm
when height &lt;= 0 then
reinit(velocity, -c*velocity);
end when;
end BouncingBall;
Expand Down Expand Up @@ -67,8 +67,8 @@ end BouncingBall;
equation
der(height) = velocity;
der(velocity) = -g;
algorithm
when height &lt;= 0 then
algorithm
when height &lt;= 0 then
velocity := -c*velocity;
end when;
end BouncingBallError;
Expand Down Expand Up @@ -102,15 +102,15 @@ end BouncingBallError;
input Real u = 1;
output Real y;
protected
Real x;
Real x;
equation
der(x) = (u - x)/T;
y = k*x;
algorithm
when initial() then
reinit(x, u); // if x is u since der(x) = (u - x)/T
when initial() then
reinit(x, u); // if x is u since der(x) = (u - x)/T
end when;
end FilterBlock1;
end FilterBlock1;
</Input>
<Output></Output>
</InputCell>
Expand Down
4 changes: 2 additions & 2 deletions Algorithms/Sections.onb
Expand Up @@ -17,11 +17,11 @@ equation
x = y*2;
z = w;
algorithm
x1 := z + x;
x1 := z + x;
x2 := y - 5;
x3 := x2 + y;
equation
u = x1 + x2;
u = x1 + x2;
end AlgorithmSection;
</Input>
<Output></Output>
Expand Down
14 changes: 7 additions & 7 deletions Algorithms/Terminate.onb
Expand Up @@ -54,26 +54,26 @@ end Rocket; </Input>
</TextCell>
<InputCell style="Input" closed="false" >
<Input>class MoonLanding
parameter Real force1 = 36350;
parameter Real force1 = 36350;
parameter Real force2 = 1308;
protected
protected
parameter Real thrustEndTime = 210;
parameter Real thrustDecreaseTime = 43.2;
public
public
Rocket apollo(name = "Apollo13");
CelestialBody moon(name = "moon", mass = 7.382e22, radius = 1.738e6);

equation
apollo.thrust = if (time &lt; thrustDecreaseTime) then force1
else if (time &lt; thrustEndTime) then force2
else 0;
apollo.gravity = moon.g*moon.mass/(apollo.altitude + moon.radius) ^2;

algorithm
when apollo.altitude &lt; 0 then // Termination condition
terminate("The moon lander touches the ground of the moon");
end when;
end MoonLanding;
end when;
end MoonLanding;
</Input>
<Output>Ok</Output>
</InputCell>
Expand Down

0 comments on commit 6e72648

Please sign in to comment.