maverig.presenter.group_presenter¶
maverig.presenter.group_presenter.abstractGroupPresenter
¶
-
class
maverig.presenter.group_presenter.abstractGroupPresenter.
AbstractGroupPresenter
(presenter_manager, model, elem_id, cfg)¶ Bases:
maverig.presenter.abstractPresenter.AbstractPresenter
Presenter class that acts as the event handler between the view and the model for all groups.
-
mappings_port_vp
¶ Maps the port and the v_point.
-
ep
(v_point)¶ Returns the element port belonging to a virtual point.
-
vp
(elem_port)¶ Returns the virtual point belonging to an element port.
-
raster_snap_v_points
¶ Returns a list of virtual points that may snap to the raster.
-
init_scene_mapping
(scene)¶ Adds view items to the scene, sets related elem_id as tooltip for easier handling of errors and triggers scene mapping.
-
remove
()¶ Removes this whole group. Unsubscribes model events.
-
snap_zone
(v_point, pos=None)¶ Returns a list of nearby virtual points (of other groups) sorted by distance (from near to far).
-
can_dock
(from_vp, to_vp)¶ Returns if virtual point from_vp can dock with virtual point to_vp if docking is accepted and from_vp is not docked to another virtual point already. A virtual point (e.g. endpoint) can have one outgoing connection only but may have several ingoing connections (e.g. node).
-
to_dockables
(from_vp, to_vps)¶ Returns a list of virtual points from to_vps to which the virtual point from_vp can dock-out.
-
from_dockables
(from_vps, to_vp)¶ Returns a list of virtual points from from_vps to which the virtual point to_vp can dock-in.
-
connectables
(other_vps, vp)¶ Returns a list of virtual points from other_vps to which the virtual point vp can dock-in or dock-out.
-
new_connectables
(other_vps, vp)¶ Returns a list of virtual points from other_vps to which the virtual point vp can dock-in or dock-out if they are not docked already.
-
non_connectable
(other_vps, vp)¶ Returns a list of virtual points from other_vps to which the virtual point vp can’t dock.
-
dock
(from_vp, to_vp)¶ Docks virtual points and applies docking in model.
-
undock
(from_vp, to_vp)¶ Undocks virtual points and applies undocking in model.
-
check_snap_permission
(do_validate=False)¶ Checks whether the view has permission to snap. Optionally validates snap restrictions.
-
on_position_changed
(vp, delta, change, section)¶ Applies docking/undocking of the view within snap zone. Sets v_point position in model.
-
on_exit_presenter_section
(section)¶ Informs the user about docking validity via status bar messages.
-
validation
(vp, snap_zone=None)¶ Updates the views validity.
-
snap_dock
()¶ Snaps the view to the raster.
-
raster_snap
()¶ Snaps the view to the raster if raster mode is enabled.
-
avoid_invalid_positions
()¶ Avoids invalid positions by moving the view back to last valid positions.
-
on_mouse_released
(mouse_pos)¶ Applies raster snapping to the view if view is released by the mouse.
-
on_elements
()¶ Reacts on changes on elements count and removes himself if view isn’t present anymore.
-
on_positions
()¶ Reacts on position changes.
-
on_drag
()¶ Reacts on drag and drop.
-
on_selection
()¶ Reacts on selection changes. Updates the views z-mode and visibility state.
-
on_dockings
()¶ Reacts on view docking.
-
on_mode
()¶ Reacts on mode changes. Updates the state of the view.
-
on_param
()¶ Reacts on parameter changes.
-
change_ev_icon
(value)¶ Changes the icon of an electric vehicle depending on state of charge and plugged-in state.
-
set_effect
(view_or_item, effect, color=<PySide.QtGui.QColor object>, value=0)¶ Applies heat value effects to the view. :param color: the color- or shadow-effect color :param value: value for bar width or opacity (0..1)
-
on_attrs
()¶ Reacts on value changes of attributes. Triggers applying of heat value effects to the view.
-
maverig.presenter.group_presenter.iconGroupPresenter
¶
-
class
maverig.presenter.group_presenter.iconGroupPresenter.
IconGroupPresenter
(presenter_manager, model, elem_id, cfg)¶ Bases:
maverig.presenter.group_presenter.abstractGroupPresenter.AbstractGroupPresenter
Presenter class that acts as the event handler between the view and the model for the icon group.
-
mappings_port_vp
¶ Maps the port and the v_point, e.g. {‘0’: icon.vp_center}.
-
maverig.presenter.group_presenter.lineGroupPresenter
¶
-
class
maverig.presenter.group_presenter.lineGroupPresenter.
LineGroupPresenter
(presenter_manager, model, elem_id, cfg)¶ Bases:
maverig.presenter.group_presenter.abstractGroupPresenter.AbstractGroupPresenter
Presenter class that acts as the event handler between the view and the model for the line and line icon group.
-
mappings_port_vp
¶ Maps the port and the v_point, e.g. {‘0’: endpoint_left.vp_center, ‘1’: endpoint_right.vp_center}.
-
on_param
()¶
-
maverig.presenter.group_presenter.nodeGroupPresenter
¶
-
class
maverig.presenter.group_presenter.nodeGroupPresenter.
NodeGroupPresenter
(presenter_manager, model, elem_id, cfg)¶ Bases:
maverig.presenter.group_presenter.abstractGroupPresenter.AbstractGroupPresenter
Presenter class that acts as the event handler between the view and the model for the node group.
-
mappings_port_vp
¶ Maps the port and the v_point, e.g. {‘0’: node.vp_center}.
-