NetworkWidgets

Synopsis

This library contains common macros that are intended to make performing tasks upon the network and using the network editor for visual design, easier and quicker.


Increment
Decrement
Stepper

These macros all implement forms of integer counters. The Increment and Decrement macros implement counters that respectively count upwards and downwards from zero. The Stepper macro combines these two macros to implement a counter that can count both upwards and downwards. All of these macros can be reset back to their starting value.

Inputs

&in

A trigger parameter that is used by the Increment and Decrement counters to change the stored value. When this parameter is triggered the count value increases or decreases by one as appropriate.

&up

A trigger parameter that is used by the Stepper counter to increment the stored value.

&down

A trigger parameter that is used by the Stepper counter to decrement the stored value.

&reset

A trigger parameter that is used all these macros to reset the stored value back to its starting value.

Outputs

value

The current value of the counter.


last_of_2
last_of_3

These macros allow the last changed variable of a number of variables to be determined. The last_of_2 macro monitors two integer inputs and determines which of these was the last to be changed. The value of this variable is output. The last_of_3 macro is derieved from the last_of_2 macro and extends that macro so that three integer inputs are monitored.

These macros could be used for a variety of tasks; such as determining whether a user input value or computer generated value should be used as the input to a module. If more inputs are required to be monitored then the last_of_2 macro can be extended as required. This can be done in the same way as was done for the last_of_3 macro.

Inputs

&in1 &in2 &in3

These integer parameters are monitored by the last_of macros. Whenever any of these values are changed the value is passed through to the output. This results in only the last changed value being present at the output.

Outputs

out

The value of the last of the inputs to be changed.


copy_on_trigger

This module modifies the original AVS/Express module copy_on_change. The copy_on_change module copies an input value to an output port when the input value is changed or when a separate parameter is triggered. By doing this the copied value can be changed without effecting the original value. Further information can be found in the AVS/Express documentation. The copy_on_trigger module modifies the copy_on_change module by specifying that the module is only triggered by the trigger parameter. The module does not copy the input to the output when the input is changed.

This module could be used in many ways. For instance it could be used to improve the users control over module parameters. Changing the parameters of many visualization modules causes a long delay while processing occurs. If several parameters are changed this delay will happen several times. In some instances these unnecessary delays can be prevented by isolating the user interface controls from the visualization modules and adding a "Calculate Now" button. This button would trigger several copy_on_trigger modules that would transfer data from the user interface to the visualization modules.

Please see the copy_on_change documentation for full information on the input and output ports of the copy_on_trigger module.


BreakableLink
ToggleableLink
TemporaryLink

These macros all implement links that can be dynamically connected and disconnected so that the flow of data through the network can be changed. These macros could have various applications; for instance it could be used to stop the flow of data while a file is loaded and thereby prevent unnecessary visualization calculations.

BreakableLink and ToggleableLink both implement a link that can maintain its connected or disconnected state for an indefinite period. The only substative difference between these modules is in the way they are triggered. The BreakableLink macro has two trigger inputs, a connect trigger and a disconnect trigger. These make and break the connect as appropriate. The ToggleableLink macro has a single trigger input. This is used to toggle the link between connected and disconnected states.

TemporaryLink works in a significantly different way. The macro has a single trigger input. When this is triggered the connection is made and then immediately broken again. Although this behaviour may appear to have limited uses it could be used in a situation where data is only required temporarily so that a module can update its output.

Inputs

&in

The input data that is to flow through the link when the link is connected. This data can be of any type.

&connect

A trigger parameter that is used by the BreaklableLink macro to connect the input to the output. When this parameter is triggered(i.e. changed) the network inside the macro is altered so that the input is connected to the output.

&disconnect

A trigger parameter that is used by the BreakableLink macro to disconnect the input from the output. When this parameter is triggered the network inside the macro is altered so that the input is not connected to the output.

&trigger

A trigger parameter that is used by the ToggleableLink and TemporaryLink macros. When this parameter is triggered on the ToggleableLink macro the link is toggled between being connected and being disconnected. When this parameter is triggered on the TemporaryLink macro the link is connected and then immediately broken.

Outputs

out

When the link is connected input data flows through the macro and is output through this link. This data can be of any type and should not be affected by the macro in any way.


SortTwoValues

SortTwoValues is a very simple module that takes two numbers, determines which is greater and outputs them. The module operates on AVS primitives and therefore can operate on any of the numerical types.

Inputs

value1 & value2

The numbers that are to be arranged into numerical order.

Outputs

low

The lesser of the two imput numbers.

high

The greater of the two imput numbers.


SetArrayElement

This macro allows an element in an array to be set by inputting an index and a value. This macro uses the parse_v module to achieve this.

Inputs

&index

The integer index of the array element that should be set. When this parameter is changed the macro assigns the number present on the value input to the appropriate array element. The index is not checked to determine whether it is in range and AVS/Express will report an error if it is not.

&value

The primitive value that should be assigned to the array element. Changing this parameter does not cause the array element value to be updated. To set the array element value the the index parameter must be triggered.

&data_array

The primitive array whose elements are to be set. This array can be of any primitive type.

Outputs

data_array

The primitive array whose elements have been set. This output is a reference to the same array as the data_array input. It is not a separate array in memory. The output is only provided as a convenience so that clear networks can be formed more easily.


kill_parent
kill_grandparent
kill_greatgrandparent

These macros delete the ancestors of the macro at various levels. The kill_parent macro causes the macro's parent to be removed when it is triggered. This also causes the macro itself and all of its siblings to be removed. The kill_grandparent macro causes the macro's grandparent and all its subobjects to be removed. Similarly the kill_greatgrandparent causes the macro's great-grandparent and all its subobjects to be removed.

These macros should be used with care. If a kill_parent macro is placed directly within an application object then it will remove the entire application when triggered. Any changes made to the application network will be lost. It should be noted that high-level objects such as Libraries and Applications are protected by AVS/Express and hence cannot be deleted.

kill_grandparent and kill_greatgrandparent are both derived from the kill_parent macro. If ancestors further removed are required to be deleted then the kill_parent macro can be extended further.

Inputs

&trigger

When this parameter is triggered the appropriate ancestor object is removed.


Files

iac_proj/common/ne_wdgts.v contains the V definitions of the Increment, Decrement, Stepper, last_of_2, last_of_3, BreakableLink, ToggleableLink, TemporaryLink, SortTwoValues, SetArrayMember, kill_parent, kill_grandparent and kill_greatgrandparent macros.

Other Notes

The NetworkWidgets library inherits its process. As this library contains no procedural code, the process is not important. The CommonMods library contains all procedural code used by the Common project and should be compiled.

Authors

Andrew Dodd, Various

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL