Skip to content

Commit b743d3c

Browse files
smoehansu
authored andcommitted
docs: smallish corrections while translating
1 parent 3abced1 commit b743d3c

3 files changed

Lines changed: 24 additions & 37 deletions

File tree

docs/src/drivers/hostmot2.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ component. Each pwmgen instance has the following pins and parameters:
610610
* 'pwm_frequency' - (u32, RW) This specifies the PWM frequency, in Hz,
611611
of all the pwmgen instances running in the PWM modes (modes 1 and 2).
612612
This is the frequency of the variable-duty-cycle wave.
613-
Its effective range is fromc1 Hz up to 193 kHz.
613+
Its effective range is from 1 Hz up to 193 kHz.
614614
Note that the max frequency is determined by the ClockHigh frequency of the Anything I/O board;
615615
the 5i20 and 7i43 both have a 100 MHz clock, resulting in a 193 kHz max PWM frequency.
616616
Other boards may have different clocks, resulting in different max PWM frequencies.

docs/src/gui/ngcgui.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -713,8 +713,8 @@ Notes on global named parameters and NGCGUI:
713713
As in many programming languages, use of globals is powerful but can often lead to unexpected consequences.
714714
In LinuxCNC, existing global named parameters will be valid at subroutine execution and subroutines can modify or create global named parameters.
715715

716-
Passing information to subroutines using global named parameters is discourage
717-
since such usage requires the establishment and maintenance of a well-defined global context that is difficult to maintain.
716+
Passing information to subroutines using global named parameters is discouraged
717+
since such usage requires the establishment and maintenance of a well-defined global context that is difficult to maintain.
718718
Using numbered parameters #1 thru #30 as subroutine inputs should be sufficient to satisfy a wide range of design requirements.
719719

720720
//FIXME are input global named parameters supported or not ?

docs/src/gui/qtvcp-code-snippets.adoc

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ STATUS.connect('general',self.return_value)
135135
This registers `STATUS` to call the function `self.return_value` when a
136136
general message is sent.
137137

138-
.Add entry dialog request function in the `GENERAL FUNCTIONS SECTION`
138+
.Add entry dialog request function in the `GENERAL FUNCTIONS` section
139139
[source,python]
140140
----
141141
def request_number(self):
@@ -156,7 +156,7 @@ The function
156156
** *Arbitrary data* can be added to the `dict`. The dialog will ignore them but send them back to the return code.
157157
* Sends the `dict` as a *`dialog-request`* `STATUS` message
158158

159-
.Add message data processing function in the `CALLBACKS FROM STATUS SECTION`
159+
.Add message data processing function in the `CALLBACKS FROM STATUS` section.
160160
[source,python]
161161
----
162162
# Process the STATUS return message from set-tool-offset
@@ -169,17 +169,14 @@ def return_value(self, w, message):
169169
----
170170

171171
This catches all general messages so it must _check the dialog type and id code_ to confirm it's our dialog.
172-
173-
In this case we had requested an `ENTRY` dialog and our unique id was `FORM_NUMBER`,
174-
so now we know the message is for us.
175-
172+
In this case we had requested an `ENTRY` dialog and our unique id was `FORM_NUMBER`, so now we know the message is for us.
176173
`ENTRY` or `CALCULATOR` dialogs return a float number.
177174

178175
== Speak a Startup Greeting
179176

180177
This requires the `espeak` library installed on the system.
181178

182-
.Import and Instantiate the `Status` in the `IMPORT SECTION`
179+
.Import and instantiate the `Status` in the `IMPORT` section
183180
[source,python]
184181
----
185182
from qtvcp.core import Status
@@ -199,7 +196,6 @@ STATUS.emit('play-alert','SPEAK Please remember to oil the ways.')
199196
== ToolBar Functions
200197

201198
Toolbar buttons and submenus are added in Qt Designer but the code to make them do something is added in the handler file.
202-
203199
To *add a submenus* in Qt Designer:
204200

205201
* Add a `Qaction` by typing in the toolbar column then clicking the '+' icon on the right.
@@ -320,15 +316,13 @@ This is simplified - _checking state and error trapping might be helpful_.
320316
== Add A Special Max Velocity Slider Based On Percent
321317

322318
Some times you want to *build a widget to do something not built in*.
323-
324319
The built in Max velocity slider acts on units per minute, here we show how to do on percent.
325320

326321
The *`STATUS`* command makes sure the slider adjusts if LinuxCNC changes the current max velocity.
327322

328323
*`valueChanged.connect()`* _calls a function when the slider is moved_.
329324

330-
In Qt Designer add a *`QSlider`* widget called `mvPercent`,
331-
then add the following code to the handler file:
325+
In Qt Designer add a *`QSlider`* widget called `mvPercent`, then add the following code to the handler file:
332326

333327
[source,python]
334328
----
@@ -428,7 +422,6 @@ The File manager widget is designed to load a selected program in LinuxCNC.
428422
But maybe you want to print the file name first.
429423

430424
We can "class patch" the library to _redirect the function call_.
431-
432425
In the `IMPORT SECTION` add:
433426

434427
[source,python]
@@ -471,7 +464,7 @@ def our_load(self,fname):
471464
self.old_load(self.w.filemanager,fname)
472465
----
473466

