WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
IWPOCTController Class Referenceabstract

The WPOCT Controller is packaged as a toolkit and provides a set of application programming interfaces (APIs) that are designed to control and monitor the OCT engine board sold by Wasatch Photonics. More...

#include <IWPOCTController.h>

Inheritance diagram for IWPOCTController:
Inheritance graph
[legend]
Collaboration diagram for IWPOCTController:
Collaboration graph
[legend]

Public Types

enum  ErrorCode {
  NoError = 0 , PortNotOpen = 1 , PortFailedToOpen = 2 , PortFailedToClose = 3 ,
  LostConnection = 4 , CommunicationError = 5 , UnrecognizedCommand = 6 , InvalidCommandValues = 7 ,
  MissingCommandParameter = 8 , InvalidResponse = 9 , NumErrors = 10 , NoError = 0 ,
  PortNotOpen = 1 , PortFailedToOpen = 2 , PortFailedToClose = 3 , LostConnection = 4 ,
  CommunicationError = 5 , UnrecognizedCommand = 6 , InvalidCommandValues = 7 , MissingCommandParameter = 8 ,
  InvalidResponse = 9 , NumErrors = 10
}
 The following are error codes that are used within the controller. More...
 
enum  CurrentStates {
  PortClosed = 0 , PortOpened = 1 , CommandProcessed = 2 , Busy = 4 ,
  NumStates = 8 , PortClosed = 0 , PortOpened = 1 , CommandProcessed = 2 ,
  Busy = 4 , NumStates = 8
}
 The following are status codes that are used within the controller. More...
 
enum class  ErrorCode {
  NoError = 0 , PortNotOpen = 1 , PortFailedToOpen = 2 , PortFailedToClose = 3 ,
  LostConnection = 4 , CommunicationError = 5 , UnrecognizedCommand = 6 , InvalidCommandValues = 7 ,
  MissingCommandParameter = 8 , InvalidResponse = 9 , NumErrors = 10 , NoError = 0 ,
  PortNotOpen = 1 , PortFailedToOpen = 2 , PortFailedToClose = 3 , LostConnection = 4 ,
  CommunicationError = 5 , UnrecognizedCommand = 6 , InvalidCommandValues = 7 , MissingCommandParameter = 8 ,
  InvalidResponse = 9 , NumErrors = 10
}
 
enum class  CurrentStates {
  PortClosed = 0 , PortOpened = 1 , CommandProcessed = 2 , Busy = 4 ,
  NumStates = 8 , PortClosed = 0 , PortOpened = 1 , CommandProcessed = 2 ,
  Busy = 4 , NumStates = 8
}
 

Public Member Functions

virtual ~IWPOCTController ()
 Destructor

 
virtual bool IsPortOpen () const =0
 Returns whether the port is open or closed. More...
 
virtual bool IsLightOn (int index)=0
 Returns whether the given light is on or off. More...
 
virtual bool IsScanning () const =0
 Returns the scanning state. More...
 
virtual int GetBaudRate () const =0
 Gets the baud rate used to communicate with the controller. More...
 
virtual int GetNumStopBits () const =0
 Gets the number of stop bits used to communicate with the controller. More...
 
virtual int GetPortTimeout () const =0
 Gets the timeout period of the serial port in milliseconds. More...
 
virtual bool GetMonitorPort () const =0
 Gets the flag that determines if serial port is constantly being monitored for a connection. More...
 
virtual bool GetReadResponse () const =0
 Gets the flag that determines if the response is read from the serial port after each command is sent. More...
 
virtual const char * GetVersion () const =0
 Get the firmware version of the controller. More...
 
virtual int GetAScans () const =0
 Gets the number of A-scans per B-scan output by the controller. More...
 
virtual int GetBScans () const =0
 Gets the number of B-scans output by the controller. More...
 
virtual int GetFoci () const =0
 Get the foci value. More...
 
virtual int GetDelay () const =0
 Gets the delay in milliseconds between the end of one pulse and the start of another. More...
 
virtual int GetPulse () const =0
 Gets the size of the timing pulse in milliseconds that is used to trigger an A-scan. More...
 
virtual int GetPhase () const =0
 Get the phase delay. More...
 
virtual int GetArmPosition () const =0
 Get the reference arm position. More...
 
virtual void GetScanArea (int *xStart, int *xStop, int *yStart, int *yStop) const =0
 Get the limits of the scanning area (each value is between 1500 and 52000). More...
 
