Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image #16

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .idea/Classwork_Spring2023.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

281 changes: 281 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions LRLTimer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
unsigned long LRLTimerEndValue;
char timerLRLState;

void setLRLTimer(){
LRLTimerEndValue = milis() + LRLINT;
LRLTimerState = TIMER_SET;
return;
}

void clearLRLTimer(){
timerLRLState = TIMER_CLEAR;
return;
}

char checkLRLTimer(){
if (timerLRLState == SET){
if (milis() < LRLTimerEndValue)
return timerLRLState
else timerLRLState = TIMER_EXPIRED;
}
return timerLRLState;
}
25 changes: 25 additions & 0 deletions LRLonly.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#define TIMER_SET 0
#define TIMER_CLEAR 1
#define TIMER_EXPIRED 2

void processLRLOnlyState(){
if (checkLRLTimer() == TIMER_EXPIRED{}){
/* Start LRLTimer */
clearLRLTimer();
setLRLTimer();
/* If LRLTimer expires, next state is PACE */
pState = PACE;
VPaceOn();
setVPACETimer();
return;
}
if (IsVentricularEvent()){
/* Start LRLTimer */
clearLRLTimer();
setLRLTimer();
/* If sense a R wave, then next state is state VB */
pState = VB;
return;
}
return;
}
32 changes: 32 additions & 0 deletions PACETimer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
unsigned long paceTimerEndValue;
char timerPaceState;

/* Function to set the PaceTimer */
void setPaceTimer() {
/* Set the end time */
paceTimerEndValue = millis() + PACEINT;
/* Set the time state */
timerPaceState = TIMER_SET;
}

/* Function to clear the PaceTimer */
void clearPaceTimer() {
/* Set the time state */
timerPaceState = TIMER_CLEAR;
}

/* Function to check the PaceTimer */
char checkPaceTimer() {
if (timerPaceState == TIMER_SET) {
/* Check if the current time is less than the end time */
if (millis() < paceTimerEndValue) {
/* If it is, return the timer state (TIMER_SET) */
return timerPaceState;
} else {
/* If it's not, set the timer state to TIMER_EXPIRED */
timerPaceState = TIMER_EXPIRED;
}
}
/* Return the timer state (either TIMER_SET or TIMER_EXPIRED) */
return timerPaceState;
}
47 changes: 47 additions & 0 deletions Pace.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#define TIMER_SET 0
#define TIMER_CLEAR 1
#define TIMER_EXPIRED 2

void processPACEState(){
if (checkVPaceTimer() == TIMER_EXPIRED{}){
/* Start VPACETimer */
clearVPACETimer();
setVPACETimer();
/* If VPaceTimer expires, next state is VB */
pState = VB;
VPaceOff();
/* Setup everything needed for state VB */
setVBTimer();
return;
}
return;
}

void processVBState(){
if (checkVBTimer() == TIMER_EXPIRED{}){
/* Start VBTimer */
clearVBTimer();
setVBTimer();
/* If VBTimer expires, next state is VRP */
pState = VRP;
VPaceOff();
/* Setup everything needed for state VRP */
setVRPTimer();
return;
}
return;
}

void processVRPState(){
if (checkVRPTimer() == TIMER_EXPIRED{}){
/* Start VRPTimer */
clearVRPTimer();
setVRPTimer();
/* If VRPTimer expires, next state is LRLONLY */
pState = LRLONLY;
/* Setup everything needed for state LRLONLY */
setLRLTimer();
return;
}
return;
}
26 changes: 14 additions & 12 deletions blood_calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ def interface():
elif choice == "3":
total_driver()
print("Program ending")


def HDL_driver():
HDL_in = generic_input("HDL")
HDL_analy = HDL_analysis(HDL_in)
generic_output("HDL", HDL_in, HDL_analy)


def generic_input(test_name):
value = input ("Enter the {} value: ".format(test_name))
value = input("Enter the {} value: ".format(test_name))
value = int(value)
return value


def HDL_analysis(HDL_int):
if HDL_int >= 60:
answer = "Normal"
Expand All @@ -39,19 +39,20 @@ def HDL_analysis(HDL_int):
else:
answer = "Low"
return answer


def generic_output(test_name, test_value, test_analy):
print("The {} result of {} is considered {}"
.format(test_name, test_value, test_analy))
.format(test_name, test_value, test_analy))
return


def LDL_driver():
LDL_in = generic_input("LDL")
LDL_analy = LDL_analysis(LDL_in)
generic_output("LDL", LDL_in, LDL_analy)



def LDL_analysis(LDL_int):
if LDL_int >= 190:
answer = "Very High"
Expand All @@ -63,11 +64,13 @@ def LDL_analysis(LDL_int):
answer = "Normal"
return answer


def total_driver():
total_in = generic_input("Total Cholesterol")
total_analy = total_analysis(total_in)
generic_output("Total Cholesterol", total_in, total_analy)


def total_analysis(total_int):
if total_int >= 240:
answer = "High"
Expand All @@ -77,7 +80,6 @@ def total_analysis(total_int):
answer = "Normal"
return answer




if __name__ == "__main__":
interface()
31 changes: 31 additions & 0 deletions card.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# define PACE 0
# define VB 1
# define VRP 2
# define LRLONLY 3

char pState;

main(){
int time = 0;
Setup();
while(1){
switch (pState){
case PACE:
processPACEState();
break;
case VB:
processVBState();
break;
case VRP:
processVRPState();
break;
case LRLONLY:
processLRLOnlyState();
break;
case default:
processError("Illegal State\n");
break;
}
time++;
}
}
36 changes: 36 additions & 0 deletions client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import requests

server = "http://127.0.0.1:5000"

r = requests.get(server + "/info")
print(r.status_code)
print(r.text)


out_data = {"name": "David", "HDL_value": 55}
r = requests.post(server + "/HDL_analysis", json=out_data)
print(r.status_code)
print(r.text)


# out_data = {"a": 2, "b": -3}
# r = requests.post(server + "/add", json=out_data)
# print(r.status_code)
# print(r.text)
# if r.status_code == 200:
# x = r.json()
# print(x + 2)

# r = requests.get(server + "/add_two/five/26")
# print(r.status_code)
# print(r.text)
# print(r.json())
#
#
# out_data = {"a": 2, "b": -3}
# r = requests.post(server + "/add", json=out_data)
# print(r.status_code)
# print(r.text)
# if r.status_code == 200:
# x = r.json()
# print(x + 2)
37 changes: 37 additions & 0 deletions db_gui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import tkinter as tk
from tkinter import ttk


def set_up_window():

def ok_btn_cmd():


root = tk.Tk()
root.title("Donor")
root.geometry("800x800")

top_label = ttk.Label(root, text="blood")
top_label.grid(column=0, row=0)

name_label = ttk.Label(root, text="Name:")
name_label.grid(column=0, row=1)
name_entry = ttk.Entry(root, width=50)
name_entry.grid(column=1, row=1)

id_label = ttk.Label(root, text="Id:")
id_label.grid(column=0, row=2)
id_entry = ttk.Entry(root)
id_entry.grid(column=1, row=2)

root.mainloop()


if __name__ == '__main__':
set_up_window()



# root = tk.Tk() # Defines the top, or root, window, so doesn't have a parent
# content = ttk.Frame(root) # The content Frame is placed in root
# ok_btn = ttk.Button(content) # The ok_btn button is placed in the content Frame
Loading