📄 evtdb.h
字号:
// evtdb.h: interface for the evtdb class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_EVTDB_H__6E2C464E_732F_48F2_B0C1_680364594244__INCLUDED_)
#define AFX_EVTDB_H__6E2C464E_732F_48F2_B0C1_680364594244__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#include "common.h"
#include "yh9000.h"
#include "userapi.h"
#include "dbapi.h"
#include "edapi.h"
#include "define.h"
#include "Mmsystem.h"
#include <windows.h>
#include <iostream.h>
#include <Shlwapi.h>
#define MAXEVT 151
#define MAXEVTTYPE 100 //告警类型库记录量
class evtdb
{
public:
DWORD m_Nodeid;
DWORD m_Evtid;
DWORD m_EvtTid;
DWORD m_tmpid;
MEMTABLE* m_pNode1;
MEMTABLE* m_pEvt1;
MEMTABLE* m_pEvtType1;
MEMTABLE* m_ptmp1;
MEMTABLE* m_pEvtOpt;
scada_EvtOpt* m_EvtOpt;
COMMON_Node m_nod;
COMMON_Node *m_pNode;
scada_event *m_pEvt;
scada_event *m_ptmp;
scada_eventType *m_pEvtType;
public:
char IndEvtT[M_EVTT][M_EVTTS];
public:
int m_SoundBegin;
char m_typeV;
bool m_soundF;
bool Is_ChgF;
HANDLE handle;
public:
CFileStatus filestatus;
char path[MAX_PATH];
char path1[MAX_PATH];
char path2[MAX_PATH];
char path3[MAX_PATH];
char path4[MAX_PATH];
char pathopt[MAX_PATH];
char pathoptname[MAX_PATH];
char temppath[20];
public:
bool fisf;
bool m_printf;
bool warntimes;
int warntime;
bool m_bInVoice;
public:
void SetSave();
void SetOpen();
void SetCheckData();
public:
void push_evt();
void push_evt(scada_event evtt);
bool EvtCmp(scada_event* evt1,scada_event* evt2);
void SetEventType();
bool GetIfShow(int nCounts);
bool SetIfShow(int nCounts,int bResult);
bool GetIfPlaySound(int nCounts);
bool SetIfPlaySound(int nCounts,int bResult);
bool GetIfPicture(int nCounts);
bool SetIfPicture(int nCounts,int bResult);
bool GetIfPlayRing(int nCounts);
bool SetIfPlayRing(int nCounts,int bResult);
bool GetIfPlayAlarm(int nCounts);
bool SetIfPlayAlarm(int nCounts,int bResult);
bool GetIfPrint(int nCounts);
bool SetIfPrint(int nCounts,int bResult);
char * GetEventCode(int nCounts);
bool WriteSelfEvent(BYTE TypeID,BYTE SubtypeID,char* Dec);
bool AckAllEvent();
bool SetColors(COLORREF *pColor,int nCounts);
bool IsNeedPrint(BYTE TypeID,BYTE SubtypeID);
bool IsNeedShow(BYTE TypeID,BYTE SubtypeID);
COLORREF GetWarnColor(BYTE TypeID,BYTE SubtypeID);
COLORREF GetWarnColor(char* warndes);
void SetCurDisType(WORD iType);
void SetCurDisType(char* warndes);
int GetEvtTypeCounts()
{
return m_nEvtTypeCounts;
}
bool IsInit()
{
return m_bdbInitialed;
}
bool GetEventType(CString *pNames,WORD * pType,COLORREF *pColor);
bool GetSafeDays(int& safedays);
bool InitDbApi(char *user, char *pw);
bool IsRecChanged();
char IsDisRecChanged();
// int Level();
bool AckEvent();
int GetAck();
int GetType();
void SelectNewEvt();
// DWORD ShowColor();
bool Ack();
void GetCurStr(char *str);
void GotoNextEvent();
void GotoLastEvent();
void ReadAllEvt();
evtdb();
virtual ~evtdb();
scada_event evt0; //事件的缓冲区
scada_event* evt; //事件的缓冲区
scada_event evt_tmp[MAXEVT]; //事件的缓冲区
scada_eventType evttype[MAXEVTTYPE];
scada_event m_oldEvt; //保存上次的最后一条记录
scada_event m_olddisEvt; //保存当前显示类型的最后一个记录
int nEvt; //当前事件个数
int cursor; //当前光标位置
int m_nEvtTypeCounts; //事件种类数量
char curchange; //当前光标被改变
void GetDTMStr(CTime &tm,WORD MilliSec,char *dstr,bool f=true);
WORD m_iCurEvtDisType; //当前显示类型
void PrintWarn();
void VoiceWarn();
private:
char m_strSoundpath[MAX_PATH];
void AckPrint(int index);
void PlayVoice(int i,char type);
bool m_bdbInitialed;
void * GetAllEvent(int &num);
void * GetAllEventType(int &num);
char IsNeedVoiceWarn(BYTE TypeID, BYTE SubtypeID);
bool AckVoiceWarn(int index,char F=0);
void NewLine();
void headLine();
};
#endif // !defined(AFX_EVTDB_H__6E2C464E_732F_48F2_B0C1_680364594244__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -