library Test;

uses
  SysUtils,
  Classes,
  Forms,
  Dialogs,
  TestU in 'TestU.pas' {Form1};

{$R *.res}

procedure PluginStart( AOwner: TComponent ); stdcall;
begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.ShowMainForm := true;
  Form1.Show;
end;

procedure PluginFinalize; stdcall;
begin
	Form1.Free;
end;

procedure AccessVariable( varindex: word; var value: single; var write: boolean ); stdcall;
begin
  case varindex of
    0:
    begin
        Form1.Label2.Caption := floattostrF( value, ffFixed, 5, 1 ) + ' km/h';
        Form1.Gauge1.Progress := round( value );
        write := false;
    end;
    1:
    begin
      value := Form1.TrackBar1.Position / 30;
      write := true;
    end;
  end;
end;

procedure AccessTrigger( triggerindex: word; var active: boolean ); stdcall;
begin
  case triggerindex of
    0:
    begin
      active := Form1.Button1.Default;
    end;
  end;
end;

procedure AccessSystemVariable( varindex: word; var value: single; var write: boolean );
begin
end;

procedure AccessStringVariable( varindex: word; str: PWideChar; var write: boolean );
begin
end;

exports
        PluginStart,
        AccessVariable,
        AccessTrigger,
        AccessSystemVariable,
        AccessStringVariable,
        PluginFinalize;

begin
end.
