@@ -151,29 +151,52 @@ classDiagram
151151 }
152152 Pin <|-- Pedestrian_Button : Inheritance
153153
154- class Controller {
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
162- - bool __debug
163- - str state
164- - float last_state_change
165- + Controller(ped_red, ped_green, car_red, car_amber, car_green, button, buzzer, debug)
166- + walk()
167- + walk_warning()
168- + idle()
169- + change()
170- + update()
154+ class TrafficLightSubsystem {
155+ -__red: Led_Light
156+ -__amber: Led_Light
157+ -__green: Led_Light
158+ -__debug: bool
159+ +__init__(red: Led_Light, amber: Led_Light, green: Led_Light, debug: bool)
160+ +show_red()
161+ +show_amber()
162+ +show_green()
171163 }
164+ Led_Light --> TrafficLightSubsystem : Association
165+
166+ class PedestrianSubsystem {
167+ -__red: Led_Light
168+ -__green: Led_Light
169+ -__button: Pedestrian_Button
170+ -__buzzer: Audio_Notification
171+ -__debug: bool
172+ +__init__(red: Led_Light, green: Led_Light, button: Pedestrian_Button, buzzer: Audio_Notification, debug: bool)
173+ +show_stop()
174+ +show_walk()
175+ +show_warning()
176+ +is_button_pressed() bool
177+ +reset_button()
178+ }
179+ Led_Light --> PedestrianSubsystem : Association
180+ Audio_Notification --> PedestrianSubsystem : Association
181+ Pedestrian_Button --> PedestrianSubsystem : Association
172182
173- Led_Light --> Controller : Association
174- Audio_Notification --> Controller : Association
175- Pedestrian_Button --> Controller : Association
176-
183+ class Controller {
184+ -__traffic_lights: TrafficLightSubsystem
185+ -__pedestrian_signals: PedestrianSubsystem
186+ -__debug: bool
187+ -__last_state_change: float
188+ +state: string
189+ +__init__(ped_red: Led_Light, ped_green: Led_Light, car_red: Led_Light, car_amber: Led_Light, car_green: Led_Light, button: Pedestrian_Button, buzzer: Audio_Notification, debug: bool)
190+ +set_idle_state()
191+ +set_change_state()
192+ +set_walk_state()
193+ +set_warning_state()
194+ +set_error_state()
195+ +update()
196+ }
197+
198+ TrafficLightSubsystem --o Controller : contains
199+ PedestrianSubsystem --o Controller : contains
177200```
178201
179202> [ !Note]
0 commit comments