Skip to content

Commit ba5ca74

Browse files
committed
Merge remote-tracking branch 'origin/2.9'
* origin/2.9: g-code.txt: Minor typos spotted when reading docs qtvcp -istat: fix OINT_RELATIONS_LIST so synced joints are calculated right qtvcp -docs: add details, examples for python rc files qtdagon -docs: add details; tool changer HAL pins, python customization dehian -add lintain overrides for qtvcp's basic probe help files qtvcp -probe basic help: update images, add another page qtvcp -probe_routines: fix a check in calibrate round pocket qtvcp -mdiline: add a function to return the current command text docs: remove obsolete "sign-off" admonition from Contributing doc
2 parents eb5b603 + 78a54b6 commit ba5ca74

36 files changed

Lines changed: 179 additions & 84 deletions

debian/source/lintian-overrides

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,13 @@ linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/versa_usage5.html]
1818
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/versa_usage6.html]
1919
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/versa_usage7.html]
2020
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/versa_usage8.html]
21+
22+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help.html]
23+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help1.html]
24+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help2.html]
25+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help3.html]
26+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help4.html]
27+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help5.html]
28+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help6.html]
29+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help7.html]
30+
linuxcnc source: source-is-missing [share/qtvcp/widgets_ui/basic_help8.html]

docs/src/code/contributing-to-linuxcnc.adoc

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -109,30 +109,18 @@ https://wiki.spheredev.org/index.php/Git_for_the_lazy
109109
The high-level overview of how to contribute changes to the source goes
110110
like this:
111111

112-
* Communicate with the project developers and let us know what you're
113-
hacking on
114-
* Clone the git repo
115-
* Make your changes in a local branch, making sure you "sign off" your commits
116-
according to our signed-off-by policy (see below).
117-
* Adding documentation and <<cha:writing-tests,writing tests>> is
118-
an important part of adding a new feature. Otherwise, others won't
119-
know how to use your feature, and if other changes break your
120-
feature it can go unnoticed without a test.
112+
* Communicate with the project developers and let us know what you're hacking on. Explain what you are doing, and why.
113+
* Clone the git repo.
114+
* Make your changes in a local branch.
115+
* Adding documentation and <<cha:writing-tests,writing tests>> is an important part of adding a new feature. Otherwise, others won't know how to use your feature, and if other changes break your feature it can go unnoticed without a test.
121116
* Share your changes with the other project developers in one of these ways:
122-
** Push your branch to github and create a github pull request to
123-
https://github.com/linuxcnc/linuxcnc (this requires a github account)
124-
** Push your branch to a publicly visible git repo (such as github,
125-
bitbucket, your own publicly-accessible server, etc) and share that
126-
location on the emc-developers mailing list, or
127-
** Email your commits to the LinuxCNC-developers mailing list
128-
(emc-developers@lists.sourceforge.net) (use `git
129-
format-patch` to create the patches)
130-
* Advocate for your patch
131-
** Explain what problem it addresses and why it should be included
132-
in LinuxCNC
117+
** Push your branch to github and create a github pull request to <https://github.com/linuxcnc/linuxcnc> (this requires a github account), or
118+
** Push your branch to a publicly visible git repo (such as github, or your own publicly-accessible server, etc) and share that location on the emc-developers mailing list, or
119+
** Email your commits to the LinuxCNC-developers mailing list (<emc-developers@lists.sourceforge.net>) (use `git format-patch` to create the patches).
120+
* Advocate for your patch:
121+
** Explain what problem it addresses and why it should be included in LinuxCNC.
133122
** Be receptive to questions and feedback from the developer community.
134-
** It is not uncommon for a patch to go through several revisions before
135-
it is accepted.
123+
** It is not uncommon for a patch to go through several revisions before it is accepted.
136124

137125
== git configuration
138126

docs/src/gcode/g-code.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,8 +1855,8 @@ Optional settings
18551855

18561856
* '$-' - The spindle number to which the motion will be synchronised
18571857
(default 0).
1858-
For example is $1 is programmed then the motion will begin on the
1859-
reset od spindle.1.index-enable and proceed in synchrony with the
1858+
For example if $1 is programmed then the motion will begin on the
1859+
reset of spindle.1.index-enable and proceed in synchrony with the
18601860
value of spindle.1.revs
18611861
* 'R-' - The 'depth degression'. 'R1.0' selects constant depth on
18621862
successive threading passes. 'R2.0' selects constant area.

docs/src/gui/qtdragon.adoc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,13 @@ net tool-changed hal_manualtoolchange.changed <= iocontrol.0.tool-changed
448448
net tool-prep-number hal_manualtoolchange.number <= iocontrol.0.tool-prep-number
449449
----
450450

451+
Also if you don't have an automatic tool changer make sure these pins are connected in one of the HAL files:
452+
453+
[source,{hal}]
454+
----
455+
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
456+
----
457+
451458
This input pin should be connected to indicate probe state.
452459

