-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbarcoatsim.html
executable file
·484 lines (468 loc) · 28.1 KB
/
barcoatsim.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
474
475
476
477
478
479
480
481
482
483
484
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>ActCoatSim</title>
<link rel="stylesheet" href="https://cdn.usebootstrap.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!--link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css"-->
<link rel="stylesheet" href="./sastyles.css">
<link rel="stylesheet" href="./style.css">
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdn.usebootstrap.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<!--script language="javascript" type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js"></script-->
</head>
<body>
<button id="btnStart" class="btn btn-default">Full Reset</button>
<!--button id="btnPause" class="btn btn-default"><span id="playpause">Pause</span></button-->
<button id="btnReload" class="btn btn-default">Resimulate</button>
Current Step: <span id="currentstep">0</span>
<button id="btnSaveParams" class="btn btn-default">Save Parameters</button>
<button id="btnSaveData" class="btn btn-default">Save Everything</button>
<button id="btnAllFinish" class="btn btn-default">End All Runs</button>
<button id="btnQuickFinish" class="btn btn-default">End Current Run</button>
<!--div>
<label for="reloaddata" class="btn">Reload Data</label>
<input id="reloaddata" style="visibility:hidden;" type="file" name="files[]"></input>
</div-->
<div>
<!--button id="reloadgrid" class="btn btn-default">Reload Grids</button-->
<label for="reloadgrid" class="btn">Reload Grids</label>
<input id="reloadgrid" style="visibility:hidden;" type="file" name="files[]"></input>
</div>
<div class="container">
<div class="jumbotron">
<div class="row">
<div class="col-md-8" style="text-align: center">
<canvas id="myCanvas"></canvas>
</div>
<div id="fullgraph">
<div class="col-md-8" style="text-align: center">
<!-- <div id="Graph" class="flot-graph"></div>
<canvas id="Graph"></canvas> -->
<div id="Graph" style="margin-left: 0.9625rem;margin-right: 0.9625rem;width: 96%;height: 340px;"></div>
</div>
<div class="col-md-8" style="text-align: center">
<div id="Legend" class="flot-legend"></div>
</div>
</div>
</div>
</div>
</div> <!-- /container -->
<ul class="nav nav-pills">
<li class="active"><a data-toggle="pill" href="#generate1">Microstructure Parameters 1</a></li>
<li><a data-toggle="pill" href="#generate2">Microstructure Parameters 2</a></li>
<li><a data-toggle="pill" href="#kinetics">Simulation Parameters</a></li>
<li><a data-toggle="pill" href="#running">Simulation Controls</a></li>
</ul>
<div class="tab-content">
<div id="generate1" class="tab-pane fade in active">
<h3>Coating</h3>
<!--div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
<span id="exampleName">Dropdown</span>
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a class="exampleLink" data-example="leaching">Active Coating</a></li>
<li><a class="exampleLink" data-example="barrier">Barrier</a></li>
</ul>
</div-->
<!--div class="row"-->
<div class="row">
<div class="col-sm-5">
<label for="nocoatings" class="col-sm-5 control-label">No of Coatings</label>
<input name="nocoatings" id="nocoatings" class="form-control" type="number" value="5" min="1"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="manualinter" class="col-sm-5 control-label">Manual Intervention</label>
<input name="manualinter" id="manualinter" class="form-check-input" type="checkbox">
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="coatwidth" class="col-sm-5 control-label">System Width</label>
<input name="coatwidth" id="coatwidth" class="form-control" type="number" value="96" min="10" max="200"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="coatheight" class="col-sm-5 control-label">System Height</label>
<input name="coatheight" id="coatheight" class="form-control" type="number" value="48" min="10" max="100"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="diffusiontest" class="col-sm-5 control-label">Check Diffusion</label>
<input name="diffusiontest" id="diffusiontest" class="form-check-input" type="checkbox">
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="waterontop" class="col-sm-5 control-label">Top Water</label>
<input name="waterontop" id="waterontop" class="form-check-input" type="checkbox" checked>
</div>
<div class="col-sm-5">
<label for="depthofwater" class="col-sm-5 control-label">Depth of Water</label>
<input name="depthofwater" id="depthofwater" class="form-control" type="number" value="10"
min="1" style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="topcoated" class="col-sm-5 control-label">Topcoated</label>
<input name="topcoated" id="topcoated" class="form-check-input" type="checkbox">
</div>
<div class="col-sm-5">
<label for="depthoftopcoat" class="col-sm-5 control-label">Depth of Topcoat</label>
<input name="depthoftopcoat" id="depthoftopcoat" class="form-control" type="number" value="10"
min="1" style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="scribed" class="col-sm-5 control-label">Scribed</label>
<input name="scribed" id="scribed" class="form-check-input" type="checkbox">
</div>
<div class="col-sm-5">
<label for="sizeofscribe" class="col-sm-5 control-label">Size of Scribe</label>
<input name="sizeofscribe" id="sizeofscribe" class="form-control" type="number" value="10"
min="1" style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="gridfromca" class="col-sm-5 control-label">CA Microstructure</label>
<input name="gridfromca" id="gridfromca" class="form-check-input" type="checkbox">
</div>
<div class="col-sm-5">
<label for="nostrucsteps" class="col-sm-5 control-label">No Refinement Steps</label>
<input name="nostrucsteps" id="nostrucsteps" class="form-control" type="number" value="15" min="1"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="probca" class="col-sm-5 control-label">CA Rule Probability</label>
<input name="probca" id="probca" class="form-control" type="number" value="0.45" min="0.01"
max="1.0" style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="nolayers" class="col-sm-5 control-label">No of Layers</label>
<input name="nolayers" id="nolayers" class="form-control" type="number" value="1" min="1" max="2"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="layer1height" class="col-sm-5 control-label">Layer 1 Height</label>
<input name="layer1height" id="layer1height" class="form-control" type="number" value="24" min="1" max="100"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="layer2height" class="col-sm-5 control-label">Layer 2 Height</label>
<input name="layer2height" id="layer2height" class="form-control" type="number" value="24" min="1" max="100"
style="width: 96px" />
</div>
</div>
</div>
<div id="generate2" class="tab-pane fade">
<h3>Particles</h3>
<div class="row">
<div class="col-sm-5">
<label for="square" class="col-sm-5 control-label">Sqaure Particles</label>
<input name="square" id="square" class="form-check-input" type="checkbox">
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="noofparticles" class="col-sm-5 control-label">No of Particles</label>
<input name="noofparticles" id="noofparticles" class="form-control" type="text" value="20"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="radius" class="col-sm-5 control-label">Radius</label>
<input name="radius" id="radius" class="form-control" type="text" value="10"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="noofcuts" class="col-sm-5 control-label">No of Particle Cuts</label>
<input name="noofcuts" id="noofcuts" class="form-control" type="text" value="4"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="minimumpvc" class="col-sm-5 control-label">Minimum PVC</label>
<input name="minimumpvc" id="minimumpvc" class="form-control" type="text" value="0.1"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="maximumpvc" class="col-sm-5 control-label">Maximum PVC</label>
<input name="maximumpvc" id="maximumpvc" class="form-control" type="text" value="1.0"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="noofparticles2" class="col-sm-5 control-label">No of Particles 2</label>
<input name="noofparticles2" id="noofparticles2" class="form-control" type="text" value="20"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="radius2" class="col-sm-5 control-label">Radius 2</label>
<input name="radius2" id="radius2" class="form-control" type="text" value="5"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="noofcuts2" class="col-sm-5 control-label">No of Particle Cuts 2</label>
<input name="noofcuts2" id="noofcuts2" class="form-control" type="text" value="4"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="minimumpvc2" class="col-sm-5 control-label">Minimum PVC2</label>
<input name="minimumpvc2" id="minimumpvc2" class="form-control" type="text" value="0.1"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="maximumpvc2" class="col-sm-5 control-label">Maximum PVC2</label>
<input name="maximumpvc2" id="maximumpvc2" class="form-control" type="text" value="1.0"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="restrictrange" class="col-sm-5 control-label">Restrict Range</label>
<input name="restrictrange" id="restrictrange" class="form-check-input" type="checkbox">
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="minparticle" class="col-sm-5 control-label">Minimum Particle Size</label>
<input name="minparticle" id="minparticle" class="form-control" type="number" value="3" min="1"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="maxparticle" class="col-sm-5 control-label">Maximum Particle Size</label>
<input name="maxparticle" id="maxparticle" class="form-control" type="number" value="10" min="1"
style="width: 96px" />
</div>
</div>
</div>
<!--/div-->
<div id="kinetics" class="tab-pane fade">
<h3>Kinetics</h3>
<div class="row">
<div class="col-sm-5">
<label for="inhibitordensity" class="col-sm-5 control-label">Inhibitor Density</label>
<input name="inhibitordensity" id="inhibitordensity" class="form-control" type="text"
value="1" style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="inhibitorsolubility" class="col-sm-5 control-label">Inhibitor Solubility</label>
<input name="inhibitorsolubility" id="inhibitorsolubility" class="form-control" type="text"
value="1" style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="probdiff" class="col-sm-5 control-label">Probability of Diffusion</label>
<input name="probdiff" id="probdiff" class="form-control" type="text" value="1.0"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="probsol" class="col-sm-5 control-label">Probability of Solubility</label>
<input name="probsol" id="probsol" class="form-control" type="text" value="1.0"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="topleak" class="col-sm-5 control-label">Loose from Top</label>
<input name="topleak" id="topleak" class="form-check-input" type="checkbox" checked>
</div>
<div class="col-sm-5">
<label for="bottomleak" class="col-sm-5 control-label">Loose from Bottom</label>
<input name="bottomleak" id="bottomleak" class="form-check-input" type="checkbox">
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="leftleak" class="col-sm-5 control-label">Loose from Left</label>
<input name="leftleak" id="leftleak" class="form-check-input" type="checkbox">
</div>
<div class="col-sm-5">
<label for="rightleak" class="col-sm-5 control-label">Loose from Right</label>
<input name="rightleak" id="rightleak" class="form-check-input" type="checkbox">
</div>
</div>
</div>
<div id="running" class="tab-pane fade">
<h3>Running</h3>
<div class="row">
<div class="col-sm-5">
<label for="globalplots" class="col-sm-5 control-label">Global Plot</label>
<input name="globalplots" id="globalplots" class="form-check-input" type="checkbox" checked>
</div>
<div class="col-sm-5">
<label for="xsqrt" class="col-sm-5 control-label">X Square Root</label>
<input name="xsqrt" id="xsqrt" class="form-check-input" type="checkbox" checked>
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="cumulativeplots" class="col-sm-5 control-label">Accumulate Runs</label>
<input name="cumulativeplots" id="cumulativeplots" class="form-check-input" type="checkbox" checked>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-sm-5">
<label for="savegrids" class="col-sm-5 control-label">Save Generated Coatings</label>
<input name="savegrids" id="savegrids" class="form-check-input" type="checkbox">
</div>
<div class="col-sm-5">
<label for="savegraphs" class="col-sm-5 control-label">Save Graphs</label>
<input name="savegraphs" id="savegraphs" class="form-check-input" type="checkbox">
</div>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-sm-5">
<label for="captureanimation" class="col-sm-5 control-label">Capture animation to webm</label>
<input name="captureanimation" id="captureanimation" class="form-check-input" type="checkbox">
</div>
<div class="col-sm-5">
<label for="captureplot" class="col-sm-5 control-label">Capture plot to png</label>
<input name="captureplot" id="captureplot" class="form-check-input" type="checkbox">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="numFrames" class="col-sm-5 control-label">Number of frames</label>
<input name="numFrames" id="numFrames" class="form-control" type="number" value="3" min="1"
style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="numPlots" class="col-sm-5 control-label">Number of plots</label>
<input name="numPlots" id="numPlots" class="form-control" type="number" value="10" min="1"
style="width: 96px" />
</div>
</div>
<div class="row">
<div class="col-sm-5">
<label for="endfraction" class="col-sm-5 control-label">Terminal Fraction</label>
<input name="endfraction" id="endfraction" class="form-control" type="number" value="0.5" min="0.0"
max="1.0" style="width: 96px" />
</div>
<div class="col-sm-5">
<label for="noupdates" class="col-sm-5 control-label">No Visual Updates</label>
<input name="noupdates" id="noupdates" class="form-check-input" type="checkbox">
</div>
</div>
</div>
</div>
<script>
/* <div>
<label for="savedata" class="btn">Save Data</label>
<input id="savedata" style="visibility:hidden;" type="file" name="files[]"></input>
</div>
function saveFileSelect(evt) {
var files = evt.target.files; // FileList object
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = function(){
if (multipleLeaches.length == 0) {
ret=JSON.stringify({ label : currentLabel, data:leachProgress});
} else {
ret = JSON.stringify(multipleLeaches.concat({ label : currentLabel, data:leachProgress}));
};
var BB = new Blob([ret], {type: "text/plain;charset=UTF-8"});
saveAs(BB, "./fred" + ".txt");
};
console.log('there');
// Read in the image file as a data URL.
console.log(files[0]);
// reader.readAsText(files[0]);
}
document.getElementById('reloaddata').addEventListener('change', saveFileSelect, false);*/
function reloadFileSelectGrid(evt) {
var files = evt.target.files; // FileList object
var reader = new FileReader();
console.log("now here");
// Closure to capture the file information.
reader.onload = function () {
text = reader.result;
console.log(reader.result.substring(0, 400));
var loadedStuff = JSON.parse(text);
ms = loadedStuff.ms;
updateMSToPage();
allStuff = loadedStuff.allStuff;
};
console.log('now there');
// Read in the image file as a data URL.
console.log(files[0]);
fileNameStem = files[0].name;
fileNameStem = fileNameStem.substring(0,fileNameStem.length - 4);
console.log(fileNameStem);
reader.readAsText(files[0]);
}
document.getElementById('reloadgrid').addEventListener('change', reloadFileSelectGrid, true);
// <label for="reloadgrid" class="btn">Reload Grids</label>
// <input id="reloadgrid" style="visibility:hidden;" type="file" name="files[]"></input>
function reloadFileSelect(evt) {
var files = evt.target.files; // FileList object
var reader = new FileReader();
// Closure to capture the file information.
reader.onload = function () {
text = reader.result;
console.log(reader.result.substring(0, 200));
multipleLeaches = JSON.parse(text);
};
console.log('there');
// Read in the image file as a data URL.
console.log(files[0]);
reader.readAsText(files[0]);
}
//document.getElementById('reloaddata').addEventListener('change', reloadFileSelect, false);
</script>
<!--script language="javascript" type="text/javascript" src="./dist/pixi.js"></script-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/6.0.2/browser/pixi.min.js"></script>
<!--script src="./dist/run_prettify.js?skin=desert"></script-->
<script language="javascript" type="text/javascript" src="./third-party/jquery.canvaswrapper.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/jquery.colorhelpers.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.saturated.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.browser.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.drawSeries.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.uiConstants.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.symbol.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.legend.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/flot/4.2.2/jquery.flot.axislabels.min.js"></script>
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/9.4.3/math.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/cellauto.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/download.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/CCapture.min.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/html2canvas.min.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/webm-writer-0.3.0.js"></script>
<script language="javascript" type="text/javascript" src="./third-party/rainbowvis.js"></script>
<script language="javascript" type="text/javascript" src="./coatsimvis.js"></script>
<script language="javascript" type="text/javascript" src="./examples.js"></script>
<!--script language="javascript" type="text/javascript" src="./third-party/bootstrap.min.js"></script-->
<script language="javascript" type="text/javascript" src="./third-party/FileSaver.js"></script>
<!--<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> -->
</body>
</html>