package svgdevicestest.mock;
|
|
import art.library.model.devices.vms.rotapanel.VmsRotapanel;
|
import art.library.model.devices.vms.rotapanel.VmsRotapanelAlarms;
|
import art.library.model.devices.vms.rotapanel.VmsRotapanelStatus;
|
|
public class VmsRotaPanelStatusMocker extends DeviceMocker
|
{
|
int face = 0;
|
|
public VmsRotaPanelStatusMocker()
|
{
|
super(new VmsRotapanel("rotapanel"));
|
}
|
|
public VmsRotaPanelStatusMocker getMocker()
|
{
|
return this;
|
}
|
|
@Override
|
public void updateDevice(boolean active)
|
{
|
VmsRotapanel vmsRotapanel = (VmsRotapanel) device;
|
vmsRotapanel.status = new VmsRotapanelStatus();
|
vmsRotapanel.alarms = new VmsRotapanelAlarms();
|
|
face++;
|
if (face > 3) face = 0;
|
vmsRotapanel.getDeviceStatus().face = face;
|
|
if (active)
|
{
|
vmsRotapanel.setAlarm("alarm_offline", true);
|
vmsRotapanel.getDeviceStatus().lightActive = true;
|
vmsRotapanel.getDeviceStatus().manualControlActive = true;
|
vmsRotapanel.getDeviceStatus().turnTestActive = true;
|
vmsRotapanel.getDeviceStatus().rotationInterval = 15;
|
} else
|
{
|
vmsRotapanel.getDeviceStatus().lightActive = false;
|
vmsRotapanel.getDeviceStatus().manualControlActive = false;
|
vmsRotapanel.getDeviceStatus().turnTestActive = false;
|
vmsRotapanel.getDeviceStatus().rotationInterval = 0;
|
}
|
active = !active;
|
}
|
}
|