06.08.2013 Views

JAVA-BASED REAL-TIME PROGRAMMING

JAVA-BASED REAL-TIME PROGRAMMING

JAVA-BASED REAL-TIME PROGRAMMING

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

/**<br />

* The machine to regulate<br />

*/<br />

protected AbstractWashingMachine myMachine;<br />

/**<br />

* Simulation speed<br />

*/<br />

protected double mySpeed;<br />

/**<br />

* The temperature controller<br />

*/<br />

protected TemperatureController myTempController;<br />

/**<br />

* The water controller<br />

*/<br />

protected WaterController myWaterController;<br />

/**<br />

* The spin controller<br />

*/<br />

protected SpinController mySpinController;<br />

WashingProgram3<br />

4.7. Exercise 5 - Mailbox and lab 3 preparation<br />

The WashingProgram3 class is an example of a washing program implemented<br />

for the washing machine.<br />

package todo;<br />

import done.*;<br />

/**<br />

* Program 3 of washing machine. Does the following:<br />

* <br />

* Switches off heating<br />

* Switches off spin<br />

* Pumps out water<br />

* Unlocks the hatch.<br />

* <br />

*/<br />

class WashingProgram3 extends WashingProgram {<br />

/**<br />

* @param mach The washing machine to control<br />

* @param speed Simulation speed<br />

* @param tempController The TemperatureController to use<br />

* @param waterController The WaterController to use<br />

* @param spinController The SpinController to use<br />

*/<br />

public WashingProgram3(AbstractWashingMachine mach ,<br />

double speed ,<br />

TemperatureController tempController ,<br />

WaterController waterController ,<br />

SpinController spinController) {<br />

129

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!