sivicncdriver.ui package

Submodules

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]

Looks for selected line in the code_edit, then updates the drawing to highlight the corresponding path.

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 given gcode.

Parameters:
  • gcode (list) – The gcode as a list of commands.
  • n (int) – A length for the sending_process progress bar.
  • disable (bool) – Disable ui elements which trigger sending.
  • allow_waiting (bool) – Adds the command to the waiting queue.
save_config(filename=None)[source]

Saves a configuration.

Parameters:filename (str) – The name of the file.
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.

sivicncdriver.ui.main_window module

class sivicncdriver.ui.main_window.Ui_MainWindow[source]

Bases: object

retranslateUi(MainWindow)[source]
setupUi(MainWindow)[source]

sivicncdriver.ui.preprocessor module

The preprocessor module

Provides the PreprocessorDialog class.

class sivicncdriver.ui.preprocessor.PreprocessorDialog(gcode, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sivicncdriver.ui.preprocessor_window.Ui_dialog

The preprocessor dialog.

accept()[source]
cancel()[source]
get_minimize_bounding_box()[source]

Computes a new origin for the drawing.

remove_useless()[source]

Remove useless things in the code according to the UI options.

run_preprocessor()[source]

Runs the preprocessor on the G-Code.

sivicncdriver.ui.preprocessor_window module

class sivicncdriver.ui.preprocessor_window.Ui_dialog[source]

Bases: object

retranslateUi(dialog)[source]
setupUi(dialog)[source]

sivicncdriver.ui.ressources_rc module

sivicncdriver.ui.ressources_rc.qCleanupResources()[source]
sivicncdriver.ui.ressources_rc.qInitResources()[source]

sivicncdriver.ui.view3d module

class sivicncdriver.ui.view3d.View3D(parent=None, width=5, height=4, dpi=100)[source]

Bases: matplotlib.backends.backend_qt5agg.FigureCanvasQTAgg

Prints G-Codes in 3D.

compute_data(gcode)[source]

Computes the paths generated by a gcode file.

Parameters:gcode (str) – The gcode.
draw(**kwargs)[source]
Parameters:
  • reverse_x (bool) – Should the x axis be reversed ? (default : False)
  • reverse_y (bool) – Should the y axis be reversed ? (default : False)
  • reverse_z (bool) – Should the z axis be reversed ? (default : False)
  • highlight_line (int) – A line which is to be highlighted. (default : None)
get_bounds()[source]

Returns the maximum and the minimum value on each axis.

parse_error

Module contents