#ifndef __ORDEVICE_SKELETON_HARDWARE_H__
#define __ORDEVICE_SKELETON_HARDWARE_H__
#include "skeletondevicetester/DeviceBuffer.h"
class ORDeviceSkeletonHardware
{
public:
ORDeviceSkeletonHardware();
~ORDeviceSkeletonHardware();
bool Open();
bool Close();
bool GetSetupInfo ();
bool StartDataStream ();
bool StopDataStream ();
void ResetPacketTimeOffset(FBTime &pTime);
bool FetchDataPacket (FBTime &pTime);
void SetNetworkUse(bool pUse) { mNetworkUse = pUse; }
bool GetNetworkUse() { return mNetworkUse; }
void SetNetworkAddress (const char *pIPAddress){ mNetworkAddress = pIPAddress; }
const char* GetNetworkAddress () { return mNetworkAddress; }
void SetNetworkPort (int pPort) { mNetworkPort = pPort; }
int GetNetworkPort () { return mNetworkPort; }
int GetChannelCount () { return mChannelCount; }
const char* GetChannelName (int pChannel) { return mChannel[pChannel].mName; }
int GetChannelParent(int pChannel) { return mChannel[pChannel].mParentChannel; }
FBVector3d GetDefaultT (
int pChannel) { SkeletonNodeInfo& lSI = mChannel[pChannel];
return FBVector3d(lSI.mDefaultT[0],lSI.mDefaultT[1],lSI.mDefaultT[2]); }
FBVector3d GetDefaultR (
int pChannel) { SkeletonNodeInfo& lSI = mChannel[pChannel];
return FBVector3d(lSI.mDefaultR[0],lSI.mDefaultR[1],lSI.mDefaultR[2]); }
double GetDataTX (int pChannel) { return mChannel[pChannel].mT[0]; }
double GetDataTY (int pChannel) { return mChannel[pChannel].mT[1]; }
double GetDataTZ (int pChannel) { return mChannel[pChannel].mT[2]; }
double GetDataRX (int pChannel) { return mChannel[pChannel].mR[0]; }
double GetDataRY (int pChannel) { return mChannel[pChannel].mR[1]; }
double GetDataRZ (int pChannel) { return mChannel[pChannel].mR[2]; }
private:
struct SkeletonNodeInfo
{
const char* mName;
int mParentChannel;
double mDefaultT[3];
double mDefaultR[3];
double mT[3];
double mR[3];
};
SkeletonNodeInfo mChannel[sSKDataBuffer::ChannelCount];
int mChannelCount;
sSKDataBuffer mSkDataBuffer;
nsTime mPacketTimeOffset;
FBTime mStartRecordingTime;
FBTime mLastSimulationTime;
int mPassCount;
bool mNetworkUse;
FBString mNetworkAddress;
int mNetworkPort;
FBSystem mSystem;
int mSocket;
FBTCPIP mTCP;
};
#endif