Skip to main content

Advanced Cluster Part 3

• In the “Custom_Gauge”, add new “StackLayout” and name it “StackLayout_Texts”

• Add 2 “Text” controls and 1 “Text Value” control to the “StackLayout_Texts”, rename the text controls to “Text_Top” and “Text_Bottom”

drawing-7-1676524979.pngdrawing-7-1676524979.png

• Ensure that the order of the items inside of this layout is the same as shown in the picture above.

• Set these parameters: Arrangement = Vertical, MinimumSize = 250, VerticalAlignment = VCenter

drawing-7-1676524999.pngdrawing-7-1676524999.png

• Set these “Text_Top” values: VerticalAlignment = VCenter, HorizontalAlignment = HCenter, Text Alignment = Center, Text Style = OpenSans35, Text = “RPM”

• Same for the “Text_Bottom” values, but set Text = “” (to be empty)

• Almost the same for the “Text_Value”, with these differences: Format Text = “%04d”, Text Style = Vera96

drawing-7-1676525320.png
drawing-7-1676525330.png
drawing-7-1676525340.png
drawing-7-1676525260.png

• Select the “StackLayout_Texts” and add 2 Value behaviors (Toolbox->Behaviors->Value Processing->Value). Name them as “Value_TextPos_X” and “Value_TextPos_Y”

020-Value_Behavior.png
021-Value_Behaviors_Applied.png
drawing-7-1676525394.png

drawing-7-1676525405.png
• To each of these behaviors, insert 1 “Set Position” behavior (Behaviors->Value Processing->Transformation->Set Position). Name them “Set Position_X” and “Set Position_Y”
037-SetPosBehaviors.png
drawing-7-1676525430.png

• For both of them, set the target node Custom_Gauge->StackLayout_Texts. Select the proper axis (X for Set Position_X, Y for Set Position_Y)

• Set Variant = 205 for the “Value_TextPos_X” behavior and Variant = 230 for “Value_TextPos_Y”

• Click at the “Custom_Gauge” control and put “Forward Value” behavior into it

• Set its target node to “Custom_Gauge->StackLayout_Texts->TextValue”

022-ForwardValue.png
drawing-7-1676525454.png

• Go to the “Custom_Gauge”, click on the “ControlValueProvider” behavior and set the Receivers Maximum value to 8000. Then try to change its Variant value so you can see the text and needle updated.

• Right-click at the “Custom_Gauge” and select “Control Properties…”. We will choose which properties should be available from the scene as the control properties

• Follow the settings from the pictures below:

ForegroundImage:


025-ForegroundImage_ConfigureProperties.png
drawing-7-1676525492.png

BackgroundImage:

0251-BackgroundImage_ConfigureProperties.png
drawing-7-1676525560.png

NeedleImage:

0261-NeedleImage_ConfigureProperties.png
drawing-7-1676525593.png

NeedleEffectImage:

026-NeedleEffect_ConfigureProperties.png
drawing-7-1676525629.png

Text_Bottom:

027-TextBottom_ConfigureProperties.png
drawing-7-1676525656.png

Text_Top:

029-TextTop_ConfigureProperties.png
drawing-7-1676525680.png

Text_Value:

030-TextValue_ConfigureProperties.png
drawing-7-1676525703.png

Value_TextPosX and Value_TextPosY:

028-TextPos_ConfigureProperties.png
drawing-7-1676525724.png

• The custom gauge control should now be finished and ready to use