unit1.h

来自「16 relay output channels and 16 isolated」· C头文件 代码 · 共 81 行

H
81
字号
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "..\..\..\..\..\Include\Driver.h"
#include "..\..\..\..\..\Include\paras.h"
#include "..\..\..\..\..\Include\event.h"

#define  TIMER_BASE_50KHZ 50000.0L
#define  TIMER_BASE_5KHZ  5000.0L
#define  TIMER_BASE_500HZ 500.0L
#define  TIMER_BASE_50HZ  50.0L
#define  TIMER_BASE_5HZ   5.0L

//---------------------------------------------------------------------------
class EventThread : public TThread
{
private:
protected:
        void __fastcall Execute();
public:
        __fastcall EventThread(bool CreateSuspended);
};
//---------------------------------------------------------------------------
class TForm2 : public TForm
{
__published:	// IDE-managed Components
        TGroupBox *GroupBox1;
        TEdit *editDevName;
        TButton *btnSelDev;
        TGroupBox *GroupBox2;
        TButton *btnSetTimer;
        TLabel *Label1;
        TEdit *editTimerInt;
        TEdit *editRealTimer;
        TLabel *labUnit;
        TGroupBox *GroupBox4;
        TLabel *Label3;
        TEdit *editEventCount;
        TButton *btnEnable;
        TButton *btnDisable;
        TLabel *Label4;
        TButton *btnClose;
        TRadioButton *radUs;
        TRadioButton *radMs;
        TRadioButton *radS;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
        void __fastcall btnSelDevClick(TObject *Sender);
        void __fastcall btnSetTimerClick(TObject *Sender);
        void __fastcall radUsClick(TObject *Sender);
        void __fastcall radMsClick(TObject *Sender);
        void __fastcall radSClick(TObject *Sender);
        void __fastcall btnEnableClick(TObject *Sender);
        void __fastcall btnDisableClick(TObject *Sender);
        void __fastcall btnCloseClick(TObject *Sender);
private:	// User declarations
        LRESULT m_ErrCde;
        LONG    m_DriverHandle;
        ULONG   m_ulDevNum;
        char    m_szErrMsg[80];
        BOOL    m_bContinue;
        USHORT  m_Unit;
        void*   m_pThreadHandle;
        EventThread *pEventThread;

public:		// User declarations
        __fastcall TForm2(TComponent* Owner);
        void CheckEvent();    // Event checking
        void KillThread();    // Kill the thread
};
//---------------------------------------------------------------------------
extern PACKAGE TForm2 *Form2;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?