as
Alejandro Acuña
2025-01-21 61cdfc6ee7f013c4533add51d797c1886b312883
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
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<DeviceAction> 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()]);
    }
 
}