PyDMLineEdit

class pydm.widgets.line_edit.PyDMLineEdit(parent=None, init_channel=None)[source]
class DisplayFormat
apply_conversion(unit)[source]

Convert the current unit to a different one

This function will attempt to find a scalar to convert the current unit type to the desired one and reset the display with the new conversion.

Parameters

unit (str) – String name of desired units

create_unit_options()[source]

Create the menu for displaying possible unit values

The menu is filled with possible unit conversions based on the current PyDMLineEdit. If either the unit is not found in the by the utilities.find_unit_options() function, or, the showUnits attribute is set to False, the menu will tell the user that there are no available conversions

focusOutEvent(event)[source]

Overwrites the function called when a user leaves a PyDMLineEdit without pressing return. Resets the value of the text field to the current channel value.

send_value()[source]

Emit a send_value_signal to update channel value.

The text is cleaned of all units, user-formatting and scale values before being sent back to the channel. This function is attached the ReturnPressed signal of the PyDMLineEdit

set_display()[source]

Set the text display of the PyDMLineEdit.

The original value given by the PV is converted to a text entry based on the current settings for scale value, precision, a user-defined format, and the current units. If the user is currently entering a value in the PyDMLineEdit the text will not be changed.

unit_changed(new_unit)[source]

Accept a unit to display with a channel’s value

The unit may or may not be displayed based on the showUnits attribute. Receiving a new value for the unit causes the display to reset.

value_changed(new_val)[source]

Receive and update the PyDMLineEdit for a new channel value

The actual value of the input is saved as well as the type received. This also resets the PyDMLineEdit display text using set_display()

Parameters

value (str, float or int) – The new value of the channel

widget_ctx_menu()[source]

Fetch the Widget specific context menu which will be populated with additional tools by assemble_tools_menu.

Returns

If the return of this method is None a new QMenu will be created by assemble_tools_menu.

Return type

QMenu or None

write_access_changed(new_write_access)[source]

Change the PyDMLineEdit to read only if write access is denied