init
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// ChannelDefinition.h
|
||||
// --------------------
|
||||
// Defines a data channel (based on DDAS testplan.h)
|
||||
//
|
||||
//
|
||||
// AUTHOR: A. J. Owski
|
||||
// LOC: 1250
|
||||
// DEPT: 5260 Tool Development
|
||||
// (formerly Instrument Systems)
|
||||
//
|
||||
// COPYRIGHT: (c) 2002 DaimlerChrysler Corp.
|
||||
//
|
||||
// REVISIONS: (most-recent at top of list).
|
||||
//
|
||||
// Date Init Description of Change
|
||||
// ---- ---- ---------------------
|
||||
// 11/08/04 wjp Remove redundant CalDate from Channel definition and label the
|
||||
// field as spare bytes. Use the date in the transducer structure,
|
||||
// which is part of the channel definition.
|
||||
//
|
||||
|
||||
#if !defined( CHANNEL_H )
|
||||
#define CHANNEL_H
|
||||
|
||||
#include "TransducerDefinition.h"
|
||||
|
||||
enum ChannelFlags{CHANFLAG_ACTIVE};
|
||||
|
||||
|
||||
// Channel State Macro's
|
||||
|
||||
#define ISCHANACTIVE(pChan)(pChan->Flags&(1<<CHANFLAG_ACTIVE)?1:0)
|
||||
#define SETCHANACTIVE(pChan)(pChan->Flags|=(1<<CHANFLAG_ACTIVE))
|
||||
#define CLRCHANACTIVE(pChan)(pChan->Flags&=(~(1<<CHANFLAG_ACTIVE)))
|
||||
|
||||
|
||||
// Channel Data Structure
|
||||
|
||||
typedef struct tagCHANNEL
|
||||
{
|
||||
short Size; // Size of this object
|
||||
short Flags; // Channel Flags
|
||||
char Name[64]; // Channel Name
|
||||
char Sign[8]; // Sign +, -, or blank
|
||||
char Axis[8]; // X,Y,Z,FX,MX,AX,...
|
||||
float FilterFreq; // Channel Filter Class (in Hz)
|
||||
float SetGain; // Gain setting (1 - n)
|
||||
float ActGain; // Actual (measured?) gain setting.
|
||||
float Rcal; // Shunt cal resistance
|
||||
float Excitation; // Excitation Voltage (when programable)
|
||||
// time_t CalDate; // Calibration date (Remove - redundant)
|
||||
byte byteSpares[4]; // Spare bytes (was Cal Date)
|
||||
TRANSDUCER Transducer; // "Snapshot" of transducer values
|
||||
} CHANNEL;
|
||||
|
||||
typedef CHANNEL *PCHANNEL; // Pointer to a channel
|
||||
typedef CHANNEL *PCHAN; // Even shorter version of above
|
||||
|
||||
#endif // !defined( CHANNEL_H )
|
||||
@@ -0,0 +1,133 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// DDASTestDefinition.h
|
||||
// --------------------
|
||||
// Defines the data acquisition system configuration and channels for a test.
|
||||
//
|
||||
//
|
||||
// AUTHOR: A. J. Owski
|
||||
// LOC: 1250
|
||||
// DEPT: 5260 Tool Development
|
||||
// (formerly Instrument Systems)
|
||||
//
|
||||
// COPYRIGHT: (c) 2002-2004 DaimlerChrysler Corp.
|
||||
//
|
||||
// REVISIONS: (most-recent at top of list).
|
||||
//
|
||||
// Date Init Description of Change
|
||||
// -------- --- ---------------------
|
||||
// 06/22/05 WJP Add support for MemoryOptionFlags bits MEMOPT_PREEVENT and
|
||||
// MEMOPT_PREEVENTXXX, Programmable Pre-Event blocks up to 99 and
|
||||
// 511 introduced in Memory Units versions 2.40 and 3.10,
|
||||
// respectively.
|
||||
// 10/19/04 WJP Add support for channel (analog) triggers.
|
||||
// 04/02/04 WJP General clean up
|
||||
// 07/22/03 WJP Added HardwareType
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef DDASTYPENAME // If these def's aren't def'd,
|
||||
|
||||
#define TESTDEFEXT ".tdf"
|
||||
#define DDASTYPENAME "DDAS V5"
|
||||
#define DDASFILEVERS "Ver 500"
|
||||
|
||||
enum FileTypeFlags
|
||||
{
|
||||
FILETYPE_IMPORTED4X // Test was imported from 4x
|
||||
};
|
||||
|
||||
enum HardwareType // Hardware type values
|
||||
{ // in upper 16 bits of FileTypeFlags
|
||||
HWTYPE_UNKNOWN, // None specified - old DDAS
|
||||
HWTYPE_DDAS3, // DDAS III hardware
|
||||
HWTYPE_KAYSERTHREDE, // Kayser-Threde hardware (future)
|
||||
HWTYPE_COUNT
|
||||
};
|
||||
|
||||
typedef struct tagFILEINFOBLOCK
|
||||
{
|
||||
UINT Size; // Block Size (including nSize)
|
||||
char FileTypeName[12]; // Software Type Name
|
||||
char FileTypeVers[12]; // File Version Name
|
||||
UINT FileTypeFlags; // File Type Flags
|
||||
// - Hardware Type in upper 16 bits
|
||||
// - File Type in lower 16 bits
|
||||
char CreatedByName[16]; // Created by T-number
|
||||
char UpdatedByName[16]; // Updated by T-number
|
||||
}FILEINFOBLOCK;
|
||||
|
||||
|
||||
typedef struct tagDATASYSTEMBLOCK
|
||||
{
|
||||
UINT Size; // Block Size (including nSize)
|
||||
UINT NumberOfSystems; // No of systems in this definition
|
||||
UINT ChannelsPerSystem; // Chan per system in this definition
|
||||
UINT MaxSampleRate; // Max (or default) sample rate
|
||||
UINT SizeOfConfig; // Size of 1 DDASCONFIGBLOCK
|
||||
}DATASYSTEMBLOCK;
|
||||
|
||||
|
||||
typedef struct tagDDASCONFIGBLOCK // One config block per system
|
||||
{
|
||||
UINT Size; // Block Size (including nSize)
|
||||
short AnalogUnitNo; // DDAS analog unit for this test
|
||||
short AnalogOptions; // DDAS analog unit options
|
||||
short MemoryUnitNo; // DDAS memory unit for this test
|
||||
short MemoryOptions; // DDAS memory unit options
|
||||
long MemorySize; // DDAS memory unit RAM (bytes)
|
||||
}DDASCONFIGBLOCK;
|
||||
|
||||
enum AnalogOptionFlags
|
||||
{
|
||||
ANAOPT_CHANTRIGGERS // Analog unit has channel triggers
|
||||
};
|
||||
|
||||
enum MemoryOptionFlags
|
||||
{
|
||||
MEMOPT_TAPEMODE, // Memory unit has tape mode
|
||||
MEMOPT_PREEVENT, // Memory unit can sel pre-event to 99
|
||||
MEMOPT_PREEVENTXXX // Memory unit can sel pre-event to 511
|
||||
};
|
||||
|
||||
|
||||
enum RecordModes
|
||||
{
|
||||
RECORDMODE_EVENT, // Normal (event) mode
|
||||
RECORDMODE_TAPE // Tape (manual) mode
|
||||
};
|
||||
|
||||
|
||||
typedef struct tagACQUISITIONBLOCK // Defines data acq params this test
|
||||
{
|
||||
long nSize; // Block Size (including nSize)
|
||||
long nRecordMode; // Enumerated constant data mode
|
||||
long SampleRate; // Samples per second
|
||||
long TotalSamples; // Total samples in record
|
||||
long PreEventSamples; // Pre-Event samples (Rec Mode only!)
|
||||
long TapeModeChannels; // No of Channels (Tape Mode only!)
|
||||
// long nTrigBlock; // Trigger block size if non-zero
|
||||
long nTrigBlock; // Number of trigger entries (can be 0).
|
||||
}ACQUISITIONBLOCK;
|
||||
|
||||
|
||||
// To enable trigger,
|
||||
// ChanNo and LevelPct must be nonzero
|
||||
// and TRIGCHANDSBL must not be set in LevelPct
|
||||
typedef struct tagTRIGCHANDEF // Defines chan (analog) trigger
|
||||
{
|
||||
BYTE ChanNo; // Channel number to use as trigger
|
||||
BYTE LevelPct; // Trig level in % full scale (0=off)
|
||||
}TRIGCHANDEF; // Trigger when signal exceeds +/-level.
|
||||
|
||||
#define MAXTRIGCHANS 4
|
||||
#define TRIGCHANDSBL 0x80
|
||||
|
||||
typedef struct tagTRIGCHANBLOCK // Defines chan (analog) trigs this test
|
||||
{
|
||||
unsigned short SizeBlock; // Block Size in bytes (including nSize)
|
||||
unsigned short NumTrigs; // Number of entries in array TrigChan
|
||||
TRIGCHANDEF TrigChan[MAXTRIGCHANS]; // Channel (analog) triggers. (NOTE that
|
||||
}TRIGCHANBLOCK; // this will be a variable size array,
|
||||
// but we sized it to 1 to avoid warnings.)
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,166 @@
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// DataFloat.h: interface for the CDataFloat class.
|
||||
// -----------------------------------------------
|
||||
//
|
||||
// REVISIONS:
|
||||
// 6-22-10 AJO Add bool GetTimeAtValue(float fValue, float *pTvalue)
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "FilePath.h" // Added by ClassView for def of CFilePath
|
||||
#include "ChannelDefinition.h" // for def of CHANNEL
|
||||
#include "DDASTestDefinition.h" // for def of FILEINFOBLOCK
|
||||
#include <Afxtempl.h> // CArray definitions
|
||||
|
||||
|
||||
#ifndef TESTPATHSIZE
|
||||
#define TESTPATHSIZE 128
|
||||
#endif
|
||||
|
||||
enum FileTypes {UNKNOWN, FLOATPOINT, PROCESSED}; // File types
|
||||
|
||||
//File Definitions
|
||||
#define FILEERROR -1 // Error in file I/O
|
||||
|
||||
// File Types and Version
|
||||
#define FLOATDATANAME "DDAS FlPt" // Floating Point Data File type
|
||||
#define FLOATDATARAW "DDAS fpRAW" // Float Raw data
|
||||
#define FLOATDATAVER "Ver 500" // Floating Point Data File version
|
||||
|
||||
// Standard Messages
|
||||
#define CantOpenMsg "Could not open file "
|
||||
#define NonExistMsg "Non-existent file "
|
||||
|
||||
typedef struct tagTESTINFO
|
||||
{
|
||||
unsigned long Size; // Block Size (including Size)
|
||||
unsigned long DeviceID; // DAQ device ID
|
||||
long ChannelNo; // Channel number (1-32)
|
||||
long SampleRate; // Samples per second
|
||||
long TotalSamples; // Total samples in data record
|
||||
long PreEventSamples; // Samples before event
|
||||
short ChanNumInSys; // Channel Number (1-128) in system (many devices)
|
||||
short NumPreCalPts; // Number of preCal points included with data
|
||||
short NumPostCalPts; // Number of preCal points included with data
|
||||
char TestCreation[TESTPATHSIZE]; // Test path and date
|
||||
char TimeAxisTitle[32]; // Time axis title
|
||||
byte SpareBytes[2]; // 2 bytes of spare (for 4 byte alignment)
|
||||
|
||||
} TESTINFO;
|
||||
|
||||
typedef struct tagFILEHEADER
|
||||
{
|
||||
FILEINFOBLOCK FileInfo;
|
||||
TESTINFO TestInfo;
|
||||
CHANNEL Channel;
|
||||
|
||||
//---------------the following must add up to 32 bytes -----------------
|
||||
byte SpareBytes[32]; // 32 bytes of spare
|
||||
} FILEHEADER;
|
||||
|
||||
/* DATA PEAK STRUCTURE TYPE DEFINITION */
|
||||
typedef struct tagDATAPEAK
|
||||
{
|
||||
float Min;
|
||||
short Xmin;
|
||||
float Max;
|
||||
short Xmax;
|
||||
} DATAPEAK;
|
||||
|
||||
typedef DATAPEAK *PDATAPEAK; // Pointer to data peak structure
|
||||
typedef DATAPEAK *LPDP; // Pointer to data peak
|
||||
|
||||
// types of peak value calculations
|
||||
enum PeakTypes {PEAKS_MINMAX, PEAKS_3MSCONTIN, PEAKS_3MSCUMUL};
|
||||
|
||||
typedef struct tagDATAHIST // Histogram (number of occurrences) of data values
|
||||
{
|
||||
float fVal; // Data value
|
||||
int nOccurrences; // Number of occurrences in data set
|
||||
// float fX; // First x value of occurrence
|
||||
// int nX; // First x index of occurrence
|
||||
} DATAHIST;
|
||||
|
||||
|
||||
class CDataFloat
|
||||
{
|
||||
public:
|
||||
CDataFloat(unsigned int nSize);
|
||||
CDataFloat();
|
||||
virtual ~CDataFloat();
|
||||
|
||||
class CPeakList
|
||||
{
|
||||
public:
|
||||
CPeakList() { };
|
||||
virtual ~CPeakList() {};
|
||||
void RemoveAll() { m_lstDHist.RemoveAll(); }
|
||||
void AddDataPoint(DATAHIST* pDHist);
|
||||
void Get3msMin(int nPtPer3ms, DATAHIST* pDHist);
|
||||
void Get3msMax(int nPtPer3ms, DATAHIST* pDHist);
|
||||
private:
|
||||
CList<DATAHIST, DATAHIST&> m_lstDHist;
|
||||
// int m_nMaxXIndex;
|
||||
// float m_fMaxXVal;
|
||||
};
|
||||
|
||||
int GetChannelNumberInBox();
|
||||
bool VerifyAndCoerceAxis(bool bNegativeSign, const char* szAxis, BOOL bVerbose);
|
||||
void SetEngrgUnits(char *szNewEngrgUnits);
|
||||
void SetChannelName(char* szNewChannelName);
|
||||
int CalcSampIn3mSecInt();
|
||||
int ConvertTimeToIndex(float fTime);
|
||||
float ConvertIndexToTime(int nIndex);
|
||||
const CString GetFileName();
|
||||
int AppendArrayFloat(CArray<float, float&>* srcArray);
|
||||
CArray<float, float&>* GetDataArray();
|
||||
|
||||
bool GetTimeAtValue(float fValue, float *pTvalue);
|
||||
|
||||
bool GetDataPeaks(int nPkType, int nVerbose, float* pTStart, float* pTEnd, float* pTMin, float* pDMin, float* pTMax, float* pDMax);
|
||||
bool GetDataPeaks(int nPkType, int nVerbose, float* pTMin, float* pDMin, float* pTMax, float* pDMax);
|
||||
bool GetDataPeaks(int nPkType, int nVerbose, int *pXMin, float *pTMin, float *pDMin, int *pXMax, float *pTMax, float *pDMax);
|
||||
|
||||
int GetChannelNumber();
|
||||
float GetStartTime(bool bmSec);
|
||||
float GetStartTimeData(bool bmSec);
|
||||
float GetStopTime(bool bmSec);
|
||||
float GetStopTimeData(bool bmSec);
|
||||
const char* GetFileExt();
|
||||
const char* GetFileTitle();
|
||||
long GetSampleRate();
|
||||
const char* GetFilePathAndName();
|
||||
int SetFilePathAndName(char* szNewFileSpec);
|
||||
int ClearAll(long NewNumberElements);
|
||||
TESTINFO* GetTestInfo();
|
||||
FILEINFOBLOCK* GetFileInfo();
|
||||
CHANNEL* GetChannel();
|
||||
float GetFilterClass();
|
||||
int GetEventOffset();
|
||||
// char* GetDataSetName();
|
||||
CString GetDataSetName(CString &csName);
|
||||
FILEHEADER* CDataFloat::GetFileHeader();
|
||||
bool WriteToFile(const char *lpFilename, bool bPrint);
|
||||
bool ReadFromFile(const char *lpFilename);
|
||||
float* GetDataBuffer();
|
||||
bool SetSize(long lNumberElements);
|
||||
long GetSize();
|
||||
bool GetDataNext(float* fData);
|
||||
bool StoreDataNext(float fData);
|
||||
bool SetIndexToStart();
|
||||
void operator=(const CDataFloat &src);
|
||||
|
||||
// File Extensions
|
||||
#define RawExt ".raw" // Unprocessed Data File Extension
|
||||
#define FlPtExt ".fpd" // Floating Point Data File Extension
|
||||
|
||||
enum FPDVerbosity {FPD_SILENT, // Amount of messages printed
|
||||
FPD_ERRORS, FPD_STATUS, FPD_RESULTS, FPD_VERBOSE};
|
||||
|
||||
protected:
|
||||
void Peak3mS(float *pfDataBlock, PDATAPEAK p3msPeak);
|
||||
CFilePath FilePathAndName;
|
||||
FILEHEADER FileHeader;
|
||||
CArray<float, float&> FloatData; // Floating point Data array
|
||||
float * pfBfr; // working pointer to buffer at FloatData
|
||||
};
|
||||
@@ -0,0 +1,71 @@
|
||||
// FilePath.h: interface for the CFilePath class.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined(AFX_FILEPATH_H__A46C856A_61D3_4A43_A232_12CBDE99D7BE__INCLUDED_)
|
||||
#define AFX_FILEPATH_H__A46C856A_61D3_4A43_A232_12CBDE99D7BE__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
|
||||
#define PATHLENMAX 300 // Longest path length allowed
|
||||
|
||||
enum FileSpecOK
|
||||
{
|
||||
// FileExtOK,
|
||||
// FileNameOK,
|
||||
// FilePathOK,
|
||||
// FileRootOK,
|
||||
// RootDriveSpecified,
|
||||
// RootPathSpecified,
|
||||
// RelativePathSpecified,
|
||||
|
||||
FSPEC_EXTOK = 0x1, // File Extension OK
|
||||
FSPEC_NAMEOK = 0x2, // File Name OK
|
||||
FSPEC_PATHOK = 0x4, // File Path OK
|
||||
FSPEC_ROOTOK = 0x8, // File Drive or computer OK
|
||||
FSPEC_RELATIVEPATH = 0x10 // Path is relative
|
||||
};
|
||||
|
||||
class CFilePath
|
||||
{
|
||||
public:
|
||||
bool IsFileValid(const char* szFileSpec, const char *szFileTypeExt, CString* pcsError);
|
||||
BOOL FileExists();
|
||||
const CString GetFileNameExt();
|
||||
int ParseFilePathAndName(char *szPathAndName);
|
||||
void Clear();
|
||||
const char* GetFileExtension();
|
||||
const char* GetFileName();
|
||||
const char* GetFullFilePathAndName();
|
||||
bool IsFileType(char *szFileTypeExt);
|
||||
bool IsPathComplete(int *pFlgValid);
|
||||
int SetFile(char *szNewFile, int *nNext);
|
||||
bool IsAllValidChars(char* szInString, int* pnPosBad);
|
||||
int SetDir(char *szNewDir, int* nNext);
|
||||
int SetDrive(int nDriveAis1);
|
||||
int SetDriveOrResource(char *szNewDrive, int* nNext);
|
||||
int SetExtension(char *szNewExt);
|
||||
int SetFullFilePathAndName(char* szPathAndName);
|
||||
// int SetFullFilePathAndName(const char* szPathAndName);
|
||||
void operator =(const CFilePath &src);
|
||||
CFilePath();
|
||||
virtual ~CFilePath();
|
||||
|
||||
protected:
|
||||
char* FindLastDir(char *pStrDir);
|
||||
char* FindNextDir(char* pStrDir);
|
||||
int BuildFullPath();
|
||||
int Status;
|
||||
bool AllocString(char **pChar, long nSize);
|
||||
int FreeMem(void** pMem);
|
||||
char* szFullPathNameExt;
|
||||
char* szRootDrvOrComp;
|
||||
char* szDir;
|
||||
char* szName;
|
||||
char* szExt;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_FILEPATH_H__A46C856A_61D3_4A43_A232_12CBDE99D7BE__INCLUDED_)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
process ch0601.fpd * 1.0 "processed"
|
||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user