From 0bcad35c7041cda54dd72df5ae729a1ea407bc96 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Fri, 4 Jun 2021 12:53:48 -0400 Subject: [PATCH] Set ack time on pydantic model --- piker/ui/order_mode.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/piker/ui/order_mode.py b/piker/ui/order_mode.py index 22293efa..a49858f4 100644 --- a/piker/ui/order_mode.py +++ b/piker/ui/order_mode.py @@ -129,7 +129,7 @@ class OrderMode: line = self.lines.commit_line(uuid) req_msg = self.book._sent_orders.get(uuid) if req_msg: - req_msg['ack_time_ns'] = time.time_ns() + req_msg.ack_time_ns = time.time_ns() return line @@ -196,8 +196,10 @@ class OrderMode: def submit_exec( self, size: Optional[float] = None, + ) -> LevelLine: - """Send execution order to EMS. + """Send execution order to EMS return a level line to + represent the order on a chart. """ # register the "staged" line under the cursor @@ -226,6 +228,9 @@ class OrderMode: exec_mode=self._exec_mode, ) + # TODO: update the line once an ack event comes back + # from the EMS! + # make line graphic if order push was # sucessful line = self.lines.create_order_line( @@ -266,14 +271,6 @@ class OrderMode: price=line.value(), ) - # def on_key_press( - # self, - # key: - # mods: - # text: str, - # ) -> None: - # pass - @asynccontextmanager async def open_order_mode(