GetLastRefresh - method of the PmaPanel object
Description:
It is used for obtaining the time when this panel requested data (locally or on the Web) for the last time.
Syntax:
Date GetLastRefresh()
Note:
This way it is possible to determine whether the panel is currently open (locally or on the Web) and then, for example, modify the communication period.
Example:
The script in the
PmaTimer.onTick event sets the communication period depending on the open/closed
"MainPanel".
JavaScriptVBScriptSelect and copy to clipboard
var nGetLastRefresh = pMe.Pm("/MainPanel").GetLastRefresh();
var oCommGroup = pMe.Pm("/Comm/Group");
var nSecRefresh = 3;
// x second
var nTimeOut = Pm.Time - (1 / 24 / 60 / 60) * nSecRefresh;
if (nTimeOut > nGetLastRefresh)
{
Pm.Debug("slow communication");
oCommGroup.UpdateRate = 5000;
}
else
{
Pm.Debug("fast communication");
oCommGroup.UpdateRate = 1000;
}
Dim nGetLastRefresh, oCommGroup, nSecRefresh, nTimeOut
nGetLastRefresh = pMe.Pm("/MainPanel").GetLastRefresh()
Set oCommGroup = pMe.Pm("/Comm/Group")
nSecRefresh = 3
' x second
nTimeOut = Pm.Time - (1 / 24 / 60 / 60) * nSecRefresh
If nTimeOut > nGetLastRefresh Then
Pm.Debug("slow communication")
oCommGroup.UpdateRate = 5000
Else
Pm.Debug("fast communication")
oCommGroup.UpdateRate = 1000
End If