-
Notifications
You must be signed in to change notification settings - Fork 4
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
11 changed files
with
87 additions
and
54 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
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
25 changes: 0 additions & 25 deletions
25
05_oop_in_st/exercises/4_inheritance_complex_valve/src/ITank.st
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
05_oop_in_st/exercises/4_inheritance_complex_valve/src/IValve.st
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
05_oop_in_st/exercises/4_inheritance_complex_valve/src/ItfTank.st
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,15 @@ | ||
//File to create the interface to implement the class tank | ||
NAMESPACE FluidHandlingClass | ||
|
||
INTERFACE ItfTank | ||
METHOD Fill | ||
END_METHOD | ||
METHOD Flush | ||
END_METHOD | ||
METHOD Close | ||
END_METHOD | ||
METHOD Emptying | ||
END_METHOD | ||
END_INTERFACE | ||
|
||
END_NAMESPACE |
14 changes: 14 additions & 0 deletions
14
05_oop_in_st/exercises/4_inheritance_complex_valve/src/ItfValve.st
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,14 @@ | ||
//File to create the interface to implement the class valve | ||
//File to create the interface to implement the class tank | ||
NAMESPACE FluidHandlingClass | ||
|
||
INTERFACE ItfValve | ||
METHOD Open | ||
END_METHOD | ||
METHOD Close | ||
END_METHOD | ||
METHOD GetState : ValveState | ||
END_METHOD | ||
END_INTERFACE | ||
|
||
END_NAMESPACE |
32 changes: 32 additions & 0 deletions
32
05_oop_in_st/exercises/4_inheritance_complex_valve/src/TankBase.st
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,32 @@ | ||
//Use the same namespace than the TYPE for the Valves state | ||
|
||
NAMESPACE FluidHandlingClass | ||
|
||
CLASS TankBase IMPLEMENTS ItfTank | ||
VAR PRIVATE | ||
inletValve: ValveBase; | ||
outletValve: ValveBase; | ||
END_VAR | ||
|
||
METHOD PUBLIC Fill | ||
inletValve.Open(); | ||
outletValve.Close(); | ||
END_METHOD | ||
|
||
METHOD PUBLIC Flush | ||
inletValve.Open(); | ||
outletValve.Open(); | ||
END_METHOD | ||
|
||
METHOD PUBLIC Close | ||
inletValve.Close(); | ||
outletValve.Close(); | ||
END_METHOD | ||
|
||
METHOD PUBLIC Emptying | ||
this.Close(); | ||
outletValve.Open(); | ||
END_METHOD | ||
END_CLASS | ||
|
||
END_NAMESPACE |
10 changes: 6 additions & 4 deletions
10
05_oop_in_st/exercises/4_inheritance_complex_valve/src/TankWithVolume.st
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
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
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
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