Skip to content

Commit

Permalink
Only do tracker update if pp msg is received for sym
Browse files Browse the repository at this point in the history
  • Loading branch information
goodboy committed Sep 6, 2021
1 parent 3713831 commit b9ee099
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions piker/ui/order_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,31 +574,32 @@ async def open_order_mode(
# so that view handlers can access it
view.order_mode = mode

# make fill bar and positioning snapshot
# XXX: this need to be called *before* the first
# pp tracker update(s) below to ensure the limit size unit has
# been correctly set prior to updating the line's pp size label
# (the one on the RHS)
order_pane.init_status_ui()
our_sym = mode.chart.linked._symbol.key

# update any exising position
pp_msg = None
for sym, msg in positions.items():

our_sym = mode.chart.linked._symbol.key
if sym.lower() in our_sym:
pp_msg = msg
break

# make fill bar and positioning snapshot
# XXX: this need to be called *before* the first
# pp tracker update(s) below to ensure the limit size unit has
# been correctly set prior to updating the line's pp size label
# (the one on the RHS).
# TODO: should probably split out the alloc config from the UI
# config startup steps..
order_pane.init_status_ui()

# call this again now since we've configured
# the allocator from the asset type...super dumb.
# we should probably make the allocator config
# and explitict helper func call that takes in the aloc and
# the postion / symbol info then take that alloc ref and
# update the pp_tracker and pp_pane.
# pp_tracker.update(msg, position=pp_tracker.startup_pp)
# we should probably make the allocator config
# and explitict helper func call that takes in the aloc and
# the postion / symbol info then take that alloc ref and
# update the pp_tracker and pp_pane?
if pp_msg:
pp_tracker.update_from_pp_msg(msg)

pp_tracker.update_from_pp_msg(msg, position=pp_tracker.startup_pp)
pp_tracker.update_from_pp_msg(msg)
break
order_pane.update_status_ui()

live_pp = mode.pp.live_pp
size = live_pp.size
Expand Down

0 comments on commit b9ee099

Please sign in to comment.