-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.html
473 lines (420 loc) · 19.2 KB
/
shell.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
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
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<!-- See ../COPYING for licensing details -->
<title>epanet.js</title>
<link rel="canonical" href="http://epanet.de/js/" />
<script src="js/d3.v3.min.js"></script>
<script type="text/javascript" src="js/epanet.js"></script>
<!-- Bootstrap header -->
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link href="css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="css/epanet.css" />
</head>
<body>
<!-- Modal input -->
<div id="inputModal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Edit EPANET Model</h3>
</div>
<div class="modal-body">
<textarea id="inputTextarea">[TITLE]
EPANET Example Network 1
A simple example of modeling chlorine decay. Both bulk and
wall reactions are included.
[JUNCTIONS]
;ID Elev Demand Pattern
10 710 0 ;
11 710 150 ;
12 700 150 ;
13 695 100 ;
21 700 150 ;
22 695 200 ;
23 690 150 ;
31 700 100 ;
32 710 100 ;
[RESERVOIRS]
;ID Head Pattern
9 800 ;
[TANKS]
;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
2 850 120 100 150 50.5 0 ;
[PIPES]
;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
10 10 11 10530 18 100 0 Open ;
11 11 12 5280 14 100 0 Open ;
12 12 13 5280 10 100 0 Open ;
21 21 22 5280 10 100 0 Open ;
22 22 23 5280 12 100 0 Open ;
31 31 32 5280 6 100 0 Open ;
110 2 12 200 18 100 0 Open ;
111 11 21 5280 10 100 0 Open ;
112 12 22 5280 12 100 0 Open ;
113 13 23 5280 8 100 0 Open ;
121 21 31 5280 8 100 0 Open ;
122 22 32 5280 6 100 0 Open ;
[PUMPS]
;ID Node1 Node2 Parameters
9 9 10 HEAD 1 ;
[VALVES]
;ID Node1 Node2 Diameter Type Setting MinorLoss
[TAGS]
[DEMANDS]
;Junction Demand Pattern Category
[STATUS]
;ID Status/Setting
[PATTERNS]
;ID Multipliers
;Demand Pattern
1 1.0 1.2 1.4 1.6 1.4 1.2
1 1.0 0.8 0.6 0.4 0.6 0.8
[CURVES]
;ID X-Value Y-Value
;PUMP: Pump Curve for Pump 9
1 1500 250
[CONTROLS]
LINK 9 OPEN IF NODE 2 BELOW 110
LINK 9 CLOSED IF NODE 2 ABOVE 140
[RULES]
[ENERGY]
Global Efficiency 75
Global Price 0.0
Demand Charge 0.0
[EMITTERS]
;Junction Coefficient
[QUALITY]
;Node InitQual
10 0.5
11 0.5
12 0.5
13 0.5
21 0.5
22 0.5
23 0.5
31 0.5
32 0.5
9 1.0
2 1.0
[SOURCES]
;Node Type Quality Pattern
[REACTIONS]
;Type Pipe/Tank Coefficient
[REACTIONS]
Order Bulk 1
Order Tank 1
Order Wall 1
Global Bulk -.5
Global Wall -1
Limiting Potential 0.0
Roughness Correlation 0.0
[MIXING]
;Tank Model
[TIMES]
Duration 24:00
Hydraulic Timestep 1:00
Quality Timestep 0:05
Pattern Timestep 2:00
Pattern Start 0:00
Report Timestep 1:00
Report Start 0:00
Start ClockTime 12 am
Statistic None
[REPORT]
Status Yes
Summary No
Page 0
[OPTIONS]
Units GPM
Headloss H-W
Specific Gravity 1.0
Viscosity 1.0
Trials 40
Accuracy 0.001
CHECKFREQ 2
MAXCHECK 10
DAMPLIMIT 0
Unbalanced Continue 10
Pattern 1
Demand Multiplier 1.0
Emitter Exponent 0.5
Quality Chlorine mg/L
Diffusivity 1.0
Tolerance 0.01
[COORDINATES]
;Node X-Coord Y-Coord
10 20.00 70.00
11 30.00 70.00
12 50.00 70.00
13 70.00 70.00
21 30.00 40.00
22 50.00 40.00
23 70.00 40.00
31 30.00 10.00
32 50.00 10.00
9 10.00 70.00
2 50.00 90.00
[VERTICES]
;Link X-Coord Y-Coord
[LABELS]
;X-Coord Y-Coord Label & Anchor Node
6.99 73.63 "Source"
13.48 68.13 "Pump"
43.85 91.21 "Tank"
[BACKDROP]
DIMENSIONS 7.00 6.00 73.00 94.00
UNITS None
FILE
OFFSET 0.00 0.00
[END]
</textarea>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
<button class="btn btn-primary" onclick="runButton()">Save changes</button>
</div>
</div>
</div>
</div>
<!-- NAVBAR -->
<div class="navbar navbar-inverse navbar-static-top">
<!-- Wrap the .navbar in .container to center it within the absolutely positioned parent. -->
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#about" data-toggle="modal">epanet.js</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">View <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="javascript:epanetjs.setMode(epanetjs.INPUT)">Input</a></li>
<li><a href="javascript:epanetjs.setMode(epanetjs.ANALYSIS)">Analysis</a></li>
<li><a href="javascript:epanetjs.setMode(epanetjs.ANALYSIS_WITH_LEGEND)">Analysis with legend</a></li>
<li><a href="javascript:epanetjs.setMode(epanetjs.ANALYSIS_SANKEY)">Sankey</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Samples <b class="caret"></b></a>
<ul class="dropdown-menu">
<li class="dropdown-header">EPANET</li>
<li><a href="javascript:epanetjs.loadSample('Net1.inp')">Net1.inp</a></li>
<li><a href="javascript:epanetjs.loadSample('Net2.inp')">Net2.inp</a></li>
<li><a href="javascript:epanetjs.loadSample('Net3.inp')">Net3.inp</a></li>
<li class="divider"></li>
<li class="dropdown-header">epanet.js</li>
<li><a href="javascript:epanetjs.loadSample('simple.inp')">simple.inp</a></li>
<li><a href="javascript:epanetjs.loadSample('PRV.inp')">PRV.inp</a></li>
</ul>
</li>
<li><a href="http://epanet.de/developer/epanetjs.html" data-toggle="tooltip" title="Documentation, source code and background information">Documentation</a></li>
<li><a href="http://epanet.de/" data-toggle="tooltip" title="The epanet.de home page">epanet.de</a></li>
</ul><!-- .nav -->
</div><!-- .navbar-collapse -->
</div><!-- .container -->
</div><!-- .navbar -->
<div id="jumbotron" class="jumbotron">
<svg id="svgSimple" width="100%" height="100%"></svg>
</div>
<div id="legend">
</div>
<div class="container marketing">
<div id="ad">
</div>
<div class="row">
<div class="col-lg-6" id="inputContainer">
<h2 class="">Input
<button type="button" class="btn btn-default" data-content="Select File->Export->Network... in EPANET to save INP files. If opening does not work, open in text editor, then copy and paste." title="" data-toggle="popover" data-original-title="INP file input">
<span class="glyphicon glyphicon-info-sign"></span>
</button>
</h2>
<div class="well well-sm" id="inputButtons">
<input type="file" id="file" style="display: none" data-toggle="tooltip" title="File is kept locally in your browser. It is not sent to the server."/>
<button id="saveButton" class="btn" type="button" role="button" onclick="saveButton()" data-toggle="tooltip" title="Save model in INP format.">Save</button>
<button href="#inputModal" type="button" role="button" class="btn" data-toggle="modal">Edit</button>
</div>
<pre id="inputPre" data-toggle="tooltip" title="Click to edit">
</pre>
</div><!-- /.col-lg-8 -->
<div class="col-lg-6" id="analysisContainer">
<h2>Analysis</h2>
<div class="well well-sm well-analysis">
<span id="status">
<span class="label label-success">Success</span>
</span>
Time
<select id="time" onchange="epanetjs.renderAnalysis()">
<option>1</option>
</select>
Node
<select id="nodeResult" onchange="epanetjs.renderAnalysis()">
<option>Demand</option>
<option>Head</option>
<option>Pressure</option>
</select>
Link
<select id="linkResult" onchange="epanetjs.renderAnalysis()">
<option>Flow</option>
<option>Velocity</option>
<option>Headloss</option>
</select>
</div>
<pre id="output"></pre>
</div><!-- /.col-lg-8 -->
</div><!-- /.row -->
<!-- FOOTER -->
<footer>
<p class="pull-right"><a href="#">Back to top</a></p>
<p>© 2013 Steffen Macke <a href="mailto:sdteffen@gmail.com">sdteffen@gmail.com</a> and others · <a href="http://epanet.de/privacypolicy.html.en">Privacy</a> · <a href="http://epanet.de/imprint.html.en">Imprint</a></p>
<p>Epanet.de is not affiliated with or managed by the United States Environmental Protection Agency or any other governmental agency.</p>
<progress value="0" max="100" id="progress" hidden=1></progress>
</footer>
</div><!-- /.container -->
<!-- About modal -->
<div id="about" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">epanet.js 2.0.12.4</h4>
</div>
<div class="modal-body">
<p>Copyright © 2013 Steffen Macke and others.</p>
<p>Analyse EPANET INP files in your browser. The INP files
are kept locally in the browser and not send to a server.</p>
<p>Uses the original EPANET 2 source code.</p>
<p>This product includes color specifications and designs
developed by Cynthia Brewer (http://colorbrewer.org/).</p>
<p>Epanet.de is not affiliated with or managed by the United
States Environmental Protection Agency or any other
governmental agency.</p>
<p>Additional information is available on
<a href="http://epanet.de/developer/epanetjs.html">epanet.de/developer/epanetjs.html</a>.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-primary" data-dismiss="modal">OK</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- progress modal -->
<div id="working" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><span class="glyphicon glyphicon-cog"></span> EPANET analysis in progress</h4>
</div>
<div class="modal-body">
<p><span class="glyphicon glyphicon-time"></span> Please wait...</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default btn-primary" data-dismiss="modal">OK</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/FileSaver.min.js"></script>
<script>
!function ($) {
$(function() {
try {
var reader = new FileReader();
if(reader)
$("input[type=file").show();
} catch (e) {}
try {
var blob = new Blob();
if(blob)
$("#saveButton").show();
} catch (e) {}
$("[data-toggle=popover]").popover();
})
}(window.jQuery)
if(window.File && window.FileReader && window.FileList)
document.getElementById('file').style.display = 'block';
function handleFileSelect(evt) {
if(!evt.target || !evt.target.files || !evt.target.files.length || 0 == evt.target.files.length)
return;
var f = evt.target.files[0],
reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
document.getElementById('inputTextarea').value = e.target.result;
runButton();
};
})(f);
reader.readAsText(f);
}
document.getElementById('file').addEventListener('change', handleFileSelect, false);
$('#inputPre').on('click', function () {$('#inputModal').modal('show');});
// connect to canvas
var Module = {
preRun: [],
postRun: [],
print: (function() {
var element = document.getElementById('output');
element.value = ''; // clear browser cache
return function(text) {
text = Array.prototype.slice.call(arguments).join(' ');
// These replacements are necessary if you render to raw HTML
//text = text.replace(/&/g, "&");
//text = text.replace(/</g, "<");
//text = text.replace(/>/g, ">");
//text = text.replace('\n', '<br>', 'g');
element.value += text + "\n";
element.scrollTop = element.scrollHeight; // focus on bottom
};
})(),
printErr: function(text) {
text = Array.prototype.slice.call(arguments).join(' ');
if (0) { // XXX disabled for safety typeof dump == 'function') {
dump(text + '\n'); // fast, straight to the real console
} else {
console.log(text);
}
},
canvas: document.getElementById('canvas'),
setStatus: function(text) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
if (text === Module.setStatus.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
if (m) {
text = m[1];
progressElement.value = parseInt(m[2])*100;
progressElement.max = parseInt(m[4])*100;
progressElement.hidden = false;
} else {
progressElement.value = null;
progressElement.max = null;
progressElement.hidden = true;
}
statusElement.innerHTML = text;
},
totalDependencies: 0,
monitorRunDependencies: function(left) {
this.totalDependencies = Math.max(this.totalDependencies, left);
Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
}
};
Module.setStatus('Downloading...');
</script>
{{{ SCRIPT }}}
</body>
</html>
<script src="js/js.js"></script>