//---------------------------------------------------------------------------

#ifndef IntervalSetting_FormH
#define IntervalSetting_FormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>

#include "Environment.h"
#include "TntExtCtrls.hpp"
#include "TntGrids.hpp"
#include "TntStdCtrls.hpp"
#include "TntForms.hpp"
//---------------------------------------------------------------------------
typedef struct
{
    int CurrentSensor1ListIndex;
    int CurrentSensor2ListIndex;
} TIntervalData;
//---------------------------------------------------------------------------
class TIntervalSettingForm : public TTntForm
{
__published:	// IDE-managed Components
    TTntPanel *Panel1;
    TTntPanel *Panel2;
    TTntStringGrid *IntervalStringGrid;
    TTimer *StatusReadTimer;
    TTntButton *StartButton;
    TTntButton *StopButton;
    TTntButton *CalculateButton;
	TTntButton *SetupButton;
    TTntGroupBox *GroupBox1;
    TTntLabel *Label1;
	TTntLabel *AverageIntervalALabel;
    TTntLabel *Label2;
	TTntLabel *MinIntervalALabel;
    TTntLabel *Label4;
	TTntLabel *MaxIntervalALabel;
	TTntLabel *Label3;
	TTntEdit *VDSpeedEdit;
	TTntLabel *Label5;
	TTntEdit *SetupValueAEdit;
	TTntGroupBox *GroupBox2;
	TTntLabel *Label6;
	TTntLabel *AverageIntervalBLabel;
	TTntLabel *Label8;
	TTntLabel *MinIntervalBLabel;
	TTntLabel *Label10;
	TTntLabel *MaxIntervalBLabel;
	TTntLabel *Label7;
	TTntEdit *SetupValueBEdit;
  TTntLabel *TntLabel1;
  TTntLabel *TntLabel2;
  TTntEdit *CalcSetupValueAEdit;
  TTntEdit *CalcSetupValueBEdit;
  TTntLabel *TntLabel3;
    void __fastcall StartButtonClick(TObject *Sender);
    void __fastcall StopButtonClick(TObject *Sender);
    void __fastcall StatusReadTimerTimer(TObject *Sender);
    void __fastcall CalculateButtonClick(TObject *Sender);
	void __fastcall SetupButtonClick(TObject *Sender);
  void __fastcall TntFormCreate(TObject *Sender);
private:	// User declarations
    TPCTabletUnit TabletList[PC_TABLET_LIST_COUNT];
    TIntervalData IntervalData;
    int AverageIntervalA, AverageIntervalB;

    void __fastcall RefreshStringGrid(void);
public:		// User declarations
    __fastcall TIntervalSettingForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TIntervalSettingForm *IntervalSettingForm;
//---------------------------------------------------------------------------
#endif
