//---------------------------------------------------------------------------
#ifndef ReadIndH
#define ReadIndH
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
#include <vcl\ExtCtrls.hpp>
#include <vcl\Buttons.hpp>
#include <vcl\Mask.hpp>
//---------------------------------------------------------------------------

#define LongPlat	0
#define ShortPlat	1

typedef struct _ScalePars {
    int     Indicator,
    		Com;

	DWORD	BaudRate;

	bool	Arquivo,Leitura;
    
	BYTE	ByteSize,
    		Parity,
			StopBits;
} ScalePars;

class TFormConfBal : public TForm
{
__published:	// IDE-managed Components
	TLabel *LabelLiquido;
	TTimer *TimerConfBal;
	TLabel *Label1;
	TLabel *Label2;
	TLabel *LabelStatus;
	TPanel *PanelGross;
	TPanel *PanelTare;
	TPanel *PanelNet;
	TShape *ShapeStable;
	TShape *ShapeMotion;
	TLabel *Label3;
	TShape *ShapeOvercap;
	TLabel *Label4;
	TShape *ShapeError;
	TLabel *Label5;
	TGroupBox *GBConexao;
	TRadioGroup *RGBaudRate;
	TRadioGroup *RGDataBits;
	TRadioGroup *RGStopBit;
	TRadioGroup *RGParity;
	TButton *ButtonTeste;
	TComboBox *CBConexao;
	TGroupBox *GBIndicador;
	TComboBox *CBIndicador;
	TLabel *LabelUnidade;
	TBitBtn *BitBtnSalvar;
	TCheckBox *CheckBoxLeitura;
	TCheckBox *CheckBoxArquivo;
	TTimer *TimerReabilita;
        TLabel *Label6;
        TPanel *PanelCont;
        TPanel *PanelCod;
        TLabel *Label7;
	void __fastcall TimerConfBalTimer(TObject *Sender);
	void __fastcall ButtonTesteClick(TObject *Sender);
	void __fastcall CheckParametersComm(void);
	void __fastcall CBIndicadorChange(TObject *Sender);
	void __fastcall RGBaudRateClick(TObject *Sender);
	void __fastcall RGParityClick(TObject *Sender);
	void __fastcall RGStopBitClick(TObject *Sender);
	void __fastcall RGDataBitsClick(TObject *Sender);
	void __fastcall ClearPanel(void);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall BitBtnSalvarClick(TObject *Sender);
	void __fastcall DisableAllFields(void);
	void __fastcall EnableAllFields(void);
	void __fastcall ClearAllFields(void);
	void __fastcall GetInformation(void);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall CheckBoxLeituraClick(TObject *Sender);
	void __fastcall CheckBoxArquivoClick(TObject *Sender);
	bool __fastcall InicializaBalanca(void);
	bool __fastcall GeraArquivo(void);
	void __fastcall TimerReabilitaTimer(TObject *Sender);
    void __fastcall CBConexaoChange(TObject *Sender);
private:	// User declarations
	int	status;
    HANDLE  hScale;
public:		// User declarations
    ScalePars	ParametrosBal;
    int __fastcall WriteScaleParameters(int balno,ScalePars *pPars);
    int __fastcall GetScaleParameters(int balno,ScalePars *pPars);
        __fastcall TFormConfBal(TComponent* Owner);


};
//---------------------------------------------------------------------------
extern TFormConfBal *FormConfBal;
//---------------------------------------------------------------------------
#endif
