--The Thermostat Class
-----------------------------------------------
-- Author: Sune Wolff - 20022462
-- Created: 21/4 - 2008
-- Updated:
-- Description: Thermostat sub class
-----------------------------------------------
--
-- class definition
--
class Thermostat is subclass of Actuator
--
-- Operations definition section
--
operations
public Thermostat: nat * NetworkTypes`nodeType ==> Thermostat
Thermostat (id, type) ==
(ID := id;
Type := type;
Corr := <NONE>;
);
public Step: () ==> ()
Step() ==
(if (Corr = <INC>)
then World`env.IncTemp()
elseif (Corr = <DEC>)
then World`env.DecTemp();
);
public SetCorrection: NetworkTypes`correction ==> ()
SetCorrection(cor) ==
Corr := cor
pre (cor = <INC>) or (cor = <DEC>) or (cor = <NONE>);
public GetCorrection: () ==> NetworkTypes`correction
GetCorrection() ==
return Corr;
end Thermostat
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet)
¤
|
Haftungshinweis
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.
|