edcon.gui package
Submodules
edcon.gui.connection_widget module
Functionality related to the connection widget.
edcon.gui.gui module
GUI entry point.
- edcon.gui.gui.start_gui(ip_address)
Entry point for the GUI.
edcon.gui.main_window module
Setup code of the main window.
- class edcon.gui.main_window.MainWindow(ip_address)
Bases:
QMainWindowDefines the main window.
- on_tab_change(index)
Callback for tab change events.
- property com
Returns the communication driver. Trys to establish the connection if not yet established.
- connect_function(ip_address)
Establishes the connection using the communication driver.
- get_com_function()
Returns the communication driver. Trys to establish the connection if not yet established.
- pnu_read_function(pnu)
Reads a PNU using the communication driver.
- pnu_write_function(pnu, value)
Writes a PNU using the communication driver.
edcon.gui.motion_tab module
Setup code of the main window.
- class edcon.gui.motion_tab.MotionTab(get_com_function)
Bases:
QWidgetDefines the motion tab widget.
- reset()
Reset the tab to its initial state.
- update_functions()
Updates the content of display labels
- update_homing_status()
Updates the homing feedback label
- update_current_position()
Updates the position display labels
- update_current_velocity()
Updates the content display labels
- on_control_toggled(enable)
Powerstage toggle callback
- Parameters:
enable (bool) – Value determining whether the powerstage should be enabled
- on_powerstage_toggled(enable)
Powerstage toggle callback
- Parameters:
enable (bool) – Value determining whether the powerstage should be enabled
- button_acknowledge_all_clicked()
Acknowledge button callback
- button_start_homing_clicked()
Start homing button callback
- button_jog_negative_pressed()
Jog negative button pressed callback
- button_jog_positive_pressed()
Jog positive button pressed callback
- button_jog_released()
Jog button released callback
- get_single_step_parameters()
Function returning the single step parameters position and velocity
- Returns:
Single step position velocity (int): Single step velocity
- Return type:
position (int)
- button_single_step_negative_clicked()
Single step negative button callback
- button_single_step_positive_clicked()
Single step positive button callback
- button_execute_clicked()
Execute button callback
- button_pause_motion_clicked()
Pause button callback
- button_continue_motion_clicked()
Continue button callback
- button_stop_movement_clicked()
Stop movement button callback
- manage_button_connections(enable)
Manage button connections
- Parameters:
enable (bool) – Value determining whether the buttons should be enabled
edcon.gui.parameter_tab module
Setup code of the main window.
- class edcon.gui.parameter_tab.ParameterTab(pnu_read_func, pnu_write_func)
Bases:
QWidgetDefines the parameter tab widget.
- reset()
Reset the tab to its initial state.
- on_pnu_list_filter_text_changed(text)
Updates the table view content with name filter.
- Parameters:
text (str) – name filter text
- button_pnu_read_clicked()
Button click callback for PNU read.
- button_pnu_write_clicked()
Button click callback for PNU write.
- button_pnu_list_update_clicked()
Button click callback for PNU list update.
edcon.gui.parameter_table_model module
Model for the parameter table widget.
- class edcon.gui.parameter_table_model.PnuDataItem(pnu: int, name: str, data_type: str, parameter_id: str, value: Any)
Bases:
objectClass representing a PNU data item.
- pnu: int
- name: str
- data_type: str
- parameter_id: str
- value: Any
- class edcon.gui.parameter_table_model.ParameterTableModel
Bases:
QAbstractTableModelDefines the model for the parameter table.
- set_name_filter(name_filter)
uses name filter to filter the data
- Parameters:
name_filter (str) – string sequence used to filter the pnu names
- update_all_values(pnu_read_func)
Fill the column “value” for all rows.
- Parameters:
pnu_read_func (function) – function to read a PNU
- update_value(pnu, pnu_read_func)
Fill the column “value” for one row.
- Parameters:
pnu (int) – PNU id
pnu_read_func (function) – function to read a PNU
- Returns:
updated data value or None
- Return type:
list
- data(index, role)
returns the cell value if the role is Qt.DisplayRole
- Parameters:
index (QModelIndex) – index of the cell
role (Qt.DisplayRole) – role of the cell
- Returns:
cell value
- Return type:
Any
- rowCount(index)
returns the number of rows.
- Parameters:
index (QModelIndex) – index of the cell
- Returns:
number of rows
- Return type:
int
- columnCount(index)
returns the number of columns.
- Parameters:
index (QModelIndex) – index of the cell
- Returns:
number of columns
- Return type:
int
- headerData(section, orientation, role)
Used to provide data for the header rows
- Parameters:
section (int) – section
orientation (Qt.Orientation) – orientation
role (Qt.DisplayRole) – role
- Returns:
header value
- Return type:
Any
edcon.gui.processdata_model module
Model for the processdata.
- class edcon.gui.processdata_model.BasicState(value)
Bases:
EnumDefines the states of the basic profidrive state machine.
- SWITCHING_ON_INHIBITED = 0
- READY_FOR_SWITCHING_ON = 1
- SWITCHED_ON = 2
- OPERATION = 3
- UNDEFINED = 7
- class edcon.gui.processdata_model.ProcessDataModel(tgh)
Bases:
QStandardItemModelDefines the process data model.
- clear()
Clears the treeview.
- fault_string()
Returns the fault string.
- basic_state()
Returns the basic state according to current process data words.
- word_names(word_list)
Returns a list of names of words provided in word_list.
- Parameters:
word_list (list) – list of word objects to get names from
- Returns:
iterator of word names
- Return type:
iter
- is_bitwise_word(word_name)
Returns True if telegram attribute word_name is an BitwiseWord.
- Parameters:
word_name (string) – word name
- Returns:
True if word is Bitwiseword
- Return type:
bool
- append_bitwise_word_item(root, name, value, readonly=False)
Append a bitwise word item to provided root.
- Parameters:
root (Qstandarditem) – root item to append to
name (string) – name of bit item
value (bool) – value of bit item
readonly (bool) – read only
- append_word_item(root, name, readonly=False)
Append word item to provided root.
- Parameters:
root (Qstandarditem) – root item to append to
name (string) – name of bit item
value (bool) – value of bit item
readonly (bool) – read only
- populate()
Populates a treeview model using the respective telegram handler
- update_bitwise_words()
Updates all bitwise word item labels
- on_data_changed(index)
Item changed callback for handling item changed events
- Parameters:
index (QModelIndex) – Index of the item that changed
- update()
Updates the content of inputs tree
edcon.gui.processdata_tab module
Setup code of the process data tab.
- class edcon.gui.processdata_tab.ProcessDataTab(get_com_function)
Bases:
QWidgetDefines the process data tab.
- reset()
Reset the tab to its initial state.
- update_functions()
Updates the content of process data tab
- select_telegramhandler()
Select a Telegram handler from the combobox.
- expand_all_button_clicked()
Expand the whole treeview
- toggle_graphicview()
Toggle graphicview button callback
edcon.gui.pyqt_helpers module
Helper functions used for PyQt interaction.
- edcon.gui.pyqt_helpers.style_string(string, color='black', weight=400, font_size=8)
Adds a style to the provided string.
- Parameters:
color (str) – color of the font
weight (int) – weight of the font
- edcon.gui.pyqt_helpers.bold_string(string, color='black', font_size=8)
Adds a bold style to the provided string.
- Parameters:
color (str) – color of the font
- edcon.gui.pyqt_helpers.checkmark()
- Returns:
A bold green checkmark symbol.
- Return type:
string
- edcon.gui.pyqt_helpers.ballot()
- Returns:
A bold red ballot symbol.
- Return type:
string
edcon.gui.state_diagram module
Scene for the state diagram.
- class edcon.gui.state_diagram.StateDiagram
Bases:
QGraphicsSceneDefines the state diagram scene.
- setup_states()
Sets up and adds labeled state rectangles to the scene at specified positions
- add_arrow(start, end, condition_left, condition_right)
Adds arrows and their conditions on the correct place
- Parameters:
start (int) – starting point
end (int) – ending point
condition_left (str) – condition on the left side
condition_right (str) – condition on the right side
offset (int)
- setup_arrows()
“”Setup the positions for the arrows
- update(current_state)
Update the active state in state diagram
- Parameters:
current_state – State to be set as active
edcon.gui.state_diagram_widget module
Functionality related to the connection widget.
Module contents
Test import of pyqt5.