453460
[source,{hal}]
@@ -1330,7 +1337,16 @@ All aspects of the GUI are fully customization through Qt Designer and/or Python
13301337
This capability is included with the QtVCP development environment.
13311338
The extensive use of QtVCP widgets keeps the amount of required Python code to a minimum, allowing relatively easy modifications.
13321339
The LinuxCNC website has extensive documentation on the installation and use of QtVCP libraries.
1333-
See <<cha:qtvcp,QtVCP Overview>> for more information.
1340+
See <<cha:qtvcp,QtVCP>> for more information in about QtVCP in general.
1341+
Qtdragon can also utilize QtVCP's rc file to do minor python code modifications without using a custom handler file.
1342+
1343+
[source,{ini}]
1344+
----
1345+
[DISPLAY]
1346+
USER_COMMAND_FILE = CONFIGFOLDER/qtdragonrc.py
1347+
----
1348+
1349+
See <<cha:qtvcp:modifying-screens,Modifying Screens>> for more information about customization.
13341350

13351351
.QtDragon - Customized QtDragon
13361352
image::images/silverdragon_custom.png["QtDragon customized",scale=25]

docs/src/gui/qtvcp.adoc

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ In that folder, QtVCP will load any of the available following files:
218218

219219
There are _three ways_ to customize a screen/panel.
220220

221-
.Minor StyleSheet Changes
221+
==== Minor StyleSheet Changes
222222
Stylesheets can be used to *set Qt properties*.
223223
If a widget uses properties then they usually can be modified by stylesheets.
224224

@@ -232,8 +232,9 @@ State_LED #name_of_led{
232232
}
233233
----
234234

235-
.Minor Python Code Changes
235+
==== Minor Python Code Changes
236236
Another Python file can be used to *add commands* to the screen, after the handler file is parsed.
237+
This can be useful for minor changes while still honouring standard handler updates from linuxcnc repositoies.
237238

238239
In the _INI file_ under the `[DISPLAY]` heading add *`USER_COMMAND_FILE = _PATH_`* +
239240

@@ -251,22 +252,80 @@ The default path is in the configuration directory as a hidden file using the sc
251252

252253
This file will be read and executed as Python code in the *handler file context*.
253254

254-
*Only local functions and local attributes* can be referenced.
255-
Global libraries can not be referenced.
256-
These are usually seen as all capital words with no preceding self.
255+
*Only local functions and local attributes* can be referenced. +
256+
Global libraries defined in the screen's handler file can be referenced but must be preceded with 'self.' +
257+
These are usually seen as all capital words with no preceding self. +
258+
'self' references the window class +
259+
'self.w' typically references the widgets
257260

258261
What can be used can vary by screen and development cycle.
259262

