Class AF2Impl

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by iAF2.AF2InterfacePOA
          extended by AF2Impl
All Implemented Interfaces:
iAF2.AF2InterfaceOperations, org.omg.CORBA.portable.InvokeHandler

 class AF2Impl
extends iAF2.AF2InterfacePOA

The class AF2Impl contains the implementation methods for the AF2 CORBA interface. All CORBA method calls enter here.


Field Summary
private  boolean abortInProgress
           
private  long MIN_ROBOT_LIMIT_SWITCH_STATUS_UPDATE_PERIOD
           
private  long MIN_ROBOT_STATUS_UPDATE_PERIOD
           
private  Stopwatch robotLimitSwitchUpdateTimer
           
private  Stopwatch robotUpdateTimer
           
private  Configuration theConfiguration
           
(package private) static FibreModule theFibreModule
           
private  Robot theRobot
           
private  RobotEncoder theRobotEncoder
           
private  iAF2.RobotStatus theRobotStatus
           
private  Setup theSetup
           
private  UserMode theUserMode
           
 
Constructor Summary
AF2Impl()
           
 
Method Summary
 void abort()
          Abort a setup or load module
 iAF2.Position centroid()
          Perform a centroid on the TV system and return the centroid position
 void circleFibres()
          Set all of the fibres to the circle position
 void closeGripper()
          Close the gripper jaws
 java.lang.String commandMotionController(java.lang.String command)
          Issue a command to the motion controller
 void disableFibre(int fibreNumber)
          Disable a fibre
 void enableFibre(int fibreNumber)
          Enable a fibre
 void exit()
          Exit the AF2 server
 void extractRobot()
          Extract the robot from its limit switches
 iAF2.RobotAxisConfiguration getAxisConfiguration(iAF2.RobotAxis axis)
          Get the configuration of an axis
 iAF2.FibreModuleStatus getFibreModuleStatus()
          Get the fibre module status
 iAF2.Fibre getFibreStatus(int fibreNumber)
          Get the fibre status
 iAF2.RobotGripperConfiguration getGripperJawConfiguration()
          Get the gripper jaw height configuration
private  MotionControllerAxis getMotionControllerAxis(iAF2.RobotAxis axis)
          Convert the iAF2.RobotAxis to the correct MotionController axis
 iAF2.RobotStatus getRobotStatus()
          Get the robot status
 iAF2.Position getSkyViewProbeOffset()
          Get the offset between the gripper centre and sky viewing probe in x and y
 void initialiseRobot()
          Initialise the robot
 boolean isConfigurationValid(java.lang.String[] theConfigurationData, java.lang.String siderealTime)
          Check the validity of the configuration data
private  boolean isRobotLimitSwitchStatusUpdateRequired()
          Is a robot limit switch status update required.
