2 files added
16 files modified
| | |
| | | borderopacity="1.0" |
| | | inkscape:pageopacity="0.0" |
| | | inkscape:pageshadow="2" |
| | | inkscape:zoom="15.839192" |
| | | inkscape:cx="-12.823288" |
| | | inkscape:cy="13.478538" |
| | | inkscape:zoom="5.6" |
| | | inkscape:cx="-39.351516" |
| | | inkscape:cy="45.026974" |
| | | inkscape:document-units="mm" |
| | | inkscape:current-layer="svg1894" |
| | | showgrid="false" |
| | |
| | | |
| | | public void timer() |
| | | { |
| | | status(); |
| | | } |
| | | |
| | | public void status() |
| | |
| | | flashOn = java.util.Calendar.getInstance().get(java.util.Calendar.SECOND) % 2 == 0; |
| | | |
| | | Device device = getDevice(); |
| | | art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerInformation information = (art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerInformation) device.getDeviceInformation(); |
| | | art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerStatus status = (art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerStatus) device.getDeviceStatus(); |
| | | |
| | | art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General statusGeneral = status.rtz32.general; |
| | |
| | | SVGElement background = getElement("Background"); |
| | | SVGElement border = getElement("Border"); |
| | | |
| | | setAttribute(border, "display", "none",999); |
| | | setAttribute(background, "display", "none", 999); |
| | | setAttribute(border, "display", "inline",999); |
| | | setAttribute(background, "display", "inline", 999); |
| | | |
| | | SVGElement controlMode = null; |
| | | |
| | | if (status.status == art.library.model.devices.DeviceStatus.STATUS_UNKNOWN || status.status == art.library.model.devices.DeviceStatus.STATUS_OFFLINE) |
| | | if (information.mode == art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerInformation.MODE_NON_CENTRALIZED) |
| | | { |
| | | setAttribute(background, "fill", "#00FF00", 999); |
| | | setAttribute(background, "display", flashOn || status.status == art.library.model.devices.DeviceStatus.STATUS_OFFLINE ? "inline" : "none", 999); |
| | | } |
| | | else if (statusGeneral.state == art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General.STATE_FLASHING) |
| | | { |
| | | setAttribute(border, "fill", "#FFFFFF",999); |
| | | setAttribute(background, "fill", "#FFFFFF", 999); |
| | | setAttribute(background, "display", flashOn ? "inline" : "none", 999); |
| | | } |
| | | else |
| | | { |
| | | controlMode = statusGeneral.semiactuated ? border : background; |
| | | if (status.rtz32.centralized.centralized == false) |
| | | { |
| | | setAttribute(border, "fill", "#808080", 999); |
| | | setAttribute(background, "fill", "#808080", 999); |
| | | } |
| | | else |
| | | { |
| | | boolean semiactuated = status.rtz32.general.semiactuated ; |
| | | boolean offline = false; |
| | | |
| | | if (device.getAlarm("alarm_controller_offline") > 0 || device.getAlarm("alarm_offline") > 0) |
| | | { |
| | | offline = true; |
| | | setAttribute(border, "display", flashOn ? "inline" : "none", 999); |
| | | setAttribute(background, "display", flashOn ? "inline" : "none", 999); |
| | | } |
| | | |
| | | if (controlMode != null) |
| | | if (status.rtz32.general.control == art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General.CONTROL_COMPUTER) |
| | | { |
| | | if (statusGeneral.control == art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General.CONTROL_LOCAL) |
| | | setAttribute(border, "fill", "#00FF00", 999); |
| | | setAttribute(background, "fill", "#00FF00", 999); |
| | | |
| | | if(offline == true) |
| | | { |
| | | setAttribute(controlMode, "fill", "#FF0000", 999); |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | setAttribute(border, "display", flashOn ? "none" : "inline", 999); |
| | | } |
| | | else if (statusGeneral.control == art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General.CONTROL_COMPUTER) |
| | | { |
| | | setAttribute(controlMode, "fill", "#00FF00", 999); |
| | | |
| | | if(semiactuated) |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | } |
| | | setAttribute(controlMode, "display", "inline", 999); |
| | | else if (status.rtz32.general.control == art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General.CONTROL_LOCAL) |
| | | { |
| | | setAttribute(border, "fill", "#FF0000", 999); |
| | | setAttribute(background, "fill", "#FF0000", 999); |
| | | |
| | | if (offline == true) |
| | | { |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | setAttribute(border, "display", flashOn ? "none" : "inline", 999); |
| | | } |
| | | |
| | | if(semiactuated) |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | } |
| | | |
| | | if (device.getAlarm("alarm_controller_offline") <= 0 && device.getAlarm("alarm_offline") <= 0) |
| | | { |
| | | if (art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller.class.cast(device).getDeviceAlarms().rtz32.flashing.getServerityAlarm() > 0) |
| | | { |
| | | setAttribute(border, "fill", "#FFFF00", 999); |
| | | setAttribute(background, "fill", "#FFFF00", 999); |
| | | setAttribute(border, "display", flashOn ? "inline" : "none", 999); |
| | | setAttribute(background, "display", flashOn ? "inline" : "none", 999); |
| | | |
| | | if(semiactuated) |
| | | setAttribute(background, "display","none", 999); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | catch (Exception ex){} |
| | | } |
| | | "> |
| | | }"> |
| | | <rdf:RDF> |
| | | <cc:Work |
| | | rdf:about=""> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| | | <!-- Created with Inkscape (http://www.inkscape.org/) --> |
| | | |
| | | <svg |
| | | xmlns:dc="http://purl.org/dc/elements/1.1/" |
| | | xmlns:cc="http://creativecommons.org/ns#" |
| | | xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| | | xmlns:svg="http://www.w3.org/2000/svg" |
| | | xmlns="http://www.w3.org/2000/svg" |
| | | xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
| | | xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
| | | width="24" |
| | | height="24" |
| | | viewBox="0 0 6.3499999 6.3500002" |
| | | version="1.1" |
| | | id="svg8" |
| | | inkscape:export-filename="C:\Users\Konstantin\Documents\LocalBackup\UI\Icons\24x24\send-working.png" |
| | | inkscape:export-xdpi="95.380096" |
| | | inkscape:export-ydpi="95.380096" |
| | | inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)" |
| | | sodipodi:docname="alarm-configuration.svg"> |
| | | <defs |
| | | id="defs2" /> |
| | | <sodipodi:namedview |
| | | id="base" |
| | | pagecolor="#ffffff" |
| | | bordercolor="#666666" |
| | | borderopacity="1.0" |
| | | inkscape:pageopacity="0.0" |
| | | inkscape:pageshadow="2" |
| | | inkscape:zoom="15.839192" |
| | | inkscape:cx="7.0600233" |
| | | inkscape:cy="8.6561954" |
| | | inkscape:document-units="mm" |
| | | inkscape:current-layer="layer1" |
| | | showgrid="false" |
| | | units="px" |
| | | inkscape:window-width="1920" |
| | | inkscape:window-height="1027" |
| | | inkscape:window-x="-8" |
| | | inkscape:window-y="-8" |
| | | inkscape:window-maximized="1" /> |
| | | <metadata |
| | | id="metadata5"> |
| | | <rdf:RDF> |
| | | <cc:Work |
| | | rdf:about=""> |
| | | <dc:format>image/svg+xml</dc:format> |
| | | <dc:type |
| | | rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
| | | <dc:title></dc:title> |
| | | </cc:Work> |
| | | </rdf:RDF> |
| | | </metadata> |
| | | <g |
| | | inkscape:label="Capa 1" |
| | | inkscape:groupmode="layer" |
| | | id="layer1" |
| | | transform="translate(0,-290.64998)"> |
| | | <g |
| | | transform="matrix(0.00567882,0,0,0.00567882,3.4176231,294.07248)" |
| | | id="g2186" |
| | | style="stroke-width:1.13664603"> |
| | | <g |
| | | id="g2184" |
| | | style="stroke-width:1.13664603"> |
| | | <path |
| | | inkscape:connector-curvature="0" |
| | | d="m 501.818,90.998 c -1.876,-4.733 -6.008,-8.203 -10.993,-9.234 -4.991,-1.033 -10.156,0.516 -13.756,4.116 l -77.994,77.994 -41.932,-9.016 -9.015,-41.932 77.994,-77.995 c 3.6,-3.6 5.146,-8.77 4.116,-13.755 -1.031,-4.986 -4.502,-9.117 -9.234,-10.995 -53.547,-21.234 -114.462,-8.643 -155.186,32.079 -19.604,19.604 -33.066,44.227 -38.93,71.206 -5.017,23.082 -4.312,46.931 1.991,69.544 L 20.735,391.154 C 7.363,404.524 0,422.301 0,441.21 0,460.119 7.363,477.896 20.734,491.266 34.105,504.637 51.881,512 70.79,512 c 18.908,0 36.686,-7.363 50.056,-20.734 L 328.99,283.122 c 22.614,6.302 46.462,7.006 69.543,1.99 26.98,-5.864 51.603,-19.326 71.207,-38.93 40.723,-40.722 53.313,-101.637 32.078,-155.184 z" |
| | | id="path2182" |
| | | style="stroke-width:1.13664603" /> |
| | | </g> |
| | | </g> |
| | | <path |
| | | style="opacity:1;fill:#000000;fill-opacity:1;stroke:none;stroke-width:6.50078773;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:0.64313725" |
| | | d="M 9.3007812 0.02734375 A 9.2999367 9.5535711 0 0 0 0 9.5800781 A 9.2999367 9.5535711 0 0 0 9.3007812 19.134766 A 9.2999367 9.5535711 0 0 0 18.599609 9.5800781 A 9.2999367 9.5535711 0 0 0 9.3007812 0.02734375 z M 9.3261719 2.0039062 A 0.6883818 0.6883818 0 0 1 10.033203 2.6914062 L 10.033203 3.4433594 A 4.1302896 4.1302896 0 0 1 13.476562 7.5117188 L 13.476562 11.640625 L 14.853516 13.017578 L 3.8378906 13.017578 L 5.2148438 11.640625 L 5.2148438 7.5117188 A 4.1302896 4.1302896 0 0 1 8.6582031 3.4433594 L 8.6582031 2.6914062 A 0.6883818 0.6883818 0 0 1 9.3261719 2.0039062 z M 7.96875 14.394531 L 10.722656 14.394531 A 1.3767633 1.3767633 0 0 1 7.96875 14.394531 z " |
| | | transform="matrix(0.26458333,0,0,0.26458333,0,290.64998)" |
| | | id="path827" /> |
| | | </g> |
| | | </svg> |
| | |
| | | #Wed, 26 Feb 2025 13:30:34 +0100 |
| | | #Wed, 16 Apr 2025 12:23:14 +0200 |
| | | |
| | | |
| | | D\:\\LocalBackup\\svgDevicesTest= |
| | |
| | | public class SvgDeviceStatusTest |
| | | { |
| | | |
| | | private static final SvgMocker SELECTED_MOCKER = SvgMocker.M_Controller; |
| | | private static final SvgMocker SELECTED_MOCKER = SvgMocker.RTZMap; |
| | | |
| | | public static String mapPath; |
| | | |
| | |
| | | setAttribute(thunderbolt, "display", "inline"); |
| | | setAttribute(thunderbolt, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", color, 999); |
| | | |
| | | setAttribute(border, "stroke", "#0000FF"); |
| | | setAttribute(border, "stroke-width", 10.5); |
| | | |
| | | } else if (commands.userControlPlan == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_NO) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | |
| | | { |
| | | statusSubcontroller(controllerStatus.lsubcontroller.get(i).number); |
| | | } |
| | | } catch (Exception e) |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | setAttribute(alarm, "display", "none"); |
| | | setAttribute(icon, "fill", "#800080", 999); |
| | | setText("Text number", String.format("%05d", controllerInformation.number)); |
| | | DeviceCommands deviceCommands = getDeviceCommands(); |
| | | if (!deviceCommands.isEmpty()) |
| | | |
| | | commands = new art.library.model.devices.colors.controller.M.M_ControllerCommands(); |
| | | { |
| | | art.library.model.devices.colors.controller.M.M_ControllerCommands controllerCommands = (art.library.model.devices.colors.controller.M.M_ControllerCommands)commands; |
| | | { |
| | | controllerCommands.userControlPlan = 1; |
| | | } |
| | | } |
| | | |
| | | if (!commands.isEmpty()) |
| | | { |
| | | switch (commands.colorsMode) |
| | | { |
| | |
| | | setAttribute(background, "fill", "#00FF00"); |
| | | setAttribute(icon, "fill", "#008000"); |
| | | setAttribute(border, "stroke", "#008000"); |
| | | |
| | | |
| | | break; |
| | | default: |
| | | setAttribute(background, "fill", "#00FF00"); |
| | |
| | | setAttribute(border, "stroke", "#008000"); |
| | | break; |
| | | } |
| | | } else |
| | | |
| | | if (art.library.model.devices.colors.controller.M.M_ControllerCommands.class.cast(commands).userControlPlan == DeviceCommands.CONDITION_YES) |
| | | { |
| | | setAttribute(border, "stroke", "#0000FF"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | setAttribute(background, "fill", "#0000FF"); |
| | | setAttribute(icon, "fill", "#000080"); |
| | |
| | | |
| | | try |
| | | { |
| | | M_Controller mock = (M_Controller)Serialization.deserialize(M_Controller.class, new File("C:\\Users\\Konstantin\\Desktop\\junction.txt")); |
| | | int i = 0; |
| | | |
| | | controller.status = mock.status; |
| | | controller.information = mock.information; |
| | | controller.alarms = mock.alarms; |
| | | controller.realtime = mock.realtime; |
| | | controller.graphics = mock.graphics; |
| | | controller.configuration = mock.configuration; |
| | | |
| | | controller.getDeviceStatus().getStatusSubcontroller().userControlPlan = 1; |
| | | M_Controller mock = (M_Controller)Serialization.deserialize(M_Controller.class, new File("C:\\Users\\Konstantin\\Desktop\\controller.txt")); |
| | | // int i = 0; |
| | | // |
| | | // controller.status = mock.status; |
| | | // controller.information = mock.information; |
| | | // controller.alarms = mock.alarms; |
| | | // controller.realtime = mock.realtime; |
| | | // controller.graphics = mock.graphics; |
| | | // controller.configuration = mock.configuration; |
| | | // |
| | | // controller.getDeviceStatus().getStatusSubcontroller().userControlPlan = 1; |
| | | |
| | | } |
| | | catch (SerializationException ex) |
| | |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | setAttribute(border, "display", flashOn ? "none" : "inline", 999); |
| | | } |
| | | |
| | | if(semiactuated) |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | } |
| | | else if (status.rtz32.general.control == art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General.CONTROL_LOCAL) |
| | | { |
| | |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | setAttribute(border, "display", flashOn ? "none" : "inline", 999); |
| | | } |
| | | |
| | | if(semiactuated) |
| | | setAttribute(background, "display", flashOn || semiactuated ? "none" : "inline", 999); |
| | | } |
| | | |
| | | if (device.getAlarm("alarm_controller_offline") <= 0 && device.getAlarm("alarm_offline") <= 0) |
| | | { |
| | | if (art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller.class.cast(device).getDeviceAlarms().rtz32.flashing.getServerityAlarm() > 0) |
| | | if (art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller.class.cast(device).getDeviceStatus().rtz32.general.state == status.rtz32.general.STATE_FLASHING) |
| | | { |
| | | setAttribute(border, "fill", "#FFFF00", 999); |
| | | setAttribute(background, "fill", "#FFFF00", 999); |
| | |
| | | } |
| | | if (device.getAlarm("alarm_controller_offline") <= 0 && device.getAlarm("alarm_offline") <= 0) |
| | | { |
| | | if (art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller.class.cast(device).getDeviceAlarms().rtz32.flashing.getServerityAlarm() > 0) |
| | | if (art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller.class.cast(device).getDeviceStatus().rtz32.general.state == controllerStatus.rtz32.general.STATE_FLASHING) |
| | | { |
| | | setAttribute(background, "fill", "#FFFF00", 999); |
| | | setAttribute(ribbon, "stroke", "#FFFF00", 999); |
| | |
| | | |
| | | import Mocker.IDeviceMocker; |
| | | import Rtz.RtzMap; |
| | | import art.library.interop.serialization.Serialization; |
| | | import art.library.model.devices.colors.controller.RTZ32.RTZ32_Controller; |
| | | import art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerInformation; |
| | | import art.library.model.devices.colors.controller.RTZ32.RTZ32_ControllerStatus; |
| | | import art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_Centralized; |
| | | import art.library.model.devices.colors.controller.RTZ32.status.RTZ32_Status_General; |
| | | import devices.mockers.LocalFileDeviceMocker; |
| | | import java.nio.file.Files; |
| | | import java.nio.file.Paths; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | import svgdevicestest.mock.*; |
| | | |
| | | public class RtzMockerMap extends DeviceMocker implements IDeviceMocker |
| | |
| | | @Override |
| | | public void updateDevice(boolean active) |
| | | { |
| | | // RTZ32_Controller.class.cast(device).getDeviceInformation().mode = RTZ32_ControllerInformation.MODE_NON_CENTRALIZED; |
| | | RTZ32_Controller.class.cast(device).getDeviceInformation().mode = RTZ32_ControllerInformation.MODE_NON_CENTRALIZED; |
| | | try |
| | | { |
| | | |
| | | RTZ32_ControllerStatus status = (RTZ32_ControllerStatus)device.getDeviceStatus(); |
| | | status.rtz32.general.control = RTZ32_Status_General.CONTROL_LOCAL; |
| | | status.rtz32.general.semiactuated = false; |
| | | status.rtz32.centralized = new RTZ32_Status_Centralized(); |
| | | status.rtz32.centralized.centralized = true; |
| | | String dv = new String(Files.readAllBytes(Paths.get("C:\\Users\\Konstantin\\Desktop\\rtz32_controller.txt"))); |
| | | |
| | | device.setAlarm("alarm_offline", true); |
| | | device.setAlarm("alarm_flashing_inputs_key", false); |
| | | RTZ32_Controller controller = Serialization.deserialize(RTZ32_Controller.class, dv); |
| | | |
| | | int i = 0; |
| | | |
| | | // Device controller = Serialization.deserialize(Device.class, "C:\\Users\\Konstantin\\Desktop\\rtz32_controller.txt"); |
| | | |
| | | device.status = controller.status; |
| | | device.alarms = controller.alarms; |
| | | device.information = controller.information; |
| | | device.configuration = controller.configuration; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Logger.getLogger(RtzMockerMap.class.getName()).log(Level.SEVERE, null, ex); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public String getFilePath() |
| | | { |
| | | return "C:\\Users\\Konstantin\\Documents\\LocalBackup\\Obras\\Zaragoza\\rtzserver\\data\\art.servers.rtzserver\\symbols\\9\\Controller.svg"; |
| | | return "D:\\LocalBackup\\Obras\\Zaragoza\\rtzserver\\data\\art.servers.rtzserver\\symbols\\9\\Controller.svg"; |
| | | } |
| | | |
| | | @Override |