OPI Model package¶
opimodel.actions¶
-
class
opimodel.actions.ActionsModel(hook_first=True, hook_all=False)[source]¶ Bases:
objectRepresents all actions attached to a widget.
-
class
opimodel.actions.ExecuteCommand(command, description, directory='$(opi.dir)')[source]¶ Bases:
objectAction that executes a script command in the specified directory.
-
HOME_DIR= '$(user.home)'¶
-
OPI_DIR= '$(opi.dir)'¶
-
-
class
opimodel.actions.OpenOpi(path, mode=8, macros=None, parent_macros=True)[source]¶ Bases:
objectAction that opens another opi file.
-
DETACHED_TAB= 6¶
-
NEW_WORKBENCH= 7¶
-
REPLACE_CURRENT= 0¶
-
STANDALONE= 8¶
-
WORKBENCH_TAB= 1¶
-
WORKBENCH_TAB_BOTTOM= 5¶
-
WORKBENCH_TAB_LEFT= 2¶
-
WORKBENCH_TAB_RIGHT= 3¶
-
WORKBENCH_TAB_TOP= 4¶
-
opimodel.colors¶
opimodel.fonts¶
opimodel.rules¶
-
class
opimodel.rules.BetweenRule(prop_id, pv, min_val, max_val, min_equals=True, max_equals=True, name=None)[source]¶ Bases:
opimodel.rules.Rule
-
class
opimodel.rules.GreaterThanRule(prop_id, pv, threshold, name=None, val=True, false_val=False, sevr_options=None)[source]¶ Bases:
opimodel.rules.Rule
-
class
opimodel.rules.RawRule(prop_id, rule_xml, name=None)[source]¶ Bases:
opimodel.rules.Rule
-
class
opimodel.rules.SelectionRule(prop_id, pv, name=None, val_options=None, sevr_options=None, else_val=None)[source]¶ Bases:
opimodel.rules.Rule
opimodel.utils¶
opimodel.widgets¶
Module containing widgets to describe opi files. An opi has a root widget of type Display. To create the opi, add widgets as children of this widget.
-
class
opimodel.widgets.ActionButton(x, y, width, height, text, hook_first=True, hook_all=False)[source]¶ Bases:
opimodel.widgets.ActionWidget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.ActionButton'¶
-
-
class
opimodel.widgets.ActionWidget(type_id, x, y, width, height, hook_first=True, hook_all=False)[source]¶ Bases:
opimodel.widgets.WidgetBase class for any widget that can have a list of actions.
-
class
opimodel.widgets.Byte(x, y, width, height, pv, bits, start_bit=None)[source]¶ Bases:
opimodel.widgets.Widget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.bytemonitor'¶
-
-
class
opimodel.widgets.Display(width, height)[source]¶ Bases:
opimodel.widgets.WidgetDisplay widget. This is the root widget for any opi.
-
TYPE_ID= 'org.csstudio.opibuilder.Display'¶
-
-
class
opimodel.widgets.GroupingContainer(x, y, width, height)[source]¶ Bases:
opimodel.widgets.Widget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.groupingContainer'¶
-
-
class
opimodel.widgets.HAlign[source]¶ Bases:
objectEnum describing horizontal alignment
This is typically used with the horizontal_alignment property.
-
CENTER= 1¶
-
LEFT= 0¶
-
RIGHT= 2¶
-
-
class
opimodel.widgets.Label(x, y, width, height, text)[source]¶ Bases:
opimodel.widgets.Widget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.Label'¶
-
-
class
opimodel.widgets.Led(x, y, width, height, pv)[source]¶ Bases:
opimodel.widgets.Widget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.LED'¶
-
-
class
opimodel.widgets.Line(x0, y0, x1, y1)[source]¶ Bases:
opimodel.widgets.Widget-
ID= 'org.csstudio.opibuilder.widgets.polyline'¶
-
-
class
opimodel.widgets.MenuButton(x, y, width, height, text)[source]¶ Bases:
opimodel.widgets.ActionWidget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.MenuButton'¶
-
-
class
opimodel.widgets.Rectangle(x, y, width, height)[source]¶ Bases:
opimodel.widgets.ActionWidget-
ID= 'org.csstudio.opibuilder.widgets.Rectangle'¶
-
-
class
opimodel.widgets.Symbol(x, y, width, height, pv, image_file, image_width, image_index=0)[source]¶ Bases:
opimodel.widgets.ActionWidget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.edm.symbolwidget'¶
-
-
class
opimodel.widgets.TextInput(x, y, width, height, pv)[source]¶ Bases:
opimodel.widgets.Widget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.TextInput'¶
-
-
class
opimodel.widgets.TextMonitor(x, y, width, height, pv)[source]¶ Bases:
opimodel.widgets.Widget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.TextUpdate'¶
-
-
class
opimodel.widgets.ToggleButton(x, y, width, height, on_text, off_text)[source]¶ Bases:
opimodel.widgets.ActionWidget-
TYPE_ID= 'org.csstudio.opibuilder.widgets.BoolButton'¶
-
-
class
opimodel.widgets.Widget(type_id, x, y, width, height, name='widget')[source]¶ Bases:
objectBase class for any widget to extend.
- Args:
- id - the CSS id for the widget. x - the x position of the widget in pixels y - the y position of the widget in pixels widget - the width of the widget in pixels height - the height of the widget in pixels name - a name for the widget within the display
-
add_children(children)[source]¶ Add multiple widgets as children of this widget.
- Args:
- sequence of child widgets
Renderer packages¶
renderers.css.actions¶
-
class
renderers.css.actions.OpiAction(text_renderer)[source]¶ Bases:
objectBase class for action renderers.
-
class
renderers.css.actions.OpiActions[source]¶ Bases:
objectRenderer for actions.
-
ACTION_MAPPING= {<class 'opimodel.actions.OpenOpi'>: <class 'renderers.css.actions.OpiOpen'>, <class 'opimodel.actions.ExecuteCommand'>: <class 'renderers.css.actions.OpiExecuteCommand'>, <class 'opimodel.actions.WritePv'>: <class 'renderers.css.actions.OpiWritePv'>, <class 'opimodel.actions.Exit'>: <class 'renderers.css.actions.OpiExit'>}¶
-
-
class
renderers.css.actions.OpiExecuteCommand(text_renderer)[source]¶ Bases:
renderers.css.actions.OpiActionRenderer for write PV actions.
-
ACTION_TYPE= 'EXECUTE_CMD'¶
-
-
class
renderers.css.actions.OpiExit(text_renderer)[source]¶ Bases:
renderers.css.actions.OpiActionRender for exit OPI actions.
-
ACTION_TYPE= 'EXECUTE_JAVASCRIPT'¶
-
-
class
renderers.css.actions.OpiOpen(text_renderer)[source]¶ Bases:
renderers.css.actions.OpiActionRenderer for write PV actions.
-
ACTION_TYPE= 'OPEN_DISPLAY'¶
-
MACRO_ERROR= 'Invalid macro {}:{} (error {})'¶
-
-
class
renderers.css.actions.OpiWritePv(text_renderer)[source]¶ Bases:
renderers.css.actions.OpiActionRenderer for write PV actions.
-
ACTION_TYPE= 'WRITE_PV'¶
-