type
attribute determines how the object base is represented. Each LED
type is associated with a specific base renderer that is in
charge of drawing the object according to its type and state
information.
IltLedBaseRenderer
is the same as to create a new IltNEBaseRenderer.
IltLed.Type MyType = new IltLed.Type("MyType"); IltSettings.SetValue("Led.Type.MyType.Renderer", new IltBaseRendererFactory() { public IltBaseRenderer createValue() { return new MyLedTypeBaseRenderer(); } });
setting."ilog.tgo.model.IltLed"{ types[0]: @+ledType0; } Subobject#ledType0 { class: 'ilog.tgo.model.IltLed.Type'; name: "MyType"; }
IltLed.Type myNewType = new IltLed.Type("MyType");
IltLedImageBaseRendererFactory factory = new IltLedImageBaseRendererFactory(image);
IltSettings.SetValue("Led.Type.MyType.Renderer", factory);
// Create the new LED type IltLed.Type batteryType = new IltLed.Type("Battery"); // Retrieve the image and create the base renderer factory Image img = IltSystem.GetDefaultContext().getImageRepository().getImage("battery.png"); IltLedImageBaseRendererFactory factor = new IltLedImageBaseRendererFactory(img); // Associate the new LED type with the image base renderer factory IltSettings.SetValue("Led.Type.Battery.Renderer", factory);
IltLed led = new IltLed("new", batteryType);
TwoImagesBaseRenderer
, allows you to create very detailed LEDs, where a specific image
area “glows”, while the other areas
remain unchanged.
IltLed.Type myNewType = new IltLed.Type("MyType");
IltLedImageBaseRendererFactory factory = new IltLedImageBaseRendererFactory(image_off, image_on);
IltSettings.SetValue("Led.Type.MyType.Renderer", factory);
/** * Creates the new led type using the * "trash_on.png" and "trash_off.png" * png images. */ String fileOn = "trash_on.png"; String fileOff = "trash_off.png"; // create the new type that will be associated with the // given images IltLed.Type theType = new IltLed.Type("TrashCan"); try { IlpImageRepository repository = IltSystem.GetDefaultContext().getImageRepository(); Image imgOn = repository.getImage(fileOn); Image imgOff = repository.getImage(fileOff); // then map the factory created using the images with the new type IltLedImageBaseRendererFactory factory = new IltLedImageBaseRendererFactory(imgOff, imgOn); IltSettings.SetValue("Led.Type.TrashCan.Renderer", factory); // Note: the numerical values above have been adjusted // using the imagecolortuner application provided with // JTGO } catch (Exception ex) { logger.log("Error while creating TrashCan LED type."); }
IltLed newLedType = new IltLed("new", theType);
renderer
. In the following example, the name of the renderer factory
class that is included in the search path is
MyLedRendererFactory
.
setting."ilog.tgo.model.IltLed.Type"[name="MyType"] { renderer: @+ledRendererFactory; } Subobject#ledRendererFactory { class: 'MyLedRendererFactory'; }
labelVisible
. All other label properties are also applicable to
IltLED
instances.
object."ilog.tgo.model.IltLed" { labelVisible: true; }
Property
Name |
Type |
Default
Value |
Description
|
---|---|---|---|
alarmBorderVisible
|
boolean
|
false
|
Denotes
whether the alarm border is displayed or not around the
object base. |
alarmColorVisible
|
boolean
|
true
|
Denotes whether the alarm color is displayed or not in the
object base. If this value is set to
false
, the foreground color of the object base does not change
when new alarms are set in the object.
|
object."ilog.tgo.model.IltLed" { alarmBorderVisible: false; }
object."ilog.tgo.model.IltLed" { foreground: lightGrey; } object."ilog.tgo.model.IltLed"["objectState.SNMP.State"=Up] { foreground: green; } object."ilog.tgo.model.IltLed"["objectState.SNMP.State"=Failed] { foreground: yellow; }