From 9b0d6fd0a05ee6b6e751b014b6a0ecfbe6964652 Mon Sep 17 00:00:00 2001 From: zhu4ling3 Date: Fri, 6 Apr 2018 20:56:19 -0400 Subject: [PATCH] v --- UML/dataRecord.puml | 86 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 UML/dataRecord.puml diff --git a/UML/dataRecord.puml b/UML/dataRecord.puml new file mode 100644 index 00000000..57a825d0 --- /dev/null +++ b/UML/dataRecord.puml @@ -0,0 +1,86 @@ +@startuml +participant runDataRecord as run +participant mongoDB as db +participant MainEngine as me +participant DrEngine as dr +participant Queue as drq +participant eventEngine as ee +participant Queue as eeq +participant ibGateway as gw + +activate db +activate run +'create ee +run->ee: new evnetEngine() +activate ee + +ee->ee: __init__() +activate ee +create eeq +ee->eeq: Create Queue +activate eeq +ee->ee: Create Child Thread +deactivate ee + +create me +run->me: new mainEngine(ee) +activate me +me->ee: ee.start() +note right +启动ee的子线程 +end note +me->me:创建DataEngine() + + +run->me: addGateway(ibGateway) +run->me: addApp() +run->ee: regiser() 注册日志处理事件 +run->me: 连接IB网关 +create dr +me->dr: new DrEngine(me,ee) + +activate dr + +dr->dr:loadSetting() +note right +从配置文件中加载 +订阅设置到字典对象 +end note +create drq +dr->drq:Create Queue +activate drq +dr->ee:register(TICK, handler) +deactivate ee +gw-->eeq: queue.put(tick/bar) +activate ee #red +loop +ee->eeq:queue.get() +eeq-->ee: Message +ee->ee: process(mesage) +end +ee->dr:call procecssTickEvent() +deactivate ee +activate dr #blue +dr->dr:OnTick() +activate dr +dr->drq: queue.put(tick) +deactivate dr +dr->dr:OnBar() +activate dr +dr->drq: queue.put(bar) +deactivate dr +deactivate dr +deactivate dr + +dr->dr:run() +activate dr #blue +loop +dr->drq:queue.get() +drq-->dr:data +dr->me:insertDB(data) +end +deactivate dr + +me->db: 写入mongoDB + +@enduml