ViscaControl Class Reference

Visca control protocol implementation over a serial line. More...

#include <cams/control/visca.h>

List of all members.


Public Member Functions

 ViscaControl (bool blocking=true)
 Constructor.
void open (const char *port)
 Open serial port.
void close ()
 Close port.
void set_address (unsigned int num_cameras)
 Set addresses of cameras.
void clear ()
 Clear.
void send ()
 Send outbound queue.
void recv (unsigned int max_wait_ms=10)
 Receive data.
void recv_ack (unsigned int *socket=NULL)
 Receive ACK packet.
void send_with_reply ()
 Send and wait for reply, blocking.
void send_nonblocking (unsigned int *socket=NULL)
 Send non-blocking.
void cancel_command (unsigned int socket)
 Cancel a running command.
bool data_available ()
 Check data availability.
void process ()
 Process incoming data.
void resetPanTilt ()
 Reset pan/tilt.
void startGetPanTilt ()
 Query for pan/tilt but do not wait until finished This will send an inquire to the camera that asks for pan/tilt values but it does not wait for the data! A later call to getPanTilt will then block and wait until the results arrive.
void setPanTilt (int pan, int tilt)
 Set pan tilt.
void getPanTilt (int *pan, int *tilt)
 Get pan and tilt values.
void setPanTiltLimit (int pan_left, int pan_right, int tilt_up, int tilt_down)
 Set pan tilt limit.
void resetPanTiltLimit ()
 Reset pan/tilt limit.
void resetZoom ()
 Reset zoom.
void setZoom (unsigned int zoom)
 Set zoom.
void getZoom (unsigned int *zoom)
 Get zoom.
void setZoomSpeedTele (unsigned int speed)
 Set zoom speed in tele.
void setZoomSpeedWide (unsigned int speed)
 Set zoom speed in wide angle.
void setZoomDigitalEnabled (bool enabled)
 Enable or disable digital zoome.
void resetEffect ()
 Reset effects.
void applyEffect (unsigned char effect)
 Apply effect.
void applyEffectPastel ()
 Apply pastel effect.
void applyEffectNegArt ()
 Apply negative art effect.
void applyEffectSepia ()
 Apply sepia effect.
void applyEffectBnW ()
 Apply B/W effect.
void applyEffectSolarize ()
 Apply solarize effect.
void applyEffectMosaic ()
 Apply mosaic effect.
void applyEffectSlim ()
 Apply slim effect.
void applyEffectStretch ()
 Apply stretch effect.
unsigned int getWhiteBalanceMode ()
 Get white balance mode.

Static Public Attributes

static const unsigned int VISCA_WHITEBLANCE_AUTO = VISCA_WB_AUTO
 Automatic white balance.
static const unsigned int VISCA_WHITEBALANCE_INDOOR = VISCA_WB_INDOOR
 Indoor white balance preset.
static const unsigned int VISCA_WHITEBALANCE_OUTDOOR = VISCA_WB_OUTDOOR
 Outdoor white balance preset.
static const unsigned int VISCA_WHITEBALANCE_ONE_PUSH = VISCA_WB_ONE_PUSH
 One push white balance preset.
static const unsigned int VISCA_WHITEBALANCE_ATW = VISCA_WB_ATW
 ATW white balance preset.
static const unsigned int VISCA_WHITEBALANCE_MANUAL = VISCA_WB_MANUAL
 Manual white balance.

Detailed Description

Visca control protocol implementation over a serial line.

Author:
Tim Niemueller

Definition at line 51 of file visca.h.


Constructor & Destructor Documentation

ViscaControl::ViscaControl ( bool  blocking = true  ) 

Constructor.

Parameters:
blocking if true, operate in blocking mode, false to operate in non-blocking mode.

Definition at line 89 of file visca.cpp.


Member Function Documentation

void ViscaControl::applyEffect ( unsigned char  filter  ) 

void ViscaControl::applyEffectBnW (  ) 

Apply B/W effect.

Definition at line 1042 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectMosaic (  ) 

Apply mosaic effect.

Definition at line 1068 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectNegArt (  ) 

Apply negative art effect.

Definition at line 1016 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectPastel (  ) 

Apply pastel effect.

Definition at line 1003 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectSepia (  ) 

Apply sepia effect.

Definition at line 1029 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectSlim (  ) 

Apply slim effect.

Definition at line 1081 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectSolarize (  ) 

Apply solarize effect.

Definition at line 1055 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::applyEffectStretch (  ) 

Apply stretch effect.

Definition at line 1094 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::set_effect().

void ViscaControl::cancel_command ( unsigned int  socket  ) 

Cancel a running command.

Parameters:
socket socket that the command was send on

Definition at line 477 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

void ViscaControl::clear (  ) 

Clear.

Definition at line 222 of file visca.cpp.

References fawkes::Exception::append(), recv(), and send().

Referenced by SonyEviD100PControl::open().

void ViscaControl::close (  ) 

Close port.

Definition at line 187 of file visca.cpp.

Referenced by SonyEviD100PControl::close(), open(), and SonyEviD100PControl::open().

bool ViscaControl::data_available (  ) 

Check data availability.

Returns:
true if data is available, false otherwise

Definition at line 271 of file visca.cpp.

Referenced by process().

void ViscaControl::getPanTilt ( int *  pan,
int *  tilt 
)

Get pan and tilt values.

If you used startGetPanTilt() to initiate the query the result is received and returned, otherwise a request is sent and the method blocks until the answer has been received.

Parameters:
pan contains pan upon return
tilt contains tilt upon return

Definition at line 610 of file visca.cpp.

References recv(), send(), and send_with_reply().

Referenced by SonyEviD100PControl::pan(), SonyEviD100PControl::pan_tilt(), SonyEviD100PControl::pan_tilt_rad(), and SonyEviD100PControl::tilt().

unsigned int ViscaControl::getWhiteBalanceMode (  ) 

Get white balance mode.

Returns:
white balance mode

Definition at line 1109 of file visca.cpp.

References fawkes::Exception::append(), recv(), and send_with_reply().

Referenced by SonyEviD100PControl::white_balance_mode().

void ViscaControl::getZoom ( unsigned int *  zoom  ) 

Get zoom.

Parameters:
zoom contains zoom upon return.

Definition at line 911 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::zoom().

void ViscaControl::open ( const char *  port  ) 

Open serial port.

Parameters:
port port to open.

Definition at line 106 of file visca.cpp.

References close().

Referenced by SonyEviD100PControl::open().

void ViscaControl::process (  ) 

Process incoming data.

Definition at line 503 of file visca.cpp.

References data_available(), and recv().

Referenced by SonyEviD100PControl::process_pantilt().

void ViscaControl::recv ( unsigned int  max_wait_ms = 10  ) 

Receive data.

Parameters:
max_wait_ms maximum wait time in miliseconds

Definition at line 283 of file visca.cpp.

References fawkes::Exception::append().

Referenced by clear(), getPanTilt(), getWhiteBalanceMode(), process(), send_with_reply(), and set_address().

void ViscaControl::recv_ack ( unsigned int *  socket = NULL  ) 

Receive ACK packet.

Parameters:
socket contains the socket that the ACK was received on upon return

Definition at line 320 of file visca.cpp.

References fawkes::Exception::append().

Referenced by send_nonblocking().

void ViscaControl::resetEffect (  ) 

Reset effects.

Definition at line 990 of file visca.cpp.

References fawkes::Exception::append(), and applyEffect().

Referenced by SonyEviD100PControl::reset_effect(), and SonyEviD100PControl::set_effect().

void ViscaControl::resetPanTilt (  ) 

Reset pan/tilt.

Definition at line 800 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::reset_pan_tilt().

void ViscaControl::resetPanTiltLimit (  ) 

Reset pan/tilt limit.

Definition at line 718 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::reset_pan_tilt_limit().

void ViscaControl::resetZoom (  ) 

Reset zoom.

Definition at line 818 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::reset_zoom().

void ViscaControl::send (  ) 

Send outbound queue.

Definition at line 243 of file visca.cpp.

Referenced by clear(), getPanTilt(), send_nonblocking(), send_with_reply(), set_address(), and startGetPanTilt().

void ViscaControl::send_nonblocking ( unsigned int *  socket = NULL  ) 

Send non-blocking.

Does a non-blocking send.

Parameters:
socket the socket that was used to send the request.

Definition at line 355 of file visca.cpp.

References fawkes::Exception::append(), recv_ack(), and send().

Referenced by setPanTilt().

void ViscaControl::send_with_reply (  ) 

void ViscaControl::set_address ( unsigned int  num_cameras  ) 

Set addresses of cameras.

Parameters:
num_cameras number of cameras on bus

Definition at line 200 of file visca.cpp.

References fawkes::Exception::append(), recv(), and send().

Referenced by SonyEviD100PControl::open().

void ViscaControl::setPanTilt ( int  pan,
int  tilt 
)

Set pan tilt.

Parameters:
pan pan
tilt tilt

Definition at line 525 of file visca.cpp.

References fawkes::Exception::append(), send_nonblocking(), and send_with_reply().

Referenced by SonyEviD100PControl::set_pan(), SonyEviD100PControl::set_pan_tilt(), and SonyEviD100PControl::set_tilt().

void ViscaControl::setPanTiltLimit ( int  pan_left,
int  pan_right,
int  tilt_up,
int  tilt_down 
)

Set pan tilt limit.

Parameters:
pan_left most left pan value
pan_right most right pan value
tilt_up most up tilt value
tilt_down most down tilt value

Definition at line 755 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::set_pan_tilt_limit().

void ViscaControl::setZoom ( unsigned int  zoom  ) 

Set zoom.

Parameters:
zoom zoom value

Definition at line 885 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::set_zoom().

void ViscaControl::setZoomDigitalEnabled ( bool  enabled  ) 

Enable or disable digital zoome.

Parameters:
enabled true to enable digital zoom, false to disable

Definition at line 946 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::set_zoom_digital_enabled().

void ViscaControl::setZoomSpeedTele ( unsigned int  speed  ) 

Set zoom speed in tele.

Parameters:
speed speed

Definition at line 839 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::set_zoom_speed_tele().

void ViscaControl::setZoomSpeedWide ( unsigned int  speed  ) 

Set zoom speed in wide angle.

Parameters:
speed speed

Definition at line 862 of file visca.cpp.

References fawkes::Exception::append(), and send_with_reply().

Referenced by SonyEviD100PControl::set_zoom_speed_wide().

void ViscaControl::startGetPanTilt (  ) 

Query for pan/tilt but do not wait until finished This will send an inquire to the camera that asks for pan/tilt values but it does not wait for the data! A later call to getPanTilt will then block and wait until the results arrive.

Initiate a pan/tilt request, but do not wait for the reply.

Not that you can _not_ run another inquire (get*) method until this call has finished! You will get VISCA_E_INQRUNNING as error message.

Definition at line 581 of file visca.cpp.

References fawkes::Exception::append(), and send().

Referenced by SonyEviD100PControl::start_get_pan_tilt().


Member Data Documentation

const unsigned int ViscaControl::VISCA_WHITEBALANCE_ATW = VISCA_WB_ATW [static]

ATW white balance preset.

Definition at line 58 of file visca.h.

const unsigned int ViscaControl::VISCA_WHITEBALANCE_INDOOR = VISCA_WB_INDOOR [static]

Indoor white balance preset.

Definition at line 55 of file visca.h.

const unsigned int ViscaControl::VISCA_WHITEBALANCE_MANUAL = VISCA_WB_MANUAL [static]

Manual white balance.

Definition at line 59 of file visca.h.

const unsigned int ViscaControl::VISCA_WHITEBALANCE_ONE_PUSH = VISCA_WB_ONE_PUSH [static]

One push white balance preset.

Definition at line 57 of file visca.h.

const unsigned int ViscaControl::VISCA_WHITEBALANCE_OUTDOOR = VISCA_WB_OUTDOOR [static]

Outdoor white balance preset.

Definition at line 56 of file visca.h.

const unsigned int ViscaControl::VISCA_WHITEBLANCE_AUTO = VISCA_WB_AUTO [static]

Automatic white balance.

Definition at line 54 of file visca.h.


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