private  boolean isRobotStatusUpdateRequired()
          Is a robot status update required.
 boolean isSetupInProgress()
          Check whether a setup is in progress
 void killFibre(int fibreNumber)
          Kill a fibre, causing it to be permanently disabled
 void loadFibre(int fibreNumber)
          Load a fibre
 void loadFibreHere(int fibreNumber)
          Load a fibre at the current robot position
 void loadModule()
          Load all of the fibres in the fibre module
 void loadModuleAll()
          Load all of the fibres in the fibre module continuing in the event of failure to find fibres
 void map(java.lang.String[] theConfigurationData, java.lang.String siderealTime)
          Construct a distortion map of the Prime Focus field using a standard set of star positions, and star centroid information produced by the autoguider
 void moveFibre(int fibreNumber, int positionX, int positionY)
          Move a fibre to the specified coordinates
 void moveProbe(int positionProbe)
          Move the single axis probe to the specified position
 void moveRobot(int positionX, int positionY)
          Move the robot to the specified position
 void moveTheta(int positionTheta)
          Rotate the gripper jaws to the specified angle (in arcmins)
 void moveZ(int positionZ)
          Move the gripper jaws up or down to the specified position
 void offsetFibre(int fibreNumber, int offsetX, int offsetY)
          Offset the fibre by the specified amount in x and y
 void offsetRobot(int offsetX, int offsetY)
          Offset the robot by the specified amount in x and y
 void openGripper()
          Open the gripper jaws
 void parkFibre(int fibreNumber)
          Place a fibre in its park position
 void parkFibres()
          Place all fibres in their park position
 void parkRobot()
          Park the robot
 void ping()
          Ping the instrument to verify a connection
 void recoverFibre()
          Recover a fibre lost during a setup
 void reset()
          Reset the AF2 server
 void ringFibre(int fibreNumber)
          Inform the AF2 system that a fibre has been manually placed in the load ring
 void ringFibres()
          Inform the AF2 system that all fibres have been manually placed in the load ring
 void saveAxisConfiguration()
          Save the robot's axis configuration
 void setAxisConfiguration(iAF2.RobotAxis axis, iAF2.RobotAxisConfiguration configuration)
          Set the configuration of an axis
 void setBackIlluminationOff()
          Set the AF2 back illumination system off
 void setBackIlluminationOn()
          Set the AF2 back illumination system on
 void setEngineeringUserMode(java.lang.String password)
          Set engineering user mode on
 void setExtendedUserMode(java.lang.String password)
          Set extended user mode on
 void setGripperJawConfiguration(iAF2.RobotGripperConfiguration gripperConfiguration)
          Set the gripper jaw height configuration
 void setInspectionLightsOff()
          Set the inspection lights off
 void setInspectionLightsOn()
          Set the inspection lights on
 void setInstrumentPowerOff()
          Set the instrument power off
 void setInstrumentPowerOn()
          Set the instrument power on
 void setIterations(int numberOfFibrePlacementIterations)
          Set the maximum number of fibre placement iterations for a setup to the specified value
 void setMotorPowerOff()
          Set the motor power off
 void setMotorPowerOn()
          Set the motor power on
 void setNormalUserMode()
          Set normal user mode on
 void setSkyViewProbeOffset(int offsetX, int offsetY)
          Set the offset between the gripper centre and sky viewing probe in x and y
 void setTolerance(int fibrePlacementToleranceInMicrons)
          Set the positioning tolerance for fibre placements to the specified value in microns
 void setup(java.lang.String[] theConfigurationData, java.lang.String siderealTime)
          Perform a field setup on the specified configuration data
 void sleepRobot()
          Sleep the robot
private  void updateLimitSwitchStatus(iAF2.RobotStatus theRobotStatus)
          Update the state of the axis limit switches
 void viewFibre(int fibreNumber)
          View the specified fibre
 void viewObject(int objectNumber)
          View the specified object
 void viewSky(int positionX, int positionY)
          View the sky at the specified position
private  void waitSetupFinished()
          Wait for a setup to complete
 void wakeRobot()
          Wake the robot
 int whichFibre()
          Return the number of the fibre which failed during a setup
 
Methods inherited from class iAF2.AF2InterfacePOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_ROBOT_STATUS_UPDATE_PERIOD

private final long MIN_ROBOT_STATUS_UPDATE_PERIOD
See Also:
Constant Field Values

MIN_ROBOT_LIMIT_SWITCH_STATUS_UPDATE_PERIOD

private final long MIN_ROBOT_LIMIT_SWITCH_STATUS_UPDATE_PERIOD
See Also:
Constant Field Values

theRobot

private Robot theRobot

theRobotEncoder

private RobotEncoder theRobotEncoder

theRobotStatus

private iAF2.RobotStatus theRobotStatus

robotUpdateTimer

private Stopwatch robotUpdateTimer

robotLimitSwitchUpdateTimer

private Stopwatch robotLimitSwitchUpdateTimer

theFibreModule

static FibreModule theFibreModule

theConfiguration

private Configuration theConfiguration

theSetup

private Setup theSetup

theUserMode

private UserMode theUserMode

abortInProgress

private boolean abortInProgress
Constructor Detail

AF2Impl

public AF2Impl()
Method Detail

abort

public void abort()
           throws iAF2.AF2Error
