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

📄 pnrawdef.h

📁 PQDIF软件包(SDK,Software Development Kit),它能转换、生成并且显示PQDIF文件.对于开发电力系统的数据输出非常有用。
💻 H
字号:
#pragma pack(1)
/*
** pnrawdef - This header defines the data structures which are used to hold
**      raw data as it is obtained from the database.  For the most part, for 
**      each disturbance type has at least two structures defined for it. The
**      first contains the setup information for the node/disturbance and is 
**      combination of the PNGENERAL and the disturbance specific data struct,
**      both PNDDE.H.  The second structure defines the PQNode record header
**      structure for the particular distubance type.  Also, for many 
**      distubance types there are stuctures defined for the internal structure
**      of the data as it provided by the PQNode.  Also, for RMSdev and 
**      WaveFaults, structures are defined to hold summarizied (and 
**      categorized) information about the disturbance.
**
**      While I am adding this documentation, I am musing as to why I pulled
**      all of these definitions together in this single file.  They used
**      be stored individually with the decoder functions that used them.
**      I'm sure I had a good reason at the time.  It may be that is a good
**      single point for maintenance of data structures that were changing
**      all the time just a short time back!?
*/

#ifdef PNWAVFRC_INC
/*------------------------------------------------------------------
** WAVEFAULT Data structures.
**
** The wavefault info head tag is the header record which we add to all
** waveflt records.  PNGENERAL and PNWAVEFORM come from PNDDE.H.
*/
typedef struct WaveFaultInfoHead_tag
    {
    PNGENERAL General;
    PNWAVEFORM FaultInfo;
    } WAVEFAULTINFOHEAD, FAR * PWAVEFAULTINFOHEAD;

/*
** Raw Data header from the PQNode.  There are no structures for the 
** raw data since it is simply vectors of integers whose length is infered
** by data in the header.
*/

typedef struct WaveFaultDataHead_tag
    {
    BYTE byDistId;          /*  0 */
    BYTE vbTsData[7];       /*  1 */
    WORD wDataLen;          /*  8 */
    WORD fPhases;           /* 10 */
    BYTE wDistPhase;        /* 12 */
    WORD wRefCycle;         /* 13 */
    BYTE byTrigCycle;       /* 15 */
    BYTE byTrigPoint;       /* 16 */
    WORD wFrequency;        /* 17 */
    BYTE byGainSet;         /* 19 */
    BYTE bNumCycle;         /* 20 */
    BYTE bUnused[9];        /* 21 */
    WORD wSiteNum;          /* 30 */
    } WAVEFAULTDATAHEAD, FAR * PWAVEFAULTDATAHEAD;

/*
** Structure to abstact the raw database form of the wavefault summary record.
** PNWAVEFAULTSUM comes from PNDDE.H. 
*/

typedef struct WaveFaultSummary_tag
    {
    PNWAVEFAULTSUMMARY WaveSummary;
    } WAVEFAULTSUMMARY, FAR * PWAVEFAULTSUMMARY;

#endif

#ifdef PNWAVSRC_INC
/*------------------------------------------------------------------
** WAVESAMPLE (waveform samples) Data structures.
**
** The wavesamp info head tag is the header record which we add to all
** wavesamp records.  PNGENERAL and PNSAMPLED come from PNDDE.H.
*/

typedef struct WaveSampInfoHead_tag
    {
    PNGENERAL General;
    PNSAMPLED SampInfo;
   } WAVESAMPINFOHEAD, FAR * PWAVESAMPINFOHEAD;


/*
** Raw Data header from the PQNode.  There are no structures for the 
** raw data since it is simply vectors of integers whose length is infered
** by data in the header.
*/

