-Wrapping rest api in try catch
-Tuning css for numeric fields -Clean-up
This commit is contained in:
@@ -16,9 +16,9 @@ defaultSettings = {
|
||||
},
|
||||
"XYZSteps": {
|
||||
"gCodeCubeSize": {
|
||||
"X":20,
|
||||
"Y":20,
|
||||
"Z":20
|
||||
"X":20.000,
|
||||
"Y":20.000,
|
||||
"Z":20.000
|
||||
}
|
||||
},
|
||||
"pid": {
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||
|
||||
import traceback
|
||||
from ast import Try
|
||||
|
||||
import flask
|
||||
|
||||
@@ -27,13 +26,18 @@ class API(EStepsApi.API, PIDAutoTune.API):
|
||||
return result
|
||||
|
||||
def on_api_get(self, request):
|
||||
# request.args.get('x')
|
||||
try:
|
||||
self._logger.debug("api.on_api_get")
|
||||
return flask.jsonify(
|
||||
{
|
||||
"data": self.data["steps"]
|
||||
}
|
||||
)
|
||||
except Exception as e:
|
||||
self._logger.error(traceback.format_exc())
|
||||
return flask.abort(500, {
|
||||
"msg": "An error curred"
|
||||
})
|
||||
|
||||
def on_api_command(self, command, data):
|
||||
try:
|
||||
|
||||
@@ -69,6 +69,11 @@
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#tab_plugin_CalibrationTools input.numberDisplay {
|
||||
text-align: left;
|
||||
max-width: 65px;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
|
||||
|
||||
@@ -59,7 +59,11 @@ $(function () {
|
||||
"newYSteps": self.eStepsXYZ.newSteps.Y(),
|
||||
"newZSteps": self.eStepsXYZ.newSteps.Z()
|
||||
}).done(function (response) {
|
||||
|
||||
new PNotify({
|
||||
title: "Saved",
|
||||
text: "X: " + self.eStepsXYZ.newSteps.X() + "steps/mm<br>Y: " + self.eStepsXYZ.newSteps.Y() + "steps/mm<br>Z: " + self.eStepsXYZ.newSteps.Z() + " steps/mm<br> had been set for X/Y/Z axes",
|
||||
type: "info"
|
||||
});
|
||||
}).always(function (response) {
|
||||
self.saveEStepsXYZActive(true);
|
||||
})
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
"number", "settings.plugins.CalibrationTools.eSteps.markLength", "true", "mm", 50) }}
|
||||
|
||||
{{ 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.field("gCode cube size of X", "", "number", "settings.plugins.CalibrationTools.XYZSteps.gCodeCubeSize.X", "true", "mm", 0.001, 10.000, "") }}
|
||||
{{ snipped.field("gCode cube size of Y", "", "number", "settings.plugins.CalibrationTools.XYZSteps.gCodeCubeSize.Y", "true", "mm", 0.001, 10.000, "") }}
|
||||
{{ snipped.field("gCode cube size of Z", "", "number", "settings.plugins.CalibrationTools.XYZSteps.gCodeCubeSize.Z", "true", "mm", 0.001, 10.000, "") }}
|
||||
|
||||
|
||||
{{ snipped.subSection("Hot-end PID default values") }}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
<div class="octo-tab-content">
|
||||
<div class="row-fluid header" id="toolBar">
|
||||
<div class="span3 title">
|
||||
<div class="span11 title">
|
||||
<p>Calibration</p>
|
||||
</div>
|
||||
<div class="span8 title">
|
||||
<!-- <div class="span8 title">
|
||||
<div class="row-fluid">
|
||||
<div class="span6"></div>
|
||||
<div class="span6">
|
||||
<button class="btn" data-bind="click: $root.restart, visible: true">
|
||||
<button class="btn" data-bind="click: $root.restart, visible: false">
|
||||
RESTART
|
||||
</button>
|
||||
<button class="btn btn-primary" data-bind="click: $root.test, visible: true" title="BTN for testing">
|
||||
<button class="btn btn-primary" data-bind="click: $root.test, visible: false" title="BTN for testing">
|
||||
<i class="fas fa-save" data-color="#000000"></i>  
|
||||
TEST
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="span1 icon">
|
||||
<a data-bind="click: $root.onSettingsClick">
|
||||
<i class="fas fa-cog fa-lg" data-color="#ddd"></i>
|
||||
@@ -26,14 +26,14 @@
|
||||
<div class="main row-fluid">
|
||||
<div class="span3">
|
||||
<ul class="nav nav-list">
|
||||
<li>
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#calibration_documentation">Documentation</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-toggle="tab" href="#calibration_eSteps">E-Steps</a>
|
||||
</li>
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#calibration_x-y-z">X-Y-Z-Steps</a>
|
||||
<li>
|
||||
<a data-toggle="tab" href="#calibration_x-y-z">X-Y-Z Steps</a>
|
||||
</li>
|
||||
<li>
|
||||
<a data-toggle="tab" href="#calibration_pid">PID Autotune</a>
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<div class="tab-content">
|
||||
<div id="calibration_documentation" class="tab-pane ">
|
||||
<div id="calibration_documentation" class="tab-pane active">
|
||||
{% include "tabs/tab-doc.jinja2" %}
|
||||
</div>
|
||||
<div id="calibration_x-y-z" visible="false" class="tab-pane active">
|
||||
<div id="calibration_x-y-z" visible="false" class="tab-pane">
|
||||
{% include "tabs/tab-xyz.jinja2" %}
|
||||
</div>
|
||||
<div id="calibration_eSteps" visible="false" class="tab-pane">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% import "macros.jinja2" as snipped %}
|
||||
|
||||
{{ snipped.subSection("Current PID values", true) }}
|
||||
{{ snipped.subSection("X-Y-Z Steps", true) }}
|
||||
<div class="row-fluid">
|
||||
<div class="span3">
|
||||
<label for="tunningPIDNoCycles" class="pull-right" style="margin-top: 5px;" title="x">
|
||||
@@ -11,11 +11,11 @@
|
||||
<div class="input-prepend input-append">
|
||||
{{ snipped.linkToMarlin("M092", "Marlin website") }}
|
||||
<span class="add-on" title="">M92 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">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.currentSteps.X, enable: false">
|
||||
<span class="add-on" title=""> 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">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.currentSteps.Y, enable: false">
|
||||
<span class="add-on" title=""> 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">
|
||||
<input type="number" id="" class="input-small numberDisplay" 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>
|
||||
@@ -32,11 +32,11 @@
|
||||
<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">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.X">
|
||||
<span class="add-on" title=""> Y</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.Y">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.Y">
|
||||
<span class="add-on" title=""> Z</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.Z">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.gCodeCubeSize.Z">
|
||||
<span class="add-on" title=""> mm</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -50,11 +50,11 @@
|
||||
<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">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.X">
|
||||
<span class="add-on" title=""> Y</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.Y">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.Y">
|
||||
<span class="add-on" title=""> Z</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.Z">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.printedCubeSize.Z">
|
||||
<span class="add-on" title=""> mm</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,11 +69,11 @@
|
||||
<div class="input-prepend input-append">
|
||||
{{ snipped.linkToMarlin("M092", "Marlin website") }}
|
||||
<span class="add-on" title="">M92 X</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.X">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.X">
|
||||
<span class="add-on" title=""> Y</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.Y">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.Y">
|
||||
<span class="add-on" title=""> Z</span>
|
||||
<input type="number" id="" class="input-small" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.Z">
|
||||
<input type="number" id="" class="input-small numberDisplay" step="0.001" min="0" max="100" title="" data-bind="value: $root.eStepsXYZ.newSteps.Z">
|
||||
{{ snipped.m500Icon() }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user