00001 /*************************************************************************** 00002 l1394_dccregister.h - description 00003 ------------------- 00004 begin : Thu Aug 17 2000 00005 copyright : (C) 2000-2004 by Michael Repplinger 00006 email : repplinger@cs.uni-sb.de 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef L1394DCCREGISTER_H 00019 #define L1394DCCREGISTER_H 00020 #include "l1394_quadlet.h" 00021 #include "l1394_node.h" 00022 #include "l1394_cameraregister.h" 00023 #include "l1394_message.h" 00024 00025 #define DCC_BASE 0xFFFFF0F00000ULL 00026 00027 //ok 00028 namespace L1394{ 00029 00030 /*! \class DccRegister 00031 * \ingroup L1394_Register 00032 * \brief Class DccRegister implements the interface of class CameraRegister for DccCameras. 00033 * 00034 * As described in class CameraRegister, class DccRegister defines how to execute a command 00035 * of class DccCamera . 00036 * 00037 * For example see class DccCamera or class Camera. 00038 * 00039 * Illegal combinations are ignored. 00040 * 00041 *@author Michael Repplinger 00042 */ 00043 00044 class DccRegister : public CameraRegister 00045 { 00046 00047 public: 00048 /*! \name DccRegister constructor 00049 * These functions creates the DccRegister for DccCameras. 00050 */ 00051 //@{ 00052 /*! \fn DccRegister(const Node *parent) 00053 * \brief constructor 00054 * \param Node* parent pointer to parent node 00055 */ 00056 DccRegister(const Node *parent); 00057 00058 00059 /*! \fn ~DccRegister() 00060 * \brief destructor 00061 */ 00062 virtual ~DccRegister() {}; 00063 //@} 00064 00065 /*! \name Camera_register Interface 00066 * These functions implement the CameraRegister interface for DccCameras 00067 */ 00068 //@{ 00069 /*! \fn onePush(const bool one_push = true) const 00070 * \brief This method activates or deactivates one-push mode of a feature 00071 * \param one_push : enable or disable one_push 00072 * \return bool : new status of one-push mode. 00073 */ 00074 virtual bool onePush(const bool one_push = true) const; 00075 00076 00077 /*! \fn on(const bool set) const 00078 * \brief This method enables or disables a feature. 00079 * 00080 * After disabling a feature, no write access has effect until enabling 00081 * the feature again. So this method can be used, to lock (unlock) a 00082 * feature to a value. 00083 * \param set : true enables, false disables the feature. 00084 */ 00085 virtual bool on(const bool on = true) const; 00086 00087 00088 /*! \fn automatic(const bool on = true) const 00089 * \brief This method activates or deactivates the automode of a feature. 00090 * \param on : true enables, false disables the automatic mode of a feature. 00091 * \return bool : new status of automatic mode. 00092 */ 00093 virtual bool automatic(const bool on = true) const; 00094 00095 00096 /*! \fn setValue(const int value) const 00097 * \brief This method changes the parameter of a feature. 00098 * \param value : new value for the feature. 00099 * \return int : value after changing the value. 00100 */ 00101 virtual int setValue(const int value) const; 00102 00103 00104 /*! \fn setTriggerMode(const int value) const 00105 * \brief This method changes the trigger mode of a feature. 00106 * \param value : new value for trigger mode. 00107 * \return int : value after changing the trigger mode. 00108 */ 00109 virtual int setTriggerMode(const int value) const; 00110 00111 00112 /*! \fn setTriggerPolarity(const bool value) const 00113 * \brief This method sets trigger polarity to value (False = low active) 00114 * \param value : new value for trigger mode. 00115 * \return bool : value after changing the trigger mode 00116 */ 00117 virtual bool setTriggerPolarity(const bool value) const; 00118 00119 00120 /*! \fn getValue() const 00121 * \brief This method returns the actual value of a feature. 00122 * \return int : actual value of the feature. 00123 */ 00124 virtual int getValue() const; 00125 00126 00127 /*! \fn getMinValue() const 00128 * \brief This method returns the minimum value of a feature. 00129 * \return int : returns the minimum value of a feature. 00130 */ 00131 virtual int getMinValue() const; 00132 00133 00134 /*! \fn getMaxValue() const 00135 * \brief This method returns the maximum value of a feature. 00136 * \return int : returns the maximum value of a feature. 00137 */ 00138 virtual int getMaxValue() const; 00139 00140 00141 /*! \fn hasFeature() const 00142 * \brief This method tests if a feature is supported by a camera. 00143 * \return bool : true if feature is supported, false if not. 00144 */ 00145 virtual bool hasFeature() const; 00146 00147 00148 /*! \fn hasOnePush() const 00149 * \brief This method tests, if one-push mode is supported by a camera 00150 * \return bool : true if a feature supported this mode, false if not. 00151 */ 00152 virtual bool hasOnePush() const; 00153 00154 00155 /*! \fn hasReadout() const 00156 * \brief This method tests for readout mode of a feature. 00157 * \return bool : true if a feature supports this mode, false if not. 00158 */ 00159 virtual bool hasReadout() const; 00160 00161 00162 /*! \fn hasOnOff() const 00163 * \brief This method tests, if on-off mode is supported by a feature. 00164 * \return bool : true if a feature supports this mode, false if not. 00165 */ 00166 virtual bool hasOnOff() const; 00167 00168 00169 /*! \fn hasAuto() const 00170 * \brief This method tests for auto mode of a feature. 00171 * \return bool : true if auto-mode is supported, false if not. 00172 */ 00173 virtual bool hasAuto() const; 00174 00175 /*! \fn hasManual() const 00176 * \brief This method tests for manual mode of a feature. 00177 * \return bool : true if feature has manual support, false if not. 00178 */ 00179 virtual bool hasManual() const; 00180 //@} 00181 00182 /*! \name Some internal functions 00183 * These methods help to implement the interface. 00184 */ 00185 //@{ 00186 /*! \fn setOffset(int offset) 00187 * \brief This method set the offset register to access a feature. 00188 * 00189 * This method is for internal use only!!! 00190 * \param offset : new register offset 00191 * \return DccRegister* : pointer to this object. 00192 */ 00193 DccRegister* setOffset(int offset) {reg_offset = offset; return this;} 00194 00195 /*! \fn setWhiteBalance(bool value) 00196 * \brief This method is for internal use only!! DON'T use it. 00197 * 00198 * This method sets the bit range for writing values to a register. 00199 * This method will be removed in later versions. 00200 * \param value : true for bit range 12..23, false for 0..11 00201 * \return DccRegister* : pointer to this object. 00202 */ 00203 DccRegister* setWhiteBalance(bool value) {balance = value; return this;} 00204 //@} 00205 private: 00206 mutable bool balance; 00207 DccRegister (const DccRegister&); 00208 int reg_offset, sub_reg_offset; 00209 const Node *parent; 00210 mutable Quadlet data; 00211 Quadlet feature_hi, feature_lo; 00212 internal::Message* message; 00213 }; 00214 } 00215 #endif