📄 pqdh.h
字号:
/* Positive and negative peak magnitudes. */
double posPkMag;
double negPkMag;
/* Filtered positive and negative peak magnitudes. */
double fPosPkMag;
double fNegPkMag;
/* Quantity-sec under impulse. */
double area;
/* Quantity squared-sec under impulse. */
double area2;
/* RMS Magnitude envelope. */
double minimum;
double maximum;
double average;
/* RMS Maximum deviation from nominal. */
double maxDeviation;
} PQDHWaveFault;
/* Trend record template. Multiple records can be added to represent a single
trend with different sampling rates or more sample than this record supports. */
typedef struct
{
/* Record attributes: quantity, characteristic, harmonic number,
and phase. */
PQDQuantity quantity;
PQDCharacteristic characteristic;
double harmonic;
PQDPhase phase;
/* Minimum, maximum, and average magnitude values. */
double minimum;
double maximum;
double average;
/* Number of samples used to construct the minimum, maximum,
and average values. */
int numberSamples;
/* The time of the first sample relative to the event time
in seconds. */
double startTime;
/* The period of time represented by each sample (i.e., the time step
between each point) in seconds. */
double samplePeriod;
/* Data format specifier. */
PQDFormat format;
/* Conversion values. These values are applied to integer data
to convert it to real values as follows:
realValue[index] = scale * sampleData[index] + bias
For floating point data, bias and scale are not used. They should
should be set to 0.0.
*/
double scale;
double bias;
/* Pointers to the sample data arrays. This are optional. If a
particular array is not supplied, its respective pointer should be
set to NULL. The sample data arrays reflect that Trend Records can be
derived from both discrete and continuous monitoring. The handler should
provide only the appropriate data. For example, if discrete monitoring is
used, then the sample data array should be provided; if continuous
monitoring is used then the average, minimum, and maximum sample data
arrays should be specified. */
void FAR *sampleData;
void FAR *minSampleData;
void FAR *maxSampleData;
void FAR *avgSampleData;
} PQDHTrend;
/* Waveform record template. For a given event, a Waveform record is
added for each quantity and phase as appropriate. Multiple records
can be added to represent a single waveform with different
sampling rates or more sample than this record supports. */
typedef struct PQDHWaveform
{
/* Record attributes: quantity and phase. */
PQDQuantity quantity;
PQDPhase phase;
/* The number of samples in the data array. */
short numberSamples;
/* The time of the first sample relative to the event time
in seconds. */
double startTime;
/* The period of time represented by each sample (i.e., the time step
between each point) in seconds. */
double samplePeriod;
/* Data format specifier. */
PQDFormat format;
/* Conversion values. These values are applied to integer data
to convert it to real values as follows:
realValue[index] = scale * sampleData[index] + bias
For floating point data, bias and scale are not used. They should
should be set to 0.0.
*/
double scale;
double bias;
/* Pointer to the array containing the values. */
void FAR *sampleData;
} PQDHWaveform;
/* Client call-back function selector codes (used by PQDHSetCallBack
and PQDHGetCallBack.) */
typedef enum
{
pqdhCBStatus = 1,
pqdhCBAddFormat,
pqdhCBBeginSite,
pqdhCBEndSite,
pqdhCBEventRequired,
pqdhCBBeginEvent,
pqdhCBEndEvent,
pqdhCBAddEventChar
} PQDHCBSelector;
/* Generic call-back function pointer. */
typedef int (PQDHExtern *PQDHPCBFunction)(void);
// Pointers to client call-back functions.
typedef BOOL (PQDHExtern *PQDHPStatus)(long, long);
typedef BOOL (PQDHExtern *PQDHPAddFormat)(const char FAR *,
const char FAR *);
typedef BOOL (PQDHExtern *PQDHPBeginSite)(const char FAR *,
const char FAR *);
typedef BOOL (PQDHExtern *PQDHPEndSite)(BOOL);
typedef BOOL (PQDHExtern *PQDHPEventRequired)(PQDHCRType,
PQDEventType, PQDQuantity, PQDCharacteristic);
typedef BOOL (PQDHExtern *PQDHPBeginEvent)(const PQDHEvent FAR *);
typedef BOOL (PQDHExtern *PQDHPEndEvent)(BOOL);
typedef BOOL (PQDHExtern *PQDHPAddEventChar)(PQDHCRType, const void FAR *);
// Pointers to handler functions.
typedef BOOL (PQDHExtern *PQDHPOpenHandler)(const char FAR *);
typedef void (PQDHExtern *PQDHPCloseHandler)(void);
typedef long (PQDHExtern *PQDHPGestalt)(short);
typedef BOOL (PQDHExtern *PQDHPGetFormats)(void);
typedef PQDHPDataStore (PQDHExtern *PQDHPOpenDataStore)(char FAR *);
typedef void (PQDHExtern *PQDHPCloseDataStore)(PQDHPDataStore);
typedef BOOL (PQDHExtern *PQDHPGetSites)(PQDHPDataStore);
typedef BOOL (PQDHExtern *PQDHPGetEvents)(PQDHPDataStore,
const char FAR *, PQDDateTime, PQDDateTime);
// Date and Time Value Format codes. Values from the different
// format groups are combined.
enum
{
// Time base group codes.
pqdhDTBase = 0x000f, // Base group mask.
pqdhDTBaseUCT = 0x0000, // UCT based (default.)
pqdhDTBaseLocal = 0x0001, // Local time based.
// Date format group .
pqdhDTDate = 0x00f0, // Date group mask.
pqdhDTDateMDY = 0x0010, // Month/Day/Year
pqdhDTDateD = 0x0020, // Days since 12/31/1899 (includes
// decimal time-of-day.)
// Time format group.
pqdhDTTime = 0x0f00, // Time group mask.
pqdhDTTimeHMS = 0x0100, // Hours:Minutes:Seconds
pqdhDTTimeHMSM = 0x0200, // Hours:Minutes:Seconds:Miliseconds
pqdhDTTimeS = 0x0300 // Seconds since midnight (floating point)
};
/*-----------------------------------------------------------------------
//
// Global Variables.
//
*/
/*-----------------------------------------------------------------------
//
// Functions that are implemented by PQDH.
//
*/
/* Package initialization. */
PQDHExport BOOL PQDHOpen(void);
PQDHExport void PQDHClose(void);
/* Call-back function management. */
PQDHExport void PQDHSetCallBack(PQDHCBSelector cbSelector,
PQDHPCBFunction pCB);
PQDHExport PQDHPCBFunction PQDHGetCallBack(PQDHCBSelector cbSelector);
/* Error processing. */
PQDHExport void PQDHSetError(PQDHErrorType errorType,
const char FAR *errorDesc);
PQDHExport PQDHErrorType PQDHGetErrorType(void);
PQDHExport const char FAR * PQDHGetErrorDesc(void);
/* General utility functions. */
PQDHExport BOOL PQDHStringToDateTime(const char *str, int fmt,
PQDDateTime *dateTime);
PQDHExport int PQDHDateTimeToString(const PQDDateTime dateTime, int fmt,
char *str);
/*-----------------------------------------------------------------------
//
// Functions that are implemented by the Device Data Handler.
//
*/
/* Handler management. */
PQDHExport BOOL PQDHOpenHandler(const char FAR *handlerName);
PQDHExport void PQDHCloseHandler(void);
/* Capability reporting functions. */
PQDHExport long PQDHGestalt(short selectorCode);
/* Handler format reporting functions. */
PQDHExport BOOL PQDHGetFormats(void);
/* Device data access functions. */
PQDHExport PQDHPDataStore PQDHOpenDataStore(char FAR *dataStoreSpec);
PQDHExport void PQDHCloseDataStore(PQDHPDataStore pDataStore);
PQDHExport BOOL PQDHGetSites(PQDHPDataStore pDataStore);
PQDHExport BOOL PQDHGetEvents(PQDHPDataStore pDataStore,
const char FAR *siteName, PQDDateTime start, PQDDateTime end);
/*-----------------------------------------------------------------------
//
// Client Call-back functions that are available to the
// Device Data Handler.
//
*/
/* Status reporting functions. */
PQDHExport BOOL PQDHStatus(long required, long completed);
/* Handler data format definition functions. (Called in response
to a PQDHGetFormats request.) */
PQDHExport BOOL PQDHAddFormat(const char FAR *fmtSpec,
const char FAR *fmtDesc);
/* Site definition functions. (Called in responce to multi-site
funtion requests to define the boundaries of the data for
each site. */
PQDHExport BOOL PQDHBeginSite(const char FAR *siteName,
const char FAR *siteDesc);
PQDHExport BOOL PQDHEndSite(BOOL commit);
/* Characteristic data definition functions (called in response
to a PQDHGetEvents request.) */
PQDHExport BOOL PQDHEventRequired(PQDHCRType crType,
PQDEventType eventType, PQDQuantity qty,
PQDCharacteristic characteristic);
PQDHExport BOOL PQDHBeginEvent(const PQDHEvent FAR *pEventData);
PQDHExport BOOL PQDHEndEvent(BOOL commit);
PQDHExport BOOL PQDHAddEventChar(PQDHCRType crType,
const void FAR * crData);
// Macro's for compatibility with earlier versions of PQDH.
#define PQDHTrigVariation PQDHRMSVariation
#define PQDHAddTrigVariation(pData) PQDHAddEventChar(pqdhCRRMSVariation,pData)
#define PQDHTrigWaveform PQDHWaveFault
#define PQDHAddTrigWaveform(pData) PQDHAddEventChar(pqdhCRWaveFault,pData)
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -