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

📄 pnrmssrc.h

📁 PQDIF软件包(SDK,Software Development Kit),它能转换、生成并且显示PQDIF文件.对于开发电力系统的数据输出非常有用。
💻 H
字号:
#ifndef PNRMSSRC_INC
#define PNRMSSRC_INC

/*
** Periodic RMS Record Class - Raw data decoder class for PQNode Periodic RMS 
** sample data.
*/

/*
** include the definition for our base class.
*/
#include "pndisrec.h"

/*
** Forward declare some of the "processed" types that we can produce.
*/
class PQNodeRMSEnvelope;

class RMSSampleRecord : public PQNodeDistRec
    {
    private:
        int iNumMAMData;
        float fInterval;
        struct RMSSampleMAMData_tag *pMAMDat;
        struct RMSSampleDataHead_tag *pRMSHeader;
        struct RMSSampleInfoHead_tag *pRMSDataInfo;
        float * MakeTimeAxis();
        int iNumPnts[1];
        float fSegInterval[1];
        int iNumInterval;
        BOOL SetGains();
        BOOL DecodeRawData(LPSTR pData);
    protected:
        BOOL DecodeData(void* pSetupHeader);

    public:
        /*
        ** Various forms of consturctor.  ALL CONSTRUCTORS COPY THE DATA EXCEPT
        ** THE WaveformRecord(void *pData,DWORD dwDataSize) FORM.  THIS FORM
        ** is reserved for the file translator (pndxlate download time functions).
        **
        ** Constructing does not automatically force a decode to occur.  You must
        ** call DecodeData before using other methods. 
        */

        /*
        ** For the following constructors, the szTime is the Hex String format
        ** of the disturbance time.  The hex time is the only way to set the
        ** hundredths so the third form is not recommended.  The name parameters
        ** are self explanitory.  At the pointer, should be the data file as
        ** delivered by PNDS, or read directly from the file.  dwDataSize tells
        ** how big the memory block at pData is and is used to validate the
        ** decoding operations.
        */
        RMSSampleRecord(LPSTR szTime, ATOM atName, void *pData,DWORD dwDataSize);
        RMSSampleRecord(LPSTR szTime, LPSTR szName, void *pData,DWORD dwDataSize);
        RMSSampleRecord(long tTime, LPSTR szName, void *pData, DWORD dwDataSize);

        /*
        ** Special constructor for pndxlate.  No copy of the data is made,
        ** much info is missing after the decode.
        */
        RMSSampleRecord(void *pData,DWORD dwDataSize);
        RMSSampleRecord() 
            {
            pMAMDat = NULL;
            pRMSHeader = NULL;
            pRMSDataInfo = NULL;
            }

        virtual ~RMSSampleRecord();

        /*
        ** Normal Decoder when data is comming from the data base.
        */
        BOOL DecodeData();

        /*
        ** Channel numbering for a methods below is:
        ** 0 = Va, 1 = Vb, 2 = Vc, 3 = Vn 
        ** 4 = Ia, 5 = Ib, 6 = Ic, 7 = In
        ** IDCHAN_VOLTRESIDUALS = Sum of enabled voltage channels
        ** IDCHAN_CURRRESIDUALS = Sum of enabled current channels
        **
        ** Determine if a channel is enabled in the data record.
        */
        BOOL IsChannelEnabled(int iChannel);

        /*
        ** Obtain a vector of time data points for the RMS evnvelope.
        */
        float * GetTimeVector();

        /*
        ** Find out how many data points are in the rms record for the channel.
        */
        int GetPhaseDataCount(int iChannel);

        /*
        ** Primitive methods for finding the min, ave or max curve of the
        ** rms envelope.  Use these only if the RMSEnvelope helper class
        ** doesn't fit your needs.  iChannel, VoltPref are as always.  
        ** The pfMin, pfMax and pfAve pointers if provided will receive the
        ** min max or average of the data respetively.  A vector of
        ** GetPhaseDataCount(int iChannel) floats is returned by each method.
        ** The caller owns the returned data.
        */
        float *GetPhaseMinData(int iChannel,VOLTDISPLAYS VoltPref,float *pfMin);
        float *GetPhaseMaxData(int iChannel,VOLTDISPLAYS VoltPref,float *pfMax);
        float *GetPhaseAveData(int iChannel,VOLTDISPLAYS VoltPref,float *pfAve);

        /*
        ** Helper function for creating an RMS Envelope object from this
        ** RMS object.  This is the way to get one of these since it takes a
        ** a fair amount of processing to crunch out the required values to
        ** create the envelope and associated parameters.  iChannel may take 
        ** on standard values as described above.  The VoltPref parameter
        ** specifies the "base" or unit voltage channels should be created
        ** in.  Once created, these values are not easily changed.  
        **
        ** Once created, the envelope objects are independent of the creating
        ** RMSDevRecord.
        */
        PQNodeRMSEnvelope *GetPhaseEnvelope(int iChannel,VOLTDISPLAYS VoltPref);

        /*
        ** Primitive method for finding the temperature data for an RMS
        ** periodic sample.  Note, temperature does not support an envelope
        ** just a single curve of data.  Below you can find a method that will
        ** load this information into an RMSEnvelope object.
        */
        float *GetTempData(float *pfMin,float *pfAve,float *pfMax);
        int GetTempDataCount() {return iNumMAMData;}

        /*
        ** Primitive methods for finding the min, ave or max curve of the
        ** freqency envelope.  Use these only if the RMSEnvelope helper class
        ** doesn't fit your needs.  
        ** The pfMin, pfMax and pfAve pointers if provided will receive the
        ** min max or average of the data respetively.  A vector of
        ** GetPhaseDataCount(int iChannel) floats is returned by each method.
        ** The caller owns the returned data.
        */
        float *GetFreqMinData(float *pfMin);
        float *GetFreqAveData(float *pfAve);
        float *GetFreqMaxData(float *pfMax);

        /*
        ** Helper functions for creating an RMS Envelope object from this
        ** RMS object for the Frequency and temperature data.
        **
        ** Once created, the envelope objects are independent of the creating
        ** RMSDevRecord.
        */
        PQNodeRMSEnvelope *GetFrequencyEnvelope();

        PQNodeRMSEnvelope *GetTemperatureEnvelope();
        
        float GetPhaseInterval() {return fInterval;}
        float GetChanPrefGain(int iChannel,VOLTDISPLAYS VoltPref);
        float GetBaseV();

    };    // end of class RMSSampleRecord

#endif    // prevent multiple includes

⌨️ 快捷键说明

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