unit DataClientConnectBad;

interface

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

type
  TDataClientConnectBadForm = class(TForm)
    Timer1: TTimer;
    StatePanel: TPanel;
    StateLabel: TLabel;
    Label2: TLabel;
    btCancel: TButton;
    procedure Timer1Timer(Sender: TObject);
    procedure btCancelClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  DataClientConnectBadForm: TDataClientConnectBadForm;

implementation
uses
  Users,
  RpVisualMain,
  RpVisualGlobal,
  Status,
  MesLogging,
  Connecting,
  TagStorage,
  main;

{$R *.dfm}

procedure TDataClientConnectBadForm.Timer1Timer(Sender: TObject);
begin
  timer1.Enabled := false;

  AutoLoginUserName := CurUserName;

  Hide;
  ConnectSystem;
  Show;

  if rvgLogin then begin
    DataClientConnectBadForm := nil;
    Release;
  end else begin
    timer1.Enabled := true;
  end;
end;


procedure TDataClientConnectBadForm.btCancelClick(Sender: TObject);
begin
  timer1.Enabled := false;
  DataClientConnectBadForm := nil;
  updateMainFormButtons;
  Release;
end;

end.
