#ifndef OverbyteIcsSnmpCliTst1H
#define OverbyteIcsSnmpCliTst1H

#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>

#include "OverbyteIcsTypes.hpp"
#include "OverbyteIcsSnmpCli.hpp"

class TSnmpClientTestForm : public TForm
{
__published:
    TPanel *ToolsPanel;
    TMemo *DisplayMemo;
    TLabel *HostEditLabel;
    TLabel *CommunityLabel;
    TEdit *HostEdit;
    TEdit *CommunityEdit;
    TLabel *Label4;
    TButton *GetButton;
    TLabel *TimeoutLabel1;
    TEdit *TimeoutEdit;
    TButton *ClearButton;
    TEdit *MaxRetriesEdit;
    TLabel *MaxRetriesLabel;
    TLabel *PortLabel;
    TEdit *PortEdit;
    TLabel *TimeoutLabel;
    TLabel *PortRangeLabel;
    TEdit *PortRangeEdit;
    TButton *GetTableButton;
    TComboBox *OidComboBox;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall GetButtonClick(TObject *Sender);
    void __fastcall ClearButtonClick(TObject *Sender);
    void __fastcall GetTableButtonClick(TObject *Sender);

private:
    String FIniFileName;
    bool FInitialized = false;
    TSnmpCli *FSnmpCli = nullptr;
    unsigned FStartTick = 0;
    unsigned FEndTick = 0;

    void SetupRequest();
    void __fastcall SnmpCliRequestDone(TObject *Sender, TSnmpCliReq ReqType, TSnmpCliAct &Action, Word ErrCode);

public:
    __fastcall TSnmpClientTestForm(TComponent *Owner);
    void Display(const String &Msg);
};

extern PACKAGE TSnmpClientTestForm *SnmpClientTestForm;

#endif
