Package org.medcare.igtl.messages
Class StatusMessage
java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
org.medcare.igtl.messages.StatusMessage
** This class create an Status object from bytes received or help to generate
bytes to send from it
-
Field Summary
Modifier and TypeFieldDescriptionstatic int
static int
Fields inherited from class org.medcare.igtl.messages.OpenIGTMessage
bytesArray, deviceName, VERSION
-
Constructor Summary
ConstructorDescriptionStatusMessage
(String deviceName) ** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **StatusMessage
(String deviceName, int code, int subCode, String status) ** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **StatusMessage
(String deviceName, int code, int subCode, String errorName, String status) ** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **StatusMessage
(Header header, byte[] body) ** Constructor to be used to create message from received data -
Method Summary
Modifier and TypeMethodDescriptionlong
getCode()
** To get client or server code **** To get errorName subCode **** To get client or server status **byte[]
** To get status_data byte array **** To get statusString subCode **long
** To get Image subCode **byte[]
packBody()
** To create body from image_header and image_data SetStatusData must have called firstvoid
setCode
(long code) ** To set client or server codevoid
** To set client or server statusvoid
setStatusData
(byte[] status_data) ** To extract image characteristics from status_data byte arraybyte[]
setStatusData
(Status status) ** To create status_data from server or client status and to get the byte array to sendtoString()
** To get status String **boolean
** To create body from body arrayMethods inherited from class org.medcare.igtl.messages.OpenIGTMessage
getBody, getBytes, getDeviceName, getHeader, setBody, setHeader, Unpack
-
Field Details
-
IGTL_STATUS_HEADER_SIZE
public static int IGTL_STATUS_HEADER_SIZE -
IGTL_STATUS_ERROR_NAME_LENGTH
public static int IGTL_STATUS_ERROR_NAME_LENGTH
-
-
Constructor Details
-
StatusMessage
** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **- Parameters:
deviceName
- Device Name
-
StatusMessage
** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **- Parameters:
deviceName
- Device Name
-
StatusMessage
** Constructor to be used to create message to send them with this constructor you must use method SetImageHeader, then CreateBody and then getBytes to send them **- Parameters:
deviceName
- -Device Name
-
StatusMessage
** Constructor to be used to create message from received data- Parameters:
header
-body
-- Throws:
Exception
-
-
Method Details
-
unpackBody
** To create body from body array**
- Specified by:
unpackBody
in classOpenIGTMessage
- Returns:
- true if unpacking is ok
- Throws:
Exception
-
packBody
public byte[] packBody()** To create body from image_header and image_data SetStatusData must have called first**
- Specified by:
packBody
in classOpenIGTMessage
- Returns:
- the bytes array containing the body
-
setStatusData
** To create status_data from server or client status and to get the byte array to send- Parameters:
status
- **- Returns:
- the bytes array created from the value
-
setStatusData
public void setStatusData(byte[] status_data) ** To extract image characteristics from status_data byte array- Parameters:
status_data
-
-
getStatusData
public byte[] getStatusData()** To get status_data byte array **- Returns:
- the status_data bytes array
-
setCode
public void setCode(long code) ** To set client or server code- Parameters:
code
- **
-
getCode
public long getCode()** To get client or server code **- Returns:
- the status code
-
setStatus
** To set client or server status- Parameters:
status
- **
-
getStatus
** To get client or server status **- Returns:
- the status code
-
getSubCode
public long getSubCode()** To get Image subCode **- Returns:
- the subCode array
-
getErrorName
** To get errorName subCode **- Returns:
- the errorName
-
getStatusString
** To get statusString subCode **- Returns:
- the statusString
-
toString
** To get status String **- Specified by:
toString
in classOpenIGTMessage
- Returns:
- the status String
-