Pass god widget to line editor and order mode instances
parent
2dfa8976a0
commit
2b76baeb10
|
@ -1020,8 +1020,7 @@ async def display_symbol_data(
|
||||||
async with (
|
async with (
|
||||||
open_order_mode(
|
open_order_mode(
|
||||||
feed,
|
feed,
|
||||||
chart,
|
godwidget,
|
||||||
hist_chart,
|
|
||||||
fqsn,
|
fqsn,
|
||||||
order_mode_started
|
order_mode_started
|
||||||
)
|
)
|
||||||
|
|
|
@ -67,7 +67,10 @@ from ._forms import open_form_input_handling
|
||||||
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ._chart import ChartPlotWidget
|
from ._chart import (
|
||||||
|
ChartPlotWidget,
|
||||||
|
GodWidget,
|
||||||
|
)
|
||||||
|
|
||||||
log = get_logger(__name__)
|
log = get_logger(__name__)
|
||||||
|
|
||||||
|
@ -110,6 +113,7 @@ class OrderMode:
|
||||||
|
|
||||||
'''
|
'''
|
||||||
chart: ChartPlotWidget # type: ignore # noqa
|
chart: ChartPlotWidget # type: ignore # noqa
|
||||||
|
hist_chart: ChartPlotWidget # type: ignore # noqa
|
||||||
nursery: trio.Nursery
|
nursery: trio.Nursery
|
||||||
quote_feed: Feed
|
quote_feed: Feed
|
||||||
book: OrderBook
|
book: OrderBook
|
||||||
|
@ -577,8 +581,7 @@ class OrderMode:
|
||||||
async def open_order_mode(
|
async def open_order_mode(
|
||||||
|
|
||||||
feed: Feed,
|
feed: Feed,
|
||||||
chart: ChartPlotWidget, # noqa
|
godw: GodWidget,
|
||||||
hist_chart: ChartPlotWidget, # noqa
|
|
||||||
fqsn: str,
|
fqsn: str,
|
||||||
started: trio.Event,
|
started: trio.Event,
|
||||||
|
|
||||||
|
@ -591,6 +594,9 @@ async def open_order_mode(
|
||||||
state, mostly graphics / UI.
|
state, mostly graphics / UI.
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
chart = godw.rt_linked.chart
|
||||||
|
hist_chart = godw.hist_linked.chart
|
||||||
|
|
||||||
multistatus = chart.window().status_bar
|
multistatus = chart.window().status_bar
|
||||||
done = multistatus.open_status('starting order mode..')
|
done = multistatus.open_status('starting order mode..')
|
||||||
|
|
||||||
|
@ -616,11 +622,9 @@ async def open_order_mode(
|
||||||
|
|
||||||
):
|
):
|
||||||
log.info(f'Opening order mode for {fqsn}')
|
log.info(f'Opening order mode for {fqsn}')
|
||||||
rt_view = chart.view
|
|
||||||
hist_view = chart.view
|
|
||||||
|
|
||||||
# annotations editors
|
# annotations editors
|
||||||
lines = LineEditor(chart=chart)
|
lines = LineEditor(godw=godw)
|
||||||
arrows = ArrowEditor(chart, {})
|
arrows = ArrowEditor(chart, {})
|
||||||
|
|
||||||
# symbol id
|
# symbol id
|
||||||
|
@ -732,6 +736,7 @@ async def open_order_mode(
|
||||||
# a namespace..
|
# a namespace..
|
||||||
mode = OrderMode(
|
mode = OrderMode(
|
||||||
chart,
|
chart,
|
||||||
|
hist_chart,
|
||||||
tn,
|
tn,
|
||||||
feed,
|
feed,
|
||||||
book,
|
book,
|
||||||
|
|
Loading…
Reference in New Issue