//---------------------------------------------------------------------------
#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>
#include "Trayicon.h"
#include <AppEvnts.hpp>
#include <Menus.hpp>
#include "trayicon.h"
//---------------------------------------------------------------------------

#define LongPlat	0
#define ShortPlat	1

typedef struct _ScalePars {
    int     Indicator,
    		Com;

	DWORD	BaudRate;

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

class TfrmMain : public TForm
{
__published:	// IDE-managed Components
    TTimer *TimerRead;
    TGroupBox *GroupBox2;
    TSpeedButton *btnConfigurar;
    TLabel *lblBaudRate;
    TLabel *lblPorta;
    TGroupBox *GroupBox1;
    TLabel *LabelLiquido;
    TLabel *Label1;
    TLabel *Label2;
    TLabel *Label6;
    TLabel *Label7;
    TPanel *PanelGross;
    TPanel *PanelTare;
    TPanel *PanelNet;
    TPanel *PanelCont;
    TPanel *PanelCod;
    TLabel *Label8;
    TLabel *Label9;
    TPanel *PanelVtot;
    TPanel *PanelVunit;
    TGroupBox *GroupBox3;
    TCheckBox *chkStartRunning;
    TCheckBox *chkBuildTxtFile;
    TLabel *Label11;
    TLabel *Label12;
    TLabel *Label13;
    TSpeedButton *btnSalvar;
    TSpeedButton *btnTestar;
    TTrayIcon *TIcon;
    TApplicationEvents *ApplicationEvents1;
    TPopupMenu *pmTrayIcon;
    TMenuItem *Restaurar1;
    TMenuItem *Fechar1;
    TSpeedButton *btnSair;
    TGroupBox *GroupBox4;
    TLabel *lblStatus;
    TButton *btnEnviaCS;
    TLabel *Label3;
    TPanel *Paneldfab;
    TLabel *Label4;
    TPanel *Paneldval;
    TLabel *Label5;
    TPanel *Panelpmed;
    TMainMenu *MainMenu1;
    TMenuItem *Sobre1;
    TLabel *lblModelo;
	void __fastcall TimerReadTimer(TObject *Sender);
	void __fastcall ClearPanel(int tipo);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall chkStartRunningClick(TObject *Sender);
	void __fastcall chkBuildTxtFileClick(TObject *Sender);
	bool __fastcall GeraArquivo(void);
    void __fastcall btnConfigurarClick(TObject *Sender);
    void __fastcall ShowParameters();
    void __fastcall btnTestarClick(TObject *Sender);
    void __fastcall FormActivate(TObject *Sender);
    void __fastcall ApplicationEvents1Minimize(TObject *Sender);
    void __fastcall TIconMinimize(TObject *Sender);
    void __fastcall TIconRestore(TObject *Sender);
    void __fastcall Restaurar1Click(TObject *Sender);
    void __fastcall Fechar1Click(TObject *Sender);
    void __fastcall btnSalvarClick(TObject *Sender);
    void __fastcall btnSairClick(TObject *Sender);
    void __fastcall btnEnviaCSClick(TObject *Sender);
    bool __fastcall Inicializa();
    void __fastcall Sobre1Click(TObject *Sender);
private:	// User declarations
	char	status,gross[9],tare[9],net[9], unit[3], cont[7], cod[6];
    AnsiString  mascara;
public:		// User declarations
    __fastcall TfrmMain(TComponent* Owner);

};
//---------------------------------------------------------------------------
extern TfrmMain *frmMain;
//---------------------------------------------------------------------------
#endif
