Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FlirThermalCameraSerialControl.hh
1 /*
2 This file is part of the BIAS library (Basic ImageAlgorithmS).
3 
4 Copyright (C) 2003-2009 (see file CONTACT for details)
5  Multimediale Systeme der Informationsverarbeitung
6  Institut fuer Informatik
7  Christian-Albrechts-Universitaet Kiel
8 
9 
10 BIAS is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14 
15 BIAS is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Lesser General Public License for more details.
19 
20 You should have received a copy of the GNU Lesser General Public License
21 along with BIAS; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24 
25 
26 
27 #ifndef FLIRTHERMALCAMERASERIALCONTROL_HH_
28 #define FLIRTHERMALCAMERASERIALCONTROL_HH_
29 
30 #include <bias_config.h>
31 // BIAS
32 #include <Utils/SerialPortIO.hh>
33 
34 namespace BIAS{
35 
36 enum BIASVideoSource_EXPORT FLIR_STATUS_MESSAGE{
37  CAM_GENERAL_ERROR=-1,
38  CAM_OK=0,
39  CAM_BUSY,
40  CAM_NOT_READY,
41  CAM_RANGE_ERROR,
42  CAM_CHECKSUM_ERROR,
43  CAM_UNDEFINED_PROCESS_ERROR,
44  CAM_UNDEFINED_FUNCTION_ERROR,
45  CAM_TIMEOUT_ERROR,
46  CAM_BYTE_COUNT_ERROR,
47  CAM_FEATURE_ERROR
48 };
49 
50 /**
51 * \class FlirThermalCameraSerialControl
52 * \brief this class is used for serial communication with the FLIR Tau 320 Thermal camera
53 * \brief Use the Set functions to set values to the camera such as FCCMode, Color etc.
54 * \date Jan 12, 2011
55 * \author ischiller
56 */
57 class BIASVideoSource_EXPORT FlirThermalCameraSerialControl {
58  public:
61 
62  /** \brief connect over serial port */
63  FLIR_STATUS_MESSAGE ConnectCamera(std::string port);
64  /** \brief disconnnect camera control*/
65  FLIR_STATUS_MESSAGE DisconnectCamera();
66  /** \brief check whether camera control is connected */
67  bool IsConnected(){return connected_;};
68 
69  /** \brief set default camera parameters */
70  FLIR_STATUS_MESSAGE SetDefaults();
71 
72  /** \brief allowed values are 0,1,4,8
73  * 0=real time
74  * 1 = freeze frame
75  * 4 = 2x zoom
76  * 8 = 4x zoom */
77  FLIR_STATUS_MESSAGE SetVideoMode(unsigned level);
78 
79  /** \brief Set the flat field correction
80  * allowed values 0,1,2 */
81  FLIR_STATUS_MESSAGE SetFFCMode(unsigned mode);
82  /** \brief Set the flat field correction interval in frames*/
83  FLIR_STATUS_MESSAGE SetFFCInterval(unsigned interval, unsigned intervalLowGain);
84  /** \brief Set the flat field correction max temp change*/
85  FLIR_STATUS_MESSAGE SetFFCTempChange(unsigned tmpChange,unsigned tmpChangeLowGain);
86 
87  /** \brief Set the algorithm for Automatic Gain Control*/
88  FLIR_STATUS_MESSAGE SetAGCAlgorithm(unsigned algo);
89 
90  /** \brief set different color shemes
91  * allowed range 0,...,12 */
92  FLIR_STATUS_MESSAGE SetColoring(unsigned color);
93 
94  /** \brief set orientation of video
95  * allowed range 0,...,4
96  * 0 = normal
97  * 1 = Invert
98  * 2 = Revert
99  * 3 = Invert and Revert*/
100  FLIR_STATUS_MESSAGE SetVideoOrientation(unsigned orientation);
101 
102  /** \brief set the video standard
103  * 0=NTSC
104  * 1=PAL*/
105  FLIR_STATUS_MESSAGE SetVideoStandard(unsigned std);
106 
107  FLIR_STATUS_MESSAGE SetOptimization(unsigned optimization);
108 
109  FLIR_STATUS_MESSAGE SetContrast(unsigned contrast);
110  FLIR_STATUS_MESSAGE SetBrightness(unsigned brigthness);
111 
112  /**\brief sets the gain mode */
113  FLIR_STATUS_MESSAGE SetGainMode(unsigned mode);
114  /**\brief sets the gain mode */
115  FLIR_STATUS_MESSAGE SetExternalSync(unsigned sync);
116 
117  /** \brief */
118  FLIR_STATUS_MESSAGE SetSpotMeterMode(unsigned spotmeter);
119  /** \brief */
120  FLIR_STATUS_MESSAGE SetSpotMeterDisplay(unsigned spotmeter);
121  /** \brief */
122  FLIR_STATUS_MESSAGE GetSpotMeterCelcius(double& degree);
123  FLIR_STATUS_MESSAGE GetSensorTemp(double& degree);
124 
125  FLIR_STATUS_MESSAGE GetSerialNumber(std::string &serial);
126  std::string StatusCodeToString(FLIR_STATUS_MESSAGE code);
127 
128  protected:
129  FLIR_STATUS_MESSAGE CheckCameraReply_(unsigned char* buf);
130  FLIR_STATUS_MESSAGE SendCommand_(unsigned char* buf, int length);
131  FLIR_STATUS_MESSAGE GetAnswer_(unsigned char* buf, int length, bool wait=false);
132 
133  protected:
136  std::string serialNumber_;
137  };
138 }
139 #endif /* FLIRTHERMALCAMERASERIALCONTROL_HH_ */
bool IsConnected()
check whether camera control is connected
Communication over the serial port, use OpenPort with e.g.
Definition: SerialPortIO.hh:63
this class is used for serial communication with the FLIR Tau 320 Thermal camera