a

Dependencies:   mbed

Fork of HelloWorld by Vincent Cheung

Revision:
5:402ac8c92d76
Parent:
4:fb75731983cd
diff -r fb75731983cd -r 402ac8c92d76 PaceHeart.cpp
--- a/PaceHeart.cpp	Sat Oct 29 21:12:09 2016 +0000
+++ b/PaceHeart.cpp	Sat Oct 29 22:51:31 2016 +0000
@@ -11,7 +11,6 @@
     int p_hysteresis = 0;
     int p_hysteresisInterval = 300;
     int lowrateInterval = 1000;
-    int uprateInterval = 500; //upper rate limit
 //Ventricle
     double p_vPaceAmp = 3500.0;
     double p_vPaceWidth = 0.4;
@@ -30,40 +29,36 @@
 {
     return p_pacingMode;
 }
+void Pace::set_p_pacingMode(int mode)
+{
+    p_pacingMode = mode;
+    return;
+}
 int PaceHeart::get_p_hysteresis()
 {
     return p_hysteresis;
 }
-void PaceHeart::set_p_hysteresis(int x)
+void PaceHeart::set_p_hysteresis(int hysteresis)
 {
-    p_hysteresis = x;
+    p_hysteresis = hysteresis;
     return;
 }
 int PaceHeart::get_p_hysteresisInterval()
 {
     return p_hysteresisInterval;
 }
-void PaceHeart::set_p_hysteresisInterval(int x)
+void PaceHeart::set_p_hysteresisInterval(int hysteresisInterval)
 {
-    p_hysteresisInterval = x;
+    p_hysteresisInterval = hysteresisInterval;
     return;
 }
 int PaceHeart::get_lowrateInterval()
 {
     return lowrateInterval;
 }
-void PaceHeart::set_lowrateInterval(int x)
+void PaceHeart::set_lowrateInterval(int lowrateInterval)
 {
-    lowrateInterval = x;
-    return;
-}
-int PaceHeart::get_uprateInterval()
-{
-    return uprateInterval;
-}
-void PaceHeart::set_uprateInterval(int x)
-{
-    uprateInterval = x;
+    lowrateInterval = lowrateInterval;
     return;
 }
 //Ventricle
@@ -71,9 +66,9 @@
 {
     return p_vPaceAmp;
 }
-void PaceHeart::set_p_vPaceAmp(double x)
+void PaceHeart::set_p_vPaceAmp(double vPaceAmp)
 {
-    p_vPaceAmp = x;
+    p_vPaceAmp = vPaceAmp;
     return;
 }
 
@@ -81,9 +76,9 @@
 {
     return p_vPaceWidth;
 }
-void PaceHeart::set_p_vPaceWidth(double x)
+void PaceHeart::set_p_vPaceWidth(double vPaceWidth)
 {
-    p_vPaceWidth = x;
+    p_vPaceWidth = vPaceWidth;
     return;
 }
 
@@ -91,9 +86,9 @@
 {
     return p_VRP;
 }
-void PaceHeart::set_p_VRP(int x)
+void PaceHeart::set_p_VRP(int VRP)
 {
-    p_VRP = x;
+    p_VRP = VRP;
     return;
 }
 //Atrium
@@ -101,9 +96,9 @@
 {
     return p_aPaceAmp;
 }
-void PaceHeart::set_p_aPaceAmp(double x)
+void PaceHeart::set_p_aPaceAmp(double aPaceAmp)
 {
-    p_aPaceAmp = x;
+    p_aPaceAmp = aPaceAmp;
     return;
 }
 
@@ -111,9 +106,9 @@
 {
     return p_aPaceWidth;
 }
-void PaceHeart::set_p_aPaceWidth(double x)
+void PaceHeart::set_p_aPaceWidth(double aPaceWidth)
 {
-    p_aPaceWidth = x;
+    p_aPaceWidth = aPaceWidth;
     return;
 }
 
@@ -121,9 +116,9 @@
 {
     return p_ARP;
 }
-void PaceHeart::set_p_ARP(int x)
+void PaceHeart::set_p_ARP(int ARP)
 {
-    p_ARP = x;
+    p_ARP = ARP;
     return;
 }
 
@@ -149,7 +144,7 @@
 }
 
 
-void PaceHeart::pace_V(double amp, double wid, int pin)
+void PaceHeart::pace_V(double amp, double wid, int output_pin_V)
 {
     output_pin_V = !output_pin_V ;
     wait(2);
@@ -169,6 +164,7 @@
 
 void PaceHeart::pace(int mode)
 {
+    set_p_pacingMode(mode);
     switch(mode){
     case 1:  //AOO
            pace_A();