typedef struct WaveSampDataHead_tag
    {
    BYTE byDistId;          /*  0 */
    BYTE vbTsData[7];       /*  1 */
    WORD wDataLen;          /*  8 */
    WORD fPhases;           /* 10 */
    WORD wRefCycle;         /* 12 */
    WORD wFrequency;        /* 14 */
    BYTE byGainSet;         /* 16 */
    BYTE bNumCycle;         /* 17 */
    BYTE bUnused[12];       /* 18 */
    WORD wSiteNum;          /* 30 */
    } WAVESAMPDATAHEAD, FAR * PWAVESAMPDATAHEAD;

#endif

#ifdef PNIMPLRC_INC

/*------------------------------------------------------------------
** IMPULSE Data structures.
**
** The Impulse info head tag is the header record which we add to all
** waveflt records.  PNGENERAL and PNIMPULSE come from PNDDE.H.
*/

typedef struct ImpulseInfoHead_tag
    {
    PNGENERAL General;
    PNIMPULSE FaultInfo;
    } IMPULSEINFOHEAD, FAR * PIMPULSEINFOHEAD;


/*
**  The raw data in impulse file consists of waveform information (which
**  as with WAVEFAULTS and WAVESAMPS is just vectors of integers) and the 
**  impulse information as defined next:
*/
typedef struct ImpPhaseData_tag
    {
    float fPosPeak;
    float fNegPeak;
    float fVoltSec;
    } IMPPHASEDATA, FAR * PIMPPHASEDATA;

/*
** Raw Data header from the PQNode. 
*/

typedef struct ImpulseDataHead_tag
    {
    BYTE byDistId;          /*  0 */
    BYTE vbTsData[7];       /*  1 */
    WORD wDataLen;          /*  8 */
    WORD fPhases;           /* 10 */
    BYTE wDistPhase;        /* 12 */
    WORD wRefCycle;         /* 13 */
    BYTE byTrigCycle;       /* 15 */
    BYTE byTrigPoint;       /* 16 */
    WORD wFrequency;        /* 17 */
    BYTE byGainSet;         /* 19 */
    BYTE bNumCycle;         /* 20 */
    BYTE bUnused[9];        /* 21 */
    WORD wSiteNum;          /* 30 */
    } IMPULSEDATAHEAD, FAR * PIMPULSEDATAHEAD;

#endif

#if defined(PNRMSDRC_INC) || defined(PNRMSSRC_INC) || defined(PNCLDLRC_INC)
/*------------------------------------------------------------------
** RMS type data, common data structures.  The following structures are used
** RMSdeviation, Cold load and RMS Sampled files.
**
** Define the basic data structures in the rms deviation Min/Ave/Max data block.
** at the lowest level are the min, ave and max for a phase.
*/
typedef struct RMSMAMPhase_tag
    {
    float fMin;
    float fAve;
    float fMax;
    } RMSMAMPHASEDATA, FAR * PRMSMAMPHASEDATA;

/*
** All Min/Ave/Max 8 phases are grouped together with a count of cycles to make
** up a data block.  There is a data block for each segment of the RMS setup.
*/
typedef struct RMSDevMAMData_tag
    {
    DWORD dwNumCycle;
    RMSMAMPHASEDATA PhaseData[8];
    } RMSDEVMAMDATA, FAR * PRMSDEVMAMDATA;

/*
** Preceding the MAM blocks are cycle by cycle RMS calcs for pre- and post-
** trigger periods.
*/
typedef struct RMSDevRMSData_tag
    {
    float fPhaseRMS[8];
    } RMSDEVRMSDATA, FAR * PRMSDEVRMSDATA;

#endif




#ifdef PNRMSDRC_INC
/*------------------------------------------------------------------
** RMSDeviaton Data structures.
**
** The RMS Deviation info head tag is the header record which we add to all
** RMS Deviation records.  PNGENERAL and PNRMSDIST come from PNDDE.H.
*/

typedef struct RMSDevInfoHead_tag
    {
    PNGENERAL General;
    PNRMSDIST SampInfo;
    } RMSDEVINFOHEAD, FAR * PRMSDEVINFOHEAD;

