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

#ifndef ComputerSystemSetting_FormH
#define ComputerSystemSetting_FormH
#include "TntButtons.hpp"
#include "TntComCtrls.hpp"
#include "TntExtCtrls.hpp"
#include "TntGrids.hpp"
#include "TntStdCtrls.hpp"
#include <Buttons.hpp>
#include <Classes.hpp>
#include <ComCtrls.hpp>
#include <Controls.hpp>
#include <ExtCtrls.hpp>
#include <Grids.hpp>
#include <StdCtrls.hpp>
//---------------------------------------------------------------------------
#include<iostream>
#include <string>
#include<map.h>
#include<vector>
using namespace std;

#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Buttons.hpp>
#include <ComCtrls.hpp>
#include "TntButtons.hpp"
#include "TntComCtrls.hpp"
#include "TntExtCtrls.hpp"
#include "TntStdCtrls.hpp"
#include "TntForms.hpp"
#include "TntGrids.hpp"
#include <Grids.hpp>

#include "Environment.h"

#define START_LOT_USER	0
#define LAST_LOT_USER	1
//---------------------------------------------------------------------------
class TComputerSystemSettingForm : public TTntForm
{
__published:	// IDE-managed Components
	TTntPanel *Panel1;
	TTntButton *OkButton;
	TTntButton *CancelButton;
	TTntPanel *SecuritySettingPanel;
	TTntPanel *Panel3;
	TTntSpeedButton *SecuritySettingSpeedButton;
	TTntGroupBox *GroupBox1;
	TTntCheckBox *InactivityLogoutCheckBox;
	TTntLabel *Label1;
	TTntEdit *InactivityTimeoutEdit;
	TTntLabel *Label2;
	TTntGroupBox *GroupBox2;
	TTntCheckBox *PasswordExpirationCheckBox;
	TTntLabel *Label3;
	TTntEdit *PasswordMinLengthEdit;
	TTntLabel *Label4;
	TTntLabel *Label5;
	TTntEdit *PasswordExpirationTimeEdit;
	TTntLabel *Label6;
	TTntSpeedButton *ProgramSettingSpeedButton;
	TTntSpeedButton *AuthoritySettingSpeedButton;
	TTntPanel *ProgramSettingPanel;
	TTntPageControl *ProgramOptionPageControl;
	TTntTabSheet *InspectionScreenTabSheet;
	TTntGroupBox *GroupBox3;
	TTntCheckBox *InspectionContinueOnRestartCheckBox;
	TTntTabSheet *TabSheet2;
	TTntGroupBox *GroupBox7;
	TTntCheckBox *QuickStartCheckBox;
	TTntTabSheet *TabSheet1;
	TTntGroupBox *GroupBox8;
	TTntRadioButton *PrintGradeOnlyRadioButton;
	TTntRadioButton *PrintGradeAndSizeRadioButton;
	TTntGroupBox *GroupBox10;
	TTntRadioButton *PrintThreeDHeightValueRadioButton;
	TTntRadioButton *PrintThreeDHeightGradeRadioButton;
	TTntTabSheet *TabSheet5;
	TTntGroupBox *GroupBox11;
	TTntLabel *Label13;
	TTntLabel *Label15;
	TTntLabel *Label16;
	TTntEdit *SDMinSpeedEdit;
	TTntEdit *SDMaxSpeedEdit;
	TTntLabel *Label17;
	TTntLabel *Label18;
	TTntLabel *Label19;
	TTntLabel *Label20;
	TTntLabel *Label21;
	TTntEdit *BFIDMinSpeedEdit;
	TTntEdit *BFIDMaxSpeedEdit;
	TTntLabel *Label22;
	TTntLabel *Label23;
	TTntLabel *Label24;
	TTntLabel *Label25;
	TTntLabel *Label26;
	TTntEdit *BFODMinSpeedEdit;
	TTntEdit *BFODMaxSpeedEdit;
	TTntLabel *Label27;
	TTntLabel *Label28;
  TTntGroupBox *TntGroupBox2;
  TTntCheckBox *FPGASecurityCheckbox;
  TTntPanel *TntPanel1;
  TTntGroupBox *APPGroupbox;
  TTntCheckBox *APPCheckBox;
    TTntGroupBox *HIGroupBox;
    TTntCheckBox *HICheckbox;
  TTntCheckBox *SensorOutputSettingCheckBox;
  TTntCheckBox *FirstLoginChangePWCheckBox;
  TTntGroupBox *TntGroupBox5;
  TTntCheckBox *SCADASystemSwitchCheckBox;
  TTntPanel *ButtonWrapPanel;
  TTntCheckBox *DHCheckBox2;
  TCheckBox *DetailReportCheckBox;
  TGroupBox *ReportOptionGroupBox;
  TTntGroupBox *SensorGroupBox;
  TCheckBox *IncludeUninsTabletCheckBox;
	TTntGroupBox *DistributorGroupBox;
	TTntRadioGroup *TntRadioGroup2;
	TTntCheckBox *TwoSplitterActivationCheckBox;
	TTntCheckBox *DHCheckbox;
  TTntLabel *TntLabel1;
  TTntEdit *TntEdit1;
  TTntLabel *TntLabel2;
  TTntGroupBox *TntGroupBox1;
  TTntCheckBox *UVLaserCheckBox;
  TTntComboBox *AjantaReportCompanyNameComboBox;
  TTntLabel *LocalNonationLabel;
  TTntGroupBox *SubSamplingModeGroupBox;
  TTntRadioButton *SubSamplingStandardRadioButton;
  TTntRadioButton *SubSamplingHDRadioButton;
  TTntCheckBox *ResolutionSettingFunctionEnableCheckBox;
  TTntEdit *NameofmachineEdit;
  TTntLabel *TntLabel3;
  TTntLabel *TntLabel4;
  TTntEdit *MachineIDEdit;
  TTntPanel *AuthoritySettingPanel;
  TGroupBox *GroupBox4;
  TStringGrid *AuthorityStringGrid;
  TButton *AddAuthorityBtn;
  TButton *AuthrorityReviseOrSaveBtn;
  TButton *DeleteAuthorityBtn;
  TButton *AuthorityRestoreBtn;
  TButton *AuthoritySettingCancelBtn;
  TButton *UserAuthoritySettingBtn;
  TTntCheckBox *UpstreamCheckbox;
  TTntCheckBox *DownstreamCheckbox;
  TTntCheckBox *ConveyorCheckBox;
  TTntCheckBox *CareUpperLowCaseCheckBox;
  TCheckBox *ResultGraphOptCheckBox;
  TTntGroupBox *TcpIpMonitorGroupBox;
  TTntCheckBox *TcpIpMonitorActiveCheckBox;
  TTntGroupBox *ReportOptionGroupBox2;
  TTntCheckBox *SPB_HCB_CntMatchingOptOffCheckBox;
  TTntGroupBox *CSV_ReportOptionGroupBox1;
  TTntCheckBox *CSV_PrintMaxPageCntComboBox;
  TTntEdit *CSV_PrintMaxPageCntEdit;
	TTntGroupBox *BackupOptionGroupBox;
	TTntGroupBox *BackupSpeedModeGroupBox;
	TTntRadioButton *BackupFastSpeedRadioButton;
	TTntRadioButton *BackupNormalSpeedRadioButton;
	TTntCheckBox *AllAuthorityNotActiveCheckBox;
	TTntRadioGroup *PrintInsResUserDisplayRadioGroupBox;
	TTntCheckBox *VibratorFeederSpeedControlOptCheckBox;
	TTntCheckBox *SendCompleteSigDistributorCheckBox;
	void __fastcall NumEditClick(TObject *Sender);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall OkButtonClick(TObject *Sender);
	void __fastcall SecuritySettingSpeedButtonClick(TObject *Sender);
	void __fastcall ProgramSettingSpeedButtonClick(TObject *Sender);
	void __fastcall AuthoritySettingSpeedButtonClick(TObject *Sender);
  void __fastcall TntPanel1DblClick(TObject *Sender);
  void __fastcall SDMinSpeedEditKeyPress(TObject *Sender, char &Key);

