📄 decoder.h
字号:
/*
**
** File: decoder.h
**
** $NAME$
** Class definition header for PQDM virtual base class
** for PQDM file translator DLL, and its derived classes.
** $PATHS$
** General
**
** $AUTHOR$
** Wade Franklin
** Copyright (C) 1992 by Electrotek Concepts, Inc.
** $1$
*/
#ifndef _DECODER_H_
#define _DECODER_H_
#include <io.h>
#include "eventime.h"
#include "event.h"
//===========================================================================
//
// CLASS CPQDMFileProcessor
//
// Abstract base class from which we will derive two actual file processor
// classes for PNDS disturbance files. One will process PNDS archives,
// the other will process PNDS system directories.
//
//===========================================================================
typedef char SITEID[12];
class CPQDMFileProcessor : public CObject
{
public:
virtual BOOL FoundDataSource(void) { return bFoundDataSource; };
virtual const char FAR *GetDataSourcePath() { return szDataStorePath; };
SITEID *aszSite;
int nSite;
CPQEvent **apEvent;
int nEvent;
protected:
//
// Protected constructor makes this a pure base class.
//
CPQDMFileProcessor();
BOOL bFoundDataSource; // The constructor will set to TRUE if successful.
HANDLE hDisturbanceFile; // Will be allocated to hold each disturbance.
char szNodeID[14]; // Current node being processed
char szNodePath[_MAX_PATH]; // PNDS PQNode identifier.
char szDataStorePath[_MAX_PATH]; // Path to files (derived classes will look for
// either archive or 'Actual' here).
CEventTime etStartTime; // Start time of the data we want
CEventTime etEndTime; // End time of our desired time window.
CEventTime etEventTime; // Time of current event in same format.
WORD uEventType; // Type of current event.
// File types to process checking.
BOOL bDoFileType[8];
BOOL DoThisFileType(int iFileType) {return bDoFileType[iFileType];}
};
//========================================================================================
//
// CLASS CPQNodePNDSProcessor
//
// This one grabs PNDS disturbance files straight out of a PNDS database
// directory tree.
//
//========================================================================================
class CPQNodePNDSProcessor : public CPQDMFileProcessor
{
public:
CPQNodePNDSProcessor(const char *szDataPath);
~CPQNodePNDSProcessor();
BOOL GetEventList(CEventTime etStart, CEventTime etEnd, char **aszNodeID, const int nNode, const WORD nMax, BOOL *abDo);
BOOL GetSiteList(CString *astrAllowedNode, WORD nAllowedNode);
int CountSites();
CPQEvent *GetEventInfo(long fh);
CPQEvent * GetEventData(char *szNode, char *szFile);
BOOL GetEventData(int idx);
private:
char szSearchPath[_MAX_PATH];
struct _finddata_t ftFileInfo; // Used to search PNDS directory for disturbance files.
BOOL bFoundNext; // Flag necessary because of how findfirst/findnext works.
};
#endif // _DECODER_H_
/* $end$ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -