A class to parse and represent replies from Zaber devices using the ASCII protocol.
More...
|
int | AxisNumber |
| The axis from which the reply came, or 0 if the reply came from a whole device. More...
|
|
bool | Busy |
| Whether the device is moving or not. More...
|
|
byte | DeviceAddress |
| The address of the device from which the reply came. More...
|
|
ReplyType | MessageType |
| The message type of the reply. Either '@', '#', or '!', for "response", "info", or "alert", respectively. More...
|
|
bool | Rejected |
| Whether the device rejected the last command. More...
|
|
string | ResponseData |
| The "meat" of a response. Can contain many different things: see the command reference for your chosen test to see what to expect. More...
|
|
string | WarningFlags |
| A two-letter code if something is wrong, or "--" if everything is OK. More...
|
|
A class to parse and represent replies from Zaber devices using the ASCII protocol.
Represents the three different possible types of reply.
Enumerator |
---|
Response |
Sent as soon as a device has received a command and determined if it should respond.
|
Info |
Extra info from the device for testing/debugging/programming purposes.
Info is designed to be read by the user and ignored by software. One or more info messages can follow a reply or alert message. The common occurrence of info messages is in reply to the "/help" command.
|
Alert |
Sent when a motion command has completed if a device has the "comm.alert" setting set to 1.
|
Create a blank AsciiReply.
Most of the time, you will want to use the one-argument AsciiReply constructor, which will parse a reply string and turn it into a populated AsciiReply object.
Create a new AsciiReply parsed from a string.
It is rare that you will need to construct an AsciiReply yourself: ZaberPort packages up received strings as AsciiReplies automatically. This constructor parses a reply and builds a matching AsciiReply object.
- Parameters
-
reply | The string to be parsed. |
- Exceptions
-
ArgumentNullException | reply is null. |
FormatException | The reply could not be parsed. |
AsciiReply |
( |
char |
messageType, |
|
|
byte |
deviceAddress, |
|
|
int |
axisNumber, |
|
|
bool |
rejected, |
|
|
bool |
busy, |
|
|
string |
warningFlags, |
|
|
string |
responseData |
|
) |
| |
|
inline |
A constructor for making AsciiReplies by explicitly settings each attribute.
- Parameters
-
messageType | The type of the reply. |
deviceAddress | The address of the device which sent the reply. |
axisNumber | The number of the axis which sent the reply. |
rejected | Whether a command was rejected by the device. |
busy | Whether the device is busy. |
warningFlags | A flag warning that something may be wrong with the device or its operation. |
responseData | The data associated with a reply. |
override bool Equals |
( |
object |
obj | ) |
|
|
inlineinherited |
Tests the equality of any object against this reply.
- Parameters
-
obj | The object to be compared. |
- Returns
- True if the object and this reply are equal, false if they are inequal.
override bool Equals |
( |
Reply |
reply | ) |
|
|
inlinevirtual |
Checks to see if this reply is equal to another Reply.
- Parameters
-
reply | The reply to compare this one to. |
- Returns
- True if the replies are equal, false if inequal.
Implements Reply.
Reports whether an AsciiReply is equal to another AsciiReply.
Equality is defined as having all of the same attribute values. If any of the MessageType, DeviceAddress, AxisNumber, etc. are inequal, this method returns false.
- Parameters
-
- Returns
- true if equal, false if inequal.
override int GetHashCode |
( |
| ) |
|
|
inlinevirtual |
Returns a hash code based off the reply's attributes.
The hash code returned by this function depends on all of the attributes of the object, including the mutable ones. This means that when using this class in a HashMap or similar structure, it should be considered immutable, or else it will be lost upon being changed.
- Returns
- The calculated hash code.
Implements Reply.
override string ToString |
( |
| ) |
|
|
inlinevirtual |
Returns a human-readable representation of this reply.
This method will return a string which is either identical or very similar to the original reply string.
- Returns
- A string representing the reply.
Implements Reply.
The axis from which the reply came, or 0 if the reply came from a whole device.
Whether the device is moving or not.
A device will always be busy immediately after being given a "move" command. This attribute is especially useful for polling a device to see whether it is ready to be given another command.
The address of the device from which the reply came.
The message type of the reply. Either '@', '#', or '!', for "response", "info", or "alert", respectively.
Whether the device rejected the last command.
The "meat" of a response. Can contain many different things: see the command reference for your chosen test to see what to expect.
A two-letter code if something is wrong, or "--" if everything is OK.
The documentation for this class was generated from the following file: