-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsym-mbbasicvalue.js
45 lines (40 loc) · 1.06 KB
/
sym-mbbasicvalue.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
(function (PV) {
"use strict";
function symbolVis() { };
PV.deriveVisualizationFromBase(symbolVis);
var vt={
Time: Date.now(),
Value: 100*Math.random()-25
};
var definition = {
typeName: "mbsimplevalue",
visObjectType: symbolVis,
datasourceBehavior: PV.Extensibility.Enums.DatasourceBehaviors.Single,
getDefaultConfig: function(){
return {
Height: 150,
Width: 150
}
}
}
symbolVis.prototype.init = function(scope, elem)
{
this.onDataUpdate=onDataUpdate;
function onDataUpdate(data)
{
// Only on sporadic updates
if(data.Label)
{
scope.Label=data.Label;
scope.Units=data.Units;
scope.DataSource=data.Path.indexOf('|')>-1?"AF Attribute":"Tag";
}
scope.Value=data.Value;
scope.Time=data.Time;
// console.log(data);
}
// scope.Time=vt.Time;
// scope.Value=vt.Value;
};
PV.symbolCatalog.register(definition);
})(window.PIVisualization);