|
From: John T. <gi...@gi...> - 2015-08-26 11:51:42
|
Docs: add missing parameter and clean up Signed-off-by: John Thornton <bj...@gm...> http://git.linuxcnc.org/?p=linuxcnc.git;a=commitdiff;h=03a2c21 --- docs/src/gui/pyvcp.txt | 156 +++++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 76 deletions(-) diff --git a/docs/src/gui/pyvcp.txt b/docs/src/gui/pyvcp.txt index 8f51924..ea46e59 100644 --- a/docs/src/gui/pyvcp.txt +++ b/docs/src/gui/pyvcp.txt @@ -59,7 +59,7 @@ Once you have created your panel, connecting HAL signals to and from the PyVCP pins is done with the halcmd: ----------------------------------------------------------------------- -net <signal-name> <pin-name> <opt-direction> <opt-pin-name>signal-name +net <signal-name> <pin-name> <opt-direction> <opt-pin-name>signal-name ----------------------------------------------------------------------- If you are new to HAL, the HAL basics chapter in the Integrator @@ -122,7 +122,7 @@ This change will run the HAL commands specified in this: ------------------------------------------------- -net spindle-rpm-filtered => pyvcp.spindle-speed +net spindle-rpm-filtered => pyvcp.spindle-speed ------------------------------------------------- assuming that a signal called 'spindle-rpm-filtered' already exists. @@ -142,7 +142,7 @@ with or without LinuxCNC's machine controller. To load a stand alone PyVCP panel with LinuxCNC use these commands: ----------------------------------------------------------------------- -loadusr -Wn mypanel pyvcp -g WxH+X+Y -c mypanel <path/>panel_file.xml +loadusr -Wn mypanel pyvcp -g WxH+X+Y -c mypanel <path/>panel_file.xml ----------------------------------------------------------------------- You would use this if you wanted a floating panel or a panel with a @@ -177,7 +177,7 @@ GUI other than AXIS. To load a 'stand alone' PyVCP panel without LinuxCNC use this command: ----------------------------------------------------------------------- -loadusr -Wn mypanel pyvcp -g 250x500+800+0 -c mypanel mypanel.xml +loadusr -Wn mypanel pyvcp -g 250x500+800+0 -c mypanel mypanel.xml ----------------------------------------------------------------------- The minimum command to load a pyvcp panel is: @@ -191,12 +191,12 @@ controller such as for testing or a standalone DRO. The loadusr command is used when you also load a component that will stop HAL from closing until it's done. If you loaded a panel and then -loaded Classic Ladder using 'loadusr -w classicladder', -CL would hold HAL open (and the panel)Â until you closed CL. -The '-Wn' above means wait for the component '-Wn "name"' to become ready. -('name' can be any name. Note the capital W and lowercase n.) +loaded Classic Ladder using 'loadusr -w classicladder', +CL would hold HAL open (and the panel)Â until you closed CL. +The '-Wn' above means wait for the component '-Wn "name"' to become ready. +('name' can be any name. Note the capital W and lowercase n.) The -c tells PyVCP to build a panel with the -name 'panelname' using the info in 'panel_file_name.xml'. +name 'panelname' using the info in 'panel_file_name.xml'. The name 'panel_file_name.xml' can be any name but must end in .xml - it is the file that describes how to build the panel. You must add the path name if the panel is not in the directory that the HAL script is in. @@ -217,7 +217,7 @@ HAL shuts down when the panel is closed. HAL signals come in two variants, bits and numbers. Bits are off/on signals. Numbers can be 'float', 's32' or 'u32'. For more information on HAL -data types see the <<sec:hal-data,HAL Data>> section. The PyVCP widget +data types see the <<sec:hal-data,HAL Data>> section. The PyVCP widget can either display the value of the signal with an indicator widget, or modify the signal value with a control widget. Thus there are four classes of PyVCP widgets that you can connect to a HAL signal. A fifth @@ -255,10 +255,10 @@ and When the attribute-based syntax is used, the following rules are used to turn the attributes value into a Python value: - . If the first character of the attribute is one of the following, it is + . If the first character of the attribute is one of the following, it is evaluated as a Python expression: '{(["'' . If the string is accepted by int(), the value is treated as an integer - . If the string is accepted by float(), the value is treated as + . If the string is accepted by float(), the value is treated as floating-point . Otherwise, the string is accepted as a string. @@ -412,19 +412,19 @@ image::images/pyvcp_rectled.png[] A button is used to control a BIT pin. The pin will be set True when the button is pressed and held down, and will be set False when the -button is released. Buttons can use the following formatting options +button is released. Buttons can use the following optional options. -* '<padx>n</padx>' - - where 'n' is the amount of extra horizontal extra space +* '<padx>n</padx>' - where 'n' is the amount of extra horizontal extra space. -* '<pady>n</pady>' - - where 'n' is the amount of extra vertical extra space +* '<pady>n</pady>' - where 'n' is the amount of extra vertical extra space. -* '<activebackground>"color"</activebackground>' - - the cursor over color +* '<activebackground>"color"</activebackground>' - the cursor over color. -* '<bg>"color"</bg>' - - the color of the button +* '<fg> "color"</fg> - the forground color. + +* '<bg>"color"</bg>' - the background color. + +* '<disable_pin>True</disable_pin>' - disable pin. .Text Button @@ -452,9 +452,12 @@ image::images/pyvcp_button.png[] .Checkbutton -A checkbutton controls a bit halpin. The halpin will be set True when the button is checked, and false when the button is unchecked. The checkbutton is a toggle type button. -The Checkbuttons may be set initially as TRUE or FALSE the initval field -A pin called changepin is also created automatically, which can toggle the Checkbutton via HAL, if the value linked is changed, to update the display remotely +A checkbutton controls a bit halpin. The halpin will be set True when the +button is checked, and false when the button is unchecked. The checkbutton is a +toggle type button. The Checkbuttons may be set initially as TRUE or FALSE the +initval field A pin called changepin is also created automatically, which can +toggle the Checkbutton via HAL, if the value linked is changed, to update the +display remotely. [source,xml] --------------------------------------- @@ -479,10 +482,10 @@ image::images/pyvcp_checkbutton.png[] .Radiobutton -A radiobutton will set one of the halpins true. The other pins are set -false. -The initval field may be set to choose the default selection when the panel displays. -Only one radio button may be set to TRUE (1) or only the highest number pin set TRUE will have that value. +A radiobutton will set one of the halpins true. The other pins are set false. +The initval field may be set to choose the default selection when the panel +displays. Only one radio button may be set to TRUE (1) or only the highest +number pin set TRUE will have that value. [source,xml] ------------------------------------------------- @@ -528,7 +531,7 @@ The above code produced this example. image::images/pyvcp_number.png[] -* '<font>' - is a Tkinter font type and size specification. One font that +* '<font>' - is a Tkinter font type and size specification. One font that will show up to at least size 200 is 'courier 10 pitch', so for a really big Number widget you could specify: @@ -537,7 +540,7 @@ really big Number widget you could specify: <font>("courier 10 pitch",100)</font> ------------------------------------------------- -* '<format>' - is a 'C-style' format specified that determines how +* '<format>' - is a 'C-style' format specified that determines how the number is displayed. .s32 Number @@ -569,9 +572,10 @@ is the same as 'number' except the name which is <u32>. A bar widget displays the value of a FLOAT signal both graphically using a bar display and numerically. -The colour of the bar can be set as one colour throughout its range (default using fillcolor) -or set to change colour dependent upon the value of the halpin (range1, range2 range3 must all be set, -if you only want 2 ranges, set 2 of them to the same colour) +The color of the bar can be set as one color throughout its range (default +using fillcolor) or set to change color dependent upon the value of the halpin +(range1, range2 range3 must all be set, if you only want 2 ranges, set 2 of +them to the same color). [source,xml] --------------------------------------- @@ -593,8 +597,7 @@ image::images/pyvcp_bar.png[] .Meter -Meter displays the value of a FLOAT signal using a traditional dial -indicator. +Meter displays the value of a FLOAT signal using a traditional dial indicator. [source,xml] ------------------------------------------------- @@ -621,11 +624,11 @@ image::images/pyvcp_meter.png[] .Spinbox -Spinbox controls a FLOAT pin. You increase or decrease the value of -the pin by either pressing on the arrows, or pointing at the spinbox -and rolling your mouse-wheel. -If the param_pin field is set TRUE(1), a pin will be created that can be used to set the spinbox to -an initial value and to remotely alter its value without HID input +Spinbox controls a FLOAT pin. You increase or decrease the value of the pin by +either pressing on the arrows, or pointing at the spinbox and rolling your +mouse-wheel. If the param_pin field is set TRUE(1), a pin will be created that +can be used to set the spinbox to an initial value and to remotely alter its +value without HID input. [source,xml] --------------------------------------- @@ -652,9 +655,9 @@ value of the pin be either dragging the slider, or pointing at the scale and rolling your mouse-wheel. The 'halpin' will have both '-f' and '-i' added to it to form the float and s32 pins. Width is the width of the slider in vertical and the height of the slider in horizontal -orientation. -If the param_pin field is set TRUE(1), a pin will be created that can be used to set the spinbox to -an initial value and to remotely alter its value without HID input +orientation. If the param_pin field is set TRUE(1), a pin will be created that +can be used to set the spinbox to an initial value and to remotely alter its +value without HID input. [source,xml] @@ -682,7 +685,7 @@ an initial value and to remotely alter its value without HID input </scale> --------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_scale.png[] @@ -692,9 +695,10 @@ The Dial outputs a HAL float and reacts to both mouse wheel and dragging. Double left click to increase the resolution and double right click to reduce the resolution by one digit. The output is capped by the min and max values. The <cpr> is how many tick marks are on the -outside of the ring (beware of high numbers). -If the param_pin field is set TRUE(1), a pin will be created that can be used to set the spinbox to -an initial value and to remotely alter its value without HID input +outside of the ring (beware of high numbers). If the param_pin field is set +TRUE(1), a pin will be created that can be used to set the spinbox to +an initial value and to remotely alter its value without HID input. + [source,xml] --------------------------------------- <dial> @@ -713,7 +717,7 @@ an initial value and to remotely alter its value without HID input </dial> --------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_dial.png[] @@ -732,7 +736,7 @@ motion, or by rolling the mouse-wheel. </jogwheel> --------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_jogwheel.png[] @@ -757,10 +761,10 @@ true or false. </vbox> ----------------------------------------------------------- -This example was produced from the above code. -Using the two image files fwd.gif and rev.gif. -FWD is displayed when 'selectimage' is false -and REV is displayed when 'selectimage' is true. +This example was produced from the above code. +Using the two image files fwd.gif and rev.gif. +FWD is displayed when 'selectimage' is false +and REV is displayed when 'selectimage' is true. image:images/pyvcp_image01.png[] image:images/pyvcp_image02.png[] @@ -781,10 +785,12 @@ and 1 for the second image etc. </vbox> --------------------------------------------------------------------- -The above code produced the following example -by adding the stb.gif image. +The above code produced the following example +by adding the stb.gif image. -image:images/pyvcp_image_u32_01.png[] image:images/pyvcp_image01.png[] image:images/pyvcp_image02.png[] +image:images/pyvcp_image_u32_01.png[] +image:images/pyvcp_image01.png[] +image:images/pyvcp_image02.png[] Notice that the default is the min even though it is set higher than max unless there is a negative min. @@ -800,7 +806,7 @@ Container borders are specified with two tags used together. The <relief> tag specifies the type of border and the <bd> specifies the width of the border. -* '<relief>type</relief>' - +* '<relief>type</relief>' - Where 'type' is FLAT, SUNKEN, RAISED, GROOVE, or RIDGE * '<bd>n</bd>' - @@ -837,13 +843,13 @@ width of the border. </hbox> --------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_borders.png[] .Hbox -Use an Hbox when you want to stack widgets horizontally +Use an Hbox when you want to stack widgets horizontally next to each other. [source,xml] @@ -858,15 +864,14 @@ next to each other. </hbox> ------------------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_hbox.png[] -Inside an Hbox, you can use the '<boxfill fill=""/>', '<boxanchor -anchor=""/>', and '<boxexpand expand=""/>' tags to choose how items in -the box behave when the window is re-sized. -For details of how fill, anchor, and expand behave, refer to -the Tk 'pack' manual page, 'pack(3tk)'. By default, 'fill="y"', +Inside an Hbox, you can use the '<boxfill fill=""/>', '<boxanchor anchor=""/>' +, and '<boxexpand expand=""/>' tags to choose how items in the box behave when +the window is re-sized. For details of how fill, anchor, and expand behave, +refer to the Tk 'pack' manual page, 'pack(3tk)'. By default, 'fill="y"', 'anchor="center"', 'expand="yes"'. .Vbox @@ -886,15 +891,14 @@ other. </vbox> ------------------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_vbox.png[] -Inside a Hbox, you can use the '<boxfill fill=""/>', '<boxanchor -anchor=""/>', and '<boxexpand expand=""/>' tags to choose how items in -the box behave when the window is -re-sized. For details of how fill, anchor, and expand behave, refer to -the Tk 'pack' manual page, 'pack(3tk)'. By default, 'fill="x"', +Inside a Hbox, you can use the '<boxfill fill=""/>', '<boxanchor anchor=""/>' +, and '<boxexpand expand=""/>' tags to choose how items in the box behave +when the window is re-sized. For details of how fill, anchor, and expand +behave, refer to the Tk 'pack' manual page, 'pack(3tk)'. By default, 'fill="x"', 'anchor="center"', 'expand="yes"'. .Labelframe @@ -913,16 +917,16 @@ corner. </labelframe> --------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_labelframe.png[] .Table A table is a container that allows layout in a grid of rows and -columns. Each row is started by a '<tablerow/>' tag. A contained +columns. Each row is started by a '<tablerow/>' tag. A contained widget may span rows or columns through the use of -the '<tablespan rows= cols=/>' tag. The sides of the cells to which +the '<tablespan rows= cols=/>' tag. The sides of the cells to which the contained widgets âstickâ may be set through the use of the '<tablesticky sticky=/>' tag. A table expands on its flexible rows and columns. @@ -956,7 +960,7 @@ Example: </table> ----------------------------------------------------------- -The above code produced this example. +The above code produced this example. image::images/pyvcp_table.png[] @@ -993,7 +997,7 @@ A tabbed interface can save quite a bit of space. </tabs> ----------------------------------------------------------- -The above code produced this example showing each tab selected. +The above code produced this example showing each tab selected. image::images/pyvcp_tabs1.png[] |