The Lead models a Pacemaker lead that read and write pulse valuesfromandto the heart. Each lead its attached to a specific chamber and this is captured using the instance variable chamber.
\begin{vdm_al} class Lead issubclassof GLOBAL, BaseThread
The following operation discharges a pulse to the heart.
\begin{vdm_al} public
addLeadPace : Pulse * Time ==> ()
addLeadPace (p,t) == if t <= World`timerRef.GetTime() then dischargePulse(p) else (scheduledPulse := mk_(t,p); return);
\end{vdm_al}
\begin{vdm_al} private
followPlan : () ==> ()
followPlan () ==
( dcl curTime : Time := World`timerRef.GetTime(); if scheduledPulse <> nil thenif(curTime >= scheduledPulse.#1) then (dischargePulse(scheduledPulse.#2);
scheduledPulse := nil);
public Step: () ==> ()
Step() ==
(if(scheduledPulse <> nil) then followPlan(); -- World`timerRef.WaitRelative(5);
);
\end{vdm_al}
To the lead class the changes are the same a thread definition substitutes the Step function.
\begin{vdm_al} --thread -- while true do -- ( if(scheduledPulse <> nil) -- then followPlan(); -- World`timerRef.WaitRelative(5); -- World`timerRef.NotifyAll(); -- World`timerRef.Awake(); -- );
\end{vdm_al}
And syncronization premission predicates are introduced.
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.