Skip to content

Commit

Permalink
Added CruiseController UML
Browse files Browse the repository at this point in the history
  • Loading branch information
josokw committed Jun 23, 2019
1 parent 21d71e7 commit dbbe66d
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions CruiseController-UML/CruiseController-EngineOff.puml
@@ -0,0 +1,28 @@
@startuml

title \nCruise Controller: E_ENGINE_OFF \n

[*] -down--> Idle : / CCinitialise();
' Idle -right----> Initial : E_ENGINE_ON / \nclearDesiredSpeed();

Initial -up--> Idle : E_ENGINE_OFF
' Initial --> Accelerating : E_ACCELERATION [brake == off] / \nenable(INCREASE_SPEED);

' Accelerating -right-> CruisingOff : E_BRAKE_PRESSED / \ndisable(INCREASE_SPEED);
Accelerating --> Idle : E_ENGINE_OFF / \ndisable(INCREASE_SPEED);
' Accelerating -down-> CruisingOn : E_CRUISE_ON / \ndisable(INCREASE_SPEED); \nselectSpeed();\nenable(INCREASE_SPEED);

' CruisingOff ---> Resuming : E_CRUISE_OFF / \ndisable(RESUME_CRUISING);
' CruisingOff --> Accelerating : E_ACCELERATION [brake == off] / \n enable(INCREASE_SPEED)
CruisingOff --> Idle : E_ENGINE_OFF

' Resuming --> Accelerating : E_ACCELERATION / \ndisable(RESUME_CRUISING);\nenable(INCREASE_SPEED);
' Resuming --> CruisingOn : E_REACHED_CRUISING_SPEED / \ndisable(RESUME_CRUISING); \nenable(MAINTAIN_SPEED);
Resuming --> Idle : E_ENGINE_OFF / \ndisable(RESUME_CRUISING);
' Resuming -right-> CruisingOff : E_BREAK_PRESSED / \ndisable(RESUME_CRUISING);
' Resuming --> CruisingOff : E_CRUISE_OFF / \ndisable(RESUME_CRUISING);

CruisingOn --> Idle : E_ENGINE_OFF / \ndisable(MAINTAIN_SPEED);
' CruisingOn --> Accelerating : E_ACCELERATION / \ndisable(MAINTAIN_SPEED);\nenable(INCREASE_SPEED);

@enduml
Binary file added CruiseController-UML/CruiseController-fsm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions CruiseController-UML/CruiseController.puml
@@ -0,0 +1,28 @@
@startuml

title \nCruise Controller\n

[*] -down--> Idle : / CCinitialise();
Idle --> Initial : E_ENGINE_ON / \nclearDesiredSpeed();

' Initial -up--> Idle : E_ENGINE_OFF
Initial --> Accelerating : E_ACCELERATION [brake == off] / \nenable(INCREASE_SPEED);

Accelerating -right-> CruisingOff : E_BRAKE_PRESSED / \ndisable(INCREASE_SPEED);
' Accelerating --> Idle : E_ENGINE_OFF / \ndisable(INCREASE_SPEED);
Accelerating -down-> CruisingOn : E_CRUISE_ON / \ndisable(INCREASE_SPEED); \nselectSpeed();\nenable(INCREASE_SPEED);

CruisingOff ---> Resuming : E_CRUISE_OFF / \ndisable(RESUME_CRUISING);
CruisingOff --> Accelerating : E_ACCELERATION [brake == off] / \n enable(INCREASE_SPEED)
' CruisingOff --> Idle : E_ENGINE_OFF

Resuming --> Accelerating : E_ACCELERATION / \ndisable(RESUME_CRUISING);\nenable(INCREASE_SPEED);
Resuming --> CruisingOn : E_REACHED_CRUISING_SPEED / \ndisable(RESUME_CRUISING); \nenable(MAINTAIN_SPEED);
' Resuming --> Idle : E_ENGINE_OFF / \ndisable(RESUME_CRUISING);
Resuming -right-> CruisingOff : E_BREAK_PRESSED / \ndisable(RESUME_CRUISING);
Resuming --> CruisingOff : E_CRUISE_OFF / \ndisable(RESUME_CRUISING);

' CruisingOn --> Idle : E_ENGINE_OFF / \ndisable(MAINTAIN_SPEED);
CruisingOn --> Accelerating : E_ACCELERATION / \ndisable(MAINTAIN_SPEED);\nenable(INCREASE_SPEED);

@enduml

0 comments on commit dbbe66d

Please sign in to comment.