cac
parent
e9eef722b1
commit
a64e2ca42c
@ -0,0 +1,31 @@
|
|||||||
|
// ClearThread.cpp: implementation of the CClearThread class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "ClearThread.h"
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// Construction/Destruction
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
CClearThread::CClearThread(QTextEdit *pEdit)
|
||||||
|
{
|
||||||
|
m_pEditWidget = pEdit;
|
||||||
|
}
|
||||||
|
|
||||||
|
CClearThread::~CClearThread()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CClearThread::run()
|
||||||
|
{
|
||||||
|
qDebug("clear thread start... ...");
|
||||||
|
|
||||||
|
if(m_pEditWidget)
|
||||||
|
{
|
||||||
|
m_pEditWidget->clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
qDebug("clear thread finished");
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
// ClearThread.h: interface for the CClearThread class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if !defined(AFX_CLEARTHREAD_H__17C9FD37_21E1_4FC2_83D4_942D1DE68D4B__INCLUDED_)
|
||||||
|
#define AFX_CLEARTHREAD_H__17C9FD37_21E1_4FC2_83D4_942D1DE68D4B__INCLUDED_
|
||||||
|
|
||||||
|
#include <qthread.h>
|
||||||
|
#include <qtextedit.h>
|
||||||
|
|
||||||
|
class CClearThread : public QThread
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CClearThread(QTextEdit *pEdit);
|
||||||
|
virtual ~CClearThread();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QTextEdit *m_pEditWidget;
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual void run();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !defined(AFX_CLEARTHREAD_H__17C9FD37_21E1_4FC2_83D4_942D1DE68D4B__INCLUDED_)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,78 @@
|
|||||||
|
// DlgDevListImpl.cpp: implementation of the CDlgDevListImpl class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#include "DlgDevListImpl.h"
|
||||||
|
#include <qvariant.h>
|
||||||
|
#include <qpushbutton.h>
|
||||||
|
#include <qtable.h>
|
||||||
|
#include <qlayout.h>
|
||||||
|
#include <qtooltip.h>
|
||||||
|
#include <qwhatsthis.h>
|
||||||
|
|
||||||
|
#include "qt_public.h"
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
// Construction/Destruction
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
const char* gColumnName[MAX_NET_NUM+1] = {"唗瘍","IP華硊1","IP華硊2","IP華硊3"};
|
||||||
|
|
||||||
|
CDlgDevListImpl::CDlgDevListImpl(DEV_DEF *pDevParam, int iDevNum, int iCurSel, QWidget* parent, const char* name, bool modal, WFlags fl)
|
||||||
|
: DevList(parent, name, modal, fl)
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
char sztmp[128];
|
||||||
|
|
||||||
|
m_iCurSelect = 0;
|
||||||
|
languageChange();
|
||||||
|
|
||||||
|
m_CTableDevList->setNumRows(iDevNum);
|
||||||
|
m_CTableDevList->setNumCols(MAX_NET_NUM+1);
|
||||||
|
|
||||||
|
QHeader *pHorHeader = m_CTableDevList->horizontalHeader();
|
||||||
|
for(i=0; i<(MAX_NET_NUM+1); i++)
|
||||||
|
{
|
||||||
|
pHorHeader->setLabel(i, CHS(gColumnName[i]));
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i=0; i<iDevNum; i++)
|
||||||
|
{
|
||||||
|
sprintf(sztmp, "%d", i+1);
|
||||||
|
m_CTableDevList->setText(i, 0, CHS(sztmp));
|
||||||
|
|
||||||
|
for(j=0; j<MAX_NET_NUM; j++)
|
||||||
|
{
|
||||||
|
sprintf(sztmp, "%d.%d.%d.%d",
|
||||||
|
((pDevParam[i].IpAddr[j]>>24)&0xFF),
|
||||||
|
((pDevParam[i].IpAddr[j]>>16)&0xFF),
|
||||||
|
((pDevParam[i].IpAddr[j]>>8)&0xFF),
|
||||||
|
(pDevParam[i].IpAddr[j]&0xFF));
|
||||||
|
m_CTableDevList->setText(i, j+1, CHS(sztmp));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(i=0; i<(MAX_NET_NUM+1); i++)
|
||||||
|
{
|
||||||
|
m_CTableDevList->adjustColumn( i );
|
||||||
|
}
|
||||||
|
|
||||||
|
m_CTableDevList->selectRow(iCurSel);
|
||||||
|
}
|
||||||
|
|
||||||
|
CDlgDevListImpl::~CDlgDevListImpl()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CDlgDevListImpl::languageChange()
|
||||||
|
{
|
||||||
|
setCaption(CHS("扢掘蹈桶"));
|
||||||
|
m_BtnChange->setText(CHS("恁寁"));
|
||||||
|
m_BtnCancel->setText(CHS("龰秏"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void CDlgDevListImpl::ChangeSelectSlot()
|
||||||
|
{
|
||||||
|
m_iCurSelect = m_CTableDevList->currentRow();
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
// DlgDevListImpl.h: interface for the CDlgDevListImpl class.
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#if !defined(AFX_DLGDEVLISTIMPL_H__DD481030_4A5E_4260_8D3E_A28E986FDDCF__INCLUDED_)
|
||||||
|
#define AFX_DLGDEVLISTIMPL_H__DD481030_4A5E_4260_8D3E_A28E986FDDCF__INCLUDED_
|
||||||
|
|
||||||
|
#if _MSC_VER > 1000
|
||||||
|
#pragma once
|
||||||
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
|
#include "devlist.h"
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
class CDlgDevListImpl : public DevList
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
CDlgDevListImpl(DEV_DEF *pDevParam, int iDevNum, int iCurSel, QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0);
|
||||||
|
virtual ~CDlgDevListImpl();
|
||||||
|
|
||||||
|
int m_iCurSelect;
|
||||||
|
int GetCurSelect(){return m_iCurSelect;};
|
||||||
|
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
virtual void ChangeSelectSlot();
|
||||||
|
|
||||||
|
protected slots:
|
||||||
|
virtual void languageChange();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // !defined(AFX_DLGDEVLISTIMPL_H__DD481030_4A5E_4260_8D3E_A28E986FDDCF__INCLUDED_)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
#if !defined(___CONFRW_H__DASJFHNZVCKZLCVHASPFDUIWQERJADHBNCBJADJFJDJAHFLWEJAHDSLFHLA)
|
||||||
|
#define ___CONFRW_H__DASJFHNZVCKZLCVHASPFDUIWQERJADHBNCBJADJFJDJAHFLWEJAHDSLFHLA
|
||||||
|
|
||||||
|
|
||||||
|
//#include <util/util.h>
|
||||||
|
#include "confrw_errno.h"
|
||||||
|
#include "confrw.h"
|
||||||
|
|
||||||
|
//#include "Profile_Hash.h"
|
||||||
|
|
||||||
|
|
||||||
|
#endif //!defined(___CONFRW_H__DASJFHNZVCKZLCVHASPFDUIWQERJADHBNCBJADJFJDJAHFLWEJAHDSLFHLA)
|
@ -0,0 +1,77 @@
|
|||||||
|
#ifndef __BAOHU_A_H_H_ICL__
|
||||||
|
#define __BAOHU_A_H_H_ICL__
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
// 设备信息定义
|
||||||
|
#define DEVIVE_NAME "CAC-SERVER"
|
||||||
|
#define VERSION "V1.00"
|
||||||
|
#define VERSION_DATE "2023-11-10"
|
||||||
|
#define MANUFACTURER "Global CAC"
|
||||||
|
|
||||||
|
extern SIO_PARAM_DEF SioParam[];
|
||||||
|
|
||||||
|
extern FUNCTION_CALL *FunCallPtr;
|
||||||
|
|
||||||
|
extern u_short MaxSerialPortNum;
|
||||||
|
extern u_short MaxNetPortNum;
|
||||||
|
extern u_short MaxPortNum;
|
||||||
|
|
||||||
|
extern void *pvconf_handle;
|
||||||
|
extern void *pvportconf_handle;
|
||||||
|
extern void *pvdataconf_handle;
|
||||||
|
extern char pvDataFileName[256];
|
||||||
|
|
||||||
|
extern char DeviceName[];
|
||||||
|
extern char Version[];
|
||||||
|
extern char VersionDate[];
|
||||||
|
extern char Manufacturer[];
|
||||||
|
extern char IniFilePath[256];
|
||||||
|
|
||||||
|
extern DAY_TIME DayTime;
|
||||||
|
|
||||||
|
void ByPassRecvData( int commid, u_char *buf, int len );
|
||||||
|
void WatchPortRecvData( void );
|
||||||
|
|
||||||
|
// 从 config.ini 或 portconfig.ini 读信息
|
||||||
|
u_long GetPrivateProString( char * section, char * entry, char * deflautstr, char * reslut,int len, char *inifile );
|
||||||
|
|
||||||
|
u_long atoul( u_char *buf );
|
||||||
|
|
||||||
|
int SetPntMsg( int port, int point, void *pntmsg, BYTE type, BYTE attr );
|
||||||
|
int GetPntMsg( int port, int point, void *pntmsg, BYTE type, BYTE attr );
|
||||||
|
int SetPorvPntMsg( int port, int point, void *pntmsg, BYTE type, BYTE attr );
|
||||||
|
int GetPorvPntMsg( int port, int point, void *pntmsg, BYTE type );
|
||||||
|
|
||||||
|
int CheckPollCmdBufEmpty( int port );
|
||||||
|
int PutPollCmdToBuf( int port, int type, WORD wait, char *buf, int len );
|
||||||
|
|
||||||
|
void PortMemeryMalloc( int port, int type );
|
||||||
|
|
||||||
|
void YkYtCommandProcess( int port, u_char *buf, int len );
|
||||||
|
|
||||||
|
|
||||||
|
// 读设备信息,检查芯片状态和读芯片类型和频率
|
||||||
|
void ReadPortConfigInfo( u_short netport );
|
||||||
|
|
||||||
|
void DataDisp( HWND );
|
||||||
|
|
||||||
|
void CloseUdpSetSock( void );
|
||||||
|
void PageUp( void );
|
||||||
|
void PageDown( void );
|
||||||
|
void PageHome( void );
|
||||||
|
void PageEnd( void );
|
||||||
|
void LineUp( void );
|
||||||
|
void LineDown( void );
|
||||||
|
|
||||||
|
void OpenAllPort( void );
|
||||||
|
void CloseOnePort( int commid );
|
||||||
|
void CloseAllPort( void );
|
||||||
|
void PollAllSerialPort( void );
|
||||||
|
void PollAllNetPort( void );
|
||||||
|
|
||||||
|
void TimerProc( void );
|
||||||
|
void SystemRtuTime( void );
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,85 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
* FileName : basetype.h *
|
||||||
|
* Programmer : Li Liangchu *
|
||||||
|
* Writen at : 2002.09.20 *
|
||||||
|
* Version : *
|
||||||
|
* Description: header of the nport.c *
|
||||||
|
* Last modify: 2002.11.6 *
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __BASETYPE_H_ICL__
|
||||||
|
#define __BASETYPE_H_ICL__
|
||||||
|
/*#ifndef OS_WINDOWS
|
||||||
|
//#include <winsock.h>
|
||||||
|
//#else
|
||||||
|
#include <sys/types.h>
|
||||||
|
#else*/
|
||||||
|
typedef unsigned char u_char;
|
||||||
|
typedef unsigned short u_short;
|
||||||
|
typedef unsigned int u_int;
|
||||||
|
typedef unsigned long u_long;
|
||||||
|
//#endif// OS_WINDOWS
|
||||||
|
|
||||||
|
typedef u_char BYTE;
|
||||||
|
typedef u_short WORD;
|
||||||
|
typedef u_long DWORD;
|
||||||
|
typedef long i_32;
|
||||||
|
typedef u_long u_32;
|
||||||
|
typedef int BOOL;
|
||||||
|
#define TRUE 1
|
||||||
|
#define FALSE 0
|
||||||
|
|
||||||
|
typedef struct tagCMDDEF
|
||||||
|
{
|
||||||
|
u_32 CmdTimerCnt; //命令时间计数
|
||||||
|
u_32 CmdTimerConst; //命令时间间隔
|
||||||
|
} CMDDEF, *pCMDDEF;
|
||||||
|
|
||||||
|
/*#ifndef OS_WINDOWS
|
||||||
|
typedef int bool;
|
||||||
|
typedef int64_t _int64;
|
||||||
|
typedef uint64_t _uint64;
|
||||||
|
typedef u_long UINT;
|
||||||
|
#define true TRUE
|
||||||
|
#define false FALSE
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
WORD Year __attribute__ ((packed));
|
||||||
|
u_char Month __attribute__ ((packed));
|
||||||
|
u_char Day __attribute__ ((packed));
|
||||||
|
u_char WeekDay __attribute__ ((packed));
|
||||||
|
u_char MonthDay __attribute__ ((packed));
|
||||||
|
u_char Hour __attribute__ ((packed));
|
||||||
|
u_char Min __attribute__ ((packed));
|
||||||
|
u_char Sec __attribute__ ((packed));
|
||||||
|
u_char reserved __attribute__ ((packed));
|
||||||
|
WORD mSec __attribute__ ((packed));
|
||||||
|
}DAY_TIME;
|
||||||
|
|
||||||
|
#define DSLIB_API
|
||||||
|
#else*/
|
||||||
|
#ifdef DSLIB_EXPORTS
|
||||||
|
#define DSLIB_API __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define DSLIB_API __declspec(dllimport)
|
||||||
|
#endif// DSLIB_EXPORTS
|
||||||
|
|
||||||
|
#pragma pack (push,1)
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
WORD Year;
|
||||||
|
u_char Month;
|
||||||
|
u_char Day;
|
||||||
|
u_char WeekDay;
|
||||||
|
u_char MonthDay;
|
||||||
|
u_char Hour;
|
||||||
|
u_char Min;
|
||||||
|
u_char Sec;
|
||||||
|
u_char reserved;
|
||||||
|
WORD mSec;
|
||||||
|
} DAY_TIME;
|
||||||
|
#pragma pack (pop)
|
||||||
|
//#endif// OS_WINDOWS
|
||||||
|
#endif// __BASETYPE_H_ICL__
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,174 @@
|
|||||||
|
//***************************************************************
|
||||||
|
//* chainlist.cpp *
|
||||||
|
//* aaawen 2005.05.27 *
|
||||||
|
//***************************************************************
|
||||||
|
//#ifdef OS_WINDOWS
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <process.h>
|
||||||
|
//#endif
|
||||||
|
#include <memory.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include "chainlist.h"
|
||||||
|
#include "basefunc.h"
|
||||||
|
#include "os_heap.h"
|
||||||
|
|
||||||
|
// SingleList
|
||||||
|
void SingleListInit(SINGLELIST *psSingleList, int iMaxNum)
|
||||||
|
{
|
||||||
|
psSingleList->iDevId = 0;
|
||||||
|
psSingleList->iMaxNum = iMaxNum;
|
||||||
|
psSingleList->iNum = 0;
|
||||||
|
psSingleList->pHead = NULL;
|
||||||
|
psSingleList->pTail = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SingleListInitEx(SINGLELIST *psSingleList, int iMaxNum, int iDevId)
|
||||||
|
{
|
||||||
|
psSingleList->iDevId = iDevId;
|
||||||
|
psSingleList->iMaxNum = iMaxNum;
|
||||||
|
psSingleList->iNum = 0;
|
||||||
|
psSingleList->pHead = NULL;
|
||||||
|
psSingleList->pTail = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SingleListHaveData(SINGLELIST *psSingleList)
|
||||||
|
{
|
||||||
|
return psSingleList->iNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL SingleListAddData(SINGLELIST *psSingleList, BYTE *pu8Data, int iDataLen)
|
||||||
|
{
|
||||||
|
char szDbg[128];
|
||||||
|
SINGLELISTUNIT *pUnit;
|
||||||
|
|
||||||
|
if(psSingleList->iNum >= psSingleList->iMaxNum)
|
||||||
|
{
|
||||||
|
sprintf(szDbg, "WARN(%04d): DevId=%08x SingleListAddData is Overflow.\n",
|
||||||
|
_getpid(), psSingleList->iDevId);
|
||||||
|
DebugPrint(szDbg);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
pUnit = (SINGLELISTUNIT *)HEAP_MALLOC(sizeof(SINGLELISTUNIT));
|
||||||
|
if(pUnit == NULL)
|
||||||
|
{
|
||||||
|
sprintf(szDbg, "WARN(%04d): DevId=%08x SingleListAddData malloc(%d) is failed in unit.\n",
|
||||||
|
_getpid(), psSingleList->iDevId, sizeof(SINGLELISTUNIT));
|
||||||
|
DebugPrint(szDbg);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
pUnit->pNext = NULL;
|
||||||
|
pUnit->pBuf = (BYTE *)HEAP_MALLOC(iDataLen+1);
|
||||||
|
if(pUnit->pBuf == NULL)
|
||||||
|
{
|
||||||
|
HEAP_FREE(pUnit);
|
||||||
|
sprintf(szDbg, "WARN(%04d): DevId=%08x SingleListAddData malloc(%d) is failed in content.\n",
|
||||||
|
_getpid(), psSingleList->iDevId, iDataLen+1);
|
||||||
|
DebugPrint(szDbg);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
pUnit->iLen = iDataLen;
|
||||||
|
memcpy(pUnit->pBuf, pu8Data, iDataLen);
|
||||||
|
|
||||||
|
if(psSingleList->pTail == NULL)
|
||||||
|
{
|
||||||
|
psSingleList->pTail = pUnit;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
psSingleList->pTail->pNext = pUnit;
|
||||||
|
psSingleList->pTail = pUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(psSingleList->pHead == NULL)
|
||||||
|
{
|
||||||
|
psSingleList->pHead = pUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
psSingleList->iNum++;
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
int SingleListGetAndDelData(SINGLELIST *psSingleList, BYTE *pu8Data, int iMaxLen)
|
||||||
|
{
|
||||||
|
int iDataLen;
|
||||||
|
SINGLELISTUNIT *pUnit;
|
||||||
|
|
||||||
|
if(psSingleList->pHead == NULL)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pUnit = psSingleList->pHead;
|
||||||
|
|
||||||
|
psSingleList->iNum--;
|
||||||
|
if(psSingleList->iNum <= 0)
|
||||||
|
{
|
||||||
|
psSingleList->iNum = 0;
|
||||||
|
psSingleList->pHead = NULL;
|
||||||
|
psSingleList->pTail = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
psSingleList->pHead = pUnit->pNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pUnit->iLen > iMaxLen)
|
||||||
|
{
|
||||||
|
iDataLen = iMaxLen;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iDataLen = pUnit->iLen;
|
||||||
|
}
|
||||||
|
memcpy(pu8Data, pUnit->pBuf, iDataLen);
|
||||||
|
|
||||||
|
HEAP_FREE(pUnit->pBuf);
|
||||||
|
HEAP_FREE(pUnit);
|
||||||
|
|
||||||
|
return iDataLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL SingleListDelData(SINGLELIST *psSingleList)
|
||||||
|
{
|
||||||
|
SINGLELISTUNIT *pUnit;
|
||||||
|
|
||||||
|
if(psSingleList->pHead == NULL)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
pUnit = psSingleList->pHead;
|
||||||
|
|
||||||
|
psSingleList->iNum--;
|
||||||
|
if(psSingleList->iNum <= 0)
|
||||||
|
{
|
||||||
|
psSingleList->iNum = 0;
|
||||||
|
psSingleList->pHead = NULL;
|
||||||
|
psSingleList->pTail = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
psSingleList->pHead = pUnit->pNext;
|
||||||
|
}
|
||||||
|
|
||||||
|
HEAP_FREE(pUnit->pBuf);
|
||||||
|
HEAP_FREE(pUnit);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL SingleListDelAllData(SINGLELIST *psSingleList)
|
||||||
|
{
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
if(SingleListDelData(psSingleList) == FALSE)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
#if !defined(_CHAINLIST_H_AAAWEN_200505271056__INCLUDED_)
|
||||||
|
#define _CHAINLIST_H_AAAWEN_200505271056__INCLUDED_
|
||||||
|
|
||||||
|
#include "basetype.h"
|
||||||
|
|
||||||
|
// 单向链表
|
||||||
|
typedef struct tagSINGLELISTUNIT
|
||||||
|
{
|
||||||
|
int iLen; // 数据长度
|
||||||
|
BYTE *pBuf; // 存储内容
|
||||||
|
struct tagSINGLELISTUNIT *pNext; // 单项链表的下一个
|
||||||
|
}SINGLELISTUNIT;
|
||||||
|
|
||||||
|
typedef struct tagSINGLELIST
|
||||||
|
{
|
||||||
|
int iDevId; // 端口号(高2个字节为端口号, 低2个字节为装置号)
|
||||||
|
int iNum;
|
||||||
|
int iMaxNum;
|
||||||
|
SINGLELISTUNIT *pHead;
|
||||||
|
SINGLELISTUNIT *pTail;
|
||||||
|
}SINGLELIST;
|
||||||
|
|
||||||
|
typedef struct tagDOUBLELISTUNIT
|
||||||
|
{
|
||||||
|
int iDataLen; // 数据长度
|
||||||
|
BYTE *pDataBuf; // 存储内容
|
||||||
|
struct tagDOUBLELISTUNIT *pNext; // 双向链表的下一个
|
||||||
|
struct tagDOUBLELISTUNIT *pFore; // 双向链表的前一个
|
||||||
|
}DOUBLELISTUNIT;
|
||||||
|
|
||||||
|
typedef struct tagDOUBLELIST
|
||||||
|
{
|
||||||
|
int iNum;
|
||||||
|
int iMaxNum;
|
||||||
|
DOUBLELISTUNIT *pHead;
|
||||||
|
DOUBLELISTUNIT *pTail;
|
||||||
|
}DOUBLELIST;
|
||||||
|
|
||||||
|
// SingleList
|
||||||
|
DSLIB_API void SingleListInit(SINGLELIST *psSingleList, int iMaxNum);
|
||||||
|
DSLIB_API void SingleListInitEx(SINGLELIST *psSingleList, int iMaxNum, int iDevId);
|
||||||
|
DSLIB_API int SingleListHaveData(SINGLELIST *psSingleList);
|
||||||
|
DSLIB_API BOOL SingleListAddData(SINGLELIST *psSingleList, BYTE *pu8Data, int iDataLen);
|
||||||
|
DSLIB_API int SingleListGetAndDelData(SINGLELIST *psSingleList, BYTE *pu8Data, int iMaxLen);
|
||||||
|
DSLIB_API BOOL SingleListDelData(SINGLELIST *psSingleList);
|
||||||
|
DSLIB_API BOOL SingleListDelAllData(SINGLELIST *psSingleList);
|
||||||
|
|
||||||
|
#endif // !defined(_CHAINLIST_H_AAAWEN_200505271056__INCLUDED_)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,42 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//#include <util/util.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#include "confrw_errno.h"
|
||||||
|
//#include "confrw.h"
|
||||||
|
|
||||||
|
#include "_confrw.h"
|
||||||
|
#include "Profile_Hash.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 关闭配置文件句柄
|
||||||
|
*
|
||||||
|
* 参数
|
||||||
|
* handle -- 配置文件句柄
|
||||||
|
*
|
||||||
|
* 返回值
|
||||||
|
* SUCCESS -- 成功的关闭了指定的配置文件句柄(包括资源释放等工作)
|
||||||
|
* 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
* 备注
|
||||||
|
* 如果输入的参数非配置文件(上下文)句柄, 则不作任何事.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int conf_close ( void * handle )
|
||||||
|
{
|
||||||
|
int ret = SUCCESS;
|
||||||
|
|
||||||
|
if ( NULL == handle )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
ret = close_profile_handle ( (HPROFILE )*(int *)handle );
|
||||||
|
if ( SUCCESS != ret )
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
free ( handle );
|
||||||
|
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
|
||||||
|
//#include <util/util.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <malloc.h>
|
||||||
|
|
||||||
|
#include "confrw_errno.h"
|
||||||
|
#include "confrw.h"
|
||||||
|
|
||||||
|
#include "_confrw.h"
|
||||||
|
#include "Profile_Hash.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 打开配置文件, 返回表示配置文件的句柄
|
||||||
|
*
|
||||||
|
* 参数
|
||||||
|
* pszfname -- 配置文件的全路径名(默认为 char [MAX_PATH]类型)
|
||||||
|
* ppvhandle -- 在函数执行成功的情况下, 返回配置文件(的上下文环境)句柄
|
||||||
|
*
|
||||||
|
* 返回值
|
||||||
|
* SUCCESS -- 成功的执行了该函数, 并打开了给定的配置文件
|
||||||
|
* 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int conf_open ( const char * pszfname, void ** ppvhandle )
|
||||||
|
{
|
||||||
|
int ret = SUCCESS;
|
||||||
|
|
||||||
|
if ( NULL == pszfname || NULL == ppvhandle )
|
||||||
|
return ERROR_POINTER;
|
||||||
|
|
||||||
|
int handle = -1;
|
||||||
|
|
||||||
|
ret = create_profile_cache ( (char *)pszfname, &handle );
|
||||||
|
if ( SUCCESS != ret )
|
||||||
|
{
|
||||||
|
*ppvhandle = NULL;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ppvhandle = calloc ( 1, sizeof(long) );
|
||||||
|
*((int *)*ppvhandle) = handle;
|
||||||
|
return SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,111 @@
|
|||||||
|
/********************************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999-2000 SCADA Technology Control Co., Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* 读配置文件的调用接口函数 之
|
||||||
|
* 根据指定的 [段]及键的名称, 获取配置文件中的配置项
|
||||||
|
*
|
||||||
|
* 创建日期: 2002/01/21
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* $Name: $
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
*
|
||||||
|
* $Date: 2006/08/04 03:37:33 $
|
||||||
|
*
|
||||||
|
* $State: Exp $
|
||||||
|
*
|
||||||
|
* $Log: conf_read_key.cpp,v $
|
||||||
|
* Revision 1.2 2006/08/04 03:37:33 zhuzhenhua
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.2.1 2006/07/28 07:54:02 zhuzhenhua
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2003/01/02 03:14:51 scada
|
||||||
|
* trim substitution line
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/08/21 07:16:39 harold
|
||||||
|
* temporarily import
|
||||||
|
*
|
||||||
|
* Revision 1.8 2002/03/20 03:40:22 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/03/15 13:43:21 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/03/15 08:17:11 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.7 2002/01/23 06:07:22 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.6 2002/01/23 05:43:55 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.5 2002/01/23 05:41:06 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.4 2002/01/23 03:35:41 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.3 2002/01/23 03:34:24 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2002/01/23 03:26:24 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1 2002/01/21 02:46:53 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//#include <util/util.h>
|
||||||
|
#include "confrw_errno.h"
|
||||||
|
#include "confrw.h"
|
||||||
|
|
||||||
|
#include "_confrw.h"
|
||||||
|
#include "Profile_Hash.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 根据指定的 [段]及键的名称, 获取配置文件中的配置项
|
||||||
|
*
|
||||||
|
* 参数
|
||||||
|
* handle -- 配置文件句柄
|
||||||
|
* pszsec_name -- 段名
|
||||||
|
* pszkey_name -- 键名称
|
||||||
|
* pszdefault -- 键的默认值, 以null字符结尾的字符串,
|
||||||
|
* 如果配置文件中没有该键的配置, 同时, 该参数不为空, 则返回该值
|
||||||
|
* pbuf -- 返回值的缓冲区
|
||||||
|
* buffer_length -- 缓冲区长度
|
||||||
|
*
|
||||||
|
* 返回值
|
||||||
|
* SUCCESS -- 成功的执行了本函数
|
||||||
|
* 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int conf_read_key ( void * handle,
|
||||||
|
const char * pszsec_name,
|
||||||
|
const char * pszkey_name,
|
||||||
|
const char * pszdefault,
|
||||||
|
char * pbuf,
|
||||||
|
int buffer_length )
|
||||||
|
{
|
||||||
|
int len = buffer_length;
|
||||||
|
|
||||||
|
return get_pgcprofile_string ( (char *)pszsec_name,
|
||||||
|
(char *)pszkey_name,
|
||||||
|
(char *)pszdefault,
|
||||||
|
pbuf,
|
||||||
|
(pgcu32 *)&len,
|
||||||
|
(HPROFILE)*(int *)handle );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,96 @@
|
|||||||
|
/********************************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999-2000 SCADA Technology Control Co., Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* 读配置文件的调用接口函数 之
|
||||||
|
* 修改/添加一个新的配置项
|
||||||
|
*
|
||||||
|
* 创建日期: 2002/01/21
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* $Name: $
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
*
|
||||||
|
* $Date: 2006/08/04 03:37:33 $
|
||||||
|
*
|
||||||
|
* $State: Exp $
|
||||||
|
*
|
||||||
|
* $Log: conf_write_key.cpp,v $
|
||||||
|
* Revision 1.2 2006/08/04 03:37:33 zhuzhenhua
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.2.1 2006/07/28 07:54:02 zhuzhenhua
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2003/01/02 03:14:51 scada
|
||||||
|
* trim substitution line
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/08/21 07:16:39 harold
|
||||||
|
* temporarily import
|
||||||
|
*
|
||||||
|
* Revision 1.5 2002/03/20 03:40:22 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/03/15 13:43:21 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/03/15 08:17:11 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.4 2002/01/23 05:41:06 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.3 2002/01/23 03:35:41 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2002/01/23 03:26:24 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1 2002/01/21 02:46:53 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//#include <util/util.h>
|
||||||
|
#include "confrw_errno.h"
|
||||||
|
#include "confrw.h"
|
||||||
|
|
||||||
|
#include "_confrw.h"
|
||||||
|
#include "typedef.h"
|
||||||
|
#include "Profile_Hash.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 修改/添加一个新的配置项
|
||||||
|
*
|
||||||
|
* 参数
|
||||||
|
* handle -- 配置文件句柄
|
||||||
|
* pszsec_name -- 段名
|
||||||
|
* pszkey_name -- 键名
|
||||||
|
* pszkey_value -- 键的值
|
||||||
|
* force_insert -- 如果(段, 键)不存在, 是否需要插入该(段, 键)的配置值,
|
||||||
|
* 如果该参数等于0, 则不插入该配置项, 否则, 插入该配置项.
|
||||||
|
*
|
||||||
|
* 返回值
|
||||||
|
* SUCCESS -- 成功
|
||||||
|
* 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
int conf_write_key ( void * handle,
|
||||||
|
const char * pszsec_name,
|
||||||
|
const char * pszkey_name,
|
||||||
|
const char * pszkey_value,
|
||||||
|
int force_insert )
|
||||||
|
{
|
||||||
|
return write_pgcprofile_string ( pszsec_name,
|
||||||
|
pszkey_name,
|
||||||
|
pszkey_value,
|
||||||
|
force_insert ? PGCTRUE : PGCFALSE,
|
||||||
|
(HPROFILE)*(int *)handle );
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
[网络设置]
|
||||||
|
主机网络端口=7119
|
||||||
|
PING接收端口=13124
|
||||||
|
PING发送端口=13123
|
||||||
|
[主机地址]
|
||||||
|
主机A地址1=192.168.1.199
|
||||||
|
停止向主机发送端口全数据=0
|
||||||
|
[前置机]
|
||||||
|
前置机A地址1=192.168.1.143
|
||||||
|
前置机A地址2=192.168.2.143
|
||||||
|
前置机B地址1=192.168.1.113
|
||||||
|
前置机B地址2=192.168.2.113
|
||||||
|
前置机A地址1掩码=255.255.255.0
|
||||||
|
前置机A地址2掩码=255.255.255.0
|
||||||
|
前置机B地址1掩码=255.255.255.0
|
||||||
|
前置机B地址2掩码=255.255.255.0
|
||||||
|
允许前置机连接=1
|
||||||
|
前置机连接=2
|
||||||
|
起始厂站号=0
|
||||||
|
运行方式=0
|
||||||
|
主备切换端口屏蔽字=0x00000000
|
||||||
|
[对时]
|
||||||
|
对时方式=1
|
||||||
|
[NetCommPort]
|
||||||
|
UdpCommPort=0xfe00
|
||||||
|
TcpCommPort=0xff01
|
||||||
|
WatchCommPort=0xff02
|
||||||
|
[PortConfig]
|
||||||
|
Port1=1
|
||||||
|
Port2=1
|
||||||
|
Port3=1
|
||||||
|
Port4=1
|
||||||
|
Port5=1
|
||||||
|
Port6=1
|
||||||
|
Port7=1
|
||||||
|
Port8=1
|
||||||
|
Port9=1
|
||||||
|
Port10=1
|
||||||
|
Port11=1
|
||||||
|
Port12=1
|
||||||
|
Port13=1
|
||||||
|
Port14=1
|
||||||
|
Port15=1
|
||||||
|
Port16=1
|
@ -0,0 +1,177 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#if !defined(__CONFRW_H__QWERUOIPUADFJHAFKLHADSFHADSFVCMBVZXCVQOEWIRADSHJKXZJVBLWQERYO)
|
||||||
|
#define __CONFRW_H__QWERUOIPUADFJHAFKLHADSFHADSFVCMBVZXCVQOEWIRADSHJKXZJVBLWQERYO
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \if developer_doc
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief 读配置文件的调用接口头文件,包括:系统限值常量, 外部接口函数声明头文件。
|
||||||
|
*
|
||||||
|
* id: $Id: confrw.h,v 1.2 2006/08/04 03:37:33 zhuzhenhua Exp $
|
||||||
|
*
|
||||||
|
* \author 杨小波 prcharold@sina.com.cn develop1@szscada.com
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
//#include <util/util.h>
|
||||||
|
#include "confrw_errno.h"
|
||||||
|
|
||||||
|
#ifdef OS_LINUX
|
||||||
|
#define DSLIB_API
|
||||||
|
#else
|
||||||
|
#ifdef CONFRWLIB_EXPORTS
|
||||||
|
#define CONFRWLIB_API __declspec(dllexport)
|
||||||
|
#else
|
||||||
|
#define CONFRWLIB_API __declspec(dllimport)
|
||||||
|
#endif// CONFRWLIB_EXPORTS
|
||||||
|
#endif//OS_LINUX
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \if by_group
|
||||||
|
* \addtogroup grp_config_rw
|
||||||
|
* @{
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief 打开配置文件, 返回表示配置文件的句柄
|
||||||
|
*
|
||||||
|
* \param pszfname --[in] 配置文件的全路径名(默认为 char [MAX_PATH]类型)
|
||||||
|
* \param ppvhandle --[in] 在函数执行成功的情况下, 返回配置文件(的上下文环境)句柄
|
||||||
|
*
|
||||||
|
* \retval 返回值
|
||||||
|
* \retval SUCCESS -- 成功的执行了该函数, 并打开了给定的配置文件
|
||||||
|
* \retval 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
CONFRWLIB_API int conf_open ( const char * pszfname, void ** ppvhandle );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief 关闭配置文件句柄
|
||||||
|
*
|
||||||
|
* \param handle --[in] 配置文件句柄
|
||||||
|
*
|
||||||
|
* \retval SUCCESS -- 成功的关闭了指定的配置文件句柄(包括资源释放等工作)
|
||||||
|
* \retval ERROR_CONF_HANLDE -- 错误的配置文件读写句柄
|
||||||
|
* \retval 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
* \note
|
||||||
|
* 如果输入的参数非配置文件(上下文)句柄, 则不作任何事.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
CONFRWLIB_API int conf_close ( void * handle );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief 根据指定的 [段]及键的名称, 获取配置文件中的配置项
|
||||||
|
*
|
||||||
|
* \param handle --[in] 配置文件句柄
|
||||||
|
* \param pszsec_name --[in] 段名, 以null字符结尾的字符串
|
||||||
|
* \param pszkey_name --[in] 键名称, 以null字符结尾的字符串
|
||||||
|
* \param pszdefault --[in] 键的默认值, 以null字符结尾的字符串,如果配置文件中没有该键的配置, 同时, 该参数不为空, 则返回该值
|
||||||
|
* \param pbuf --[out] 返回值的缓冲区
|
||||||
|
* \param buffer_length --[in] 缓冲区长度
|
||||||
|
*
|
||||||
|
* \retval SUCCESS -- 配置的键值存在, 且成功地读出
|
||||||
|
* \retval 如果给出默认值, 则在欲读取的键值/键不存在地情况下, 同样返回SUCCESS
|
||||||
|
* \retval ERROR_CONF_SECTION -- 欲读取的键所在的段不存在
|
||||||
|
* \retval ERROR_CONF_KEY -- 欲读取的键不存在
|
||||||
|
* \retval 其它 -- 失败代码
|
||||||
|
*/
|
||||||
|
CONFRWLIB_API int conf_read_key ( void * handle,
|
||||||
|
const char * pszsec_name,
|
||||||
|
const char * pszkey_name,
|
||||||
|
const char * pszdefault,
|
||||||
|
char * pbuf,
|
||||||
|
int buffer_length );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief 修改/添加一个新的配置项
|
||||||
|
*
|
||||||
|
* \param handle --[in] 配置文件句柄
|
||||||
|
* \param pszsec_name --[in] 段名
|
||||||
|
* \param pszkey_name --[in] 键名
|
||||||
|
* \param pszkey_value --[in] 键的值
|
||||||
|
* \param force_insert --[in] 如果(段, 键)不存在, 是否需要插入该(段, 键)的配置值,
|
||||||
|
* 如果该参数等于0, 则不插入该配置项, 否则, 插入该配置项.
|
||||||
|
*
|
||||||
|
* \retval SUCCESS -- 成功
|
||||||
|
* \retval 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
* \note
|
||||||
|
* 如果 force_insert 为0, 则当配置文件中不存在指定段时, 返回 ERROR_CONF_SECTION;
|
||||||
|
* 如果不存在指定(段/键)组合时, 返回 ERROR_CONF_KEY.
|
||||||
|
*/
|
||||||
|
CONFRWLIB_API int conf_write_key ( void * handle,
|
||||||
|
const char * pszsec_name,
|
||||||
|
const char * pszkey_name,
|
||||||
|
const char * pszkey_value,
|
||||||
|
int force_insert );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief 从配置文件中删除一个指定的配置项(段, 键)
|
||||||
|
*
|
||||||
|
* \param handle --[in] 配置文件句柄
|
||||||
|
* \param pszsec_name --[in] 段名
|
||||||
|
* \param pszkey_name --[in] 键名
|
||||||
|
*
|
||||||
|
* \retval SUCCESS -- 成功的删除了指定的配置项
|
||||||
|
* \retval 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
* \note
|
||||||
|
* 如果指定的段不存在, 则返回 ERROR_CONF_SECTION
|
||||||
|
* 如果指定(段, 键名称)组合不存在, 则返回 ERROR_CONF_KEY
|
||||||
|
*/
|
||||||
|
CONFRWLIB_API int conf_delete_key ( void * handle,
|
||||||
|
const char * pszsec_name,
|
||||||
|
const char * pszkey_name );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief 删除配置文件中一个整段的配置
|
||||||
|
*
|
||||||
|
* \param handle --[in] 配置文件句柄
|
||||||
|
* \param pszsec_name --[in] 希望删除的段的名称, 以null字符结尾的字符串
|
||||||
|
*
|
||||||
|
* \retval SUCCESS -- 成功的删除了配置文件中的指定的段
|
||||||
|
* \retval 其它 -- 失败代码
|
||||||
|
*
|
||||||
|
* \note
|
||||||
|
* 如果指定的段不存在, 则返回 ERROR_CONF_SECTION
|
||||||
|
*/
|
||||||
|
CONFRWLIB_API int conf_delete_section ( void * handle,
|
||||||
|
const char * pszsec_name );
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \if by_group
|
||||||
|
* @}
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#endif //!defined(__CONFRW_H__QWERUOIPUADFJHAFKLHADSFHADSFVCMBVZXCVQOEWIRADSHJKXZJVBLWQERYO)
|
@ -0,0 +1,69 @@
|
|||||||
|
|
||||||
|
#if !defined(__CONFRW_ERRNO_H__OPQEWUIPADSJKHZXCXZVNZCADLHJFOQEWPOQYUEHJASDFHPWQEUQ)
|
||||||
|
#define __CONFRW_ERRNO_H__OPQEWUIPADSJKHZXCXZVNZCADLHJFOQEWPOQYUEHJASDFHPWQEUQ
|
||||||
|
/*!
|
||||||
|
* \if developer_doc
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief 读配置文件的调用接口函数库的错误代码定义头文件。
|
||||||
|
*
|
||||||
|
* id: $Id: confrw_errno.h,v 1.2 2006/08/04 03:37:33 zhuzhenhua Exp $
|
||||||
|
*
|
||||||
|
* \author 杨小波 prcharold@sina.com.cn develop1@szscada.com
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "global_errno.h"
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \if by_group
|
||||||
|
* \addtogroup grp_config_rw
|
||||||
|
* @{
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
//!< 不能为当前打开的配置文件缓冲分配一个句柄,原因是句柄已经全被占用
|
||||||
|
#define ERROR_CONF_NOHANDLE (ERROR_CONF_BASE + 1)
|
||||||
|
|
||||||
|
//!< 创建哈希表失败
|
||||||
|
#define ERROR_CONF_CREATEHASH (ERROR_CONF_BASE + 2)
|
||||||
|
|
||||||
|
//!< 输入了非法的配置文件缓冲句柄
|
||||||
|
#define ERROR_CONF_INVALIDHANDLE (ERROR_CONF_BASE + 3)
|
||||||
|
|
||||||
|
//!< 在读配置文件时,用户开辟的接收缓冲区不够大
|
||||||
|
#define ERROR_CONF_REVBUFFER (ERROR_CONF_BASE + 4)
|
||||||
|
|
||||||
|
//!< 在读配置文件时,因指定的段的项目名不存在,函数执行缺省拷贝,并返回此结果
|
||||||
|
#define SUCCESS_CONF_DEFCOPY (ERROR_CONF_BASE + 5)
|
||||||
|
|
||||||
|
//!< 不能输入一个空的句柄指针作参数
|
||||||
|
#define ERROR_CONF_NULL_HANDEPTR (ERROR_CONF_BASE + 6)
|
||||||
|
|
||||||
|
//!< 输入的段名,项目名,项目值的字符串长度超长
|
||||||
|
#define ERROR_CONF_INPUTSTRING_TOOLARGE (ERROR_CONF_BASE + 7)
|
||||||
|
|
||||||
|
//!< 指定的段或项目并不存在
|
||||||
|
#define ERROR_CONF_NOTEXIST (ERROR_CONF_BASE + 8)
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
*\verbatim
|
||||||
|
以下为confrw_ex中定义的错误代码
|
||||||
|
*\endvervatim
|
||||||
|
*/
|
||||||
|
//!< 无效的配置文件句柄
|
||||||
|
#define ERROR_CONF_HANDLE (ERROR_CONF_BASE + 9)
|
||||||
|
|
||||||
|
//!< 指定的段不存在
|
||||||
|
#define ERROR_CONF_SECTION (ERROR_CONF_BASE + 10)
|
||||||
|
|
||||||
|
//!< 指定的键值不存在
|
||||||
|
#define ERROR_CONF_KEY (ERROR_CONF_BASE + 11)
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \if by_group
|
||||||
|
* @}
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
#endif //!defined(__CONFRW_ERRNO_H__OPQEWUIPADSJKHZXCXZVNZCADLHJFOQEWPOQYUEHJASDFHPWQEUQ)
|
@ -0,0 +1,625 @@
|
|||||||
|
|
||||||
|
|
||||||
|
//#include "stdafx.h"
|
||||||
|
#include "display.h"
|
||||||
|
#include "commport.h"
|
||||||
|
|
||||||
|
extern SIO_PARAM_DEF SioParam[];
|
||||||
|
|
||||||
|
extern int iCurDevIdx;
|
||||||
|
extern DEV_DEF DevParam[];
|
||||||
|
|
||||||
|
HWND hMainWnd;
|
||||||
|
|
||||||
|
int RealDataDispFlag;
|
||||||
|
|
||||||
|
int CurPort;
|
||||||
|
int DispType = 0;
|
||||||
|
|
||||||
|
int ListIndex = 0; // 显示序号索引起始
|
||||||
|
int ItemNumOfPage; // 页显示项目数
|
||||||
|
|
||||||
|
|
||||||
|
COLORREF dwColorVal[16] = // 显示颜色定义
|
||||||
|
{
|
||||||
|
RGB(255,255,255), RGB(128,128,128),
|
||||||
|
RGB(255, 0, 0), RGB(255,255, 0),
|
||||||
|
RGB( 0,255, 0), RGB( 0,255,255),
|
||||||
|
RGB( 0, 0,255), RGB(255, 0,255),
|
||||||
|
RGB(192,192,192), RGB( 0, 0, 0),
|
||||||
|
RGB(128, 0, 0), RGB(128,128, 0),
|
||||||
|
RGB( 0,128, 0), RGB( 0,128,128),
|
||||||
|
RGB( 0, 0,128), RGB(128, 0,128)
|
||||||
|
};
|
||||||
|
|
||||||
|
void RealAiDataDisp( HDC hdc )
|
||||||
|
{
|
||||||
|
UINT xWd, yHg, lineh, tmp;
|
||||||
|
int i, j, total, idx, itemofline;
|
||||||
|
char szbuf[256];
|
||||||
|
RECT rc;
|
||||||
|
AI_DEF *aiptr;
|
||||||
|
|
||||||
|
float sp;
|
||||||
|
int pos[6];
|
||||||
|
|
||||||
|
GetClientRect( hMainWnd, &rc );
|
||||||
|
|
||||||
|
itemofline = 2;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"行距" );
|
||||||
|
lineh = yHg + 5;
|
||||||
|
|
||||||
|
rc.top = 10;
|
||||||
|
|
||||||
|
SetTextColor( hdc, dwColorVal[BLUE] );
|
||||||
|
|
||||||
|
// 显示标题
|
||||||
|
sprintf( szbuf,"端口%02d 实时遥测数据信息", CurPort + 1 );
|
||||||
|
DrawText(hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
rc.top += (lineh + 5);
|
||||||
|
|
||||||
|
SetTextColor( hdc, dwColorVal[BLACK] );
|
||||||
|
|
||||||
|
// 计算显示位置
|
||||||
|
pos[0] = 0;
|
||||||
|
pos[3] = rc.right / 2;
|
||||||
|
|
||||||
|
tmp = 0;
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"序号" );
|
||||||
|
tmp += xWd;
|
||||||
|
|
||||||
|
pos[1] = pos[0] + xWd;
|
||||||
|
pos[4] = pos[3] + xWd;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点名称" );
|
||||||
|
tmp += xWd;
|
||||||
|
|
||||||
|
pos[2] = pos[1] + xWd;
|
||||||
|
pos[5] = pos[4] + xWd;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点原值" );
|
||||||
|
tmp += xWd;
|
||||||
|
sp = ((float)rc.right - (float)tmp*itemofline) / (itemofline*4);
|
||||||
|
pos[0] += (int)sp;
|
||||||
|
pos[1] += (int)(sp*2);
|
||||||
|
pos[2] += (int)(sp*3);
|
||||||
|
pos[3] += (int)(sp);
|
||||||
|
pos[4] += (int)(sp*2);
|
||||||
|
pos[5] += (int)(sp*3);
|
||||||
|
|
||||||
|
// 显示项目名称
|
||||||
|
for ( i = 0; i < itemofline; i++ )
|
||||||
|
{
|
||||||
|
sprintf( szbuf, (char*)"序号" );
|
||||||
|
rc.left = pos[i*3];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
sprintf( szbuf, (char*)"测点名称" );
|
||||||
|
rc.left = pos[i*3+1];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
sprintf( szbuf, (char*)"测点原值" );
|
||||||
|
rc.left = pos[i*3+2];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
}
|
||||||
|
rc.top += lineh;
|
||||||
|
|
||||||
|
ItemNumOfPage = (rc.bottom - rc.top) / lineh;
|
||||||
|
|
||||||
|
if( !IsBaoHuPtr(CurPort) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 计算总行数
|
||||||
|
total = (SioParam[CurPort].m_psBaoHu->AiNum + itemofline - 1) / itemofline;
|
||||||
|
|
||||||
|
// 调整显示的起始位置
|
||||||
|
if ( total < ItemNumOfPage )
|
||||||
|
ListIndex = 0;
|
||||||
|
if ( (ListIndex + ItemNumOfPage) > total )
|
||||||
|
ListIndex = total - ItemNumOfPage;
|
||||||
|
if ( ListIndex < 0 )
|
||||||
|
ListIndex = 0;
|
||||||
|
|
||||||
|
// 显示输出
|
||||||
|
idx = ListIndex * itemofline;
|
||||||
|
aiptr = (AI_DEF*)SioParam[CurPort].m_psBaoHu->AiPtr;
|
||||||
|
if( !aiptr )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for ( i = 0; (i < ItemNumOfPage) && (idx < SioParam[CurPort].m_psBaoHu->AiNum); i++ )
|
||||||
|
{
|
||||||
|
for ( j = 0; j < itemofline; j++ )
|
||||||
|
{
|
||||||
|
if((idx + j) >= SioParam[CurPort].m_psBaoHu->AiNum)
|
||||||
|
break;
|
||||||
|
|
||||||
|
sprintf( szbuf, "%03d", idx + j + 1 );
|
||||||
|
rc.left = pos[j*3+0];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"序号" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
|
||||||
|
sprintf( szbuf, "遥测%03d", idx + j + 1 );
|
||||||
|
rc.left = pos[j*3+1];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点名称" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
|
||||||
|
sprintf( szbuf, "0x%04x", aiptr[idx+j].RawValue & 0xffff );
|
||||||
|
rc.left = pos[j*3+2];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点原值" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
}
|
||||||
|
|
||||||
|
idx += itemofline;
|
||||||
|
rc.top += lineh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RealDiDataDisp( HDC hdc )
|
||||||
|
{
|
||||||
|
UINT xWd, yHg, lineh, tmp;
|
||||||
|
int i, j, total, idx, itemofline;
|
||||||
|
char szbuf[256], stchar = 1;
|
||||||
|
RECT rc;
|
||||||
|
DI_DEF *diptr;
|
||||||
|
|
||||||
|
float sp;
|
||||||
|
int pos[6];
|
||||||
|
|
||||||
|
GetClientRect( hMainWnd, &rc );
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"行距" );
|
||||||
|
lineh = yHg + 5;
|
||||||
|
|
||||||
|
itemofline = 2;
|
||||||
|
|
||||||
|
rc.top = 10;
|
||||||
|
|
||||||
|
SetTextColor( hdc, dwColorVal[BLUE] );
|
||||||
|
|
||||||
|
// 显示标题
|
||||||
|
sprintf( szbuf,"端口%02d 实时遥信数据信息", CurPort + 1 );
|
||||||
|
DrawText(hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
rc.top += (lineh + 5);
|
||||||
|
|
||||||
|
SetTextColor( hdc, dwColorVal[BLACK] );
|
||||||
|
|
||||||
|
// 计算显示位置
|
||||||
|
pos[0] = 0;
|
||||||
|
pos[3] = rc.right / 2;
|
||||||
|
|
||||||
|
tmp = 0;
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"序号" );
|
||||||
|
tmp += xWd;
|
||||||
|
|
||||||
|
pos[1] = pos[0] + xWd;
|
||||||
|
pos[4] = pos[3] + xWd;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点名称" );
|
||||||
|
tmp += xWd;
|
||||||
|
|
||||||
|
pos[2] = pos[1] + xWd;
|
||||||
|
pos[5] = pos[4] + xWd;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"状态" );
|
||||||
|
tmp += xWd;
|
||||||
|
sp = ((float)rc.right - (float)tmp*itemofline) / (itemofline*4);
|
||||||
|
pos[0] += (int)sp;
|
||||||
|
pos[1] += (int)(sp*2);
|
||||||
|
pos[2] += (int)(sp*3);
|
||||||
|
pos[3] += (int)(sp);
|
||||||
|
pos[4] += (int)(sp*2);
|
||||||
|
pos[5] += (int)(sp*3);
|
||||||
|
|
||||||
|
// 显示项目名称
|
||||||
|
for ( i = 0; i < itemofline; i++ )
|
||||||
|
{
|
||||||
|
sprintf( szbuf, (char*)"序号" );
|
||||||
|
rc.left = pos[i*3+0];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
|
||||||
|
sprintf( szbuf, (char*)"测点名称" );
|
||||||
|
rc.left = pos[i*3+1];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
|
||||||
|
sprintf( szbuf, (char*)"状态" );
|
||||||
|
rc.left = pos[i*3+2];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
}
|
||||||
|
rc.top += lineh;
|
||||||
|
|
||||||
|
ItemNumOfPage = (rc.bottom - rc.top) / lineh;
|
||||||
|
|
||||||
|
if( !IsBaoHuPtr(CurPort) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 计算总行数
|
||||||
|
total = (SioParam[CurPort].m_psBaoHu->DiNum + itemofline - 1) / itemofline;
|
||||||
|
|
||||||
|
// 调整显示的起始位置
|
||||||
|
if ( total < ItemNumOfPage )
|
||||||
|
ListIndex = 0;
|
||||||
|
if ( (ListIndex + ItemNumOfPage) > total )
|
||||||
|
ListIndex = total - ItemNumOfPage;
|
||||||
|
if ( ListIndex < 0 )
|
||||||
|
ListIndex = 0;
|
||||||
|
|
||||||
|
// 显示输出
|
||||||
|
idx = ListIndex * itemofline;
|
||||||
|
diptr = (DI_DEF*)SioParam[CurPort].m_psBaoHu->DiPtr;
|
||||||
|
if( !diptr )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for ( i = 0; (i < ItemNumOfPage) && (idx < SioParam[CurPort].m_psBaoHu->DiNum); i++ )
|
||||||
|
{
|
||||||
|
for ( j = 0; j < itemofline; j++ )
|
||||||
|
{
|
||||||
|
if((idx + j) >= SioParam[CurPort].m_psBaoHu->DiNum)
|
||||||
|
break;
|
||||||
|
|
||||||
|
sprintf( szbuf, "%03d", idx + j + 1 );
|
||||||
|
rc.left = pos[j*3+0];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"序号" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
|
||||||
|
sprintf( szbuf, "遥信%03d", idx + j + 1 );
|
||||||
|
rc.left = pos[j*3+1];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点名称" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
|
||||||
|
sprintf( szbuf, "%s", diptr[idx+j].Status ? (char*)"合" : (char*)"分" );
|
||||||
|
rc.left = pos[j*3+2];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"状态" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
}
|
||||||
|
|
||||||
|
idx += itemofline;
|
||||||
|
rc.top += lineh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void RealPiDataDisp( HDC hdc )
|
||||||
|
{
|
||||||
|
UINT xWd, yHg, lineh, tmp;
|
||||||
|
int i, j, total, idx, itemofline;
|
||||||
|
char szbuf[256];
|
||||||
|
RECT rc;
|
||||||
|
PI_DEF *piptr;
|
||||||
|
|
||||||
|
float sp;
|
||||||
|
int pos[6];
|
||||||
|
|
||||||
|
GetClientRect( hMainWnd, &rc );
|
||||||
|
itemofline = 2;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"行距" );
|
||||||
|
lineh = yHg + 5;
|
||||||
|
|
||||||
|
rc.top = 10;
|
||||||
|
|
||||||
|
SetTextColor( hdc, dwColorVal[BLUE] );
|
||||||
|
|
||||||
|
// 显示标题
|
||||||
|
sprintf( szbuf,"端口%02d 实时电度数据信息", CurPort + 1 );
|
||||||
|
DrawText(hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
rc.top += (lineh + 5);
|
||||||
|
|
||||||
|
SetTextColor( hdc, dwColorVal[BLACK] );
|
||||||
|
|
||||||
|
// 计算显示位置
|
||||||
|
pos[0] = 0;
|
||||||
|
pos[3] = rc.right / 2;
|
||||||
|
|
||||||
|
tmp = 0;
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"序号" );
|
||||||
|
tmp += xWd;
|
||||||
|
|
||||||
|
pos[1] = pos[0] + xWd;
|
||||||
|
pos[4] = pos[3] + xWd;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点名称" );
|
||||||
|
tmp += xWd;
|
||||||
|
|
||||||
|
pos[2] = pos[1] + xWd;
|
||||||
|
pos[5] = pos[4] + xWd;
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点原值" );
|
||||||
|
tmp += xWd;
|
||||||
|
sp = ((float)rc.right - (float)tmp*itemofline) / (itemofline*4);
|
||||||
|
pos[0] += (int)sp;
|
||||||
|
pos[1] += (int)(sp*2);
|
||||||
|
pos[2] += (int)(sp*3);
|
||||||
|
pos[3] += (int)(sp);
|
||||||
|
pos[4] += (int)(sp*2);
|
||||||
|
pos[5] += (int)(sp*3);
|
||||||
|
|
||||||
|
// 显示项目名称
|
||||||
|
for ( i = 0; i < itemofline; i++ )
|
||||||
|
{
|
||||||
|
sprintf( szbuf, (char*)"序号" );
|
||||||
|
rc.left = pos[i*3+0];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
|
||||||
|
sprintf( szbuf, (char*)"测点名称" );
|
||||||
|
rc.left = pos[i*3+1];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
|
||||||
|
sprintf( szbuf, (char*)"测点原值" );
|
||||||
|
rc.left = pos[i*3+2];
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
}
|
||||||
|
rc.top += lineh;
|
||||||
|
|
||||||
|
ItemNumOfPage = (rc.bottom - rc.top) / lineh;
|
||||||
|
|
||||||
|
if( !IsBaoHuPtr(CurPort) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 计算总行数
|
||||||
|
total = (SioParam[CurPort].m_psBaoHu->PiNum + itemofline - 1) / itemofline;
|
||||||
|
|
||||||
|
// 调整显示的起始位置
|
||||||
|
if ( total < ItemNumOfPage )
|
||||||
|
ListIndex = 0;
|
||||||
|
if ( (ListIndex + ItemNumOfPage) > total )
|
||||||
|
ListIndex = total - ItemNumOfPage;
|
||||||
|
if ( ListIndex < 0 )
|
||||||
|
ListIndex = 0;
|
||||||
|
|
||||||
|
// 显示输出
|
||||||
|
idx = ListIndex * itemofline;
|
||||||
|
piptr = (PI_DEF*)SioParam[CurPort].m_psBaoHu->PiPtr;
|
||||||
|
if( !piptr )
|
||||||
|
return;
|
||||||
|
|
||||||
|
for ( i = 0; (i < ItemNumOfPage) && (idx < SioParam[CurPort].m_psBaoHu->PiNum); i++ )
|
||||||
|
{
|
||||||
|
for ( j = 0; j < itemofline; j++ )
|
||||||
|
{
|
||||||
|
if((idx + j) >= SioParam[CurPort].m_psBaoHu->PiNum)
|
||||||
|
break;
|
||||||
|
|
||||||
|
sprintf( szbuf, "%03d", idx + j + 1 );
|
||||||
|
rc.left = pos[j*3+0];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"序号" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
|
||||||
|
sprintf( szbuf, "电度%03d", idx + j + 1);
|
||||||
|
rc.left = pos[j*3+1];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点名称" );
|
||||||
|
rc.right = rc.left + xWd;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
|
||||||
|
sprintf( szbuf, "0x%08x", piptr[idx+j].RawValue );
|
||||||
|
rc.left = pos[j*3+2];
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"测点原值" );
|
||||||
|
// wen 2004.11.19 显示的长度是名称的1.5倍
|
||||||
|
//rc.right = rc.left + xWd;
|
||||||
|
//DrawText( hdc, szbuf, strlen(szbuf), &rc, DT_CENTER );
|
||||||
|
rc.right = rc.left + xWd/4*6;
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
}
|
||||||
|
|
||||||
|
idx += itemofline;
|
||||||
|
rc.top += lineh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WatchDataDisp( HDC hdc )
|
||||||
|
{
|
||||||
|
UINT xWd, yHg, lineh;
|
||||||
|
int i, j, total, idx, type;
|
||||||
|
char szbuf[256];
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
|
GetClientRect( hMainWnd, &rc );
|
||||||
|
|
||||||
|
CaculateWH( hdc, &xWd, &yHg, (char*)"行距" );
|
||||||
|
lineh = yHg + 5;
|
||||||
|
|
||||||
|
rc.top = 10;
|
||||||
|
|
||||||
|
if ( DevParam[iCurDevIdx].WatchDispLine.LineCnt == 0 )
|
||||||
|
{
|
||||||
|
sprintf( szbuf, "当前没有数据....." );
|
||||||
|
DrawText(hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemNumOfPage = (rc.bottom - rc.top) / lineh;
|
||||||
|
|
||||||
|
total = DevParam[iCurDevIdx].WatchDispLine.LineCnt;
|
||||||
|
if ( RealDataDispFlag )
|
||||||
|
ListIndex = 100000;
|
||||||
|
|
||||||
|
// 调整显示的起始位置
|
||||||
|
if ( total < ItemNumOfPage )
|
||||||
|
ListIndex = 0;
|
||||||
|
if ( (ListIndex + ItemNumOfPage) > total )
|
||||||
|
ListIndex = total - ItemNumOfPage;
|
||||||
|
if ( ListIndex < 0 )
|
||||||
|
ListIndex = 0;
|
||||||
|
|
||||||
|
// 寻找数据起始位置
|
||||||
|
idx = DevParam[iCurDevIdx].WatchDispLine.Rear - total;
|
||||||
|
if ( idx < 0 )
|
||||||
|
idx += MAX_DISP_LINE;
|
||||||
|
|
||||||
|
// 显示起始位置
|
||||||
|
idx += ListIndex;
|
||||||
|
|
||||||
|
for ( i = 0; i < min(ItemNumOfPage, total); i++ )
|
||||||
|
{
|
||||||
|
j = (idx + i) % MAX_DISP_LINE;
|
||||||
|
|
||||||
|
type = DevParam[iCurDevIdx].WatchDispLine.Line[j][0];
|
||||||
|
if ( type == 'R' ) // 接收数据
|
||||||
|
SetTextColor( hdc, dwColorVal[BLUE] );
|
||||||
|
else
|
||||||
|
SetTextColor( hdc, dwColorVal[MAGENTA] );
|
||||||
|
|
||||||
|
strcpy( szbuf, (char*)&DevParam[iCurDevIdx].WatchDispLine.Line[j][1] );
|
||||||
|
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szbuf, strlen(szbuf), &rc, DT_LEFT );
|
||||||
|
|
||||||
|
rc.top += lineh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************
|
||||||
|
//* 新字体函数? *
|
||||||
|
//***************************************************************
|
||||||
|
HFONT NewFont( int nFSize )
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
WCHAR typeface[32] = (WCHAR *)"宋体";
|
||||||
|
|
||||||
|
LOGFONT LogFont = { 0, 0, 0, 0,
|
||||||
|
400,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
DEFAULT_CHARSET,
|
||||||
|
//OUT_STROKE_PRECIS,
|
||||||
|
OUT_STRING_PRECIS,
|
||||||
|
CLIP_DEFAULT_PRECIS,
|
||||||
|
PROOF_QUALITY,
|
||||||
|
DEFAULT_PITCH,
|
||||||
|
typeface
|
||||||
|
//"新宋体"
|
||||||
|
//"黑体"
|
||||||
|
//"隶书"
|
||||||
|
//"幼圆"
|
||||||
|
//"仿宋_GB2312"
|
||||||
|
};
|
||||||
|
|
||||||
|
LogFont.lfWidth = (LONG)((float)nFSize*.618);
|
||||||
|
|
||||||
|
LogFont.lfHeight = (LONG)nFSize;
|
||||||
|
|
||||||
|
strcpy( LogFont.lfFaceName, "Lee宋体" );
|
||||||
|
return( CreateFontIndirect( &LogFont ));*/
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DataDisp( HWND hWnd )
|
||||||
|
{
|
||||||
|
HDC hdc;
|
||||||
|
HFONT hFont;
|
||||||
|
int nFSize;
|
||||||
|
|
||||||
|
hdc = GetDC( hWnd );
|
||||||
|
|
||||||
|
if( WATCH_DATA_DISP != DispType)
|
||||||
|
nFSize = 16;
|
||||||
|
else
|
||||||
|
nFSize = 12;
|
||||||
|
|
||||||
|
hFont = (HFONT)SelectObject( hdc, NewFont( nFSize ) );
|
||||||
|
|
||||||
|
if( !IsBaoHuPtr(CurPort) )
|
||||||
|
return;
|
||||||
|
|
||||||
|
switch( DispType )
|
||||||
|
{
|
||||||
|
case AI_DATA_DISP:
|
||||||
|
if(PROV_PROTOCOL != SioParam[CurPort].m_psBaoHu->PortType)
|
||||||
|
RealAiDataDisp( hdc );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DI_DATA_DISP:
|
||||||
|
if(PROV_PROTOCOL != SioParam[CurPort].m_psBaoHu->PortType)
|
||||||
|
RealDiDataDisp( hdc );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PI_DATA_DISP:
|
||||||
|
if(PROV_PROTOCOL != SioParam[CurPort].m_psBaoHu->PortType)
|
||||||
|
RealPiDataDisp( hdc );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WATCH_DATA_DISP:
|
||||||
|
WatchDataDisp( hdc );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteObject( SelectObject(hdc, hFont) );
|
||||||
|
|
||||||
|
ReleaseDC( hWnd, hdc );
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************
|
||||||
|
//* 计算字串显示宽度和高度 *
|
||||||
|
//***************************************************************
|
||||||
|
void CaculateWH( HDC hdc, UINT *xWidth, UINT *yHeight, char *szStr )
|
||||||
|
{
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
|
DrawText( hdc, (CONST WCHAR*)szStr, strlen(szStr), &rc, DT_CALCRECT );
|
||||||
|
*xWidth = rc.right - rc.left;
|
||||||
|
*yHeight = rc.bottom - rc.top;
|
||||||
|
}
|
||||||
|
|
||||||
|
//****************************************************************
|
||||||
|
//* 显示数据上页? *
|
||||||
|
//****************************************************************
|
||||||
|
void PageUp( void )
|
||||||
|
{
|
||||||
|
ListIndex -= ItemNumOfPage;
|
||||||
|
if ( ListIndex < 0 )
|
||||||
|
ListIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************
|
||||||
|
//* 显示数据下页? *
|
||||||
|
//***************************************************************
|
||||||
|
void PageDown( void )
|
||||||
|
{
|
||||||
|
ListIndex += ItemNumOfPage;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************
|
||||||
|
//* 显示端口最后一页数据 *
|
||||||
|
//***************************************************************
|
||||||
|
void PageEnd( void )
|
||||||
|
{
|
||||||
|
ListIndex = 100000;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************
|
||||||
|
//* 显示端口最前一页数据? *
|
||||||
|
//***************************************************************
|
||||||
|
void PageHome( void )
|
||||||
|
{
|
||||||
|
ListIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LineUp( void )
|
||||||
|
{
|
||||||
|
ListIndex--;
|
||||||
|
|
||||||
|
if ( ListIndex < 0 )
|
||||||
|
ListIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************
|
||||||
|
//* 显示下移一行? *
|
||||||
|
//***************************************************************
|
||||||
|
void LineDown( void )
|
||||||
|
{
|
||||||
|
ListIndex++;
|
||||||
|
}
|
||||||
|
|
||||||
|
int GetCurPort()
|
||||||
|
{
|
||||||
|
return CurPort;
|
||||||
|
}
|
||||||
|
|
||||||
|
int IsRealDataDisp()
|
||||||
|
{
|
||||||
|
return RealDataDispFlag;
|
||||||
|
}
|
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#ifndef __DISPLAY_H_ICL__
|
||||||
|
#define __DISPLAY_H_ICL__
|
||||||
|
|
||||||
|
#define WHITE 0
|
||||||
|
#define DARKGRAY 1
|
||||||
|
#define RED 2
|
||||||
|
#define YELLOW 3
|
||||||
|
#define GREEN 4
|
||||||
|
#define CYAN 5
|
||||||
|
#define BLUE 6
|
||||||
|
#define MAGENTA 7
|
||||||
|
#define GRAY 8
|
||||||
|
#define BLACK 9
|
||||||
|
#define BROWN 10
|
||||||
|
#define DYELLOW 11
|
||||||
|
#define DGREEN 12
|
||||||
|
#define DCYAN 13
|
||||||
|
#define DBLUE 14
|
||||||
|
#define DMAGENTA 15
|
||||||
|
|
||||||
|
#define AI_DATA_DISP 4
|
||||||
|
#define DI_DATA_DISP 5
|
||||||
|
#define PI_DATA_DISP 6
|
||||||
|
|
||||||
|
#define WATCH_DATA_DISP 8
|
||||||
|
|
||||||
|
void RealAiDataDisp( HDC hdc );
|
||||||
|
void RealDiDataDisp( HDC hdc );
|
||||||
|
void RealPiDataDisp( HDC hdc );
|
||||||
|
void RealStatInfoDisp( HDC hdc );
|
||||||
|
void WatchDataDisp( HDC hdc );
|
||||||
|
|
||||||
|
int CheckDev( HDC hdc );
|
||||||
|
void DataDisp( HWND hWnd );
|
||||||
|
|
||||||
|
HFONT NewFont( int nFSize );
|
||||||
|
|
||||||
|
void CaculateWH( HDC hdc, UINT *xWidth, UINT *yHeight, char *szStr );
|
||||||
|
|
||||||
|
void PageUp( void );
|
||||||
|
void PageDown( void );
|
||||||
|
void PageHome( void );
|
||||||
|
void PageEnd( void );
|
||||||
|
void LineUp( void );
|
||||||
|
void LineDown( void );
|
||||||
|
|
||||||
|
// wen 2004.10.25
|
||||||
|
int GetCurPort();
|
||||||
|
int IsRealDataDisp();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,11 @@
|
|||||||
|
portconfig.ini
|
||||||
|
config.ini
|
||||||
|
inf/scada.csv
|
||||||
|
inf/port103ser.csv
|
||||||
|
inf/port103sie.csv
|
||||||
|
inf/top9xxx_h.csv
|
||||||
|
dat/top9xxx_h.dat
|
||||||
|
dat/103-RCS925A.dat
|
||||||
|
dat/103-7SJ682.dat
|
||||||
|
dat/mach300.dat
|
||||||
|
inf/mach300.csv
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,56 @@
|
|||||||
|
/*----------------------------------------------------------
|
||||||
|
平台无关的INI文件读写函数 V1.65
|
||||||
|
|
||||||
|
张磊 2002.10.3
|
||||||
|
----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef INI_FILE_H
|
||||||
|
#define INI_FILE_H
|
||||||
|
|
||||||
|
#include "platform_def.h"
|
||||||
|
|
||||||
|
#define MAX_LINE_BUF_LENGTH 2048 //最大行缓冲区长度
|
||||||
|
|
||||||
|
#define FILE_OPEN_ERROR -1 //文件打开错误
|
||||||
|
#define SECTION_NOT_FOUND -2 //段没有找到
|
||||||
|
#define KEY_NOT_FOUND -3 //键没有找到
|
||||||
|
|
||||||
|
//工具函数
|
||||||
|
void StrTrimLeft(char* szBuf);
|
||||||
|
void StrTrimRight(char* szBuf);
|
||||||
|
void StrTrimAll(char* szBuf);
|
||||||
|
long GetFileSize(char* lpszFileName);
|
||||||
|
int ReadLineFromFile(FILE* IniFile, char* lpszLineBuf, int iLen); //从指定文件中读取一行内容
|
||||||
|
bool IfBeforeHasRet(FILE* pFile); //辅助函数,判断当前文件位置前面是否是换行符号
|
||||||
|
|
||||||
|
//读配置文件中指定段下指定键的值(字符串)
|
||||||
|
int QGetPrivateProfileString(
|
||||||
|
char* lpszSectionName, //段名
|
||||||
|
char* lpszKeyName, //键名
|
||||||
|
char* lpszDefault, //缺省字符串
|
||||||
|
char* lpszReturnedString, //结果字符串
|
||||||
|
u_32 nSize, //结果字符串长度
|
||||||
|
char* lpszFileName, //ini文件名
|
||||||
|
char* lpszRemarkInLineStr = (char*)";", //行内注释符
|
||||||
|
char chContinueLineChar = '\\' //续行符号
|
||||||
|
);
|
||||||
|
|
||||||
|
//读配置文件中指定段下指定键的值(整数)
|
||||||
|
int QGetPrivateProfileInt(
|
||||||
|
char* lpszSectionName, //段名
|
||||||
|
char* lpszKeyName, //键名
|
||||||
|
int nDefault, //缺省值
|
||||||
|
char* lpszFileName, //ini文件名
|
||||||
|
char* lpszRemarkInLineStr = (char*)";", //行内注释符
|
||||||
|
char chContinueLineChar = '\\' //续行符号
|
||||||
|
);
|
||||||
|
|
||||||
|
//向配置文件写入指定段下指定键的值(字符串)
|
||||||
|
int QWritePrivateProfileString(
|
||||||
|
char* lpszSectionName, //段名
|
||||||
|
char* lpszKeyName, //键名
|
||||||
|
char* lpszString, //要写入的字符串
|
||||||
|
char* lpszFileName //INI文件名
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
@ -0,0 +1,103 @@
|
|||||||
|
/************************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003-2004
|
||||||
|
* Shenzhen SCADA Control Technology Co., Ltd.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* 实现双链表
|
||||||
|
*
|
||||||
|
* 创建日期: 2004/01/10
|
||||||
|
*
|
||||||
|
* $Id: list_entry.cpp,v 1.1.1.1 2006/07/05 07:31:43 jehu Exp $
|
||||||
|
*
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#include "list_entry.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 双向链表的操纵例程函数的实现
|
||||||
|
*/
|
||||||
|
void Initialize_list_head ( list_entry_t * plist_head )
|
||||||
|
{
|
||||||
|
plist_head->flink = plist_head->blink = plist_head;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 判断双向链表是否为空
|
||||||
|
*
|
||||||
|
* \retval 0 空链表
|
||||||
|
* \retval 非0 空链表
|
||||||
|
*/
|
||||||
|
int is_list_empty ( list_entry_t * plist_head )
|
||||||
|
{
|
||||||
|
return (int)(plist_head->flink == plist_head);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 从双向链表的头部移取一个链表元素--与链表脱离链接关系
|
||||||
|
*/
|
||||||
|
list_entry_t * remove_head_list ( list_entry_t * plist_head )
|
||||||
|
{
|
||||||
|
list_entry_t * pHeadEntry = plist_head->flink;
|
||||||
|
remove_entry_list ( plist_head->flink );
|
||||||
|
return pHeadEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 从双向链表的尾部移取一个链表元素--与链表脱离链接关系
|
||||||
|
*/
|
||||||
|
list_entry_t * remove_tail_list ( list_entry_t * plist_head )
|
||||||
|
{
|
||||||
|
list_entry_t * pHeadEntry = plist_head->blink;
|
||||||
|
remove_entry_list ( plist_head->blink );
|
||||||
|
return pHeadEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 从双向链表中移取制定的链表元素--与链表脱离链接关系
|
||||||
|
*/
|
||||||
|
void remove_entry_list ( list_entry_t * pEntry )
|
||||||
|
{
|
||||||
|
list_entry_t * _EX_Blink = (list_entry_t *)0;
|
||||||
|
list_entry_t * _EX_Flink = (list_entry_t *)0;
|
||||||
|
|
||||||
|
_EX_Flink = pEntry->flink;
|
||||||
|
_EX_Blink = pEntry->blink;
|
||||||
|
_EX_Blink->flink = _EX_Flink;
|
||||||
|
_EX_Flink->blink = _EX_Blink;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 将一个链表元素从尾部插入到双向链表中
|
||||||
|
*/
|
||||||
|
void insert_tail_list ( list_entry_t * plist_head, list_entry_t * pEntry )
|
||||||
|
{
|
||||||
|
list_entry_t * _EX_Blink = (list_entry_t *)0;
|
||||||
|
list_entry_t * _EX_ListHead = (list_entry_t *)0;
|
||||||
|
|
||||||
|
_EX_ListHead = plist_head;
|
||||||
|
_EX_Blink = _EX_ListHead->blink;
|
||||||
|
pEntry->flink = _EX_ListHead;
|
||||||
|
pEntry->blink = _EX_Blink;
|
||||||
|
_EX_Blink->flink = pEntry;
|
||||||
|
_EX_ListHead->blink = pEntry;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 将一个链表元素从尾部插入到双向链表中
|
||||||
|
*/
|
||||||
|
void insert_head_list ( list_entry_t * plist_head, list_entry_t * pEntry)
|
||||||
|
{
|
||||||
|
list_entry_t * _EX_Flink = (list_entry_t *)0;
|
||||||
|
list_entry_t * _EX_ListHead = (list_entry_t *)0;
|
||||||
|
|
||||||
|
_EX_ListHead = plist_head;
|
||||||
|
_EX_Flink = _EX_ListHead->flink;
|
||||||
|
pEntry->flink = _EX_Flink;
|
||||||
|
pEntry->blink = _EX_ListHead;
|
||||||
|
_EX_Flink->blink = pEntry;
|
||||||
|
_EX_ListHead->flink = pEntry;
|
||||||
|
}
|
@ -0,0 +1,107 @@
|
|||||||
|
/************************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 2003-2004
|
||||||
|
* Shenzhen SCADA Control Technology Co., Ltd.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* 双链表
|
||||||
|
*
|
||||||
|
* 创建日期: 2004/01/10
|
||||||
|
*
|
||||||
|
* 摘自Windoes $(DDKPATH)/inc/ntdef.h和$(DDKPATH)/inc/ddk/ntddk.h
|
||||||
|
*
|
||||||
|
* $Id: list_entry.h,v 1.1.1.1 2006/07/05 07:31:43 jehu Exp $
|
||||||
|
*
|
||||||
|
***********************************************************************/
|
||||||
|
|
||||||
|
#ifndef __LIST_ENTRY_H__SKLJFALKJZLJVADFHOPSHVPZIOXJHCVOIPADFDFNXVCQWEDAH
|
||||||
|
#define __LIST_ENTRY_H__SKLJFALKJZLJVADFHOPSHVPZIOXJHCVOIPADFDFNXVCQWEDAH
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 双向链表结构定义, 可以用链表的头或者链表成员.
|
||||||
|
*/
|
||||||
|
typedef struct tag_list_entry_t {
|
||||||
|
|
||||||
|
struct tag_list_entry_t * flink; /*!< 指向链表元素的前驱元素 */
|
||||||
|
|
||||||
|
struct tag_list_entry_t * blink; /*!< 指向链表元素的后继元素 */
|
||||||
|
|
||||||
|
} list_entry_t;
|
||||||
|
|
||||||
|
typedef list_entry_t * plist_entry_t;
|
||||||
|
typedef list_entry_t ** pplist_entry_t;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 下面是双向链表的操纵例程函数
|
||||||
|
*
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | Initialize_list_head | 初始化链表头中的list_entry_t结构 |
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | is_list_empty | 判断链表是否为空 |
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | remove_head_list | 从双向链表的头部移取一个链表元素--与链表脱离链接关系|
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | remove_tail_list | 从双向链表的尾部移取一个链表元素--与链表脱离链接关系|
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | remove_entry_list | 从双向链表中移取指定的链表元素--与链表脱离链接关系 |
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | insert_tail_list | 在起始处插入一个元素 |
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | insert_head_list | 在结尾处插入一个元素 |
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
* | CONTAINING_RECORD | 由链表元素指针反演出链表元素所包含的元素指针 |
|
||||||
|
* +---------------------------+-----------------------------------------------------+
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 由链表元素指针反演出链表元素所包含的元素指针
|
||||||
|
*/
|
||||||
|
#ifdef CONTAINING_RECORD
|
||||||
|
#undef CONTAINING_RECORD
|
||||||
|
#endif
|
||||||
|
#define CONTAINING_RECORD(_addr, _type, _field) ((_type *)((char *)(_addr) - (char *)(&((_type *)0)->_field)))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 初始化双向链表
|
||||||
|
*
|
||||||
|
* \param plist_head 指向链表的头
|
||||||
|
*/
|
||||||
|
void Initialize_list_head ( list_entry_t * plist_head );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 判断双向链表是否为空
|
||||||
|
*
|
||||||
|
* \retval 0 空链表
|
||||||
|
* \retval 非0 空链表
|
||||||
|
*/
|
||||||
|
int is_list_empty ( list_entry_t * plist_head );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 从双向链表的头部移取一个链表元素--与链表脱离链接关系
|
||||||
|
*/
|
||||||
|
list_entry_t * remove_head_list ( list_entry_t * plist_head );
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 从双向链表的尾部移取一个链表元素--与链表脱离链接关系
|
||||||
|
*/
|
||||||
|
list_entry_t * remove_tail_list ( list_entry_t * plist_head );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 从双向链表中移取制定的链表元素--与链表脱离链接关系
|
||||||
|
*/
|
||||||
|
void remove_entry_list ( list_entry_t * pEntry);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 将一个链表元素从尾部插入到双向链表中
|
||||||
|
*/
|
||||||
|
void insert_tail_list ( list_entry_t * plist_head, list_entry_t * pEntry );
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 将一个链表元素从头部插入到双向链表中
|
||||||
|
*/
|
||||||
|
void insert_head_list ( list_entry_t * plist_head, list_entry_t * pEntry);
|
||||||
|
|
||||||
|
#endif /* __LIST_ENTRY_H__SKLJFALKJZLJVADFHOPSHVPZIOXJHCVOIPADFDFNXVCQWEDAH */
|
@ -0,0 +1,36 @@
|
|||||||
|
/*****************************************************************************
|
||||||
|
* FileName : netport.h *
|
||||||
|
* Programmer : Li Liangchu *
|
||||||
|
* Writen at : 2004.07.21 *
|
||||||
|
* Version : *
|
||||||
|
* Description: base on net comm sports driver *
|
||||||
|
* Last modify: 2004.07.21 *
|
||||||
|
*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __NET_PORT_H_ICL__
|
||||||
|
#define __NET_PORT_H_ICL__
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
BYTE CreateUdpSock(int *CommSock, DWORD NetPort, DWORD NetCommIpAddr);
|
||||||
|
BYTE CreateTcpServerSock(int *LiSock, DWORD NetPort);
|
||||||
|
BYTE CreateTcpClientSock(int *CommSock, DWORD NetPort, DWORD NetCommIpAddr);
|
||||||
|
// 设置及时知道TCP非优雅的方式断开连接的socket属性
|
||||||
|
//void set_keepalive(int fd, int keep_alive, int keep_idle, int keep_interval, int keep_count);
|
||||||
|
|
||||||
|
void OpenNetPort( int commid);
|
||||||
|
void CloseNetPort( int commid );
|
||||||
|
void CloseNetListenPort( int commid );
|
||||||
|
|
||||||
|
void UdpRecv(int commid, int fds, u_long ipaddr);
|
||||||
|
void UdpSend(int commid);
|
||||||
|
|
||||||
|
BOOL TcpRecv(int commid, int fds, u_long ipaddr);
|
||||||
|
void TcpSend(int commid);
|
||||||
|
// 检查连接服务器端口的客户端ip地址配置的端口
|
||||||
|
void TcpAccept(int commid, int lisfds);
|
||||||
|
|
||||||
|
void PollAllPort(void);
|
||||||
|
#endif
|
||||||
|
|
@ -0,0 +1,246 @@
|
|||||||
|
[Port1]
|
||||||
|
Protocol=buban103
|
||||||
|
CommMode=9600,e,8,1
|
||||||
|
WorkMode=RS-485
|
||||||
|
HandshakeMode=NO_HANDSHAKE
|
||||||
|
XonXoff=0000
|
||||||
|
AiNum=128
|
||||||
|
DiNum=256
|
||||||
|
PiNum=0
|
||||||
|
Retry=1
|
||||||
|
RetryTime=3
|
||||||
|
WaitTime=0
|
||||||
|
ykyttimeout=20
|
||||||
|
PortType=0
|
||||||
|
CheckTime=NO
|
||||||
|
#@@规约配置
|
||||||
|
时间同步过程=60.00
|
||||||
|
总查询过程=60.00
|
||||||
|
电度量查询=300.00
|
||||||
|
通用分类数据模拟量查询=3.00
|
||||||
|
通用分类数据状态量查询=3.00
|
||||||
|
链路数量=1
|
||||||
|
链路1模板文件名称=port103ser.csv
|
||||||
|
链路2模板文件名称=
|
||||||
|
链路3模板文件名称=
|
||||||
|
链路4模板文件名称=
|
||||||
|
链路5模板文件名称=
|
||||||
|
链路6模板文件名称=
|
||||||
|
上送遥信变位=0
|
||||||
|
#@@测点配置--主站
|
||||||
|
Di2CtrlNo=0
|
||||||
|
[Port2]
|
||||||
|
Protocol = modbus
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-485
|
||||||
|
AiNum = 128
|
||||||
|
DiNum = 256
|
||||||
|
#PiNum = 48
|
||||||
|
# 轮询指令时间配置
|
||||||
|
Retry = 1
|
||||||
|
RetryTime = 1
|
||||||
|
WaitTime = 0
|
||||||
|
# 端口类型(=0, 主站端口; =1, 子站端口)
|
||||||
|
PortType = 0
|
||||||
|
# 时间校正(=no, 不对时(缺省); =up, 上对时; =down, 下对时)
|
||||||
|
CheckTime = no
|
||||||
|
装置数量=1
|
||||||
|
装置状态输入厂站端口号 = 16
|
||||||
|
装置状态输入厂站起始点号 = 3
|
||||||
|
是否屏蔽未配置信息事件 = 0
|
||||||
|
模拟量指令 = 3,0,53
|
||||||
|
开关量指令 = 3,100,4
|
||||||
|
遥控项数=1
|
||||||
|
遥控1配置=1,16,3,0,108,8899,300,110,21930,200,110,43605,0,1,108,8899,300,109,21930,200,109,43605,0
|
||||||
|
Di1CtrlNo = 1
|
||||||
|
寄存器位数 = 16
|
||||||
|
#装置1配置信息文件名称 = mach300
|
||||||
|
装置1线路名称 =
|
||||||
|
装置1寄存器位数=16
|
||||||
|
装置1型号 = mach300
|
||||||
|
装置1地址 = 1
|
||||||
|
#模板文件名称=mach300
|
||||||
|
指令发送序列=dda
|
||||||
|
SOE状态即遥信状态=1
|
||||||
|
[Port3]
|
||||||
|
Protocol=buban103
|
||||||
|
CommMode=9600,e,8,1
|
||||||
|
WorkMode=RS-485
|
||||||
|
HandshakeMode=NO_HANDSHAKE
|
||||||
|
XonXoff=0000
|
||||||
|
AiNum=128
|
||||||
|
DiNum=256
|
||||||
|
PiNum=0
|
||||||
|
Retry=1
|
||||||
|
RetryTime=3
|
||||||
|
WaitTime=0
|
||||||
|
ykyttimeout=20
|
||||||
|
PortType=0
|
||||||
|
CheckTime=NO
|
||||||
|
#@@规约配置
|
||||||
|
时间同步过程=0
|
||||||
|
总查询过程=60.00
|
||||||
|
电度量查询=300.00
|
||||||
|
通用分类数据模拟量查询=3.00
|
||||||
|
通用分类数据状态量查询=3.00
|
||||||
|
链路数量=1
|
||||||
|
链路1模板文件名称=port103sie.csv
|
||||||
|
链路2模板文件名称=
|
||||||
|
链路3模板文件名称=
|
||||||
|
链路4模板文件名称=
|
||||||
|
链路5模板文件名称=
|
||||||
|
链路6模板文件名称=
|
||||||
|
上送遥信变位=0
|
||||||
|
#@@测点配置--主站
|
||||||
|
Di1CtrlNo=0
|
||||||
|
Di2CtrlNo=1
|
||||||
|
[Port4]
|
||||||
|
Protocol=buban103
|
||||||
|
CommMode=9600,e,8,1
|
||||||
|
WorkMode=RS-485
|
||||||
|
HandshakeMode=NO_HANDSHAKE
|
||||||
|
XonXoff=0000
|
||||||
|
AiNum=128
|
||||||
|
DiNum=256
|
||||||
|
PiNum=0
|
||||||
|
Retry=1
|
||||||
|
RetryTime=3
|
||||||
|
WaitTime=0
|
||||||
|
ykyttimeout=20
|
||||||
|
PortType=0
|
||||||
|
CheckTime=NO
|
||||||
|
装置数量 = 1
|
||||||
|
请求系统运行状态 = 10
|
||||||
|
请求交流配电信息 = 10
|
||||||
|
请求电池检测单元信息 = 10
|
||||||
|
请求馈线检测单元信息 = 10
|
||||||
|
请求绝缘监察单元信息 = 10
|
||||||
|
请求整流模块信息 = 10
|
||||||
|
请求参数设定信息 = 0
|
||||||
|
装置1地址 = 1
|
||||||
|
装置1电池数量 = 52
|
||||||
|
装置1整流模块数量 = 4
|
||||||
|
装置1名称 = gjb
|
||||||
|
[Port5]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port6]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port7]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port8]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port9]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port10]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port11]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port12]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port13]
|
||||||
|
Protocol=bypass
|
||||||
|
CommMode=9600,n,8,1
|
||||||
|
WorkMode=RS-232
|
||||||
|
[Port14]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port15]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port16]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port17]
|
||||||
|
Protocol=scadaprotect
|
||||||
|
NetCommMode=TCP,Server
|
||||||
|
NetPort=8000
|
||||||
|
NetCommAddr=127.0.0.1
|
||||||
|
AiNum=0
|
||||||
|
DiNum=0
|
||||||
|
PiNum=0
|
||||||
|
Retry=1
|
||||||
|
RetryTime=3
|
||||||
|
WaitTime=0
|
||||||
|
ykyttimeout=20
|
||||||
|
PortType=1
|
||||||
|
CheckTime=NO
|
||||||
|
#@@规约配置
|
||||||
|
模板文件名称=scada.csv
|
||||||
|
[Port18]
|
||||||
|
Protocol=buban104
|
||||||
|
NetCommMode=TCP,Server
|
||||||
|
NetPort=2404
|
||||||
|
NetCommAddr=192.168.111.168
|
||||||
|
AiNum=128
|
||||||
|
DiNum=256
|
||||||
|
PiNum=64
|
||||||
|
Retry=1
|
||||||
|
RetryTime=3
|
||||||
|
WaitTime=0
|
||||||
|
ykyttimeout=20
|
||||||
|
PortType=1
|
||||||
|
CheckTime=UP
|
||||||
|
#@@规约配置
|
||||||
|
站地址=1
|
||||||
|
总召唤电度数据=120.00
|
||||||
|
召唤初始化数据=300.00
|
||||||
|
帧序应答=20.00
|
||||||
|
超时时间=3.00
|
||||||
|
转发返校超时时间=0.00
|
||||||
|
转发是否要求应答=0
|
||||||
|
超时发送测试帧=0
|
||||||
|
遥控方式=0
|
||||||
|
遥测信息体起始地址=1793
|
||||||
|
遥信信息体起始地址=1
|
||||||
|
遥脉信息体起始地址=3073
|
||||||
|
遥控信息体起始地址=2817
|
||||||
|
版本号=1
|
||||||
|
#@@测点配置--从站
|
||||||
|
ProvAi1=1a1,1
|
||||||
|
ProvAi1Inc=18
|
||||||
|
ProvAi20=2a1,1
|
||||||
|
ProvAi21=2a2,1
|
||||||
|
ProvAi22=2a3,1
|
||||||
|
ProvAi23=2a5,1
|
||||||
|
ProvAi24=2a6,1
|
||||||
|
ProvAi25=2a7,1
|
||||||
|
ProvAi26=2a9,1
|
||||||
|
ProvAi27=2a10,1
|
||||||
|
ProvAi28=2a11,1
|
||||||
|
ProvAi29=2a16,1
|
||||||
|
ProvAi30=2a17,1
|
||||||
|
ProvAi31=2a1,1
|
||||||
|
ProvAi32=3a1,1
|
||||||
|
ProvAi32Inc=16
|
||||||
|
ProvDi1=2d1,1
|
||||||
|
ProvDi2=2d17
|
||||||
|
ProvDi3=2d33
|
||||||
|
ProvDi4=2d49
|
||||||
|
[Port19]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
[Port20]
|
||||||
|
Protocol = bypass
|
||||||
|
CommMode = 9600,n,8,1
|
||||||
|
WorkMode = RS-232
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,372 @@
|
|||||||
|
/*************************************************************************************
|
||||||
|
*
|
||||||
|
* Copyright (C) 1999-2000 SCADA Technology Control Co., Ltd. All rights reserved.
|
||||||
|
*
|
||||||
|
* 作者: 杨小波
|
||||||
|
*
|
||||||
|
* 日期: 2001/08/07
|
||||||
|
*
|
||||||
|
* 说明:
|
||||||
|
* 最基本的类型定义.
|
||||||
|
* 1: 基本类型的长度(字节单位)
|
||||||
|
* 2: 定义可移植类型
|
||||||
|
*
|
||||||
|
*************************************************************************************/
|
||||||
|
|
||||||
|
#ifndef __TYPEDEF_H__DFJGLWREPUEPISXVCMAFGLJHQEWPYRPEOAJLKGZNCNALDHFPQEWUPOQRJSJHGAQ
|
||||||
|
#define __TYPEDEF_H__DFJGLWREPUEPISXVCMAFGLJHQEWPYRPEOAJLKGZNCNALDHFPQEWUPOQRJSJHGAQ
|
||||||
|
/*!
|
||||||
|
* \if developer_doc
|
||||||
|
* \file
|
||||||
|
*
|
||||||
|
* \brief 最基本的类型定义
|
||||||
|
*
|
||||||
|
* id: $Id: typedef.h,v 1.2 2006/08/04 03:37:33 zhuzhenhua Exp $
|
||||||
|
*
|
||||||
|
* \author 杨小波 prcharold@sina.com.cn develop1@szscada.com
|
||||||
|
* \endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 定义最基本的类型, 这些类型可以在不同的操作系统中保持字节长度不变,
|
||||||
|
* 便于在不同的操作系统环境中, PGC系列软件之间交换数据和文件
|
||||||
|
*
|
||||||
|
* 单字节数据类型 //(SIZE_OF_CHAR = sizeof(char))
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define SIZE_OF_CHAR 1
|
||||||
|
#if SIZE_OF_CHAR == 1
|
||||||
|
typedef char pgcchar;
|
||||||
|
typedef char pgc8;
|
||||||
|
typedef signed char int8;
|
||||||
|
typedef signed char i_8;
|
||||||
|
typedef unsigned char u_char;
|
||||||
|
typedef unsigned char pgcu_char;
|
||||||
|
typedef unsigned char pgcbyte;
|
||||||
|
typedef unsigned char PGCBYTE;
|
||||||
|
typedef unsigned char pgcu8;
|
||||||
|
typedef unsigned char u_8;
|
||||||
|
typedef unsigned char BYTE;
|
||||||
|
#else
|
||||||
|
#error "Please choose a 1 byte data type to redefine pgcchar."
|
||||||
|
#endif /* SIZE_OF_CHAR == 1 */
|
||||||
|
|
||||||
|
|
||||||
|
#define SIZE_OF_SHORT 2
|
||||||
|
/*!
|
||||||
|
* 双字节 //(SIZE_OF_SHORT = sizeof(short))
|
||||||
|
*/
|
||||||
|
#if SIZE_OF_SHORT == 2
|
||||||
|
typedef short pgc16;
|
||||||
|
typedef short int16;
|
||||||
|
typedef short i_16;
|
||||||
|
typedef unsigned short pgcu16;
|
||||||
|
typedef unsigned short pgcword;
|
||||||
|
typedef unsigned short PGCWORD;
|
||||||
|
typedef unsigned short u_16;
|
||||||
|
typedef unsigned short u_short;
|
||||||
|
typedef unsigned short WORD;
|
||||||
|
#else
|
||||||
|
#error "Please choose a 2 byte data type to redefine pgc16."
|
||||||
|
#endif //SIZE_OF_SHORT == 2
|
||||||
|
|
||||||
|
#define SIZE_OF_LONG 4
|
||||||
|
#define SIZE_OF_INT 4
|
||||||
|
/*!
|
||||||
|
* 双字节 (SIZE_OF_LONG = sizeof(long))
|
||||||
|
*/
|
||||||
|
#if SIZE_OF_LONG == 4 && SIZE_OF_INT == 4
|
||||||
|
typedef int pgc32;
|
||||||
|
typedef int int32;
|
||||||
|
typedef unsigned int pgcu32;
|
||||||
|
typedef unsigned int pgcdword;
|
||||||
|
typedef unsigned int PGCDWORD;
|
||||||
|
typedef unsigned int u32;
|
||||||
|
/*#if OS_WINDOWS
|
||||||
|
typedef unsigned int DWORD;
|
||||||
|
#endif //OS_WINDOWS*/
|
||||||
|
#elif SIZE_OF_LONG == 4
|
||||||
|
typedef long pgc32;
|
||||||
|
typedef long int32;
|
||||||
|
typedef long i_32;
|
||||||
|
typedef unsigned long pgcu32;
|
||||||
|
typedef unsigned long pgcdword;
|
||||||
|
typedef unsigned long PGCDWORD;
|
||||||
|
typedef unsigned long u_32;
|
||||||
|
typedef unsigned long DWORD;
|
||||||
|
#elif SIZE_OF_INT == 4 //(SIZE_OF_INT = sizeof(ing))
|
||||||
|
#ifndef _INTEGER_32BIT
|
||||||
|
#define _INTEGER_32BIT
|
||||||
|
typedef int pgc32;
|
||||||
|
typedef int int32;
|
||||||
|
typedef int i_32;
|
||||||
|
typedef unsigned int pgcu32;
|
||||||
|
typedef unsigned int pgcdword;
|
||||||
|
typedef unsigned int PGCDWORD;
|
||||||
|
typedef unsigned int u_32;
|
||||||
|
typedef unsigned int DWORD;
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
#error "Please choose a 4 byte data type to redefine pgc32."
|
||||||
|
#endif //SIZE_OF_LONG == 4 and SIZE_OF_INT == 4
|
||||||
|
|
||||||
|
#define SIZE_OF_LONG 8
|
||||||
|
/*!
|
||||||
|
* 8字节 (SIZE_OF_LONG == sizeof(long))
|
||||||
|
*/
|
||||||
|
#if SIZE_OF_LONG == 8
|
||||||
|
typedef long pgc64;
|
||||||
|
typedef long int64;
|
||||||
|
typedef long i_64;
|
||||||
|
typedef unsigned long pgcu64;
|
||||||
|
typedef unsigned long pgcddword;
|
||||||
|
typedef unsigned long PGCDDWORD;
|
||||||
|
typedef unsigned long u_64;
|
||||||
|
typedef unsigned long DDWORD;
|
||||||
|
#elif OS_WINDOWS
|
||||||
|
typedef __int64 pgc64;
|
||||||
|
typedef __int64 int64;
|
||||||
|
typedef __int64 i_64;
|
||||||
|
typedef unsigned __int64 pgcu64;
|
||||||
|
typedef unsigned __int64 pgcddword;
|
||||||
|
typedef unsigned __int64 PGCDDWORD;
|
||||||
|
typedef unsigned __int64 u_64;
|
||||||
|
typedef unsigned __int64 DDWORD;
|
||||||
|
#else
|
||||||
|
typedef int64_t pgc64;
|
||||||
|
typedef int64_t int64;
|
||||||
|
typedef int64_t i_64;
|
||||||
|
typedef u_int64_t pgcu64;
|
||||||
|
typedef u_int64_t pgcddword;
|
||||||
|
typedef u_int64_t PGCDDWORD;
|
||||||
|
typedef u_int64_t u_64;
|
||||||
|
typedef u_int64_t DDWORD;
|
||||||
|
#endif //SIZE_OF_LONG == 8
|
||||||
|
|
||||||
|
#define SIZE_OF_PTR 4
|
||||||
|
/*!
|
||||||
|
* 指针 (SIZE_OF_PTR == sizeof(void *))
|
||||||
|
*/
|
||||||
|
#if SIZE_OF_PTR == 4
|
||||||
|
typedef pgc32 PGCPTR;
|
||||||
|
typedef pgc32 PTR;
|
||||||
|
typedef pgcu32 PGCUPTR;
|
||||||
|
typedef pgcu32 UPTR;
|
||||||
|
#elif SIZE_OF_PTR == 8
|
||||||
|
typedef pgc64 PGCPTR;
|
||||||
|
typedef pgc64 PTR;
|
||||||
|
typedef pgcu64 PGCUPTR;
|
||||||
|
typedef pgcu64 UPTR;
|
||||||
|
#else
|
||||||
|
#error "Please choose a data type, which size is acturally the size of pointer, to present PGCPTR"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* PGCBOOL自定义类型 -- 表达SCADA布尔量
|
||||||
|
*/
|
||||||
|
//#ifndef __PGCBOOL_DEF__
|
||||||
|
//#define __PGCBOOL_DEF__
|
||||||
|
typedef pgcu8 PGCBOOL;
|
||||||
|
#define PGCTRUE ((PGCBOOL)1)
|
||||||
|
#define PGCFALSE ((PGCBOOL)0)
|
||||||
|
//#endif //__PGCBOOL_DEF__
|
||||||
|
|
||||||
|
//#if OS_WINDOWS
|
||||||
|
//# ifndef key_t
|
||||||
|
typedef int key_t;
|
||||||
|
//# endif
|
||||||
|
//#endif // OS_WINDOWS
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* ipc别名定义.
|
||||||
|
*
|
||||||
|
* 共享内存键值, 共享内存id, 信号量键值, 信号量id, 消息队列键值, 消息队列id
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
typedef key_t shmkey_t, SHMKEY_t; // 共享内存键值
|
||||||
|
typedef int shmid_t, SHMID_t; // 共享内存id
|
||||||
|
|
||||||
|
typedef key_t semkey_t, SEMKEY_t; // 信号量键值
|
||||||
|
typedef int semid_t, SEMID_t; // 信号量id
|
||||||
|
|
||||||
|
typedef key_t msgkey_t, MSGKEY_t; // 消息队列键值
|
||||||
|
typedef int msgid_t, MSGID_t; // 消息队列id
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 无效的共享内存映射地址(-1)
|
||||||
|
*/
|
||||||
|
#define SHM_ADDR_INVALID ((void *)(-1))
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 和windows兼容的布尔类型定义BOOL
|
||||||
|
*/
|
||||||
|
typedef int BOOL;
|
||||||
|
|
||||||
|
|
||||||
|
/*! CAUTIOUS
|
||||||
|
* 如果, 以后站号, 点号类型的数据类型定义发生变化, 则需要修改该行
|
||||||
|
*
|
||||||
|
* 站号, 点号类型定义
|
||||||
|
*/
|
||||||
|
typedef int32 stn_no_t;
|
||||||
|
typedef int32 pnt_no_t;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 历史数据采样类型定义
|
||||||
|
*/
|
||||||
|
typedef i_8 sampling_type_t;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 在TRU64上, pthread_t的长度等于8, 而在linux(intel)上, pthread_t的长度
|
||||||
|
* 等于4, 所以为了兼容, 定义thd_id_t的长度为8个字节, 因此, 在非64位平台
|
||||||
|
* 上, 使用一个结构来代替
|
||||||
|
*
|
||||||
|
* 线程标识符(id)类型定义
|
||||||
|
*/
|
||||||
|
#if defined(OS_LINUX) // unix平台(肯定使用posix线程库)
|
||||||
|
#if SIZE_OF_PTHREAD_T == 8
|
||||||
|
typedef pthread_t thd_id_t;
|
||||||
|
#elif SIZE_OF_PTHREAD_T == 4
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
//! 低32位上定义thd_id
|
||||||
|
pthread_t thd_id;
|
||||||
|
|
||||||
|
//! 高32位保留
|
||||||
|
i_32 reserved;
|
||||||
|
|
||||||
|
} thd_id_t;
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#if SIZE_OF_PTHREAD_T == 8
|
||||||
|
typedef long thd_id_t;
|
||||||
|
#elif SIZE_OF_PTHREAD_T == 4
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
//! 低32位上定义thd_id
|
||||||
|
u_32 thd_id;
|
||||||
|
|
||||||
|
//! 高32位保留
|
||||||
|
i_32 reserved;
|
||||||
|
|
||||||
|
} thd_id_t;
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* 便于移植和修改的数据类型定义.
|
||||||
|
*
|
||||||
|
* 网络套接字类型
|
||||||
|
*/
|
||||||
|
typedef int socket_t, SOCKET_t;
|
||||||
|
|
||||||
|
#define SOCKET_INVALID ((socket_t)-1)
|
||||||
|
|
||||||
|
#if defined(OS_LINUX)
|
||||||
|
#ifndef INVALID_SOCKET
|
||||||
|
#define INVALID_SOCKET (SOCKET_INVALID)
|
||||||
|
#endif //end of INVALID_SOCKET
|
||||||
|
#endif //end of defined(__unix)
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* ip地址定义
|
||||||
|
*/
|
||||||
|
//typedef u_32 ip_addr_t;
|
||||||
|
|
||||||
|
#endif //__TYPEDEF_H__DFJGLWREPUEPISXVCMAFGLJHQEWPYRPEOAJLKGZNCNALDHFPQEWUPOQRJSJHGAQ
|
||||||
|
|
||||||
|
/*************************************************************************************
|
||||||
|
*
|
||||||
|
* $Revision: 1.2 $
|
||||||
|
*
|
||||||
|
* $Date: 2006/08/04 03:37:33 $
|
||||||
|
*
|
||||||
|
* $State: Exp $
|
||||||
|
*
|
||||||
|
* $Log: typedef.h,v $
|
||||||
|
* Revision 1.2 2006/08/04 03:37:33 zhuzhenhua
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.11 2003/09/19 07:55:15 scada
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.10 2003/08/01 06:36:19 scada
|
||||||
|
* 在Win32平台上借用__int64定义64bit的整数
|
||||||
|
*
|
||||||
|
* Revision 1.9 2003/07/01 01:31:01 scada
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.8 2003/06/05 03:56:15 jehu
|
||||||
|
* 将注释修改为符合doxgen工具提取开发文档
|
||||||
|
*
|
||||||
|
* Revision 1.7 2003/01/10 10:38:40 scada
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.6 2003/01/02 03:14:32 scada
|
||||||
|
* trim substitution line
|
||||||
|
*
|
||||||
|
* Revision 1.5 2002/12/04 07:47:36 scada
|
||||||
|
* for NT
|
||||||
|
*
|
||||||
|
* Revision 1.4 2002/10/07 05:37:59 harold
|
||||||
|
* cvs up -d
|
||||||
|
*
|
||||||
|
* Revision 1.3 2002/09/18 09:13:38 harold
|
||||||
|
* revised errors and warning under solaris/CC environment
|
||||||
|
*
|
||||||
|
* Revision 1.2 2002/08/26 02:07:32 harold
|
||||||
|
* 重新定义stn_no_t, pnt_no_t, sampling_type_t, 由无符号整数-->有符号整数
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/08/21 07:16:36 harold
|
||||||
|
* temporarily import
|
||||||
|
*
|
||||||
|
* Revision 1.9 2002/03/20 03:39:57 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2002/03/17 15:33:52 harold
|
||||||
|
* changed for iccp v0.9
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/03/15 13:43:17 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2002/03/15 08:17:07 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.8 2002/03/05 03:01:34 harold
|
||||||
|
* *** empty log message ***
|
||||||
|
*
|
||||||
|
* Revision 1.7 2002/03/04 14:04:39 harold
|
||||||
|
* *** empty log message ***
|
||||||
|
*
|
||||||
|
* Revision 1.6 2002/01/15 10:37:07 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.5 2002/01/15 10:25:42 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.4 2002/01/15 10:20:11 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.3 2002/01/15 09:55:29 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2002/01/15 08:44:34 harold
|
||||||
|
* 添加线程id类型定义thd_id_t
|
||||||
|
*
|
||||||
|
* Revision 1.1.1.1 2001/12/24 09:33:23 harold
|
||||||
|
* no message
|
||||||
|
*
|
||||||
|
* Revision 1.2 2001/12/24 06:39:57 harold
|
||||||
|
* 为了适应不同的操作系统, 不同的CPU类型, 及不同的编译器,
|
||||||
|
* 对头文件做了相应的修改, 同时添加了一些宏定义, 如:
|
||||||
|
* HAVE__FUNCTION__, __OS__, __PLATFORM__,__TIMEZONE__等等.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
************************************************************************************/
|
@ -0,0 +1,38 @@
|
|||||||
|
|
||||||
|
|
||||||
|
#ifndef __UDP_COMM_H_ICL__
|
||||||
|
#define __UDP_COMM_H_ICL__
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
//#include "resource.h"
|
||||||
|
|
||||||
|
void InitGlobalMember();
|
||||||
|
|
||||||
|
void GetHostIpAddr( void );
|
||||||
|
int GetSdsIpAddr( void );
|
||||||
|
void CreatUdpSetSock( void );
|
||||||
|
void CloseUdpSetSock( void );
|
||||||
|
int CheckIsMySelftIpAddr( u_long addr );
|
||||||
|
|
||||||
|
void SetUdpRecv( void );
|
||||||
|
int SetUdpSend( u_long ipaddr, char *buf, int len );
|
||||||
|
int FillAndSendCmd( u_long ipaddr, u_char port, WORD cmd, u_char *retbuf, int len );
|
||||||
|
|
||||||
|
void ValueToBuf( u_char *buf, u_long val, int len );
|
||||||
|
u_long BufToValue( u_char *buf, int len );
|
||||||
|
|
||||||
|
void WatchDataPutDispBuf( int port, WORD type, u_char *buf, int len );
|
||||||
|
void WatchDataPutDispBufToFile(int port, WORD type, u_char *buf, int len);
|
||||||
|
|
||||||
|
void SetUdpRecvDataProcess( u_long ipaddr, u_char *buf, int len );
|
||||||
|
|
||||||
|
void SetDevConfigFile(int blk);
|
||||||
|
int SetDevConfigFileEx(char *szPortConfigName, int blk);
|
||||||
|
|
||||||
|
void SetDevTime();
|
||||||
|
|
||||||
|
void ResetDev(int iDevNo);
|
||||||
|
|
||||||
|
BOOL isUdpSocketExist();
|
||||||
|
|
||||||
|
#endif
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,211 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>15.0</VCProjectVersion>
|
||||||
|
<ProjectGuid>{EEA43B07-32A7-4DE8-9E7F-20AE51E2C1A9}</ProjectGuid>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<RootNamespace>widgets</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v141</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;DISABLE_OS_HEAP</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<AdditionalOptions>/UTF-8 %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<AdditionalDependencies>Ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>
|
||||||
|
</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="basefunc.cpp" />
|
||||||
|
<ClCompile Include="buban103.cpp" />
|
||||||
|
<ClCompile Include="buban104.cpp" />
|
||||||
|
<ClCompile Include="chainlist.cpp" />
|
||||||
|
<ClCompile Include="commport.cpp" />
|
||||||
|
<ClCompile Include="conf_close.cpp" />
|
||||||
|
<ClCompile Include="conf_open.cpp" />
|
||||||
|
<ClCompile Include="conf_read_key.cpp" />
|
||||||
|
<ClCompile Include="conf_write_key.cpp" />
|
||||||
|
<ClCompile Include="display.cpp" />
|
||||||
|
<ClCompile Include="DSFileSystem.cpp" />
|
||||||
|
<ClCompile Include="Inifile.cpp" />
|
||||||
|
<ClCompile Include="list_entry.cpp" />
|
||||||
|
<ClCompile Include="netport.cpp" />
|
||||||
|
<ClCompile Include="os_heap.cpp" />
|
||||||
|
<ClCompile Include="Profile_Hash.cpp" />
|
||||||
|
<ClCompile Include="scadaprotect.cpp" />
|
||||||
|
<ClCompile Include="tcphost.cpp" />
|
||||||
|
<ClCompile Include="udpcomm.cpp" />
|
||||||
|
<ClCompile Include="udpping.cpp" />
|
||||||
|
<ClCompile Include="widgets.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="baohua.h" />
|
||||||
|
<ClInclude Include="basefunc.h" />
|
||||||
|
<ClInclude Include="basetype.h" />
|
||||||
|
<ClInclude Include="buban103.h" />
|
||||||
|
<ClInclude Include="buban104.h" />
|
||||||
|
<ClInclude Include="chainlist.h" />
|
||||||
|
<ClInclude Include="common.h" />
|
||||||
|
<ClInclude Include="commport.h" />
|
||||||
|
<ClInclude Include="confrw.h" />
|
||||||
|
<ClInclude Include="confrw_errno.h" />
|
||||||
|
<ClInclude Include="display.h" />
|
||||||
|
<ClInclude Include="DSFileSystem.h" />
|
||||||
|
<ClInclude Include="filesystemdialog.ui.h" />
|
||||||
|
<ClInclude Include="FileSystemDlgimpl.h" />
|
||||||
|
<ClInclude Include="global_errno.h" />
|
||||||
|
<ClInclude Include="Header.h" />
|
||||||
|
<ClInclude Include="inifile.h" />
|
||||||
|
<ClInclude Include="ListReport.h" />
|
||||||
|
<ClInclude Include="list_entry.h" />
|
||||||
|
<ClInclude Include="netport.h" />
|
||||||
|
<ClInclude Include="os_heap.h" />
|
||||||
|
<ClInclude Include="platform_def.h" />
|
||||||
|
<ClInclude Include="Profile_Hash.h" />
|
||||||
|
<ClInclude Include="scadaprotect.h" />
|
||||||
|
<ClInclude Include="tcphost.h" />
|
||||||
|
<ClInclude Include="udpcomm.h" />
|
||||||
|
<ClInclude Include="udpping.h" />
|
||||||
|
<ClInclude Include="_confrw.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
@ -0,0 +1,168 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="源文件">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="头文件">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="资源文件">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="widgets.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="buban103.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="buban104.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="commport.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="display.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Inifile.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="scadaprotect.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="tcphost.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="udpcomm.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="udpping.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="basefunc.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="chainlist.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="DSFileSystem.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="os_heap.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="conf_read_key.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="conf_write_key.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="Profile_Hash.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="list_entry.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="conf_open.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="conf_close.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="netport.cpp">
|
||||||
|
<Filter>源文件</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="baohua.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="buban103.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="buban104.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="common.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="commport.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="display.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="filesystemdialog.ui.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="FileSystemDlgimpl.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Header.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="inifile.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="ListReport.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="platform_def.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="scadaprotect.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="tcphost.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="udpcomm.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="udpping.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="basefunc.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="basetype.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="chainlist.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="DSFileSystem.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="os_heap.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="confrw.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="confrw_errno.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="global_errno.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="_confrw.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="Profile_Hash.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="list_entry.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="netport.h">
|
||||||
|
<Filter>头文件</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup />
|
||||||
|
</Project>
|
Loading…
Reference in New Issue