Removed created + some unused functions and comments (Graphics JS file)
This commit is contained in:
@ -290,7 +290,6 @@ let graphs = (function (){
|
|||||||
|
|
||||||
let resolution = undefined;
|
let resolution = undefined;
|
||||||
|
|
||||||
let created = false;
|
|
||||||
let activateUpdateTimeout = undefined;
|
let activateUpdateTimeout = undefined;
|
||||||
let updateAutoTimeout = undefined;
|
let updateAutoTimeout = undefined;
|
||||||
|
|
||||||
@ -380,8 +379,6 @@ let graphs = (function (){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let gotoNowElm = document.createElement('div');
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets live mode and enable/disable 'go to now' button
|
* Sets live mode and enable/disable 'go to now' button
|
||||||
* @param {boolean} mode - Tells if we are in live mode or not
|
* @param {boolean} mode - Tells if we are in live mode or not
|
||||||
@ -461,22 +458,6 @@ let graphs = (function (){
|
|||||||
activateUpdateTimeout = setTimeout(function(){
|
activateUpdateTimeout = setTimeout(function(){
|
||||||
activateUpdates();
|
activateUpdates();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
// Was here before
|
|
||||||
// result = AJAX( "http://" + hostPort +
|
|
||||||
// "/updategraph?variables=" + variables() +
|
|
||||||
// "&id=" + clientID).getJSON().then(function(data) {
|
|
||||||
// setLiveMode(data.live);
|
|
||||||
// console.log('LIVE create', liveMode)
|
|
||||||
// })
|
|
||||||
|
|
||||||
// result = AJAX( "http://" + hostPort +
|
|
||||||
// "/updategraph?" +
|
|
||||||
// "id=" + clientID).getJSON().then(function(data) {
|
|
||||||
// setLiveMode(data.live);
|
|
||||||
// console.log('LIVE create', liveMode)
|
|
||||||
// })
|
|
||||||
// //console.log('UPDATE LIVE', result);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -598,8 +579,7 @@ let graphs = (function (){
|
|||||||
legendFlag = true;
|
legendFlag = true;
|
||||||
let trect = evt.target.getBoundingClientRect();
|
let trect = evt.target.getBoundingClientRect();
|
||||||
let X = evt.clientX - trect.x, Y = evt.clientY - trect.y;
|
let X = evt.clientX - trect.x, Y = evt.clientY - trect.y;
|
||||||
displayAllLegends();
|
showLegends(true, false);
|
||||||
// showLegends(true, false);
|
|
||||||
cursorLine(X);
|
cursorLine(X);
|
||||||
setLiveMode();
|
setLiveMode();
|
||||||
update();
|
update();
|
||||||
@ -673,17 +653,8 @@ let graphs = (function (){
|
|||||||
}
|
}
|
||||||
console.log("RELOAD")
|
console.log("RELOAD")
|
||||||
activateUpdates();
|
activateUpdates();
|
||||||
// Was here before
|
|
||||||
// AJAX( "http://" + hostPort + "/updategraph?id=" + clientID).getJSON(); // activate updates
|
|
||||||
// result = AJAX("http://" + hostPort +
|
|
||||||
// "/updategraph?variables=" + variables() +
|
|
||||||
// "&id=" + clientID).getJSON().then(function(data) {
|
|
||||||
// setLiveMode(data.live);
|
|
||||||
// console.log('LIVE reload', liveMode)
|
|
||||||
// })
|
|
||||||
|
|
||||||
updateAuto(false);
|
updateAuto(false);
|
||||||
//update();
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,36 +697,6 @@ let graphs = (function (){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function zoomIn(){
|
|
||||||
console.log("Zoomed in !");
|
|
||||||
|
|
||||||
let someGraph = graph_array[0];
|
|
||||||
let xTk = someGraph.chart.options.scales.xAxes[0].ticks;
|
|
||||||
let pZoom = 0.2; //window width for the zoom (a proportion of the current window, centered)
|
|
||||||
let delta = (xTk.max - xTk.min)*pZoom/2;
|
|
||||||
xTk.max -= delta;
|
|
||||||
xTk.min += delta;
|
|
||||||
|
|
||||||
if (liveMode && xTk.max < lastTime) setLiveMode(false);
|
|
||||||
setMinMax(xTk.min, xTk.max);
|
|
||||||
updateAuto();
|
|
||||||
}
|
|
||||||
|
|
||||||
function zoomOut(){
|
|
||||||
console.log("Zoomed out !");
|
|
||||||
|
|
||||||
let someGraph = graph_array[0];
|
|
||||||
let xTk = someGraph.chart.options.scales.xAxes[0].ticks;
|
|
||||||
let pZoom = 0.2; //window width for the zoom (a proportion of the current window, centered)
|
|
||||||
let delta = (xTk.max - xTk.min)*pZoom/2;
|
|
||||||
xTk.max += delta;
|
|
||||||
xTk.min -= delta;
|
|
||||||
|
|
||||||
if (liveMode && xTk.max < lastTime) setLiveMode(false);
|
|
||||||
setMinMax(xTk.min, xTk.max);
|
|
||||||
updateAuto();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function called at each mouse wheel step.
|
* Function called at each mouse wheel step.
|
||||||
* If zoom mode in x mode, disables liveMode if the visualisaiton window is older than the last known value and sets axis min and max
|
* If zoom mode in x mode, disables liveMode if the visualisaiton window is older than the last known value and sets axis min and max
|
||||||
@ -860,32 +801,6 @@ let graphs = (function (){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function shiftOlder(){
|
|
||||||
|
|
||||||
let someGraph = graph_array[0];
|
|
||||||
let xTk = someGraph.chart.options.scales.xAxes[0].ticks;
|
|
||||||
let pShift = 0.2; //shift size the pan (a proportion of the current window)
|
|
||||||
let delta = (xTk.max - xTk.min)*pShift;
|
|
||||||
xTk.max -= delta;
|
|
||||||
xTk.min -= delta;
|
|
||||||
if (liveMode && xTk.max < lastTime) setLiveMode(false);
|
|
||||||
setMinMax(xTk.min,xTk.max);
|
|
||||||
updateAuto();
|
|
||||||
}
|
|
||||||
|
|
||||||
function shiftNewer(){
|
|
||||||
|
|
||||||
let someGraph = graph_array[0];
|
|
||||||
let xTk = someGraph.chart.options.scales.xAxes[0].ticks;
|
|
||||||
let pShift = 0.2; //shift size the pan (a proportion of the current window)
|
|
||||||
let delta = (xTk.max - xTk.min)*pShift;
|
|
||||||
xTk.max += delta;
|
|
||||||
xTk.min += delta;
|
|
||||||
if (liveMode && xTk.max < lastTime) setLiveMode(false);
|
|
||||||
setMinMax(xTk.min,xTk.max);
|
|
||||||
updateAuto();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function called when the viewing window is moved by the mouse.
|
* The function called when the viewing window is moved by the mouse.
|
||||||
*
|
*
|
||||||
@ -1004,7 +919,6 @@ let graphs = (function (){
|
|||||||
gotoMainElm.style.marginRight = "6px";
|
gotoMainElm.style.marginRight = "6px";
|
||||||
gotoMainElm.style.color = "white";
|
gotoMainElm.style.color = "white";
|
||||||
gotoMainElm.style.cursor = "pointer";
|
gotoMainElm.style.cursor = "pointer";
|
||||||
created = true;
|
|
||||||
|
|
||||||
if (isTouchDevice) {
|
if (isTouchDevice) {
|
||||||
doubleTap(removeCursor);
|
doubleTap(removeCursor);
|
||||||
@ -1016,10 +930,7 @@ let graphs = (function (){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function initGraphs(blocks){
|
function initGraphs(blocks){
|
||||||
if(!created){
|
|
||||||
buildGraphicsUI();
|
buildGraphicsUI();
|
||||||
created = true;
|
|
||||||
}
|
|
||||||
receivedVars(blocks);
|
receivedVars(blocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1112,14 +1023,6 @@ let graphs = (function (){
|
|||||||
//bringToFront(null);
|
//bringToFront(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayAllLegends(){
|
|
||||||
showLegends(true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function hideAllLegends(){
|
|
||||||
showLegends(false, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adjust the legend window depending on the position of the last legend
|
* Adjust the legend window depending on the position of the last legend
|
||||||
*/
|
*/
|
||||||
@ -1274,7 +1177,6 @@ let graphs = (function (){
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
addDataset: addDataset,
|
addDataset: addDataset,
|
||||||
//toggleAxesType: toggleAxesType,
|
|
||||||
newDataHandler: newDataHandler,
|
newDataHandler: newDataHandler,
|
||||||
zoomCallback: zoomCallback,
|
zoomCallback: zoomCallback,
|
||||||
panCallback: panCallback,
|
panCallback: panCallback,
|
||||||
@ -1293,16 +1195,9 @@ let graphs = (function (){
|
|||||||
setLiveMode: setLiveMode,
|
setLiveMode: setLiveMode,
|
||||||
cursorLine: cursorLine,
|
cursorLine: cursorLine,
|
||||||
bringToFront: bringToFront,
|
bringToFront: bringToFront,
|
||||||
// Exposing callbacks for controls and indicators
|
|
||||||
gotoNow: gotoNow,
|
gotoNow: gotoNow,
|
||||||
displayAllLegends: displayAllLegends,
|
|
||||||
hideAllLegends: hideAllLegends,
|
|
||||||
toggleZoomMode: toggleZoomMode,
|
toggleZoomMode: toggleZoomMode,
|
||||||
removeCursor: removeCursor,
|
|
||||||
zoomOut: zoomOut,
|
|
||||||
zoomIn: zoomIn,
|
|
||||||
shiftOlder: shiftOlder,
|
|
||||||
shiftNewer: shiftNewer,
|
|
||||||
jumpToDate: jumpToDate,
|
jumpToDate: jumpToDate,
|
||||||
initGraphs: initGraphs,
|
initGraphs: initGraphs,
|
||||||
onZoomCompleteCallback:onZoomCompleteCallback,
|
onZoomCompleteCallback:onZoomCompleteCallback,
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
# device.parameter=cat[,color[,unit]]
|
# device.parameter=cat[,color[,unit]]
|
||||||
# device.parameter=cat:raw,color:yellow
|
# device.parameter=cat:raw,color:yellow
|
||||||
[nicos]
|
[chart]
|
||||||
se_t_plato.raw=raw,#FFF,Ohm
|
t_plato.raw=raw,#FFF,Ohm
|
||||||
|
|
||||||
|
|
||||||
se_t_plato.target=none # do not show
|
T_plato.target=none # do not show
|
||||||
se_t_plato.raw=std # show in standard section
|
T_plato.raw=rawOhm # show in extra section "rawOhm"
|
||||||
se_t_plato.raw=raw # show in extra section "raw"
|
T_plato=,,Ohm # custom unit
|
||||||
se_t_plato.value=std,unit:Ohm # custom unit
|
T_plato=unit:Ohm # custom unit
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
tag -> cat
|
||||||
|
|
||||||
|
lookup with the label (secop module)
|
Reference in New Issue
Block a user