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

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

#include "ErrorList_Form.h"
#include "Environment.h"
#include <ComCtrls.hpp>
#include <Grids.hpp>
#include <Buttons.hpp>
#include "TntButtons.hpp"
#include "TntExtCtrls.hpp"
#include "TntGrids.hpp"
#include "TntStdCtrls.hpp"
#include "TntForms.hpp"
//---------------------------------------------------------------------------
typedef struct
{
    // hcb info
    int CurrentSensor1ListIndex;
	int CurrentSensor2ListIndex;
	int CurrentCapture1ListIndex;
	int CurrentCapture2ListIndex;
	int PollingResultTabletIndex;
	int PollingBlowTabletIndex;

	int NextCaptureListIndex[SYSTEM_SPB_MAX_COUNT];
	int NumberingCaptureListIndex[SYSTEM_SPB_MAX_COUNT];
	int PollingCaptureListIndex[SYSTEM_SPB_MAX_COUNT];
	int ProcessingTabletListIndex[SYSTEM_SPB_MAX_COUNT];
} TPCTabletInfo;
//---------------------------------------------------------------------------
class TInspectionStatusForm : public TTntForm
{
__published:	// IDE-managed Components
	TTntPanel *Panel1;
	TTntButton *ReadButton;
	TTntButton *StopButton;
	TTimer *StatusReadTimer;
    TTntGroupBox *GroupBox1;
    TTntLabel *Label1;
    TTntLabel *Sensor1IndexLabel;
    TTntLabel *Label2;
    TTntLabel *Sensor2IndexLabel;
    TTntLabel *Label4;
    TTntLabel *Capture1IndexLabel;
    TTntLabel *Label6;
    TTntLabel *Capture2IndexLabel;
    TTntLabel *Label8;
    TTntLabel *ResultIndexLabel;
    TTntLabel *Label10;
    TTntLabel *BlowIndexLabel;
	TTntGroupBox *GroupBox2;
	TTntLabel *Label3;
	TTntLabel *NextCaptureIndexLabel1;
	TTntLabel *Label5;
	TTntLabel *NumberingIndexLabel1;
	TTntLabel *Label9;
	TTntLabel *PollingCaptureIndexLabel1;
	TTntLabel *Label12;
	TTntLabel *ProcessingIndexLabel1;
	TTntGroupBox *GroupBox3;
	TTntLabel *Label14;
	TTntLabel *NextCaptureIndexLabel2;
	TTntLabel *Label16;
	TTntLabel *NumberingIndexLabel2;
	TTntLabel *Label18;
	TTntLabel *PollingCaptureIndexLabel2;
	TTntLabel *Label20;
	TTntLabel *ProcessingIndexLabel2;
	TTntGroupBox *GroupBox4;
	TTntLabel *Label7;
    TTntLabel *NextCaptureIndexLabel3;
	TTntLabel *Label13;
    TTntLabel *NumberingIndexLabel3;
	TTntLabel *Label17;
    TTntLabel *PollingCaptureIndexLabel3;
	TTntLabel *Label21;
    TTntLabel *ProcessingIndexLabel3;
	TTntGroupBox *GroupBox5;
	TTntLabel *Label23;
    TTntLabel *NextCaptureIndexLabel4;
	TTntLabel *Label25;
    TTntLabel *NumberingIndexLabel4;
	TTntLabel *Label27;
    TTntLabel *PollingCaptureIndexLabel4;
	TTntLabel *Label29;
    TTntLabel *ProcessingIndexLabel4;
	TTntLabel *Label11;
	TTntLabel *CurrentTabletNumberLabel;
	TTntLabel *Label15;
	TTntLabel *Int1IndexLabel;
	TTntLabel *Label22;
	TTntLabel *Int2IndexLabel;
	TTntLabel *Label19;
	TTntLabel *CurrentRelatedDisk1ListIndexLabel;
  TTntStringGrid *SPBInspectionStatusStringGrid;
  TTntStringGrid *HCBInspectionStatusStringGrid2;
  TTntSpeedButton *SPBSpeedButton1;
  TTntSpeedButton *SPBSpeedButton3;
  TTntSpeedButton *SPBSpeedButton4;
  TTntSpeedButton *SPBSpeedButton2;
  TTntButton *TntButton1;
  TGroupBox *GroupBox11;
  TLabel *Label45;
  TLabel *Label55;
  TEdit *Edit2;
  TBitBtn *BitBtn1;
  TTntGroupBox *TntGroupBox1;
  TTntLabel *TntLabel1;
  TTntLabel *NextCaptureIndexLabel5;
  TTntLabel *TntLabel3;
  TTntLabel *NumberingIndexLabel5;
  TTntLabel *TntLabel5;
  TTntLabel *PollingCaptureIndexLabel5;
  TTntLabel *TntLabel7;
  TTntLabel *ProcessingIndexLabel5;
  TTntSpeedButton *TntSpeedButton1;
  TTntSpeedButton *TntSpeedButton2;
  TSpeedButton *SpeedButton1;
  TSpeedButton *SpeedButton2;
  TTntStringGrid *PrintResultStringGrid;
  TTimer *Timer1;
  TTntStringGrid *spbPrintResultStringGrid1;
  TTntStringGrid *spbPrintResultStringGrid2;
  TCheckBox *CheckBox1;
  TCheckBox *CheckBox2;
  TTntSpeedButton *TntSpeedButton3;
  TTntSpeedButton *TntSpeedButton4;
  TTntGroupBox *TntGroupBox2;
  TTntLabel *TntLabel2;
  TTntLabel *NextCaptureIndexLabel6;
  TTntLabel *TntLabel6;
  TTntLabel *NumberingIndexLabel6;
  TTntLabel *TntLabel9;
  TTntLabel *PollingCaptureIndexLabel6;
  TTntLabel *TntLabel11;
  TTntLabel *ProcessingIndexLabel6;
  TTntGroupBox *TntGroupBox5;
  TTntLabel *TntLabel25;
  TTntLabel *NextCaptureIndexLabel8;
  TTntLabel *TntLabel27;
  TTntLabel *NumberingIndexLabel8;
  TTntLabel *TntLabel29;
  TTntLabel *PollingCaptureIndexLabel8;
  TTntLabel *TntLabel31;
  TTntLabel *ProcessingIndexLabel8;
  TTntGroupBox *TntGroupBox6;
  TTntLabel *TntLabel33;
  TTntLabel *NextCaptureIndexLabel7;
  TTntLabel *TntLabel35;
  TTntLabel *NumberingIndexLabel7;
  TTntLabel *TntLabel37;
  TTntLabel *PollingCaptureIndexLabel7;
  TTntLabel *TntLabel39;
  TTntLabel *ProcessingIndexLabel7;
	void __fastcall ReadButtonClick(TObject *Sender);
	void __fastcall StopButtonClick(TObject *Sender);
	void __fastcall StatusReadTimerTimer(TObject *Sender);
  void __fastcall SPBSpeedButton1Click(TObject *Sender);
  void __fastcall TntButton1Click(TObject *Sender);
  void __fastcall BitBtn1Click(TObject *Sender);
  void __fastcall Timer1Timer(TObject *Sender);
  void __fastcall SpeedButton1Click(TObject *Sender);
  void __fastcall SpeedButton2Click(TObject *Sender);
  void __fastcall CheckBox2Click(TObject *Sender);
  void __fastcall TntFormActivate(TObject *Sender);
private:	// User declarations
	TPCTabletUnit TabletList[PC_TABLET_LIST_COUNT];
	TPCTabletInfo PCTabletInfo;
	TTabletInfo HCBTabletInfo;
    int StatusBoardIndex;
    TSPBTabletProcessInfo SPBTabletProcessInfo[SYSTEM_SPB_MAX_COUNT];
    TProcessingImageBufferData ProcessingImageBufferData[SYSTEM_SPB_MAX_COUNT];

    TErrorListForm *pErrorListForm;


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