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