Component: Scale Linear Template (Advanced Shapes)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd
Version 1.2 (Release)
Category Advanced Shapes


Image Scale Linear Template component

A base component for drawing scales on horizontal or vertical strips. Can be used to simplify the building of rulers, meters and slider controls. Mouse handling is built in for easy construction of interactive controls.

This component can be used as a base to create child components

The following components all inherit the traits of Scale Linear Template:

-
Image Dash Scale Horizontal Horizontal based slider with a user defined scale, typically used on in SCADA based solution
Image Dash Scale Vertical Vertical based slider with a user defined scale, typically used on in SCADA based solution

Examples

Simple example showing how to use the simulation dial components as a meter display for use in monitoring type applications. FC6 Icon.png Meters

Downloadable macro reference

This component does not contain any downloadable macros

Simulation macro reference

GetValue

Get the current value from the scale.

Will be either the most recent value set by "SetValue", or, if set to "Control" mode, the latest mouse clicked value.

Parameters

This macro has no parameters


Return value

FLOAT


SetValue

Set the value for the scale. If a pointer object is defined, it will move to point at the new value.

Parameters

FLOAT Value
Value to set - will be constrained to the minumum-maximum range.


Return value

This call does not return a value


SetLabel

Set the text of the component's label.

Parameters

STRING Text
New text to set.


Return value

This call does not return a value


SetRange

Set new maximum and minimum values for the scale.

Parameters

FLOAT Minimum
The minimum value of the scale (Bottom of the component)
FLOAT Maximum
The maximum value of the scale (Top of the component)


Return value

This call does not return a value



Property reference

Pointer

This property is of type Panel object and can be referenced with the variable name target_object.

Sets an object to act as the pointer for the scale.

If in 'Display' mode, the pointer will move to show the incoming "SetValue" numbers.

In "Control" mode, it will act as an object for setting the value using mouse clicks/drags.

Track

This property is of type Panel object and can be referenced with the variable name track_object.

An object to represent a 'track' parallel to the scale upon which the moving part travels.

If the scale is resized or moved, the 'track' object will also be scaled or moved.

For example, the 'track' object could be a simple black rectangle to represent the 'slot' in which

a slider control moves.

Orientation

This property is of type Fixed list of ints and can be referenced with the variable name orientation.

Whether the scale and/or motion should be along the X-axis (horizontal) or Y-axis (vertical)

Function

This property is of type Fixed list of ints and can be referenced with the variable name is_slider.

Set the mode of the component...

Display - the pointer object moves only when a value is set using the 'SetValue' macro.

Control - the pointer can be moved using the mouse to set a new value, which can then be read using the

'GetValue' macro.

Resolution

This property is of type Signed integer and can be referenced with the variable name resolution.

Determines the amount of detail in the scale graphics - larger values will require more memory

and/or loading time etc.

BG Color

This property is of type Color picker with transparency and can be referenced with the variable name bg_color.

Colour of the background object.

Positive Color

This property is of type Color picker and can be referenced with the variable name ink_color.

Markings colour for positive scale values.

Negative Color

This property is of type Color picker and can be referenced with the variable name neg_color.

Markings colour for negative values.

Label Color

This property is of type Color picker and can be referenced with the variable name label_color.

Color for the text label.

Offset %

This property is of type Signed integer and can be referenced with the variable name line_offset.

Distance of the main line from the left or bottom of the component. % of component size.

Start %

This property is of type Signed integer and can be referenced with the variable name line_start.

Start position of the scale from the left/bottom of the component. % of component size.

End %

This property is of type Signed integer and can be referenced with the variable name line_end.

End position of the scale from the left/bottom of the component. % of component size.

Thickness

This property is of type Floating point and can be referenced with the variable name line_thick.

Thickness of the main scale line.

Show

This property is of type True or false and can be referenced with the variable name show_line.

Whether to show or hide the main scale line.

Divisions

This property is of type Signed integer and can be referenced with the variable name marks_count.

Number of major divisions of the scale - these can be numbered.

Offset %

This property is of type Signed integer and can be referenced with the variable name marks_offset.

Position of the division lines across the scale - % of component size,.

Thickness

This property is of type Floating point and can be referenced with the variable name divs_thick.

Thickness of the division lines.

Subdivisions

This property is of type Signed integer and can be referenced with the variable name marks_subdiv.

Number of smaller divsions between the numbered ones. Set to zero if not required.

Subs Offset

This property is of type Signed integer and can be referenced with the variable name subdiv_offset.

Position of the sub-division line ends. % of width across the component.

Subs Thickness

This property is of type Floating point and can be referenced with the variable name subs_thick.

Thickness of the sub-division lines..

Show

This property is of type True or false and can be referenced with the variable name show_marks.

Whether to show or hide the divisions and sub-divisions.

Maximum

This property is of type Floating point and can be referenced with the variable name val_max.

Maximum number to show on the scale.

Minimum

This property is of type Floating point and can be referenced with the variable name val_min.

Minimum number to show on the scale.

Decimals

This property is of type Signed integer and can be referenced with the variable name dec_places.

Number of decimal places to show on the numbers.

Offset %

This property is of type Signed integer and can be referenced with the variable name num_offset.

Distance acrross the scale width to show the numbers. % of component size.

Text Size %

This property is of type Signed integer and can be referenced with the variable name num_size.

Text height of the scale numbers. % of component size.

Font

This property is of type Font picker and can be referenced with the variable name num_font.

Font for the scale numbers.

Show

This property is of type True or false and can be referenced with the variable name show_numbers.

Whether to show or hide the scale numbers.

Text

This property is of type Line of text and can be referenced with the variable name label_text.

Text label for the component to aid identification.

Offset X %

This property is of type Signed integer and can be referenced with the variable name label_X.

X - position of the label. % of Width.

Offset Y %

This property is of type Signed integer and can be referenced with the variable name label_Y.

Y position of label. % of height.

Text Size %

This property is of type Signed integer and can be referenced with the variable name label_size.

Text size of label. % of component size.

Font

This property is of type Font picker and can be referenced with the variable name label_font.

Font for the component label.

Show

This property is of type True or false and can be referenced with the variable name show_label.

Whether to show or hide the text label.