virtual void GetMirror (int *major, int *minor) const =0
 Get the major and minor mirror values. More...
 
virtual bool GetSwapXY () const =0
 Gets the value of the SwapXY flag. More...
 
virtual const char * GetPortName ()=0
 Gets the name of the serial port used by the controller. More...
 
virtual const char * GetLastCommandSent () const =0
 Get the last command sent. More...
 
virtual const char * GetLastResponse () const =0
 Get the last response from the serial port. More...
 
virtual int GetXRampMinPos () const =0
 Get the x ramp min position. More...
 
virtual int GetXRampMaxPos () const =0
 Get the x ramp max position. More...
 
virtual int GetYRampMinPos () const =0
 Get the y ramp min position. More...
 
virtual int GetYRampMaxPos () const =0
 Get the y ramp max position. More...
 
virtual int GetXRampStartPos () const =0
 Get the x ramp start position. More...
 
virtual int GetXRampStopPos () const =0
 Get the x ramp stop position. More...
 
virtual int GetYRampStartPos () const =0
 Get the y ramp start position. More...
 
virtual int GetYRampStopPos () const =0
 Get the y ramp stop position. More...
 
virtual int GetPathMotorPosMax () const =0
 Gets the max possible value of the path motor. More...
 
virtual int GetQuarterHalfWavePosMax () const =0
 Gets the max possible value of the quarter and half wave motors’ position. More...
 
virtual bool SetAScans (int value)=0
 Sets the number of A-scans sent out in a frame (B-scan). More...
 
virtual bool SetBScans (int value)=0
 Sets the number of B-scans sent out. More...
 
virtual bool SetFoci (int value)=0
 Sets the foci value. More...
 
virtual bool SetDelay (int value)=0
 Sets the delay value in quarter milliseconds. More...
 
virtual bool SetPulse (int value)=0
 Sets the pulse duration value in quarter milliseconds. More...
 
virtual bool SetPhase (int value)=0
 Sets the phase delay value in milliseconds. More...
 
virtual bool SetArmPosition (int position)=0
 Sets the reference arm position. More...
 
virtual bool SetScanArea (int xStart, int xStop, int yStart, int yStop)=0
 Set the limits of the scanning area (each value is between 1500 and 52000). More...
 
virtual bool SetScanArea (int xStart, int xStop, int yStart, int yStop, int numPasses)=0
 Set the limits of the scanning area (each value is between 1500 and 52000). More...
 
virtual bool SetMirror (int major, int minor)=0
 Set the major and minor mirror values. More...
 
virtual bool SetSwapXY (bool value)=0
 Sets the SwapXY flag. More...
 
virtual bool SetXRampMinPos (int value)=0
 Sets the minimum scan position in the x direction. More...
 
virtual bool SetXRampMaxPos (int value)=0
 Sets the maximum scan position in the x direction. More...
 
virtual bool SetYRampMinPos (int value)=0
 Set the min y ramp value. More...
 
virtual bool SetYRampMaxPos (int value)=0
 Set the max y ramp value. More...
 
virtual bool SetReadResponse (bool value)=0
 Sets the flag that determines if the response from the serial port is read after a command is issued. More...
 
virtual bool SetPathMotorPosMax (int value)=0
 Sets the max possible value of the path motor. More...
 
virtual bool SetQuarterHalfWavePosMax (int value)=0
 Sets the max possible value of the quarter and half wave motor position. More...
 
virtual bool OpenPort (const char *portName, int baudRate, int numStopBits, int timeout, bool monitorConnection)=0
 Open the specified port with the parameters supplied. More...
 
virtual bool OpenPort (int baudRate, int numStopBits, int timeout, bool monitorConnection)=0
 Open the specified port. More...
 
virtual bool OpenPort ()=0
 Open the port using the default or previous parameters. More...
 
virtual bool ClosePort ()=0
 Close the serial port. More...
 
virtual bool SendCommand (const char *command, char *response, int maxResponseSize)=0
 Send a command to the serial port and receive its response back if GetReadResponse() is true. More...
 
virtual bool SendCommand (const char *command)=0
 Send a command to the serial port. More...
 
virtual bool TurnLightOn (int num)=0
 Turns the specified light on. More...
 
virtual bool TurnLightOff (int num)=0
 Turns the specified light off. More...
 
virtual bool TurnLightsOff ()=0
 Turns all lights off. More...
 
