亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? alarm.c

?? 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
 ***********************************************************************
 *  Program     : ALARM.C                                              *
 *  Description : Demo program for Win 16 with Alarm functions         *
 *  Revision    : 1.00                                                 *
 *  Date        : 9/5/1996                     Advantech Co., Ltd.     *
 ***********************************************************************
 *
 * FUNCTIONS:
 *
 *   InitApplication() - Initializes window data and registers window class
 *
 *   InitInstance() - Saves instance handle and creates main window
 *
 *   MainWndProc() - Process main window messages
 *
 *   ConfigDlgProc() - Process the dialog box messages for configuration
 */


#include <windows.h>
#include <stdlib.h>
#include <dos.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "..\..\include\driver.h"
#include "..\..\include\os.h"
#include "resource.h"

// ------------------------------------------------------------------------
// CONSTANT DEFINITION
// ------------------------------------------------------------------------
#define     MAX_DEVICES     100


// ------------------------------------------------------------------------
// GLOBAL VARIABLES
// ------------------------------------------------------------------------
HANDLE      hInst;                      // current instance
HWND        hMainWnd;                   // main window handle


static      DEVFEATURES     DevFeatures;    // structure for device features
static      PT_AlarmConfig  ptAlarmConfig;  // structure for AlarmConfig table
static      PT_AlarmEnable  ptAlarmEnable;  // structure for AlarmEnable table
static      PT_AlarmCheck   ptAlarmCheck;   // structure for AlarmCheck table
static      PT_DeviceGetFeatures  ptDevFeatures;

char        szErrMsg[80];               // Use for MESSAGEBOX function
LRESULT     ErrCde;                     // Return error code

//
// used for dynamic allocation memory for the installed devices
//
// static  HGLOBAL     hDeviceList,hSubDeviceList;
// static  LPDEVLIST   DeviceList,SubDeviceList;
//

//
// used for fixed memory for the installed devices
//
DEVLIST     DeviceList[MAX_DEVICES];
DEVLIST     SubDeviceList[MAX_DEVICES];

LONG        DriverHandle = (LONG)NULL;          // driver handle
BOOL        bRun = FALSE;                       // flag for running
USHORT      gwDevice = 0, gwSubDevice = 0;      // device index
USHORT      gwChannel = 0;                      // input channel
FLOAT       gfLoLimit = 0.0f, gfHiLimit = 0.0f; // High and low limits
USHORT      gwLatchMode = 1;                    // momentary mode
USHORT      gwLoState = 0, gwHiState = 0;       // alarm status
SHORT       gnNumOfDevices, gnNumOfSubdevices;  // number of installed devices
USHORT      gwScanTime = 1000;                  // scan time
DWORD       gdwStartTime;                       // start time
DWORD       gdwElapseTime = 0;                  // elapse time
USHORT      gwOverrunCount = 0;                 // overrun count
FARPROC     lpfnConfigDlgProc;                  // config. dialog procedure
FARPROC     lpfnScanDlgProc;                    // scan dialog procedure


// ------------------------------------------------------------------------
// FUNCTION DECLARATION
// ------------------------------------------------------------------------
BOOL InitApplication(HANDLE);
BOOL InitInstance(HANDLE, int);
long FTYPE MainWndProc(HWND, UINT, WPARAM, LPARAM);
int  FTYPE WinMain(HANDLE, HANDLE, LPSTR, int);


/***************************************************************************
    FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)

    PURPOSE: calls initialization function, processes message loop
****************************************************************************/

int FTYPE WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
HANDLE hInstance;                          /* current instance             */
HANDLE hPrevInstance;                      /* previous instance            */
LPSTR lpCmdLine;                           /* command line                 */
int nCmdShow;                              /* show-window type (open/icon) */
{
    MSG msg;                               /* message                      */

    if (!hPrevInstance)                /* Other instances of app running?  */
      if (!InitApplication(hInstance)) /* Initialize shared things         */
          return (FALSE);              /* Exits if unable to initialize    */

    // Perform initializations that apply to a specific instance
    if (!InitInstance(hInstance, nCmdShow))
        return (FALSE);

    // Acquire and dispatch messages until a WM_QUIT message is received.
    while (GetMessage(&msg,      /* message structure                      */
        (HWND)NULL,              /* handle of window receiving the message */
        (UINT)NULL,              /* lowest message to examine              */
        (UINT)NULL))             /* highest message to examine             */
    {
        TranslateMessage(&msg);  /* Translates virtual key codes           */
        DispatchMessage(&msg);   /* Dispatches message to window           */
    }
    return (msg.wParam);         /* Returns the value from PostQuitMessage */
}

/****************************************************************************
    FUNCTION: InitApplication(HANDLE)

    PURPOSE: Initializes window data and registers window class
****************************************************************************/