Abort a setup or load module

Throws:
iAF2.AF2Error

centroid

public iAF2.Position centroid()
                       throws iAF2.AF2Error
Perform a centroid on the TV system and return the centroid position

Throws:
iAF2.AF2Error

circleFibres

public void circleFibres()
                  throws iAF2.AF2Error
Set all of the fibres to the circle position

Throws:
iAF2.AF2Error

closeGripper

public void closeGripper()
                  throws iAF2.AF2Error
Close the gripper jaws

Throws:
iAF2.AF2Error

commandMotionController

public java.lang.String commandMotionController(java.lang.String command)
                                         throws iAF2.AF2Error
Issue a command to the motion controller

Throws:
iAF2.AF2Error

disableFibre

public void disableFibre(int fibreNumber)
                  throws iAF2.AF2Error
Disable a fibre

Throws:
iAF2.AF2Error

enableFibre

public void enableFibre(int fibreNumber)
                 throws iAF2.AF2Error
Enable a fibre

Throws:
iAF2.AF2Error

exit

public void exit()
Exit the AF2 server


extractRobot

public void extractRobot()
                  throws iAF2.AF2Error
Extract the robot from its limit switches

Throws:
iAF2.AF2Error

initialiseRobot

public void initialiseRobot()
                     throws iAF2.AF2Error
Initialise the robot

Throws:
iAF2.AF2Error

isConfigurationValid

public boolean isConfigurationValid(java.lang.String[] theConfigurationData,
                                    java.lang.String siderealTime)
                             throws iAF2.AF2Error
Check the validity of the configuration data

Throws:
iAF2.AF2Error

isSetupInProgress

public boolean isSetupInProgress()
Check whether a setup is in progress


killFibre

public void killFibre(int fibreNumber)
               throws iAF2.AF2Error
Kill a fibre, causing it to be permanently disabled

Throws:
iAF2.AF2Error

loadFibre

public void loadFibre(int fibreNumber)
               throws iAF2.AF2Error
Load a fibre

Throws:
iAF2.AF2Error

loadFibreHere

public void loadFibreHere(int fibreNumber)
                   throws iAF2.AF2Error
Load a fibre at the current robot position

Throws:
iAF2.AF2Error

loadModule

public void loadModule()
                throws iAF2.AF2Error
Load all of the fibres in the fibre module

Throws:
iAF2.AF2Error

loadModuleAll

public void loadModuleAll()
                   throws iAF2.AF2Error
Load all of the fibres in the fibre module continuing in the event of failure to find fibres

Throws:
iAF2.AF2Error

map

public void map(java.lang.String[] theConfigurationData,
                java.lang.String siderealTime)
         throws iAF2.AF2Error
Construct a distortion map of the Prime Focus field using a standard set of star positions, and star centroid information produced by the autoguider

Throws:
iAF2.AF2Error

moveFibre

public void moveFibre(int fibreNumber,
                      int positionX,
                      int positionY)
               throws iAF2.AF2Error
Move a fibre to the specified coordinates

Throws:
iAF2.AF2Error

moveProbe

public void moveProbe(int positionProbe)
               throws iAF2.AF2Error
Move the single axis probe to the specified position

Throws:
iAF2.AF2Error

moveRobot

public void moveRobot(int positionX,
                      int positionY)
               throws iAF2.AF2Error
Move the robot to the specified position

Throws:
iAF2.AF2Error

moveTheta

public void moveTheta(int positionTheta)
               throws iAF2.AF2Error
Rotate the gripper jaws to the specified angle (in arcmins)

Throws:
iAF2.AF2Error

moveZ

public void moveZ(int positionZ)
           throws iAF2.AF2Error
Move the gripper jaws up or down to the specified position

Throws:
iAF2.AF2Error

offsetFibre

public void offsetFibre(int fibreNumber,
                        int offsetX,
                        int offsetY)
                 throws iAF2.AF2Error
Offset the fibre by the specified amount in x and y

Throws:
iAF2.AF2Error

offsetRobot

public void offsetRobot(int offsetX,
                        int offsetY)
                 throws iAF2.AF2Error
Offset the robot by the specified amount in x and y

Throws:
iAF2.AF2Error

openGripper

public void openGripper()
                 throws iAF2.AF2Error
Open the gripper jaws

Throws:
iAF2.AF2Error

parkFibre

public void parkFibre(int fibreNumber)
               throws iAF2.AF2Error
Place a fibre in its park position

Throws:
iAF2.AF2Error

parkFibres

public void parkFibres()
                throws iAF2.AF2Error
Place all fibres in their park position

Throws:
iAF2.AF2Error

parkRobot

public void parkRobot()
               throws iAF2.AF2Error
Park the robot

Throws:
iAF2.AF2Error

ping

public void ping()
          throws iAF2.AF2Error
Ping the instrument to verify a connection

Throws:
iAF2.AF2Error

recoverFibre

public void recoverFibre()
                  throws iAF2.AF2Error
Recover a fibre lost during a setup

Throws:
iAF2.AF2Error

reset

public void reset()
           throws iAF2.AF2Error
Reset the AF2 server

Throws:
iAF2.AF2Error

ringFibre

public void ringFibre(int fibreNumber)
               throws iAF2.AF2Error
Inform the AF2 system that a fibre has been manually placed in the load ring

Throws:
iAF2.AF2Error

ringFibres

public void ringFibres()
                throws iAF2.AF2Error
Inform the AF2 system that all fibres have been manually placed in the load ring

Throws:
iAF2.AF2Error

sleepRobot

public void sleepRobot()
                throws iAF2.AF2Error
Sleep the robot

Throws:
iAF2.AF2Error

setup

public void setup(java.lang.String[] theConfigurationData,
                  java.lang.String siderealTime)
           throws iAF2.AF2Error
Perform a field setup on the specified configuration data

Throws:
iAF2.AF2Error

viewFibre

public void viewFibre(int fibreNumber)
               throws iAF2.AF2Error
View the specified fibre

Throws:
iAF2.AF2Error

viewObject

public void viewObject(int objectNumber)
                throws iAF2.AF2Error
View the specified object

Throws:
iAF2.AF2Error

viewSky

public void viewSky(int positionX,
                    int positionY)
             throws iAF2.AF2Error
View the sky at the specified position

Throws:
iAF2.AF2Error

wakeRobot

public void wakeRobot()
               throws iAF2.AF2Error
Wake the robot

Throws:
iAF2.AF2Error

whichFibre

public int whichFibre()
               throws iAF2.AF2Error
Return the number of the fibre which failed during a setup

Throws:
iAF2.AF2Error

getAxisConfiguration

public iAF2.RobotAxisConfiguration getAxisConfiguration(iAF2.RobotAxis axis)
                                                 throws iAF2.AF2Error
Get the configuration of an axis

Throws:
iAF2.AF2Error

getGripperJawConfiguration

public iAF2.RobotGripperConfiguration getGripperJawConfiguration()
                                                          throws iAF2.AF2Error
Get the gripper jaw height configuration

Throws:
iAF2.AF2Error

getSkyViewProbeOffset

public iAF2.Position getSkyViewProbeOffset()
                                    throws iAF2.AF2Error
Get the offset between the gripper centre and sky viewing probe in x and y

Throws:
iAF2.AF2Error

saveAxisConfiguration

public void saveAxisConfiguration()
                           throws iAF2.AF2Error
Save the robot's axis configuration

Throws:
iAF2.AF2Error

setAxisConfiguration

public void setAxisConfiguration(iAF2.RobotAxis axis,
                                 iAF2.RobotAxisConfiguration configuration)
                          throws iAF2.AF2Error
Set the configuration of an axis

Throws:
iAF2.AF2Error

setBackIlluminationOn

public void setBackIlluminationOn()
                           throws iAF2.AF2Error
Set the AF2 back illumination system on

Throws:
iAF2.AF2Error

setBackIlluminationOff

public void setBackIlluminationOff()
                            throws iAF2.AF2Error
Set the AF2 back illumination system off

Throws:
iAF2.AF2Error

setEngineeringUserMode

public void setEngineeringUserMode(java.lang.String password)
                            throws iAF2.AF2Error
Set engineering user mode on

Throws:
iAF2.AF2Error

setInspectionLightsOn

public void setInspectionLightsOn()
                           throws iAF2.AF2Error
Set the inspection lights on

Throws:
iAF2.AF2Error

setInspectionLightsOff

public void setInspectionLightsOff()
                            throws iAF2.AF2Error
Set the inspection lights off

Throws:
iAF2.AF2Error

setInstrumentPowerOn

public void setInstrumentPowerOn()
                          throws iAF2.AF2Error
Set the instrument power on

Throws:
iAF2.AF2Error

setInstrumentPowerOff

public void setInstrumentPowerOff()
                           throws iAF2.AF2Error
Set the instrument power off

Throws:
iAF2.AF2Error

setMotorPowerOn

public void setMotorPowerOn()
                     throws iAF2.AF2Error
Set the motor power on

Throws:
iAF2.AF2Error

setMotorPowerOff

public void setMotorPowerOff()
                      throws iAF2.AF2Error
Set the motor power off

Throws:
iAF2.AF2Error

setNormalUserMode

public void setNormalUserMode()
                       throws iAF2.AF2Error
Set normal user mode on

Throws:
iAF2.AF2Error

setExtendedUserMode

public void setExtendedUserMode(java.lang.String password)
                         throws iAF2.AF2Error
Set extended user mode on

Throws:
iAF2.AF2Error

setGripperJawConfiguration

public void setGripperJawConfiguration(iAF2.RobotGripperConfiguration gripperConfiguration)
                                throws iAF2.AF2Error
Set the gripper jaw height configuration

Throws:
iAF2.AF2Error

setIterations

public void setIterations(int numberOfFibrePlacementIterations)
                   throws iAF2.AF2Error
Set the maximum number of fibre placement iterations for a setup to the specified value

Throws:
iAF2.AF2Error

setSkyViewProbeOffset

public void setSkyViewProbeOffset(int offsetX,
                                  int offsetY)
                           throws iAF2.AF2Error
Set the offset between the gripper centre and sky viewing probe in x and y

Throws:
iAF2.AF2Error

setTolerance

public void setTolerance(int fibrePlacementToleranceInMicrons)
                  throws iAF2.AF2Error
Set the positioning tolerance for fibre placements to the specified value in microns

Throws:
iAF2.AF2Error

getFibreStatus

public iAF2.Fibre getFibreStatus(int fibreNumber)
                          throws iAF2.AF2Error
Get the fibre status

Throws:
iAF2.AF2Error

getRobotStatus

public iAF2.RobotStatus getRobotStatus()
                                throws iAF2.AF2Error
Get the robot status

Throws:
iAF2.AF2Error

getFibreModuleStatus

public iAF2.FibreModuleStatus getFibreModuleStatus()
                                            throws iAF2.AF2Error
Get the fibre module status

Throws:
iAF2.AF2Error

isRobotStatusUpdateRequired

private boolean isRobotStatusUpdateRequired()
Is a robot status update required. This checks whether the robot update status timer has timed out

Returns:
Boolean to indicate whether a robot status update is required

isRobotLimitSwitchStatusUpdateRequired

private boolean isRobotLimitSwitchStatusUpdateRequired()
Is a robot limit switch status update required. This checks whether the robot limit switch update status timer has timed out

Returns:
Boolean to indicate whether a robot limit switch status update is required

updateLimitSwitchStatus

private void updateLimitSwitchStatus(iAF2.RobotStatus theRobotStatus)
Update the state of the axis limit switches

Parameters:
theRobotStatus - The robot status

waitSetupFinished

private void waitSetupFinished()
Wait for a setup to complete


getMotionControllerAxis

private MotionControllerAxis getMotionControllerAxis(iAF2.RobotAxis axis)
Convert the iAF2.RobotAxis to the correct MotionController axis

Parameters:
axis - The axis
Returns:
The MotionController axis