sivicncdriver.ui.interface module

The interface module

Provides the MainWindow class.

class sivicncdriver.ui.interface.MainWindow[source]

Bases: PyQt5.QtWidgets.QMainWindow, sivicncdriver.ui.main_window.Ui_MainWindow

The main window of the application.

about_license()[source]

Displays informations about the license.

about_qt()[source]

Displays informations about Qt.

auto_cmd()[source]

Sends auto commands using a thread if they are too long.

choose_file()[source]

Sets the gcode file.

close_file()[source]

Close the current file.

config_as_dict()[source]

Get the configuration as a dict.

Returns:The configuration as a dict.
Return type:dict
connectUi()[source]

Connects The UI signals and slots.

draw_file(gcode=None)[source]

Draws a gcode file.

Parameters:gcode – gcode to use in place of the one form code_edit.
emergency_stop()[source]
end_preprocessor()[source]

Manages the end of the preprocessing interface.

goto_origin()[source]
highlight_selected_path()[source]
list_configs()[source]

Lists available configurations.

list_serials()[source]

Lists available serials ports.

load_file()[source]

Loads a gcode file.

manage_auto_cmd_number(n)[source]

Enable the widgets for auto commands

manage_connection()[source]

Manages the connection widgets.

manage_emulate_serial_port(s)[source]

Enable widgets for serial port emulation.

parse_error(line)[source]

Handles parsing errors.

Parameters:line – The line where the error occurred.
print(txt, msg_type='operator')[source]

Prints a message on the application console.

Parameters:
  • txt (str) – The message
  • msg_type (str) – The type of the message. Can be “operator”, “machine”, “error” or “info”
reset_config()[source]

Resets the configuration.

run_custom_cmd()[source]

Sends a custom command using a thread.

run_preprocessor()[source]

Runs the preprocessor dialog.

run_thread(gcode, n=None, disable=True, allow_waiting=True)[source]

Run a thread to send the diven gcode. :param gcode: The gcode as a list of commands. :param n: a length for the sending_process. :param disable: Should the ui elements which trigger sending be

disabled ?
Parameters:allow_waiting (bool) – If True and a thread is already running, wait for it to end before sending the command. Else stop the current thread.
save_config(filename=None)[source]

Saves a configuration. :param filename: The name of the file. :type filename: str

save_config_as()[source]

Saves a configuration in a new file.

save_file()[source]

Saves a gcode file.

save_file_as()[source]

Saves a gcode file in a nex file.

send_cmd()[source]

Sends an user command using a thread.

send_config()[source]

Send a configuration to the machine.

send_file()[source]

Send a file using a different thread.

sending_end()[source]

Manages the end of upload. If some commands are waiting, run them at the end.

set_origin()[source]
set_serial_mode(mode)[source]

Change serial mode.

Parameters:mode (str) – can be “manual” or “file”
start_continuous_x_backward()[source]
start_continuous_x_forward()[source]
start_continuous_y_backward()[source]
start_continuous_y_forward()[source]
start_continuous_z_backward()[source]
start_continuous_z_forward()[source]
stop_x()[source]
stop_y()[source]
stop_z()[source]
update_config(i)[source]

Updates the configuration widgets.

update_drawing(highlight_line=None)[source]

Updates the drawing.

Parameters:highlight_line (int) – A line which is to be highlighted.
update_progress(s)[source]

Updates the progress bar.