Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::ViscaControl Class Reference

for use with Sony PanTilt Cameras, also compatible with WISKA PanTilt Cameras. More...

#include <PanTilt/ViscaControl.hh>

+ Inheritance diagram for BIAS::ViscaControl:
+ Collaboration diagram for BIAS::ViscaControl:

Public Types

enum  VISCA_CONSTANT { VISCA_ERROR =-1, VISCA_INTERLACED =0, VISCA_PROGRESSIVE }
 

Public Member Functions

void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
void AdressSet ()
 
void CamPower (bool mode)
 
bool ClosePanTiltUnit ()
 
void ContinuousRead ()
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
ViscaControl::VISCA_CONSTANT GetCCDScanningMode ()
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
int GetMaxZoom ()
 
int GetPan ()
 
int GetTilt ()
 
int GetZoom ()
 
bool InitPanTiltUnit (std::string port)
 
bool IsConnected ()
 
void LightOff ()
 
void LightOn ()
 
void ManageAnswer ()
 Answers start with X0, where X is the camera number +8, e.g. More...
 
void MoveAbsolute (short panPos, short tiltPos)
 
void MoveDown ()
 
void MoveDownLeft ()
 
void MoveDownRight ()
 
void MoveHome ()
 
void MoveLeft ()
 
void MovePhysical (short panSteps, short tiltSteps)
 
void MoveRelative (short relPan, short relTilt)
 
void MoveRight ()
 
void MoveStop ()
 
void MoveUp ()
 
void MoveUpLeft ()
 
void MoveUpRight ()
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PanTiltPosInq ()
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void ResetCamCustom ()
 
void ResetPanTilt ()
 
void SetActiveUnit (unsigned char activeUnit)
 
bool SetCCDScanningMode (VISCA_CONSTANT mode)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetPanSpeed (unsigned char panSpeed)
 
void SetTiltSpeed (unsigned char tiltSpeed)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 
 ViscaControl ()
 
void WaitForAck ()
 
void Wash ()
 
void Wipe ()
 
void ZoomDirect (short zoom)
 
void ZoomInq ()
 
void ZoomStop ()
 
void ZoomTele ()
 
void ZoomWide ()
 
 ~ViscaControl ()
 

Static Public Member Functions

static long int GetGlobalDebugLevel ()
 
static void SetGlobalDebugLevel (long int lev)
 

Public Attributes

short int pan_
 
short int tilt_
 
bool used_
 
short int zoom_
 

Protected Member Functions

int CamInitialize_ ()
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
int SendCommand_ (unsigned char *buf, int length, bool manageAnswer=true)
 adresses of cameras start with 1, eg, 0x81 is first cam the reply starts with 0 on 90, e.g. More...
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
unsigned char activeUnit_
 
pthread_mutex_t camMutex
 
bool connected_
 
int maxZoom_
 
unsigned char panSpeed_
 
unsigned char sendBuffer [16]
 
unsigned char * sendPtr
 
BIAS::SerialPortIO serialIO_
 
unsigned char tiltSpeed_
 
bool zoomed_
 

Static Protected Attributes

static std::ostream _zDebugStream
 
static long int GlobalDebugLevel = 0
 

Detailed Description

for use with Sony PanTilt Cameras, also compatible with WISKA PanTilt Cameras.

This is used to control a camera settings. It uses the class SerialPortIO to send commands and receive answers. Also included are some functions of the Camera (MoveUp...), they can be extended as needed (for a full list of functions see the reference manuals for the parts). The commands always start with 8X where X is the camera number, so 1 is the first camera!! and X of {1,...,7}. A broadcast is done with 88. Replies start with 9X and 0!! (unequal to request command!)

Author
ischiller, fnommensen, mfranke
Examples:
ExampleViscaControl.cpp.

Definition at line 57 of file ViscaControl.hh.

Member Enumeration Documentation

Enumerator
VISCA_ERROR 
VISCA_INTERLACED 
VISCA_PROGRESSIVE 

Definition at line 61 of file ViscaControl.hh.

Constructor & Destructor Documentation

ViscaControl::ViscaControl ( )

Definition at line 48 of file ViscaControl.cpp.

ViscaControl::~ViscaControl ( )

Definition at line 67 of file ViscaControl.cpp.

Member Function Documentation

void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

void ViscaControl::AdressSet ( )

Definition at line 383 of file ViscaControl.cpp.

int ViscaControl::CamInitialize_ ( )
protected

Definition at line 346 of file ViscaControl.cpp.

void ViscaControl::CamPower ( bool  mode)
bool ViscaControl::ClosePanTiltUnit ( )
long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

void ViscaControl::ContinuousRead ( )

Definition at line 122 of file ViscaControl.cpp.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

ViscaControl::VISCA_CONSTANT ViscaControl::GetCCDScanningMode ( )
int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

int BIAS::ViscaControl::GetMaxZoom ( )
inline
int BIAS::ViscaControl::GetPan ( )
inline
int BIAS::ViscaControl::GetTilt ( )
inline
int BIAS::ViscaControl::GetZoom ( )
inline

Definition at line 135 of file ViscaControl.hh.

