Table of Contents

Getting started with TMS FNC Widget Set Point

TTMSFNCWidgetSetPoint shows a live current value and a target set-point together on one circular scale, with a strip drawn between them. This page gets a working widget on screen; the guides cover value handling, appearance, and custom drawing in depth.

Prerequisites

  • TMS FNC Core installed and its runtime package added to the project.
  • TMS FNC Dashboard Pack design-time package registered in the IDE.

Add the control

  1. Drop TTMSFNCWidgetSetPoint from the TMS FNC Dashboard palette page onto a form.
  2. Set ValueOptions.Min and ValueOptions.Max to define the operating range.
  3. Set SetPoint to position the target marker.
  4. Set Value to display the current measured value.

Create it in code

The range, step, and number format live on the ValueOptions sub-object — not on the control directly. Configure the range first, because a Value or SetPoint outside Min..Max is silently ignored.

procedure TForm1.FormCreate(Sender: TObject);
var
  SetPoint: TTMSFNCWidgetSetPoint;
begin
  SetPoint := TTMSFNCWidgetSetPoint.Create(Self);
  SetPoint.Parent := Self;
  SetPoint.SetBounds(20, 20, 280, 280);

  { Define the operating range and number format on ValueOptions. }
  SetPoint.ValueOptions.Min := 10;
  SetPoint.ValueOptions.Max := 50;
  SetPoint.ValueOptions.Step := 0.5;
  SetPoint.ValueOptions.Format := '%.1f';

  { Caption above or below the ring. }
  SetPoint.CaptionOptions.Text := 'Thermostat';

  { Target value (the set-point marker) and the live current value. }
  SetPoint.SetPoint := 21;
  SetPoint.Value := 24;
end;

procedure TForm1.ApplyReading(ATemperature: Single);
begin
  { Update the live value from a timer or data source. }
  TMSFNCWidgetSetPoint1.Value := ATemperature;

  { Annotate the center based on how value compares to the set-point. }
  if TMSFNCWidgetSetPoint1.SetPoint > ATemperature then
    TMSFNCWidgetSetPoint1.Tickmarks.CenterText := 'Heating'
  else if TMSFNCWidgetSetPoint1.SetPoint < ATemperature then
    TMSFNCWidgetSetPoint1.Tickmarks.CenterText := 'Cooling'
  else
    TMSFNCWidgetSetPoint1.Tickmarks.CenterText := 'OK';
end;

Next steps