Kevin Chen
/
HelloWorld
a
Fork of HelloWorld by
Diff: interface.cpp
- Revision:
- 4:fb75731983cd
- Parent:
- 3:641eefd1110b
diff -r 641eefd1110b -r fb75731983cd interface.cpp --- a/interface.cpp Wed Oct 26 21:17:17 2016 +0000 +++ b/interface.cpp Sat Oct 29 21:12:09 2016 +0000 @@ -5,7 +5,7 @@ using namespace std; void interface(){ - + int initialize_settings = 1; while(initialize_settings ==1){ @@ -29,7 +29,7 @@ continue; } else if (waveform == 1){ - + //Make sure reference to PaceHeart is correct double amplitude = Pace->get_p_vPaceAmp(); cout << "Current amplitude is: " << amplitude << " mV." << endl; @@ -37,7 +37,7 @@ cout << "Set the amplitude for the ventricle in mV (or enter -1 to escape): " << endl; cin >> amplitude; - if ((amplitude >= 500) && (amplitude <= 7000)) { + if (Pace->amp_inRange(amplitude)== true) { cout << "Valid input. Amplitude is now set to " << amplitude << "mV" << endl; Pace->set_p_vPaceAmp(amplitude); } @@ -58,7 +58,7 @@ cout << "Set the duration for the ventricle in msec (or enter -1 to escape): " << endl; cin >> duration; - if ((duration >= 150) && (duration <= 500)) { + if (Pace->dur_inRange(duration)==true) { cout << "Valid input. Duration is now set to " << duration << "msec" << endl; Pace->set_p_VRP(duration); } @@ -80,7 +80,7 @@ cout << "Set the width for the ventricle in msec (or enter -1 to escape): " << endl; cin >> width; - if ((width >= 0.1) && (width <= 1.9)) { + if (Pace->width_inRange(width)==true) { cout << "Valid input. Width is now set to " << width<< "msec" << endl; Pace->set_p_vPaceWidth(width); } @@ -100,21 +100,21 @@ int waveform = 0; cout << "Enter 1 to change amplitude, 2 for duration, 3 for width, 0 to cancel: " << endl; cin >> waveform; - - + + if (waveform == 0){ continue; } else if (waveform == 1){ - + //Make sure reference to PaceHeart is correct int amplitude = Pace->get_p_aPaceAmp(); cout << "Current amplitude is: " << amplitude << " mV." << endl; - - + + cout << "Set the amplitude for the atrium in mV (or enter -1 to escape): " << endl; cin >> amplitude; - if ((amplitude >= 500) && (amplitude <= 7000)) { + if (Pace->amp_inRange(amplitude)== true) { cout << "Valid input. Amplitude is now set to " << amplitude << "mV" << endl; Pace->set_p_aPaceAmp(amplitude); } @@ -122,21 +122,21 @@ else { cout << "Invalid input. Returning to main menu" << endl; system("PAUSE"); //use these to prompt user to return - - + + } } else if (waveform == 2){ - - + + //Make sure reference to PaceHeart is correct int duration = Pace->get_p_ARP(); cout << "Current duration is: " << duration << "msec. " << endl; - - + + cout << "Set the duration for the atrium in msec (or enter -1 to escape): " << endl; cin >> duration; - if ((duration >= 150) && (duration <= 500)) { + if (Pace->dur_inRange(duration)==true) { cout << "Valid input. Duration is now set to " << duration << "msec" << endl; Pace->set_p_ARP(duration); } @@ -145,20 +145,20 @@ cout << "Invalid input. Returning to main menu" << endl; system("PAUSE"); //use these to prompt user to return } - - - - + + + + } else if (waveform == 3){ //Make sure reference to PaceHeart is correct double width = Pace->get_p_aPaceWidth(); cout << "Current width is: " << width << "msec. " << endl; - - + + cout << "Set the width for the atrium in msec (or enter -1 to escape): " << endl; cin >> width; - if ((width >= 0.1) && (width <= 1.9)) { + if (Pace->width_inRange(width)==true) { cout << "Valid input. Width is now set to " << width<< "msec" << endl; Pace->set_p_aPaceWidth(width); } @@ -167,14 +167,14 @@ cout << "Invalid input. Returning to main menu" << endl; system("PAUSE"); //use these to prompt user to return } - - + + } //Checks if user wants to re-input settings cout << "Do you want to change any values? (1 to re-input all settings, 0 to start PaceMaker)" << endl; cin >> initialize_settings; - - + + } } -} \ No newline at end of file +}