as
Alejandro Acuña
2025-01-21 61cdfc6ee7f013c4533add51d797c1886b312883
svgDevicesTest/src/Rtz/mockers/RtzMockerMapComplex.java
@@ -2,9 +2,9 @@
import Mocker.IDeviceMocker;
import art.library.interop.serialization.Serialization;
import art.library.interop.serialization.SerializationException;
import art.library.model.devices.Device;
import art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller;
import devices.mockers.LocalFileDeviceMocker;
import java.io.File;
import java.util.Random;
import svgdevicestest.mock.*;
@@ -13,9 +13,9 @@
{
    private final static Random rnd = new Random();
    public RtzMockerMapComplex()
    public RtzMockerMapComplex() throws SerializationException
    {
        super(new LocalFileDeviceMocker<RTZ32_Controller>(RTZ32_Controller.class).getDevice(), new LocalFileDeviceMocker<RTZ32_Controller>(RTZ32_Controller.class).getDevice().getDeviceCommandsEmpty());
        super((Device)Serialization.deserialize(RTZ32_Controller.class, new File("C:\\Users\\Konstantin\\Desktop\\rtz.txt")));
    }
    public RtzMockerMapComplex getMocker() 
@@ -39,64 +39,36 @@
//                information.mode = RTZ32_ControllerInformation.MODE_NON_CENTRALIZED;
//            }
            
            Device d = Serialization.deserialize(RTZ32_Controller.class, new File("C:\\Users\\Konstantin\\Desktop\\rtz.txt"));
//            Device d = Serialization.deserialize(RTZ32_Controller.class, new File("C:\\Users\\Konstantin\\Desktop\\rtz_svg.txt"));
//            device = d;
            
            RTZ32_Controller controller = (RTZ32_Controller) d;
            device.status =  controller.status;
            device.information = controller.information;
            device.configuration = controller.configuration;
            device.alarms = controller.alarms;
//        RTZ32_ControllerCommands commands = RTZ32_ControllerCommands.class.cast(this.commands);
//        {
//            if ((System.currentTimeMillis() / 1000) % 2 == 0)
//            RTZ32_Controller controller = (RTZ32_Controller)device;
//            controller.getDeviceStatus().rtz32.forcings.plan = new RTZ32_Commands_Plan();
//            {
//                commands.online = new RTZ32_Commands_Online();
//                commands.online.colorsMode = RTZ32_ControllerCommands.COLORS_MODE_COLORS;
//                commands.online.plan = new RTZ32_Commands_Plan();
//                commands.online.plan.number = rnd.nextInt(7) + 1;
//                commands.online.plan.offset = rnd.nextInt(255);
//                commands.online.realtime = rnd.nextBoolean();
//
//                commands.online.computerMode = new RTZ32_Commands_Computer();
//                {
//                    commands.online.computerMode.actuated = rnd.nextBoolean();
//                    commands.online.computerMode.semiactuated = !commands.online.computerMode.actuated;
//                    commands.online.control = RTZ32_ControllerCommands.CONTROL_COMPUTER;
//                }
//                controller.getDeviceStatus().rtz32.forcings.plan.number = 1;
//                controller.getDeviceStatus().rtz32.forcings.plan.offset = 20;
//            }
//            else
//            {
//                 commands.online = new RTZ32_Commands_Online();
//                 commands.online.colorsMode = RTZ32_ControllerCommands.COLORS_MODE_FLASHING;
//                 commands.online.plan = new RTZ32_Commands_Plan();
//                 commands.online.plan.number = rnd.nextInt(7) + 1;
//                 commands.online.plan.offset = rnd.nextInt(255);
//                 commands.online.realtime = rnd.nextBoolean();
//
//                 commands.online.clearAlarms = rnd.nextBoolean();
//
//            d.setAlarm("alarm_offline", false);
//
//            controller.getDeviceAlarms().rtz32.flashing.alarm_flashing_bus_I2C = 1000;
//
//            controller.getDeviceInformation().mode = RTZ32_ControllerInformation.MODE_CENTRALIZED;
//
////            controller.getDeviceStatus().rtz32.centralized = new RTZ32_Status_Centralized();
////            {
////            controller.getDeviceStatus().rtz32.centralized.centralized = false;
////            }
//
//            controller.getDeviceStatus().rtz32.general.control = RTZ32_Status_General.CONTROL_LOCAL;
//
//                commands.online.computerMode = new RTZ32_Commands_Computer();
//                {
//                    commands.online.computerMode.actuated = rnd.nextBoolean();
//                    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.centralized = rnd.nextBoolean();
//            }
//
//            commands.online.centralized = new RTZ32_Commands_Centralized();
//            {
////              commands.online.centralized.centralized = true;
//                commands.online.centralized.centralized = rnd.nextBoolean();
//            }
//        }
//            device.status =  controller.status;
//            device.information = controller.information;
//            device.configuration = controller.configuration;
//            device.alarms = controller.alarms;
//
        } catch (Exception ex)
        {
        }
@@ -105,7 +77,7 @@
    @Override
    public String getFilePath()
    {
        return "C:\\Users\\Konstantin\\Documents\\LocalBackup\\Obras\\Zaragoza\\rtzserver\\data\\art.servers.rtzserver\\symbols\\18\\Controller.svg";
        return "X:\\ARTIC3\\applications\\colors\\rtzserver\\data\\art.servers.rtzserver\\symbols\\18\\Controller.svg";
    }
    @Override