Nevron Open Vision Documentation
Instrumentation / Gauges / Indicators / Knob Indicator
In This Topic
    Knob Indicator
    In This Topic

    Knob indicators are visualized by radial gauges and extend the functionality of the NValueIndicator class. Therefore knob indicators behave like normal value indicators, but have appearance that resembles volume knobs.

     Creating a Knob Indicator

    In order to create a knob indicator you must first create an instance of the NKnobIndicator class and then add it to the Indicators collection of the radial gauge. The following code snippet creates a simple radial gauge with a knob:

    C#
    Copy Code

    // create a radial gauge

    NRadialGauge radialGauge = new NRadialGauge();

    radialGauge.NeedleCap.Visible = false;
    radialGauge.BeginAngle =
    new NAngle(-225, NUnit.Degree);
    radialGauge.SweepAngle =
    new NAngle(270, NUnit.Degree);

    // add an axis
    NGaugeAxis axis = new NGaugeAxis();
    radialGauge.Axes.Add(axis);

    // add knob
    NKnobIndicator knobIndicator = new NKnobIndicator();
    radialGauge.Indicators.Add(knobIndicator);

     Knob Elements

    Each knob element consists of several parts as shown the following picture:

     Knob Rim

    Both the inner and the outer rim of the knob are controlled through an instance of the NCircularRim class. The rim style has several properties allowing you to customize its pattern.

    Rim Pattern

    You can change the rim pattern with the help of the Pattern property of the rim style. On the picture above the outer rim style uses RoundHandle rim pattern and the inner rim uses Circle respectively. The following table lists the available pattern options:

    Pattern Description
    Bolt The appearance of the rim resembles a bolt.
    Circle The rim is circular. On the picture above the inner rim style uses this pattern.
    EdgeHandle The appearance of the rim resembles a handle with "edges".
    EdgeHandleSmall Same as edge handle except the dips between edges are smaller.
    RoundHandle The appearance of the rim resembles a handle with round edges. On the picture above the outer rim style uses this pattern.
    RoundHandleSmall Same as RoundHandle except the the dips between the edges are smaller.

    Repeat Count

    For all rim patterns except circle you can also control the PatternRepeatCount property allowing you specify how many times the pattern will be repeated around the knob edge. On the picture above the outer rim uses a repeat count of 6.

    Radius Offset

    The Offset property allows you to configure the distance of the rim pattern from the rim of the knob.

    The following code snippet shows how to modify these properties:

    C#
    Copy Code

    // add knob

    NKnobIndicator knobIndicator = new NKnobIndicator();

    // offset the knob from the scale
    knobIndicator.OffsetFromScale = -2;

    // configure the outer rim style
    knobIndicator.OuterRim.Pattern = ENCircularRimPattern.RoundHandleSmall;
    knobIndicator.OuterRim.PatternRepeatCount = 8;
    knobIndicator.OuterRim.Offset = 2;