Class StatusMessage

java.lang.Object
org.medcare.igtl.messages.OpenIGTMessage
org.medcare.igtl.messages.StatusMessage

public class StatusMessage extends OpenIGTMessage
** This class create an Status object from bytes received or help to generate bytes to send from it
  • 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

      public StatusMessage(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 **
      Parameters:
      deviceName - Device Name
    • StatusMessage

      public 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 **
      Parameters:
      deviceName - Device Name
    • StatusMessage

      public 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 **
      Parameters:
      deviceName - -Device Name
    • StatusMessage

      public StatusMessage(Header header, byte[] body) throws Exception
      ** Constructor to be used to create message from received data
      Parameters:
      header -
      body -
      Throws:
      Exception
  • Method Details

    • unpackBody

      public boolean unpackBody() throws Exception
      ** To create body from body array

      **

      Specified by:
      unpackBody in class OpenIGTMessage
      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 class OpenIGTMessage
      Returns:
      the bytes array containing the body
    • setStatusData

      public byte[] setStatusData(Status status)
      ** 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

      public void setStatus(Status status)
      ** To set client or server status
      Parameters:
      status - **
    • getStatus

      public 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

      public String getErrorName()
      ** To get errorName subCode **
      Returns:
      the errorName
    • getStatusString

      public String getStatusString()
      ** To get statusString subCode **
      Returns:
      the statusString
    • toString

      public String toString()
      ** To get status String **
      Specified by:
      toString in class OpenIGTMessage
      Returns:
      the status String