Skip to content

Commit

Permalink
qtvcp -docs: update qt_vismach for HideCollection function
Browse files Browse the repository at this point in the history
  • Loading branch information
c-morley committed Dec 22, 2024
1 parent 2d9dea5 commit 43bce69
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions docs/src/gui/qtvcp-vismach.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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)`*::
Expand Down Expand Up @@ -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

Expand All @@ -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`.

Expand Down Expand Up @@ -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. +

Expand Down Expand Up @@ -396,17 +395,17 @@ 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_. +

*`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. +
Expand Down Expand Up @@ -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)
# <snip make a machine with an A axis chuck assembly>
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.

Expand Down

0 comments on commit 43bce69

Please sign in to comment.