virtual bool StartScan ()=0
 Start the scan using the parameters previously specified. More...
 
virtual bool StopScan ()=0
 Stop the scan. More...
 
virtual bool ParkArm ()=0
 Park the reference arm. More...
 
virtual bool SendMotorsHome ()=0
 Send all motors to their home position (position 0). More...
 
virtual int GetActiveOpticalPort ()=0
 Gets the active optical port. More...
 
virtual bool SetActiveOpticalPort (int port)=0
 Sets the optical switch to the specified port. More...
 
virtual bool ToggleOpticalSwitch ()=0
 Toggles the optical switch from one position to the other. More...
 
virtual bool IsShutterOpen (int ID, bool *open)=0
 
virtual bool OpenShutter (int ID)=0
 
virtual bool CloseShutter (int ID)=0
 
virtual IWPOCTController::ErrorCode GetLastError () const =0
 Gets the result of the most current operation. More...
 
virtual IWPOCTController::CurrentStates GetCurrentStatus () const =0
 Gets the current status of the controller. More...
 
virtual void SetSerialPortLostCallback (NotifyErrorCallback notifyError)=0
 Sets the callback to run if the serial port connection is lost. More...
 
virtual void SetSerialPortLostCallback2 (SendNoParams serialPortLost, void *context)=0
 Sets the callback to run if the serial port connection is lost. More...
 
virtual void Dispose ()
 
virtual bool IsPortOpen ()
 
virtual bool IsLightOn (int index)
 
virtual bool IsScanning ()
 
virtual int GetBaudRate ()
 
virtual int GetNumStopBits ()
 
virtual int GetPortTimeout ()
 
virtual bool GetMonitorPort ()
 
virtual bool GetReadResponse ()
 
virtual string GetVersion ()
 
virtual int GetAScans ()
 
virtual int GetBScans ()
 
virtual int GetFoci ()
 
virtual int GetDelay ()
 
virtual int GetPulse ()
 
virtual int GetPhase ()
 
virtual int GetArmPosition ()
 
virtual void GetScanArea (ref int xStart, ref int xStop, ref int yStart, ref int yStop)
 
virtual void GetMirror (ref int major, ref int minor)
 
virtual bool GetSwapXY ()
 
virtual string GetPortName ()
 
virtual string GetLastCommandSent ()
 
virtual string GetLastResponse ()
 
virtual int GetXRampMinPos ()
 
virtual int GetXRampMaxPos ()
 
virtual int GetYRampMinPos ()
 
virtual int GetYRampMaxPos ()
 
virtual int GetXRampStartPos ()
 
virtual int GetXRampStopPos ()
 
virtual int GetYRampStartPos ()
 
virtual int GetYRampStopPos ()
 
virtual int GetPathMotorPosMax ()
 
virtual int GetQuarterHalfWavePosMax ()
 
virtual bool SetAScans (int value)
 
virtual bool SetBScans (int value)
 
virtual bool SetFoci (int value)
 
virtual bool SetDelay (int value)
 
virtual bool SetPulse (int value)
 
virtual bool SetPhase (int value)
 
virtual bool SetArmPosition (int position)
 
virtual bool SetScanArea (int xStart, int xStop, int yStart, int yStop)
 
virtual bool SetScanArea (int xStart, int xStop, int yStart, int yStop, int numPasses)
 
virtual bool SetMirror (int major, int minor)
 
virtual bool SetSwapXY (bool value)
 
virtual bool SetXRampMinPos (int value)
 
virtual bool SetXRampMaxPos (int value)
 
virtual bool SetYRampMinPos (int value)
 
virtual bool SetYRampMaxPos (int value)
 
virtual bool SetReadResponse (bool value)
 
virtual bool SetPathMotorPosMax (int value)
 
virtual bool SetQuarterHalfWavePosMax (int value)
 
virtual bool OpenPort (string portName, int baudRate, int numStopBits, int timeout, bool monitorConnection)
 
virtual bool OpenPort (int baudRate, int numStopBits, int timeout, bool monitorConnection)
 
virtual bool OpenPort ()
 
virtual bool ClosePort ()
 
virtual bool SendCommand (string command, string response, int maxResponseSize)
 
virtual bool SendCommand (string command)
 
virtual bool TurnLightOn (int num)
 
virtual bool TurnLightOff (int num)
 
virtual bool TurnLightsOff ()
 
virtual bool StartScan ()
 
