Skip to content

Commit

Permalink
gmoccapy: take starting values for spindle bar from INI file
Browse files Browse the repository at this point in the history
  • Loading branch information
hansu committed Nov 17, 2024
1 parent 783e33a commit 3b30e1e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions configs/sim/gmoccapy/gmoccapy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
16 changes: 10 additions & 6 deletions docs/src/gui/gmoccapy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -501,9 +504,10 @@ DISPLAY = gmoccapy <log_level_param>
using these parameters:
----
Log level <log_level_param>
VERBOSE -v
DEBUG -d
INFO -i
VERBOSE -v
WARNING -w
ERROR -q
----

Expand Down Expand Up @@ -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.
+
Expand Down
11 changes: 5 additions & 6 deletions src/emc/usr_intf/gmoccapy/gmoccapy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 3b30e1e

Please sign in to comment.