📄 pnimplrc.h
字号:
/*
** Class ImpulseRecord - PQNode Raw Data Decoder class for impulse disturbance
** data files.
*/
#ifndef PNIMPLRC_INC
#define PNIMPLRC_INC
/*
** include declaration of our base class
*/
#include "pndisrec.h"
/*
** Forward declare some classes that we can create and return from this
** class. They are forward declared so that we dont have to include the
** declarations here.
*/
class PQNodeWaveform;
class PQNodeSpectrum;
class PQNodeImpulseData;
class PQNodeWaveSum;
class PQNodeWaveCharacter;
/*
** All Raw data decoders are based upon the PQNodeDistRec (pndisrec.h)
*/
class ImpulseRecord : public PQNodeDistRec
{
private:
int GetT2(int iChannel, float *pfData, int iStart);
int FindMinMaxRMS(float *pfData, int iStart,int iStop,
float fBaseV, float *pfMinRMS, float *pfMaxRMS,
float *pfArea,float *pfAveRMS);
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 ProcessImpulse(struct PQNodeXlateDataInfo_tag *p);
int iNumCycles;
int iVoltRecSize;
int iCurrRecSize;
int iVoltPntPerCy;
LPSHORT pfPhaseData[8];
struct ImpPhaseData_tag *pImpPhaseData[4];
int iTrigChan;
float fTrigTime;
struct ImpulseInfoHead_tag *pImpInfo;
struct ImpulseDataHead_tag *pImpHeader;
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 DecodeData(void *pSetupHeader);
BOOL SetGains();
public:
/*
** Various forms of consturctor. ALL CONSTRUCTORS COPY THE DATA EXCEPT
** THE ImpulseRecord(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.
*/
ImpulseRecord(LPSTR szTime, ATOM atName, void *pData,DWORD dwDataSize);
ImpulseRecord(LPSTR szTime, LPSTR szName, void *pData,DWORD dwDataSize);
ImpulseRecord(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.
*/
ImpulseRecord(void *pData,DWORD dwDataSize);
ImpulseRecord()
{
int i;
for (i = 0; i < 8; i++)
pfPhaseData[i] = NULL;
for (i = 0; i < 4; i++)
pImpPhaseData[i] = NULL;
pImpInfo = NULL;
pImpHeader = NULL;
}
~ImpulseRecord();
/*
** Decode the Raw data record. If the function returns false then
** this object was not created with a valid waveform 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 waveform portion of 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; }
/*
** primitive method to access the PQNodes Impulse Min Max and Volt-
** seconds for a given channel. The return is a vector of 4 reals,
** [0] - The postive peak (delta from waveform)
** [1] - The negative peak (delta from waveform)
** [2] - The volt * seconds
** [3] - If waveform information is available, the value of the
** waveform when the impulse occured.
**
** A nicer way to get the same info might be by using the PQNodeImpulseData
** helper object from the GetImpulseData() call described below.
*/
float *GetImpData(int iChannel,VOLTDISPLAYS VoltPref);
/*
** 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);
/*
** Helper function to find an access the PQNode Impulse info from
** the record. 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.
*/
PQNodeImpulseData *GetImpulseData(int iChannel,VOLTDISPLAYS VoltPref);
PQNodeWaveSum *GetPhaseSummary(int iChannel,VOLTDISPLAYS VoltPref);
PQNodeWaveCharacter *GetWaveCharacter(int iChannel,
VOLTDISPLAYS VoltPref);
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 + -