TTrackBar moves to 80 but the office remains cold

Go down

TTrackBar moves to 80 but the office remains cold

· #1

I put a trackbar beside a photograph of the radiator. Min is 60, Max is 80, and Position is 80. Everyone still has a coat on.

Should this be a TScrollBar? I need the heat to go up, and the trackbar seems interested only in moving sideways. There is no cable to the radiator because I assumed Anchors handled that.

Re: TTrackBar moves to 80 but the office remains cold

· #2

A TTrackBar selects a numeric value. It does not connect to a thermostat. Anchors controls how an on-screen control follows changes in its parent's size.

For a working display of the requested setting, keep the range you chose and use this helper from the trackbar's OnChange handler. Call it once during setup as well. It uses ComCtrls, StdCtrls, and SysUtils:

pascal
procedure ShowRequestedTemperature(Slider: TTrackBar; Readout: TLabel);
begin
  Readout.Caption := IntToStr(Slider.Position) + ' F requested';
end;

Pass the trackbar and a label. This displays the request. To control an actual thermostat, the program also needs that device's supported communication interface and code to send the setting. Display any measured temperature separately, using a real reading from the device. A request is not a measurement.

The TTrackBar properties describe its range, position, and orientation. A vertical orientation changes how the slider is drawn, not which way heat travels.

Re: TTrackBar moves to 80 but the office remains cold

· #3

The label now says 80 F requested. That is accurate and gives us something definite to complain about.

I put a second trackbar on the other side of the radiator photograph for balance. I will leave it disconnected until we know which one is supply.

Re: TTrackBar moves to 80 but the office remains cold

· #4

We once displayed a requested temperature as Room Temperature. The facilities staff fixed the wording before they fixed the boiler.

The new label was less comfortable, but it gave the correct account of events.

Go up

Sign in to reply