working dynamic columns
Browse files
efficiency_module/efficiency.py
CHANGED
|
@@ -10,39 +10,36 @@ def efficiency():
|
|
| 10 |
|
| 11 |
|
| 12 |
# build the report page for the exposure module
|
| 13 |
-
@blueprint.route('/efficiency', methods=['POST'])
|
| 14 |
-
def eff_post():
|
| 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 |
-
print(Conc)
|
| 46 |
-
|
| 47 |
-
return render_template('efficiency_report.html', ExtEff = ExtEff, Conc=Conc)
|
| 48 |
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
# build the report page for the exposure module
|
| 13 |
+
# @blueprint.route('/efficiency', methods=['POST'])
|
| 14 |
+
# def eff_post():
|
| 15 |
+
#
|
| 16 |
+
# mass = float(request.form["mass"])
|
| 17 |
+
# density = float(request.form["density"])
|
| 18 |
+
# PolymerVolume = mass / density
|
| 19 |
+
# SurfaceArea = float(request.form["area"])
|
| 20 |
+
#
|
| 21 |
+
# SolventVolume = float(request.form["svol"])
|
| 22 |
+
# ExtractionTime = float(request.form["time"])*3600.
|
| 23 |
+
# iterations = int(request.form["iterations"])
|
| 24 |
+
#
|
| 25 |
+
# ExtractionTime = ExtractionTime * iterations
|
| 26 |
+
# SolventVolume = SolventVolume * iterations
|
| 27 |
+
#
|
| 28 |
+
# #D = float(request.form["DiffCoeff"])
|
| 29 |
+
# #K = float(request.form["PartCoeff"])
|
| 30 |
+
#
|
| 31 |
+
# L = PolymerVolume / SurfaceArea
|
| 32 |
+
#
|
| 33 |
+
# nterms = 5
|
| 34 |
+
# M0 = 1.
|
| 35 |
+
# K = np.array((1e-3, 1., 1e3))
|
| 36 |
+
# D = np.array((1e-7, 1e-10, 1e-13))
|
| 37 |
+
# ExtEff = np.zeros((3,3))
|
| 38 |
+
# for i in range(3):
|
| 39 |
+
# for j in range(3):
|
| 40 |
+
# ExtEff[i,j] = PlaneSheetAnalytical(M0, D[i], K[j], PolymerVolume, SurfaceArea, SolventVolume, ExtractionTime, nterms)
|
| 41 |
+
#
|
| 42 |
+
# Conc = ExtEff * PolymerVolume / SolventVolume
|
| 43 |
+
#
|
| 44 |
+
# return render_template('efficiency_report.html', ExtEff = ExtEff, Conc=Conc)
|
|
|
|
|
|
|
|
|
|
| 45 |
|
efficiency_module/templates/efficiency_index.html
CHANGED
|
@@ -8,6 +8,13 @@
|
|
| 8 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js" integrity="sha384-VHvPCCyXqtD5DqJeNxl2dtTyhF78xXNXdkwX1CZeRusQfRKp+tA7hAShOK/B/fQ2" crossorigin="anonymous"></script>
|
| 9 |
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles.css') }}">
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
</head>
|
| 12 |
|
| 13 |
<img src="{{ url_for('static',filename='images/FDAlogo.png') }}" style="float: left;" height="100"/>
|
|
@@ -15,48 +22,84 @@
|
|
| 15 |
<br clear="all" />
|
| 16 |
|
| 17 |
<header>
|
| 18 |
-
<h1 style="text-align:center"><font color="#0070C0">CH</font>emical <font color="#0070C0">RIS</font>k calculator (CHRIS) - Extraction efficiency RST</h1>
|
| 19 |
</header>
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
<body>
|
| 22 |
|
| 23 |
<form method="POST">
|
| 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 |
</body>
|
| 62 |
</html>
|
|
|
|
| 8 |
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.min.js" integrity="sha384-VHvPCCyXqtD5DqJeNxl2dtTyhF78xXNXdkwX1CZeRusQfRKp+tA7hAShOK/B/fQ2" crossorigin="anonymous"></script>
|
| 9 |
<link rel= "stylesheet" type= "text/css" href= "{{ url_for('static',filename='styles.css') }}">
|
| 10 |
|
| 11 |
+
<style>
|
| 12 |
+
table, th, td {
|
| 13 |
+
border: 1px solid black;
|
| 14 |
+
border-collapse: collapse;
|
| 15 |
+
}
|
| 16 |
+
</style>
|
| 17 |
+
|
| 18 |
</head>
|
| 19 |
|
| 20 |
<img src="{{ url_for('static',filename='images/FDAlogo.png') }}" style="float: left;" height="100"/>
|
|
|
|
| 22 |
<br clear="all" />
|
| 23 |
|
| 24 |
<header>
|
| 25 |
+
<h1 style="text-align:center"><font color="#0070C0">CH</font>emical <font color="#0070C0">RIS</font>k calculator (CHRIS) - Extraction efficiency comparison RST</h1>
|
| 26 |
</header>
|
| 27 |
|
| 28 |
+
<script>
|
| 29 |
+
function addColumn(){
|
| 30 |
+
|
| 31 |
+
var i = document.getElementById('theTable').rows[0].cells.length;
|
| 32 |
+
|
| 33 |
+
$("#theTable tr:eq( 0 )").append("<td> <input type='number' step='any' value='1.0' min='0.00001' required id='mass'" + i + "> </td>");
|
| 34 |
+
$("#theTable tr:eq( 1 )").append("<td> <input type='number' step='any' value='1.0' min='0.00001' required id='density'" + i + "> </td>");
|
| 35 |
+
$("#theTable tr:eq( 2 )").append("<td> <input type='number' step='any' value='6.0' min='0.00001' required id='area'" + i + "> </td>");
|
| 36 |
+
$("#theTable tr:eq( 3 )").append("<td> <input type='number' step='any' value='1.0' min='0.00001' required id='svol'" + i + "> </td>");
|
| 37 |
+
$("#theTable tr:eq( 4 )").append("<td> <input type='number' step='1' value='1' min='1' onchange='this.value = parseInt(this.value);' required id='iterations'" + i + "> </td>");
|
| 38 |
+
$("#theTable tr:eq( 5 )").append("<td> <input type='number' step='any' value='1.0' min='0.00001' required id='time'" + i + "> </td>");
|
| 39 |
+
$("#theTable tr:eq( 6 )").append("<td> <input type='number' step='any' value='1e-8' min='1e-20' required id='D'" + i + "> </td>");
|
| 40 |
+
$("#theTable tr:eq( 7 )").append("<td> <input type='number' step='any' value='1.0' min='0.00001' required id='K'" + i + "> </td>");
|
| 41 |
+
|
| 42 |
+
};
|
| 43 |
+
|
| 44 |
+
function removeColumn(){
|
| 45 |
+
|
| 46 |
+
$('#theTable tr').find('td:last').remove();
|
| 47 |
+
|
| 48 |
+
};
|
| 49 |
+
</script>
|
| 50 |
+
|
| 51 |
<body>
|
| 52 |
|
| 53 |
<form method="POST">
|
| 54 |
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
<input type = "button" onclick = "javascript:addColumn()" value = "Add column" />
|
| 58 |
+
<input type = "button" onclick = "javascript:removeColumn()" value = "Remove column" />
|
| 59 |
+
|
| 60 |
+
<table id="theTable">
|
| 61 |
+
<tr>
|
| 62 |
+
<th> Test article mass (g)</th>
|
| 63 |
+
<td> <input name="mass1" id="mass1" step="any" value="1.0" min="0.000001" type="number" required> </td>
|
| 64 |
+
<td> <input name="mass2" id="mass2" step="any" value="1.0" min="0.000001" type="number" required> </td>
|
| 65 |
+
</tr>
|
| 66 |
+
<tr>
|
| 67 |
+
<th> Test article density (g/cm<sup>3</sup>) </th>
|
| 68 |
+
<td> <input name="density1" id="density1" step="any" value="1.0" min="0.01" type="number" required> </td>
|
| 69 |
+
<td> <input name="density2" id="density2" step="any" value="1.0" min="0.01" type="number" required> </td>
|
| 70 |
+
</tr>
|
| 71 |
+
<tr>
|
| 72 |
+
<th> Test article surface area (cm<sup>2</sup>) </th>
|
| 73 |
+
<td> <input name="area1" id="area1" step="any" value="6.0" min="0.001" type="number" required> </td>
|
| 74 |
+
<td> <input name="area2" id="area2" step="any" value="6.0" min="0.001" type="number" required> </td>
|
| 75 |
+
</tr>
|
| 76 |
+
<tr>
|
| 77 |
+
<th> Solvent volume (ml) </th>
|
| 78 |
+
<td> <input name="svol1" id="svol1" step="any" value="1.0" min="0.000001" type="number" required> </td>
|
| 79 |
+
<td> <input name="svol2" id="svol2" step="any" value="1.0" min="0.000001" type="number" required> </td>
|
| 80 |
+
</tr>
|
| 81 |
+
<tr>
|
| 82 |
+
<th> # of iterations </th>
|
| 83 |
+
<td> <input name="iterations1" id="iterations1" value="1" min="1" type="number" step="1" onchange="this.value = parseInt(this.value);" required> </td>
|
| 84 |
+
<td> <input name="iterations2" id="iterations2" value="1" min="1" type="number" step="1" onchange="this.value = parseInt(this.value);" required> </td>
|
| 85 |
+
</tr>
|
| 86 |
+
<tr>
|
| 87 |
+
<th> time per iteration (h) </th>
|
| 88 |
+
<td> <input name="time1" id="time1" step="any" value="24.0" min="0.001" type="number" required> </td>
|
| 89 |
+
<td> <input name="time2" id="time2" step="any" value="24.0" min="0.001" type="number" required> </td>
|
| 90 |
+
</tr>
|
| 91 |
+
<tr>
|
| 92 |
+
<th> Diffusion coefficient (cm<sup>2</sup>/s) </th>
|
| 93 |
+
<td> <input name="D1" id="D1" step="any" value="1e-8" min="1e-20" type="number" required> </td>
|
| 94 |
+
<td> <input name="D2" id="D2" step="any" value="1e-8" min="1e-20" type="number" required> </td>
|
| 95 |
+
</tr>
|
| 96 |
+
<tr>
|
| 97 |
+
<th> Partition coefficient </th>
|
| 98 |
+
<td> <input name="K1" id="K1" step="any" value="1" min="1e-3" type="number" required> </td>
|
| 99 |
+
<td> <input name="K2" id="K2" step="any" value="1" min="1e-3" type="number" required> </td>
|
| 100 |
+
</tr>
|
| 101 |
+
</table>
|
| 102 |
+
|
| 103 |
+
<br> <button type="submit">Calculate</button>
|
| 104 |
</body>
|
| 105 |
</html>
|