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

#ifndef MachineTest_FormH
#define MachineTest_FormH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <Buttons.hpp>
#include "TntExtCtrls.hpp"
#include "TntStdCtrls.hpp"
#include "TntForms.hpp"
//---------------------------------------------------------------------------
class TMachineTestForm : public TTntForm
{
__published:	// IDE-managed Components
	TTntPanel *Panel1;
	TTntPanel *TestClientPanel;
	TTntButton *SetTestModeButton;
    TTntButton *SetInterlockModeButton;
	TTntPanel *Panel2;
	TTntGroupBox *GroupBox4;
	TTntPanel *AirKnifeOnPanel;
	TTntPanel *AirKnifeOffPanel;
	TTntLabel *Label6;
	TTntPanel *SDBlower1OnPanel;
	TTntPanel *SDBlower1OffPanel;
	TTntLabel *Label10;
	TTntPanel *DefectEjectorOnPanel;
	TTntPanel *DefectEjectorOffPanel;
	TTntLabel *Label1;
	TTntPanel *UnInsEjectorOnPanel;
	TTntPanel *UnInsEjectorOffPanel;
	TTntLabel *Label2;
	TTntGroupBox *GroupBox5;
	TTntPanel *CylinderInPanel1;
	TTntPanel *CylinderOutPanel1;
	TTntPanel *CylinderInPanel2;
	TTntPanel *CylinderOutPanel2;
	TTntLabel *Label3;
	TTntLabel *Label4;
	TTntPanel *Panel4;
	TTntGroupBox *GroupBox1;
	TTntPanel *VFRunPanel;
	TTntPanel *VFStopPanel;
	TTntLabel *Label13;
	TTntEdit *VFSpeedEdit;
	TTntGroupBox *GroupBox6;
	TTntLabel *Label5;
	TTntLabel *Label7;
	TTntPanel *ServoMotorStartPanel3;
	TTntPanel *ServoMotorStopPanel3;
	TTntPanel *ServoMotorStartPanel4;
	TTntPanel *ServoMotorStopPanel4;
	TTntGroupBox *GroupBox7;
	TTntLabel *Label9;
	TTntLabel *Label11;
	TTntPanel *ServoMotorStartPanel1;
	TTntPanel *ServoMotorStopPanel1;
	TTntPanel *ServoMotorStartPanel2;
	TTntPanel *ServoMotorStopPanel2;
	TTntPanel *Panel6;
	TTntButton *CloseButton;
    TTntGroupBox *GroupBox2;
    TTntPanel *RedLightOnPanel;
    TTntPanel *RedLightOffPanel;
    TTntPanel *YellowLightOnPanel;
    TTntPanel *YellowLightOffPanel;
    TTntPanel *GreenLightOnPanel;
    TTntPanel *GreenLightOffPanel;
    TTntPanel *BuzzerOnPanel;
    TTntPanel *BuzzerOffPanel;
    TTntGroupBox *GroupBox3;
    TTntPanel *RBOnPanel1;
    TTntPanel *RBOffPanel1;
	TTntPanel *RBOnPanel3;
	TTntPanel *RBOffPanel3;
    TTntPanel *DustBlowerOnPanel1;
    TTntPanel *DustBlowerOffPanel1;
    TTntLabel *Label15;
    TTntPanel *DustBlowerOnPanel2;
    TTntPanel *DustBlowerOffPanel2;
    TTntLabel *Label17;
    TTntPanel *DustBlowerOnPanel3;
    TTntPanel *DustBlowerOffPanel3;
    TTntLabel *Label18;
    TTntPanel *DustBlowerOnPanel4;
    TTntPanel *DustBlowerOffPanel4;
    TTntLabel *Label20;
	TTntPanel *TestWarningPanel;
	TTntPanel *AirBrushOnPanel;
	TTntPanel *AirBrushOffPanel;
	TTntLabel *Label19;
	TTntEdit *Disk1SpeedEdit;
	TTntLabel *Label21;
	TTntLabel *Disk1SpeedRPMLabel;
	TTntEdit *Disk2SpeedEdit;
	TTntLabel *Label23;
	TTntLabel *Disk2SpeedRPMLabel;
	TTntEdit *FeederInnerDiskSpeedEdit;
	TTntLabel *Label22;
	TTntEdit *FeederOuterDiskSpeedEdit1;
	TTntLabel *Label24;
	TTimer *StatusTimer;
	TTntLabel *Label25;
	TTntLabel *Label26;
	TTntLabel *Label27;
	TTntLabel *Label28;
	TTntLabel *Motor1MidTermRPMLabel;
	TTntLabel *Motor2MidTermRPMLabel;
	TTntLabel *Label51;
	TTntLabel *Label52;
	TTntGroupBox *GroupBox8;
	TTntLabel *Label53;
	TTntPanel *LeftLight1OnPanel;
	TTntPanel *LeftLight1OffPanel;
	TTntLabel *Label54;
	TTntPanel *LeftLight2OnPanel;
	TTntPanel *LeftLight2OffPanel;
	TTntLabel *Label55;
	TTntPanel *RightLight1OnPanel;
	TTntPanel *RightLight1OffPanel;
	TTntLabel *Label56;
	TTntPanel *RightLight2OnPanel;
	TTntPanel *RightLight2OffPanel;
	TTntLabel *Label14;
	TTntPanel *SDBlower2OnPanel;
	TTntPanel *SDBlower2OffPanel;
	TTntLabel *Label8;
	TTntPanel *SensorBlowerOnPanel;
	TTntPanel *SensorBlowerOffPanel;
	TTntLabel *Label12;
	TTntPanel *CylinderOpenPanel3;
	TTntPanel *CylinderClosePanel3;
	TTntLabel *Label32;
	TTntPanel *RBOnPanel2;
	TTntPanel *RBOffPanel2;
  TTntGroupBox *GroupBox11;
  TTntLabel *Label29;
  TTntLabel *Label30;
  TTntLabel *Label34;
  TTntLabel *Label35;
  TTntLabel *Label36;
  TTntLabel *Label16;
  TTntLabel *TntLabel1;
  TTntPanel *BFSensor1OnPanel;
  TTntPanel *BFSensor1OffPanel;
  TTntPanel *BFSensor2OnPanel;
  TTntPanel *BFSensor2OffPanel;
  TTntPanel *VDSensor1OnPanel;
  TTntPanel *VDSensor1OffPanel;
  TTntPanel *VDSensor2OnPanel;
  TTntPanel *VDSensor2OffPanel;
  TTntPanel *FrontDoorSensorOnPanel;
  TTntPanel *FrontDoorSensorOffPanel;
  TTntPanel *CounterSensorOnPanel;
  TTntPanel *CounterSensorOffPanel;
  TTntPanel *EmissionSensorOnPanel;
  TTntPanel *EmissionSensorOffPanel;
  TTntGroupBox *GroupBox12;
  TTntLabel *Label43;
  TTntLabel *Label44;
  TTntLabel *Label42;
  TTntLabel *Label47;
  TTntLabel *Label50;
  TTntPanel *MainPowerOnPanel;
  TTntPanel *MainPowerOffPanel;
  TTntPanel *PCOnPanel;
  TTntPanel *PCOffPanel;
  TTntPanel *RB3OLOnPanel;
  TTntPanel *RB3OLOffPanel;
  TTntPanel *EmergencyOnPanel;
  TTntPanel *EmergencyOffPanel;
  TTntPanel *MonitorSWOnPanel;
  TTntPanel *MonitorSWOffPanel;
  TTntPanel *HopperOnpanel;
  TTntPanel *HopperOffpanel;
  TTntLabel *HopperLabel;
  TGroupBox *GroupBox9;
  TRadioButton *SensorARadioBtn;
  TRadioButton *SensorBRadioBtn;
  TTntLabel *TntLabel2;
  TTntPanel *TestOnPanel;
  TTntPanel *TestOffPanel;
	TTntPanel *Buzzer2OnPanel;
	TTntPanel *Buzzer2OffPanel;
	TTntPanel *Buzzer3OnPanel;
	TTntPanel *Buzzer3OffPanel;
  TTntLabel *TntLabel3;
  TTntPanel *LeftDoorSenserOnPanel;
  TTntPanel *LeftDoorSenserOffPanel;
  TTntLabel *TntLabel4;
  TTntPanel *InterLockOpenPanel;
  TTntPanel *InterLockClosePanel;
	TTntPanel *Tnt2DisPanel1;
	TTntPanel *Tnt2DisPanel2;
	TTntLabel *Tnt2DistibutorLabel;
  TTntLabel *TntLabel5;
  TTntPanel *MisejectSensorOpenPanel;
  TTntPanel *MisejectSensorClosePanel;
  TTntPanel *MisejectSensorJamPanel;
  TRadioButton *SensorCRadioBtn;
  TTntGroupBox *PowerMeterGroupBox;
  TPanel *TntPanel1;
  TLabel *Label31;
  TLabel *ModeLabel;
  TLabel *TntLabel7;
  TLabel *RangeLabel;
  TLabel *TntLabel9;
  TLabel *WaveLengthLabel;
  TLabel *TntLabel11;
  TLabel *AverageValueLabel;
  TLabel *TntLabel13;
  TLabel *TntLabel14;
  TPanel *TntPanel2;
  TGroupBox *GroupBox10;
  TLabel *Label33;
  TLabel *Label37;
  TLabel *BaudRateLabel;
  TLabel *Label38;
  TButton *Disconnectbtn;
  TButton *Connectionbtn;
  TButton *sLaseronBtn;
  TButton *PowerMeterOnbtn;
  TButton *PowerMeterOffbtn;
  TTntPanel *PowerMeterSensorOffPanel;
  TTntPanel *PowerMeterSensorOnPanel;
  TTntLabel *PowerMeterNameLabel;
  TTimer *PowerMeterTimer;
        TTntPanel *LaserShutterSensorOffPanel;
        TTntPanel *LaserShutterSensorOnPanel;
        TTntLabel *LaserShutterNameLabel;
  TTntLabel *RedLightOnLabel;
  TTntLabel *RedLightOffLabel;
  TTntLabel *GreenLightOnLabel;
  TTntLabel *GreenLightOffLabel;
  TTntLabel *Buzzer2OnLabel;
  TTntLabel *Buzzer2OffLabel;
  TTntLabel *YellowLightOnLabel;
  TTntLabel *YellowLightOffLabel;
  TTntLabel *BuzzerOnLabel;
  TTntLabel *BuzzerOffLabel;
  TTntLabel *Buzzer3OnLabel;
  TTntLabel *Buzzer3OffLabel;
	TTntLabel *TntLabel6;
	TTntLabel *TntLabel8;
	TTntEdit *FeederOuterDiskSpeedEdit2;
	TTntPanel *ServoMotorStartPanel5;
	TTntPanel *ServoMotorStopPanel5;
	void __fastcall NumberEditClick(TObject *Sender);
	void __fastcall VFRunPanelClick(TObject *Sender);
	void __fastcall VFStopPanelClick(TObject *Sender);
	void __fastcall RedLightOnPanelClick(TObject *Sender);
	void __fastcall RedLightOffPanelClick(TObject *Sender);
	void __fastcall YellowLightOnPanelClick(TObject *Sender);
	void __fastcall YellowLightOffPanelClick(TObject *Sender);
	void __fastcall GreenLightOnPanelClick(TObject *Sender);
	void __fastcall GreenLightOffPanelClick(TObject *Sender);
	void __fastcall BuzzerOnPanelClick(TObject *Sender);
	void __fastcall BuzzerOffPanelClick(TObject *Sender);
	void __fastcall RBOnPanelClick(TObject *Sender);
	void __fastcall RBOffPanelClick(TObject *Sender);
	void __fastcall AirKnifeOnPanelClick(TObject *Sender);
	void __fastcall AirKnifeOffPanelClick(TObject *Sender);
	void __fastcall SDBlower1OnPanelClick(TObject *Sender);
	void __fastcall SDBlower1OffPanelClick(TObject *Sender);
	void __fastcall DefectEjectorOnPanelClick(TObject *Sender);
	void __fastcall DefectEjectorOffPanelClick(TObject *Sender);
	void __fastcall UnInsEjectorOnPanelClick(TObject *Sender);
	void __fastcall UnInsEjectorOffPanelClick(TObject *Sender);
	void __fastcall CylinderInPanel1Click(TObject *Sender);
	void __fastcall CylinderOutPanel1Click(TObject *Sender);
	void __fastcall CylinderInPanel2Click(TObject *Sender);
	void __fastcall CylinderOutPanel2lick(TObject *Sender);
	void __fastcall ServoMotorStartPanelClick(TObject *Sender);
	void __fastcall ServoMotorStopPanelClick(TObject *Sender);
	void __fastcall SetTestModeButtonClick(TObject *Sender);
	void __fastcall SetInterlockModeButtonClick(TObject *Sender);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
    void __fastcall DustBlowerOnPanel1Click(TObject *Sender);
    void __fastcall DustBlowerOffPanel1Click(TObject *Sender);
    void __fastcall DustBlowerOnPanel2Click(TObject *Sender);
    void __fastcall DustBlowerOffPanel2Click(TObject *Sender);
    void __fastcall DustBlowerOnPanel3Click(TObject *Sender);
    void __fastcall DustBlowerOffPanel3Click(TObject *Sender);
    void __fastcall DustBlowerOnPanel4Click(TObject *Sender);
    void __fastcall DustBlowerOffPanel4Click(TObject *Sender);
	void __fastcall AirBrushOnPanelClick(TObject *Sender);
	void __fastcall AirBrushOffPanelClick(TObject *Sender);
	void __fastcall Disk1SpeedEditClick(TObject *Sender);
	void __fastcall Disk2SpeedEditClick(TObject *Sender);
	void __fastcall FeederInnerDiskSpeedEditClick(TObject *Sender);
	void __fastcall FeederOuterDiskSpeedEdit1Click(TObject *Sender);
	void __fastcall StatusTimerTimer(TObject *Sender);
	void __fastcall LeftLight1OnPanelClick(TObject *Sender);
	void __fastcall LeftLight1OffPanelClick(TObject *Sender);
	void __fastcall LeftLight2OnPanelClick(TObject *Sender);
	void __fastcall LeftLight2OffPanelClick(TObject *Sender);
	void __fastcall RightLight1OnPanelClick(TObject *Sender);
	void __fastcall RightLight1OffPanelClick(TObject *Sender);
	void __fastcall RightLight2OnPanelClick(TObject *Sender);
	void __fastcall RightLight2OffPanelClick(TObject *Sender);
	void __fastcall SDBlower2OnPanelClick(TObject *Sender);
	void __fastcall SDBlower2OffPanelClick(TObject *Sender);
	void __fastcall SensorBlowerOnPanelClick(TObject *Sender);
	void __fastcall SensorBlowerOffPanelClick(TObject *Sender);
	void __fastcall CylinderOpenPanel3Click(TObject *Sender);
	void __fastcall CylinderClosePanel3Click(TObject *Sender);
  //void __fastcall OPDistributorOnClick(TObject *Sender);
  //void __fastcall OPDistributorOffClick(TObject *Sender);
  void __fastcall TestOnPanelClick(TObject *Sender);
  void __fastcall TestOffPanelClick(TObject *Sender);
	void __fastcall Buzzer2OnPanelClick(TObject *Sender);
	void __fastcall Buzzer2OffPanelClick(TObject *Sender);
	void __fastcall Buzzer3OnPanelClick(TObject *Sender);
	void __fastcall Buzzer3OffPanelClick(TObject *Sender);
  void __fastcall InterLockOpenPanelClick(TObject *Sender);
  void __fastcall InterLockClosePanelClick(TObject *Sender);
	void __fastcall Tnt2DisPanel1Click(TObject *Sender);
	void __fastcall Tnt2DisPanel2Click(TObject *Sender);
  void __fastcall CloseButtonClick(TObject *Sender);
  void __fastcall ConnectionbtnClick(TObject *Sender);
  void __fastcall DisconnectbtnClick(TObject *Sender);
  void __fastcall PowerMeterTimerTimer(TObject *Sender);
  void __fastcall sLaseronBtnClick(TObject *Sender);
  void __fastcall PowerMeterOnbtnClick(TObject *Sender);
  void __fastcall PowerMeterOffbtnClick(TObject *Sender);
	void __fastcall FeederOuterDiskSpeedEdit2Click(TObject *Sender);
private:	// User declarations
	bool IsTestMode;
	int Disk1TargetSpeed, Disk2TargetSpeed, FeederInnerDiskTargetSpeed, FeederOuterDisk1TargetSpeed,FeederOuterDisk2TargetSpeed;
  void __fastcall GetDefaultString();
  void RefreshComNameList();
  bool  PowerMeterDisconnect();
  void SafeDeletePowerMeterResource();
  int FindPowerMeterPort();
public:		// User declarations
	__fastcall TMachineTestForm(TComponent* Owner);
	void __fastcall OnUserChange(void);
};
//---------------------------------------------------------------------------
extern PACKAGE TMachineTestForm *MachineTestForm;
//---------------------------------------------------------------------------
#endif
