cz.zcu.fav.kiv.jsimcasestudies.watersystem.application
Class WaterStationControl

java.lang.Object
  |
  +--cz.zcu.fav.kiv.jsimcasestudies.watersystem.application.WaterStationControl

public class WaterStationControl
extends java.lang.Object

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.

Version:
1.1 from 2004-03-18
Author:
Cesar ALLAIN, Jarda KACER, St. Racek

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

basePeriod

private double basePeriod
Base period of control loops.


numberOfSources

private int numberOfSources
Number of water sources in the system.


maxNumberOfPumpsOn

private int maxNumberOfPumpsOn
Maximum number of pumps that is allowed to run simultaneously.


source

private SourceMonitor[] source
Sources objects.


station

private StationMonitor station
The main station object.


sourceControl

private SourceControlThread[] sourceControl
Processes-threads controlling the sources


simulation

private cz.zcu.fav.kiv.jsim.JSimSimulation simulation
The simulation that this model is a part of.


controlInterface

private CommonControlInterface controlInterface
An instance of CommonControlInterface.


iI

private InterruptControllerInterface iI
An instance of InterruptController Interface, it represents HW interrupt controller


iE

private InterruptEntry iE
An instance of InterruptEntry, it encapsulates interrupt service routine.

Constructor Detail

WaterStationControl

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
Constructs a new control program with specified number of water sources. It creates all necessary threads and monitors.

Parameters:
simulation - The overall simulation.
controlInterface - The object of control interface
numberOfSources - Number of water sources in the simulation.
basePeriod - Base period of active control loops
Method Detail

displayState

public void displayState()
Displays the state-like data on a console



Copyright © 2000-2004 University of West Bohemia, FAV-KIV. All Rights Reserved. Build date 20040510