products/sources/formale Sprachen/Delphi/Bille 0.71/__history image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei: HumidSensor.vdmpp   Sprache: Unknown

class HumidSensor is subclass of Sensor, BaseThread

instance variables

finished : bool := false;

operations

public HumidSensor: nat * NetworkTypes`nodeType * nat * Surroundings * nat1 * bool ==> HumidSensor
HumidSensor (id, type, val, envir, p, isP) ==
 (ID := id;
  Type := type;
  Value := val;
  Env := envir;
  period := p;
  isPeriodic := isP;
 );

public Finish: () ==> ()
Finish() ==
  finished := true;

public IsFinished: () ==> ()
IsFinished() ==
  skip;

protected Step: () ==> ()
Step() ==
  Value := Env.ReadHumid();

sync
 
  per IsFinished => finished;

--thread
-- (--World`timerRef.RegisterThread();
  
--  while true 
--  do 
--   (Value := Env.ReadHumid();
--    World`timerRef.WaitRelative(3);--World`timerRef.stepLength);
--   )
-- )

end HumidSensor

[ Dauer der Verarbeitung: 0.18 Sekunden  (vorverarbeitet)  ]