Skip to content

Commit 69b09f2

Browse files
authored
Merge pull request #2837 from hansu/gmoccapy-800x600
Gmoccapy: add configuration for 800x600
2 parents e6c81da + 026d897 commit 69b09f2

7 files changed

Lines changed: 323 additions & 9 deletions

File tree

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
# EMC controller parameters for a simulated machine.
2+
# General note: Comments can either be preceded with a # or ; - either is
3+
# acceptable, although # is in keeping with most linux config files.
4+
5+
# General section -------------------------------------------------------------
6+
[EMC]
7+
VERSION = 1.1
8+
MACHINE = gmoccapy_800x600
9+
DEBUG = 0
10+
11+
# Sections for display options ------------------------------------------------
12+
[DISPLAY]
13+
DISPLAY = gmoccapy -i
14+
# Log level:
15+
# DEBUG -d
16+
# INFO -i
17+
# VERBOSE -v
18+
# ERROR -q
19+
20+
# Cycle time, in milliseconds, that display will sleep between polls
21+
CYCLE_TIME = 100
22+
23+
# Values that will be allowed for override, 1.0 = 100%
24+
MAX_FEED_OVERRIDE = 1.5
25+
MAX_SPINDLE_OVERRIDE = 1.2
26+
MIN_SPINDLE_OVERRIDE = 0.5
27+
28+
# Max and default jog speeds in units per second
29+
MAX_LINEAR_VELOCITY = 166
30+
DEFAULT_LINEAR_VELOCITY = 100
31+
MAX_ANGULAR_VELOCITY = 234
32+
DEFAULT_SPINDLE_SPEED = 450
33+
34+
# Prefix to be used
35+
PROGRAM_PREFIX = ../../nc_files/
36+
37+
USER_COMMAND_FILE=gmoccapy_800x600.py
38+
39+
# Introductory graphic
40+
INTRO_GRAPHIC = linuxcnc.gif
41+
INTRO_TIME = 5
42+
43+
# list of selectable jog increments
44+
INCREMENTS = 1.000 mm, 0.100 mm, 0.010 mm, 0.001 mm, 1.2345 inch
45+
46+
# for details see nc_files/subroutines/maco_instructions.txt
47+
[FILTER]
48+
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
49+
PROGRAM_EXTENSION = .py Python Script
50+
png = image-to-gcode
51+
gif = image-to-gcode
52+
jpg = image-to-gcode
53+
py = python3
54+
55+
# Task controller section -----------------------------------------------------
56+
[RS274NGC]
57+
RS274NGC_STARTUP_CODE = G17 G21 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9
58+
PARAMETER_FILE = sim.var
59+
SUBROUTINE_PATH = macros
60+
61+
# Motion control section ------------------------------------------------------
62+
[EMCMOT]
63+
EMCMOT = motmod
64+
COMM_TIMEOUT = 1.0
65+
BASE_PERIOD = 100000
66+
SERVO_PERIOD = 1000000
67+
68+
# Hardware Abstraction Layer section --------------------------------------------------
69+
[TASK]
70+
TASK = milltask
71+
CYCLE_TIME = 0.001
72+
73+
# Part program interpreter section --------------------------------------------
74+
[HAL]
75+
HALFILE = core_sim.hal
76+
HALFILE = spindle_sim.hal
77+
HALFILE = simulated_home.hal
78+
79+
# Single file that is executed after the GUI has started.
80+
POSTGUI_HALFILE = gmoccapy_postgui.hal
81+
82+
HALUI = halui
83+
84+
# Trajectory planner section --------------------------------------------------
85+
[HALUI]
86+
#No Content
87+
88+
[TRAJ]
89+
COORDINATES = X Y Z
90+
LINEAR_UNITS = mm
91+
ANGULAR_UNITS = degree
92+
DEFAULT_LINEAR_VELOCITY = 35
93+
MAX_LINEAR_VELOCITY = 234
94+
POSITION_FILE = position.txt
95+
# NO_FORCE_HOMING = 1
96+
97+
[EMCIO]
98+
EMCIO = io
99+
CYCLE_TIME = 0.100
100+
101+
# tool table file
102+
TOOL_TABLE = tool.tbl
103+
TOOL_CHANGE_POSITION = 100 100 -10
104+
TOOL_CHANGE_QUILL_UP = 1
105+
106+
[KINS]
107+
KINEMATICS = trivkins coordinates=xyz
108+
JOINTS = 3
109+
110+
[AXIS_X]
111+
MIN_LIMIT = -400.0
112+
MAX_LIMIT = 400.0
113+
MAX_VELOCITY = 166
114+
MAX_ACCELERATION = 1500.0
115+
116+
[JOINT_0]
117+
TYPE = LINEAR
118+
MAX_VELOCITY = 166
119+
MAX_ACCELERATION = 1500.0
120+
BACKLASH = 0.000
121+
INPUT_SCALE = 4000
122+
OUTPUT_SCALE = 1.000
123+
MIN_LIMIT = -400.0
124+
MAX_LIMIT = 400.0
125+
FERROR = 0.050
126+
MIN_FERROR = 0.010
127+
HOME_OFFSET = 0.0
128+
HOME = 10
129+
HOME_SEARCH_VEL = 200.0
130+
HOME_LATCH_VEL = 20.0
131+
HOME_USE_INDEX = NO
132+
HOME_IGNORE_LIMITS = NO
133+
HOME_SEQUENCE = 1
134+
HOME_IS_SHARED = 1
135+
136+
# Second axis
137+
[AXIS_Y]
138+
MIN_LIMIT = -400.0
139+
MAX_LIMIT = 400.0
140+
MAX_VELOCITY = 166
141+
MAX_ACCELERATION = 1500.0
142+
143+
[JOINT_1]
144+
TYPE = LINEAR
145+
MAX_VELOCITY = 166
146+
MAX_ACCELERATION = 1500.0
147+
BACKLASH = 0.000
148+
INPUT_SCALE = 4000
149+
OUTPUT_SCALE = 1.000
150+
MIN_LIMIT = -400.0
151+
MAX_LIMIT = 400.0
152+
FERROR = 0.050
153+
MIN_FERROR = 0.010
154+
HOME_OFFSET = 0.0
155+
HOME = 10
156+
HOME_SEARCH_VEL = 200.0
157+
HOME_LATCH_VEL = 20.0
158+
HOME_USE_INDEX = NO
159+
HOME_IGNORE_LIMITS = NO
160+
HOME_SEQUENCE = 1
161+
162+
# Third axis
163+
[AXIS_Z]
164+
MIN_LIMIT = -400.0
165+
MAX_LIMIT = 0.001
166+
MAX_VELOCITY = 166
167+
MAX_ACCELERATION = 1500.0
168+
169+
[JOINT_2]
170+
TYPE = LINEAR
171+
MAX_VELOCITY = 166
172+
MAX_ACCELERATION = 1500.0
173+
BACKLASH = 0.000
174+
INPUT_SCALE = 4000
175+
OUTPUT_SCALE = 1.000
176+
MIN_LIMIT = -400.0
177+
MAX_LIMIT = 0.001
178+
FERROR = 0.050
179+
MIN_FERROR = 0.010
180+
HOME_OFFSET = 1.0
181+
HOME = -10
182+
HOME_SEARCH_VEL = 200.0
183+
HOME_LATCH_VEL = 20.0
184+
HOME_USE_INDEX = NO
185+
HOME_IGNORE_LIMITS = NO
186+
HOME_SEQUENCE = 0
187+
HOME_IS_SHARED = 1
188+
189+
# section for main IO controller parameters -----------------------------------
190+
[MACROS]
191+
MACRO = go_to_position x-pos y-pos z-pos
192+
MACRO = i_am_lost
193+
MACRO = increment x-incr y-incr
194+
MACRO = macro_4
195+
MACRO = macro_5
196+
MACRO = macro_6
197+
MACRO = macro_7
198+
MACRO = macro_8
199+
MACRO = macro_9
200+
MACRO = macro_10
201+
MACRO = macro_11
202+
MACRO = macro_12
203+
MACRO = macro_13
204+
MACRO = macro_14
205+
MACRO = macro_15
206+
207+
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
from gi.repository import Pango
2+
3+
# reduce size of v-buttons
4+
self.widgets["vbtb_main"].set_size_request(78, -1)
5+
self.widgets["lbl_time"].hide()
6+
self.widgets["vbtb_main"].set_layout(Gtk.ButtonBoxStyle.EXPAND)
7+
vbuttons = self.widgets["vbtb_main"].get_children()
8+
for v in vbuttons:
9+
v.set_size_request(60, 56)
10+
11+
# change layout of h-button boxes to allow smaller spacing & resize buttons
12+
hbuttonboxes = [ "hbtb_main", "hbtb_MDI", "hbtb_auto", "hbtb_ref",
13+
"hbtb_touch_off", "hbtb_setup", "hbtb_edit", "hbtb_tool",
14+
"hbtb_load_file", "hbtb_ref_joints" ]
15+
for b in hbuttonboxes:
16+
self.widgets[b].set_layout(Gtk.ButtonBoxStyle.EXPAND)
17+
children = self.widgets[b].get_children()
18+
for c in children:
19+
c.set_size_request(60, 56)
20+
if type(c) is Gtk.Button:
21+
btn_child = c.get_children()[0]
22+
if type(btn_child) is Gtk.Label:
23+
# btn_child.set_ellipsize(Pango.EllipsizeMode.END)
24+
btn_child.set_line_wrap(True)
25+
btn_child.set_line_wrap_mode(Pango.WrapMode.WORD_CHAR)
26+
27+
# optimize space in jog box
28+
self.widgets["vbtb_jog_incr"].hide()
29+
self.widgets["vbx_jog"].set_size_request(-1, -1)
30+
31+
# second row for gremlin buttons
32+
self.widgets["box_gremlin_buttons"].remove(self.widgets["tbtn_view_dimension"])
33+
self.widgets["box_gremlin_buttons"].remove(self.widgets["tbtn_view_tool_path"])
34+
self.widgets["box_gremlin_buttons"].remove(self.widgets["btn_delete_view"])
35+
self.widgets["btn_zoom_out"].set_margin_end(0)
36+
hbox_gremlin_buttons_2 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
37+
hbox_gremlin_buttons_2.show()
38+
hbox_gremlin_buttons_2.pack_end(self.widgets["btn_delete_view"], False, False, 0)
39+
hbox_gremlin_buttons_2.pack_end(self.widgets["tbtn_view_tool_path"], False, False, 0)
40+
hbox_gremlin_buttons_2.pack_end(self.widgets["tbtn_view_dimension"], False, False, 0)
41+
self.widgets["vbox15"].pack_end(hbox_gremlin_buttons_2, False, False, 3)
42+
43+
# reorder settings page
44+
self.widgets["vbox_window"].remove(self.widgets["frm_ntb_preview"]) # "On Touch off"
45+
self.widgets["vbox_window"].remove(self.widgets["frm_keyboard"])
46+
self.widgets["vbox_dro_settings"].remove(self.widgets["frm_preview"])
47+
self.widgets["vbox_file"].remove(self.widgets["frm_message_position"])
48+
self.widgets["vbox_file"].remove(self.widgets["frm_themes"])
49+
self.widgets["vbox21"].remove(self.widgets["frm_unlock"])
50+
self.widgets["vbox_window"].pack_start(self.widgets["frm_preview"], False, False, 3)
51+
self.widgets["vbox_dro_settings"].pack_start(self.widgets["frm_ntb_preview"], False, False, 3)
52+
vbox_c1 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
53+
vbox_c2 = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
54+
hbox_setup_appearance_2 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL)
55+
hbox_setup_appearance_2.pack_start(vbox_c1, False, False, 3)
56+
hbox_setup_appearance_2.pack_start(vbox_c2, False, False, 3)
57+
hbox_setup_appearance_2.show()
58+
vbox_c1.pack_start(self.widgets["frm_keyboard"], False, False, 3)
59+
vbox_c1.pack_start(self.widgets["frm_message_position"], False, False, 3)
60+
vbox_c2.pack_start(self.widgets["frm_themes"], False, False, 3)
61+
vbox_c2.pack_start(self.widgets["frm_unlock"], False, False, 3)
62+
vbox_c1.show()
63+
vbox_c2.show()
64+
label = Gtk.Label(label=_("Appearance") + " 2")
65+
self.widgets["ntb_setup"].insert_page(hbox_setup_appearance_2, label, 1)
66+
67+
# reorder info box (feed rate, rapid override, spindle and cooling)
68+
self.widgets["box_info"].remove(self.widgets["grid_search"])
69+
self.widgets["box_info"].remove(self.widgets["ntb_info"])
70+
self.widgets["ntb_info"].remove(self.widgets["hbox_main_info"])
71+
self.widgets["hbox_main_info"].remove(self.widgets["box_tool_and_code_info"])
72+
73+
box_info = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
74+
box_info.show()
75+
box_info.pack_start(self.widgets["box_tool_and_code_info"], False, False, 0)
76+
box_info.pack_end(self.widgets["hbox_main_info"], False, False, 0)
77+
self.widgets["ntb_user_tabs"].append_page(box_info, Gtk.Label("Info"))
78+
79+
# enable user tab button to access info box
80+
self.widgets.tbtn_user_tabs.set_sensitive(True)
81+
self.user_tabs_enabled = True
82+
83+
# change default values (not necessary with correct pref file)
84+
self.xpos = 20
85+
self.ypos = 20
86+
self.width = 770
87+
self.height = 580
88+
self.widgets.adj_x_pos.set_value(self.xpos)
89+
self.widgets.adj_y_pos.set_value(self.ypos)
90+
self.widgets.adj_width.set_value(self.width)
91+
self.widgets.adj_height.set_value(self.height)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
GMOCCAPY configuration for a XYZ mill for screens with a resolution of 800x600.
2+
3+
This is done with a user command file specified by
4+
5+
USER_COMMAND_FILE=gmoccapy_800x600.py
6+
7+
This file allows further modification.
8+
For more information see: https://linuxcnc.org/docs/html/gui/gmoccapy.html#_user_command_file
9+

docs/src/gui/gmoccapy.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ https://linuxcnc.org/index.php/english/forum/41-guis/26314-gmoccapy-a-new-screen
5151
http://www.cncecke.de/forum/showthread.php?t=78549[German CNC Ecke Forum] or
5252
https://lists.sourceforge.net/lists/listinfo/emc-users[LinuxCNC users mailing list].
5353

54-
The minimum screen resolution for GMOCCAPY, using it without side panels is *979 x 750 Pixel*, so it should fit to every standard screen.
55-
It is recommended to use screens with minimum resolution of 1024x748.
54+
The minimum screen resolution for GMOCCAPY for the normal layout (without side panels) is *980 x 750 Pixel*, so it should fit to every standard screen.
55+
It is recommended to use screens with minimum resolution of 1024x768.
56+
There is also a configuration which fits for 800x600 screens (indroduced in GMOCCAPY 3.4.8).
5657

5758
== How to Get GMOCCAPY
5859

src/emc/usr_intf/gmoccapy/gmoccapy.glade

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<property name="step-increment">0.10</property>
2323
</object>
2424
<object class="GtkAdjustment" id="adj_height">
25-
<property name="lower">750</property>
25+
<property name="lower">580</property>
2626
<property name="upper">3920</property>
2727
<property name="value">750</property>
2828
<property name="step-increment">1</property>
@@ -121,7 +121,7 @@
121121
<signal name="value-changed" handler="on_adj_turtle_jog_factor_value_changed" swapped="no"/>
122122
</object>
123123
<object class="GtkAdjustment" id="adj_width">
124-
<property name="lower">979</property>
124+
<property name="lower">770</property>
125125
<property name="upper">3920</property>
126126
<property name="value">979</property>
127127
<property name="step-increment">1</property>
@@ -756,8 +756,8 @@
756756
<property name="textview">gcode_view</property>
757757
</object>
758758
<object class="GtkWindow" id="window1">
759-
<property name="width-request">979</property>
760-
<property name="height-request">750</property>
759+
<property name="width-request">770</property>
760+
<property name="height-request">580</property>
761761
<property name="can-focus">False</property>
762762
<property name="title">gmoccapy</property>
763763
<property name="icon">icons/Logo.png</property>
@@ -771,7 +771,6 @@
771771
<property name="orientation">vertical</property>
772772
<child>
773773
<object class="GtkBox" id="hbx_upper">
774-
<property name="visible">True</property>
775774
<property name="can-focus">False</property>
776775
<child>
777776
<object class="GtkBox" id="box_left">
@@ -6083,7 +6082,6 @@ Date</property>
60836082
<child>
60846083
<object class="GtkNotebook" id="ntb_button">
60856084
<property name="height-request">62</property>
6086-
<property name="visible">True</property>
60876085
<property name="can-focus">False</property>
60886086
<property name="show-tabs">False</property>
60896087
<property name="show-border">False</property>

