// DEPRECATED !!!

unit CtrlPanelDltbParams;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TCtrlPanelDltbParamsForm = class(TForm)
    memo: TMemo;
    Button1: TButton;
    btUpdate: TButton;
    procedure btUpdateClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    TagName, TagPath: string;
  end;

var
  CtrlPanelDltbParamsForm: TCtrlPanelDltbParamsForm;

implementation
uses
  TagStorage;

{$R *.dfm}

procedure TCtrlPanelDltbParamsForm.btUpdateClick(Sender: TObject);
var
  i: integer;
  l: cardinal;
  tagPrNum, tagPrVal: integer;
begin
  tagPrNum := GetTagIndex(TagPath + '.PrNum');
  tagPrVal := GetTagIndex(TagPath + '.PrVal');

  memo.Lines.Clear;
  if (tagPrNum<0) or (tagPrVal<0) then exit;

  for i:=0 to 157 do begin
    SetTagValue(tagPrNum, i);

    l:=GetTickCount;
    repeat
      Application.ProcessMessages;
      if GetTagValue(tagPrNum) = i then break;
    until GetTickCount-l > 3000;

    if GetTagValue(tagPrNum) = i then begin
      memo.Lines.Add('Pr' + inttostr(i) + ' = ' + inttostr(GetTagValue(tagPrVal)) );
    end else
      exit;

    memo.Update;  
  end;


end;

end.
