DESY ACOP Beans Home

de.desy.acop.video
Class VideoServerConnection

java.lang.Object
  extended by de.desy.acop.video.VideoServerConnection

public class VideoServerConnection
extends java.lang.Object

VideoServerConnection provides the interface for accessing video analysis server.

Author:
Tilen Kusterle, Cosylab

Field Summary
static java.lang.String PROPERTY_A_IMAGE
           
static java.lang.String PROPERTY_BACKGROUND
           
static java.lang.String PROPERTY_PRECISE_BACKGROUND
           
static java.lang.String PROPERTY_PRECISE_BACKGROUND_WIDTH
           
 
Constructor Summary
VideoServerConnection()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener for the specified propertyName.
 void connect()
          Connects this VideoServerConnection to video analysis server.
 void disconnect()
          Disconnects this VideoServerConnection from video analysis server.
 int getAccessRate()
          Gets the selected access rate.
 AImage getAImage()
          Gets current AImage.
 de.desy.tine.types.IMAGE getBackground()
          Gets the background image from analysis server.
 int getBackgroundId()
           
 double[] getPreciseBackground()
          Returns the precise background array.
 int getPreciseBackgroundWidth()
          Returns the precise background width.
static void main(java.lang.String[] args)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener for the specified propertyName.
 void setAccessRate(int accessRate)
           
 void setAnalysisParameters(double threshold, int roiX, int roiY, int roiW, int roiH, int roi2X, int roi2Y, int roi2W, int roi2H, boolean calculateThreshold, boolean performFit)
          Sets the analysis parameters (threshold and region of interest) to analysis server.
 void setBackground(de.desy.tine.types.IMAGE background)
          Sets the background image to analysis server.
 void setConnectionParameters(ConnectionParameters cp)
           
 void setPreciseBackground(double[] background, int width)
          Sets the precise background image array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_A_IMAGE

public static final java.lang.String PROPERTY_A_IMAGE
See Also:
Constant Field Values

PROPERTY_BACKGROUND

public static final java.lang.String PROPERTY_BACKGROUND
See Also:
Constant Field Values

PROPERTY_PRECISE_BACKGROUND

public static final java.lang.String PROPERTY_PRECISE_BACKGROUND
See Also:
Constant Field Values

PROPERTY_PRECISE_BACKGROUND_WIDTH

public static final java.lang.String PROPERTY_PRECISE_BACKGROUND_WIDTH
See Also:
Constant Field Values
Constructor Detail

VideoServerConnection

public VideoServerConnection()
Method Detail

setAnalysisParameters

public void setAnalysisParameters(double threshold,
                                  int roiX,
                                  int roiY,
                                  int roiW,
                                  int roiH,
                                  int roi2X,
                                  int roi2Y,
                                  int roi2W,
                                  int roi2H,
                                  boolean calculateThreshold,
                                  boolean performFit)
                           throws ConnectionFailed
Sets the analysis parameters (threshold and region of interest) to analysis server.

Parameters:
threshold - the threshold
roiX - the region's starting X coordinate
roiY - the region's starting Y coordinate
roiW - the region's width
roiH - the region's height
calculateThreshold - true if the threshold should be calculated by the server or false otherwise
Throws:
ConnectionFailed - if unable to connect

setBackground

public void setBackground(de.desy.tine.types.IMAGE background)
                   throws ConnectionFailed
Sets the background image to analysis server.

Parameters:
background - the background image to set
Throws:
ConnectionFailed - if unable to connect

getBackground

public de.desy.tine.types.IMAGE getBackground()
Gets the background image from analysis server.

Returns:
the background image
Throws:
ConnectionFailed

setPreciseBackground

public void setPreciseBackground(double[] background,
                                 int width)
                          throws ConnectionFailed
Sets the precise background image array.

Parameters:
background - the image array
width - the width of the image
Throws:
ConnectionFailed

getPreciseBackgroundWidth

public int getPreciseBackgroundWidth()
Returns the precise background width.

Returns:
precise background image width

getPreciseBackground

public double[] getPreciseBackground()
Returns the precise background array.

Returns:
the precise background

getBackgroundId

public int getBackgroundId()

connect

public void connect()
             throws ConnectionFailed
Connects this VideoServerConnection to video analysis server.

Throws:
ConnectionFailed - if unable to connect

disconnect

public void disconnect()
Disconnects this VideoServerConnection from video analysis server.


setConnectionParameters

public void setConnectionParameters(ConnectionParameters cp)

getAccessRate

public int getAccessRate()
Gets the selected access rate.

Returns:
the selected access rate

setAccessRate

public void setAccessRate(int accessRate)

getAImage

public AImage getAImage()
Gets current AImage.

Returns:
current AImage

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for the specified propertyName.

Parameters:
propertyName - the name of the property
listener - the PropertyChangeListener to add

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener for the specified propertyName.

Parameters:
propertyName - the name of the property
listener - the PropertyChangeListener to remove

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.

Parameters:
listener - the PropertyChangeListener to add

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener.

Parameters:
listener - the PropertyChangeListener to remove

main

public static void main(java.lang.String[] args)


Copyright © 2010. All Rights Reserved.