Here is an alternate example where the widget itself fires-up a jsonport and publishes a virtual device with an alarm state. It doesn't provide a full UI for the remote device but it does share its parameters.
<abs contexttype="opengear" id="_top" keepalive="false" style="">
<meta>
<params/>
<widgets>
<widgetdescriptor id="my-alarming-widget">
<config>
<params>
<param access="1" maxlength="0" name="JSON Port" oid="JSON_PORT" type="INT16" value="0" widget="spinner"/>
<param access="1" name="Device Name Display" oid="Display_Name" precision="0" type="STRING" value="This Widget" widget="text"/>
</params>
</config>
<oglml>
<abs contexttype="opengear" jsonport="%value['JSON_PORT'][0]%">
<meta>
<params>
<param access="1" name="Device Name" oid="0x105" precision="0" type="STRING" value="Alarm Device" widget="default"/>
<param access="1" name="Device Name Display" oid="0xFF01" precision="0" type="STRING" value="This Widget" widget="text"/>
<param access="1" constrainttype="ALARM_TABLE" name="My Alarm" oid="alarm1" precision="0" stateless="true" type="INT16" value="0" widget="default">
<constraint key="0" severity="0">OK</constraint>
<constraint key="1" severity="1">Warning!</constraint>
<constraint key="2" severity="2">ERROR!</constraint>
</param>
<param access="1" constrainttype="INT_CHOICE" name="Alarm Value" oid="Alarm_Value" precision="0" type="INT16" value="0" widget="combo">
<constraint key="0">OFF</constraint>
<constraint key="1">OK</constraint>
<constraint key="2">WARN</constraint>
<constraint key="4">ERROR</constraint>
</param>
</params>
<ogscript handles="onload">params.setValue('0xFF01', 0, params.getValue('Display_Name', 0));</ogscript>
</meta>
<param expand="true" height="30" left="0" oid="0xFF01" right="0" runtasksonload="true" showlabel="false" top="0">
<task>var alarmParam = params.getParam('alarm1', 0);
if (alarmParam != null) {
alarmParam.setValue(this.getValue());
}</task>
</param>
<param bottom="0" expand="true" left="0" oid="Alarm_Value" right="0" runtasksonload="true" showlabel="false" top="30">
<task>var alarmParam = params.getParam('alarm1', 0);
if (alarmParam != null) {
alarmParam.setValue(this.getValue());
}</task>
</param>
</abs>
</oglml>
</widgetdescriptor>
</widgets>
</meta>
<simplegrid height="184" hspace="5" left="44" rows="1" top="38" width="460">
<widget widgetid="my-alarming-widget">
<config>
<params>
<param oid="JSON_PORT" value="5300"/>
<param oid="Alarm_Value" value="4"/>
<param oid="Display_Name" value="TEST"/>
</params>
</config>
</widget>
</simplegrid>
<simplegrid height="184" hspace="5" left="522" rows="1" top="39" width="460">
<widget widgetid="my-alarming-widget">
<config>
<params>
<param oid="JSON_PORT" value="5302"/>
<param oid="Alarm_Value" value="4"/>
<param oid="Display_Name" value="TEST 2"/>
</params>
</config>
</widget>
</simplegrid>
</abs>
------------------------------
James Peltzer
Ross Video
------------------------------
Original Message:
Sent: 08-18-2025 05:34
From: Richard Hills
Subject: Widget development - Internal / Extrenal api and params
Hi,
I have written a couple of widgets that are working well but I wanted to add a status param that would be used to update the tree view status indicators.
I have successfully done this with a simple grid file using the jsonport param, but I am getting stuck with the widget.
The issue relates to where the param is defined.
- If it is in the <!--INTERNAL PARAMETERS --> section, my internal api can change its state, but it is not visible in the tree view or main grid file.
- If it is in the <!-- ACTUAL CONTENT --> section, my internal api can't change its state, but it is visible in the tree view or main grid file.
The names of the sections say it all! But is there a way of getting my internal api to change the state of a param in the main code.
------------------------------
Richard Hills
------------------------------