phoebusgen.widget package

Submodules

phoebusgen.widget.properties module

phoebusgen.widget.widget module

phoebusgen.widget.widget.prettify(elem)

Return a pretty-printed XML string for the Element. From: https://pymotw.com/3/xml.etree.ElementTree/create.html

phoebusgen.widget.widgets module

class phoebusgen.widget.widgets.ActionButton(name, text, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Actions, _Text, _Font, _ForegroundColor, _BackgroundColor, _Transparent, _RotationStep, _Enabled, _AlarmBorder, _Confirmation

ActionButton Phoebus Widget

action_execute_as_one(val)

Add execute all actions as one property to widget (execute all actions on button press)

Parameters:

val (bool) – Execute all actions as one?

Return type:

None

action_execute_command(command, description=None)

Add Execute Command action to widget. description is optional

Parameters:
  • command (str) – Command to run in action

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

action_execute_external_script(file_name, description=None)

Add Execute Command action to widget. description is optional

Parameters:
  • file_name (str) – External script file name

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

action_execute_javascript_script(script, description=None)

Add Execute Command action to widget. description is optional

Parameters:
  • script (str) – Javascript code to execute as action

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

action_execute_python_script(script, description=None)

Add Execute Command action to widget. description is optional

Parameters:
  • script (str) – Python script to execute as action

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

action_open_display(file, target, description=None, macros=None)

Add open display action to widget. description and macros are optional params

Parameters:
  • file (str) – File name to open

  • target (str) – <specific strings only> tab, replace, window

  • description (Optional[str]) – Description of action. Default is None

  • macros (Optional[dict]) – Dictionary of macros. key=macro name and value=macro value

Return type:

None

Returns:

action_open_file(file, description=None)

Add Open File action to widget. description is optional

Parameters:
  • file (str) – File name to open

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

action_open_webpage(url, description=None)

Add Open Webpage action to widget. description is optional

Parameters:
  • url (str) – URL to open

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

action_write_pv(pv_name, value, description=None)

Add Write PV action to widget. description is optional

Parameters:
  • pv_name (str) – PV name to write to

  • value (Union[str, int, float]) – Value to write to PV

  • description (Optional[str]) – Description of action. Default is None

Return type:

None

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rotation_step_0()

Change rotation step value to 0

Return type:

None

rotation_step_180()

Change rotation step value to 180

Return type:

None

rotation_step_90()

Change rotation step value to 90

Return type:

None

rotation_step_negative_90()

Change rotation step value to -90

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

text(text)

Add text property to widget

Parameters:

text (str) – Text string

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Arc(name, x, y, width, height)

Bases: _Widget, _Macro, _Angle, _LineWidth, _LineColor, _BackgroundColor, _Transparent

Arc Phoebus Widget

angle_size(val)

Add angle size value for widget

Parameters:

val (Union[float, int]) – Angle size value

Return type:

None

angle_start(val)

Add angle start value for widget

Parameters:

val (Union[float, int]) – Start angle value

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Array(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Macro, _ForegroundColor, _BackgroundColor, _AlarmBorder

Array Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.BooleanButton(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Bit, _OffImage, _OnImage, _ShowLED, _Font, _ForegroundColor, _BackgroundColor, _LabelsFromPV, _AlarmBorder, _Enabled, _Mode, _Confirmation

BooleanButton Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

bit(val=-1)

Add bit property to widget. Default arg is -1

Parameters:

val (int) – Bit number

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

labels_from_pv(val)

Change labels from pv property for widget

Parameters:

val (bool) – Show labels from PV?

Return type:

None

mode_push()

Change mode to Push

Return type:

None

mode_push_inverted()

Change mode to Push Inverted

Return type:

None

mode_toggle()

Change mode to Toggle

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

off_color(red, green, blue, alpha=255)

Add Off color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

off_image(image_file)

Add image for off property using file name

Parameters:

image_file (str) – Path to image file

Return type:

None

off_label(label)

Add Off label string to widget

Parameters:

label (str) – label

Return type:

None

on_color(red, green, blue, alpha=255)

Add On color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

on_image(image_file)

Add image for on property using file name

Parameters:

image_file (str) – Path to image file

Return type:

None

on_label(label)

Add On label string to widget

Parameters:

label (str) – label

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_off_color(name)

Add named color for Off Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_on_color(name)

Add named color for On Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_led(val)

Change Show LED property on widget

Parameters:

val (bool) – Show LED?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.ByteMonitor(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _StartBit, _NumBits, _ReverseBits, _Horizontal, _Square, _OffColor, _OnColor, _ForegroundColor, _Font, _Labels, _AlarmBorder

ByteMonitor Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal(val)

Change horizontal property of widget

Parameters:

val (bool) – Is widget horizontal?

Return type:

None

labels(label_list_or_name)

Add label property to widget

Parameters:

label_list_or_name (Union[list, str]) – List of label strings or a single label string

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

num_bits(number_of_bits)

Add number of bits property to widget

Parameters:

number_of_bits (int) – Number of bits

Return type:

None

off_color(red, green, blue, alpha=255)

Add Off color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

on_color(red, green, blue, alpha=255)

Add On color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_off_color(name)

Add named color for Off Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_on_color(name)

Add named color for On Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

reverse_bits(reverse_bits=True)

Add reverse bits option on widget. Default arg value is True

Parameters:

reverse_bits (bool) – Reverse bits?

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

square(val)

Change widget square property

Parameters:

val (bool) – Is width square?

Return type:

None

start_bit(start_bit)

Adding start bit property to widget

Parameters:

start_bit (int) – Start bit

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.CheckBox(name, label, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Bit, _Label, _Font, _ForegroundColor, _AutoSize, _AlarmBorder, _Confirmation

CheckBox Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

auto_size(auto=True)

Change auto size property on widget. Default arg is True

Parameters:

auto (bool) – Auto size widget?

Return type:

None

bit(val=-1)

Add bit property to widget. Default arg is -1

Parameters:

val (int) – Bit number

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

label(val)

Add label to widget

Parameters:

val (str) – Label

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.ChoiceButton(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _SelectedColor, _Horizontal, _AlarmBorder, _Items, _ItemsFromPV, _Confirmation

ChoiceButton Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal(val)

Change horizontal property of widget

Parameters:

val (bool) – Is widget horizontal?

Return type:

None

item(item_text)

Add item property to widget

Parameters:

item_text (str) – Item text string

Return type:

None

items_from_pv(val)

Change Items from PV property to widget

Parameters:

val (bool) – Use items from pv?

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_selected_color(name)

Add predefined selected color name to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

selected_color(red, green, blue, alpha=255)

Add selected color property to widget

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.ColorBar

Bases: _Generic, _ScaleFont, _ColorBarSize

bar_size(val)

Add size value to color bar

Parameters:

val (int) – Bar size value

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

predefined_scale_font(name)

Add named scale font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

scale_font_family(family)

Change scale font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

scale_font_size(size)

Change scale font size property for widget

Parameters:

size (int) – Font size

Return type:

None

scale_font_style_bold()

Change scale font style to Bold

Return type:

None

scale_font_style_bold_italic()

Change scale font style to Bold & Italic

Return type:

None

scale_font_style_italic()

Change scale font style to Italic

Return type:

None

scale_font_style_regular()

Change scale font style to Regular

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.ColorMapColor(value, red, green, blue)

Bases: _Generic

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.ComboBox(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _AlarmBorder, _Items, _ItemsFromPV, _Editable, _Enabled, _Confirmation

ComboBox Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

editable(val=True)

Change editable property on the widget. Default arg is True

Parameters:

val (bool) – Is widget editable?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

item(item_text)

Add item property to widget

Parameters:

item_text (str) – Item text string

Return type:

None

items_from_pv(val)

Change Items from PV property to widget

Parameters:

val (bool) – Use items from pv?

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.DataBrowser(name, file, x, y, width, height)

Bases: _Widget, _Macro, _File, _ShowToolbar, _SelectionValuePV

DataBrowser Phoebus Widget

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

file(val)

Add file name property to widget

Parameters:

val (str) – File name

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

selection_value_pv(val)

Add selection value PV to widget

Parameters:

val (str) – PV Name for selection value pv

Return type:

None

show_toolbar(val)

Change option to show toolbar property option for the widget

Parameters:

val (bool) – Show toolbar?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Ellipse(name, x, y, width, height)

Bases: _Widget, _Macro, _LineWidth, _LineColor, _BackgroundColor, _Transparent

Ellipse Phoebus Widget

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.EmbeddedDisplay(name, file, x, y, width, height)

Bases: _Widget, _Macro, _File, _ResizeBehavior, _GroupName, _Transparent, _Border

EmbeddedDisplay Phoebus Widget

border_color(red, green, blue, alpha=255)

Change border color with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_width(width)

Add border width property to widget

Parameters:

width (int) – Border width value

Return type:

None

crop_content()

Change resize behavior to Crop Content

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

file(val)

Add file name property to widget

Parameters:

val (str) – File name

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

group_name(val)

Add group name to widget

Parameters:

val (str) – Name of group

Return type:

None

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

no_resize()

Change resize behavior to No Resize

Return type:

None

predefined_border_color(name)

Change border color with named color

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

size_content_to_fit_widget()

Change resize behavior to Size Content to Fit Widget

Return type:

None

size_widget_to_match_content()

Change resize behavior to Size Widget to Match Content

Return type:

None

stretch_content_to_fit_widget()

Change resize behavior to Stretch Content to Fit Widget

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.FileSelector(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _FileComponent, _AlarmBorder, _Enabled

FileSelector Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

file_component_base_name()

Change file component to only use file base name

Return type:

None

file_component_directory()

Change file component to use directory name

Return type:

None

file_component_full_path()

Change file component to use full file path

Return type:

None

file_component_name_and_extension()

Change file component to only use file name and extension

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Group(name, x, y, width, height)

Bases: _Widget, _Structure, _Macro, _Style, _Font, _ForegroundColor, _BackgroundColor, _Transparent, _LineColor

Group Phoebus Widget

add_widget(elem)

Add widget to structure element (group, etc.)

Parameters:

elem (Union[list, object]) – <Phoebusgen.widget> Element or List of Elements to add to structure

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

no_style()

Change widget style to No Style

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

style_group_box()

Change widget style to Style Group Box

Return type:

None

style_line()

Change widget style to Style Line

Return type:

None

style_title_bar()

Change widget style to Style Title Bar

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Image(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _ForegroundColor, _BackgroundColor, _ShowToolbar, _AlarmBorder, _MinMax, _AutoScale, _DataHeightAndWidth, _UnsignedData, _LogScale, _Cursor, _Interpolation, _XAxis, _YAxis, _ColorMode, _RegionsOfInterest, _ColorBar, _ColorMap

Image Phoebus Widget

add_color_bar(bar)

Add color bar property to widget

Parameters:

bar (object) – Color bar object

Return type:

None

add_color_map(color)

Adds custom color map

Parameters:

color (object) – Color map object

Return type:

None

add_roi(roi)

Add ROI to list of ROIs for widget

Parameters:

roi (object) – ROI object

Return type:

None

add_x_axis(axis)

Add x-axis property to widget

Parameters:

axis (object) – x-axis object

Return type:

None

add_y_axis(axis)

Add y-axis property to widget

Parameters:

axis (object) – y-axis object

Return type:

None

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

auto_scale(auto_scale)

Add auto scale property to widget

Parameters:

auto_scale (bool) – Auto scale image?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

color_mode_3BYTE_BGR()

Change color mode to 3BYTE_BGR

Return type:

None

color_mode_4BYTE_ABGR()

Change color mode to 4BYTE_ABGR

Return type:

None

color_mode_4BYTE_ABGR_PRE()

Change color mode to 4BYTE_ABGR_PRE

Return type:

None

color_mode_BAYER()

Change color mode to BAYER

Return type:

None

color_mode_BYTE_BINARY()

Change color mode to BYTE_BINARY

Return type:

None

color_mode_BYTE_GRAY()

Change color mode to BYTE_GRAY

Return type:

None

color_mode_BYTE_INDEXED()

Change color mode to BYTE_INDEXED

Return type:

None

color_mode_CUSTOM()

Change color mode to CUSTOM

Return type:

None

color_mode_INT_ARGB()

Change color mode to INT_ARGB

Return type:

None

color_mode_INT_ARGB_PRE()

Change color mode to INT_ARGB_PRE

Return type:

None

color_mode_INT_BGR()

Change color mode to INT_BGR

Return type:

None

color_mode_INT_RGB()

Change color mode to INT_RGB

Return type:

None

color_mode_MONO()

Change color mode to MONO

Return type:

None

color_mode_RGB1()

Change color mode to RGB1

Return type:

None

color_mode_RGB2()

Change color mode to RGB2

Return type:

None

color_mode_RGB3()

Change color mode to RGB3

Return type:

None

color_mode_USHORT_555_RGB()

Change color mode to USHORT_555_RGB

Return type:

None

color_mode_USHORT_565_RGB()

Change color mode to USHORT_565_RGB

Return type:

None

color_mode_USHORT_GRAY()

Change color mode to USHORT_GRAY

Return type:

None

color_mode_YUV411()

Change color mode to YUV411

Return type:

None

color_mode_YUV422()

Change color mode to YUV422

Return type:

None

color_mode_YUV444()

Change color mode to YUV444

Return type:

None

cursor_crosshair(cursor_crosshair=True)

Toggle widget cursor crosshair property. Default arg is True

Parameters:

cursor_crosshair (bool) – Is widget transparent?

Return type:

None

cursor_info_pv(info_pv_name)

Add cursor info PV to widget

Parameters:

info_pv_name (str) – PV Name

Return type:

None

cursor_x_pv(x_pv_name)

Add cursor X PV to widget

Parameters:

x_pv_name (str) – PV Name

Return type:

None

cursor_y_pv(y_pv_name)

Add cursor Y PV to widget

Parameters:

y_pv_name (str) – PV Name

Return type:

None

data_height(height)

Add data height property to widget

Parameters:

height (int) – Data height

Return type:

None

data_width(width)

Add data width property to widget

Parameters:

width (int) – Data width

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

interpolation_automatic()

Change interpolation to Automatic

Return type:

None

interpolation_interpolate()

Change interpolation to Interpolate

Return type:

None

interpolation_none()

Change interpolation to None

Return type:

None

log_scale(log_scale=True)

Add log scale property to widget. Default arg is True

Parameters:

log_scale (bool) – Use log scale?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_color_map(name)

Adds color map from one of the predefined enums

Parameters:

name (str) – Name of predefined color map

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_color_bar(bar)

Removes color bar from widget

Parameters:

bar (object) – Color bar object

Return type:

None

remove_color_map(color)

Removes custom color map color

Parameters:

color (object) – Color map object

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

remove_roi(roi)

Removes ROI from widget

Parameters:

roi (object) – ROI object

Return type:

None

remove_x_axis(axis)

Removes x-axis from widget

Parameters:

axis (object) – x-axis object

Return type:

None

remove_y_axis(axis)

Removes y-axis from widget

Parameters:

axis (object) – y-axis object

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_toolbar(val)

Change option to show toolbar property option for the widget

Parameters:

val (bool) – Show toolbar?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

unsigned_data(unsigned=True)

Add unsigned data property to widget. Default arg is True

Parameters:

unsigned (bool) – Is data unsigned?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.ImageXAxis

Bases: _Generic, _Title, _MinMax, _TitleFont, _ScaleFont

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

predefined_scale_font(name)

Add named scale font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_title_font(name)

Add named title font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

scale_font_family(family)

Change scale font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

scale_font_size(size)

Change scale font size property for widget

Parameters:

size (int) – Font size

Return type:

None

scale_font_style_bold()

Change scale font style to Bold

Return type:

None

scale_font_style_bold_italic()

Change scale font style to Bold & Italic

Return type:

None

scale_font_style_italic()

Change scale font style to Italic

Return type:

None

scale_font_style_regular()

Change scale font style to Regular

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

title_font_family(family)

Change title font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

title_font_size(size)

Change title font size property for widget

Parameters:

size (int) – Font size

Return type:

None

title_font_style_bold()

Change title font style to Bold

Return type:

None

title_font_style_bold_italic()

Change title font style to Bold & Italic

Return type:

None

title_font_style_italic()

Change title font style to Italic

Return type:

None

title_font_style_regular()

Change title font style to Regular

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.ImageYAxis

Bases: _Generic, _Title, _MinMax, _TitleFont, _ScaleFont

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

predefined_scale_font(name)

Add named scale font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_title_font(name)

Add named title font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

scale_font_family(family)

Change scale font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

scale_font_size(size)

Change scale font size property for widget

Parameters:

size (int) – Font size

Return type:

None

scale_font_style_bold()

Change scale font style to Bold

Return type:

None

scale_font_style_bold_italic()

Change scale font style to Bold & Italic

Return type:

None

scale_font_style_italic()

Change scale font style to Italic

Return type:

None

scale_font_style_regular()

Change scale font style to Regular

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

title_font_family(family)

Change title font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

title_font_size(size)

Change title font size property for widget

Parameters:

size (int) – Font size

Return type:

None

title_font_style_bold()

Change title font style to Bold

Return type:

None

title_font_style_bold_italic()

Change title font style to Bold & Italic

Return type:

None

title_font_style_italic()

Change title font style to Italic

Return type:

None

title_font_style_regular()

Change title font style to Regular

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.LED(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Bit, _Off, _On, _Font, _ForegroundColor, _LineColor, _Square, _LabelsFromPV, _AlarmBorder

LED Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

bit(val=-1)

Add bit property to widget. Default arg is -1

Parameters:

val (int) – Bit number

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

labels_from_pv(val)

Change labels from pv property for widget

Parameters:

val (bool) – Show labels from PV?

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

off_color(red, green, blue, alpha=255)

Add Off color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

off_label(label)

Add Off label string to widget

Parameters:

label (str) – label

Return type:

None

on_color(red, green, blue, alpha=255)

Add On color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

on_label(label)

Add On label string to widget

Parameters:

label (str) – label

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_off_color(name)

Add named color for Off Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_on_color(name)

Add named color for On Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

square(val)

Change widget square property

Parameters:

val (bool) – Is width square?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.LEDMultiState(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _LineColor, _Square, _AlarmBorder, _States, _Fallback

LEDMultiState Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

fallback_color(red, green, blue, alpha=255)

Add fallback color to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

fallback_label(label)

Add fallback label to widget

Parameters:

label (str) – label

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_fallback_color(name)

Add fallback color to widget with a named color

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

square(val)

Change widget square property

Parameters:

val (bool) – Is width square?

Return type:

None

state(state_value, label, red, green, blue, alpha=255)

Add state color to widget with RGB values

Parameters:
  • state_value (int) – Integer value of the state

  • label (str) – State label

  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

state_predefined_color(state_value, label, color_name)

Add state color to widget with a named color

Parameters:
  • state_value (int) – Integer value of the state

  • label (str) – State label

  • color_name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Label(name, text, x, y, width, height)

Bases: _Widget, _Text, _Macro, _Font, _ForegroundColor, _BackgroundColor, _Transparent, _HorizontalAlignment, _VerticalAlignment, _RotationStep, _WrapWords, _AutoSize, _Border

Label Phoebus Widget

auto_size(auto=True)

Change auto size property on widget. Default arg is True

Parameters:

auto (bool) – Auto size widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_color(red, green, blue, alpha=255)

Change border color with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_width(width)

Add border width property to widget

Parameters:

width (int) – Border width value

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal_alignment_center()

Change horizontal alignment to center

Return type:

None

horizontal_alignment_left()

Change horizontal alignmnet to Left

Return type:

None

horizontal_alignment_right()

Change horizontal alignment to right

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_border_color(name)

Change border color with named color

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rotation_step_0()

Change rotation step value to 0

Return type:

None

rotation_step_180()

Change rotation step value to 180

Return type:

None

rotation_step_90()

Change rotation step value to 90

Return type:

None

rotation_step_negative_90()

Change rotation step value to -90

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

text(text)

Add text property to widget

Parameters:

text (str) – Text string

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

vertical_alignment_bottom()

Change vertical alignment to Bottom

Return type:

None

vertical_alignment_middle()

Change vertical alignment to Middle

Return type:

None

vertical_alignment_top()

Change vertical alignment to Top

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

wrap_words(wrap=True)

Change wrap words property. Default arg value is True

Parameters:

wrap (bool) – Wrap words?

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Marker

Bases: _Generic, _Color, _PVName, _Interactive

color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

interactive(val)

Set marker as interactive

Parameters:

val (bool) – Interactive?

Return type:

None

predefined_color(name)

Add named color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.Meter(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _ForegroundColor, _BackgroundColor, _Font, _Format, _Precision, _ShowValue, _ShowUnits, _ShowLimits, _AlarmBorder, _LimitsFromPV, _MinMax, _NeedleColor, _KnobColor

Meter Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

format(format_val)

Add format property to widget, i.e. Decimal, Exponential, Engineering, String, etc

Parameters:

format_val (str) – Format String name

Return type:

None

Returns:

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

knob_color(red, green, blue, alpha=255)

Add Knob Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

needle_color(red, green, blue, alpha=255)

Add Needle Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

precision(val)

Add precision value to widget

Parameters:

val (int) – Precision value

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_knob_color(name)

Add named Knob Color property to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_needle_color(name)

Add named Needle Color property to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_limits(val)

Change show limits property of widget

Parameters:

val (bool) – Show limits?

Return type:

None

show_units(show=True)

Change show units property to widget. Default arg is True

Parameters:

show (bool) – Show units?

Return type:

None

show_value(val)

Change show value property of widget

Parameters:

val (bool) – Show value?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.NavigationTabs(name, x, y, width, height)

Bases: _Widget, _NavTabs, _ActiveTab, _TabWidth, _TabSpacing, _TabHeight, _SelectedColor, _DeselectedColor, _Direction, _Font

NavigationTabs Phoebus Widget

active_tab(tab_num)

Select active tab number for the widget

Parameters:

tab_num (int) – Tab number to be active on page open

Return type:

None

deselected_color(red, green, blue, alpha=255)

Add deselected color property to widget

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_deselected_color(name)

Add predefined deselected color name to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_selected_color(name)

Add predefined selected color name to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

selected_color(red, green, blue, alpha=255)

Add selected color property to widget

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

tab(name, file_name, group_name, macros=None)

Add tab to the Navigation Tab widget. Nav tabs use bob files. Macro arg is optional

Parameters:
  • name (str) – Tab name

  • file_name (str) – .bob file name

  • group_name (str) – Tab group name

  • macros (Optional[dict]) – Dictionary of macros. key=macro name and value=macro value

Return type:

None

tab_direction_horizontal()

Change tab direction property to horizontal for widget

Return type:

None

tab_direction_vertical()

Change tab direction property to vertical for widget

Return type:

None

tab_height(height)

Add tab height property to widget

Parameters:

height (int) – Height value for tabs

Return type:

None

tab_spacing(spacing)

Add tab spacing property to widget

Parameters:

spacing (int) – Tab spacing value

Return type:

None

tab_width(width)

Add tab width property to widget

Parameters:

width (int) – Width value for tabs

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Picture(name, file, x, y, width, height)

Bases: _Widget, _Macro, _File, _StretchToFit, _Rotation

Picture Phoebus Widget

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

file(val)

Add file name property to widget

Parameters:

val (str) – File name

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rotation(val)

Add rotation value for widget

Parameters:

val (Union[float, int]) – Rotation value

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

stretch_to_fit(val)

Add stretch to fit property to widget

Parameters:

val (bool) – Stretch widget to fit?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Polygon(name, x, y, width, height)

Bases: _Widget, _Macro, _LineWidth, _LineColor, _BackgroundColor, _Points

Polygon Phoebus Widget

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

point(x, y)

Add point to points property of a widget

Parameters:
  • x (int) – X position of the point

  • y (int) – Y position of the point

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Polyline(name, x, y, width, height)

Bases: _Widget, _Macro, _LineWidth, _LineColor, _LineStyle, _Arrow, _Points

Polyline Phoebus Widget

arrow_length(length)

Change arrow length widget property

Parameters:

length (int) – Arrow length

Return type:

None

arrows_both()

Change arrow property to “Both”

Return type:

None

arrows_from()

Change arrow property to “From” for arrow direction

Return type:

None

arrows_none()

Change arrow property to “None” for no arrows

Return type:

None

arrows_to()

Change arrow property to “To” for arrow direction

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

line_style_dash_dot()

Change line style to dash-dot

Return type:

None

line_style_dash_dot_dot()

Change line style to dash-dot-dot

Return type:

None

line_style_dashed()

Change line style to dashed

Return type:

None

line_style_dot()

Change line style to dot

Return type:

None

line_style_solid()

Change line style to solid

Return type:

None

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

point(x, y)

Add point to points property of a widget

Parameters:
  • x (int) – X position of the point

  • y (int) – Y position of the point

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.ProgressBar(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _FillColor, _BackgroundColor, _Horizontal, _AlarmBorder, _LimitsFromPV, _MinMax

ProgressBar Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

fill_color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal(val)

Change horizontal property of widget

Parameters:

val (bool) – Is widget horizontal?

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_fill_color(name)

Add named Fill Color property to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.RadioButton(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _Horizontal, _AlarmBorder, _Items, _ItemsFromPV, _Enabled, _Confirmation

RadioButton Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal(val)

Change horizontal property of widget

Parameters:

val (bool) – Is widget horizontal?

Return type:

None

item(item_text)

Add item property to widget

Parameters:

item_text (str) – Item text string

Return type:

None

items_from_pv(val)

Change Items from PV property to widget

Parameters:

val (bool) – Use items from pv?

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Rectangle(name, x, y, width, height)

Bases: _Widget, _Macro, _LineWidth, _LineColor, _BackgroundColor, _Transparent, _Corner

Rectangle Phoebus Widget

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

corner_height(height)

Add corner height property to widget

Parameters:

height (int) – Corner height

Return type:

None

corner_width(width)

Add corner width property to widget

Parameters:

width (int) – Corner width

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

line_color(red, green, blue, alpha=255)

Add line color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_line_color(name)

Add named line color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.RegionOfInterest

Bases: _Generic, _Name, _Color, _Interactive, _XPV, _YPV, _WidthPV, _HeightPV, _File

color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

file(val)

Add file name property to widget

Parameters:

val (str) – File name

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height_pv(pv)

Change ROI height_pv value

Parameters:

pv (str) – ROI height_pv

Return type:

None

interactive(val)

Set marker as interactive

Parameters:

val (bool) – Interactive?

Return type:

None

name(name)

Change trace name

Parameters:

name (str) – Trace name

Return type:

None

predefined_color(name)

Add named color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width_pv(pv)

Change ROI width_pv value

Parameters:

pv (str) – ROI width_pv

Return type:

None

x_pv(pv)

Change trace x_pv value

Parameters:

pv (str) – Trace x_pv

Return type:

None

y_pv(pv)

Change trace y_pv value

Parameters:

pv (str) – Trace y_pv

Return type:

None

class phoebusgen.widget.widgets.ScaledSlider(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Horizontal, _ForegroundColor, _BackgroundColor, _Transparent, _Font, _ShowScale, _ShowMinorTicks, _MajorTicksPixelDist, _ScaleFormat, _LevelsAndShow, _AlarmBorder, _Increment, _MinMax, _LimitsFromPV, _Enabled

ScaledSlider Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal(val)

Change horizontal property of widget

Parameters:

val (bool) – Is widget horizontal?

Return type:

None

increment(val)

Change increment property for widget

Parameters:

val (Union[float, int]) – Increment value

Return type:

None

level_high(level)

Add High level on widget

Parameters:

level (Union[float, int]) – High level

Return type:

None

level_hihi(level)

Add HiHi level on widget

Parameters:

level (Union[float, int]) – HiHi level

Return type:

None

level_lolo(level)

Add LoLo level on widget

Parameters:

level (Union[float, int]) – LoLo level

Return type:

None

level_low(level)

Add Low level on widget

Parameters:

level (Union[float, int]) – Low level

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

major_ticks_pixel_dist(dist)

Add major ticks pixel distribution value to widget

Parameters:

dist (int) – Pixel distribution

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

scale_format(format_string)

Add scale format string to widget

Parameters:

format_string (str) – Formatting string, ex: #.##

Return type:

None

show_high(show=True)

Add ShowHigh option on widget. Default arg is True

Parameters:

show (bool) – Show High?

Return type:

None

show_hihi(show=True)

Add ShowHiHi option on widget. Default arg is True

Parameters:

show (bool) – Show HiHi?

Return type:

None

show_lolo(show=True)

Add ShowLoLo option on widget. Default arg is True

Parameters:

show (bool) – Show LoLo?

Return type:

None

show_low(show=True)

Add ShowLow option on widget. Default arg is True

Parameters:

show (bool) – Show Low?

Return type:

None

show_minor_ticks(show=True)

Add show minor ticks option on widget. Default arg value is True

Parameters:

show (bool) – Show minor ticks?

Return type:

None

show_scale(show=True)

Add show scale option on widget. Default arg value is True

Parameters:

show (bool) – Show scale?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Scrollbar(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Horizontal, _ShowValueTip, _AlarmBorder, _MinMax, _LimitsFromPV, _BarLength, _Increment, _Enabled

Scrollbar Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

bar_length(val)

Change bar length property of widget

Parameters:

val (Union[float, int]) – Bar length value

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal(val)

Change horizontal property of widget

Parameters:

val (bool) – Is widget horizontal?

Return type:

None

increment(val)

Change increment property for widget

Parameters:

val (Union[float, int]) – Increment value

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_value_tip(val)

Change Show Value Tip property to widget

Parameters:

val (bool) – Show value tip?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.SlideButton(name, label, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Bit, _Label, _OffColor, _OnColor, _Font, _ForegroundColor, _AutoSize, _AlarmBorder, _Enabled, _Confirmation

SlideButton Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

auto_size(auto=True)

Change auto size property on widget. Default arg is True

Parameters:

auto (bool) – Auto size widget?

Return type:

None

bit(val=-1)

Add bit property to widget. Default arg is -1

Parameters:

val (int) – Bit number

Return type:

None

confirmation_dialog(message, password=None)

Add confirmation dialog to widget, i.e. Are you sure? . Default arg for password is None (no pw)

Parameters:
  • message (str) – Confirmation dialog message

  • password (Optional[str]) – Password for dialog. Stored in plain text XML

Return type:

None

disable_confirmation_dialog()

Turn off confirmation dialog for widget

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

label(val)

Add label to widget

Parameters:

val (str) – Label

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

off_color(red, green, blue, alpha=255)

Add Off color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

on_color(red, green, blue, alpha=255)

Add On color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_off_color(name)

Add named color for Off Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_on_color(name)

Add named color for On Color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Spinner(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Format, _Precision, _ShowUnits, _ForegroundColor, _BackgroundColor, _ButtonsOnLeft, _AlarmBorder, _MinMax, _LimitsFromPV, _Increment, _Enabled

Spinner Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

buttons_on_left(val)

Change buttons on the left property option for widget

Parameters:

val (bool) – Have button on the left?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

format(format_val)

Add format property to widget, i.e. Decimal, Exponential, Engineering, String, etc

Parameters:

format_val (str) – Format String name

Return type:

None

Returns:

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

increment(val)

Change increment property for widget

Parameters:

val (Union[float, int]) – Increment value

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

precision(val)

Add precision value to widget

Parameters:

val (int) – Precision value

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_units(show=True)

Change show units property to widget. Default arg is True

Parameters:

show (bool) – Show units?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.StripChart(name, x, y, width, height)

Bases: _Widget, _ForegroundColor, _BackgroundColor, _ShowToolbar, _Title, _TitleFont, _ShowLegend, _ShowGrid, _TimeRange, _LabelFont, _ScaleFont, _YAxes, _Traces

StripChart Phoebus Widget

add_trace(trace)

Add trace property to widget

Parameters:

trace (object) – trace object

Return type:

None

add_y_axis(axis)

Add y-axis property to widget

Parameters:

axis (object) – y-axis object

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

label_font_family(family)

Change label font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

label_font_size(size)

Change label font size property for widget

Parameters:

size (int) – Font size

Return type:

None

label_font_style_bold()

Change label font style to Bold

Return type:

None

label_font_style_bold_italic()

Change label font style to Bold & Italic

Return type:

None

label_font_style_italic()

Change label font style to Italic

Return type:

None

label_font_style_regular()

Change label font style to Regular

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_label_font(name)

Add named label font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_scale_font(name)

Add named scale font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_title_font(name)

Add named title font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

remove_trace(trace)

Removes trace from widget

Parameters:

trace (object) – trace object

Return type:

None

remove_y_axis(axis)

Removes y-axis from widget

Parameters:

axis (object) – y-axis object

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

scale_font_family(family)

Change scale font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

scale_font_size(size)

Change scale font size property for widget

Parameters:

size (int) – Font size

Return type:

None

scale_font_style_bold()

Change scale font style to Bold

Return type:

None

scale_font_style_bold_italic()

Change scale font style to Bold & Italic

Return type:

None

scale_font_style_italic()

Change scale font style to Italic

Return type:

None

scale_font_style_regular()

Change scale font style to Regular

Return type:

None

show_grid(show_grid=True)

Add show grid property to widget. Default arg is True

Parameters:

show_grid (bool) – Show grid?

Return type:

None

show_legend(show_legend=True)

Add show legend property to widget. Default arg is True

Parameters:

show_legend (bool) – Show legend?

Return type:

None

show_toolbar(val)

Change option to show toolbar property option for the widget

Parameters:

val (bool) – Show toolbar?

Return type:

None

time_range(time_range)

Add time range of plot to widget

Parameters:

time_range (str) – Time range of plot, i.e. “5 minutes”, “1 hour”, etc

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

title_font_family(family)

Change title font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

title_font_size(size)

Change title font size property for widget

Parameters:

size (int) – Font size

Return type:

None

title_font_style_bold()

Change title font style to Bold

Return type:

None

title_font_style_bold_italic()

Change title font style to Bold & Italic

Return type:

None

title_font_style_italic()

Change title font style to Italic

Return type:

None

title_font_style_regular()

Change title font style to Regular

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.StripChartTrace

Bases: _Generic, _Name, _YPV, _Axis, _TraceType, _Color, _LineWidth, _PointType, _PointSize

axis(axis)

Determine which y-axis the trace is for

Parameters:

axis (int) – Trace y-axis

Return type:

None

color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

name(name)

Change trace name

Parameters:

name (str) – Trace name

Return type:

None

point_size(size)

Set trace point size

Parameters:

size (int) – Trace point size

Return type:

None

point_type_circles()

Change point type to circles

Return type:

None

point_type_diamonds()

Change point type to diamonds

Return type:

None

point_type_none()

Change point type to none

Return type:

None

point_type_squares()

Change point type to squares

Return type:

None

point_type_triangles()

Change point type to triangles

Return type:

None

point_type_x()

Change point type to x

Return type:

None

predefined_color(name)

Add named color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

trace_type_bars()

Change trace_type to bars

Return type:

None

trace_type_error_bars()

Change trace_type to error bars

Return type:

None

trace_type_line()

Change trace_type to line

Return type:

None

trace_type_line_error_bars()

Change trace_type to line & error bars

Return type:

None

trace_type_none()

Change trace_type to none

Return type:

None

trace_type_step()

Change trace_type to step

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

y_pv(pv)

Change trace y_pv value

Parameters:

pv (str) – Trace y_pv

Return type:

None

class phoebusgen.widget.widgets.StripChartYAxis

Bases: _Generic, _Title, _AutoScale, _LogScale, _MinMax, _ShowGrid, _Color

auto_scale(auto_scale)

Add auto scale property to widget

Parameters:

auto_scale (bool) – Auto scale image?

Return type:

None

color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

log_scale(log_scale=True)

Add log scale property to widget. Default arg is True

Parameters:

log_scale (bool) – Use log scale?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

predefined_color(name)

Add named color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

show_grid(show_grid=True)

Add show grid property to widget. Default arg is True

Parameters:

show_grid (bool) – Show grid?

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.Symbol(name, pv_name, x, y, width, height)

Bases: _Widget, _Symbols, _PVName, _BackgroundColor, _InitialIndex, _Rotation, _ShowIndex, _Transparent, _AlarmBorder, _ArrayIndex, _AutoSize, _Enabled, _PreserveRatio

Symbol Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

array_index(index)

Add array index to widget

Parameters:

index (int) – Array index

Return type:

None

auto_size(auto=True)

Change auto size property on widget. Default arg is True

Parameters:

auto (bool) – Auto size widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

initial_index(index)

Add initial index to widget

Parameters:

index (int) – Index

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

preserve_ratio(preserve_ratio=True)

Add preserve ratio option on widget. Default arg value is True

Parameters:

preserve_ratio (bool) – Preserve ratio?

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rotation(val)

Add rotation value for widget

Parameters:

val (Union[float, int]) – Rotation value

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_index(show=True)

Add show index option on widget. Default arg value is True

Parameters:

show (bool) – Show index?

Return type:

None

symbols(symbol_list_or_string)

Add symbol to widget. Symbols can be file name or text symbol

Parameters:

symbol_list_or_string (Union[list, str]) – List of strings/file names or single string/file name

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Table(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _ShowToolbar, _AlarmBorder, _Editable, _SelectRows, _SelectionPV, _Columns

Table Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

column(name, width, editable, options)

Add column property to widget

Parameters:
  • name (str) – Name of column

  • width (int) – Column width

  • editable (bool) – Is column editable?

  • options (Union[list, str]) – List of strings or single string

Return type:

None

editable(val=True)

Change editable property on the widget. Default arg is True

Parameters:

val (bool) – Is widget editable?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

select_rows(select_rows=True)

Add row selection mode to widget. Default arg is True

Parameters:

select_rows (bool) – Are rows selectable?

Return type:

None

selection_pv(name)

Add selection PV to widget

Parameters:

name (str) – PV Name

Return type:

None

show_toolbar(val)

Change option to show toolbar property option for the widget

Parameters:

val (bool) – Show toolbar?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Tabs(name, x, y, width, height)

Bases: _Widget, _Macro, _Tabs, _ActiveTab, _TabHeight, _Font, _BackgroundColor, _Direction

Tabs Phoebus Widget

active_tab(tab_num)

Select active tab number for the widget

Parameters:

tab_num (int) – Tab number to be active on page open

Return type:

None

add_widget(tab_name, elem)

Add widget to a specific tab with given tab_name

Parameters:
  • tab_name (str) – Name of the tab to add widget to

  • elem (object) – <Phoebusgen.widget> Widget to add to tab

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

macro(name, val)

Add macro to widget

Parameters:
  • name (str) – Macro name

  • val (Union[str, int, float]) – Macro value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tab(name)

Add tab to the Tabs widget

Parameters:

name (str) – Tab name, should be unique

Return type:

None

tab_direction_horizontal()

Change tab direction property to horizontal for widget

Return type:

None

tab_direction_vertical()

Change tab direction property to vertical for widget

Return type:

None

tab_height(height)

Add tab height property to widget

Parameters:

height (int) – Height value for tabs

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Tank(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _FillColor, _EmptyColor, _ScaleVisible, _AlarmBorder, _LimitsFromPV, _MinMax

Tank Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

empty_color(red, green, blue, alpha=255)

Add Empty Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

fill_color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_empty_color(name)

Add named Empty Color property to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_fill_color(name)

Add named Fill Color property to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

scale_visible(val)

Change Scale Visible property on widget

Parameters:

val (bool) – Is scale visible?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.TextEntry(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _Format, _Precision, _ShowUnits, _WrapWords, _MultiLine, _AlarmBorder, _Enabled, _Border, _HorizontalAlignment, _VerticalAlignment

TextEntry Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_color(red, green, blue, alpha=255)

Change border color with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_width(width)

Add border width property to widget

Parameters:

width (int) – Border width value

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

format(format_val)

Add format property to widget, i.e. Decimal, Exponential, Engineering, String, etc

Parameters:

format_val (str) – Format String name

Return type:

None

Returns:

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal_alignment_center()

Change horizontal alignment to center

Return type:

None

horizontal_alignment_left()

Change horizontal alignmnet to Left

Return type:

None

horizontal_alignment_right()

Change horizontal alignment to right

Return type:

None

multi_line(val)

Change Multi Line property for widget

Parameters:

val (bool) – Use multi line?

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

precision(val)

Add precision value to widget

Parameters:

val (int) – Precision value

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_border_color(name)

Change border color with named color

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_units(show=True)

Change show units property to widget. Default arg is True

Parameters:

show (bool) – Show units?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

vertical_alignment_bottom()

Change vertical alignment to Bottom

Return type:

None

vertical_alignment_middle()

Change vertical alignment to Middle

Return type:

None

vertical_alignment_top()

Change vertical alignment to Top

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

wrap_words(wrap=True)

Change wrap words property. Default arg value is True

Parameters:

wrap (bool) – Wrap words?

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.TextSymbol(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _Transparent, _HorizontalAlignment, _VerticalAlignment, _Rotation, _WrapWords, _AlarmBorder, _Enabled, _ArrayIndex, _Symbols

TextSymbol Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

array_index(index)

Add array index to widget

Parameters:

index (int) – Array index

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

enabled(val)

Add enabled property to widget

Parameters:

val (bool) – Is widget enabled?

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal_alignment_center()

Change horizontal alignment to center

Return type:

None

horizontal_alignment_left()

Change horizontal alignmnet to Left

Return type:

None

horizontal_alignment_right()

Change horizontal alignment to right

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rotation(val)

Add rotation value for widget

Parameters:

val (Union[float, int]) – Rotation value

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

symbols(symbol_list_or_string)

Add symbol to widget. Symbols can be file name or text symbol

Parameters:

symbol_list_or_string (Union[list, str]) – List of strings/file names or single string/file name

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

vertical_alignment_bottom()

Change vertical alignment to Bottom

Return type:

None

vertical_alignment_middle()

Change vertical alignment to Middle

Return type:

None

vertical_alignment_top()

Change vertical alignment to Top

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

wrap_words(wrap=True)

Change wrap words property. Default arg value is True

Parameters:

wrap (bool) – Wrap words?

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.TextUpdate(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _Font, _ForegroundColor, _BackgroundColor, _Transparent, _Format, _Precision, _ShowUnits, _HorizontalAlignment, _VerticalAlignment, _WrapWords, _RotationStep, _Border, _AlarmBorder

TextUpdate Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_color(red, green, blue, alpha=255)

Change border color with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

border_width(width)

Add border width property to widget

Parameters:

width (int) – Border width value

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

font_family(family)

Change font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

font_size(size)

Change font size property for widget

Parameters:

size (int) – Font size

Return type:

None

font_style_bold()

Change font style to Bold

Return type:

None

font_style_bold_italic()

Change font style to Bold & Italic

Return type:

None

font_style_italic()

Change font style to Italic

Return type:

None

font_style_regular()

Change font style to Regular

Return type:

None

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

format(format_val)

Add format property to widget, i.e. Decimal, Exponential, Engineering, String, etc

Parameters:

format_val (str) – Format String name

Return type:

None

Returns:

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

horizontal_alignment_center()

Change horizontal alignment to center

Return type:

None

horizontal_alignment_left()

Change horizontal alignmnet to Left

Return type:

None

horizontal_alignment_right()

Change horizontal alignment to right

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

precision(val)

Add precision value to widget

Parameters:

val (int) – Precision value

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_border_color(name)

Change border color with named color

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_font(name)

Add named font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rotation_step_0()

Change rotation step value to 0

Return type:

None

rotation_step_180()

Change rotation step value to 180

Return type:

None

rotation_step_90()

Change rotation step value to 90

Return type:

None

rotation_step_negative_90()

Change rotation step value to -90

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_units(show=True)

Change show units property to widget. Default arg is True

Parameters:

show (bool) – Show units?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

transparent(transparent=False)

Change widget transparent property. Default arg is False

Parameters:

transparent (bool) – Is widget transparent?

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

vertical_alignment_bottom()

Change vertical alignment to Bottom

Return type:

None

vertical_alignment_middle()

Change vertical alignment to Middle

Return type:

None

vertical_alignment_top()

Change vertical alignment to Top

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

wrap_words(wrap=True)

Change wrap words property. Default arg value is True

Parameters:

wrap (bool) – Wrap words?

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.Thermometer(name, pv_name, x, y, width, height)

Bases: _Widget, _PVName, _FillColor, _AlarmBorder, _LimitsFromPV, _MinMax

Thermometer Phoebus Widget

alarm_border(val)

Add alarm border property ON/OFF for widget

Parameters:

val (bool) – Add alarm border to widget?

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

fill_color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

limits_from_pv(val)

Change limits from PV property for widget

Parameters:

val (bool) – Use limits from PV?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_fill_color(name)

Add named Fill Color property to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

pv_name(name)

Add PV name to widget

Parameters:

name (str) – PV name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.ThreeDViewer(name, file, x, y, width, height)

Bases: _Widget, _File

ThreeDViewer Phoebus Widget

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

file(val)

Add file name property to widget

Parameters:

val (str) – File name

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.WebBrowser(name, url, x, y, width, height)

Bases: _Widget, _URL, _ShowToolbar

WebBrowser Phoebus Widget

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_toolbar(val)

Change option to show toolbar property option for the widget

Parameters:

val (bool) – Show toolbar?

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

url(url)

Add URL string property for widget

Parameters:

url (str) – URL string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.XYPlot(name, x, y, width, height)

Bases: _Widget, _ForegroundColor, _BackgroundColor, _ShowToolbar, _Title, _TitleFont, _GridColor, _XAxis, _YAxes, _Traces, _Markers

XYPlot Phoebus Widget

add_marker(marker)

Add marker property to widget

Parameters:

marker (object) – marker object

Return type:

None

add_trace(trace)

Add trace property to widget

Parameters:

trace (object) – trace object

Return type:

None

add_x_axis(axis)

Add x-axis property to widget

Parameters:

axis (object) – x-axis object

Return type:

None

add_y_axis(axis)

Add y-axis property to widget

Parameters:

axis (object) – y-axis object

Return type:

None

background_color(red, green, blue, alpha=255)

Add background color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

embedded_javascript_script(js_script, pv_dict, only_trigger_if_connected=True)

Add an embedded JS script to the widget

Parameters:
  • js_script (str) – Usually multi-line string representing the actual JS code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

embedded_python_script(python_script, pv_dict, only_trigger_if_connected=True)

Add an embedded Jython (Python) script to the widget

Parameters:
  • python_script (str) – Usually multi-line string representing the actual python code to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

external_script(file_name, pv_dict, only_trigger_if_connected=True)

Add an external script to the widget, either jython (.py) or javascript (.js)

Parameters:
  • file_name (str) – Path and file name of the external script to attach to widget

  • pv_dict (dict) – Dictionary of PVs for the script, format - { pvName: triggerOnPV }

  • only_trigger_if_connected (bool) – Defaults to True. If False, script will run even if PVs are not connected

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

foreground_color(red, green, blue, alpha=255)

Add foreground color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

grid_color(red, green, blue, alpha=255)

Add grid color property using RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

height(height)

Change widget height

Parameters:

height (int) – height

Return type:

None

name(name)

Change widget name

Parameters:

name (str) – Widget name

Return type:

None

predefined_background_color(name)

Add named background color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_foreground_color(name)

Add named foreground color to widget

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_grid_color(name)

Add named grid color property

Parameters:

name (object) – <phoebusgen.colors> Predefined color name

Return type:

None

predefined_title_font(name)

Add named title font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

remove_marker(marker)

Removes marker from widget

Parameters:

marker (object) – marker object

Return type:

None

remove_trace(trace)

Removes trace from widget

Parameters:

trace (object) – trace object

Return type:

None

remove_x_axis(axis)

Removes x-axis from widget

Parameters:

axis (object) – x-axis object

Return type:

None

remove_y_axis(axis)

Removes y-axis from widget

Parameters:

axis (object) – y-axis object

Return type:

None

rule(name, widget_property, pv_dict, expression_dict, value_as_expression=False)

Add a rule to the widget to control a property based on some logic

Parameters:
  • name (str) – Name of the rule

  • widget_property (str) – Property for rule to control, i.e. name, foreground_color, etc.

  • pv_dict (dict) – Dictionary of PVs for the rule, format - { pvName: triggerOnPV }

  • expression_dict (dict) – Dictionary of expressions for the rules, format - { boolean expression : value }

  • value_as_expression (bool) – Defaults to False. If True, use value as expression

Return type:

None

show_toolbar(val)

Change option to show toolbar property option for the widget

Parameters:

val (bool) – Show toolbar?

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

title_font_family(family)

Change title font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

title_font_size(size)

Change title font size property for widget

Parameters:

size (int) – Font size

Return type:

None

title_font_style_bold()

Change title font style to Bold

Return type:

None

title_font_style_bold_italic()

Change title font style to Bold & Italic

Return type:

None

title_font_style_italic()

Change title font style to Italic

Return type:

None

title_font_style_regular()

Change title font style to Regular

Return type:

None

tool_tip(tool_tip)

Add tool tip string to widget

Parameters:

tool_tip (str) – Tool tip string

Return type:

None

version(version)

Change widget version in root widget. i.e. <widget type=”textupdate” version=”2.0.0”>

Parameters:

version (str) – Version string

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

width(width)

Change widget width

Parameters:

width (int) – Width

Return type:

None

x(val)

Change widget x position

Parameters:

val (int) – x

Return type:

None

y(val)

Change widget y position

Parameters:

val (int) – y

Return type:

None

class phoebusgen.widget.widgets.XYPlotTrace

Bases: StripChartTrace, _XPV, _ErrPV, _LineStyle

axis(axis)

Determine which y-axis the trace is for

Parameters:

axis (int) – Trace y-axis

Return type:

None

color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

err_pv(pv)

Change trace err_pv value

Parameters:

pv (str) – Trace err_pv

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

line_style_dash_dot()

Change line style to dash-dot

Return type:

None

line_style_dash_dot_dot()

Change line style to dash-dot-dot

Return type:

None

line_style_dashed()

Change line style to dashed

Return type:

None

line_style_dot()

Change line style to dot

Return type:

None

line_style_solid()

Change line style to solid

Return type:

None

line_width(width)

Add line width property to widget

Parameters:

width (int) – Line width

Return type:

None

name(name)

Change trace name

Parameters:

name (str) – Trace name

Return type:

None

point_size(size)

Set trace point size

Parameters:

size (int) – Trace point size

Return type:

None

point_type_circles()

Change point type to circles

Return type:

None

point_type_diamonds()

Change point type to diamonds

Return type:

None

point_type_none()

Change point type to none

Return type:

None

point_type_squares()

Change point type to squares

Return type:

None

point_type_triangles()

Change point type to triangles

Return type:

None

point_type_x()

Change point type to x

Return type:

None

predefined_color(name)

Add named color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

trace_type_bars()

Change trace_type to bars

Return type:

None

trace_type_error_bars()

Change trace_type to error bars

Return type:

None

trace_type_line()

Change trace_type to line

Return type:

None

trace_type_line_error_bars()

Change trace_type to line & error bars

Return type:

None

trace_type_none()

Change trace_type to none

Return type:

None

trace_type_step()

Change trace_type to step

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

x_pv(pv)

Change trace x_pv value

Parameters:

pv (str) – Trace x_pv

Return type:

None

y_pv(pv)

Change trace y_pv value

Parameters:

pv (str) – Trace y_pv

Return type:

None

class phoebusgen.widget.widgets.XYPlotXAxis

Bases: _Generic, _Title, _AutoScale, _LogScale, _MinMax, _ShowGrid, _TitleFont, _ScaleFont

auto_scale(auto_scale)

Add auto scale property to widget

Parameters:

auto_scale (bool) – Auto scale image?

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

log_scale(log_scale=True)

Add log scale property to widget. Default arg is True

Parameters:

log_scale (bool) – Use log scale?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

predefined_scale_font(name)

Add named scale font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_title_font(name)

Add named title font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

scale_font_family(family)

Change scale font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

scale_font_size(size)

Change scale font size property for widget

Parameters:

size (int) – Font size

Return type:

None

scale_font_style_bold()

Change scale font style to Bold

Return type:

None

scale_font_style_bold_italic()

Change scale font style to Bold & Italic

Return type:

None

scale_font_style_italic()

Change scale font style to Italic

Return type:

None

scale_font_style_regular()

Change scale font style to Regular

Return type:

None

show_grid(show_grid=True)

Add show grid property to widget. Default arg is True

Parameters:

show_grid (bool) – Show grid?

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

title_font_family(family)

Change title font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

title_font_size(size)

Change title font size property for widget

Parameters:

size (int) – Font size

Return type:

None

title_font_style_bold()

Change title font style to Bold

Return type:

None

title_font_style_bold_italic()

Change title font style to Bold & Italic

Return type:

None

title_font_style_italic()

Change title font style to Italic

Return type:

None

title_font_style_regular()

Change title font style to Regular

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

class phoebusgen.widget.widgets.XYPlotYAxis

Bases: StripChartYAxis, _TitleFont, _ScaleFont, _OnRight, _Color

auto_scale(auto_scale)

Add auto scale property to widget

Parameters:

auto_scale (bool) – Auto scale image?

Return type:

None

color(red, green, blue, alpha=255)

Add Fill Color property to widget with RGB values

Parameters:
  • red (int) – 0-255

  • green (int) – 0-255

  • blue (int) – 0-255

  • alpha (int) – 0-255. Default is 255

Return type:

None

find_element(tag)

Find first XML element in widget by tag name

Parameters:

tag (str) – Tag name to search for

Return type:

Element

Returns:

Return XML element or None if not found

get_element_value(tag)

Get value of an XML element by tag name

Parameters:

tag (str) – Tag name to get value from

Return type:

str

Returns:

Value of XML tag

log_scale(log_scale=True)

Add log scale property to widget. Default arg is True

Parameters:

log_scale (bool) – Use log scale?

Return type:

None

maximum(val)

Add maximum value property to widget

Parameters:

val (Union[float, int]) – Maximum value

Return type:

None

minimum(val)

Add minimum value property to widget

Parameters:

val (Union[float, int]) – Minimum value

Return type:

None

on_right(right)

Change y-axis position on screen (left or right) :type right: bool :param right: Is y-axis on right side of screen?

Return type:

None

predefined_color(name)

Add named color to widget :type name: object :param name: <phoebusgen.colors> Predefined color name

Return type:

None

predefined_scale_font(name)

Add named scale font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

predefined_title_font(name)

Add named title font property to widget

Parameters:

name (object) – <phoebusgen.fonts> Font name

Return type:

None

remove_element(tag)

Delete XML element in widget by tag name

Parameters:

tag (str) – Tag name to delete

Return type:

None

scale_font_family(family)

Change scale font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

scale_font_size(size)

Change scale font size property for widget

Parameters:

size (int) – Font size

Return type:

None

scale_font_style_bold()

Change scale font style to Bold

Return type:

None

scale_font_style_bold_italic()

Change scale font style to Bold & Italic

Return type:

None

scale_font_style_italic()

Change scale font style to Italic

Return type:

None

scale_font_style_regular()

Change scale font style to Regular

Return type:

None

show_grid(show_grid=True)

Add show grid property to widget. Default arg is True

Parameters:

show_grid (bool) – Show grid?

Return type:

None

title(title)

Add title to widget

Parameters:

title (str) – Title

Return type:

None

title_font_family(family)

Change title font family property for widget

Parameters:

family (str) – Font Family name

Return type:

None

title_font_size(size)

Change title font size property for widget

Parameters:

size (int) – Font size

Return type:

None

title_font_style_bold()

Change title font style to Bold

Return type:

None

title_font_style_bold_italic()

Change title font style to Bold & Italic

Return type:

None

title_font_style_italic()

Change title font style to Italic

Return type:

None

title_font_style_regular()

Change title font style to Regular

Return type:

None

visible(visible)

Change visible property for widget

Parameters:

visible (bool) – Is widget visible?

Return type:

None

Module contents

phoebusgen.widget Module

This module contains Python class representations of each widget. Widgets can be created by calling the widget class constructor, i.e. phoebusgen.widget.TextUpdate(…) or phoebusgen.widget.ScaledSlider(…). Once the class is created and assigned to a Python variable, additional methods to change widget properties are available.

Example:
>>> import phoebusgen
>>> text_update_widget = phoebusgen.widget.TextUpdate('test widget', 'TEST:PV', 10, 20, 20, 50)
>>> text_update_widget.predefined_foreground_color(phoebusgen.colors.OK)
>>> text_update_widget.font_style_bold()
>>> print(text_update_widget)
<?xml version="1.0" ?>
<widget type="textupdate" version="2.0.0">
  <name>test widget</name>
  <x>10</x>
  <y>20</y>
  <width>20</width>
  <height>50</height>
  <pv_name>TEST:PV</pv_name>
  <foreground_color>
    <color name="OK" red="0" green="255" blue="0" alpha="255"/>
  </foreground_color>
  <font>
    <font family="Liberation Sans" size="14" style="BOLD"/>
  </font>
</widget>