bool ViscaControl::InitPanTiltUnit ( std::string  port)
bool BIAS::ViscaControl::IsConnected ( )
inline
void ViscaControl::LightOff ( )

Definition at line 285 of file ViscaControl.cpp.

void ViscaControl::LightOn ( )

Definition at line 270 of file ViscaControl.cpp.

void ViscaControl::ManageAnswer ( )

Answers start with X0, where X is the camera number +8, e.g.

90 is camera 1

Definition at line 129 of file ViscaControl.cpp.

void ViscaControl::MoveAbsolute ( short  panPos,
short  tiltPos 
)
void ViscaControl::MoveDown ( )

Definition at line 466 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnDown().

void ViscaControl::MoveDownLeft ( )

Definition at line 481 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnDownLeft().

void ViscaControl::MoveDownRight ( )

Definition at line 496 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnDownRight().

void ViscaControl::MoveHome ( )
void ViscaControl::MoveLeft ( )

Definition at line 393 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnLeft().

void ViscaControl::MovePhysical ( short  panSteps,
short  tiltSteps 
)

Definition at line 248 of file ViscaControl.cpp.

void ViscaControl::MoveRelative ( short  relPan,
short  relTilt 
)

Definition at line 206 of file ViscaControl.cpp.

void ViscaControl::MoveRight ( )

Definition at line 408 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnRight().

void ViscaControl::MoveStop ( )
void ViscaControl::MoveUp ( )

Definition at line 422 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnUp().

void ViscaControl::MoveUpLeft ( )

Definition at line 436 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnUpLeft().

void ViscaControl::MoveUpRight ( )

Definition at line 451 of file ViscaControl.cpp.

Referenced by BIAS::wxViscaControlPanelButtons::OnUpRight().

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

looks up a debuglevel in the internal map, returns 0 if not found

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void ViscaControl::PanTiltPosInq ( )

Definition at line 362 of file ViscaControl.cpp.

void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void ViscaControl::ResetCamCustom ( )

Definition at line 578 of file ViscaControl.cpp.

void ViscaControl::ResetPanTilt ( )
int ViscaControl::SendCommand_ ( unsigned char *  buf,
int  length,
bool  manageAnswer = true 
)
protected

adresses of cameras start with 1, eg, 0x81 is first cam the reply starts with 0 on 90, e.g.

0.90 is first cam

Definition at line 105 of file ViscaControl.cpp.

void BIAS::ViscaControl::SetActiveUnit ( unsigned char  activeUnit)
inline

Definition at line 114 of file ViscaControl.hh.

bool ViscaControl::SetCCDScanningMode ( VISCA_CONSTANT  mode)
void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::ViscaControl::SetPanSpeed ( unsigned char  panSpeed)
inline

Definition at line 106 of file ViscaControl.hh.

void BIAS::ViscaControl::SetTiltSpeed ( unsigned char  tiltSpeed)
inline

Definition at line 109 of file ViscaControl.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

void BIAS::ViscaControl::WaitForAck ( )
void ViscaControl::Wash ( )

Definition at line 300 of file ViscaControl.cpp.

void ViscaControl::Wipe ( )

Definition at line 315 of file ViscaControl.cpp.

void ViscaControl::ZoomDirect ( short  zoom)
void ViscaControl::ZoomInq ( )

Definition at line 591 of file ViscaControl.cpp.

void ViscaControl::ZoomStop ( )
void ViscaControl::ZoomTele ( )
void ViscaControl::ZoomWide ( )

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

unsigned char BIAS::ViscaControl::activeUnit_
protected

Definition at line 162 of file ViscaControl.hh.

pthread_mutex_t BIAS::ViscaControl::camMutex
protected

Definition at line 152 of file ViscaControl.hh.

bool BIAS::ViscaControl::connected_
protected

Definition at line 155 of file ViscaControl.hh.

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

int BIAS::ViscaControl::maxZoom_
protected

Definition at line 156 of file ViscaControl.hh.

short int BIAS::ViscaControl::pan_

Definition at line 139 of file ViscaControl.hh.

unsigned char BIAS::ViscaControl::panSpeed_
protected

Definition at line 160 of file ViscaControl.hh.

unsigned char BIAS::ViscaControl::sendBuffer[16]
protected

Definition at line 157 of file ViscaControl.hh.

unsigned char* BIAS::ViscaControl::sendPtr
protected

Definition at line 158 of file ViscaControl.hh.

BIAS::SerialPortIO BIAS::ViscaControl::serialIO_
protected

Definition at line 164 of file ViscaControl.hh.

short int BIAS::ViscaControl::tilt_

Definition at line 139 of file ViscaControl.hh.

unsigned char BIAS::ViscaControl::tiltSpeed_
protected

Definition at line 161 of file ViscaControl.hh.

bool BIAS::ViscaControl::used_

Definition at line 141 of file ViscaControl.hh.

short int BIAS::ViscaControl::zoom_

Definition at line 139 of file ViscaControl.hh.

bool BIAS::ViscaControl::zoomed_
protected

Definition at line 154 of file ViscaControl.hh.


The documentation for this class was generated from the following files: