|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cz.zcu.fav.kiv.jsimcasestudies.watersystem.application.WaterStationControl
An encapsulation of the whole control program part of the simulation. It contains data models (monitors) of water sources as well as the data model (monitor) of the water station. It uses an object of the type CommonControlInterface in order to access to the model of its controlled environment. It also incorporates threads (processes) responsible for controlling pumps. !!! This source code needs to be edited when passing it to the production version. !!! Functions startControl() and stopControl() should be added.
Field Summary | |
private double |
basePeriod
Base period of control loops. |
private CommonControlInterface |
controlInterface
An instance of CommonControlInterface. |
private InterruptEntry |
iE
An instance of InterruptEntry, it encapsulates interrupt service routine. |
private InterruptControllerInterface |
iI
An instance of InterruptController Interface, it represents HW interrupt controller |
private int |
maxNumberOfPumpsOn
Maximum number of pumps that is allowed to run simultaneously. |
private int |
numberOfSources
Number of water sources in the system. |
private cz.zcu.fav.kiv.jsim.JSimSimulation |
simulation
The simulation that this model is a part of. |
private SourceMonitor[] |
source
Sources objects. |
private SourceControlThread[] |
sourceControl
Processes-threads controlling the sources |
private StationMonitor |
station
The main station object. |
Constructor Summary | |
WaterStationControl(cz.zcu.fav.kiv.jsim.JSimSimulation simulation,
CommonControlInterface controlInterface,
int numberOfSources,
int maxNumberOfPumpsOn,
double basePeriod)
Constructs a new control program with specified number of water sources. |
Method Summary | |
void |
displayState()
Displays the state-like data on a console |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private double basePeriod
private int numberOfSources
private int maxNumberOfPumpsOn
private SourceMonitor[] source
private StationMonitor station
private SourceControlThread[] sourceControl
private cz.zcu.fav.kiv.jsim.JSimSimulation simulation
private CommonControlInterface controlInterface
private InterruptControllerInterface iI
private InterruptEntry iE
Constructor Detail |
public WaterStationControl(cz.zcu.fav.kiv.jsim.JSimSimulation simulation, CommonControlInterface controlInterface, int numberOfSources, int maxNumberOfPumpsOn, double basePeriod) throws cz.zcu.fav.kiv.jsim.JSimSimulationAlreadyTerminatedException, cz.zcu.fav.kiv.jsim.JSimInvalidParametersException, cz.zcu.fav.kiv.jsim.JSimTooManyProcessesException, cz.zcu.fav.kiv.jsim.JSimTooManyHeadsException, cz.zcu.fav.kiv.jsim.JSimSecurityException
simulation
- The overall simulation.controlInterface
- The object of control interfacenumberOfSources
- Number of water sources in the simulation.basePeriod
- Base period of active control loopsMethod Detail |
public void displayState()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |