# Path: Settings/Exceptions.py
# class PtGreyError(Exception):
# 	def __init__(self, error_key=None):
# 		'''CONSTRUCTOR'''
# 		self.__error_messages = {	'import_fc2_error_msg'					: 'flycapture2 library is not installed - see HOWTO.txt to install.', \
# 									'camera_not_connected_error_msg'		: 'Camera is not connected!', \
# 									'camera_not_capturing_error_msg'		: 'Camera has not been started capturing frames!', \
# 									'timeout_capturing_frame_error_msg'		: 'Timeout capturing frame!', \
# 									'wiringpi_not_available_error_msg' 		: 'wiringPi2 is not awailable, cannot use pin control.', \
# 									'failed_capturing_frame_error_msg' 		: 'Failed capturing frame from PtGray (API error)'}
# 
# 		self.msg = None
# 		if error_key != None:
# 			self.msg = self.__error_messages[error_key]
# 
# 	def __str__(self):
# 		return repr(self.msg)
# 
# 	def GetErrorMessage(self, error_key):
# 		'''
# 		 @brief Return all possible error messages
# 		'''
# 		return self.__error_messages[error_key]


import time
			import wiringpi2 as wpi
from Settings.Exceptions import PtGreyError
'''
 Author: Hans Erik Heggem
 Email: hans.erik.heggem@gmail.com
 Project: Master's Thesis - Autonomous Inspection Of Wind Blades
 Repository: Master's Thesis - CV (Computer Vision)
'''


'''
 @brief Pin control class.
 	Control a pin on the microcontroller

 @param pin (uint number)
 @param out_pin (True = pin control OUT, False = pin control IN (default=True))
'''
class PinControl():
	def __init__(self, pin, out_pin=True):
		'''CONSTRUCTOR'''
		try:
			self.__wpi = wpi
		except ImportError:

# Path: Settings/Exceptions.py
# class PtGreyError(Exception):
# 	def __init__(self, error_key=None):
# 		'''CONSTRUCTOR'''
# 		self.__error_messages = {	'import_fc2_error_msg'					: 'flycapture2 library is not installed - see HOWTO.txt to install.', \
# 									'camera_not_connected_error_msg'		: 'Camera is not connected!', \
# 									'camera_not_capturing_error_msg'		: 'Camera has not been started capturing frames!', \
# 									'timeout_capturing_frame_error_msg'		: 'Timeout capturing frame!', \
# 									'wiringpi_not_available_error_msg' 		: 'wiringPi2 is not awailable, cannot use pin control.', \
# 									'failed_capturing_frame_error_msg' 		: 'Failed capturing frame from PtGray (API error)'}
# 
# 		self.msg = None
# 		if error_key != None:
# 			self.msg = self.__error_messages[error_key]
# 
# 	def __str__(self):
# 		return repr(self.msg)
# 
# 	def GetErrorMessage(self, error_key):
# 		'''
# 		 @brief Return all possible error messages
# 		'''
# 		return self.__error_messages[error_key]


# Path: src/DroneVision/DroneVision_src/hardware/PinControl.py
import time
			import wiringpi2 as wpi
from Settings.Exceptions import PtGreyError

'''
 Author: Hans Erik Heggem
 Email: hans.erik.heggem@gmail.com
 Project: Master's Thesis - Autonomous Inspection Of Wind Blades
 Repository: Master's Thesis - CV (Computer Vision)
'''


'''
 @brief Pin control class.
 	Control a pin on the microcontroller

 @param pin (uint number)
 @param out_pin (True = pin control OUT, False = pin control IN (default=True))
'''
class PinControl():
	def __init__(self, pin, out_pin=True):
		'''CONSTRUCTOR'''
		try:
			self.__wpi = wpi
		except ImportError:

			raise PtGreyError('wiringpi_not_available_error_msg')