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

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

#include "Environment.h"
#include <ExtCtrls.hpp>
#include "TntExtCtrls.hpp"
#include "TntStdCtrls.hpp"
#include "TntForms.hpp"
//---------------------------------------------------------------------------
typedef struct
{
	unsigned int MachineRev;
	unsigned char VIPMap[MAX_PORT_COUNT];
	unsigned char VOPMap[MAX_PORT_COUNT];
} TPortMapInfo;
//---------------------------------------------------------------------------
class TDataMatchingForm : public TTntForm
{
__published:	// IDE-managed Components
	TTntPanel *Panel1;
	TTntButton *CloseButton;
	TTntPanel *HCBDifferenceNotificationPanel;
	TTntGroupBox *GroupBox1;
	TTntLabel *Label1;
	TTntLabel *Label2;
	TTntLabel *Label7;
	TTntGroupBox *GroupBox2;
	TTntLabel *Label3;
	TTntLabel *Label16;
	TTntLabel *Label5;
	TTntGroupBox *GroupBox3;
	TTntLabel *Label8;
	TTntLabel *Label10;
	TTntLabel *Label12;
	TTntLabel *Label14;
	TTntLabel *TargetProjectNameLabel;
	TTntLabel *TargetMachineNameLabel;
	TTntLabel *TargetDataRevLabel;
	TTntLabel *Label19;
	TTntGroupBox *GroupBox4;
	TTntLabel *Label9;
	TTntLabel *Label11;
	TTntLabel *Label13;
	TTntLabel *Label15;
	TTntLabel *HCBProjectNameLabel;
	TTntLabel *HCBMachineNameLabel;
	TTntLabel *HCBDataRevLabel;
	TTntLabel *Label23;
	TTntGroupBox *GroupBox5;
	TTntLabel *Label20;
	TTntLabel *Label4;
	TTntLabel *Label6;
	TTntLabel *Label17;
	TTntPanel *SPBDifferenceNotificationPanel;
	TTntGroupBox *GroupBox6;
	TTntLabel *SPBDifferenceMessageLabel;
	TTntLabel *Label21;
	TTntLabel *Label22;
	TTntLabel *Label24;
	TTntGroupBox *GroupBox7;
	TTntLabel *Label25;
	TTntLabel *Label26;
	TTntLabel *Label27;
	TTntGroupBox *GroupBox8;
	TTntLabel *Label28;
	TTntLabel *Label30;
	TTntLabel *Label31;
	TTntLabel *SPBTargetProjectNameLabel;
	TTntLabel *SPBTargetDataRevLabel;
	TTntLabel *Label35;
	TTntGroupBox *GroupBox9;
	TTntLabel *Label36;
	TTntLabel *Label38;
	TTntLabel *Label39;
	TTntLabel *SPBProjectNameLabel;
	TTntLabel *SPBDataRevLabel;
	TTntLabel *Label43;
	TTntGroupBox *GroupBox10;
	TTntLabel *Label44;
	TTntLabel *Label45;
	TTntLabel *Label46;
//	void __fastcall WritePCToHCBButtonClick(TObject *Sender);
//	void __fastcall WriteHCBToPCButtonClick(TObject *Sender);
//	void __fastcall WritePCToSPBButtonClick(TObject *Sender);
//	void __fastcall WriteSPBToPCButtonClick(TObject *Sender);
private:	// User declarations
	int SetupSPBIndex;
  void __fastcall GetDefaultString();
public:		// User declarations
	__fastcall TDataMatchingForm(TComponent* Owner);
	void __fastcall SetHCBDifferences(THCBProgramHeader *hcbProgramHeader, THCBDBHeader *hcbDBHeader,
		THCBMachineSpecificHeader *hcbMachineSpecificHeader);
	void __fastcall SetSPBDifferences(TSPBProgramHeader *spbProgramHeader, TSPBDBHeader *spbDBHeader,
		int spbIndex);
};
//---------------------------------------------------------------------------
extern PACKAGE TDataMatchingForm *DataMatchingForm;
void __fastcall CheckHCBDataMatching(THCBProgramHeader *hcbProgramHeader, THCBDBHeader *hcbDBHeader);
bool __fastcall CheckBinaryEquality(void *lhs, void *rhs, int length);
bool __fastcall MakePortMapInfo(TPortMapInfo &PortMapInfo, unsigned int machineRev);
void __fastcall WritePortMapInfo(TPortMapInfo &portMapInfo);
void __fastcall CheckSPBDataMatching(TSPBProgramHeader *spbProgramHeader, TSPBDBHeader *spbDBHeader, int spbIndex);
//---------------------------------------------------------------------------
#endif
