SimulatorFans/Client/source/Simulator.Manual.pas
Mark van Renswoude 96737bdc9a Added Servo mode
Refactored client to allow more simulators
2017-09-10 15:15:32 +02:00

68 lines
1.0 KiB
ObjectPascal

unit Simulator.Manual;
// #ToDo1 -oMvR: 2-9-2017: configurable speed for full fan power
interface
uses
System.Classes,
Vcl.Controls,
Vcl.ExtCtrls,
Vcl.Forms,
Vcl.StdCtrls,
Simulator.Base,
Simulator.Registry, Vcl.Samples.Spin, Vcl.ComCtrls;
type
TManualFrame = class(TSimulatorBaseFrame)
UpdateTimer: TTimer;
ValueTrackBar: TTrackBar;
procedure UpdateTimerTimer(Sender: TObject);
public
procedure Start; override;
procedure Stop; override;
end;
implementation
uses
System.SysUtils;
{$R *.dfm}
{ TManualFrame }
procedure TManualFrame.UpdateTimerTimer(Sender: TObject);
begin
Fans.SetAll(ValueTrackBar.Position);
end;
procedure TManualFrame.Start;
begin
inherited Start;
UpdateTimer.Enabled := True;
end;
procedure TManualFrame.Stop;
begin
UpdateTimer.Enabled := False;
inherited Stop;
end;
initialization
RegisterSimulator('Manual', 'Manual fan control',
function(AFans: ISimulatorFans): ISimulator
begin
Result := TSimulatorFrame<TManualFrame>.Create(AFans);
end);
end.