  void __fastcall TntFormShow(TObject *Sender);
	void __fastcall DHCheckboxClick(TObject *Sender);
	void __fastcall TwoSplitterActivationCheckBoxClick(TObject *Sender);
  void __fastcall ResolutionSettingFunctionEnableCheckBoxClick(
          TObject *Sender);
  void __fastcall NameofmachineEditClick(TObject *Sender);
  void __fastcall AuthrorityReviseOrSaveBtnClick(TObject *Sender);
  void __fastcall AuthoritySettingCancelBtnClick(TObject *Sender);
  void __fastcall UserAuthoritySettingBtnClick(TObject *Sender);
  void __fastcall AuthorityRestoreBtnClick(TObject *Sender);
  void __fastcall AddAuthorityBtnClick(TObject *Sender);
  void __fastcall DeleteAuthorityBtnClick(TObject *Sender);
  void __fastcall AuthorityStringGridMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
  void __fastcall AuthorityStringGridSelectCell(TObject *Sender, int ACol,
          int ARow, bool &CanSelect);
  void __fastcall TntFormClose(TObject *Sender, TCloseAction &Action);
  void __fastcall TntRadioGroup2Click(TObject *Sender);
  void __fastcall TcpIpMonitorActiveCheckBoxClick(TObject *Sender);
  void __fastcall CSV_PrintMaxPageCntComboBoxClick(TObject *Sender);
  void __fastcall CSV_PrintMaxPageCntEditClick(TObject *Sender);
private:	// User declarations
  void __fastcall GetDefaultString();
  void __fastcall SetAuthorityGridTable(TProgramAccessAuthorityData *programAccessAuthorityData);
  
  bool bRevAuthorityLevel; 
  bool bRevAuthorityMode;
  TProgramAccessAuthorityData tempProgramAccessAuthorityData;

  TStringList *userIDList;
  
public:		// User declarations
  __fastcall TComputerSystemSettingForm(TComponent* Owner);

  bool bNeedLogOut;
  int ActivePanelNum;
};
//---------------------------------------------------------------------------
extern PACKAGE TComputerSystemSettingForm *ComputerSystemSettingForm;
//extern TTntGroupBox *TntGroupBox2;
//---------------------------------------------------------------------------
#endif