/*
** The raw Data header from the PQNode.  
*/
typedef struct RMSDevDataHead_tag
    {
    BYTE byDistId;          /*  0 */
    BYTE vbTsData[7];       /*  1 */
    WORD wRMSDataLen;       /*  8 */
    WORD wMAMDataLen[3];    /* 10 */
    WORD wWaveDataLen;      /* 16 */
    WORD fPhases;           /* 18 */
    BYTE wDistPhase;        /* 20 */
    WORD wRefCycle;         /* 21 */
    BYTE byTrigCycle;       /* 23 */
    BYTE byTrigPoint;       /* 24 */
    BYTE byDummy;           /* 25 */
    WORD wFrequency;        /* 26 */
    BYTE byGainSet;         /* 28 */
    BYTE bNumCycle;         /* 29 */
    WORD wSiteNum;          /* 30 */
    } RMSDEVDATAHEAD, FAR * PRMSDEVDATAHEAD;

/*
**  The following structures are used in RMSDeviation raw data and
**  are defined above in the RMS type data, common data structures above.
**  typedef struct RMSMAMPhase_tag
**    {
**    float fMin;
**    float fAve;
**    float fMax;
**    } RMSMAMPHASEDATA, FAR * PRMSMAMPHASEDATA;
**
**typedef struct RMSDevMAMData_tag
**    {
**    DWORD dwNumCycle;
**    RMSMAMPHASEDATA PhaseData[8];
**    } RMSDEVMAMDATA, FAR * PRMSDEVMAMDATA;
**
**typedef struct RMSDevRMSData_tag
**    {
**    float fPhaseRMS[8];
**    } RMSDEVRMSDATA, FAR * PRMSDEVRMSDATA;
*/

/*
** Structure to abstact the raw database form of the RMS Dist. summary record.
** PNRMSDISTSUMMARY comes from PNDDE.H. 
*/
typedef struct RMSDevVoltSummary_tag
    {
    PNRMSDISTSUMMARY RMSSummary;
    } RMSDEVVOLTSUMMARY, FAR * PRMSDEVVOLTSUMMARY;

#endif


#ifdef PNRMSSRC_INC
/*------------------------------------------------------------------
** RMS Sample Data structures.
**
** The RMS Sample info head tag is the header record which we add to all
** RMS Sample records.  PNGENERAL and PNSAMPLED come from PNDDE.H.
*/

typedef struct RMSSampleInfoHead_tag
    {
    PNGENERAL General;
    PNSAMPLED SampInfo;
    } RMSSAMPLEINFOHEAD, FAR * PRMSSAMPLEINFOHEAD;

/*
** The raw Data header from the PQNode.  
*/
typedef struct RMSSampleDataHead_tag
    {
    BYTE byDistId;          /* 00 */
    BYTE vbTsData[7];       /* 01 */
    WORD wDataLen;          /* 08 */
    WORD fPhases;           /* 10 */
    WORD wInterval;         /* 12 */
    WORD wNumRecords;       /* 14 */
    BYTE bUnused[14];       /* 16 */
    WORD wSiteNum;          /* 30 */
    } RMSSAMPLEDATAHEAD, FAR * PRMSSAMPLEDATAHEAD;

/*
**  The following structures are used in RMSDeviation raw data and
**  are defined above in the RMS type data, common data structures above.
**  typedef struct RMSMAMPhase_tag
**typedef struct RMSMAMPhase_tag
**    {
**    float fMin;
**    float fAve;
**    float fMax;
**    } RMSMAMPHASEDATA, FAR * PRMSMAMPHASEDATA;

/*
** All Min/Ave/Max 8 phases are grouped together with a count of cycles to make
** up a data block.  There is a data block for each segment of the RMS setup.
** This structure is ALMOST like the Common Structures above, except that freq
** and temp information is also included.
*/
typedef struct RMSSampleMAMData_tag
    {
    DWORD dwNumCycle;
    RMSMAMPHASEDATA PhaseData[8];
    RMSMAMPHASEDATA FreqData;
    float fTemp;
    } RMSSAMPLEMAMDATA, FAR * PRMSSAMPLEMAMDATA;


#endif

#ifdef PNCLDLRC_INC
/*------------------------------------------------------------------
** Cold Load Data structures.
**
** The Coldload info head tag is the header record which we add to all
** cold load records.  PNGENERAL and PNCLPDIST come from PNDDE.H.
*/
    
typedef struct ColdLoadInfoHead_tag
    {
    PNGENERAL General;
    PNCLPDIST SampInfo;
    } COLDLOADINFOHEAD, FAR * PCOLDLOADINFOHEAD;

/*
** The raw Data header from the PQNode.  
*/
typedef struct ColdLoadDataHead_tag
    {
    BYTE byDistId;          /*  0 */
    BYTE vbTsData[7];       /*  1 */
    WORD wRMSDataLen;       /*  8 */
    WORD wMAMDataLen[3];    /* 10 */
    WORD wWaveDataLen[4];   /* 16 */
    WORD fPhases;           /* 24 */
    BYTE wDistPhase;        /* 26 */
    WORD wRefCycle;         /* 27 */
    BYTE byTrigCycle;       /* 29 */
    BYTE byWaveTrigCycle;   /* 30 */
    WORD wFrequency;        /* 31 */
    BYTE byGainSet;         /* 32 */
    BYTE bNumCycle;         /* 34 */
    BYTE bUnused[27];       /* 35 */
    WORD wSiteNum;          /* 62 */
    } COLDLOADDATAHEAD, FAR * PCOLDLOADDATAHEAD;


/*
**  The following structures are used in RMSDeviation raw data and
**  are defined above in the RMS type data, common data structures above.
**typedef struct RMSMAMPhase_tag
**    {
**    float fMin;
**    float fAve;
**    float fMax;
**    } RMSMAMPHASEDATA, FAR * PRMSMAMPHASEDATA;
**
**typedef struct RMSDevMAMData_tag
**    {
**    DWORD dwNumCycle;
**    RMSMAMPHASEDATA PhaseData[8];
**    } RMSDEVMAMDATA, FAR * PRMSDEVMAMDATA;
**
**typedef struct RMSDevRMSData_tag
**    {
**    float fPhaseRMS[8];
**    } RMSDEVRMSDATA, FAR * PRMSDEVRMSDATA;
*/


#endif


#ifdef PNOUTGRC_INC
/*------------------------------------------------------------------
** OUTAGE Data structures.
**
** The OUTAGE info head tag is the header record which we add to all
** OUTAGE records.  PNGENERAL and PNOUTAGE come from PNDDE.H.
*/

typedef struct OutageInfoHead_tag
    {
    PNGENERAL General;
    PNOUTAGE OutageInfo;
    } OUTAGEINFOHEAD, FAR * POUTAGEINFOHEAD;

/*
** Not used at this time...
*/
typedef struct OutageDistData_tag
    {
    LONG lOutageTime;
    LONG lRestTime;
    WORD fPhases;
    } OUTAGEDISTDATA, FAR * POUTAGEDISTDATA;

/*
** Outage files are wierd.  A normal, complete outage file consists of two
** record headers, the first for the outage, the second for the restoration.
** However, under various conditions one can encounter files with just outage
** or just restoration records.  The bOutCode tells use which type of record
** it is by using the OUTAGE_START_CODE and OUTAGE_END_CODE defines.
*/
#define OUTAGE_START_CODE (1)
#define OUTAGE_END_CODE (2)
typedef struct OutageDataHead_tag
    {
    BYTE byDistId;          /*  0 */
    BYTE vbTsData[7];       /*  1 */
    BYTE bOutCode;          /*  8 */
    BYTE wDistPhase;        /*  9 */
    BYTE bUnused[20];       /* 10 */
    WORD wSiteNum;          /* 30 */
    } OUTAGEDATAHEAD, FAR * POUTAGEDATAHEAD;

#endif
#pragma pack()

⌨️ 快捷键说明

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