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

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

#include "common.h"
#include "TntExtCtrls.hpp"
#include "TntStdCtrls.hpp"
#include "TntForms.hpp"

typedef enum {ECS_IDLE, ECS_RUNNING, ECS_CPB_LEAK} ECPBStatus;
//---------------------------------------------------------------------------
class TCPBStatusForm : public TTntForm
{
__published:	// IDE-managed Components
	TTntGroupBox *SPBGroupBox1;
	TTntGroupBox *SPBGroupBox2;
	TTntGroupBox *SPBGroupBox3;
	TTntGroupBox *SPBGroupBox4;
	TTntGroupBox *GroupBox5;
	TTntLabel *CPBStatusLabel;
	TTntButton *CloseButton;
	TTimer *CPBBootCheckTimer;
	TTntButton *CPBRebootButton;
  TTntGroupBox *SPB07GroupBox1;
  TGroupBox *CPB05GroupBox2;
  TGroupBox *CPB05GroupBox3;
  TGroupBox *CPB05GroupBox1;
  TTntGroupBox *SPB07GroupBox2;
  TTntGroupBox *SPB07GroupBox3;
  TTntShape *Shape21;
  TTntShape *TntShape1;
  TTntShape *TntShape2;
  TTntShape *TntShape3;
  TTntShape *TntShape4;
  TTntShape *TntShape5;
  TTntShape *TntShape6;
  TTntShape *TntShape7;
  TTntShape *TntShape8;
  TTntShape *TntShape9;
  TTntShape *TntShape10;
  TTntShape *TntShape11;
  TTntShape *TntShape12;
  TTntShape *TntShape13;
  TTntShape *TntShape14;
  TTntShape *TntShape15;
  TTntShape *TntShape16;
  TTntShape *TntShape17;
  TTntShape *TntShape18;
  TTntShape *TntShape19;
  TTntShape *TntShape20;
  TTntShape *TntShape21;
  TTntShape *TntShape22;
  TTntShape *TntShape23;
  TTntShape *TntShape24;
  TTntShape *TntShape25;
  TTntShape *TntShape26;
  TTntShape *TntShape27;
  TTntShape *TntShape28;
  TTntShape *TntShape29;
  TTntShape *TntShape30;
  TTntShape *TntShape31;
  TGroupBox *CPB05GroupBox4;
  TTntShape *TntShape32;
  TTntShape *TntShape33;
  TTntShape *TntShape34;
  TTntShape *TntShape35;
  TTntShape *TntShape36;
  TTntShape *TntShape37;
  TTntShape *TntShape38;
  TTntShape *TntShape39;
  TTntShape *TntShape40;
  TTntShape *TntShape41;
  TTntShape *TntShape42;
  TTntShape *TntShape43;
  TTntShape *TntShape44;
  TTntShape *TntShape45;
  TTntShape *TntShape46;
  TTntShape *TntShape47;
  TTntShape *TntShape48;
  TTntShape *TntShape49;
  TTntShape *TntShape50;
  TTntShape *TntShape51;
  TTntShape *TntShape52;
  TTntShape *TntShape53;
  TTntShape *TntShape54;
  TTntShape *TntShape55;
  TTntShape *TntShape56;
  TTntShape *TntShape57;
  TTntShape *TntShape58;
  TTntShape *TntShape59;
  TTntShape *TntShape60;
  TTntShape *TntShape61;
  TTntShape *TntShape62;
  TTntShape *TntShape63;
  TGroupBox *CPB05GroupBox5;
  TGroupBox *CPB05GroupBox6;
  TGroupBox *CPB05GroupBox7;
  TTntShape *TntShape64;
  TTntShape *TntShape65;
  TTntShape *TntShape66;
  TTntShape *TntShape67;
  TTntShape *TntShape68;
  TTntShape *TntShape69;
  TTntShape *TntShape70;
  TTntShape *TntShape71;
  TTntShape *TntShape72;
  TTntShape *TntShape73;
  TTntShape *TntShape74;
  TTntShape *TntShape75;
  TTntShape *TntShape76;
  TTntShape *TntShape77;
  TTntShape *TntShape78;
  TTntShape *TntShape79;
  TTntShape *TntShape80;
  TTntShape *TntShape81;
  TTntShape *TntShape82;
  TTntShape *TntShape83;
  TTntShape *TntShape84;
  TTntShape *TntShape85;
  TTntShape *TntShape86;
  TTntShape *TntShape87;
  TTntShape *TntShape88;
  TTntShape *TntShape89;
  TTntShape *TntShape90;
  TTntShape *TntShape91;
  TTntShape *TntShape92;
  TTntShape *TntShape93;
  TTntShape *TntShape94;
  TTntShape *TntShape95;
  TGroupBox *CPB05GroupBox8;
  TGroupBox *CPB05GroupBox9;
  TTntGroupBox *SPBGroupBox5;
  TTntGroupBox *SPBGroupBox6;
	void __fastcall CloseButtonClick(TObject *Sender);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall CPBBootCheckTimerTimer(TObject *Sender);
	void __fastcall FormHide(TObject *Sender);
	void __fastcall CPBRebootButtonClick(TObject *Sender);
private:	// User declarations
	ECPBStatus FCPBStatus;
	bool FCanReboot;
  int ApplyCPBVersion;

	TTntLabel *CPBNumberLabelList[SYSTEM_SPB_MAX_COUNT][SYSTEM_CPB_COUNT];
	TTntShape *CPBStatusShapeList[SYSTEM_SPB_MAX_COUNT][SYSTEM_CPB_COUNT];

	TCPBStatus CPBStatus[SYSTEM_CPB_COUNT];
	bool SPBBootSuccess[SYSTEM_SPB_MAX_COUNT];

	void __fastcall InitDisplay(void);
	void __fastcall SetCanReboot(bool bCanReboot);
  void __fastcall GetDefaultString();

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

	void SetCPBStatus(ECPBStatus status);
	void CheckCPBBooting(void);
  void SetCPBStatusComponent();

  bool KeepShowing;

	__property bool CanReboot = {read = FCanReboot, write = SetCanReboot};
};
//---------------------------------------------------------------------------
extern PACKAGE TCPBStatusForm *CPBStatusForm;

bool __fastcall CheckCPBBootStatus(bool bCanReboot,bool ReadOnly = true,bool ApplyHide = false );
//---------------------------------------------------------------------------
#endif
