📄 allocator.java
字号:
package com.zcsoft.stock;
/** 分配车数据类 */
public class Allocator extends Device
{
/** 是否联机状态 */
private boolean online = false;
/** 运行方向:入库 */
private boolean inward;
/** 运行方向:入库 */
private boolean outward;
/** 是否没有托盘 */
private boolean empty = true;
/** 运行速度 */
private int speed;
/** 当前排 */
private int line;
/** use serialVersionUID from JDK 1.0.2 for interoperability */
private static final long serialVersionUID = -8605125614042003001L;
/** @param ID 设备唯一标识号 */
public Allocator(Object ID)
{
super(ID);
}
public boolean isOnline()
{
return online;
}
public void setOnline(boolean online)
{
boolean old = this.online;
this.online = online;
this.firePropertyChange("online", old, online);
}
/** @param an */
public void copyFieldFrom(Device an)
{
super.copyFieldFrom(an);
Allocator a = (Allocator)an;
this.setOnline(a.online);
this.setEmpty(a.empty);
this.setInward(a.inward);
this.setOutward(a.outward);
this.setSpeed(a.speed);
this.setLine(a.line);
}
/**
*
* @return Boolean.TRUE=入库;Boolean.FALSE=出库;null=静止
*/
public Boolean getDirection()
{
return inward?Boolean.TRUE:(outward?Boolean.FALSE:null);
}
public void setEmpty(boolean empty)
{
boolean old = this.empty;
this.empty = empty;
this.firePropertyChange("empty", old, empty);
}
public boolean isEmpty()
{
return empty;
}
public void setSpeed(int speed)
{
int old = this.speed;
this.speed = speed;
this.firePropertyChange("speed", old, speed);
}
public int getSpeed()
{
return speed;
}
public void setLine(int line)
{
int old = this.line;
this.line = line;
this.firePropertyChange("line", old, line);
}
public int getLine()
{
return line;
}
public void setInward(boolean inward)
{
boolean old = this.inward;
this.inward = inward;
if (inward)
{
outward = false;
}
this.firePropertyChange("inward", old, inward);
}
public void setOutward(boolean outward)
{
boolean old = this.outward;
this.outward = outward;
if (outward)
{
inward = false;
}
this.firePropertyChange("outward", old, outward);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -