|
|||||||||||
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.model.ModelInterface
An encapsulation of the whole environment model part of the simulation program. It provides access to the model of hardware data values that will be read/set by the tested control program instead of real hardware registers/memory. It also incorporates processes responsible for dynamic modeling the controlled object and hardware sensors that lies between the controlling computer and controlled object. !!! It implements the abstract CommonControlInterface used by the control program.
Field Summary | |
private double |
basePeriod
Base period of data updates. |
private WaterConsumptionProcess |
consumptionProcess
Process simulating water consumption and water volume changes in the main tank. |
private InterruptController |
ic
Interrupt controller object. |
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 SourceHardwareData[] |
sourceData
Sensor data of all sources. |
private SourceProcess[] |
sourceProcesses
Processes simulating water volume changes in the sources. |
private Source[] |
sources
Source objects. |
private Station |
station
The main station object. |
private StationHardwareData |
stationData
Sensor data of the main tank. |
private StationProcess |
stationProcess
Process simulating water volume changes in the main tank. |
private TimerProcess |
timer
Process simulating HW timer device |
Constructor Summary | |
ModelInterface(cz.zcu.fav.kiv.jsim.JSimSimulation simulation,
int numberOfSources,
double basePeriod)
Constructs a new interface of a model with specified number of water sources. |
Method Summary | |
void |
displayState()
Displays the state of the model at a console. |
InterruptControllerInterface |
getInterruptControllerAddress()
Returns the reference to the interrupt controller object. |
int |
checkInvariants(int k)
Checks state invariants of the modeled system |
static void |
main(java.lang.String[] args)
This method allows the model part to be simulated alone without the tested application. |
int |
readOutputFlow()
Reads the Output Flow register of the main water tank. |
boolean |
readPump(int sourceNo)
Reads the Pump IS On flag of a water source. |
boolean |
readSourceLevelHigh(int sourceNo)
Reads the Source Level High flag of a water source. |
boolean |
readSourceLevelLow(int sourceNo)
Reads the Source Level Low flag of a water source. |
double |
readVolume()
Reads the Volume of the main water tank. |
boolean |
readWaterStationLevelHigh()
Reads the Station Level High flag of the main water tank. |
boolean |
readWaterStationLevelLow()
Reads the Source Level Low flag of the main water tank. |
boolean |
setPump(int sourceNo,
boolean newState)
Sets the Pump Is On flag of a water source. |
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 SourceHardwareData[] sourceData
private StationHardwareData stationData
private InterruptController ic
private Source[] sources
private Station station
private SourceProcess[] sourceProcesses
private StationProcess stationProcess
private TimerProcess timer
private WaterConsumptionProcess consumptionProcess
private cz.zcu.fav.kiv.jsim.JSimSimulation simulation
Constructor Detail |
public ModelInterface(cz.zcu.fav.kiv.jsim.JSimSimulation simulation, int numberOfSources, 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.JSimSecurityException
simulation
- The overall simulation.numberOfSources
- Number of water sources in the simulation.Method Detail |
public boolean readSourceLevelLow(int sourceNo)
readSourceLevelLow
in interface CommonControlInterface
sourceNo
- Number of the source whose flag has to be read.
public boolean readSourceLevelHigh(int sourceNo)
readSourceLevelHigh
in interface CommonControlInterface
sourceNo
- Number of the source whose flag has to be read.
public boolean readPump(int sourceNo)
readPump
in interface CommonControlInterface
sourceNo
- Number of the source whose flag has to be read.
public boolean setPump(int sourceNo, boolean newState)
setPump
in interface CommonControlInterface
sourceNo
- Number of the source whose flag has to be set.
public boolean readWaterStationLevelLow()
readWaterStationLevelLow
in interface CommonControlInterface
public boolean readWaterStationLevelHigh()
readWaterStationLevelHigh
in interface CommonControlInterface
public int readOutputFlow()
readOutputFlow
in interface CommonControlInterface
public double readVolume()
public InterruptControllerInterface getInterruptControllerAddress()
getInterruptControllerAddress
in interface CommonControlInterface
public int checkInvariants(int k)
k
- - limiting number of pumps to be switched on simultaneously
public void displayState()
public static void main(java.lang.String[] args)
args
- Command line arguments.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |