|
import art.library.model.devices.Device;
|
import art.library.model.devices.DeviceStatus;
|
import com.kitfox.svg.SVGDiagram;
|
|
public class DeviceGraphicsRuntime_Inforpark_VmsBannerMapLittle extends DeviceGraphicsRuntime
|
{
|
|
public DeviceGraphicsRuntime_Inforpark_VmsBannerMapLittle(art.library.model.devices.Device device, SVGDiagram diagram)
|
{
|
super(device, diagram);
|
}
|
|
|
|
|
public void status()
|
{
|
try
|
{
|
Device device = getDevice();
|
art.library.model.devices.vms.banner.BannerStatus status = (art.library.model.devices.vms.banner.BannerStatus)device.getDeviceStatus();
|
|
setAttribute("Background", "fill", "#FF00FF");
|
|
String color1 = "#000000";
|
String color2 = "#000000";
|
|
switch (status.status)
|
{
|
case DeviceStatus.STATUS_ONLINE:
|
color1 = "#00FF00";
|
color2 = "#007C00";
|
break;
|
case DeviceStatus.STATUS_WARNING:
|
color1 = "#FFFF00";
|
color2 = "#7C7C00";
|
break;
|
case DeviceStatus.STATUS_ALARM:
|
color1 = "#FF0000";
|
color2 = "#7C0000";
|
break;
|
case DeviceStatus.STATUS_INVALID:
|
color1 = "#B97A57";
|
color2 = "#5A3B2A";
|
break;
|
case DeviceStatus.STATUS_DISABLE:
|
color1 = "#7C7C7C";
|
color2 = "#3E3E3E";
|
break;
|
case DeviceStatus.STATUS_SIMULATION:
|
color1 = "#0000FF";
|
color2 = "#00007C";
|
break;
|
case DeviceStatus.STATUS_OFFLINE:
|
color1 = "#FF00FF";
|
color2 = "#7C007C";
|
break;
|
case DeviceStatus.STATUS_UNKNOWN:
|
color1 = "#FF00FF";
|
color2 = "#7C007C";
|
break;
|
}
|
|
setAttribute("Icon", "display", "inline");
|
setAttribute("Icon", "fill", color2, 2);
|
setAttribute("Background", "fill", color1);
|
setAttribute("Border", "stroke", color2);
|
setAttribute("Aura", "display", "none");
|
|
try
|
{
|
if (status.rotulosElectronicos.text.length() > 0)
|
{
|
setAttribute("Aura", "display", "inline");
|
setAttribute("Aura", "fill", color1);
|
}
|
}
|
catch (Exception e)
|
{
|
}
|
|
}
|
catch (Exception e)
|
{
|
}
|
}
|
}
|
|
|
|
//java.io.StringWriter sw = new java.io.StringWriter();
|
//art.library.gui.flat.FlatDialog.showDialog(null, "Error", e.getMessage() + "\n\n" + sw.toString(), true, art.library.gui.flat.FlatDialog.DIALOG_ERROR);
|
|
|