|
WPOCT Software Developer's Kit (SDK)
SDK For using Wasatch Photonics OCT Spectrometers
|
Class that converts a scanned image from one format to another. More...
#include <WPScanController.h>


Public Member Functions | |
| WPScanController () | |
| Constructor. | |
| virtual | ~WPScanController () |
| Destructor. | |
| bool | IsPortOpen () const override |
| Returns whether the port is open or closed. More... | |
| bool | IsLightOn (int index) override |
| Returns whether the given light is on or off. More... | |
| bool | IsScanning () const override |
| Returns the scanning state. More... | |
| int | GetBaudRate () const override |
| Gets the baud rate used to communicate with the controller. More... | |
| int | GetNumStopBits () const override |
| Gets the number of stop bits used to communicate with the controller. More... | |
| int | GetPortTimeout () const override |
| Gets the timeout period of the serial port in milliseconds. More... | |
| bool | GetMonitorPort () const override |
| Gets the flag that determines if serial port is constantly being monitored for a connection. More... | |
| bool | GetReadResponse () const override |
| Gets the flag that determines if the response is read from the serial port after each command is sent. More... | |
| const char * | GetVersion () const override |
| Get the firmware version of the controller. More... | |
| int | GetAScans () const override |
| Gets the number of A-scans per B-scan output by the controller. More... | |
| int | GetBScans () const override |
| Gets the number of B-scans output by the controller. More... | |
| int | GetFoci () const override |
| Get the foci value. More... | |
| int | GetDelay () const override |
| Gets the delay in milliseconds between the end of one pulse and the start of another. More... | |
| int | GetPulse () const override |
| Gets the size of the timing pulse in milliseconds that is used to trigger an A-scan. More... | |
| int | GetPhase () const override |
| Get the phase delay. More... | |
| int | GetArmPosition () const override |
| Get the reference arm position. More... | |
| void | GetScanArea (int *xStart, int *xStop, int *yStart, int *yStop) const override |
| Get the limits of the scanning area (each value is between 1500 and 52000). More... | |
| void | GetMirror (int *major, int *minor) const override |
| Get the major and minor mirror values. More... | |
| bool | GetSwapXY () const override |
| Gets the value of the SwapXY flag. More... | |
| const char * | GetPortName () override |
| Gets the name of the serial port used by the controller. More... | |
| const char * | GetLastCommandSent () const override |
| Get the last command sent. More... | |
| const char * | GetLastResponse () const override |
| Get the last response from the serial port. More... | |
| int | GetXRampMinPos () const override |
| Get the x ramp min position. More... | |
| int | GetXRampMaxPos () const override |
| Get the x ramp max position. More... | |
| int | GetYRampMinPos () const override |
| Get the y ramp min position. More... | |
| int | GetYRampMaxPos () const override |
| Get the y ramp max position. More... | |
| int | GetXRampStartPos () const override |
| Get the x ramp start position. More... | |
| int | GetXRampStopPos () const override |
| Get the x ramp stop position. More... | |
| int | GetYRampStartPos () const override |
| Get the y ramp start position. More... | |
| int | GetYRampStopPos () const override |
| Get the y ramp stop position. More... | |
| int | GetPathMotorPosMax () const override |
| Gets the max possible value of the path motor. More... | |
| int | GetQuarterHalfWavePosMax () const override |
| Gets the max possible value of the quarter and half wave motors’ position. More... | |
| bool | SetAScans (int value) override |
| Sets the number of A-scans sent out in a frame (B-scan). More... | |
| bool | SetBScans (int value) override |
| Sets the number of B-scans sent out. More... | |
| bool | SetFoci (int value) override |
| Sets the foci value. More... | |
| bool | SetDelay (int value) override |
| Sets the delay value in quarter milliseconds. More... | |
| bool | SetPulse (int value) override |
| Sets the pulse duration value in quarter milliseconds. More... | |
| bool | SetPhase (int value) override |
| Sets the phase delay value in milliseconds. More... | |
| bool | SetXRampMinPos (int value) override |
| Sets the minimum scan position in the x direction. More... | |
| bool | SetXRampMaxPos (int value) override |
| Sets the maximum scan position in the x direction. More... | |
| bool | SetYRampMinPos (int value) override |
| Set the min y ramp value. More... | |
| bool | SetYRampMaxPos (int value) override |
| Set the max y ramp value. More... | |
| bool | SetArmPosition (int position) override |
| Sets the reference arm position. More... | |
| bool | SetScanArea (int xStart, int xStop, int yStart, int yStop) override |
| Set the limits of the scanning area (each value is between 1500 and 52000). More... | |
| bool | SetScanArea (int xStart, int xStop, int yStart, int yStop, int numPasses) override |
| Set the limits of the scanning area (each value is between 1500 and 52000). More... | |
| bool | SetMirror (int major, int minor) override |
| Set the major and minor mirror values. More... | |
| bool | SetSwapXY (bool value) override |
| Sets the SwapXY flag. More... | |
| bool | SetReadResponse (bool value) override |
| Sets the flag that determines if the response from the serial port is read after a command is issued. More... | |
| bool | SetPathMotorPosMax (int value) override |
| Sets the max possible value of the path motor. More... | |
| bool | SetQuarterHalfWavePosMax (int value) override |
| Sets the max possible value of the quarter and half wave motor position. More... | |
| bool | OpenPort (const char *portName, int baudRate, int numStopBits, int timeout, bool monitorConnection) override |
| Open the specified port with the parameters supplied. More... | |
| bool | OpenPort (int baudRate, int numStopBits, int timeout, bool monitorConnection) override |
| Open the specified port, determining the COM port automatically. | |
| bool | OpenPort () override |
| Open the port using the default or previous parameters. | |
| void | ReadControllerVersion (bool &result) |
| bool | ClosePort () override |
| Close the serial port. | |
| bool | SendCommand (const char *command, char *response, int maxResponseSize) override |
| Send a command to the serial port and receive its response back if GetReadResponse() is true. More... | |
| bool | SendCommand (const char *command) override |
| Send a command to the serial port. More... | |
| bool | TurnLightOn (int num) override |
| Turns the specified light on. More... | |
| bool | TurnLightOff (int num) override |
| Turns the specified light off. More... | |
| bool | TurnLightsOff () override |
| Turns all lights off. More... | |
| bool | StartScan () override |
| Start the scan using the parameters previously specified. | |
| bool | StopScan () override |
| Stop the scan. | |
| bool | ParkArm () override |
| Park the reference arm. | |
| bool | SendMotorsHome () override |
| Send the motors home. | |
| int | GetActiveOpticalPort () override |
| Gets the active optical port. More... | |
| bool | SetActiveOpticalPort (int port) override |
| Sets the optical switch to the specified port. More... | |
| bool | ToggleOpticalSwitch () override |
| Toggles the optical switch from one position to the other. More... | |
| bool | IsShutterOpen (int ID, bool *open) override |
| bool | OpenShutter (int ID) override |
| bool | CloseShutter (int ID) override |
| virtual IWPOCTController::ErrorCode | GetLastError () const override |
| Gets the result of the most current operation. More... | |
| virtual IWPOCTController::CurrentStates | GetCurrentStatus () const override |
| Gets the current status of the controller. More... | |
| virtual void | SetSerialPortLostCallback (NotifyErrorCallback notifyError) override |
| Sets the callback to run if the serial port connection is lost. More... | |
| virtual void | SetSerialPortLostCallback2 (SendNoParams serialPortLost, void *context) override |
| Sets the callback to run if the serial port connection is lost. More... | |
| void | CheckPingResponse () |
Public Member Functions inherited from IWPOCTController | |
| virtual | ~IWPOCTController () |
| Destructor | |
| virtual void | Dispose () |
| virtual bool | IsPortOpen () |
| 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 | 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 | OpenPort (string portName, int baudRate, int numStopBits, int timeout, bool monitorConnection) |
| virtual bool | SendCommand (string command, string response, int maxResponseSize) |
| virtual bool | SendCommand (string command) |
| virtual bool | IsShutterOpen (int ID, ref bool open) |
| virtual IWPOCTController.ErrorCode | GetLastError () |
| virtual IWPOCTController.CurrentStates | GetCurrentStatus () |
| virtual void | SetSerialPortLostCallback (SerialPortLost notifyError) |
Protected Member Functions | |
| bool | SendStringToWasatchPort (std::string rawCommand) |
| Send string command to controller serial port. | |
| bool | SendStringToCameraPort (std::string rawCommand) |
| Send string command to camera serial port. | |
| bool | SendCommandToPort (std::string command) |
| bool | SendShutterCommand (std::string &inCommand) |
| void | ReadResponse (std::string &finalCommand) |
| bool | CheckWasatchCommandValid (std::string &inCommand, std::string &outCommand) |
| Parse commands to update parameters or override values as needed. | |
| bool | CheckCameraCommandValid (std::string &inCommand, std::string &outCommand) |
| Right now any command is valid for the camera. | |
| bool | ChangePortMonitoring (bool isOn) |
| bool | ReestablishConnection () |
| void | FormatVersionString () |
| bool | FormAScansCmd (vector< std::string > &words, string &outCommand) |
| bool | FormBScansCmd (vector< std::string > &words, string &outCommand) |
| bool | FormDelayCmd (vector< std::string > &words, string &outCommand) |
| bool | FormPulseCmd (vector< std::string > &words, string &outCommand) |
| bool | FormPhaseCmd (vector< std::string > &words, string &outCommand) |
| bool | FormFociCmd (vector< std::string > &words, string &outCommand) |
| bool | FormFocusCmd (vector< std::string > &words, string &outCommand) |
| bool | FormScanCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMirrorCmd (vector< std::string > &words, string &outCommand) |
| bool | FormVerboseCmd (vector< std::string > &words, string &outCommand) |
| bool | FormPauseTimeoutCmd (vector< std::string > &words, string &outCommand) |
| bool | FormSetOpticalPortCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMghCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMstopCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMgrCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMg2Cmd (vector< std::string > &words, string &outCommand) |
| bool | FormMihCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMasetCmd (vector< std::string > &words, string &outCommand) |
| bool | FormMssetCmd (vector< std::string > &words, string &outCommand) |
| bool | FormCameraCommand (vector< std::string > &words, string &outCommand) |
| bool | RunSetShutterCmd (vector< std::string > &words) |
| bool | RunGetShutterCmd (vector< std::string > &words, bool &open) |
| int | CheckMotorPosLimits (vector< std::string > &words) |
| int | CheckRelativeMotorPosLimits (vector< std::string > &words) |
| int | CheckMotorAccelLimits (vector< std::string > &words) |
| int | CheckMotorSpeedLimits (vector< std::string > &words) |
| void | RecordMotorPos (std::vector< std::string > &words, int pos) |
| void | RecordRelativeMotorPos (std::vector< std::string > &words, int relativePos) |
| bool | FormPrampCmd (vector< std::string > &words, string &outCommand) |
| bool | FormXYRampCmd (vector< std::string > &words, string &outCommand) |
| bool | FormXRampCmd (vector< std::string > &words, string &outCommand) |
| bool | FormYRampCmd (vector< std::string > &words, string &outCommand) |
| bool | FormOut1Cmd (vector< std::string > &words, string &outCommand) |
| bool | FormOut2Cmd (vector< std::string > &words, string &outCommand) |
| bool | FormTRetCmd (vector< std::string > &words, string &outCommand) |
| bool | FormTriggerCmd (vector< std::string > &words, string &outCommand) |
| bool | FormTrigDelayModeCmd (vector< std::string > &words, string &outCommand) |
| bool | FormTrigDelayCmd (vector< std::string > &words, string &outCommand) |
| bool | FormADivCmd (vector< std::string > &words, string &outCommand) |
| bool | FormAHoldCmd (vector< std::string > &words, string &outCommand) |
| bool | FormBHoldCmd (vector< std::string > &words, string &outCommand) |
| bool | FormRRampCmd (vector< std::string > &words, string &outCommand) |
| bool | FormRotCrossCmd (vector< std::string > &words, string &outCommand) |
Protected Attributes | |
| const int | PathMotorSpeedMax = 2900 |
| const int | QuarterHalfWaveSpeedMax = 10000 |
| const int | PathMotorAccelMax = 10000 |
| const int | QuarterHalfWaveAccelMax = 10000 |
Protected Attributes inherited from IWPOCTController | |
| bool | swigCMemOwn |
Additional Inherited Members | |
Public Types inherited from IWPOCTController | |
| 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 } |
Static Public Member Functions inherited from IWPOCTController | |
| static IWPOCTController | GetOCTController () |
| static bool | DestroyOCTController () |
Class that converts a scanned image from one format to another.
This class is the implementation of IWPOCTScanConverter.
|
overridevirtual |
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Gets the number of A-scans per B-scan output by the controller.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the baud rate used to communicate with the controller.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the number of B-scans output by the controller.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the current status of the controller.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the delay in milliseconds between the end of one pulse and the start of another.
Implements IWPOCTController.
|
inlineoverridevirtual |
|
overridevirtual |
Get the last command sent.
The char array returned may be different from what the user sent in a SendCommand.
Implements IWPOCTController.
|
inlineoverridevirtual |
|
overridevirtual |
Get the last response from the serial port.
Implements IWPOCTController.
|
overridevirtual |
Get the major and minor mirror values.
| 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 |
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the flag that determines if serial port is constantly being monitored for a connection.
Default is false.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the number of stop bits used to communicate with the controller.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the max possible value of the path motor.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the phase delay.
Should not be greater that trdelay.
Implements IWPOCTController.
|
overridevirtual |
Gets the name of the serial port used by the controller.
The port name is determined automatically by using the keyword “STMicroelectronics”.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the timeout period of the serial port in milliseconds.
Default is 500.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the size of the timing pulse in milliseconds that is used to trigger an A-scan.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the max possible value of the quarter and half wave motors’ position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Gets the flag that determines if the response is read from the serial port after each command is sent.
Default is true.
Implements IWPOCTController.
|
overridevirtual |
Get the limits of the scanning area (each value is between 1500 and 52000).
| 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 |
Implements IWPOCTController.
|
inlineoverridevirtual |
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.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the firmware version of the controller.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the x ramp max position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the x ramp min position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the x ramp start position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the x ramp stop position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the y ramp max position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the y ramp min position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the y ramp start position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Get the y ramp stop position.
Implements IWPOCTController.
|
overridevirtual |
Returns whether the given light is on or off.
Implements IWPOCTController.
|
inlineoverridevirtual |
Returns whether the port is open or closed.
Implements IWPOCTController.
|
inlineoverridevirtual |
|
overridevirtual |
Open the specified port with the parameters supplied.
Port must be open before any commands are issued.
Implements IWPOCTController.
|
overridevirtual |
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.
| command[in] | pointer to character array that contains the command. |
Implements IWPOCTController.
|
overridevirtual |
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.
| 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. |
Implements IWPOCTController.
|
overridevirtual |
Sets the optical switch to the specified port.
| port[in] | 0 or 1 |
Implements IWPOCTController.
|
overridevirtual |
Sets the reference arm position.
Default is 0. It should be a number between 0 and the max value set.
Implements IWPOCTController.
|
overridevirtual |
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.
Implements IWPOCTController.
|
overridevirtual |
Sets the number of B-scans sent out.
Default is 0. It should be an even number between 0 and 65534.
Implements IWPOCTController.
|
overridevirtual |
Sets the delay value in quarter milliseconds.
Default is 50. It should be a number between 0 and 65535.
Implements IWPOCTController.
|
overridevirtual |
Sets the foci value.
Default is 0. It should be a number between 0 and 255.
Implements IWPOCTController.
|
overridevirtual |
|
inlineoverridevirtual |
|
overridevirtual |
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.
Implements IWPOCTController.
|
overridevirtual |
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.
Implements IWPOCTController.
|
inlineoverridevirtual |
Sets the max possible value of the quarter and half wave motor position.
Implements IWPOCTController.
|
inlineoverridevirtual |
Sets the flag that determines if the response from the serial port is read after a command is issued.
Default is true.
Implements IWPOCTController.
|
overridevirtual |
Set the limits of the scanning area (each value is between 1500 and 52000).
| 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 |
Implements IWPOCTController.
|
overridevirtual |
Set the limits of the scanning area (each value is between 1500 and 52000).
| 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. |
Implements IWPOCTController.
|
overridevirtual |
Sets the callback to run if the serial port connection is lost.
| 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. |
Implements IWPOCTController.
|
overridevirtual |
Sets the callback to run if the serial port connection is lost.
| 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. |
Implements IWPOCTController.
|
inlineoverridevirtual |
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.
Implements IWPOCTController.
|
overridevirtual |
Sets the maximum scan position in the x direction.
Implements IWPOCTController.
|
overridevirtual |
Sets the minimum scan position in the x direction.
Implements IWPOCTController.
|
overridevirtual |
Set the max y ramp value.
Implements IWPOCTController.
|
overridevirtual |
Set the min y ramp value.
Implements IWPOCTController.
|
overridevirtual |
Toggles the optical switch from one position to the other.
Implements IWPOCTController.
|
overridevirtual |
Turns the specified light off.
| num[in] | light (1 or 2) |
Implements IWPOCTController.
|
overridevirtual |
Turns the specified light on.
| num[in] | light (1 or 2) |
Implements IWPOCTController.
|
overridevirtual |