260-
For a valid example:
263+
.A simple example
264+
Reference the main window to change the title (Won't show if using INI entries for title change)
261265

262266
[source,python]
263267
----
264268
self.w.setWindowTitle('My Title Test')
265269
----
266270

267-
.Full Creative Control
268-
If you wish to *modify a stock screen* with full control,
269-
_copy it's UI and handler file to your configuration folder_.
271+
.An advanced instance patching example
272+
This could work with the Qtdragon screen's handler file. +
273+
Here we show how to add new functions and override existing ones.
274+
275+
[source,python]
276+
----
277+
# needed to instance patch
278+
# reference: https://ruivieira.dev/python-monkey-patching-for-readability.html
279+
import types
280+
281+
# This is actually an unbounded function with 'obj' as a parameter.
282+
# You call this function without the usual preceding 'self.'
283+
# This is because will will not be patching it into the original handler class instance
284+
# It will only be called from code in this file
285+
def test_function(obj):
286+
print(dir(obj))
287+
288+
# This is a new function we will added to the existing handler class instance.
289+
# Notice it calls the unbounded function with 'self' as an parameter
290+
# 'self' is the only global reference available. It references the window instance
291+
def on_keycall_F10(self,event,state,shift,cntrl):
292+
if state:
293+
print ('F10')
294+
test_function(self)
295+
296+
# This will be used to override an existing function in the existing handler class instance
297+
# note we also call a copy of the original function too
298+
# this shows how to extend an existing function to do extra functions
299+
def on_keycall_F11(self,event,state,shift,cntrl):
300+
if state:
301+
self.on_keycall_F11_super(event,state,shift,cntrl)
302+
print ('Hello')
303+
304+
# We are referencing the KEYBIND library that was instantiated in the
305+
# original handler class instance by adding 'self.' to it.
306+
# This function tells KEYBIND to call 'on_keycall_F10' when F10 is pressed
307+
self.KEYBIND.add_call('Key_F10','on_keycall_F10')
308+
309+
# Here we are instance patching the original handler file to add a new
310+
# function that calls our new function (of the same name)
311+
# defined in this file
312+
self.on_keycall_F10 = types.MethodType(on_keycall_F10, self)
313+
314+
# Here we are defining a copy of the original 'on_keycall_F11' function
315+
# so we can call it later. we can use any valid, unused function name.
316+
# We need to do this before overriding the original function.
317+
self.on_keycall_F11_super = self.on_keycall_F11
318+
319+
# Here we are instance patching the original handler file to override
320+
# an existing function to point to our new function (of the same name)
321+
# defined in this file
322+
self.on_keycall_F11 = types.MethodType(on_keycall_F11, self)
323+
324+
----
325+
326+
==== Full Creative Control with custom handler/ui files
327+
If you wish to *modify a stock screen* with full control, _copy it's UI
328+
and handler file to your configuration folder_.
270329

271330
There is a QtVCP panel to help with this:
272331

@@ -278,8 +337,9 @@ qtvcp copy_dialog
278337

279338
* Select the screen and destination folder in the dialog
280339
* If you wish to *name your screen* differently than the builtin screen's default name, change the _basename_ in the edit box.
340+
* There should be a folder in the config folder; for screens: named '<CONFIG FOLDER>/qtvcp/screens/' for panels: named '<CONFIG FOLDER>/qtvcp/panels/' add the folders if ther are missing and copy your folder/files in it.
281341
* Validate to copy all the files
282-
* Delete the files you don't wish to modifyso that the original files will be used.
342+
* Delete the files you don't wish to modify so that the original files will be used.
283343

284344
[[sec:qtvcp:vcp-panels]]
285345
== VCP Panels

lib/python/qtvcp/qt_istat.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def update(self):
233233
for j in range(jointcount):
234234
seq = self.INI.find("JOINT_" + str(j), "HOME_SEQUENCE")
235235
if seq is None:
236-
seq = -1
236+
seq = 0
237237
self.HOME_ALL_FLAG = 0
238238
self.JOINT_SEQUENCE_LIST[j] = int(seq)
239239
# joint sequence/type
@@ -265,7 +265,7 @@ def update(self):
265265
if flag:
266266
templist.append(temp)
267267
# remove duplicates
268-
self.JOINT_SYNCH_LIST = list(set(tuple(sorted(sub)) for sub in templist))
268+
self.JOINT_SYNC_LIST = list(set(tuple(sorted(sub)) for sub in templist))
269269

270270
# This is a list of joints that are related to a joint.
271271
#ie. JOINT_RELATIONS_LIST(0) will give a list of joints that go with joint 0
@@ -276,8 +276,12 @@ def update(self):
276276
for j in range(jointcount):
277277
temp = []
278278
for hj, hs in list(self.JOINT_SEQUENCE_LIST.items()):
279+
# the absolute numbers must be equal first
279280
if abs(int(hs)) == abs(int(self.JOINT_SEQUENCE_LIST.get(j))):
280-
temp.append(hj)
281+
# theN one has to be negative to signal syncing
282+
if int(hs) <0 or int(self.JOINT_SEQUENCE_LIST.get(j)) < 0:
283+
temp.append(hj)
284+
# If empty list: no synced joints, just add the jointcount number
281285
if temp == []:
282286
temp.append(j)
283287
self.JOINT_RELATIONS_LIST[j] = temp

lib/python/qtvcp/widgets/basic_probe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self, parent=None):
6262
LOG.critical(e)
6363
self.helpPages = ['basic_help.html','basic_help1.html','basic_help2.html',
6464
'basic_help3.html','basic_help4.html','basic_help5.html',
65-
'basic_help6.html','basic_help7.html']
65+
'basic_help6.html','basic_help7.html','basic_help8.html']
6666
self.currentHelpPage = 0
6767

6868
self.probe_list = ["OUTSIDE CORNERS", "INSIDE CORNERS", "EDGE ANGLE", "BOSS and POCKETS",

lib/python/qtvcp/widgets/mdi_line.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def __init__(self, parent=None):
6767
self.mdiLast = None
6868
pass
6969

70+
def getMDIText(self):
71+
text = str(self.text()).strip()
72+
return text
73+
7074
def submit(self):
7175
self.mdiError = False
7276
text = str(self.text()).strip()

lib/python/qtvcp/widgets/probe_routines.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,8 +1481,11 @@ def probe_valley_y(self):
14811481
return error
14821482

14831483
def probe_cal_round_pocket(self):
1484-
if self.data_probe_diam >= self.data_diameter_hint:
1485-
return 'Probe diameter too large for hole diameter hint'
1484+
if self.data_cal_diameter_hint <= 0 :
1485+
return 'Calibration diameter hint must be larger then 0'
1486+
if self.data_probe_diameter >= self.data_cal_diameter_hint:
1487+
return 'Probe diameter too large for Calibration diameter hint'
1488+
14861489
self.data_side_edge_length = self.data_cal_diameter / 2
14871490
error = self.probe_xy_hole()
14881491
if error != 1: return error
6.04 KB
Loading

0 commit comments

Comments
 (0)