no message
This commit is contained in:
+7
-6
@@ -14,6 +14,7 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="pv_visu">
|
<div id="pv_visu">
|
||||||
<div class="label" id="prodLabel"></div>
|
<div class="label" id="prodLabel"></div>
|
||||||
<div class="bar-container">
|
<div class="bar-container">
|
||||||
@@ -37,14 +38,14 @@
|
|||||||
}
|
}
|
||||||
function handleMessage(msg) {
|
function handleMessage(msg) {
|
||||||
try {
|
try {
|
||||||
var d = (typeof msg === 'string') ? JSON.parse(msg) : msg;
|
var data = (typeof msg === 'string') ? JSON.parse(msg) : msg;
|
||||||
Apply(d);
|
Apply(data);
|
||||||
} catch (e) {
|
} catch(e) {
|
||||||
console.error('PV_Visu handleMessage error', e, msg);
|
console.error('PV_Visu handleMessage error:', e, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Register HTML-SDK handler
|
// Bind to HTML-SDK
|
||||||
if (typeof registerMessageHandler === 'function') {
|
if (typeof registerMessageHandler === 'function') {
|
||||||
registerMessageHandler(handleMessage);
|
registerMessageHandler(handleMessage);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+1
-1
@@ -130,4 +130,4 @@ class PV_Visu extends IPSModule
|
|||||||
$values = AC_GetAggregatedValues($archives[0], $varID, 1, $start, $end, 1);
|
$values = AC_GetAggregatedValues($archives[0], $varID, 1, $start, $end, 1);
|
||||||
return empty($values) ? 0.0 : (float) $values[0]['Avg'];
|
return empty($values) ? 0.0 : (float) $values[0]['Avg'];
|
||||||
}
|
}
|
||||||
}a
|
}
|
||||||
Reference in New Issue
Block a user