wolfhece._dike_manager

Dike companion object for WolfMapViewer.

All dike-simulation management logic lives here (DikeWolf objects, menu, event dispatch, creation). Injectors are not part of this companion — they register themselves via WolfMapViewer.add_object(which='injector') when DikeWolf.set_injector() is called.

WolfMapViewer holds a single instance as self._dike = DikeManager(self) and exposes one-line delegators so that external callers remain unaffected.

Module Contents

class wolfhece._dike_manager.DikeManager(viewer: wolfhece.PyDraw.WolfMapViewer)[source]

Companion object that owns dike-simulation state.

Instantiated unconditionally as viewer._dike = DikeManager(viewer) inside WolfMapViewer.__init__. If the wolfpydike package is not installed, available is False and all operations are no-ops or log an error.

available: bool = True[source]
_viewer[source]
mydikes: list[wolfhece.dike.DikeWolf] = [][source]
active: DikeWolf | None = None[source]
_menu: wx.Menu | None = None[source]
register(newobj: wolfhece.dike.DikeWolf) None[source]

Add newobj to the registry and make it the active dike.

menu_build() None[source]

Create and append the ‘Dike’ menu to the viewer menubar.

Safe to call multiple times — only the first call has any effect. Silently returns if wolfpydike is not available.

_active_guard() bool[source]

Return True if available and active dike exists, log and return False otherwise.

_on_lumped(event: wx.MenuEvent) None[source]
_on_injector(event: wx.MenuEvent) None[source]
_on_coupled(event: wx.MenuEvent) None[source]
_on_triang(event: wx.MenuEvent) None[source]
_on_discharge(event: wx.MenuEvent) None[source]
_on_levels(event: wx.MenuEvent) None[source]
_on_breach(event: wx.MenuEvent) None[source]
_on_params(event: wx.MenuEvent) None[source]
new_dike(itemlabel: str) None[source]

Handle ‘Create dike…’ and ‘Add dike…’ menu items.