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

#ifndef SelectDefectImage_FormH
#define SelectDefectImage_FormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include "TntExtCtrls.hpp"
#include "TntStdCtrls.hpp"
#include "TntButtons.hpp"
#include <Buttons.hpp>                     
#include "Common_PC.h"
//---------------------------------------------------------------------------
typedef struct
{
    int DefectImageIndex[12];
    int DefectSeries[12];
    int DefectSize[12];
}TPrintDefectImageInfo;
class TSelectDefectImageForm : public TForm
{
__published:	// IDE-managed Components
        TTntPanel *Panel1;
        TTntPanel *Panel2;
        TTntPanel *ImagePanel1;
        TTntPanel *ImagePanel2;
        TTntPanel *ImagePanel3;
        TTntPanel *ImagePanel4;
        TTntPanel *ImagePanel5;
        TTntPanel *ImagePanel6;
        TTntPanel *ImagePanel7;
        TTntPanel *ImagePanel8;
        TTntPanel *ImagePanel9;
        TTntPanel *ImagePanel10;
        TTntPanel *ImagePanel11;
        TTntPanel *ImagePanel12;
        TTntImage *Image1;
        TTntImage *Image10;
        TTntImage *Image11;
        TTntImage *Image12;
        TTntImage *Image2;
        TTntImage *Image3;
        TTntImage *Image4;
        TTntImage *Image5;
        TTntImage *Image6;
        TTntImage *Image7;
        TTntImage *Image8;
        TTntImage *Image9;
        TScrollBar *ScrollBar1;
        TTntGroupBox *ErrorType1;
        TTntGroupBox *ErrorType2;
        TTntGroupBox *ErrorType3;
        TTntGroupBox *ErrorType4;
        TTntGroupBox *ErrorType5;
        TTntGroupBox *ErrorType6;
        TTntGroupBox *ErrorType7;
        TTntGroupBox *ErrorType8;
        TTntGroupBox *ErrorType9;
        TTntGroupBox *ErrorType10;
        TTntGroupBox *ErrorType11; 
        TTntGroupBox *ErrorType12;
        TTntImage *ErrorTypeImage1;
        TTntImage *ErrorTypeImage10;  
        TTntImage *ErrorTypeImage11;
        TTntImage *ErrorTypeImage12;
        TTntImage *ErrorTypeImage2;
        TTntImage *ErrorTypeImage3;
        TTntImage *ErrorTypeImage4;
        TTntImage *ErrorTypeImage5;
        TTntImage *ErrorTypeImage6;
        TTntImage *ErrorTypeImage7;
        TTntImage *ErrorTypeImage8;
        TTntImage *ErrorTypeImage9;
        TTntBitBtn *OkBitBtn;
        TTntBitBtn *CancelBitBtn;
        TTntLabel *ImageLabel1;
        TTntLabel *ImageLabel10;
        TTntLabel *ImageLabel11;
        TTntLabel *ImageLabel12;
        TTntLabel *ImageLabel2;
        TTntLabel *ImageLabel3;
        TTntLabel *ImageLabel4;
        TTntLabel *ImageLabel6;
        TTntLabel *ImageLabel5;
        TTntLabel *ImageLabel7;
        TTntLabel *ImageLabel8;
        TTntLabel *ImageLabel9;
        TTntLabel *ErrorLabel1;
        TTntLabel *ErrorLabel10; 
        TTntLabel *ErrorLabel11;  
        TTntLabel *ErrorLabel12;
        TTntLabel *ErrorLabel2;
        TTntLabel *ErrorLabel3;
        TTntLabel *ErrorLabel4;
        TTntLabel *ErrorLabel5;
        TTntLabel *ErrorLabel6;
        TTntLabel *ErrorLabel8;
        TTntLabel *ErrorLabel7;
        TTntLabel *ErrorLabel9;
        TTntLabel *TypeLabel1;
        TTntLabel *TypeLabel2;
        TTntLabel *TypeLabel3;
        TTntLabel *TypeLabel4;
        TTntLabel *TypeLabel5;
        TTntLabel *TypeLabel6;
        TTntLabel *TypeLabel7;
        TTntLabel *TypeLabel8;
        TTntLabel *TypeLabel9;
        TTntLabel *TypeLabel10;
        TTntLabel *TypeLabel11;
        TTntLabel *TypeLabel12;
        TPanel *Panel3;
  TTntLabel *Label1;
  TTntLabel *Label2;
        void __fastcall ErrorType1Click(TObject *Sender);
        void __fastcall ErrorType2Click(TObject *Sender);
        void __fastcall ErrorTypeImage1Click(TObject *Sender);
        void __fastcall ErrorTypeImage2Click(TObject *Sender);
        void __fastcall ErrorType3Click(TObject *Sender);
        void __fastcall ErrorType4Click(TObject *Sender);
        void __fastcall ErrorType5Click(TObject *Sender);
        void __fastcall ErrorType6Click(TObject *Sender);
        void __fastcall ErrorType7Click(TObject *Sender);
        void __fastcall ErrorType8Click(TObject *Sender);
        void __fastcall ErrorType9Click(TObject *Sender);
        void __fastcall ErrorType10Click(TObject *Sender);
        void __fastcall ErrorType11Click(TObject *Sender);
        void __fastcall ErrorType12Click(TObject *Sender);
        void __fastcall ErrorTypeImage3Click(TObject *Sender);
        void __fastcall ErrorTypeImage4Click(TObject *Sender);
        void __fastcall ErrorTypeImage5Click(TObject *Sender);
        void __fastcall ErrorTypeImage6Click(TObject *Sender);
        void __fastcall ErrorTypeImage7Click(TObject *Sender);
        void __fastcall ErrorTypeImage8Click(TObject *Sender);
        void __fastcall ErrorTypeImage9Click(TObject *Sender);
        void __fastcall ErrorTypeImage10Click(TObject *Sender); 
        void __fastcall ErrorTypeImage11Click(TObject *Sender);
        void __fastcall ErrorTypeImage12Click(TObject *Sender);
        void __fastcall ScrollBar1Change(TObject *Sender);
        void __fastcall Image1DblClick(TObject *Sender);
        void __fastcall Image2DblClick(TObject *Sender);
        void __fastcall Image3DblClick(TObject *Sender);
        void __fastcall Image4DblClick(TObject *Sender);
        void __fastcall Image5DblClick(TObject *Sender);
        void __fastcall Image6DblClick(TObject *Sender);
        void __fastcall Image7DblClick(TObject *Sender);
        void __fastcall Image8DblClick(TObject *Sender);
        void __fastcall Image9DblClick(TObject *Sender);
        void __fastcall Image10DblClick(TObject *Sender);
        void __fastcall Image11DblClick(TObject *Sender);
        void __fastcall Image12DblClick(TObject *Sender);
        void __fastcall OkBitBtnClick(TObject *Sender);
        void __fastcall CancelBitBtnClick(TObject *Sender);
private:	// User declarations
  bool DefectType[12];  
  int SelectedPanel[12];
  int ScrollPos;
  TTntGroupBox *ErrorTypeBox[12];
  TTntImage *ErrorTypeImage[12];
  TTntPanel *DefectImagePanel[12];
  TTntImage *DefectImage[12];                             
  TList *DefectDataList;  
  TList *DefectViewList;
     
  AnsiString ProductCode;
  AnsiString LOTName;

  TPrintDefectImageInfo PrintDefectImageInfo;
                            
  int DefectSeriesCount[MAX_DEFECT_SERIES_COUNT + 1];

  void __fastcall TSelectDefectImageForm::DrawDefectImage();
  void __fastcall TSelectDefectImageForm::SelectionDefectSeries(int panelNum);
  void __fastcall TSelectDefectImageForm::SelectionInfoSorting();
  AnsiString __fastcall TSelectDefectImageForm::GetDefectContainerFileName(int defectIndex);
public:		// User declarations  
	__fastcall TSelectDefectImageForm(TComponent* Owner);
        void __fastcall TSelectDefectImageForm::DefectImageLoad(AnsiString lOTName, int* defectlist);
        bool  __fastcall TSelectDefectImageForm::WriteDefectSelectionData(AnsiString lOTName);   
        void __fastcall TSelectDefectImageForm::InitSelectDefect();
        int ModalStat;

        
};
//---------------------------------------------------------------------------
extern PACKAGE TSelectDefectImageForm *SelectDefectImageForm;
//---------------------------------------------------------------------------
#endif
