diff --git a/analyser.css b/analyser.css index 50fdbde..2395ac2 100644 --- a/analyser.css +++ b/analyser.css @@ -110,4 +110,21 @@ font-family: serif; font-style: oblique; font-size: 0.8em; +} + +.printHeader { + display: none; + text-align: center; +} + +@media print { + #inputArea { + display: none; + } + .header { + display: none; + } + .printHeader { + display: inline; + } } \ No newline at end of file diff --git a/analyser.js b/analyser.js index dfa54f3..49a9cdb 100644 --- a/analyser.js +++ b/analyser.js @@ -259,18 +259,67 @@ function drawGraph() { function clearScreen() { // Reset variables back to defaults - numDies = 2; + numDies = 0; outputVisible = 0; - // Delete the table - outputTable = document.getElementById("output"); + // Clear and reset inputs + var inputStart = document.getElementById("die0"); + inputStart.value = "0.0"; + var unitsType = document.getElementById("metric"); + unitsType.checked = true; + var inputTable = document.getElementById("data"); + inputTable.innerHTML = "

Draft

Exit Dia.Angle (2α)"; + + // Delete the output table + var outputTable = document.getElementById("output"); outputTable.innerHTML = ""; // Delete the output graph outputGraph = document.getElementById("outputChart"); - outputGraph.innerHTML = " "; + outputGraph.innerHTML = ""; + // Add two fresh entries + addReduction(); + addReduction(); } -///// START OF ALGORITHMS SECTION ///// \ No newline at end of file +///// END OF ALGORITHMS SECTION ///// + +///// EXTRA SECTION ///// + +function printScreen() { + var subtitle = document.getElementById("subtitle"); + var reductionCount = document.getElementById("numReductions"); + + // Get input size, and format it + var inputSize = document.getElementById("die0").value; + if (inputSize < 10.0 && inputSize > 0) { // If we have a 'proper' number i.e. ".130" + inputSize = Number(inputSize); + } else { // re-format the number if it's 'wrong' i.e. "130" + inputSize = inputSize / 1000; + } + + // If our start size is metric show that, otherwise swap them to show 'murican first + if (document.getElementById("metric").checked) { + var inputText = inputSize + " mm (" + toInches(inputSize) + "\")"; + } else { + var inputText = inputSize + "\" (" + toMillimetres(inputSize) + " mm)"; + } + + + // Get the final size and format it + var outputSize = document.getElementById("die" + numDies).value; + if (outputSize < 10.0 && outputSize > 0) { // If we have a 'proper' number i.e. ".130" + outputSize = Number(outputSize); + } else { // re-format the number if it's 'wrong' i.e. "130" + outputSize = outputSize / 1000; + } + console.log(outputSize); + var outputText = outputSize + "\" (" + toMillimetres(outputSize) + " mm)"; + + + subtitle.innerHTML = "For " + inputText + " to " + outputText; + reductionCount.innerHTML = "Across " + numDies + " reductions"; + window.print(); +} \ No newline at end of file diff --git a/index.html b/index.html index ebbe1f4..9ae8fd1 100644 --- a/index.html +++ b/index.html @@ -6,12 +6,20 @@ - + Wiredraw Setup Analyser
+
+

Taylor Courage's

+

Draft Analysis

+

+

+

+

+

Taylor Courage's

Setup Analyser

@@ -19,34 +27,36 @@

- - - - - - -

- - -

- - - - - - -

Draft

Exit Dia.Angle (2α)
-

- - - - - -

 

-

+
+ + + + + + +

+ + +

+ + + + + + +

Draft

Exit Dia.Angle (2α)
+

+ + + + + +

 

+

+

 

-

 

+