#ifndef LOGTHESE_H_
#define LOGTHESE_H_

#include <stdint.h>
#include "mutex.h"

struct PID
{
	double				error;
	double				porportionalTerm;
	double				integralTerm;
	double				derivativeTerm;
	double				output;
	double				saturatedOutput;
};

struct Labjack
{
	double				winchDAC_voltage;                //X.XXX
	double				levelWindDAC_voltage;            //X.XXX
	double 				motorTension;                   // XXX.X
	double	 			flangeTension;                   // XXX.X
	bool				isEndOfTravelLeftSwitchClosed;
	bool				isEndOfTravelRightSwitchClosed;
	bool				isCableLeftSwitchClosed;
	bool				isCableRightSwitchClosed;
};

struct Motor
{
	double				reactiveCurrent;				// In amps  XX.XXX
	double				activeCurrent;					// In amps
	uint32_t			encoderPosition;			    // In counts
	uint32_t			velocity;					    // In counts/sec
	uint32_t			positionError;					// In counts
	uint32_t			velocityError;					// In counts/sed
	uint32_t            temperature;
};

struct ESP
{
	double				depth;                      // XXX.X
	double				accelerationX;                   // X.XXX
	double				accelerationY;
	double				accelerationZ;
	double				angularRateX;
	double				angularRateY;
	double				angularRateZ;
};

class frobner
{
private:
	Mutex				m_ExclusiveAccess;
	PID					m_WinchControl;
	PID					m_LevelWindControl;
	Labjack				m_TensionDitherAndSwitches;
	Motor				m_Winch;
	Motor				m_LevelWind;
	ESP					m_Dynamics;
};


#endif /* LOGTHESE_H_ */
