Download User manual
Transcript
Software Development Kit
Highlighted in yellow is the statement that activated the refresh every 2 seconds (that is, the minimum time to ensure the server is not
overloaded with refresh requests).
The first step is to add the status LED with refresh to the page:
<table border="0" width="100%" height="100%" cellpadding="1" cellspacing="1">
<tr>
<td valign="middle" width="5%" align="center">
<%=Sfera.assint(CurrUnit.getStatus(),
"<img src='images/led/L0.gif'>;<img src='images/led/L1.gif'>;<img
src='images/led/L2.gif'>;<img src='images/led/L3.gif'>")
%>
</td>
<td valign="middle" width="5%" align="center" style="border:1px solid black;">
<%=CurrUnit.getRefreshableStatusAssint("<img src='images/led/L0.gif'>;<img
src='images/led/L1.gif'>;<img src='images/led/L2.gif'>;<img src='images/led/L3.gif'>")
%>
<br/>
<span style="font-size: xx-small;">Refreshable</span>
</td>
<td valign="middle" width="*" align="left">
<font size="4"><b><%=CurrUnit.getDescription()%></b></font>
</td>
<td valign="middle" width="5%" align="right">
<b><%=CurrUnit.getLine()%></b>
</td>
</tr>
</table>
As described previously with this call, the device status LED is added, mapping the different colours of the object with the values returned
for the status. The result, which is refreshed by the framework, is as follows:
Now the “refreshable” status has been added to the standard non-refreshable status and provides an instant picture (save for the refresh
time) of the status of the device. Obviously, the 2 states are completely independent, and therefore on a real custom page only one of the
2 will be used, according to requirements.
In addition, on the top right is the refresh button, used to manually refresh the page. The display of the button is activated by the special
PVPK_addButtons() function.
Similarly, the variables can be added with refresh, and are always updated automatically by the framework. An example of adding
variables with refresh is shown below:
<table border="0" width="100%" cellpadding="1" cellspacing="1" style="border: 1px solid black;">
<tr>
<td colspan="3" style="background-color:#7788EE;">
<font color="white"><b>Main parameters (refreshable)</b></font>
</td>
</tr>
<tr>
<td width="10%" align="center" style="background-color:#eff1fe;font-size: x-small;">
<NOBR><%=CurrUnit.getVariable("H3").getRefreshableValue()%>
<%=CurrUnit.getVariable("S3").getMUnit()%></NOBR>
</td>
<td width="10%" align="center" style="background-color:#eff1fe;font-size: xsmall;"><%=CurrUnit.getVariable("H3").getDescr1()%></td>
<td width="*" style="background-color:#eff1fe;font-size: xsmall;"><%=CurrUnit.getVariable("H3").getDescription()%></td>
</tr>
</table>
Cod. +030220766 rel. 1.2 del 31/01/08
21