From 43bce695d6cf9d540abd988735fa58b14b62f033 Mon Sep 17 00:00:00 2001 From: CMorley Date: Sat, 21 Dec 2024 23:55:22 -0800 Subject: [PATCH] qtvcp -docs: update qt_vismach for HideCollection function --- docs/src/gui/qtvcp-vismach.adoc | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/src/gui/qtvcp-vismach.adoc b/docs/src/gui/qtvcp-vismach.adoc index 2bc95917c1b..7d97fe00ca4 100644 --- a/docs/src/gui/qtvcp-vismach.adoc +++ b/docs/src/gui/qtvcp-vismach.adoc @@ -172,6 +172,9 @@ It is much easier to move while building if the origin of the model is at a rota Alternatively parts can be _created inside the model script from a range of shape primitives_. +*`assembly = collction([part1,part2,part3])`*:: + Collection is a general container of related parts + Many shapes are _created at the origin_ and need to be _moved to the required location_ after creation. *`cylinder = CylinderX(x1, r1, x2, r2)`*:: @@ -210,9 +213,6 @@ part4 = Collection([part1, part2]) Parts may need to be moved in the Vismach space to assemble the model. The origin does not move - Translate() and Rotate() move the Collection as you add parts, relative to a stationary origin. -//FIXME unclear -They may also need to be moved to create the animation as the animation rotation axis is created at the origin (but moves with the Part). - [[sub:qtvcp:vismach:translate]] === Translating Model parts @@ -227,7 +227,6 @@ They may also need to be moved to create the animation as the animation rotation [[sec:qtvcp:vismach:animate]] == Animating Parts -//FIXME 2 or 3 functions ? HalToolCylinder not documented here ? To *animate the model controlled by the values of HAL pins* there are four functions: `HalTranslate`, `HalRotate`, `HalToolCylinder` and `HalToolTriangle`. @@ -305,7 +304,7 @@ toolshape = Color([1, 1, 0, 1],[HalToolTriangle()]) ---- === HAL Adjustable Primitives -All primitives can have HAL pin names substituted for coordinates. + +All shape primitives can have HAL pin names substituted for coordinates. + Either by adding the component object as the first variable and substituting the pinname string for a coordinate, or + by substituting the full component/pinname string for a coordinate. + @@ -396,8 +395,8 @@ Sets the _display color of the part_. + *`part = Color([_colorspec_], [_part_])`*:: Note that unlike the other functions, the part definition comes second in this case. + - `_colorspec_`;; Three RGB values and opacity. + - For example [1,0,0,0.5] for a 50% opacity red. + `_colorspec_`;; Three (0-1.0) RGB values and opacity. [R,G,B,A] + + For example [1.0,0,0,0.5] for a 50% opacity red. === HALColorFlip Sets the _display color of the part based on a designated HAL bit pin state_. + @@ -405,8 +404,8 @@ Sets the _display color of the part based on a designated HAL bit pin state_. + *`part = HALColorFlip([_colorspec_], [_colorspec_], [_part_], hal_comp, hal_pin)`*:: Note that unlike the other functions, the part definition comes second in this case. + - `_colorspec_`;; Three RGB values and opacity. + - For example [1,0,0,0.5] for a 50% opacity red. + `_colorspec_`;; Three (0-1.0) RGB values and opacity. + + For example [1.0,0,0,0.5] for a 50% opacity red. `hal_comp`;; The _HAL component Object_ or None. + In QtVCP if you are reading _system pins_ directly, then the component argument is set to `None`. + `hal_pin`;; The _name of the BIT HAL IN pin_ that will change the color. + @@ -462,6 +461,20 @@ Some of the available HalHUD function: + * add_pin(text, format, pinname) * set_text_color(red, green, blue) +=== HideCollection + + HideCollection is a container that uses a HAL pin to control display of the contained parts. + + A logic high on the HAL pin will hide the contained parts. + +[source,python] +---- +comp.newpin("hide-chuck", hal.HAL_BIT, hal.HAL_IN) +# +chuckassembly = HideCollection([chuckassembly],comp,'hide-chuck') +# also can be used like this +chuckassembly = HideCollection([chuckassembly],None,'myvismach.hide-chuck') +---- + === Capture This sets the current position in the model.