⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uddumpsc.c

📁 工业组态软件modbus驱动源代码, 包括帮助文件.共享.
💻 C
字号:
/* $Header: "%n Ver=%v  %f  LastEdit=%w  Locker=%l" */
/* "UDDUMPSC.C Ver=1  5-Nov-97,14:00:00  LastEdit=JIMV  Locker=***_NOBODY_***" */
/***********************************************************************\
*                                                                       *
*       Copyright Wonderware Software Development Corp. 1992-1997       *
*                                                                       *
*               ThisFileName="L:\ww\dde_serv\src\udsample\uddumpsc.c"   *
*               LastEditDate="1997 Nov 05  14:00:00"                    *
*                                                                       *
\***********************************************************************/


#define LINT_ARGS
#include <windows.h>
#include <stdio.h>
#include <string.h>

#include "ntconv.h"
#include "hmemcpy.h"
#include "chainmgr.h"
#include "udprot.h"
#include "uddefs.h"
#include "udgetstr.h"
#include "debug.h"

/***********************************************************************/
/** display dump information on indicated device context,
    using data from indicated message structure.
    returns pointer to next message if successful */

LPUDMSG
WINAPI
XUdprotDumpMessage( HDC hDC, LPUDMSG lpMsg )
{
    SIZE  ext;
    extern int  yDebug;

    /* check message pointer */
    if( lpMsg == (LPUDMSG)NULL ) {
        /* do nothing, just return */
        return (LPUDMSG)NULL;
    }

    /* display message pointer, type of message, etc. */
    sprintf(dbgBuf,
        "%Fs %5u-%5u %Fs",
        lpMsg->mmRead ? (LPSTR)"READ " : (LPSTR)"WRITE",
        lpMsg->mmStartAddr, lpMsg->mmEndAddr,
        lpMsg->mmDue? (LPSTR)"DUE" : (LPSTR)"" );
    if( GetTextExtentPoint( hDC, dbgBuf, strlen(dbgBuf), &ext )) {
        TextOut( hDC, 5, yDebug, dbgBuf, strlen(dbgBuf) );
        yDebug += (int) ext.cy;
        yDebug += 2;
    }

    /* get and return pointer to next message, if any */
    return ((LPUDMSG) lpMsg->mmChainLink.next_item.ptr);
} /* XUdprotDumpMessage */

/***********************************************************************/
/** display dump information on indicated device context,
    using data from indicated station structure.
    returns pointer to next station if successful */

LPSTAT
WINAPI
XUdprotDumpTopic( HDC hDC, LPSTAT lpTopic )
{
    LPUDMSG lpMsg;
    CHAINSCANNER message_scanner;

    /* check station pointer */
    if( lpTopic == (LPSTAT)NULL ) {
        /* do nothing, just return */
        return (LPSTAT)NULL;
    }

    /* display information on all read messages on this station */
    lpMsg = (LPUDMSG) FindFirstItem (&lpTopic->statReadMsgList, SCAN_FROM_HEAD,
                                     NULL, NULL, &message_scanner);
    while( lpMsg != (LPUDMSG)NULL) {
        XUdprotDumpMessage( hDC, lpMsg );
        lpMsg = (LPUDMSG) FindNextItem (&message_scanner);
    }

    /* display information on all write messages on this station */
    lpMsg = (LPUDMSG) FindFirstItem (&lpTopic->statWriteMsgList, SCAN_FROM_HEAD,
                                     NULL, NULL, &message_scanner);
    while( lpMsg != (LPUDMSG)NULL ) {
        XUdprotDumpMessage( hDC, lpMsg );
        lpMsg = (LPUDMSG) FindNextItem (&message_scanner);
    }

    /* get and return pointer to next station, if any */
    return ((LPSTAT) lpTopic->statChainLink.next_item.ptr);
} /* XUdprotDumpTopic */

/***********************************************************************/
/** display dump information on indicated device context,
    using data from indicated port structure.
    returns pointer to next port if successful */

LPPORT
WINAPI
XUdprotDumpPort( HDC hDC, LPPORT lpPort )
{
    LPSTAT       lpTopic;
    CHAINSCANNER station_scanner;

    /* check port pointer */
    if( lpPort == (LPPORT)NULL ) {
        /* do nothing, just return */
        return (LPPORT)NULL;
    }

    /* display information on all stations associated with this port */
    lpTopic = (LPSTAT) FindFirstItem (&lpPort->mbTopicList, SCAN_FROM_HEAD,
                                      NULL, NULL, &station_scanner);
    while( lpTopic != (LPSTAT)NULL ) {
        XUdprotDumpTopic( hDC, lpTopic );
        lpTopic = (LPSTAT) FindNextItem (&station_scanner);
    }

    /* get and return pointer to next port, if any */
    return( (LPPORT) lpPort->mbChainLink.next_item.ptr );
} /* XUdprotDumpPort */

⌨️ 快捷键说明

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