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

#ifndef IDB0051MFH
#define IDB0051MFH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <ExtCtrls.hpp>
#include <Graphics.hpp>
#include <ComCtrls.hpp>
#include <ADODB.hpp>
#include <DB.hpp>
//---------------------------------------------------------------------------
#include "CDSColSysF.h"
#include "CDSPrcsParamF.h"
#include "cxButtons.hpp"
#include "cxCalc.hpp"
#include "cxCheckBox.hpp"
#include "cxClasses.hpp"
#include "cxContainer.hpp"
#include "cxControls.hpp"
#include "cxCustomData.hpp"
#include "cxData.hpp"
#include "cxDataStorage.hpp"
#include "cxDropDownEdit.hpp"
#include "cxEdit.hpp"
#include "cxFilter.hpp"
#include "cxGraphics.hpp"
#include "cxGrid.hpp"
#include "cxGridCustomTableView.hpp"
#include "cxGridCustomView.hpp"
#include "cxGridLevel.hpp"
#include "cxGridTableView.hpp"
#include "cxGroupBox.hpp"
#include "cxLabel.hpp"
#include "cxLookAndFeelPainters.hpp"
#include "cxLookAndFeels.hpp"
#include "cxMaskEdit.hpp"
#include "cxPC.hpp"
#include "cxPCdxBarPopupMenu.hpp"
#include "cxSpinEdit.hpp"
#include "cxSplitter.hpp"
#include "cxStyles.hpp"
#include "cxTextEdit.hpp"
#include "dxSkinBlack.hpp"
#include "dxSkinBlue.hpp"
#include "dxSkinsCore.hpp"
#include "dxSkinscxPCPainter.hpp"
#include "cxGridBandedTableView.hpp"

class TIDB0051M : public TForm
{
__published:	// IDE-managed Components
    TShape *ShpTitle;
    TcxButton *BtnSearch;
    TcxButton *BtnClose;
    TLabel *LblCaption;
    TEdit *EdFocus;
    TShape *ShpList;
    TTimer *TmrShow;
    TADOQuery *ADOQry;
    TShape *ShpInfo;
    TcxCheckBox *ChkAutoWidth;
    TcxButton *BtnBestFit;
    TcxButton *BtnSave;
    TcxButton *BtnCancel;
    TcxButton *BtnInsert;
    TcxButton *BtnEdit;
    TcxButton *BtnDelete;
    TcxGrid *CxList;
    TcxGridLevel *GlList;
    TcxGridBandedTableView *TvList;
    TcxGridBandedColumn *Column10;
    TcxGridBandedColumn *Column11;
    TcxGridBandedColumn *Column20;
    TcxGridBandedColumn *Column21;
    TcxGridBandedColumn *Column22;
    TcxGridBandedColumn *Column23;
    TcxGridBandedColumn *Column24;
    TcxGridBandedColumn *Column30;
    TcxGridBandedColumn *Column31;
    TcxGridBandedColumn *Column32;
    TcxGridBandedColumn *Column40;
    TcxGridBandedColumn *Column41;
    TcxGridBandedColumn *Column42;
    TcxGridBandedColumn *Column43;
    TcxGridBandedColumn *Column44;
    TcxGridBandedColumn *Column45;
    TcxGridBandedColumn *Column50;
    TcxGridBandedColumn *Column51;
    TcxGridBandedColumn *Column52;
    TcxGridBandedColumn *Column53;
    TcxGridBandedColumn *Column54;
    TcxGridBandedColumn *Column55;
    TcxGroupBox *cxGroupBox2;
    TPanel *PnlEdit;
    TPanel *Panel1;
    TImage *ImgDesc90;
    TLabel *Label7;
    TcxTextEdit *EdParamId;
    TcxTextEdit *EdParamName;
    TLabel *Label8;
    TImage *ImgDesc91;
    TPanel *Panel2;
    TPanel *Panel3;
    TcxGroupBox *cxGroupBoxFMT;
    TcxCheckBox *ChkFMT0;
    TcxCheckBox *ChkFMT1;
    TGroupBox *GrpFMT1;
    TImage *ImgDesc01;
    TLabel *Label5;
    TLabel *Label1;
    TImage *ImgDesc02;
    TLabel *Label2;
    TLabel *Label3;
    TcxSpinEdit *SeVolMin;
    TcxSpinEdit *SeVolMax;
    TcxSpinEdit *SeSpdMin;
    TcxSpinEdit *SeSpdMax;
    TcxButton *BtnFMTInitVal;
    TcxGroupBox *cxGroupBoxMCA;
    TcxCheckBox *ChkMCA0;
    TcxCheckBox *ChkMCA2;
    TGroupBox *GrpMCA1;
    TImage *ImgDesc07;
    TLabel *Label13;
    TLabel *Label18;
    TcxSpinEdit *SeMCAVal3;
    TcxSpinEdit *SeMCAVal2;
    TcxSpinEdit *SeMCAVal1;
    TcxCheckBox *Chk15MinPtrn;
    TcxSpinEdit *SeMissCycle;
    TcxCheckBox *ChkMCA1;
    TcxButton *BtnMCAInitVal;
    TcxGroupBox *cxGroupBoxFST;
    TcxCheckBox *ChkFST1;
    TcxCheckBox *ChkFST2;
    TGroupBox *GrpFST2;
    TImage *ImgDesc06;
    TLabel *Label9;
    TcxGrid *CxList3;
    TcxGridTableView *TvList3;
    TcxGridColumn *ColumnC01;
    TcxGridColumn *ColumnC03;
    TcxGridColumn *ColumnC02;
    TcxGridLevel *GlList3;
    TGroupBox *GrpFST1;
    TcxGrid *CxList0;
    TcxGridTableView *TvList0;
    TcxGridColumn *ColumnD01;
    TcxGridColumn *ColumnD03;
    TcxGridColumn *ColumnD02;
    TcxGridColumn *ColumnD04;
    TcxGridLevel *GlList0;
    TcxCheckBox *ChkFST3;
    TcxGroupBox *cxGroupBoxSMT;
    TcxCheckBox *ChkSMT0;
    TcxCheckBox *ChkSMT1;
    TcxCheckBox *ChkSMT2;
    TGroupBox *GrpSMT2;
    TImage *ImgDesc12;
    TLabel *Label11;
    TcxSpinEdit *SeSMTVal2;
    TcxSpinEdit *SeSMTVal1;
    TcxSpinEdit *SeSMTValC;
    TGroupBox *GrpSMT1;
    TImage *ImgDesc10;
    TLabel *Label15;
    TcxSpinEdit *SeSMTValMin;
    TcxSpinEdit *SeSMTValMax;
    TcxButton *BtnSMTIintVal;
    TcxLabel *lblNotUse;
    TcxLabel *lblText1;
    TcxLabel *lblText4;
    TcxLabel *lblText2;
    TcxLabel *lblText3;
    TcxLabel *lblText5;
    TcxLabel *lblText6;
    TcxLabel *lblText7;
    TcxLabel *lblText8;
    TcxLabel *lblText9;
    TcxGridBandedColumn *Column99;
    TLabel *Label4;
    TLabel *Label6;
    TcxLabel *lblSave;
    TcxLabel *lblEdit;
    TcxLabel *lblSelErr;
    TcxLabel *lblDelete;
    TcxLabel *lblDelCnfm;
    TcxLabel *lblNoDelete;
    TcxLabel *lblDeleteOk;
    TcxLabel *lblText10;
    void __fastcall FormShow(TObject *Sender);
    void __fastcall TmrShowTimer(TObject *Sender);
    void __fastcall BtnSearchClick(TObject *Sender);
    void __fastcall BtnCloseClick(TObject *Sender);
    void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall ChkFMT0Click(TObject *Sender);
    void __fastcall ChkFMT1Click(TObject *Sender);
    void __fastcall ChkFST1Click(TObject *Sender);
    void __fastcall ChkFST2Click(TObject *Sender);
    void __fastcall ChkMCA0Click(TObject *Sender);
    void __fastcall ChkMCA2Click(TObject *Sender);
    void __fastcall ChkMCA1Click(TObject *Sender);
    void __fastcall ChkSMT0Click(TObject *Sender);
    void __fastcall ChkSMT1Click(TObject *Sender);
    void __fastcall ChkSMT2Click(TObject *Sender);
    void __fastcall ChkFST3Click(TObject *Sender);
    void __fastcall BtnSMTIintValClick(TObject *Sender);
    void __fastcall BtnMCAInitValClick(TObject *Sender);
    void __fastcall BtnFMTInitValClick(TObject *Sender);
    void __fastcall BtnSaveClick(TObject *Sender);
    void __fastcall BtnCancelClick(TObject *Sender);
    void __fastcall BtnInsertClick(TObject *Sender);
    void __fastcall BtnEditClick(TObject *Sender);
    void __fastcall BtnDeleteClick(TObject *Sender);
    void __fastcall TvListFocusedRecordChanged(TcxCustomGridTableView *Sender, TcxCustomGridRecord *APrevFocusedRecord,
          TcxCustomGridRecord *AFocusedRecord, bool ANewItemRecordFocusingChanged);
    void __fastcall ChkAutoWidthPropertiesChange(TObject *Sender);
    void __fastcall BtnBestFitClick(TObject *Sender);

private:	// User declarations
    void __fastcall CommClose();
    String             FTitle;
    //TItsColSysManager *MyItsColSysManager;
    bool               FInit;
public:
    EN_JOB  JobType;

    String  FFMT;
    int     FFMTVolMin, FFMTVolMax, FFMTSpdMin, FFMTSpdMax;
    String  FFST;

    String  FMCA;
    float   FMCAVal3, FMCAVal2, FMCAVal1;
    int     FMissCycle;
    String  F15MinPtrn;

    String  FSMT;
    float   FSMTSpdMin, FSMTSpdMax;
    float   FSMTVal2, FSMTVal1, FSMTValC;

    int     FColSysCnt;

    TPrcsParamManager *MyParamManager;

public:		// User declarations
    __fastcall TIDB0051M(TComponent* Owner);

    void __fastcall FormInit();
    void __fastcall RefreshData();

    void __fastcall LoadLocalSkin();
    void __fastcall FormClear();
    void __fastcall ChangeButtonType(int nBtnType);
    void __fastcall DisplayListData();

    void __fastcall ChangeFMT(bool AUse);
    void __fastcall ChangeFST(bool AUse);
    void __fastcall ChangeMCA(int AType);
    void __fastcall ChangeSMT(int AType);

    void __fastcall InitCollectSysInfo();
    bool __fastcall CheckParameterValue();

    void __fastcall SelListData();
    bool __fastcall MergeData(String PARA_ID, String PARA_NM);
};
//---------------------------------------------------------------------------
extern PACKAGE TIDB0051M *IDB0051M;
//---------------------------------------------------------------------------

#endif