virtual bool StopScan ()
 
virtual bool ParkArm ()
 
virtual bool SendMotorsHome ()
 
virtual int GetActiveOpticalPort ()
 
virtual bool SetActiveOpticalPort (int port)
 
virtual bool ToggleOpticalSwitch ()
 
virtual bool IsShutterOpen (int ID, ref bool open)
 
virtual bool OpenShutter (int ID)
 
virtual bool CloseShutter (int ID)
 
virtual IWPOCTController.ErrorCode GetLastError ()
 
virtual IWPOCTController.CurrentStates GetCurrentStatus ()
 
virtual void SetSerialPortLostCallback (SerialPortLost notifyError)
 

Static Public Member Functions

static IWPOCTController GetOCTController ()
 
static bool DestroyOCTController ()
 

Protected Attributes

bool swigCMemOwn
 

Detailed Description

The WPOCT Controller is packaged as a toolkit and provides a set of application programming interfaces (APIs) that are designed to control and monitor the OCT engine board sold by Wasatch Photonics.


This section gives a description of the API categories available through WPOCT Controller. For a full description of each API, please refer to the method documentation below.

Creation Commands

These commands create a controller object and passes back a pointer to the object, which can then be used to call the worker APIs.

Deletion Commands

These APIs delete an object created by the creation call above. The controller object is passed to the API as a parameter.

Get Commands

The Get commands return some piece of information about the object that called it. The object’s state does not change when calling one of these commands.

Set Commands

The Set commands change the state of the object that the command acts on.
These commands are used to set the number of A-scans per B-scan, the delay, the scan area, etc.

Serial Port Commands

The serial port commands open, close, and send commands directly to the board. Commands issued are first checked for completeness, bounds checked, and then sent to the board. A response is sent back to the user.

Light Commands

The light commands control whether light 0 and light 1 are on or off.

Scan Commands

The commands start and stop scanning.

Movement Commands

The movement commands move the reference arm or the motors from one position to another.

Optical Switch Commands

The optical switch commands get the switch position and switch the optical switch from one position to the other. There are two possible switch positions.

Status Command

The status API returns the current status of the controller. It can be used to ensure the controller is working properly. The GetLastError command gets the most recent error code.

Member Enumeration Documentation

◆ CurrentStates

The following are status codes that are used within the controller.

They are part of the CurrentStates enum, which can be employed by the user.
One or more codes will be returned when calling GetCurrentStatus().

◆ ErrorCode

The following are error codes that are used within the controller.

They are part of the ErrorCodes enum, which can be employed by the user. One code will be returned when calling GetLastError().

Member Function Documentation

◆ ClosePort()

virtual bool IWPOCTController::ClosePort ( )
pure virtual

Close the serial port.

Returns
true on success

Implemented in WPScanController.

◆ GetActiveOpticalPort()

virtual int IWPOCTController::GetActiveOpticalPort ( )
pure virtual

Gets the active optical port.

Returns
the active port (0-1)

Implemented in WPScanController.

◆ GetArmPosition()

virtual int IWPOCTController::GetArmPosition ( ) const
pure virtual

Get the reference arm position.

Returns
integral position (unitless)

Implemented in WPScanController.

◆ GetAScans()

virtual int IWPOCTController::GetAScans ( ) const
pure virtual

Gets the number of A-scans per B-scan output by the controller.

Returns
the number of A-scans

Implemented in WPScanController.

◆ GetBaudRate()

virtual int IWPOCTController::GetBaudRate ( ) const
pure virtual

Gets the baud rate used to communicate with the controller.

Returns
baud rate, typically 9600

Implemented in WPScanController.

◆ GetBScans()

virtual int IWPOCTController::GetBScans ( ) const
pure virtual

Gets the number of B-scans output by the controller.

Returns
the number of B-scans

Implemented in WPScanController.

◆ GetCurrentStatus()

virtual IWPOCTController::CurrentStates IWPOCTController::GetCurrentStatus ( ) const
pure virtual

Gets the current status of the controller.

Returns
the staus code, comprised of multiple flags "OR"d together.
More than one can be active at the same time.

Implemented in WPScanController.

◆ GetDelay()

virtual int IWPOCTController::GetDelay ( ) const
pure virtual

Gets the delay in milliseconds between the end of one pulse and the start of another.

Returns
delay in milliseconds

Implemented in WPScanController.

◆ GetFoci()

virtual int IWPOCTController::GetFoci ( ) const
pure virtual

Get the foci value.

Returns
foci value (0-255)

Implemented in WPScanController.

◆ GetLastCommandSent()

virtual const char* IWPOCTController::GetLastCommandSent ( ) const
pure virtual

Get the last command sent.

The char array returned may be different from what the user sent in a SendCommand.

Returns
pointer to the character array that holds the last command sent to the controller

Implemented in WPScanController.

◆ GetLastError()

virtual IWPOCTController::ErrorCode IWPOCTController::GetLastError ( ) const
pure virtual

Gets the result of the most current operation.

Returns
the error code

Implemented in WPScanController.

◆ GetLastResponse()

virtual const char* IWPOCTController::GetLastResponse ( ) const
pure virtual

Get the last response from the serial port.


Returns
pointer to the character array that holds the most recent controller response to a command

Implemented in WPScanController.

◆ GetMirror()

virtual void IWPOCTController::GetMirror ( int *  major,
int *  minor 
) const
pure virtual

Get the major and minor mirror values.

Parameters
major[out]pointer to an int that will receive the mirror’s major value
minor[out]pointer to an int that will receive the mirror’s minor value

Implemented in WPScanController.

◆ GetMonitorPort()

virtual bool IWPOCTController::GetMonitorPort ( ) const
pure virtual

Gets the flag that determines if serial port is constantly being monitored for a connection.

Default is false.

Returns
true if the serial port is being monitored constantly

Implemented in WPScanController.

◆ GetNumStopBits()

virtual int IWPOCTController::GetNumStopBits ( ) const
pure virtual

Gets the number of stop bits used to communicate with the controller.

Returns
the number of stop bits used

Implemented in WPScanController.

◆ GetPathMotorPosMax()

virtual int IWPOCTController::GetPathMotorPosMax ( ) const
pure virtual

Gets the max possible value of the path motor.

Returns
maximum path motor value

Implemented in WPScanController.

◆ GetPhase()

virtual int IWPOCTController::GetPhase ( ) const
pure virtual

Get the phase delay.

Should not be greater that trdelay.

Returns
phase length in milliseconds

Implemented in WPScanController.

◆ GetPortName()

virtual const char* IWPOCTController::GetPortName ( )
pure virtual

Gets the name of the serial port used by the controller.

The port name is determined automatically by using the keyword “STMicroelectronics”.

Returns
pointer to character string containing serial port name

Implemented in WPScanController.

◆ GetPortTimeout()

virtual int IWPOCTController::GetPortTimeout ( ) const
pure virtual

Gets the timeout period of the serial port in milliseconds.

Default is 500.

Returns
timeout in milliseconds

Implemented in WPScanController.

◆ GetPulse()

virtual int IWPOCTController::GetPulse ( ) const
pure virtual

Gets the size of the timing pulse in milliseconds that is used to trigger an A-scan.

Returns
pulse size in milliseconds

Implemented in WPScanController.

◆ GetQuarterHalfWavePosMax()

virtual int IWPOCTController::GetQuarterHalfWavePosMax ( ) const
pure virtual

Gets the max possible value of the quarter and half wave motors’ position.

Returns
maximum position of the quarter and half wave motors

Implemented in WPScanController.

◆ GetReadResponse()

virtual bool IWPOCTController::GetReadResponse ( ) const
pure virtual

Gets the flag that determines if the response is read from the serial port after each command is sent.

Default is true.

Returns
true if the response is read after each command

Implemented in WPScanController.

◆ GetScanArea()

virtual void IWPOCTController::GetScanArea ( int *  xStart,
int *  xStop,
int *  yStart,
int *  yStop 
) const
pure virtual

Get the limits of the scanning area (each value is between 1500 and 52000).

Parameters
xStart[out]pointer to an int that will receive the start position in the x direction
xStop[out] pointer to an int that will receive the stop position in the x direction
yStart[out]pointer to an int that will receive the start position in the y direction
yStop[out] pointer to an int that will receive the stop position in the y direction

Implemented in WPScanController.

◆ GetSwapXY()

virtual bool IWPOCTController::GetSwapXY ( ) const
pure virtual

Gets the value of the SwapXY flag.

When true, x and y values for scan areas are switched, where the x values are used for y and vice-versa.

Returns
true if x and y values are being switched

Implemented in WPScanController.

◆ GetVersion()

virtual const char* IWPOCTController::GetVersion ( ) const
pure virtual

Get the firmware version of the controller.

Returns
pointer to a character array that holds the firmware version

Implemented in WPScanController.

◆ GetXRampMaxPos()

virtual int IWPOCTController::GetXRampMaxPos ( ) const
pure virtual

Get the x ramp max position.

Returns
maximum x ramp position in DAC units

Implemented in WPScanController.

◆ GetXRampMinPos()

virtual int IWPOCTController::GetXRampMinPos ( ) const
pure virtual

Get the x ramp min position.

Returns
minimum x ramp position in DAC units

Implemented in WPScanController.

◆ GetXRampStartPos()

virtual int IWPOCTController::GetXRampStartPos ( ) const
pure virtual

Get the x ramp start position.

Returns
the x ramp start position in DAC units

Implemented in WPScanController.

◆ GetXRampStopPos()

virtual int IWPOCTController::GetXRampStopPos ( ) const
pure virtual

Get the x ramp stop position.

Returns
the x ramp stop position in DAC units

Implemented in WPScanController.

◆ GetYRampMaxPos()

virtual int IWPOCTController::GetYRampMaxPos ( ) const
pure virtual

Get the y ramp max position.

Returns
maximum y ramp position in DAC units

Implemented in WPScanController.

◆ GetYRampMinPos()

virtual int IWPOCTController::GetYRampMinPos ( ) const
pure virtual

Get the y ramp min position.

Returns
minimum y ramp position in DAC units

Implemented in WPScanController.

◆ GetYRampStartPos()

virtual int IWPOCTController::GetYRampStartPos ( ) const
pure virtual

Get the y ramp start position.

Returns
the y ramp start position in DAC units

Implemented in WPScanController.

◆ GetYRampStopPos()

virtual int IWPOCTController::GetYRampStopPos ( ) const
pure virtual

Get the y ramp stop position.

Returns
the y ramp stop position in DAC units

Implemented in WPScanController.

◆ IsLightOn()

virtual bool IWPOCTController::IsLightOn ( int  index)
pure virtual

Returns whether the given light is on or off.

Returns
true if the light is on

Implemented in WPScanController.

◆ IsPortOpen()

virtual bool IWPOCTController::IsPortOpen ( ) const
pure virtual

Returns whether the port is open or closed.

Returns
true if the port is opened

Implemented in WPScanController.

◆ IsScanning()

virtual bool IWPOCTController::IsScanning ( ) const
pure virtual

Returns the scanning state.

Returns
true if scanning is occuring

Implemented in WPScanController.

◆ OpenPort() [1/3]

virtual bool IWPOCTController::OpenPort ( )
pure virtual

Open the port using the default or previous parameters.

Port must be open before any commands are issued.

Returns
true on success

Implemented in WPScanController.

◆ OpenPort() [2/3]

virtual bool IWPOCTController::OpenPort ( const char *  portName,
int  baudRate,
int  numStopBits,
int  timeout,
bool  monitorConnection 
)
pure virtual

Open the specified port with the parameters supplied.


Port must be open before any commands are issued.

Parameters
portName[in]pointer to character array that holds the port name (e.g. COM3).
baudRate[in]the baud rate used to communicate with the serial port.
numStopBits[in]the number of stop bits.
timeout[in]the timout in milliseconds. Default is 500.
monitorConnection[in]flag on whether or not to constantly monitor the serial port connection.
Returns
true on success

Implemented in WPScanController.

◆ OpenPort() [3/3]

virtual bool IWPOCTController::OpenPort ( int  baudRate,
int  numStopBits,
int  timeout,
bool  monitorConnection 
)
pure virtual

Open the specified port.

The COM port is determined automatically.

Port must be open before any commands are issued.

Parameters
baudRate[in]the baud rate used to communicate with the serial port.
numStopBits[in]the number of stop bits.
timeout[in]the timout in milliseconds. Default is 500.
monitorConnection[in]flag on whether or not to constantly monitor the serial port connection.
Returns
true on success

Implemented in WPScanController.

◆ ParkArm()

virtual bool IWPOCTController::ParkArm ( )
pure virtual

Park the reference arm.

Returns
true on success

Implemented in WPScanController.

◆ SendCommand() [1/2]

virtual bool IWPOCTController::SendCommand ( const char *  command)
pure virtual

Send a command to the serial port.

The response can be checked after if the flag GetReadResponse() is true.

