Device Class Definitions for the Upgrade Front-End Project


Functions for the Device class and its sub-classes


Include files for Device class object definitions


To incorporate the Device class definitions in your C source file you must have the following statement line in that file:

#include "device_class.h"

This will define all of the data types and functions which are required to access objects of the Device class and their methods (functions).


Types Declared for Device class objects


DvIdentifier
Structure containing a device identifier (four bytes in the current implementation)

DvType
Enumerated type designating the type (subclass) of device

DvIndex
Integer designating the instance of the device

DvStatus
Status returned by device class procedures

Device Superclass Functions


Function devInitialize - Initialize a Device Object

Usage Template:
DvIdentifier devInitialize(const DvDevice *device, const DvType type, unsigned int index)

Description:

Inputs:
device - Device object structure
type - Device class type
index - Device class index

Outputs:
none

Returns:
DvIdentifier - Device identifier

Function devGetIndex - Get the Index of a Device Object

Usage Template:
unsigned int devGetIndex(const DvIdentifier devId)

Description:

Inputs:
devId - Device identifier

Outputs:
none

Returns:
DvIndex - Device class index

Function devGetType - Get the Type of a Device Object

Usage Template:
DvType devGetType(const DvIdentifier devId)

Description:

Inputs:
devId - Device identifier

Outputs:
none

Returns:
DvType - Device class type

Distribution Device Class Functions


Function dstAddPoint - Add a New Point to a Distribution Object

Usage Template:
DvStatus dstAddPoint(const DvIdentifier distId, const float value)

Description:

Inputs:
distId - Distribution object identifier
value - Value of the new point

Outputs:
none

Returns:
DvStatus:

Function dstClassCreate - Create the Distribution Class Context

Usage Template:
DvStatus dstClassCreate(const unsigned int maxIds)

Description:

Inputs:
maxIds - Maximum number of class members (instances)

Outputs:
none

Returns:
DvStatus:

Function dstClassDelete - Delete the Distribution Class Context

Usage Template:
DvStatus dstClassDelete(void)

Description:

Inputs:
none

Outputs:
none

Returns:
DvStatus:

Function dstClear - Clear a Distribution Object

Usage Template:
DvStatus dstClear(const DvIdentifier distId)

Description:

Inputs:
distId - Distribution object identifier

Outputs:
none

Returns:
DvStatus:

Function dstCreate - Create a New Distribution Object

Usage Template:
DvStatus dstCreate(DvIdentifier *distId)

Description:

Inputs:
none

Outputs:
distId - Distribution object identifier

Returns:
DvStatus:

Function dstDelete - Delete an Existing Distribution Object

Usage Template:
DvStatus dstDelete(const DvIdentifier distId)

Description:

Inputs:
distId - Distribution object identifier

Outputs:
none

Returns:
DvStatus:

Function dstGetMean - Get the Mean of a Distribution Object

Usage Template:
DvStatus dstGetMean(const DvIdentifier distId, float *mean)

Description:

Inputs:
distId - Distribution object identifier

Outputs:
mean - First moment of the distribution

Returns:
DvStatus:

Function dstGetMoments - Get the Moments of a Distribution Object

Usage Template:
DvStatus dstGetMoments(const DvIdentifier distId, float *count, float *mean, float *variance)

Description:

Inputs:
distId - Distribution object identifier

Outputs:
count - Pointer to count of points in the distribution
mean - Pointer to first moment of the distribution
variance - Pointer to second central moment of the distribution

Returns:
DvStatus:

Function dstGetVariance - Get the Variance of a Distribution Object

Usage Template:
DvStatus dstGetVariance(const DvIdentifier distId, float *variance)

Description:

Inputs:
distId - Distribution object identifier

Outputs:
variance - Pointer to second central moment of the distribution

Returns:
DvStatus:

FunctiondstShow - Show the Contents of a Distribution Object

Usage Template:
DvStatus dstShow(const DvIdentifier distId)

Description:

Inputs:
distId - Distribution object identifier

Outputs:
none

Returns:
DvStatus:

Histogram Device Class Functions


Function hstAddPoint - Add a New Point to a Histogram Object

Usage Template:
DvStatus hstAddPoint(const DvIdentifier histId, const float value)

Description:

Inputs:
histId - Histogram object identifier
value - Value of the new point

Outputs:
none

Returns:
DvStatus:

Function hstClear - Clear a Histogram Object

Usage Template:
DvStatus hstClear(const DvIdentifier histId)

Description:

Inputs:
histId - Histogram identifier

Outputs:
none

Returns:
DvStatus:

Function hstCreate - Create a New Histogram Object

Usage Template:
DvStatus hstCreate(DvIdentifier *histId, unsigned int cellCount, float loLimit, float hiLimit)

Description:

Inputs:
cellCount - Number of histogram cells
loLimit - Lower limit of the histogramming range
hiLimit - Upper limit of the histogramming range

Outputs:
histId - Histogram identifier

Returns:
DvStatus:

Function hstDelete - Delete an Existing Histogram Object

Usage Template:
DvStatus hstDelete(const DvIdentifier distId)

Description:

Inputs:
histId - Histogram object identifier

Outputs:
none

Returns:
DvStatus:

Function hstGetCells - Get the Cumulative Cell Counts of a Histogram Object

Usage Template:
DvStatus hstGetCells(const DvIdentifier histId, const unsigned int size, unsigned short int cells[], unsigned int *length, unsigned short int *underflow, unsigned short int *overflow)

Description:

Inputs:
histId - Histogram object identifier
size - Size of cell array (in units of short int)

Outputs:
cells - Array of cell counts
length - Number of cells written to the cell array (optional)
underflow - Counts in the underflow cell (optional)
overflow - Counts in the overflow cell (optional)

Returns:
DvStatus:

Function hstGetMean - Get the Mean of a Histogram Object

Usage Template:
DvStatus hstGetMean(const DvIdentifier distId, float *mean)

Description:

Inputs:
histId - Histogram object identifier

Outputs:
mean - Pointer to first moment of the histogram

Returns:
DvStatus:

Function hstGetMoments - Get the Moments of a Histogram Object

Usage Template:
DvStatus hstGetMoments(const DvIdentifier distId, float *count, float *mean, float *variance)

Description:

Inputs:
histId - Histogram object identifier

Outputs:
count - Pointer to count of points in the histogram
mean - Pointer to first moment of the histogram
variance - Pointer to second central moment of the histogram

Returns:
DvStatus:

Function hstGetParameters - Get the Parameters of a Histogram Object

Usage Template:
DvStatus hstGetParameters(const DvIdentifier histId, unsigned int *cellCount, float *loLimit, float *hiLimit)

Description:

Inputs:
histId - Histogram object identifier

Outputs:
cellCount - Number of histogram cells
loLimit - Lower limit of the histogramming range
hiLimit - Upper limit of the histogramming range

Returns:
DvStatus:

Function hstGetVariance - Get the Variance of a Histogram Object

Usage Template:
DvStatus hstGetVariance(const DvIdentifier distId, float *variance)

Description:

Inputs:
histId - Histogram object identifier

Outputs:
variance - Pointer to second central moment of the histogram

Returns:
DvStatus:

Function hstShow - Show the Contents of a Histogram Object

Usage Template:
DvStatus hstShow(const DvIdentifier distId)

Description:

Inputs:
histId - Histogram object identifier

Outputs:
none

Returns:
DvStatus:

jfb
Last updated: 23-Feb-1995