src/emc/usr_intf/gmoccapy/gmoccapy.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ def __init__(self, argv):
347347
self._show_tooledit_tab(False)
348348
self._show_iconview_tab(False)
349349

350+
# those two containers are disabled by default to allow fullscreen
351+
# with smaller display resolutions
352+
self.widgets["hbx_upper"].show()
353+
self.widgets["ntb_button"].show()
354+
350355
# the velocity settings
351356
self.widgets.adj_spindle_bar_min.set_value(self.min_spindle_rev)
352357
self.widgets.adj_spindle_bar_max.set_value(self.max_spindle_rev)
@@ -386,8 +391,9 @@ def __init__(self, argv):
386391

387392
self.widgets.tbtn_view_tool_path.set_active(self.prefs.getpref("view_tool_path", True, bool))
388393
self.widgets.tbtn_view_dimension.set_active(self.prefs.getpref("view_dimension", True, bool))
389-
view = view = self.prefs.getpref("view", "p", str)
394+
view = self.prefs.getpref("view", "p", str)
390395
self.widgets["rbt_view_{0}".format(view)].set_active(True)
396+
self.widgets.gremlin.set_property("view", view)
391397

392398
# get if run from line should be used
393399
rfl = self.prefs.getpref("run_from_line", "no_run", str)

src/emc/usr_intf/gmoccapy/release_notes.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
ver 3.4.8
22
- re-ordered settings pages to have all appearance-related on one page
3+
- add configuration for 800x600 screens
4+
- fix gremlin view p wasn't applied at startup
35

46
ver 3.4.7.1
57
- Remember window size and position when switching back from fullscreen/maximized

0 commit comments

Comments
 (0)