There are many commands that can be sent. Refer to “OCT Engine Serial Command Reference” for a complete list of commands that can be sent to the Wasatch controller board. Other serial devices can also have values written and read using the send command.

Parameters
command[in]pointer to character array that contains the command.
Returns
true on success
See also
ENG-0060 OCT Engine Serial Command Reference

Implemented in WPScanController.

◆ SendCommand() [2/2]

virtual bool IWPOCTController::SendCommand ( const char *  command,
char *  response,
int  maxResponseSize 
)
pure virtual

Send a command to the serial port and receive its response back if GetReadResponse() is true.


There are many commands that can be sent. Refer to “OCT Engine Serial Command Reference” for a complete list of commands that can be sent to the Wasatch controller board. Other serial devices can also have values written and read using the send command.

Parameters
command[in]pointer to character array that contains the command.
response[in]pointer to user-supplied character array that receives the response.
maxResponseSize[in]the size of the response array.
Returns
true on success
See also
ENG-0060 OCT Engine Serial Command Reference

Implemented in WPScanController.

◆ SendMotorsHome()

virtual bool IWPOCTController::SendMotorsHome ( )
pure virtual

Send all motors to their home position (position 0).

Returns
true on success

Implemented in WPScanController.

◆ SetActiveOpticalPort()

virtual bool IWPOCTController::SetActiveOpticalPort ( int  port)
pure virtual

Sets the optical switch to the specified port.

Parameters
port[in]0 or 1
Returns
true on success

Implemented in WPScanController.

◆ SetArmPosition()

virtual bool IWPOCTController::SetArmPosition ( int  position)
pure virtual

Sets the reference arm position.

Default is 0. It should be a number between 0 and the max value set.

Returns
true on success

Implemented in WPScanController.

◆ SetAScans()

virtual bool IWPOCTController::SetAScans ( int  value)
pure virtual

Sets the number of A-scans sent out in a frame (B-scan).

Default is 1024. It should be a value between 2 and 65535.

Returns
true on success

Implemented in WPScanController.

◆ SetBScans()

virtual bool IWPOCTController::SetBScans ( int  value)
pure virtual

Sets the number of B-scans sent out.

Default is 0. It should be an even number between 0 and 65534.

Returns
true on success

Implemented in WPScanController.

◆ SetDelay()

virtual bool IWPOCTController::SetDelay ( int  value)
pure virtual

Sets the delay value in quarter milliseconds.

Default is 50. It should be a number between 0 and 65535.

Returns
true on success

Implemented in WPScanController.

◆ SetFoci()

virtual bool IWPOCTController::SetFoci ( int  value)
pure virtual

Sets the foci value.

Default is 0. It should be a number between 0 and 255.

Returns
true on success

Implemented in WPScanController.

◆ SetMirror()

virtual bool IWPOCTController::SetMirror ( int  major,
int  minor 
)
pure virtual

Set the major and minor mirror values.

Returns
true on success

Implemented in WPScanController.

◆ SetPathMotorPosMax()

virtual bool IWPOCTController::SetPathMotorPosMax ( int  value)
pure virtual

Sets the max possible value of the path motor.

Returns
true on success

Implemented in WPScanController.

◆ SetPhase()

virtual bool IWPOCTController::SetPhase ( int  value)
pure virtual

Sets the phase delay value in milliseconds.

Default is 5. It should be a number between 0 and 65535 but should not be greater than the trigger delay.

Returns
true on success

Implemented in WPScanController.

◆ SetPulse()

virtual bool IWPOCTController::SetPulse ( int  value)
pure virtual

Sets the pulse duration value in quarter milliseconds.

Default is 5. It should be a number between 0 and 65535. If set to 0, no trigger pulses occur.

Returns
true on success

Implemented in WPScanController.

◆ SetQuarterHalfWavePosMax()

virtual bool IWPOCTController::SetQuarterHalfWavePosMax ( int  value)
pure virtual

Sets the max possible value of the quarter and half wave motor position.

Returns
true on success

Implemented in WPScanController.

◆ SetReadResponse()

virtual bool IWPOCTController::SetReadResponse ( bool  value)
pure virtual

Sets the flag that determines if the response from the serial port is read after a command is issued.

Default is true.

Returns
true on success

Implemented in WPScanController.

◆ SetScanArea() [1/2]

virtual bool IWPOCTController::SetScanArea ( int  xStart,
int  xStop,
int  yStart,
int  yStop 
)
pure virtual

Set the limits of the scanning area (each value is between 1500 and 52000).

Parameters
xStart[in]start position in the x direction
xStop[in]stop position in the x direction
yStart[in]start position in the y direction
yStop[in]stop position in the y direction
Returns
true on success

Implemented in WPScanController.

◆ SetScanArea() [2/2]

virtual bool IWPOCTController::SetScanArea ( int  xStart,
int  xStop,
int  yStart,
int  yStop,
int  numPasses 
)
pure virtual

Set the limits of the scanning area (each value is between 1500 and 52000).

Parameters
xStart[in]start position in the x direction
xStop[in]stop position in the x direction
yStart[in]start position in the y direction
yStop[in]stop position in the y direction
numPasses[in]number of times the scan will occur. Default is 1.
Returns
true on success

Implemented in WPScanController.

◆ SetSerialPortLostCallback()

virtual void IWPOCTController::SetSerialPortLostCallback ( NotifyErrorCallback  notifyError)
pure virtual

Sets the callback to run if the serial port connection is lost.


Note
C++ programs should use this call. See the demo app for details on how to setup this call.
Parameters
notifyError[in]the C# callback function in the calling program.
This function is a delegate that contains the code to be run if the serial port fails.

Implemented in WPScanController.

◆ SetSerialPortLostCallback2()

virtual void IWPOCTController::SetSerialPortLostCallback2 ( SendNoParams  serialPortLost,
void *  context 
)
pure virtual

Sets the callback to run if the serial port connection is lost.


Note
C# programs should use this call.
Parameters
serialPortLost[in]the C++ callback function in the calling program.
This function should not be a member of a class. It should be a standalone function.
context[in]pointer to the C++ “this” object that has the actual callback function.

Implemented in WPScanController.

◆ SetSwapXY()

virtual bool IWPOCTController::SetSwapXY ( bool  value)
pure virtual

Sets the SwapXY flag.

When true, x and y values for scan areas are switched, where the x values are used for y and vice-versa.

Returns
true on success

Implemented in WPScanController.

◆ SetXRampMaxPos()

virtual bool IWPOCTController::SetXRampMaxPos ( int  value)
pure virtual

Sets the maximum scan position in the x direction.


Warning
This value is board dependent and should not be set arbitrarily.
Returns
true on success

Implemented in WPScanController.

◆ SetXRampMinPos()

virtual bool IWPOCTController::SetXRampMinPos ( int  value)
pure virtual

Sets the minimum scan position in the x direction.


Warning
This value is board dependent and should not be set arbitrarily.
Returns
true on success

Implemented in WPScanController.

◆ SetYRampMaxPos()

virtual bool IWPOCTController::SetYRampMaxPos ( int  value)
pure virtual

Set the max y ramp value.

Warning
This value is board dependent and should not be set arbitrarily.
Returns
true on success

Implemented in WPScanController.

◆ SetYRampMinPos()

virtual bool IWPOCTController::SetYRampMinPos ( int  value)
pure virtual

Set the min y ramp value.

Warning
This value is board dependent and should not be set arbitrarily.
Returns
true on success

Implemented in WPScanController.

◆ StartScan()

virtual bool IWPOCTController::StartScan ( )
pure virtual

Start the scan using the parameters previously specified.

Returns
true on success

Implemented in WPScanController.

◆ StopScan()

virtual bool IWPOCTController::StopScan ( )
pure virtual

Stop the scan.

Returns
true on success

Implemented in WPScanController.

◆ ToggleOpticalSwitch()

virtual bool IWPOCTController::ToggleOpticalSwitch ( )
pure virtual

Toggles the optical switch from one position to the other.

Returns
true on success

Implemented in WPScanController.

◆ TurnLightOff()

virtual bool IWPOCTController::TurnLightOff ( int  num)
pure virtual

Turns the specified light off.

Parameters
num[in]light (1 or 2)
Returns
true on success

Implemented in WPScanController.

◆ TurnLightOn()

virtual bool IWPOCTController::TurnLightOn ( int  num)
pure virtual

Turns the specified light on.

Parameters
num[in]light (1 or 2)
Returns
true on success

Implemented in WPScanController.

◆ TurnLightsOff()

virtual bool IWPOCTController::TurnLightsOff ( )
pure virtual

Turns all lights off.

Returns
true on success

Implemented in WPScanController.


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