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 27, 2024
1 parent f25db6f commit b6f0d73
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 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
19 changes: 8 additions & 11 deletions docs/src/gui/gmoccapy.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +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
DEFAULT_SPINDLE_SPEED = 500
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 @@ -135,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 All @@ -154,12 +156,6 @@ See also the <<gmoccapy:lathe-section,Lathe Specific Section>>.
If not specified, GMOCCAPY will look in the following order for NGC files:
First `linuxcnc/nc_files` and then the users home directory.

- _DEFAULT_SPINDLE_SPEED_ - Start value for <<gmoccapy-settings-spindle,"Starting RPM">> if value not present in preferences file or file is not present. Will have no effect with valid preferences file.

- _MIN_ANGULAR_VELOCITY_ - Sets the minimal jog velocity of the machine for rotary axes.
- _MAX_ANGULAR_VELOCITY_ - Sets the maximal jog velocity of the machine for rotary axes.
- _DEFAULT_ANGULAR_VELOCITY_ - Sets the default jog velocity of the machine for rotary axes.

- _DEFAULT_SPINDLE_0_SPEED_ - Start value for <<gmoccapy-settings-spindle,"Starting RPM">> if value not present in preferences file or file is not present. Will have no effect with valid preferences file.
- _MIN_SPINDLE_0_SPEED_ - Start value for <<gmoccapy-settings-spindle,"Spindle bar min">>
- _MAX_SPINDLE_0_SPEED_ - Start value for <<gmoccapy-settings-spindle,"Spindle bar max">>
Expand Down Expand Up @@ -507,9 +503,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
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 b6f0d73

Please sign in to comment.