📄 pncldlrc.h
字号:
#ifndef PNCLDLRC_INC
#define PNCLDLRC_INC
/***********************************************************************
** Coldload Pickup Record Class - Raw data decoder class for PQNode coldload
** disturbance data.
*/
/*
** include the base class for all disturbance records.
*/
#include "pndisrec.h"
/*
** Forward declare a couple of classes that we need as return values on some
** functions, but we really dont want to include the class defintions here.
*/
class PQNodeWaveform;
class PQNodeRMSEnvelope;
/*
** Begin definition of the Coldload record decoder.
*/
class ColdLoadRecord : public PQNodeDistRec
{
private:
/*
** This friend is in pndxlate.
*/
friend LONG ProcessColdLoad(struct PQNodeXlateDataInfo_tag *p);
float fTrigTime;
float fLowThesh;
int iTotalPoints;
int iNumRMSPreTrig;
int iNumRMSPostTrig;
int iNumMAMData[3];
float fMAMTime[3];
int iNumCycles;
int iVoltRecSize;
int iCurrRecSize;
LPSHORT pfPhaseData[8];
struct RMSDevRMSData_tag *pRMSDat;
struct RMSDevMAMData_tag *pMAMDat[3];
struct ColdLoadDataHead_tag *pColdLoadHeader;
struct ColdLoadInfoHead_tag *pColdLoadDataInfo;
float * MakeRMSTimeAxis();
float *SumChannels(int iChan1,int iChan2,int iChan3,
int iNumPoints,VOLTDISPLAYS VoltPref);
float * MakeCurrentData(int iChannel,LPSHORT piRaw,VOLTDISPLAYS VoltPref);
float * MakeVoltageData(int iChannel,LPSHORT piRaw,VOLTDISPLAYS VoltPref);
float * MakeWaveTimeVector(int iNumPoints);
BOOL SetGains();
BOOL DecodeRawData(LPSTR pData);
protected:
BOOL DecodeData(void *pSetupHeader);
public:
/*
** Various forms of consturctor. ALL CONSTRUCTORS COPY THE DATA EXCEPT
** THE RMSDrvevRecord(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.
*/
ColdLoadRecord(LPSTR szTime, ATOM atName, void *pData,DWORD dwDataSize);
ColdLoadRecord(LPSTR szTime, LPSTR szName, void *pData,DWORD dwDataSize);
ColdLoadRecord(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.
*/
ColdLoadRecord(void *pData,DWORD dwDataSize);
ColdLoadRecord()
{
pRMSDat = NULL;
pMAMDat[0] = pMAMDat[1] = pMAMDat[2] = NULL;
pColdLoadHeader = NULL;
pColdLoadDataInfo = NULL;
}
virtual ~ColdLoadRecord();
/*
** 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);
/*
** Determine if a channel in variation. iPhase should always be a
** voltage channel.
*/
BOOL IsPhaseInVariation(int iPhase);
/*
** Obtain a vector of time data points for the RMS evnvelope.
*/
float * GetRMSTimeVector();
/*
** 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);
/*
** Report the thresholds from the setting record.
*/
float GetLowThresh(int iChannel,VOLTDISPLAYS VoltPref);
/*
** Waveform access functions - First the size of a waveform in points.
*/
int GetWaveDataSize(int iChannel);
/*
** Get a time vector (in seconds) for the waveform.
*/
float *GetWaveTimeVector(int iChannel);
/*
** Get the waveform itself.
*/
float *GetWaveData(int iChannel,VOLTDISPLAYS VoltPref);
/*
** 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);
/*
** Helper function for creating PQNodeWaveform object for assuming
** waveform information was saved with the RMS object. 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);
/*
** Method to disclose the identity of the triggering channel.
** Standard channel numbering is used.
*/
int GetTriggerChannel() { return idTrigger; }
}; // end of class ColdLoadRecord
#endif // prevent multiple includes
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -