From 3b30e1e4535e3dc6a3301f824252d53387165098 Mon Sep 17 00:00:00 2001 From: Hans Unzner Date: Thu, 7 Nov 2024 16:06:36 +0100 Subject: [PATCH] gmoccapy: take starting values for spindle bar from INI file --- configs/sim/gmoccapy/gmoccapy.ini | 8 ++++---- docs/src/gui/gmoccapy.adoc | 16 ++++++++++------ src/emc/usr_intf/gmoccapy/gmoccapy.py | 11 +++++------ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/configs/sim/gmoccapy/gmoccapy.ini b/configs/sim/gmoccapy/gmoccapy.ini index 96e741e7541..714125c4b8f 100644 --- a/configs/sim/gmoccapy/gmoccapy.ini +++ b/configs/sim/gmoccapy/gmoccapy.ini @@ -26,16 +26,16 @@ MAX_FEED_OVERRIDE = 1.5 MAX_SPINDLE_0_OVERRIDE = 1.2 MIN_SPINDLE_0_OVERRIDE = 0.5 -# Initial value for spindle speed -DEFAULT_SPINDLE_0_SPEED = 450 +# Initial values for spindle speed settings +DEFAULT_SPINDLE_0_SPEED = 500 +MIN_SPINDLE_0_SPEED = 0 +MAX_SPINDLE_0_SPEED = 3000 # Those are not used, added here to suppress warnings # see TRAJ section MIN_LINEAR_VELOCITY = 0 MAX_LINEAR_VELOCITY = 166 DEFAULT_LINEAR_VELOCITY = 100 -MIN_SPINDLE_0_SPEED = 0 -MAX_SPINDLE_0_SPEED = 3000 # Prefix to be used PROGRAM_PREFIX = ../../nc_files/ diff --git a/docs/src/gui/gmoccapy.adoc b/docs/src/gui/gmoccapy.adoc index 71c3cb23fc8..a0e354e1050 100644 --- a/docs/src/gui/gmoccapy.adoc +++ b/docs/src/gui/gmoccapy.adoc @@ -110,8 +110,11 @@ So let us take a closer look at the INI file and what you need to include to use DISPLAY = gmoccapy PREFERENCE_FILE_PATH = gmoccapy_preferences MAX_FEED_OVERRIDE = 1.5 -MAX_SPINDLE_OVERRIDE = 1.2 -MIN_SPINDLE_OVERRIDE = 0.5 +MAX_SPINDLE_0_OVERRIDE = 1.2 +MIN_SPINDLE_0_OVERRIDE = 0.5 +DEFAULT_SPINDLE_0_SPEED = 500 +MIN_SPINDLE_0_SPEED = 0 +MAX_SPINDLE_0_SPEED = 3000 LATHE = 1 BACK_TOOL_LATHE = 1 PROGRAM_PREFIX = ../../nc_files/ @@ -134,7 +137,7 @@ If you only want to use one file for several machines, you need to include `PREF [NOTE] If no value is given, it will be set to 1.0. -- _MIN_SPINDLE_OVERRIDE = 0.5_ and _MAX_SPINDLE_OVERRIDE = 1.2_ - Will allow you to change the spindle override within a limit from 50% to 120%. +- _MIN_SPINDLE_0_OVERRIDE = 0.5_ and _MAX_SPINDLE_0_OVERRIDE = 1.2_ - Will allow you to change the spindle override within a limit from 50% to 120%. + [NOTE] If no values are given, MIN will be set to 0.1 and MAX to 1.0. @@ -171,8 +174,8 @@ First `linuxcnc/nc_files` and then the users home directory. If not set, half of 'MAX_LINEAR_VELOCITY' will be used. If that value is also not given, it will default to 180. -// max. jog velocity? - _MAX_LINEAR_VELOCITY = 230.0_ - Sets the maximal velocity of the machine. +This value will also be the maximum linear jog velocity. + [NOTE] Defaults to 600 if not set. @@ -501,9 +504,10 @@ DISPLAY = gmoccapy using these parameters: ---- Log level +VERBOSE -v DEBUG -d INFO -i -VERBOSE -v +WARNING -w ERROR -q ---- @@ -1296,7 +1300,7 @@ By default all scales are set using the calculation: (MAX - MIN)/100 ---- - +[[gmoccapy-settings-spindle]] .Spindle * _Starting RPM_ - Sets the rpm to be used if the spindle is started and no S value has been set. + diff --git a/src/emc/usr_intf/gmoccapy/gmoccapy.py b/src/emc/usr_intf/gmoccapy/gmoccapy.py index dd826225b17..5f701e725e6 100644 --- a/src/emc/usr_intf/gmoccapy/gmoccapy.py +++ b/src/emc/usr_intf/gmoccapy/gmoccapy.py @@ -582,8 +582,11 @@ def _get_pref_data(self): self.scale_rapid_override = self.prefs.getpref("scale_rapid_override", 1, float) # the velocity settings - self.min_spindle_rev = self.prefs.getpref("spindle_bar_min", 0.0, float) - self.max_spindle_rev = self.prefs.getpref("spindle_bar_max", 6000.0, float) + # if there is a INI Entry for default, min and max spindle speed, we will use that one as default + # but if there is a setting in our preference file, that one will ignore the INI entry + self.spindle_start_rpm = self.prefs.getpref( 'spindle_start_rpm', self.INI.DEFAULT_SPINDLE_0_SPEED, float ) + self.min_spindle_rev = self.prefs.getpref("spindle_bar_min", self.INI.MIN_SPINDLE_0_SPEED, float) + self.max_spindle_rev = self.prefs.getpref("spindle_bar_max", self.INI.MAX_SPINDLE_0_SPEED, float) self.turtle_jog_factor = self.prefs.getpref('turtle_jog_factor', 20, int) self.hide_turtle_jog_button = self.prefs.getpref("hide_turtle_jog_button", False, bool) @@ -592,10 +595,6 @@ def _get_pref_data(self): self.toggle_readout = self.prefs.getpref("toggle_readout", True, bool) - # if there is a INI Entry for default spindle speed, we will use that one as default - # but if there is a setting in our preference file, that one will beet the INI entry - default_spindle_speed = self.INI.DEFAULT_SPINDLE_0_SPEED - self.spindle_start_rpm = self.prefs.getpref( 'spindle_start_rpm', default_spindle_speed, float ) self.kbd_height = self.prefs.getpref("kbd_height", 250, int) self.kbd_width = self.prefs.getpref("kbd_width", 880, int)