package Rtz.mockers;
|
|
import Mocker.IDeviceMocker;
|
import Rtz.RTZSchematic;
|
import art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller;
|
import art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerCommands;
|
import art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerStatus;
|
import art.library.model.devices.colors.controller.RTZ32.commands.RTZ32_Commands_Centralized;
|
import art.library.model.devices.colors.controller.RTZ32.commands.RTZ32_Commands_Computer;
|
import art.library.model.devices.colors.controller.RTZ32.commands.RTZ32_Commands_Online;
|
import art.library.model.devices.colors.controller.RTZ32.commands.RTZ32_Commands_Plan;
|
import art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General;
|
import devices.mockers.LocalFileDeviceMocker;
|
import svgdevicestest.mock.*;
|
|
public class RtzMockerSchematic extends DeviceMocker implements IDeviceMocker
|
{
|
|
public RtzMockerSchematic()
|
{
|
super(new LocalFileDeviceMocker<RTZ32_Controller>(RTZ32_Controller.class).getDevice(),new LocalFileDeviceMocker<RTZ32_Controller>(RTZ32_Controller.class).getDevice().getDeviceCommandsEmpty());
|
}
|
|
public RtzMockerSchematic getMocker()
|
{
|
return this;
|
}
|
|
@Override
|
public void updateDevice(boolean active)
|
{
|
RTZ32_ControllerStatus status = (RTZ32_ControllerStatus)device.getDeviceStatus();
|
status.rtz32.general.control = RTZ32_Status_General.CONTROL_LOCAL;
|
|
RTZ32_ControllerCommands commands = RTZ32_ControllerCommands.class.cast(this.commands);
|
{
|
if ((System.currentTimeMillis() / 1000) % 2 == 0)
|
{
|
commands.online = new RTZ32_Commands_Online();
|
commands.online.colorsMode = RTZ32_ControllerCommands.COLORS_MODE_COLORS;
|
commands.online.plan = new RTZ32_Commands_Plan();
|
|
commands.online.computerMode = new RTZ32_Commands_Computer();
|
{
|
commands.online.computerMode.semiactuated = !commands.online.computerMode.actuated;
|
commands.online.control = RTZ32_ControllerCommands.CONTROL_COMPUTER;
|
}
|
}
|
else
|
{
|
commands.online = new RTZ32_Commands_Online();
|
commands.online.colorsMode = RTZ32_ControllerCommands.COLORS_MODE_FLASHING;
|
commands.online.plan = new RTZ32_Commands_Plan();
|
|
commands.online.computerMode = new RTZ32_Commands_Computer();
|
{
|
commands.online.computerMode.semiactuated = !commands.online.computerMode.actuated;
|
commands.online.control = RTZ32_ControllerCommands.CONTROL_LOCAL;
|
}
|
}
|
|
commands.online.centralized = new RTZ32_Commands_Centralized();
|
{
|
}
|
|
commands.online.centralized = new RTZ32_Commands_Centralized();
|
{
|
commands.online.centralized.centralized = true;
|
}
|
}
|
|
}
|
|
@Override
|
public String getFilePath()
|
{
|
return "C:\\Users\\Konstantin\\Documents\\LocalBackup\\Obras\\Zaragoza\\maps\\Ejemplo.svg";
|
}
|
|
@Override
|
public boolean isStatusMode()
|
{
|
return true;
|
}
|
|
@Override
|
public Class getScriptClass()
|
{
|
return RTZSchematic.class;
|
}
|
}
|