forked from GRIFFINCollaboration/SpectrumViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rateMonitor.html
111 lines (91 loc) · 5.11 KB
/
rateMonitor.html
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html>
<head>
<title>GRIFFIN Rate Monitor</title>
<script src='scripts/HTMLImports.min.js' type="text/javascript"></script>
<script src='scripts/mustache.js' type="text/javascript"></script>
<script src='scripts/easeljs-0.7.0.min.js' type="text/javascript"></script>
<script src='scripts/dygraphs.1.1.1.min.js' type="text/javascript"></script>
<script src='scripts/gammaSpectrum.js' type="text/javascript"></script>
<script src='scripts/fitit.js' type="text/javascript"></script>
<script src="scripts/jquery1-11-3.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="scripts/bootstrap3-3-5.min.js"></script>
<script src='scripts/helpers.js' type="text/javascript"></script>
<script src='scripts/rateMonitor.js' type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/custom.css"/>
<!--HTML imports-->
<link id='header' rel="import" href="templates/header/header.html">
<link id='plotGrid' rel="import" href="templates/plotGrid/plotGrid.html">
<link id='plotControl' rel="import" href="templates/plotControl/plotControl.html">
<link id='striptool' rel="import" href="templates/striptool/striptool.html">
<link id='striptoolSliders' rel="import" href="templates/striptool/striptoolSliders.html">
<link id='rateControl' rel="import" href="templates/rateControl/rateControl.html">
<link id='gammaWindows' rel="import" href="templates/rateControl/gammaWindows.html">
<link id='levelsAndScalars' rel="import" href="templates/rateControl/levelsAndScalars.html">
<link id='footer' rel="import" href="templates/footer/footer.html">
</head>
<body>
<div id='head'></div>
<!--Plots-->
<div id='plotRegion' class='sectionWrapper item'>
<div id='plotWrap' class='col-md-6 plotRegion'>
<div id='plottingGrid'></div>
<div id='plotCtrl'></div>
</div>
<div id='rateWrap' class='col-md-6 plotRegion'>
<div id='rates'></div>
<div id='rateSlides'></div>
</div>
</div>
<hr style='width:60%; border-top: 1px solid #999'></hr>
<!--Window Controls-->
<div class='sectionWrapper item expand' id='rateMonitorControl'>
<div id='rateCtrl'></div>
</div>
<div id='foot'></div>
<script>
window.addEventListener('HTMLImportsLoaded', function(e) {
var i, vw;
dataStore._plotGrid = new plotGrid('plottingGrid');
dataStore._plotControl = new plotControl('plotCtrl', 'horizontal');
dataStore._striptool = new striptool('rates');
dataStore._striptoolSliders = new striptoolSliders('rateSlides');
dataStore._rateControl = new rateControl('rateCtrl');
vw = dataStore.plots[0];
dataStore.templates = prepareTemplates(['header', 'plotGrid', 'plotControl', 'striptool', 'striptoolSliders', 'rateControl', 'gammaWindows', 'levelsAndScalars', 'footer']);
setupHeader('head', 'Rate Monitor');
dataStore._plotGrid.setup();
dataStore._plotControl.setup();
dataStore._striptoolSliders.setup();
dataStore._rateControl.setup();
setupFooter('foot');
//declare our one and only plot
dataStore._plotGrid.manageCellCreation(null, dataStore.plots[0]);
//don't want additional plots in this app
deleteNode('plottingGridnewPlotButton');
//prepare initial gamma windows
for(i=0; i<dataStore.defaults.gammas.length; i++){
dataStore._rateControl.drawWindow(i, dataStore.defaults.gammas[i].min, dataStore.defaults.gammas[i].max);
}
//plot the spectrum of interest
dataStore.viewers[vw].addData(dataStore.targetSpectrum, []);
dataStore._plotControl.activeSpectra = [dataStore.targetSpectrum];
dataStore._plotControl.refreshAll();
//set up dygraph
dataStore.plotStyle['height'] = document.getElementById(dataStore.plots[0]).offsetHeight - dataStore.viewers[vw].bottomMargin + 20,
dataStore.plotStyle['weight'] = document.getElementById(dataStore.plots[0]).offsetWidth
dataStore._striptool.setup();
//manage which gamma window are on by defualt
for(i=0; i<dataStore.defaults.gammas.length; i++){
if(!dataStore.defaults.gammas[i].onByDefault)
document.getElementById('display' + dataStore.defaults.gammas[i].index).click()
}
//don't allow refresh period to change
deleteNode('updateWrap');
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
});
</script>
</body>
</html>