package Rtz.mockers; import Mocker.IDeviceMocker; import Rtz.RtzMapMiddle; 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 RtzMockerMapMiddle extends DeviceMocker implements IDeviceMocker { public RtzMockerMapMiddle() { super(new LocalFileDeviceMocker(RTZ32_Controller.class).getDevice(),new LocalFileDeviceMocker(RTZ32_Controller.class).getDevice().getDeviceCommandsEmpty()); } public RtzMockerMapMiddle getMocker() { return this; } @Override public void updateDevice(boolean active) { RTZ32_ControllerStatus status = (RTZ32_ControllerStatus)device.getDeviceStatus(); status.rtz32.general.state = RTZ32_Status_General.STATE_FLASHING; 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\\rtzserver\\data\\art.servers.rtzserver\\symbols\\16\\Controller.svg"; } @Override public boolean isStatusMode() { return false; } @Override public Class getScriptClass() { return RtzMapMiddle.class; } }