asd
Alejandro Acuña
2024-09-16 816cb391a192e357426312ab8e591fd49d1d242e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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()]);
    }
 
}