📄 pnwavfrc.h
字号:
/*
** Class WaveFaultRecord - PQNode Raw Data Decoder class wavefault disturbance
** data files.
*/
#ifndef PNWAVFRC_INC
#define PNWAVFRC_INC
/*
** include declaration of our base class
*/
#include "pndisrec.h"
/*
** Defines for internal usage.
*/
#define CHAN_CURRRES (9)
#define CHAN_VOLTRES (8)
/*
** Forward declare a couple of class that this object can return. Doit as
** a forward to avoid the overhead of including the defs. We just return
** pointers to them.
*/
class PQNodeWaveform;
class PQNodeSpectrum;
class PQNodeWaveSum;
class PQNodeWaveCharacter;
class WaveFaultRecord : public PQNodeDistRec
{
private:
int FindMinMaxRMS(float *pfData, int iStart,int iStop,
float fBaseV, float *pfMinRMS, float *pfMaxRMS,
float *pfArea,float *pfAveRMS);
int GetT2(int iChannel, float *pfData, int iStart);
int GetT1(int iChannel, float *pfData, int iStop);
protected:
/*
** friend function in pndxlate. This function handles the data
** at download time, changing it from absolutely raw PQNode data to
** our form with headers and setup info.
*/
friend LONG ProcessWaveFault(struct PQNodeXlateDataInfo_tag *p);
int iNumCycles;
int iVoltRecSize;
int iVoltPntPerCy;
int iCurrRecSize;
LPSHORT pfPhaseData[8];
int iTrigChan;
float fTrigTime;
int iRangeChecks[12];
struct WaveFaultInfoHead_tag *pWaveInfo;
struct WaveFaultDataHead_tag *pWaveHeader;
struct WaveFaultSummary_tag *pWaveFltSum;
float * MakeCurrentData(int iChannel,LPSHORT piRaw,VOLTDISPLAYS VoltPref);
float * MakeVoltageData(int iChannel,LPSHORT piRaw,VOLTDISPLAYS VoltPref);
float * SumChannels(int iChan1,int iChan2,int iChan3,
int iNumPoints,VOLTDISPLAYS VoltPref,int iNeutral = -1);
float * MakeTimeVector(int iNumPoints);
BOOL DecodeRawData(LPSTR pData);
BOOL SetGains();
BOOL DecodeData(void *pSetupInfo);
public:
/*
** Various forms of consturctor. ALL CONSTRUCTORS COPY THE DATA EXCEPT
** THE WaveFaultRecord(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.
*/
WaveFaultRecord(LPSTR szTime, ATOM atName, void *pData,DWORD dwDataSize);
WaveFaultRecord(LPSTR szTime, LPSTR szName, void *pData,DWORD dwDataSize);
WaveFaultRecord(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.
*/
WaveFaultRecord(void *pData,DWORD dwDataSize);
WaveFaultRecord()
{
int i;
for (i = 0; i < 8; i++)
pfPhaseData[i] = NULL;
pWaveInfo = NULL;
pWaveHeader = NULL;
pWaveFltSum = NULL;
}
~WaveFaultRecord();
/*
** Decode the Raw data record. If the function returns false then
** this object was not created with a valid wavefault data record.
*/
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);
/*
** Find out how many data points are in the record for the channel.
*/
int GetDataSize(int iChannel);
/*
** Obtain a vector of time data points for the voltage or current data
** for the channel.
*/
float *GetTimeData(int iChannel);
/*
** Obtain a vector of data points for the voltage or current data
** for the channel. For voltage channels the values will be scaled
** as indicated by the VoltPref parameter (see pndatprf.h)
*/
float *GetWaveData(int iChannel,VOLTDISPLAYS VoltPref);
int GetVoltRecSize() { return iVoltRecSize; }
int GetCurrRecSize() { return iCurrRecSize; }
/*
** Method to determine the time (from beginning of record, not absolute)
** that the disturbance began. This is the length of the pre-trigger
** and is given in seconds.
*/
float GetTriggerTime() { return fTrigTime; }
/*
** Method to determine which channel triggerd the event. Standard
** channel numberings are returned.
*/
int GetTriggerChannel() { return iTrigChan; }
/*
** Helper function for creating PQNodeWaveform object from the
** waveform information for one channel. 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.
*/
PQNodeWaveform *GetWaveformData(int iChannel,VOLTDISPLAYS VoltPref);
/*
** Create a Harmonic Spectrum object for the indicated channel. The
** HarmOpt specifies frequency in hertz or harmonic number and the
** HarmQuant parameter specifies if the VoltPref or Percent Fundemental
** should be used for voltage spectrums.
*/
PQNodeSpectrum *GetSpectrumData(int iChannel,VOLTDISPLAYS VoltPref,
HARMAXISOPT HarmOpt, HARMQUANTOPT HarmQuant);
PQNodeWaveSum *GetPhaseSummary(int iChannel,VOLTDISPLAYS VoltPref);
PQNodeWaveCharacter *GetWaveCharacter(int iChannel,
VOLTDISPLAYS VoltPref = VD_ACTUAL);
float GetChanPrefGain(int iChannel,VOLTDISPLAYS VoltPref = VD_ACTUAL);
float GetBaseV();
}; // end of class Waveform
#endif // prevent multiple includes
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -