-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVVI_design.py
79 lines (59 loc) · 1.39 KB
/
VVI_design.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Here I will write pseudocode for VVI design
## Here is the sample code for AAI
def process_LRL_only_state():
pace_Off()
reset_AB_timer(AB_T - PACE_T)
reset_ARP_timer(ARP_T - PACE_T)
if (atrial_Sense()) is True:
next_state = "AB"
if (test_LRL_timer()) is True:
next_state = "PACE"
def atrial_Sense():
return True
def test_LRL_timer():
return True
def reset_LRL_time():
return
def start_LRL_timer():
return
def stop_LRL_timer():
pace_on
pace_Off
activate_Sensor()
deactivate_Sensor()
def process_PACE_state():
deactivate_Sensor()
pace_on()
start_PACE_timer()
reset_LRL_timer(LRL_T - PACE_T)
reset_AB_timer(AB_T - PACE_T)
reset_ARP_timer(ARP_T - PACE_T)
if test_PACE_timer is True:
next_state = AB
def process_AB_state():
return
def pace_on():
return
def pace_Off():
return
def activate_Sensor():
return
def deactivate_Sensor():
return
def reset_AB_timer(AB_T - PACE_T):
return
def reset_ARP_timer(APP_T - PACE_T):
return
def test_PACE_timer():
return True
if __name__ == "main":
next_state = process_LRL_only_State
process_LRL_only_State
while True:
if next_state == "LRL_only":
process_LRL_only_state()
break
if next_state == "PACE":
process_PACE_state()
if next_state == "AB":
process_AB_state