@startuml Power_Control participant TD as TD participant SW as SW participant UI as UI actor USER as US 'Possible actions and interaction types ' External on CANBus ' TD -> SW: MSG: Message ' SW -> TD: MSG: Message ' Internal to the application ' XX -> YY: CMD: Command ' XX -> XX: ACT: Action ' External on OS/FS ' SW -> Script: ACT: Command ' Script -> OS: CMD: Command ' Script -> SW: MSG: Message ' OS -> Script: MSG: Message ' US -> UI: User actions are: ' ASK: Display a ' ENT: User enters a value or string ' TCH: User touches a button (RadioButton, CheckBox, ...) ' SCL: User scrolls a flip-able area == Power Off Sequence == US -> TD: TCH: Press Hard Button - Power TD -> SW: MSG: [xB5: #3] Confirm Request \ \n\t(U32) mId=0 (Shutdown) \ \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_REQUEST_OPEN) \ \n\t(U32) mReason SW -> UI: ACT: Power Off Request UI -> US: ACT: Display Confirm shutdown dialog US -> UI: TCH: Press Shutdown or Cancel UI -> SW: ACT: Shutdown confirm response SW -> TD: MSG: [xB6: #2] Response \ \n\t(U32) mId=0 (Shutdown) \ \n\t(U32) mConfirm=0(cancel)/1 (shutdown) alt mConfirm=1 (shutdown) TD -> TD: ACT: Shutdown System ⟲ (May take a few seconds) TD -> SW: MSG: [x22: #0] Power Off Warning SW -> UI: ACT: Power Off Warning UI -> US: ACT: Display auto-close dialog (5 seconds)\ \n\tNotiy user system is shutting down else #Pink mConfirm=0(cancel) TD -> SW: MSG: [xB5: #3] Confirm Request \ \n\t(U32) mId=0 (Shutdown) \ \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_ACCEPT_CLOSE) \ \n\t(U32) mReason SW -> UI: ACT: Confirm Request close dialog UI -> US: ACT: Close Dialog end == Power Off Sequence Timeout == US -> TD: TCH: Press Hard Button - Power TD -> SW: MSG: [xB5: #3] Confirm Request \ \n\t(U32) mId=0 (Shutdown) \ \n\t(U32) mCommand=0 (GENERIC_CONFIRM_CMD_REQUEST_OPEN) \ \n\t(U32) mReason SW -> UI: ACT: Power Off Request UI -> US: ACT: Display Confirm shutdown dialog ... Time passes ... loop Timeout US -> US: ACT: User idle for timeout limit end TD -> SW: MSG: [xB5: #3] Confirm Request \ \n\t(U32) mId=0 (Shutdown) \ \n\t(U32) mCommand=1 (GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE) \ \n\t(U32) mReason SW -> UI: ACT: Confirm Request timeout close UI -> US: ACT: Close Dialog @enduml