Skip to content

Commit 41d68b4

Browse files
committed
gmoccapy: use spindle min, max and default directly from INI file (#3497)
1 parent 38f41b7 commit 41d68b4

File tree

4 files changed

+30
-203
lines changed

4 files changed

+30
-203
lines changed

configs/sim/gmoccapy/gmoccapy.ini

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,16 @@ MAX_FEED_OVERRIDE = 1.5
2525
MIN_SPINDLE_0_OVERRIDE = 0.5
2626
MAX_SPINDLE_0_OVERRIDE = 1.2
2727

28-
# Initial value for spindle speed
28+
# Spindel start speed
2929
DEFAULT_SPINDLE_0_SPEED = 450
30+
# Scaling of spindle speed bar
31+
MIN_SPINDLE_0_SPEED = 0
32+
MAX_SPINDLE_0_SPEED = 3000
3033

3134
# The following are not used, added here to suppress warnings (from qt_istat/logger).
3235
DEFAULT_LINEAR_VELOCITY = 35
3336
MIN_LINEAR_VELOCITY = 0
3437
MAX_LINEAR_VELOCITY = 234
35-
MIN_SPINDLE_0_SPEED = 0
36-
MAX_SPINDLE_0_SPEED = 3000
3738

3839
# Prefix to be used
3940
PROGRAM_PREFIX = ../../nc_files/

docs/src/gui/gmoccapy.adoc

Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ So let us take a closer look at the INI file and what you need to include to use
110110
DISPLAY = gmoccapy
111111
PREFERENCE_FILE_PATH = gmoccapy_preferences
112112
MAX_FEED_OVERRIDE = 1.5
113-
MAX_SPINDLE_OVERRIDE = 1.2
114-
MIN_SPINDLE_OVERRIDE = 0.5
115-
DEFAULT_SPINDLE_SPEED = 500
113+
MIN_SPINDLE_0_OVERRIDE = 0.5
114+
MAX_SPINDLE_0_OVERRIDE = 1.2
115+
DEFAULT_SPINDLE_0_SPEED = 500
116+
MIN_SPINDLE_0_SPEED = 0
117+
MAX_SPINDLE_0_SPEED = 3000
116118
LATHE = 1
117119
BACK_TOOL_LATHE = 1
118120
PROGRAM_PREFIX = ../../nc_files/
@@ -135,10 +137,10 @@ If you only want to use one file for several machines, you need to include `PREF
135137
[NOTE]
136138
If no value is given, it will be set to 1.0.
137139

138-
- _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%.
140+
- _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 80% to 120%.
139141
+
140142
[NOTE]
141-
If no values are given, MIN will be set to 0.1 and MAX to 1.0.
143+
If no values are given, MIN will be set to 0.5 and MAX to 1.0.
142144

143145
- _LATHE = 1_ - Set the screen layout to control a lathe.
144146
- _BACK_TOOL_LATHE = 1_ - Is optional and will switch the X axis in a way you need for a back tool lathe.
@@ -154,7 +156,14 @@ See also the <<gmoccapy:lathe-section,Lathe Specific Section>>.
154156
If not specified, GMOCCAPY will look in the following order for NGC files:
155157
First `linuxcnc/nc_files` and then the users home directory.
156158

157-
- _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.
159+
- _DEFAULT_SPINDLE_0_SPEED_ - Sets the rpm to be used if the spindle is started and no S value has been set. Defaults to 200.
160+
- _MIN_SPINDLE_0_SPEED_ - Sets the lower limit of the spindle bar shown in the spindle frame on the main screen. Defaults to 100.
161+
- _MAX_SPINDLE_0_SPEED_ - Sets the upper limit of the spindle bar shown in the spindle frame on the main screen. Defaults to 2500.
162+
163+
[NOTE]
164+
It is no error giving values that didn't match the minimum and maximum speed of the spindle.
165+
If you set _Spindle bar max_ to 2000 and your spindle makes 4000 RPM, only the bar level will be wrong on higher speeds than 2000 RPM.
166+
158167

159168
- _MIN_ANGULAR_VELOCITY_ - Sets the minimal jog velocity of the machine for rotary axes.
160169
- _MAX_ANGULAR_VELOCITY_ - Sets the maximal jog velocity of the machine for rotary axes.
@@ -500,9 +509,10 @@ DISPLAY = gmoccapy <log_level_param>
500509
using these parameters:
501510
----
502511
Log level <log_level_param>
512+
VERBOSE -v
503513
DEBUG -d
504514
INFO -i
505-
VERBOSE -v
515+
WARNING -w
506516
ERROR -q
507517
----
508518

@@ -1298,25 +1308,6 @@ By default all scales are set using the calculation:
12981308
(MAX - MIN)/100
12991309
----
13001310

1301-
[[gmoccapy-settings-spindle]]
1302-
.Spindle
1303-
* _Starting RPM_ - Sets the rpm to be used if the spindle is started and no S value has been set.
1304-
+
1305-
[NOTE]
1306-
This value will be presetted according to your settings in `[DISPLAY] DEFAULT_SPINDLE_SPEED` of your INI file.
1307-
If you change the settings on the settings page, that value will be default from that moment, your INI file will not be modified.
1308-
1309-
* _Spindle bar min_ and _Spindle bar max_ - Sets the limits of the spindle bar shown in the INFO frame on the main screen.
1310-
+
1311-
====
1312-
Default values are: +
1313-
MIN = 0 +
1314-
MAX = 6000
1315-
====
1316-
+
1317-
[NOTE]
1318-
It is no error giving wrong values.
1319-
If you give a maximum of 2000 and your spindle makes 4000 RPM, only the bar level will be wrong on higher speeds than 2000 RPM.
13201311

13211312
.Unlock options
13221313

src/emc/usr_intf/gmoccapy/gmoccapy.glade

Lines changed: 5 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -111,24 +111,6 @@
111111
<property name="value">100</property>
112112
<property name="step-increment">1</property>
113113
</object>
114-
<object class="GtkAdjustment" id="adj_spindle_bar_max">
115-
<property name="upper">100000</property>
116-
<property name="value">6000</property>
117-
<property name="step-increment">50</property>
118-
<signal name="value-changed" handler="on_adj_spindle_bar_max_value_changed" swapped="no"/>
119-
</object>
120-
<object class="GtkAdjustment" id="adj_spindle_bar_min">
121-
<property name="upper">20000</property>
122-
<property name="step-increment">50</property>
123-
<signal name="value-changed" handler="on_adj_spindle_bar_min_value_changed" swapped="no"/>
124-
</object>
125-
<object class="GtkAdjustment" id="adj_start_spindle_RPM">
126-
<property name="lower">50</property>
127-
<property name="upper">20000</property>
128-
<property name="value">300</property>
129-
<property name="step-increment">25</property>
130-
<signal name="value-changed" handler="on_adj_start_spindle_RPM_value_changed" swapped="no"/>
131-
</object>
132114
<object class="GtkAdjustment" id="adj_turtle_jog_factor">
133115
<property name="lower">1</property>
134116
<property name="upper">100</property>
@@ -5341,137 +5323,6 @@ to test your settings.</property>
53415323
<property name="position">0</property>
53425324
</packing>
53435325
</child>
5344-
<child>
5345-
<object class="GtkFrame" id="frm_spindle_settings">
5346-
<property name="visible">True</property>
5347-
<property name="can-focus">False</property>
5348-
<property name="label-xalign">0.5</property>
5349-
<child>
5350-
<!-- n-columns=2 n-rows=3 -->
5351-
<object class="GtkGrid" id="grid_spindle">
5352-
<property name="visible">True</property>
5353-
<property name="can-focus">False</property>
5354-
<property name="margin-start">6</property>
5355-
<property name="margin-end">6</property>
5356-
<property name="margin-top">5</property>
5357-
<property name="margin-bottom">5</property>
5358-
<property name="hexpand">False</property>
5359-
<property name="row-spacing">2</property>
5360-
<property name="column-spacing">3</property>
5361-
<child>
5362-
<object class="GtkLabel" id="lbl_start_rpm">
5363-
<property name="visible">True</property>
5364-
<property name="can-focus">False</property>
5365-
<property name="hexpand">True</property>
5366-
<property name="label" translatable="yes">Starting RPM</property>
5367-
<property name="xalign">0</property>
5368-
</object>
5369-
<packing>
5370-
<property name="left-attach">0</property>
5371-
<property name="top-attach">0</property>
5372-
</packing>
5373-
</child>
5374-
<child>
5375-
<object class="GtkLabel" id="lbl_spindle_min_rpm">
5376-
<property name="visible">True</property>
5377-
<property name="can-focus">False</property>
5378-
<property name="hexpand">True</property>
5379-
<property name="label" translatable="yes">Spindle bar min</property>
5380-
<property name="xalign">0</property>
5381-
</object>
5382-
<packing>
5383-
<property name="left-attach">0</property>
5384-
<property name="top-attach">1</property>
5385-
</packing>
5386-
</child>
5387-
<child>
5388-
<object class="GtkLabel" id="lbl_spindle_max_rpm">
5389-
<property name="visible">True</property>
5390-
<property name="can-focus">False</property>
5391-
<property name="hexpand">True</property>
5392-
<property name="label" translatable="yes">Spindle bar max</property>
5393-
<property name="xalign">0</property>
5394-
</object>
5395-
<packing>
5396-
<property name="left-attach">0</property>
5397-
<property name="top-attach">2</property>
5398-
</packing>
5399-
</child>
5400-
<child>
5401-
<object class="GtkSpinButton" id="sbtn_spindle_start_rpm">
5402-
<property name="visible">True</property>
5403-
<property name="can-focus">True</property>
5404-
<property name="invisible-char">●</property>
5405-
<property name="activates-default">True</property>
5406-
<property name="xalign">1</property>
5407-
<property name="shadow-type">etched-in</property>
5408-
<property name="primary-icon-activatable">False</property>
5409-
<property name="secondary-icon-activatable">False</property>
5410-
<property name="adjustment">adj_start_spindle_RPM</property>
5411-
<property name="climb-rate">1</property>
5412-
<property name="numeric">True</property>
5413-
</object>
5414-
<packing>
5415-
<property name="left-attach">1</property>
5416-
<property name="top-attach">0</property>
5417-
</packing>
5418-
</child>
5419-
<child>
5420-
<object class="GtkSpinButton" id="sbtn_spindle_bar_min">
5421-
<property name="visible">True</property>
5422-
<property name="can-focus">True</property>
5423-
<property name="invisible-char">●</property>
5424-
<property name="activates-default">True</property>
5425-
<property name="xalign">1</property>
5426-
<property name="shadow-type">etched-in</property>
5427-
<property name="primary-icon-activatable">False</property>
5428-
<property name="secondary-icon-activatable">False</property>
5429-
<property name="adjustment">adj_spindle_bar_min</property>
5430-
<property name="climb-rate">1</property>
5431-
<property name="numeric">True</property>
5432-
</object>
5433-
<packing>
5434-
<property name="left-attach">1</property>
5435-
<property name="top-attach">1</property>
5436-
</packing>
5437-
</child>
5438-
<child>
5439-
<object class="GtkSpinButton" id="sbtn_spindle_bar_max">
5440-
<property name="visible">True</property>
5441-
<property name="can-focus">True</property>
5442-
<property name="invisible-char">●</property>
5443-
<property name="activates-default">True</property>
5444-
<property name="width-chars">7</property>
5445-
<property name="xalign">1</property>
5446-
<property name="shadow-type">etched-in</property>
5447-
<property name="primary-icon-activatable">False</property>
5448-
<property name="secondary-icon-activatable">False</property>
5449-
<property name="adjustment">adj_spindle_bar_max</property>
5450-
<property name="climb-rate">1</property>
5451-
<property name="numeric">True</property>
5452-
</object>
5453-
<packing>
5454-
<property name="left-attach">1</property>
5455-
<property name="top-attach">2</property>
5456-
</packing>
5457-
</child>
5458-
</object>
5459-
</child>
5460-
<child type="label">
5461-
<object class="GtkLabel" id="lbl_frm_spindle">
5462-
<property name="visible">True</property>
5463-
<property name="can-focus">False</property>
5464-
<property name="label" translatable="yes">&lt;b&gt;Spindle&lt;/b&gt;</property>
5465-
<property name="use-markup">True</property>
5466-
</object>
5467-
</child>
5468-
</object>
5469-
<packing>
5470-
<property name="expand">False</property>
5471-
<property name="fill">True</property>
5472-
<property name="position">1</property>
5473-
</packing>
5474-
</child>
54755326
<child>
54765327
<object class="GtkFrame" id="frm_unlock">
54775328
<property name="visible">True</property>
@@ -5551,7 +5402,7 @@ to test your settings.</property>
55515402
<packing>
55525403
<property name="expand">False</property>
55535404
<property name="fill">False</property>
5554-
<property name="position">2</property>
5405+
<property name="position">1</property>
55555406
</packing>
55565407
</child>
55575408
<child>
@@ -5643,7 +5494,7 @@ to test your settings.</property>
56435494
<packing>
56445495
<property name="expand">False</property>
56455496
<property name="fill">False</property>
5646-
<property name="position">3</property>
5497+
<property name="position">2</property>
56475498
</packing>
56485499
</child>
56495500
<child>
@@ -5658,6 +5509,9 @@ to test your settings.</property>
56585509
<child>
56595510
<placeholder/>
56605511
</child>
5512+
<child>
5513+
<placeholder/>
5514+
</child>
56615515
</object>
56625516
<packing>
56635517
<property name="expand">True</property>

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ def __init__(self, argv):
373373
self.widgets["ntb_button"].show()
374374

375375
# the velocity settings
376-
self.widgets.adj_spindle_bar_min.set_value(self.min_spindle_rev)
377-
self.widgets.adj_spindle_bar_max.set_value(self.max_spindle_rev)
378376
self.widgets.spindle_feedback_bar.set_property("min", float(self.min_spindle_rev))
379377
self.widgets.spindle_feedback_bar.set_property("max", float(self.max_spindle_rev))
380378

@@ -468,7 +466,6 @@ def __init__(self, argv):
468466

469467
self.widgets.chk_toggle_readout.set_active(self.toggle_readout)
470468

471-
self.widgets.adj_start_spindle_RPM.set_value(self.spindle_start_rpm)
472469
self.widgets.gcode_view.set_editable(False)
473470
self.widgets.ntb_user_tabs.remove_page(0)
474471

@@ -626,8 +623,9 @@ def _get_pref_data(self):
626623
self.scale_rapid_override = self.prefs.getpref("scale_rapid_override", 1, float)
627624

628625
# the velocity settings
629-
self.min_spindle_rev = self.prefs.getpref("spindle_bar_min", 0.0, float)
630-
self.max_spindle_rev = self.prefs.getpref("spindle_bar_max", 6000.0, float)
626+
self.spindle_start_rpm = self.INI.DEFAULT_SPINDLE_0_SPEED
627+
self.min_spindle_rev = self.INI.MIN_SPINDLE_0_SPEED
628+
self.max_spindle_rev = self.INI.MAX_SPINDLE_0_SPEED
631629

632630
self.turtle_jog_factor = self.prefs.getpref('turtle_jog_factor', 20, int)
633631
self.hide_turtle_jog_button = self.prefs.getpref("hide_turtle_jog_button", False, bool)
@@ -636,10 +634,7 @@ def _get_pref_data(self):
636634

637635
self.toggle_readout = self.prefs.getpref("toggle_readout", True, bool)
638636

639-
# if there is a INI Entry for default spindle speed, we will use that one as default
640-
# but if there is a setting in our preference file, that one will beet the INI entry
641-
default_spindle_speed = self.INI.DEFAULT_SPINDLE_0_SPEED
642-
self.spindle_start_rpm = self.prefs.getpref( 'spindle_start_rpm', default_spindle_speed, float )
637+
self.spindle_start_rpm = self.INI.DEFAULT_SPINDLE_0_SPEED
643638

644639
self.kbd_height = self.prefs.getpref("kbd_height", 250, int)
645640
self.kbd_width = self.prefs.getpref("kbd_width", 880, int)
@@ -4520,20 +4515,6 @@ def on_spc_spindle_value_changed(self, widget, data=None):
45204515
except:
45214516
pass
45224517

4523-
def on_adj_start_spindle_RPM_value_changed(self, widget, data=None):
4524-
self.spindle_start_rpm = widget.get_value()
4525-
self.prefs.putpref("spindle_start_rpm", self.spindle_start_rpm, float)
4526-
4527-
def on_adj_spindle_bar_min_value_changed(self, widget, data=None):
4528-
self.min_spindle_rev = widget.get_value()
4529-
self.prefs.putpref("spindle_bar_min", self.min_spindle_rev, float)
4530-
self.widgets.spindle_feedback_bar.set_property("min", self.min_spindle_rev)
4531-
4532-
def on_adj_spindle_bar_max_value_changed(self, widget, data=None):
4533-
self.max_spindle_rev = widget.get_value()
4534-
self.prefs.putpref("spindle_bar_max", self.max_spindle_rev, float)
4535-
self.widgets.spindle_feedback_bar.set_property("max", self.max_spindle_rev)
4536-
45374518
# =========================================================
45384519
# Coolant an mist coolant button
45394520
def on_tbtn_flood_toggled(self, widget, data=None):

0 commit comments

Comments
 (0)