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.
Whenever theres an electrical pulse in the chamber corresponding to this lead the environment will call the following stimulate operation. And the lead will transmit it immediately to the HeartController.
\begin{vdm_al}
public
stimulate : Sense ==> ()
stimulate (s) == Pacemaker`heartController.sensorNotify(s,chamber);
\end{vdm_al}
The stepping mechanism in this classis just for each time unit check if there is a scheuled pulse that is made by followPlan.
The following operation its used by the HeartController when a pulse should be delivered. Its logic is simple if a pulse istobe delivered right now does it, otherwise schedules it. Because there will bealways just one scheduled pulse a precondition isset accordingly.
\begin{vdm_al} public
addLeadPace : Pulse * Time ==> ()
addLeadPace (p,t) == if t <= World`timerRef.GetTime() then dischargePulse(p) else (scheduledPulse := mk_(t,p); return) pre t > World`timerRef.GetTime() => scheduledPulse = nil;
\end{vdm_al}
Then the private function dischargePulse delivers the pulse to the environment.
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.