474-
Now our custom function will print the file path to the terminal before loading the file. +
467+
Now our custom function will print the file path to the terminal before loading the file.
475468
Obviously boring but shows the principle.
476469

477470
[NOTE]
@@ -507,12 +500,11 @@ def our_load(self,fname):
507500

508501
== Adding Widgets Programmatically
509502

510-
In some situation it is only possible to *add widgets with Python code*
511-
rather then using the Qt Designer editor.
503+
In some situation it is only possible to *add widgets with Python code* rather then using the Qt Designer editor.
512504

513505
When adding QtVCP widgets programmatically, sometimes there are _extra steps_ to be taken.
514506

515-
Here we are going to add a spindle speed indicator bar and up-to-speed LED to a tab widget corner. +
507+
Here we are going to add a spindle speed indicator bar and up-to-speed LED to a tab widget corner.
516508
Qt Designer does not support adding corner widgets to tabs but PyQt does.
517509

518510
This is a cut down example from QtAxis screen's handler file.
@@ -552,7 +544,7 @@ INFO = Info()
552544
----
553545

554546
.Register `STATUS` monitoring function
555-
For the spindle speed indicator we need to know the current spindle speed. +
547+
For the spindle speed indicator we need to know the current spindle speed.
556548
For this we _register_ with `STATUS` to:
557549

558550
* _Catch_ the `actual-spindle-speed-changed` _signal_
@@ -575,9 +567,8 @@ def __init__(self,halcomp,widgets,paths):
575567
----
576568

577569
.Add the widgets to the tab
578-
We need to _make sure the Qt Designer widgets are already built_ before we try to add to them. +
579-
For this, we add a call to `self.make_corner_widgets()` function to build our extra widgets at the right time,
580-
i.e. under the `initialized__()` function:
570+
We need to _make sure the Qt Designer widgets are already built_ before we try to add to them.
571+
For this, we add a call to `self.make_corner_widgets()` function to build our extra widgets at the right time, i.e. under the `initialized__()` function:
581572

582573
[source,python]
583574
----
@@ -593,7 +584,7 @@ def initialized__(self):
593584
----
594585

595586
.Create the widgets building functions
596-
Ok let's code the function to build the widgets and add them in the tab widget. +
587+
Ok let's code the function to build the widgets and add them in the tab widget.
597588
We are assuming there is a tab widget built with Designer called 'rightTab'.
598589

599590
We are assuming there is a tab widget built with Qt Designer called `rightTab`.
@@ -761,7 +752,7 @@ def __init__(self,halcomp,widgets,paths):
761752
This *allows an external program to call functions in the handler file*.
762753

763754
.Add a function to be called on ZMQ message reception
764-
Let's add a specific function for testing. +
755+
Let's add a specific function for testing.
765756
You will need to run LinuxCNC from a terminal to see the printed text.
766757

767758
[source,python]
@@ -774,8 +765,8 @@ def test_zmq_function(self, arg1, arg2):
774765
----
775766

776767
.Create an external program sending ZMQ messages that will trigger function call
777-
Here is a sample external program to call a function. +
778-
It alternates between two data sets every second. +
768+
Here is a sample external program to call a function.
769+
It alternates between two data sets every second.
779770
Run this in a separate terminal from LinuxCNC to see the sent messages.
780771

781772
[source,python]
@@ -896,7 +887,7 @@ while True:
896887

897888
There are several ways to *report information to the user*.
898889

899-
A *status bar* is used for _short information_ to show the user. +
890+
A *status bar* is used for _short information_ to show the user.
900891

901892
NOTE: Not all screens have a status bar.
902893

@@ -908,9 +899,8 @@ self.w.statusbar.showMessage(message, timeout * 1000)
908899

909900
`timeout` is in seconds and we assume `statusbar` is the Qt Designer set name of the widget.
910901

911-
You can also use the `Status` library to send a message to the `notify`
912-
library if it is enabled (usually set in `ScreenOptions` widget):
913-
this will send the message to the statusbar and the *desktop notify dialog*.
902+
You can also use the `Status` library to send a message to the `notify` library if it is enabled (usually set in `ScreenOptions` widget):
903+
This will send the message to the statusbar and the *desktop notify dialog*.
914904

915905
The messages are also recorded until the user erases them using controls.
916906
The users can recall any recorded messages.
@@ -977,13 +967,10 @@ def focusInChanged(self, widget):
977967

978968
Notice we sometimes compare to `widget`, sometimes to `widget.parent()`.
979969

980-
This is because _some QtVCP widgets are built from multiple_ *_sub-widgets_*
981-
and the latter actually get the focus; so we need to *check the parent* of those sub-widgets.
970+
This is because _some QtVCP widgets are built from multiple_ *_sub-widgets_* and the latter actually get the focus; so we need to *check the parent* of those sub-widgets.
982971

983-
Other times the main widget is what gets the focus,
984-
e.g., the G-code display widget can be set to accept the focus.
985-
In that case there are no sub-widgets in it,
986-
so comparing to the `widget.parent()` would get you the container that holds the G-code widget.
972+
Other times the main widget is what gets the focus, e.g., the G-code display widget can be set to accept the focus.
973+
In that case there are no sub-widgets in it, so comparing to the `widget.parent()` would get you the container that holds the G-code widget.
987974

988975
== Read Command Line Load Time Options
989976

0 commit comments

Comments
 (0)