Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

l1394_avccameraregister.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           l1394avccameraregister.cpp  -  description
00003                              -------------------
00004     begin                : Wed Oct 25 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 #include "l1394_avccameraregister.h"
00019 #include "l1394_fcpnode.h"
00020 #include "l1394_message.h"
00021 namespace L1394{
00022 AvcCameraRegister::AvcCameraRegister(const FcpNode* parent_node, const int subunit_value)
00023   : AvcRegister(parent_node, subunit_value)
00024 {
00025 }
00026 AvcCameraRegister::~AvcCameraRegister()
00027 {
00028 
00029 }
00030 
00031 
00032 bool AvcCameraRegister::onePush(bool)  const
00033 {
00034   data_array->setByte(3,0x64);
00035   if(parent_node->send(*data_array).getByte(0) == ACCEPTED)
00036     return true;
00037   return false;
00038 }
00039 
00040 
00041 bool AvcCameraRegister::automatic(bool )const
00042 {
00043   QArray tmp_array(2);
00044   tmp_array.setByte(0, CONTROL);
00045   tmp_array.setByte(1, subunit_value);
00046   tmp_array.setByte(2, opcode);
00047 
00048   parent_node->send(tmp_array);
00049   return this;
00050 }
00051 
00052 
00053 int AvcCameraRegister::setValue(int value)    const
00054 {
00055   data_array->setByte(0,STATUS);
00056   data_array->setByte(0,0xff);/*?????*/
00057   QArray temp_array(data_array->getSize());
00058   temp_array = parent_node->send(*data_array);
00059   if (temp_array.getByte(0) != NOT_IMPLEMENTED)
00060   {
00061     if (temp_array.getByte(3)< value)
00062     {
00063       data_array->setByte(0,CONTROL);
00064       data_array->setByte(3,0x01);
00065       for (int i = 0; i<(value-temp_array.getByte(3));i++)
00066         parent_node->send(*data_array);
00067     }
00068 
00069     if (temp_array.getByte(3)> value)
00070     {
00071       data_array->setByte(0,CONTROL);
00072       data_array->setByte(3,0x02);
00073       for (int i = 0; i<(temp_array.getByte(3)-value);i++)
00074         parent_node->send(*data_array);
00075     }
00076   }
00077   return 0;
00078 }
00079 
00080 
00081 
00082 int AvcCameraRegister::setTriggerMode(int )    const
00083 {
00084   return 0;
00085 }
00086 
00087 
00088 bool AvcCameraRegister::setTriggerPolarity(bool)const
00089 {
00090   return false;
00091 }
00092 
00093 int AvcCameraRegister::getValue()                      const
00094 {
00095   data_array->setByte(0,STATUS);
00096   if (data_array->getSize() == 1)
00097     return   parent_node->send(*data_array).getByte(3);
00098   else
00099     internal::SMessage::getInstance()->errorStream() << "AvcCameraRegister : unhandled case in getValue" << endl;
00100   return 0;
00101 }
00102 
00103 
00104 
00105 int AvcCameraRegister::getMinValue()const //assuming 0 for all min calues
00106 {
00107   return 0;
00108 }
00109 
00110 
00111 int AvcCameraRegister::getMaxValue() const//assuming 0xff for all max values
00112 {
00113   return 0xff;
00114 }
00115 
00116 
00117 bool AvcCameraRegister::hasFeature()const
00118 {
00119   data_array->setByte(0, SPECIFIC_INQUIRY);
00120   data_array->setByte(3, 0xff);
00121   if (parent_node->send(*data_array).getByte(0) == IMPLEMENTED)
00122     return  true;
00123 
00124   return false;
00125 }
00126 
00127 
00128 bool AvcCameraRegister::hasOnePush()const
00129 {
00130   return false;
00131 }
00132 
00133 
00134 bool AvcCameraRegister::hasReadout()const
00135 {
00136   return false;
00137 }
00138 
00139 
00140 bool AvcCameraRegister::hasOnOff()  const
00141 {
00142   return false;
00143 }
00144 
00145 
00146 bool AvcCameraRegister::hasAuto()  const
00147 {
00148   return false;
00149 }
00150 
00151 
00152 bool AvcCameraRegister::hasManual()  const
00153 {
00154   return false;
00155 }
00156 
00157 
00158 
00159 
00160 }

Generated on Wed Aug 24 00:36:39 2005 for L1394 by doxygen 1.4.2
L1394 library (NMM) grahics.cs.uni-sb.de/~repplix/l1394_home/