package art.servers.pvvserver; import art.library.interop.InteropParameters; import art.library.interop.serialization.SerializationException; import art.library.model.devices.DeviceAction; import art.library.model.devices.vms.pvv.Pvv; import art.library.model.devices.vms.pvv.PvvCommands; import java.util.ArrayList; import java.util.List; public class Shared extends art.servers.Shared { public static Model getModel() { return (art.servers.pvvserver.Model)model; } public static DeviceAction[] responseError (Pvv device, InteropParameters parameters, Exception exception) throws SerializationException, Exception { List result = new ArrayList<>(); String language = (String)parameters.getParameterValue("language"); PvvCommands pvvCommands = parameters.getBodyContentValue(PvvCommands.class); // if (pvvCommands.sequence != null) // { // VmsGeneralCommands command = new VmsGeneralCommands(); // command.sequence = pvvCommands.sequence; // DeviceAction action = new DeviceAction(device, parameters, command); // // // action.actionName = command.getActionName(); // // // DeviceActionResult actionResult = new DeviceActionResult(DeviceActionResult.RESULT_ERROR, exception.getMessage()); // action.setResult(actionResult); // result.add(action); // } // // if (pvvCommands.reset == VmsGeneralCommands.CONDITION_YES) // { // VmsGeneralCommands command = new VmsGeneralCommands(); // command.reset = pvvCommands.reset; // DeviceAction action = new DeviceAction(device, parameters, command); // // action.actionName = command.getActionName(); // // DeviceActionResult actionResult = new DeviceActionResult(DeviceActionResult.RESULT_ERROR, exception.getMessage()); // action.setResult(actionResult); // result.add(action); // } // // if ((pvvCommands.brightness != -2) || (pvvCommands.blinkOn > -1) || (pvvCommands.blinkOff > -1) || (pvvCommands.messageTime > 0)) // { // VmsGeneralCommands command = new VmsGeneralCommands(); // if (pvvCommands.brightness != -2) // command.brightness = pvvCommands.brightness; // if (pvvCommands.blinkOn > -1) // command.blinkOn = pvvCommands.blinkOn; // if (pvvCommands.blinkOff > -1) // command.blinkOff = pvvCommands.blinkOff; // if (pvvCommands.messageTime > 0) // command.messageTime = pvvCommands.messageTime; // DeviceAction action = new DeviceAction(device, parameters, command); // // action.actionName = command.getActionName(); // // DeviceActionResult actionResult = new DeviceActionResult(DeviceActionResult.RESULT_ERROR, exception.getMessage()); // action.setResult(actionResult); // result.add(action); // } return result.toArray(new DeviceAction[result.size()]); } }