Skip to content

Commit 102e5e9

Browse files
fix uml
1 parent 7dd77bf commit 102e5e9

6 files changed

Lines changed: 64 additions & 60 deletions

File tree

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,9 @@ classDiagram
114114
}
115115
116116
class Audio_Notification {
117-
- bool __debug
118-
- float _last_toggle_time
117+
- __debug: bool
118+
- __last_toggle_time: floot
119+
- __pin: int
119120
+ Audio_Notification(pin, debug=False)
120121
+ warning_on()
121122
+ warning_off()
@@ -124,10 +125,10 @@ classDiagram
124125
PWM <|-- Audio_Notification : Inheritance
125126
126127
class Led_Light {
127-
- bool __debug
128-
- int __pin
129-
- bool __flashing
130-
- float __last_toggle_time
128+
- __debug: bool
129+
- __pin: int
130+
- __flashing: int
131+
- __last_toggle_time: float
131132
+ Led_Light(pin, flashing=False, debug=False)
132133
+ on()
133134
+ off()
@@ -139,10 +140,10 @@ classDiagram
139140
Pin <|-- Led_Light : Inheritance
140141
141142
class Pedestrian_Button {
142-
- int __pin
143-
- bool __debug
144-
- int __last_pressed
145-
- bool __pedestrian_waiting
143+
- __pin: int
144+
- __debug: bool
145+
- __last_pressed: int
146+
- __pedestrian_waiting: bool
146147
+ Pedestrian_Button(pin, debug)
147148
+ button_state : bool
148149
+ button_state(value)
@@ -151,13 +152,13 @@ classDiagram
151152
Pin <|-- Pedestrian_Button : Inheritance
152153
153154
class Controller {
154-
- Led_Light __Ped_Red
155-
- Led_Light __Ped_Green
156-
- Led_Light __Car_Red
157-
- Led_Light __Car_Amber
158-
- Led_Light __Car_Green
159-
- Audio_Notification __Buzzer
160-
- Pedestrian_Button __Button
155+
- __Ped_Red: Class Led_Light
156+
- __Ped_Green: Class Led_Light
157+
- __Car_Red: Class Led_Light
158+
- __Car_Amber: Class Led_Light
159+
- __Car_Green: Class Led_Light
160+
- __Buzzer: Class Audio_Notification
161+
- __Button: Class Pedestrian_Button
161162
- bool __debug
162163
- str state
163164
- float last_state_change

tutorials/Lecture1.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ classDiagram
9797
}
9898
9999
class Audio_Notification {
100-
- bool __debug
101-
- float _last_toggle_time
100+
- __debug: bool
101+
- __last_toggle_time: floot
102+
- __pin: int
102103
+ Audio_Notification(pin, debug=False)
103104
+ warning_on()
104105
+ warning_off()
@@ -107,10 +108,10 @@ classDiagram
107108
PWM <|-- Audio_Notification : Inheritance
108109
109110
class Led_Light {
110-
- bool __debug
111-
- int __pin
112-
- bool __flashing
113-
- float __last_toggle_time
111+
- __debug: bool
112+
- __pin: int
113+
- __flashing: int
114+
- __last_toggle_time: float
114115
+ Led_Light(pin, flashing=False, debug=False)
115116
+ on()
116117
+ off()
@@ -122,10 +123,10 @@ classDiagram
122123
Pin <|-- Led_Light : Inheritance
123124
124125
class Pedestrian_Button {
125-
- int __pin
126-
- bool __debug
127-
- int __last_pressed
128-
- bool __pedestrian_waiting
126+
- __pin: int
127+
- __debug: bool
128+
- __last_pressed: int
129+
- __pedestrian_waiting: bool
129130
+ Pedestrian_Button(pin, debug)
130131
+ button_state : bool
131132
+ button_state(value)

tutorials/Lecture4.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ classDiagram
1414
class Pin
1515
1616
class Pedestrian_Button {
17-
- int __pin
18-
- bool __debug
19-
- int __last_pressed
20-
- bool __pedestrian_waiting
17+
- __pin: int
18+
- __debug: bool
19+
- __last_pressed: int
20+
- __pedestrian_waiting: bool
2121
+ Pedestrian_Button(pin, debug)
2222
+ button_state : bool
2323
+ button_state(value)

tutorials/Lecture5.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ classDiagram
1414
class PWM
1515
1616
class Audio_Notification {
17-
- bool __debug
18-
- float _last_toggle_time
17+
- __debug: bool
18+
- __last_toggle_time: floot
19+
- __pin: int
1920
+ Audio_Notification(pin, debug=False)
2021
+ warning_on()
2122
+ warning_off()

tutorials/Lecture6.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ Association in Object-Oriented Programming (OOP) describes the relationship betw
6464
- It represents a "uses-a" or "knows-a" relationship.
6565
- The lifetime of associated objects is independent—neither object controls the lifecycle of the other.
6666

67-
6867
```mermaid
6968
classDiagram
7069
class Pin {
@@ -86,8 +85,9 @@ classDiagram
8685
}
8786
8887
class Audio_Notification {
89-
- bool __debug
90-
- float _last_toggle_time
88+
- __debug: bool
89+
- __last_toggle_time: floot
90+
- __pin: int
9191
+ Audio_Notification(pin, debug=False)
9292
+ warning_on()
9393
+ warning_off()
@@ -96,10 +96,10 @@ classDiagram
9696
PWM <|-- Audio_Notification : Inheritance
9797
9898
class Led_Light {
99-
- bool __debug
100-
- int __pin
101-
- bool __flashing
102-
- float __last_toggle_time
99+
- __debug: bool
100+
- __pin: int
101+
- __flashing: int
102+
- __last_toggle_time: float
103103
+ Led_Light(pin, flashing=False, debug=False)
104104
+ on()
105105
+ off()
@@ -111,10 +111,10 @@ classDiagram
111111
Pin <|-- Led_Light : Inheritance
112112
113113
class Pedestrian_Button {
114-
- int __pin
115-
- bool __debug
116-
- int __last_pressed
117-
- bool __pedestrian_waiting
114+
- __pin: int
115+
- __debug: bool
116+
- __last_pressed: int
117+
- __pedestrian_waiting: bool
118118
+ Pedestrian_Button(pin, debug)
119119
+ button_state : bool
120120
+ button_state(value)
@@ -123,13 +123,13 @@ classDiagram
123123
Pin <|-- Pedestrian_Button : Inheritance
124124
125125
class Controller {
126-
- Led_Light __Ped_Red
127-
- Led_Light __Ped_Green
128-
- Led_Light __Car_Red
129-
- Led_Light __Car_Amber
130-
- Led_Light __Car_Green
131-
- Audio_Notification __Buzzer
132-
- Pedestrian_Button __Button
126+
- __Ped_Red: Class Led_Light
127+
- __Ped_Green: Class Led_Light
128+
- __Car_Red: Class Led_Light
129+
- __Car_Amber: Class Led_Light
130+
- __Car_Green: Class Led_Light
131+
- __Buzzer: Class Audio_Notification
132+
- __Button: Class Pedestrian_Button
133133
- bool __debug
134134
- str state
135135
- float last_state_change
@@ -141,9 +141,10 @@ classDiagram
141141
+ update()
142142
}
143143
144-
Led_Light --> Controller: Association
144+
Led_Light --> Controller : Association
145+
Audio_Notification --> Controller : Association
145146
Pedestrian_Button --> Controller : Association
146-
Audio_Notification --> Controller: Association
147+
147148
```
148149

149150
### Setup differnet states of the controller using association

tutorials/Lecture7.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ classDiagram
6868
class Audio_Notification
6969
7070
class Controller {
71-
- Led_Light __Ped_Red
72-
- Led_Light __Ped_Green
73-
- Led_Light __Car_Red
74-
- Led_Light __Car_Amber
75-
- Led_Light __Car_Green
76-
- Audio_Notification __Buzzer
77-
- Pedestrian_Button __Button
71+
- __Ped_Red: Class Led_Light
72+
- __Ped_Green: Class Led_Light
73+
- __Car_Red: Class Led_Light
74+
- __Car_Amber: Class Led_Light
75+
- __Car_Green: Class Led_Light
76+
- __Buzzer: Class Audio_Notification
77+
- __Button: Class Pedestrian_Button
7878
- bool __debug
7979
- str state
8080
- float last_state_change

0 commit comments

Comments
 (0)