using System;

namespace LabJack
{
	public class Error
	{
		public Error() {}

		public string getError(int err)
		{
			switch(err)
			{
				case 0: return "No error";
				case -1: return "Error";
				case -2: return "Error: Could not find device";
				case -3: return "Error : Problem Communicating with Device";
				case -4: return "Error : Could not close USB device";
				
				case -10: return "Error : received wrong command bytes";
				case -11: return "Error : bad IP address";
				case -12: return "Error : received bad checksum";
				case -13: return "Error : received buffer has wrong IOType";
				case -14: return "Error : send failed";
				case -15: return "Error : receive failed";
				case -16: return "Error : received bad checksum16";
				case -17: return "Error : received bad checksum8";
				case -18: return "Errorcode : ";
				case -19: return "Error : Invalid TimerClockDivisor";
 				
				case -50: return "Error : binaryToCalibratedAnalogVoltage error";
				case -51: return "Error : binaryToCalibratedAnalogTemperature error";
				case -52: return "Error : analogToCalibratedBinaryVoltage error";
				case -53: return "Error : binaryToUncalibratedAnalogVoltage error";
				case -54: return "Error : getCalibrationInfo write failed";
				case -55: return "Error : getCalibrationInfo read failed";
				case -56: return "Error : getCalibrationInfo error";
	
				//	
				//Error codes for old functions
				//
				case -5: return "Error : getAnalogCalibrationInfo error";
				case -6: return "Error : translateUncalibratedVoltage error";
				case -7: return "Error : getAnalogCalibrationInfo has invalid gainBip";
				case -8: return "Error : getAnalogCalibrationInfo send failed";
				case -9: return "Error : getAnalogCalibrationInfo receive failed";

				default: return "Unknown error";
			}
		}
	}
}
