| New file |
| | |
| | | package M_Controller; |
| | | |
| | | |
| | | import art.library.model.devices.DeviceCommands; |
| | | import art.library.model.devices.DeviceGraphicsRuntime; |
| | | import art.library.model.devices.DeviceStatus; |
| | | import com.kitfox.svg.SVGDiagram; |
| | | import com.kitfox.svg.SVGElement; |
| | | |
| | | public class M_ControllerBig extends DeviceGraphicsRuntime |
| | | { |
| | | |
| | | public M_ControllerBig(art.library.model.devices.Device device, SVGDiagram diagram) |
| | | { |
| | | super(device, diagram); |
| | | } |
| | | |
| | | public M_ControllerBig(art.library.model.devices.Device device, art.library.model.devices.DeviceCommands commands, SVGDiagram diagram) |
| | | { |
| | | super(device, commands, diagram); |
| | | } |
| | | |
| | | public void status() |
| | | { |
| | | try |
| | | { |
| | | art.library.model.devices.colors.controller.M.M_Controller controller = (art.library.model.devices.colors.controller.M.M_Controller) getDevice(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerStatus controllerStatus = controller.getDeviceStatus(); |
| | | if (controllerStatus.lsubcontroller.size() < 1) |
| | | { |
| | | paintNoStatusAvailable(); |
| | | } |
| | | /* Subcontrollers */ for (int i = 0; i < controllerStatus.lsubcontroller.size(); i++) |
| | | { |
| | | try |
| | | { |
| | | statusSubcontroller(controllerStatus.lsubcontroller.get(i).number); |
| | | } catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | } catch (Exception e) |
| | | { |
| | | } |
| | | } |
| | | |
| | | public void statusSubcontroller(int subcontroller) |
| | | { |
| | | art.library.model.devices.colors.controller.M.M_Controller controller = (art.library.model.devices.colors.controller.M.M_Controller) getDevice(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerStatus controllerStatus = controller.getDeviceStatus(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerInformation controllerInformation = controller.getDeviceInformation(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerAlarms controllerAlarms = controller.getDeviceAlarms(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerRealtime controllerRealtime = controller.getDeviceRealtime(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerConfiguration controllerConfiguration = controller.getDeviceConfiguration(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller subcontrollerStatus = null; |
| | | art.library.model.devices.colors.controller.M.realtime.M_ControllerRealtimeSubcontroller subcontrollerRealtime = null; |
| | | art.library.model.devices.colors.controller.M.M_SubcontrollerConfiguration subcontrollerConfiguration = null; |
| | | if (controller.status != null) |
| | | { |
| | | subcontrollerStatus = controller.getDeviceStatus().getStatusSubcontroller(subcontroller); |
| | | } |
| | | if (controller.realtime != null) |
| | | { |
| | | subcontrollerRealtime = controller.getDeviceRealtime().getRealtimeSubcontroller(subcontroller); |
| | | } |
| | | if (controller.configuration != null) |
| | | { |
| | | subcontrollerConfiguration = controller.getDeviceConfiguration().getSubcontroller(subcontroller); |
| | | } |
| | | SVGElement thunderbolt = getElement("Thunderbolt"); |
| | | SVGElement emergency = getElement("Emergency"); |
| | | SVGElement lock = getElement("Lock"); |
| | | SVGElement calendar = getElement("Calendar"); |
| | | SVGElement run = getElement("Run"); |
| | | SVGElement remote = getElement("Remote"); |
| | | SVGElement background = getElement("Background"); |
| | | SVGElement border = getElement("Border"); |
| | | SVGElement ribbon = getElement("Ribbon"); |
| | | SVGElement elapsed1 = getElement("Elapsed1"); |
| | | SVGElement elapsed2 = getElement("Elapsed2"); |
| | | /* Initialise */ setAttribute(thunderbolt, "fill-opacity", "1.0", 999); |
| | | setAttribute(emergency, "fill-opacity", "1.0", 999); |
| | | setAttribute(lock, "fill-opacity", "1.0", 999); |
| | | setAttribute(calendar, "fill-opacity", "1.0", 999); |
| | | setAttribute(run, "fill-opacity", "1.0", 999); |
| | | setAttribute(remote, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", "#804080", 999); |
| | | setAttribute(emergency, "fill", "#804080", 999); |
| | | setAttribute(lock, "fill", "#804080", 999); |
| | | setAttribute(calendar, "fill", "#804080", 999); |
| | | setAttribute(run, "fill", "#804080", 999); |
| | | setAttribute(remote, "fill", "#804080", 999); |
| | | setText("Text number", String.format("%05d", controllerInformation.number)); |
| | | setText("Text information", ""); |
| | | setText("Text offset", ""); |
| | | setText("Text cycle", ""); |
| | | setText("Text elapsed", ""); |
| | | setAttribute(elapsed1, "display", "none"); |
| | | setAttribute(elapsed2, "display", "none"); |
| | | setAttribute(border, "stroke", "#800080"); |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke-width", 6.5); |
| | | setAttribute(border, "stroke-opacity", 0.75); |
| | | setAttribute(ribbon, "stroke-opacity", 0.50); |
| | | setAttribute(ribbon, "stroke", "#FF80FF"); |
| | | setAttribute(background, "fill", "#FF80FF"); |
| | | switch (controllerStatus.status) |
| | | { |
| | | case DeviceStatus.STATUS_ONLINE: |
| | | break; |
| | | case DeviceStatus.STATUS_WARNING: |
| | | break; |
| | | case DeviceStatus.STATUS_ALARM: |
| | | break; |
| | | case DeviceStatus.STATUS_DISABLE: |
| | | setAttribute(background, "fill", "#404040"); |
| | | setAttribute(ribbon, "stroke", "#404040"); |
| | | setAttribute(border, "stroke", "#808080"); |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke-width", 6.5); |
| | | setAttribute(border, "stroke-opacity", 1.0); |
| | | setAttribute(thunderbolt, "fill-opacity", "0.0", 999); |
| | | setAttribute(emergency, "fill-opacity", "0.0", 999); |
| | | setAttribute(lock, "fill-opacity", "0.0", 999); |
| | | setAttribute(calendar, "fill-opacity", "0.0", 999); |
| | | setAttribute(run, "fill-opacity", "0.0", 999); |
| | | setAttribute(remote, "fill-opacity", "0.0", 999); |
| | | return; |
| | | case DeviceStatus.STATUS_SIMULATION: |
| | | setAttribute(background, "fill", "#0000FF"); |
| | | setAttribute(ribbon, "stroke", "#0000FF"); |
| | | setAttribute(border, "stroke", "#000080"); |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke-width", 6.5); |
| | | setAttribute(border, "stroke-opacity", 1.0); |
| | | break; |
| | | case DeviceStatus.STATUS_INVALID: |
| | | case DeviceStatus.STATUS_OFFLINE: |
| | | case DeviceStatus.STATUS_UNKNOWN: |
| | | setAttribute(background, "fill", "#FF00FF"); |
| | | setAttribute(ribbon, "stroke", "#FF00FF"); |
| | | setAttribute(border, "stroke", "#FF00FF"); |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke-width", 6.5); |
| | | setAttribute(border, "stroke-opacity", 1.0); |
| | | return; |
| | | } |
| | | /* User control */ if ((subcontrollerStatus.userControlPlan == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES)) |
| | | { |
| | | setAttribute(thunderbolt, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", "#0000FF", 999); |
| | | } else |
| | | { |
| | | setAttribute(thunderbolt, "fill-opacity", "0.15", 999); |
| | | setAttribute(thunderbolt, "fill", "#808080", 999); |
| | | } |
| | | /* Manual control */ if (subcontrollerStatus.localControl == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES) |
| | | { |
| | | setAttribute(lock, "fill-opacity", "1.0", 999); |
| | | setAttribute(lock, "fill", "#FF0000", 999); |
| | | } else if (subcontrollerStatus.localControl == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.NO) |
| | | { |
| | | setAttribute(lock, "fill-opacity", "0.15", 999); |
| | | setAttribute(lock, "fill", "#808080", 999); |
| | | } |
| | | /* Emergency */ if (subcontrollerStatus.emergency == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES) |
| | | { |
| | | setAttribute(emergency, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", "#FF0000", 999); |
| | | } else if (subcontrollerStatus.emergency == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.NO) |
| | | { |
| | | setAttribute(emergency, "fill-opacity", "0.15", 999); |
| | | setAttribute(emergency, "fill", "#808080", 999); |
| | | } |
| | | /* Plan selection */ switch (subcontrollerStatus.planSelection) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER: |
| | | { |
| | | setAttribute(calendar, "fill-opacity", "0.15", 999); |
| | | setAttribute(calendar, "fill", "#808080", 999); |
| | | break; |
| | | } |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_TIMETABLE: |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_EXTERNAL_PLANS: |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_ICF: |
| | | { |
| | | setAttribute(calendar, "fill-opacity", "1.0", 999); |
| | | setAttribute(calendar, "fill", "#0000FF", 999); |
| | | break; |
| | | } |
| | | } |
| | | /* Computer */ if ((subcontrollerStatus.planSelection == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER) || (subcontrollerStatus.centralizedMode == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES)) |
| | | { |
| | | setAttribute(remote, "fill-opacity", "1.0", 999); |
| | | setAttribute(remote, "fill", "#0000FF", 999); |
| | | } else if ((subcontrollerStatus.planSelection != art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER) && (subcontrollerStatus.centralizedMode != art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES)) |
| | | { |
| | | setAttribute(remote, "fill-opacity", "0.15", 999); |
| | | setAttribute(remote, "fill", "#808080", 999); |
| | | } |
| | | /* Running */ if ((controllerStatus.groupsRealtime == art.library.model.devices.colors.controller.M.M_ControllerStatus.YES) || (controllerStatus.detectorsRealtime == art.library.model.devices.colors.controller.M.M_ControllerStatus.YES)) |
| | | { |
| | | setAttribute(run, "fill-opacity", "1.0", 999); |
| | | setAttribute(run, "fill", "#0000FF", 999); |
| | | } else if ((controllerStatus.groupsRealtime == art.library.model.devices.colors.controller.M.M_ControllerStatus.NO) && (controllerStatus.detectorsRealtime == art.library.model.devices.colors.controller.M.M_ControllerStatus.NO)) |
| | | { |
| | | setAttribute(run, "fill-opacity", "0.15", 999); |
| | | setAttribute(run, "fill", "#808080", 999); |
| | | } |
| | | /* Alarm */ double strokeopacity = Math.pow(2, controller.getDeviceAlarms().getServerityAlarm()) / 32; |
| | | if (controller.getDeviceAlarms().getServerityAlarm() > 0) |
| | | { |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke", "#FF0000"); |
| | | setAttribute(border, "stroke-opacity", strokeopacity); |
| | | setAttribute(border, "stroke-width", 6.5 + (6.5 * strokeopacity)); |
| | | } else |
| | | { |
| | | setAttribute(border, "stroke", "#808080"); |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke-width", 6.5); |
| | | setAttribute(border, "stroke-opacity", 1.0); |
| | | } |
| | | /* Status */ switch (subcontrollerStatus.colorsMode) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.COLORS_OFF: |
| | | setAttribute(background, "fill", "#808080"); |
| | | setAttribute(ribbon, "stroke", "#808080"); |
| | | setAttribute(elapsed2, "fill", "#808080"); |
| | | setText("Text information", "OFF"); |
| | | return; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.COLORS_FLASHING: |
| | | java.util.Calendar calendardate = java.util.Calendar.getInstance(); |
| | | calendardate.set(java.util.Calendar.MILLISECOND, 0); |
| | | long seconds = calendardate.getTimeInMillis() / 1000; |
| | | if ((seconds % 2) == 0) |
| | | { |
| | | setAttribute(background, "fill", "#FFFF00"); |
| | | setAttribute(ribbon, "stroke", "#FFFF00"); |
| | | setAttribute(elapsed2, "fill", "#FFFF00"); |
| | | } else |
| | | { |
| | | setAttribute(background, "fill", "#808000"); |
| | | setAttribute(ribbon, "stroke", "#808000"); |
| | | setAttribute(elapsed2, "fill", "#808000"); |
| | | } |
| | | setText("Text information", "Y^"); |
| | | return; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.COLORS_COLORS: |
| | | if (subcontrollerStatus.emergency == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES) |
| | | { |
| | | setAttribute(background, "fill", "#FF8000"); |
| | | setAttribute(ribbon, "stroke", "#FF8000"); |
| | | setAttribute(elapsed2, "fill", "#FF8000"); |
| | | } else if ((subcontrollerStatus.userControlManual == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES)) |
| | | { |
| | | setAttribute(background, "fill", "#0000FF"); |
| | | setAttribute(ribbon, "stroke", "#0000FF"); |
| | | setAttribute(elapsed2, "fill", "#0000FF"); |
| | | } else if (subcontrollerStatus.localControl == art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.YES) |
| | | { |
| | | setAttribute(background, "fill", "#0000FF"); |
| | | setAttribute(ribbon, "stroke", "#0000FF"); |
| | | setAttribute(elapsed2, "fill", "#0000FF"); |
| | | } else |
| | | { |
| | | setAttribute(background, "fill", "#00FF00"); |
| | | setAttribute(ribbon, "stroke", "#00FF00"); |
| | | setAttribute(elapsed2, "fill", "#00FF00"); |
| | | } |
| | | break; |
| | | } |
| | | /* State, cycle */ art.library.model.devices.colors.controller.M.configuration.M_Plan plan = null; |
| | | if (subcontrollerStatus.plan > 0) |
| | | { |
| | | try |
| | | { |
| | | plan = subcontrollerConfiguration.getMPlan(subcontrollerRealtime.plan); |
| | | } catch (Exception e) |
| | | { |
| | | } |
| | | } else |
| | | { |
| | | plan = subcontrollerStatus.recordablePlan; |
| | | } |
| | | if (plan != null) |
| | | { |
| | | String information = ""; |
| | | switch (subcontrollerStatus.operationMode) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.OPERATIONMODE_FIXED: |
| | | information = "F"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.OPERATIONMODE_SEMIACTUATED: |
| | | information = "S"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.OPERATIONMODE_ACTUATED: |
| | | information = "A"; |
| | | break; |
| | | } |
| | | information = information + plan.number; |
| | | switch (subcontrollerStatus.planSelection) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_TIMETABLE: |
| | | information = information + "t"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_EXTERNAL_PLANS: |
| | | information = information + "e"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_ICF: |
| | | information = information + "i"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER: |
| | | information = information + "c"; |
| | | break; |
| | | } |
| | | switch (subcontrollerStatus.planSelectionComputer) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER_MACRO: |
| | | information = information + ""; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER_PLAN_SELECTION: |
| | | information = information + "+"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER_PLAN_GENERATION: |
| | | information = information + "+"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerStatusSubcontroller.PLANSELECTION_COMPUTER_ADAPTATIVE: |
| | | information = information + "+"; |
| | | break; |
| | | } |
| | | setText("Text information", information); |
| | | if (plan.offset > 0) |
| | | { |
| | | setText("Text offset", "" + plan.offset); |
| | | } else |
| | | { |
| | | setText("Text offset", ""); |
| | | } |
| | | setText("Text cycle", "" + plan.cycleTime); |
| | | if (subcontrollerRealtime != null) |
| | | { |
| | | try |
| | | { |
| | | String text = subcontrollerRealtime.phase + ":" + subcontrollerRealtime.cycle; |
| | | switch (subcontrollerRealtime.adjust) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.realtime.M_ControllerRealtimeSubcontroller.ADJUST_POSITIVE: |
| | | text = text + "+"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.realtime.M_ControllerRealtimeSubcontroller.ADJUST_NEGATIVE: |
| | | text = text + "-"; |
| | | break; |
| | | } |
| | | setText("Text elapsed", text); |
| | | setAttribute(elapsed1, "display", "inline"); |
| | | setAttribute(elapsed2, "display", "inline"); |
| | | int elapsedWidth = getAttributeInteger(elapsed1, "width") - 2; |
| | | float ratio = (float) subcontrollerRealtime.cycle / (float) plan.cycleTime; |
| | | setAttribute(elapsed2, "width", (elapsedWidth * Math.min(1.0f, ratio))); |
| | | update(elapsed2); |
| | | } catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | if (subcontrollerStatus.userControlPlan > 0) |
| | | { |
| | | setAttribute(border, "stroke", "#0000FF"); |
| | | setAttribute(border, "stroke-width", 10.5); |
| | | } |
| | | } |
| | | |
| | | public void paintNoStatusAvailable() |
| | | { |
| | | art.library.model.devices.colors.controller.M.M_Controller controller = (art.library.model.devices.colors.controller.M.M_Controller) getDevice(); |
| | | SVGElement thunderbolt = getElement("Thunderbolt"); |
| | | SVGElement emergency = getElement("Emergency"); |
| | | SVGElement lock = getElement("Lock"); |
| | | SVGElement calendar = getElement("Calendar"); |
| | | SVGElement run = getElement("Run"); |
| | | SVGElement remote = getElement("Remote"); |
| | | SVGElement background = getElement("Background"); |
| | | SVGElement border = getElement("Border"); |
| | | SVGElement ribbon = getElement("Ribbon"); |
| | | SVGElement elapsed1 = getElement("Elapsed1"); |
| | | SVGElement elapsed2 = getElement("Elapsed2"); |
| | | /* Initialise */ setAttribute(thunderbolt, "fill-opacity", "1.0", 999); |
| | | setAttribute(emergency, "fill-opacity", "1.0", 999); |
| | | setAttribute(lock, "fill-opacity", "1.0", 999); |
| | | setAttribute(calendar, "fill-opacity", "1.0", 999); |
| | | setAttribute(run, "fill-opacity", "1.0", 999); |
| | | setAttribute(remote, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", "#804080", 999); |
| | | setAttribute(emergency, "fill", "#804080", 999); |
| | | setAttribute(lock, "fill", "#804080", 999); |
| | | setAttribute(calendar, "fill", "#804080", 999); |
| | | setAttribute(run, "fill", "#804080", 999); |
| | | setAttribute(remote, "fill", "#804080", 999); |
| | | setText("Text number", String.format("%05d", controller.getDeviceInformation().number)); |
| | | setText("Text information", ""); |
| | | setText("Text offset", ""); |
| | | setText("Text cycle", ""); |
| | | setText("Text elapsed", ""); |
| | | setAttribute(elapsed1, "display", "none"); |
| | | setAttribute(elapsed2, "display", "none"); |
| | | setAttribute(ribbon, "stroke-opacity", 0.50); |
| | | setAttribute(background, "fill", "#FF00FF"); |
| | | setAttribute(ribbon, "stroke", "#FF00FF"); |
| | | setAttribute(border, "stroke", "#FF00FF"); |
| | | setAttribute(border, "display", "inline"); |
| | | setAttribute(border, "stroke-width", 6.5); |
| | | setAttribute(border, "stroke-opacity", 1.0); |
| | | } |
| | | |
| | | public void commands() |
| | | { |
| | | SVGElement thunderbolt = getElement("Thunderbolt"); |
| | | SVGElement emergency = getElement("Emergency"); |
| | | SVGElement lock = getElement("Lock"); |
| | | SVGElement calendar = getElement("Calendar"); |
| | | SVGElement run = getElement("Run"); |
| | | SVGElement remote = getElement("Remote"); |
| | | SVGElement background = getElement("Background"); |
| | | SVGElement border = getElement("Border"); |
| | | SVGElement ribbon = getElement("Ribbon"); |
| | | SVGElement elapsed1 = getElement("Elapsed1"); |
| | | SVGElement elapsed2 = getElement("Elapsed2"); |
| | | try |
| | | { |
| | | setAttribute(thunderbolt, "display", "none"); |
| | | setAttribute(emergency, "display", "none"); |
| | | setAttribute(lock, "display", "none"); |
| | | setAttribute(calendar, "display", "none"); |
| | | setAttribute(run, "display", "none"); |
| | | setAttribute(remote, "display", "none"); |
| | | setAttribute(ribbon, "display", "none"); |
| | | setAttribute(elapsed1, "display", "none"); |
| | | setAttribute(elapsed2, "display", "none"); |
| | | setText("Text number", ""); |
| | | setText("Text information", ""); |
| | | setText("Text offset", ""); |
| | | setText("Text cycle", ""); |
| | | setText("Text elapsed", ""); |
| | | DeviceCommands deviceCommands = getDeviceCommands(); |
| | | art.library.model.devices.colors.controller.M.M_ControllerCommands commands = (art.library.model.devices.colors.controller.M.M_ControllerCommands) deviceCommands; |
| | | art.library.model.devices.colors.controller.M.M_ControllerInformation controllerInformation = (art.library.model.devices.colors.controller.M.M_ControllerInformation) getDevice().getDeviceInformation(); |
| | | String color = "#0000FF"; |
| | | if (!deviceCommands.isEmpty()) |
| | | { |
| | | setText("Text number", String.format("%05d", controllerInformation.number)); |
| | | String textInformation = ""; |
| | | switch (commands.colorsMode) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerCommands.COLORS_OFF: |
| | | color = "#808080"; |
| | | setAttribute(background, "fill", "#808080"); |
| | | setAttribute(border, "stroke", "#606060"); |
| | | setAttribute(ribbon, "stroke", "#808080"); |
| | | setAttribute("Text information", "fill", "#606060"); |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerCommands.COLORS_FLASHING: |
| | | color = "#7C7C00"; |
| | | setAttribute(background, "fill", "#FFFF00"); |
| | | setAttribute(border, "stroke", "#7C7C00"); |
| | | setAttribute(ribbon, "stroke", "#FFFF00"); |
| | | setAttribute("Text information", "fill", "#7C7C00"); |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerCommands.COLORS_COLORS: |
| | | color = "#007C00"; |
| | | setAttribute(background, "fill", "#00FF00"); |
| | | setAttribute(border, "stroke", "#007C00"); |
| | | setAttribute(ribbon, "stroke", "#00FF00"); |
| | | setAttribute("Text information", "fill", "#007C00"); |
| | | break; |
| | | default: |
| | | color = "#007C00"; |
| | | setAttribute(background, "fill", "#00FF00"); |
| | | setAttribute(border, "stroke", "#007C00"); |
| | | setAttribute(ribbon, "stroke", "#00FF00"); |
| | | setAttribute("Text information", "fill", "#007C00"); |
| | | break; |
| | | } |
| | | switch (commands.operationMode) |
| | | { |
| | | case art.library.model.devices.colors.controller.M.M_ControllerCommands.OPERATIONMODE_FIXED: |
| | | textInformation = textInformation + "F"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerCommands.OPERATIONMODE_ACTUATED: |
| | | textInformation = textInformation + "A"; |
| | | break; |
| | | case art.library.model.devices.colors.controller.M.M_ControllerCommands.OPERATIONMODE_SEMIACTUATED: |
| | | textInformation = textInformation + "S"; |
| | | break; |
| | | } |
| | | if (commands.userControlPlan == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_YES) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(thunderbolt, "display", "inline"); |
| | | setAttribute(thunderbolt, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", color, 999); |
| | | } else if (commands.userControlPlan == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_NO) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(thunderbolt, "display", "inline"); |
| | | setAttribute(thunderbolt, "fill-opacity", "1.0", 999); |
| | | setAttribute(thunderbolt, "fill", "#808080", 999); |
| | | } |
| | | if (commands.localPlan > 0) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(calendar, "display", "inline"); |
| | | setAttribute(calendar, "fill-opacity", "1.0", 999); |
| | | setAttribute(calendar, "fill", color, 999); |
| | | } |
| | | if (commands.emergency == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_YES) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(emergency, "display", "inline"); |
| | | setAttribute(emergency, "fill-opacity", "1.0", 999); |
| | | setAttribute(emergency, "fill", color, 999); |
| | | } else if (commands.emergency == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_NO) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(emergency, "display", "inline"); |
| | | setAttribute(emergency, "fill-opacity", "1.0", 999); |
| | | setAttribute(emergency, "fill", "#808080", 999); |
| | | } |
| | | if (commands.realtime == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_ENABLED) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(run, "display", "inline"); |
| | | setAttribute(run, "fill-opacity", "1.0", 999); |
| | | setAttribute(run, "fill", color, 999); |
| | | } else if (commands.realtime == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_DISABLED) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(run, "display", "inline"); |
| | | setAttribute(run, "fill-opacity", "1.0", 999); |
| | | setAttribute(run, "fill", "#808080", 999); |
| | | } |
| | | if (commands.userControlManual == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_YES) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(lock, "display", "inline"); |
| | | setAttribute(lock, "fill-opacity", "1.0", 999); |
| | | setAttribute(lock, "fill", color, 999); |
| | | } else if (commands.userControlManual == art.library.model.devices.colors.controller.M.M_ControllerCommands.CONDITION_NO) |
| | | { |
| | | setAttribute(ribbon, "display", "inline"); |
| | | setAttribute(lock, "display", "inline"); |
| | | setAttribute(lock, "fill-opacity", "1.0", 999); |
| | | setAttribute(lock, "fill", "#808080", 999); |
| | | } |
| | | if (commands.localPlan > 0) |
| | | { |
| | | textInformation = textInformation + "P" + commands.localPlan; |
| | | } |
| | | if (commands.recordablePlan != null) |
| | | { |
| | | textInformation = textInformation + "P0St" + commands.recordablePlan.structure; |
| | | setText("Text offset", "" + commands.recordablePlan.offset); |
| | | setText("Text cycle", "" + commands.recordablePlan.getCycleTime()); |
| | | } |
| | | setText("Text information", textInformation); |
| | | } else |
| | | { |
| | | setText("Text information", String.format("%05d", controllerInformation.number)); |
| | | setAttribute("Text information", "fill", "#00007C"); |
| | | setAttribute(background, "fill", "#0000FF"); |
| | | setAttribute(border, "stroke", "#00007C"); |
| | | } |
| | | } catch (Exception e) |
| | | { |
| | | setText("Text information", String.format("%05d", device.getDeviceInformation().number)); |
| | | setAttribute("Text information", "fill", "#00007C"); |
| | | setAttribute(background, "fill", "#0000FF"); |
| | | setAttribute(border, "stroke", "#00007C"); |
| | | } |
| | | } |
| | | } |
| | | |