/*
 *  psychlops_devices_nidaqmxbase.h
 *  Psychlops Standard Library (Universal)
 *
 *  Last Modified 2009/07/30 by Kenchi HOSOKAWA
 *  (C) 2009 Kenchi HOSOKAWA, Kazushi MARUYA, Takao SATO
 */

#ifndef HEADER_PSYCHLOPS_DEVICES_NIDAQMX
#define HEADER_PSYCHLOPS_DEVICES_NIDAQMX

#include "../../core/devices/psychlops_io_analog.h"

namespace Psychlops {

namespace Devices {

	struct NIDAQmxAPI;

	class AnalogInput_NIDAQmx : public AnalogInput {
		protected:
		NIDAQmxAPI *api;

		public:
		AnalogInput_NIDAQmx(const char* devname = "Dev1/ai0");
		AnalogInput_NIDAQmx(double rate, const char* devname = "Dev1/ai0");
		virtual ~AnalogInput_NIDAQmx();
		virtual double get();
		virtual int get(double* buf, int length, double timeout_second);
		virtual double samplingRate();
		virtual void samplingRate(double sample_per_sec);
	};

	class AnalogOutput_NIDAQmx : public AnalogOutput {
		protected:
		NIDAQmxAPI *api;

		public:
		AnalogOutput_NIDAQmx(const char* devname = "Dev1/ao0");
		virtual ~AnalogOutput_NIDAQmx();
		virtual void put(double);
		static void setVoltage(double val, const char* devname = "Dev1/ao0");
	};

}

}	/*	<- namespace Psycholops 	*/



#endif
