add event sequence diagram
This commit is contained in:
parent
c07c47385e
commit
c9d2c05b73
BIN
UML/event.png
Normal file
BIN
UML/event.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 44 KiB |
55
UML/event.puml
Normal file
55
UML/event.puml
Normal file
@ -0,0 +1,55 @@
|
||||
@startuml
|
||||
|
||||
participant Behavior as b
|
||||
participant Dispatcher as d
|
||||
entity Event as e
|
||||
participant EventQueue as eq
|
||||
queue "EventQueue::queue_" as q
|
||||
|
||||
== Create an Event ==
|
||||
|||
|
||||
?->> b ++ : GEN
|
||||
b -> e ** : new
|
||||
b -> b --++ : pushEvent
|
||||
e -> b : getBehavior
|
||||
b --> e ++: setBehavior
|
||||
e --> b --
|
||||
b -> d ++ : getDispatcher
|
||||
d --> b
|
||||
b -> d -- : pushEvent
|
||||
d ->? -- : push
|
||||
|
||||
|
||||
|||
|
||||
|||
|
||||
== Push Event ==
|
||||
|||
|
||||
?->> d ++: pushEvent
|
||||
d -> eq--++: push
|
||||
eq -> q ++
|
||||
q --> eq
|
||||
eq -> q -- : pushEndQueue
|
||||
|
||||
|||
|
||||
|||
|
||||
== Dispatch ==
|
||||
|||
|
||||
?->> d ++: executeOnce
|
||||
d -> q : getFront
|
||||
q -> e ++
|
||||
e --> q
|
||||
q --> d : event
|
||||
d -> q : pop
|
||||
deactivate q
|
||||
d -> d --++ : dispatchEvent
|
||||
d -> b ++ : getBehavior
|
||||
b --> d
|
||||
d -> b -- : process
|
||||
b -> b--: processEvent
|
||||
|
||||
destroy e
|
||||
|
||||
|
||||
|
||||
|
||||
@enduml
|
38
readme.md
38
readme.md
@ -8,40 +8,6 @@
|
||||
|
||||
# Time Algorithm
|
||||
|
||||
<details>
|
||||
<summary>Code puml (maybe it's displayed) </summary>
|
||||
|
||||
```plantuml
|
||||
@startuml
|
||||
|
||||
start
|
||||
:newTime = 0
|
||||
totalTime = 0
|
||||
isEnd = it == list.end()
|
||||
lastTime = 0;
|
||||
|
||||
#tomato:if (!isEnd) then (not end)
|
||||
#tomato:totalTime += it.getRelTicks();
|
||||
endif
|
||||
|
||||
while ( !isEnd && (totalTime <= newTime) ) is (goForward)
|
||||
:isEnd = (++it == list.end());
|
||||
:lastTime = totalTime;
|
||||
#tomato:if (!isEnd) then (not end)
|
||||
#tomato:totalTime += it.getRelTicks();
|
||||
endif
|
||||
endwhile
|
||||
|
||||
#tomato:if (!isEnd) then (not end)
|
||||
#tomato:subRelTicks(newTime- lastTime);
|
||||
endif
|
||||
:it.setRelTicks(newTime - lastTime);
|
||||
:insert(it, newTimeout);
|
||||
|
||||
@enduml
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<img src="./UML/timeAlgorithme.png">
|
||||
|
||||
@ -50,6 +16,10 @@ endif
|
||||
|
||||
<img src="./UML/timeout.png">
|
||||
|
||||
## Event
|
||||
|
||||
<img src="./UML/event.png">
|
||||
|
||||
# Tests
|
||||
## Test 1
|
||||
This test launches an instance of the Task01Tm class and produces some output. Optionally, multiple instances of Task01Tm can be created to test the XF.
|
||||
|
Reference in New Issue
Block a user