zaber.motion.ascii.AlertEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of motion-library Show documentation
Show all versions of motion-library Show documentation
A library that aims to provide easy-to-use API for communication with Zaber devices using Zaber ASCII Protocol.
// ===== THIS FILE IS GENERATED FROM A TEMPLATE ===== //
// ============== DO NOT EDIT DIRECTLY ============== //
package zaber.motion.ascii;
import zaber.motion.protobufs.Main;
/**
* Alert message received from the device.
*/
public final class AlertEvent {
private int deviceAddress;
/**
* Number of the device that sent the message.
*/
public void setDeviceAddress(int deviceAddress) {
this.deviceAddress = deviceAddress;
}
/**
* @return Number of the device that sent the message.
*/
public int getDeviceAddress() {
return this.deviceAddress;
}
private int axisNumber;
/**
* Number of the axis which the response applies to. Zero denotes device scope.
*/
public void setAxisNumber(int axisNumber) {
this.axisNumber = axisNumber;
}
/**
* @return Number of the axis which the response applies to. Zero denotes device scope.
*/
public int getAxisNumber() {
return this.axisNumber;
}
private String status;
/**
* The device status contains BUSY when the axis is moving and IDLE otherwise.
*/
public void setStatus(String status) {
this.status = status;
}
/**
* @return The device status contains BUSY when the axis is moving and IDLE otherwise.
*/
public String getStatus() {
return this.status;
}
private String warningFlag;
/**
* The warning flag contains the highest priority warning currently active for the device or axis.
*/
public void setWarningFlag(String warningFlag) {
this.warningFlag = warningFlag;
}
/**
* @return The warning flag contains the highest priority warning currently active for the device or axis.
*/
public String getWarningFlag() {
return this.warningFlag;
}
private String data;
/**
* Response data which varies depending on the request.
*/
public void setData(String data) {
this.data = data;
}
/**
* @return Response data which varies depending on the request.
*/
public String getData() {
return this.data;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("AlertEvent { ");
sb.append("deviceAddress: ");
sb.append(this.deviceAddress);
sb.append(", ");
sb.append("axisNumber: ");
sb.append(this.axisNumber);
sb.append(", ");
sb.append("status: ");
sb.append(this.status);
sb.append(", ");
sb.append("warningFlag: ");
sb.append(this.warningFlag);
sb.append(", ");
sb.append("data: ");
sb.append(this.data);
sb.append(" }");
return sb.toString();
}
public static AlertEvent fromProtobuf(Main.AlertEvent pbData) {
AlertEvent obj = new AlertEvent();
obj.setDeviceAddress(pbData.getDeviceAddress());
obj.setAxisNumber(pbData.getAxisNumber());
obj.setStatus(pbData.getStatus());
obj.setWarningFlag(pbData.getWarningFlag());
obj.setData(pbData.getData());
return obj;
}
}