BOOL InitApplication(hInstance)
HANDLE hInstance;                            /* current instance           */
{
    WNDCLASS  wc;

    // Fill in window class structure with parameters that describe the
    // main window.
    wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s).                 */
    wc.lpfnWndProc = (WNDPROC)MainWndProc;  /* window process procedure    */
    wc.cbClsExtra = 0;                  /* No per-class extra data.        */
    wc.cbWndExtra = 0;                  /* No per-window extra data.       */
    wc.hInstance = hInstance;           /* Application that owns the class.*/
    wc.hIcon = LoadIcon(hInstance, "IDI_ICON1");
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName =  "MyMenu";   /* Name of menu resource in .RC file.  */
    wc.lpszClassName = "MyClass";  /* Name used in call to CreateWindow. */

    // Register the window class and return success/failure code.
    return (RegisterClass(&wc));

}

/***************************************************************************
    FUNCTION:  InitInstance(HANDLE, int)

    PURPOSE:  Saves instance handle and creates main window
****************************************************************************/

BOOL InitInstance
(
    HANDLE          hInstance,          // Current instance identifier.
    int             nCmdShow            // Param for first ShowWindow() call.
)
{
    // Save the instance handle in static variable, which will be used in
    // many subsequence calls from this application to Windows.
    hInst = hInstance;

    // Create a main window for this application instance.
    hMainWnd = CreateWindow(
        "MyClass",                 /* See RegisterClass() call.           */
        "Advantech Driver Demo : Alarm" , /* Window title bar  */
        WS_OVERLAPPEDWINDOW,        /* Window style.                       */
        CW_USEDEFAULT,              /* Default horizontal position.        */
        CW_USEDEFAULT,              /* Default vertical position.          */
        CW_USEDEFAULT,              /* Default width.                      */
        CW_USEDEFAULT,              /* Default height.                     */
        NULL,                       /* Overlapped windows have no parent.  */
        NULL,                       /* Use the window class menu.          */
        hInstance,                  /* This instance owns this window.     */
        NULL                        /* Pointer not needed.                 */
        );

    // If window could not be created, return "failure"
    if (!hMainWnd)
        return (FALSE);

    // Make the window visible; update its client area; and return "success"

    ShowWindow(hMainWnd, nCmdShow);   // Show the window
    UpdateWindow(hMainWnd);           // Sends WM_PAINT message
    return (TRUE);                // Returns the value from PostQuitMessage
}

/***************************************************************************
    FUNCTION: ConfigDlgProc(HWND, unsigned, WPARAM, LPARAM)

    PURPOSE:  Processes dialog box messages for configuration
****************************************************************************/

BOOL FTYPE ConfigDlgProc
(
    HWND        hDlg,                          // window handle
    unsigned    message,                       // type of message
    WPARAM      wParam,                        // additional information
    LPARAM      lParam                         // additional information
)
{
    int         i;
    DWORD       dwIndex;
    char        szBuffer[40];
    int         nOutEntries;

    switch (message)
    {
    case WM_INITDIALOG :

        // --------------------------------
        // Initialize Device List Combobox
        // --------------------------------

        // get number of the installed devices

        if ((ErrCde = DRV_DeviceGetNumOfList((SHORT far *)&gnNumOfDevices)) !=
            SUCCESS)
        {
             DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
             MessageBox(hMainWnd,(LPCSTR)szErrMsg, "Driver Message", MB_OK);
             return TRUE;
        }


        // ----------------------------------------------------------------
        // used for dynamic allocation memory for these installed devices
        //
        // if ((hDeviceList = GlobalAlloc(GHND, gnNumOfDevices *
        //      sizeof(DEVLIST))) == NULL)
        // {
        //    MessageBox(hMainWnd, (LPCSTR)"Not Enough Memory",
        //        "Memory Allocation", MB_OK);
        //    return TRUE;
        // }
        // DeviceList = (LPDEVLIST)GlobalLock(hDeviceList);
        // ----------------------------------------------------------------


        if (gnNumOfDevices > MAX_DEVICES)
            gnNumOfDevices = MAX_DEVICES;

        // retrieve the information of all installed devices

        if ((ErrCde = DRV_DeviceGetList((DEVLIST far *)&DeviceList[0],
            (SHORT)gnNumOfDevices, (SHORT far *)&nOutEntries)) != (LONG)SUCCESS)
        {
            DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
            MessageBox(hMainWnd,(LPCSTR)szErrMsg,"Driver Message",MB_OK);
            return TRUE;
        }

        // initialize the Device List Combobox with the retrieved information

        for (i = 0; i < gnNumOfDevices; i ++)
            SendDlgItemMessage(hDlg, IDC_DEVICE, CB_ADDSTRING, 0,
                        (LPARAM)((LPSTR)DeviceList[i].szDeviceName));

        SendDlgItemMessage(hDlg, IDC_DEVICE, CB_SETCURSEL,(WPARAM)gwDevice,
                        (LPARAM)0);


        // -----------------------------------------------------------
        // Initialize Module List Combobox for COM port or CAN devices
        // -----------------------------------------------------------

        // check if there is any device attached on this COM port or CAN

        gnNumOfSubdevices = DeviceList[gwDevice].nNumOfSubdevices;
        if (gnNumOfSubdevices > MAX_DEVICES)
            gnNumOfSubdevices = MAX_DEVICES;


        // --------------------------------------------------------------
        // used for dynamic allocation memory for these installed devices
        //
        // if ((hSubDeviceList = GlobalAlloc(GHND, gnNumOfSubdevices *
        //    sizeof(DEVLIST))) == NULL)
        // {
        //    MessageBox(hMainWnd, (LPCSTR)"Not Enough Memory",
        //        "Memory Allocation", MB_OK);
        //    return TRUE;
        // }
        //
        // SubDeviceList = (LPDEVLIST)GlobalLock(hSubDeviceList);
        // --------------------------------------------------------------


        // retrieve the information of all installed devices
        if (gnNumOfSubdevices != 0)
        {
            if ((ErrCde = DRV_DeviceGetSubList(
                (DWORD)DeviceList[gwDevice].dwDeviceNum,
                (DEVLIST far *)&SubDeviceList[0],
                (SHORT)gnNumOfSubdevices,
                (SHORT far *)&nOutEntries)) != (LONG)SUCCESS)
            {
                DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
                MessageBox(hMainWnd,(LPCSTR)szErrMsg,"Driver Message",MB_OK);
                return TRUE;
            }


            // initialize the Module List Combobox with the retrieved
            // information

            EnableWindow(GetDlgItem(hDlg, IDC_MODULE), TRUE);
            SendDlgItemMessage(hDlg, IDC_MODULE, CB_RESETCONTENT, 0,
                    (LPARAM)((LPSTR)0));

            for (i = 0; i < gnNumOfSubdevices; i++)
                SendDlgItemMessage(hDlg, IDC_MODULE, CB_ADDSTRING, 0,
                        (LPARAM)((LPSTR)SubDeviceList[i].szDeviceName));

            SendDlgItemMessage(hDlg, IDC_MODULE, CB_SETCURSEL,
					(WPARAM)gwSubDevice, (LPARAM)0);
        }
        else
        {
            EnableWindow(GetDlgItem(hDlg, IDC_MODULE), FALSE);
            SendDlgItemMessage(hDlg, IDC_MODULE, CB_RESETCONTENT, 0,
                    (LPARAM)((LPSTR)0));
        }


        // ------------------------------------------------------------
        // Initialize Channel Edit, it needs to get device
        // features for alarm channels
        // ------------------------------------------------------------

        // first : Open Device

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国精品国产| 亚洲一级不卡视频| 亚洲国产毛片aaaaa无费看| 狠狠色丁香久久婷婷综合丁香| 成人aaaa免费全部观看| 欧美一级淫片007| 一个色妞综合视频在线观看| 国产精品一区在线观看乱码 | 国产精品资源在线观看| 欧美日韩一区二区三区不卡| 中文字幕一区二区三区色视频| 国内成+人亚洲+欧美+综合在线| 91福利国产成人精品照片| 国产精品婷婷午夜在线观看| 九九在线精品视频| 欧美精品v国产精品v日韩精品 | 99久久精品国产一区| 欧美不卡视频一区| 另类综合日韩欧美亚洲| 欧美视频一二三区| 亚洲一区二区三区在线播放 | 国产成人精品免费看| 日韩欧美中文字幕制服| 日韩高清国产一区在线| 欧美精品久久一区| 日韩成人一级大片| 91精品国产麻豆国产自产在线| 亚洲国产美女搞黄色| 欧美视频你懂的| 亚洲h在线观看| 5月丁香婷婷综合| 人人狠狠综合久久亚洲| 欧美精品在欧美一区二区少妇| 午夜精品视频一区| 欧美一区二区三区不卡| 日韩有码一区二区三区| 欧美精品一级二级三级| 麻豆精品久久精品色综合| 日韩三级视频在线看| 久久99久久99小草精品免视看| 日韩视频在线永久播放| 狠狠色狠狠色综合| 欧美经典一区二区三区| 99re8在线精品视频免费播放| 亚洲美女区一区| 欧美日韩aaaaa| 精品午夜久久福利影院| 欧美国产激情一区二区三区蜜月| 99国产精品国产精品久久| 亚洲综合精品久久| 欧美一级专区免费大片| 国产精品资源在线| 亚洲精品视频一区| 日韩一区二区电影网| 国产精品一线二线三线| 亚洲精品国产无套在线观| 欧美日韩第一区日日骚| 国产一区二区三区免费观看| 亚洲天堂福利av| 日韩一区二区三区三四区视频在线观看 | 色综合久久精品| 午夜不卡在线视频| 久久久99精品免费观看| 欧美综合色免费| 国产在线一区二区| 一区二区在线电影| 久久这里只精品最新地址| 色综合天天综合网国产成人综合天| 日韩精品免费视频人成| 国产精品传媒入口麻豆| 3751色影院一区二区三区| www.亚洲人| 精品一区二区三区视频在线观看| 亚洲欧洲日韩在线| 欧美电影免费提供在线观看| 91在线视频播放| 国产在线一区二区综合免费视频| 亚洲综合999| 国产精品久久久久久久久久久免费看 | 成人午夜在线免费| 日本三级韩国三级欧美三级| 成人免费视频在线观看| 久久无码av三级| 欧美日本在线播放| 成人免费毛片a| 狠狠网亚洲精品| 午夜精品一区在线观看| 亚洲色图制服丝袜| 欧美激情综合网| 欧美精品一区二区三区高清aⅴ| 欧美日韩免费观看一区二区三区 | 在线播放中文字幕一区| 99久久精品国产导航| 激情久久久久久久久久久久久久久久| 亚洲欧美日韩在线不卡| 国产精品日产欧美久久久久| 精品播放一区二区| 69久久夜色精品国产69蝌蚪网| 色呦呦国产精品| 99麻豆久久久国产精品免费 | 亚洲欧洲一区二区三区| 久久久国产一区二区三区四区小说| 欧美日韩色综合| 欧美午夜精品久久久| 色久综合一二码| 色综合久久久久综合体桃花网| 成人激情视频网站| 成人美女视频在线观看| 国产高清精品网站| 国产精品中文字幕日韩精品| 国产老肥熟一区二区三区| 美女视频一区二区三区| 毛片一区二区三区| 九九视频精品免费| 激情六月婷婷综合| 国产伦精品一区二区三区免费迷 | 午夜精品久久久久久久久久久| 亚洲精品免费一二三区| 亚洲免费看黄网站| 亚洲一区在线电影| 亚洲v精品v日韩v欧美v专区| 日韩二区三区在线观看| 麻豆精品在线观看| 国产精品一区二区黑丝| 成人av影院在线| 欧美亚洲一区二区在线| 欧美电影在线免费观看| 日韩欧美国产一区二区在线播放| 欧美一区二区在线免费播放| 精品三级在线看| 中文字幕乱码一区二区免费| 亚洲欧美日韩中文播放| 亚洲123区在线观看| 久久99最新地址| av影院午夜一区| 欧美日韩夫妻久久| 久久久久国产免费免费 | 久久久精品免费免费| 中文字幕免费不卡| 亚洲一区在线观看视频| 极品尤物av久久免费看| 国产xxx精品视频大全| 在线一区二区三区四区五区| 日韩三级视频在线观看| 日韩美女视频19| 日韩成人dvd| 99精品久久免费看蜜臀剧情介绍| 欧美色倩网站大全免费| 久久亚区不卡日本| 一区二区三区在线看| 黄色资源网久久资源365| 色综合一个色综合亚洲| 26uuu国产日韩综合| 一区二区三区在线视频播放| 激情综合五月婷婷| 色婷婷精品大在线视频| 日韩女优av电影| 成人欧美一区二区三区1314| 爽好多水快深点欧美视频| 国产999精品久久久久久绿帽| 欧美色中文字幕| 中文字幕一区av| 九九九久久久精品| 欧美三片在线视频观看| 国产精品欧美极品| 国内精品写真在线观看| 欧美裸体一区二区三区| 成人欧美一区二区三区1314| 国产美女久久久久| 69久久夜色精品国产69蝌蚪网 | 欧美国产日产图区| 久色婷婷小香蕉久久| 欧美日韩综合一区| 中文字幕在线观看一区| 东方欧美亚洲色图在线| 精品国产免费人成在线观看| 天堂久久一区二区三区| 91免费在线播放| 国产农村妇女精品| 激情文学综合网| 欧美一级黄色片| 日韩成人伦理电影在线观看| 在线观看91视频| 一卡二卡三卡日韩欧美| 99久久久免费精品国产一区二区 | 日本系列欧美系列| 欧美在线视频你懂得| 亚洲男女一区二区三区| 成人免费的视频| 国产欧美视频一区二区三区| 久久99热这里只有精品| 日韩一级大片在线观看| av电影在线观看一区| 中文在线资源观看网站视频免费不卡| 裸体一区二区三区| 欧美精品一区二区三区四区 | 色又黄又爽网站www久久| 亚洲青青青在线视频| 色婷婷综合在线| 高清成人免费视频|