-refactoring js files,

-implementing 3 decimal observer
-reusing load steps and save steps event
-adding settings for xyzSteps
-subsection macro default spacing = true
This commit is contained in:
sergiuToporjinschi
2022-02-05 13:44:49 +02:00
parent 30ce20a60f
commit d294fa5724
13 changed files with 971 additions and 27 deletions
@@ -1,5 +1,5 @@
{% import "macros.jinja2" as snipped %}
{{ snipped.subSection("E-Steps default settings", true) }}
{{ snipped.subSection("E-Steps default values",true) }}
<div class="row-fluid">
<div class="span6"><label for="userControlsTemp" class="checkbox pull-right" style="margin-top: 5px;">Let me to control temperature</label></div>
<div class="span6"><input id="userControlsTemp" type="checkbox" data-bind="checked: settings.plugins.CalibrationTools.eSteps.userControlsTemp"></div>
@@ -23,14 +23,18 @@
{{ snipped.field("Filament mark length", "The length marked on filament",
"number", "settings.plugins.CalibrationTools.eSteps.markLength", "true", "mm", 50) }}
{{ snipped.subSection("X-Y-Z-Steps", true) }}
{{ snipped.subSection("X-Y-Z-Steps default values") }}
{{ snipped.field("gCode cube size of X", "", "number", "settings.plugins.CalibrationTools.XYZSteps.gCodeCubeSize.X", "true", "mm", 0.01, 10.00, "") }}
{{ snipped.field("gCode cube size of Y", "", "number", "settings.plugins.CalibrationTools.XYZSteps.gCodeCubeSize.Y", "true", "mm", 0.01, 10.00, "") }}
{{ snipped.field("gCode cube size of Z", "", "number", "settings.plugins.CalibrationTools.XYZSteps.gCodeCubeSize.Z", "true", "mm", 0.01, 10.00, "") }}
{{ snipped.subSection("Hot-end PID", true) }}
{{ snipped.subSection("Hot-end PID default values") }}
{{ snipped.field("Fan speed", "Default value for fan speed while tuning", "number", "settings.plugins.CalibrationTools.pid.hotEnd.fanSpeed", "true", "", 1, 0, 255) }}
{{ snipped.field("Number of cycles", "Default number of cycles to sample while tuning", "number", "settings.plugins.CalibrationTools.pid.hotEnd.noCycles", "true", "", 1, 3, 200) }}
{{ snipped.field("HotEnd index", "Default number of cycles to sample while tuning", "number", "settings.plugins.CalibrationTools.pid.hotEnd.hotEndIndex", "true", "", 1, 0) }}
{{ snipped.field("Target temperature", "Default target temperature for tuning", "number", "settings.plugins.CalibrationTools.pid.hotEnd.targetTemp", "true", "&ordmC", 1, 3, 200) }}
{{ snipped.subSection("Bed PID", true) }}
{{ snipped.subSection("Bed PID default values") }}
{{ snipped.field("Fan speed", "Default value for fan speed while tuning", "number", "settings.plugins.CalibrationTools.pid.bed.fanSpeed", "true", "", 1, 0, 255) }}
{{ snipped.field("Number of cycles", "Default number of cycles to sample while tuning", "number", "settings.plugins.CalibrationTools.pid.bed.noCycles", "true", "", 1, 3, 200) }}
{{ snipped.field("Target temperature", "Default target temperature for tuning", "number", "settings.plugins.CalibrationTools.pid.bed.targetTemp", "true", "&ordmC", 1, 3, 200) }}
@@ -26,13 +26,13 @@
<div class="main row-fluid">
<div class="span3">
<ul class="nav nav-list">
<li class="active">
<li>
<a data-toggle="tab" href="#calibration_documentation">Documentation</a>
</li>
<li>
<a data-toggle="tab" href="#calibration_eSteps">E-Steps</a>
</li>
<li>
<li class="active">
<a data-toggle="tab" href="#calibration_x-y-z">X-Y-Z-Steps</a>
</li>
<li>
@@ -1,5 +1,5 @@
{% macro subSection(title, spaceBefore) %}
{% if (spaceBefore) %} <br><br> {% endif %}
{% macro subSection(title, spaceBefore = false) %}
{% if (not spaceBefore) %} <br><br> {% endif %}
<strong>{{ _(title) }}</strong>
<hr>
{% endmacro %}
@@ -1,8 +1,8 @@
<div class="tab-content">
<div id="calibration_documentation" class="tab-pane active">
<div id="calibration_documentation" class="tab-pane ">
{% include "tabs/tab-doc.jinja2" %}
</div>
<div id="calibration_x-y-z" visible="false" class="tab-pane">
<div id="calibration_x-y-z" visible="false" class="tab-pane active">
{% include "tabs/tab-xyz.jinja2" %}
</div>
<div id="calibration_eSteps" visible="false" class="tab-pane">
@@ -51,7 +51,7 @@
</div>
</div>
{{ snipped.subSection("Test results", true) }}
{{ snipped.subSection("Test results") }}
<div class="row-fluid">
<div class="span6">
@@ -102,7 +102,7 @@
</div>
{{ snipped.subSection("Process description", true) }}
{{ snipped.subSection("Process description") }}
{{ snipped.quote("
This calibration is best done with the extruder detached from the hot end, so no restriction is present on the movement. If it is convenient, you can partially disassemble the printer so the output of the extruder is
open and the filament exits in free air. If this is inconvenient, the process below aims to minimize restrictions by extruding very slowly and with a slightly higher temperature. The results from this should still be
@@ -48,7 +48,7 @@
</div>
</div>
{{ snipped.subSection("Hot-end tuning", true) }}
{{ snipped.subSection("Hot-end tuning") }}
<div class="row-fluid">
<div class="span5">
<label for="fanSpeed" class="pull-right" style="margin-top: 5px;" title="Fan speed">
@@ -95,7 +95,7 @@
</div>
</div>
{{ snipped.subSection("Heated bed tuning", true) }}
{{ snipped.subSection("Heated bed tuning") }}
<div class="row-fluid">
<div class="span5">
<label for="fanSpeed" class="pull-right" style="margin-top: 5px;" title="Fan speed">
@@ -142,7 +142,7 @@
</div>
</div>
{{ snipped.subSection("Note", true) }}
{{ snipped.subSection("Note") }}
{{ snipped.quote("It is recommended to run the tuning with conditions as close to printing as possible. This means filament loaded and the part cooling fan set to your normal speed. It is not essential, but you may
prefer to start this process with the hot end at room temperature.",
"<a href='https://teachingtechyt.github.io/calibration.html#pid' target='_blank'>teachingtechyt.github.io</a>", "text-warning") }}
@@ -1 +1,90 @@
Something in xyz tab...
{% import "macros.jinja2" as snipped %}
{{ snipped.subSection("Current PID values", true) }}
<div class="row-fluid">
<div class="span3">
<label for="tunningPIDNoCycles" class="pull-right" style="margin-top: 5px;" title="x">
Current values
</label>
</div>
<div class="span9">
<div class="input-prepend input-append">
{{ snipped.linkToMarlin("M092", "Marlin website") }}
<span class="add-on" title="">M92&nbsp;&nbsp;&nbsp;X</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.currentSteps.X, enable: false">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Y</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.currentSteps.Y, enable: false">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Z</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.currentSteps.Z, enable: false">
<button class="btn" data-bind="click: $root.loadESteps, enable: $root.loadEStepsActive() && $root.controlViewModel.isOperational() && (!$root.controlViewModel.isPrinting())"
title="Loads current value from EEPROM by calling M92">
<i class="fas fa-sync-alt" style="color:false" data-color="false"></i>
</button>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span3">
<label for="tunningPIDNoCycles" class="pull-right" style="margin-top: 5px;" title="x">
GCode cube size
</label>
</div>
<div class="span9">
<div class="input-prepend input-append">
<span class="add-on" title="">X</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.X">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Y</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.Y">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Z</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.Z">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;mm</span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span3">
<label for="tunningPIDNoCycles" class="pull-right" style="margin-top: 5px;" title="x">
Printed cube size
</label>
</div>
<div class="span9">
<div class="input-prepend input-append">
<span class="add-on" title="">X</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.X">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Y</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.Y">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Z</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.Z">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;mm</span>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span3">
<label for="tunningPIDNoCycles" class="pull-right" style="margin-top: 5px;" title="x">
New values
</label>
</div>
<div class="span9">
<div class="input-prepend input-append">
{{ snipped.linkToMarlin("M092", "Marlin website") }}
<span class="add-on" title="">M92&nbsp;&nbsp;&nbsp;X</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.X">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Y</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.Y">
<span class="add-on" title="">&nbsp;&nbsp;&nbsp;Z</span>
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.Z">
{{ snipped.m500Icon() }}
</div>
</div>
</div>
<div class="row-fluid" style="margin-bottom: 5px;">
<div class="span3"></div>
<div class="span9">
<button class="btn btn-success" data-bind="click: $root.saveEStepsXYZ, enable: $root.saveEStepsXYZActive() && $root.controlViewModel.isOperational() && (!$root.controlViewModel.isPrinting())"
title="This will save new values to EEPROM (M92 Xx Yx Zx; M500)">
<i class="fas fa-save" style="color:false" data-color="false"></i>&nbsp&nbsp
Save to EEPROM
</button>
</div>
</div>