Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// name: Bug3503.mos | ||
// keywords: synchronous features, prefixing of clocks | ||
// status: correct | ||
// | ||
|
||
setCommandLineOptions("+std=3.3"); getErrorString(); | ||
|
||
loadModel(Modelica); getErrorString(); | ||
loadFile("ClockedSource.mo"); getErrorString(); | ||
loadFile("ClockedModel.mo"); getErrorString(); | ||
instantiateModel(ClockedSource); getErrorString(); | ||
instantiateModel(ClockedModel); getErrorString(); | ||
|
||
// Result: | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// true | ||
// "" | ||
// "class ClockedSource | ||
// parameter Real dt = 0.1; | ||
// Real u = 1.0; | ||
// output Real ud; | ||
// equation | ||
// ud = sample(time * u, Clock(dt)); | ||
// end ClockedSource; | ||
// " | ||
// "" | ||
// "class ClockedModel | ||
// parameter Real cs.dt = 0.1; | ||
// Real cs.u = 1.0; | ||
// Real cs.ud; | ||
// equation | ||
// cs.ud = sample(time * cs.u, Clock(cs.dt)); | ||
// end ClockedModel; | ||
// " | ||
// "" | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
model ClockedModel | ||
ClockedSource cs; | ||
end ClockedModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
model ClockedSource | ||
parameter Real dt = 0.1; | ||
Real u = 1; | ||
Modelica.Blocks.Interfaces.RealOutput ud; | ||
equation | ||
ud = sample(time*u, Clock(dt)); | ||
end ClockedSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters