From 889c2a3303e82d618b537db14ffe2c7c62531c40 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Fri, 22 Nov 2024 16:19:01 +0100 Subject: [PATCH] gmoccapy: add progressbar for program progress --- src/emc/usr_intf/gmoccapy/gmoccapy.glade | 55 ++++++++++++++++++------ src/emc/usr_intf/gmoccapy/gmoccapy.py | 6 +++ 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.glade b/src/emc/usr_intf/gmoccapy/gmoccapy.glade index 67a27c047a7..d4f661cd237 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.glade +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.glade @@ -1734,25 +1734,52 @@ - + True - True + False + vertical - - gcode_view + True True - Shows the code to execute - 2 - 2 - True - True - 4 - True - True - False - + + + gcode_view + True + True + Shows the code to execute + 2 + 2 + True + True + 4 + True + True + False + + + + + True + True + 0 + + + + + True + False + 10 + 10 + 5 + True + + + False + True + 1 + diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index 3f9fe0aaeda..822a55ba9b0 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -151,6 +151,9 @@ def __init__(self, argv): #eb_program_label, #eb_blockheight_label { background: rgba(0,0,0,1); } + progress, trough { + min-height: 5px; + } """ screen = Gdk.Screen.get_default() provider = Gtk.CssProvider() @@ -2562,9 +2565,11 @@ def on_hal_status_line_changed(self, widget, line): # this test is only necessary, because of remap and toolchange, it will emit a file loaded signal if self.halcomp["program.length"] > 0: self.halcomp["program.progress"] = 100.00 * line / self.halcomp["program.length"] + self.widgets.progressbar_pgm.set_fraction(line / self.halcomp["program.length"]) else: self.halcomp["program.progress"] = 0.0 # print("Progress = {0:.2f} %".format(100.00 * line / self.halcomp["program.length"])) + self.widgets.progressbar_pgm.set_fraction(0) def on_hal_status_interp_idle(self, widget): LOG.debug("IDLE") @@ -2617,6 +2622,7 @@ def on_hal_status_interp_idle(self, widget): self.halcomp["program.current-line"] = 0 self.halcomp["program.progress"] = 0.0 + self.widgets.progressbar_pgm.set_fraction(0) def on_hal_status_interp_run(self, widget): LOG.debug("RUN")