Java Reference
In-Depth Information
void openPump(String name,
int percent)
void setColor(int r, int g, int b)
boolean colorReady()
ControllerInterface redController
ControllerInterface greenController
ControllerInterface blueController
MixerInterface mixerController
void run()
void openPump(...)
void setColor(...)
boolean colorReady()
Figure 13.12 The interconnection of the supervisory console with the mixer
ControllerInterface . Accordingly, class MixerController should be declared to
implement MixerInterface instead of ControllerInterface .
The setColor() method first closes the input pumps and the spray pump of
the mixture tank. Then it opens the drain pump and evaluates the paint
flows from the colour tanks. When the run() method enters the EMPTY state,
the mixer controller requests the colour tank controllers to open their
output pumps to provide the evaluated paint flow. The mixer controller
guarantees that the mixture tank never gets empty until a new setColor()
request is received.
The colorReady() method returns the value “false” only when the drain
pump is open.
package scada.controller;
import java.rmi.*;
public interface MixerInterface extends ControllerInterface {
public void setColor( int rc, int gc, int bc)
throws java.rmi.RemoteException;
public boolean colorReady() throws java.rmi.RemoteException;
import scada.simulator.*;
public class MixerController extends TankController
implements Runnable, MixerInterface {
Search WWH ::

Custom Search