-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathgainMatcher.html
More file actions
273 lines (241 loc) · 14 KB
/
gainMatcher.html
File metadata and controls
273 lines (241 loc) · 14 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
<html>
<head>
<title>GRIFFIN Gain Matcher</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/regression.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>
<script src="scripts/bootstrap3-3-5.min.js"></script>
<script src='scripts/helpers.js' type="text/javascript"></script>
<script src='scripts/gainMatcher.js' type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap3-3-5.min.css">
<link rel="stylesheet" type="text/css" href="css/custom.css">
<!--HTML imports-->
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<link id='header' rel="import" href="templates/header/header.html">
<link id='gainMatchReport' rel="import" href="templates/gainMatchReport/gainMatchReport.html">
<link id='matchReportTable' rel="import" href="templates/gainMatchReport/matchReportTable.html">
<link id='gainMatchSetupBar' rel="import" href="templates/gainMatchReport/gainMatchSetupBar.html">
<link id='plotGrid' rel="import" href="templates/plotGrid/plotGrid.html">
<link id='plotControl' rel="import" href="templates/plotControl/plotControl.html">
<link id='plotListLite' rel="import" href="templates/plotList/plotListLite.html">
<link id='dataplot' rel="import" href="templates/dataplot/dataplot.html">
<link id='footer' rel="import" href="templates/footer/footer.html">
</head>
<body>
<div id='head'></div>
<div id='messageDiv' class='col-md-12'>
<div id='messageDivText'></div><div id='messageDivButton'></div>
</div>
<!--helpful hints-->
<div class='col-md-6'>
<div id='modeMessage' class="alert alert-warning" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Select if you want to use data being collected online now, or use an offline histogram file.
</div>
<div id='histogramMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Select which histogram file should be used for the energy gain-matching.
</div>
<div id='detectorMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Select which histogram file and detector type you want to perform energy gain-matching for.
</div>
<div id='decisionMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Select if you want to manually select peaks or try the auto-peak finder.
</div>
<div id='waitMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Spectra downloading, please wait...
</div>
<div id='regionMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Shift-click the centres of 4 peaks you'd like to calibrate with. The peak of interest should be the tallest within the search area defined.
<br>The click also sets the position on the y axis so aim for the full height of the peak.
</div>
<!-- Original text for this shiftclick message
<div id='regionMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Shift-click each end of a single line crossing both peaks you'd like to calibrate with.
<br>The first click also sets the position on the y axis.<br>
Tip: aim low and wide!
</div>
-->
<div id='pickerMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Enter each peak's position along the line counting from the left, and its energy.
</div>
<div id='reviewMessage' class="alert alert-warning hidden" role="alert">
<span class="glyphicon glyphicon-check" aria-hidden="true"></span>
Review the results in the table below, and refit any troublesome peaks one at a time.
</div>
</div>
<div id='modeChoiceBar' class='col-md-12'>
</div>
<div id='detectorChoiceBar' class='col-md-12 hidden'>
</div>
<div id='decisionBarAuto' class='col-md-12 hidden'>
</div>
<div id='decisionBarManual' class='col-md-12 hidden'>
<div class='col-md-12'>
<button type="button" class="btn btn-default" id='manualCalibration' engaged='0' onclick=setupManualCalibration()>
<span id='manCalibBadge' class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<span id='manualText'>Manually enter peak info</span>
</button>
</div>
</div>
<!--peak definition-->
<div id='setupBar' class='col-md-12 hidden'></div>
<!--Spectrum Plotting-->
<div id='plotRegion' class='sectionWrapper'>
<div id='plotWrap' class='col-md-9 plotRegion item'>
<div id='plottingGrid'></div>
<div class='col-md-8' id='plotCtrl'></div>
<div class='sectionWrapper refitButtons'>
<div class='col-md-12'>
<button type="button" class="btn btn-default btn-lg" id='fitLow' engaged='0'>
<span id='refitLoBadge' class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<span id='loText'>Refit Peak 1</span>
</button>
<button type="button" class="btn btn-default btn-lg" id='fitMid' engaged='0'>
<span id='refitMidBadge' class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<span id='hiText'>Refit Peak 2</span>
</button>
<button type="button" class="btn btn-default btn-lg" id='fitHigh' engaged='0'>
<span id='refitHiBadge' class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<span id='hiText'>Refit Peak 3</span>
</button>
<button type="button" class="btn btn-default btn-lg" id='fitvHi' engaged='0'>
<span id='refitvHiBadge' class="glyphicon glyphicon-equalizer" aria-hidden="true"></span>
<span id='hiText'>Refit Peak 4</span>
</button>
</div>
</div>
</div>
<div class='col-md-2 item'>
<div id='plotList' style='overflow-y:scroll; height:400px;'></div>
</div>
</div>
<div id='gainMatcher'></div>
<!--Resolution-->
<div id='resolutionSection' class='sectionWrapper'>
<div id='resolutionWrap' class='col-md-12 item'>
<div id='resolution' class='col-md-6'></div>
<div class='col-md-12'>
<h3>These new calibration coefficients:</h3>
<div id='residualP1new' class='col-md-6'></div>
<div id='residualP2new' class='col-md-6'></div>
</div>
<div class='col-md-12'>
<div id='residualP3new' class='col-md-6'></div>
<div id='residualP4new' class='col-md-6'></div>
</div>
<div class='col-md-12'>
<h3>Calibration coefficients from midas file/odb:</h3>
<div id='residualP1mid' class='col-md-6'></div>
<div id='residualP2mid' class='col-md-6'></div>
</div>
<div class='col-md-12'>
<div id='residualP3mid' class='col-md-6'></div>
<div id='residualP4mid' class='col-md-6'></div>
</div>
</div>
</div>
<div id='foot'></div>
<script>
window.addEventListener('HTMLImportsLoaded', function(e) {
dataStore._plotGrid = new plotGrid('plottingGrid');
dataStore._plotControl = new plotControl('plotCtrl', 'horizontal');
dataStore._dataplot[0] = new dataplot('resolution',0);
dataStore._dataplot[1] = new dataplot('residualP1new',1);
dataStore._dataplot[2] = new dataplot('residualP2new',2);
dataStore._dataplot[3] = new dataplot('residualP3new',3);
dataStore._dataplot[4] = new dataplot('residualP4new',4);
dataStore._dataplot[5] = new dataplot('residualP1mid',5);
dataStore._dataplot[6] = new dataplot('residualP2mid',6);
dataStore._dataplot[7] = new dataplot('residualP3mid',7);
dataStore._dataplot[8] = new dataplot('residualP4mid',8);
dataStore.templates = prepareTemplates(['header', 'gainMatchReport', 'matchReportTable', 'gainMatchSetupBar', 'plotGrid', 'plotControl', 'plotListLite', 'dataplot', 'footer']);
setupHeader('head', 'Gain Matcher');
dataStore._plotGrid.setup();
dataStore._plotControl.setup();
//set up spectrum cell
dataStore._plotGrid.manageCellCreation(null, dataStore.plots[0]);
dataStore._dataplot[0].setup(0);
dataStore._dataplot[1].setup(1);
dataStore._dataplot[2].setup(2);
dataStore._dataplot[3].setup(3);
dataStore._dataplot[4].setup(4);
dataStore._dataplot[5].setup(5);
dataStore._dataplot[6].setup(6);
dataStore._dataplot[7].setup(7);
dataStore._dataplot[8].setup(8);
setupFooter('foot');
//don't want additional plots in this app
deleteNode('plottingGridnewPlotButton');
// Inject the dismiss button to the messageDiv
newButton = document.createElement('button');
newButton.setAttribute('id', 'messageDivDismissButton');
newButton.setAttribute('class', 'btn btn-default btn-lg');
newButton.innerHTML = "Dismiss";
//newButton.style.padding = '4px';
newButton.onclick = function(){
ClearErrorConnectingToAnalyzerServer();
}.bind(newButton);
document.getElementById('messageDivButton').appendChild(newButton);
// Create Mode choice buttons
for(var i=0; i<dataStore.modeChoice.length; i++){
newButton = document.createElement('button');
newButton.setAttribute('id', 'modeChoice-'+dataStore.modeChoice[i].name);
newButton.setAttribute('class', 'btn btn-default');
newButton.setAttribute('engaged', '0');
newButton.value = dataStore.modeChoice[i].name;
newButton.innerHTML = dataStore.modeChoice[i].text;
newButton.onclick = function(){
setupMenusFromModeChoice(this.value);
}.bind(newButton);
document.getElementById('modeChoiceBar').appendChild(newButton);
}
// Create Detector choice buttons
for(var i=0; i<dataStore.detectorChoice.length; i++){
newButton = document.createElement('button');
newButton.setAttribute('id', 'detectorChoice-'+dataStore.detectorChoice[i].name);
newButton.setAttribute('class', 'btn btn-default');
newButton.setAttribute('engaged', '0');
newButton.value = dataStore.detectorChoice[i].name;
newButton.innerHTML = 'Calibrate '+dataStore.detectorChoice[i].name;
newButton.onclick = function(){
setupMenusFromDetectorChoice(this.value);
}.bind(newButton);
document.getElementById('detectorChoiceBar').appendChild(newButton);
}
//plug in source decision controls
for(var i=0; i<dataStore.sourceInfo.length; i++){
// Create Auto calibrate source Submit button
newButton = document.createElement('button');
newButton.setAttribute('id', 'automaticCalibration-'+dataStore.sourceInfo[i].name);
newButton.setAttribute('class', 'btn btn-default');
newButton.setAttribute('engaged', '0');
newButton.value = dataStore.sourceInfo[i].name;
newButton.innerHTML = '<span id=\'autoCalibBadge-'+dataStore.sourceInfo[i].name+'\' class=\'glyphicon glyphicon-equalizer\' aria-hidden=\'true\'></span><span id=\'autoText\'>Calibrate '+dataStore.sourceInfo[i].title+'</span>';
newButton.onclick = function(){
setupAutomaticCalibration(this.value);
}.bind(newButton);
document.getElementById('decisionBarAuto').appendChild(newButton);
}
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
// If there was a directory and filename in the URL then automatically load it.
if(dataStore.histoAutoLoad){
setupMenusFromModeChoice('Histo');
}
});
</script>
</body>
</html>