working settings
This commit is contained in:
@@ -7,8 +7,8 @@ from octoprint_CalibrationTools import api, hooks, models
|
|||||||
|
|
||||||
defaultSettings = {
|
defaultSettings = {
|
||||||
"eSteps": {
|
"eSteps": {
|
||||||
"userControlsTemp": True,
|
"userControlsTemp": "checked",
|
||||||
"turnOffHeater": True,
|
"turnOffHotend": "",
|
||||||
"extrudeTemp": 210,
|
"extrudeTemp": 210,
|
||||||
"extrudeLength": 100,
|
"extrudeLength": 100,
|
||||||
"extrudeSpeed": 50,
|
"extrudeSpeed": 50,
|
||||||
@@ -16,7 +16,6 @@ defaultSettings = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
class CalibrationtoolsPlugin(
|
class CalibrationtoolsPlugin(
|
||||||
octoprint.plugin.StartupPlugin,
|
octoprint.plugin.StartupPlugin,
|
||||||
octoprint.plugin.TemplatePlugin,
|
octoprint.plugin.TemplatePlugin,
|
||||||
@@ -29,6 +28,7 @@ class CalibrationtoolsPlugin(
|
|||||||
collectCommand = False
|
collectCommand = False
|
||||||
data = {}
|
data = {}
|
||||||
|
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
self.collectCommand = False
|
self.collectCommand = False
|
||||||
|
|
||||||
@@ -46,6 +46,7 @@ class CalibrationtoolsPlugin(
|
|||||||
"js": ["js/CalibrationTools.js"],
|
"js": ["js/CalibrationTools.js"],
|
||||||
"css": ["css/style.css"]
|
"css": ["css/style.css"]
|
||||||
}
|
}
|
||||||
|
# self._settings.valid_boolean_trues:
|
||||||
|
|
||||||
def get_settings_defaults(self):
|
def get_settings_defaults(self):
|
||||||
return defaultSettings
|
return defaultSettings
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
from __future__ import absolute_import, division, print_function, unicode_literals
|
from __future__ import absolute_import, division, print_function, unicode_literals
|
||||||
|
|
||||||
from threading import Event
|
|
||||||
import octoprint.plugin
|
|
||||||
import flask
|
|
||||||
import re
|
import re
|
||||||
|
from threading import Event
|
||||||
|
|
||||||
|
import flask
|
||||||
|
import octoprint.plugin
|
||||||
|
|
||||||
CMD_TEST = "TEST"
|
CMD_TEST = "TEST"
|
||||||
CMD_LOAD_STEPS = "loadSteps"
|
CMD_LOAD_STEPS = "loadSteps"
|
||||||
@@ -68,10 +69,10 @@ class API(octoprint.plugin.SimpleApiPlugin):
|
|||||||
return
|
return
|
||||||
|
|
||||||
if command == CMD_SAVE_E_STEPS:
|
if command == CMD_SAVE_E_STEPS:
|
||||||
cmds = ["M92 E%(newESteps)s" % data, "M500"]
|
eStepsSettings = self._settings.get(['eSteps'])
|
||||||
cmds = cmds + ["M104 S0"]
|
userControlsTemp = eStepsSettings.get("userControlsTemp")
|
||||||
self._printer.commands()
|
turnOffHotend = eStepsSettings.get("turnOffHotend")
|
||||||
|
self._printer.commands(["M92 E%(newESteps)s" % data, "M500"] + ["M104 S0"] if turnOffHotend and not userControlsTemp else [])
|
||||||
return
|
return
|
||||||
|
|
||||||
if command == CMD_TEST:
|
if command == CMD_TEST:
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
{% import "macros.jinja2" as snipped %}
|
{% import "macros.jinja2" as snipped %}
|
||||||
{{ snipped.subSection("E-Steps default settings", true) }}
|
{{ snipped.subSection("E-Steps default settings", true) }}
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6"><label class="checkbox pull-right" style="margin-top: 5px;" for="userControlsTemp">Let me to control temperature</label></div>
|
<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>
|
<div class="span6"><input id="userControlsTemp" type="checkbox" data-bind="checked: settings.plugins.CalibrationTools.eSteps.userControlsTemp"></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6"><label class="checkbox pull-right" style="margin-top: 5px;" for="turnOffHeater">Cooldown extruder when saving to EEPROM</label></div>
|
<div class="span6"><label for="turnOffHotend" class="checkbox pull-right" style="margin-top: 5px;">Cooldown extruder when saving to EEPROM</label></div>
|
||||||
<div class="span6"><input id="turnOffHeater" type="checkbox" data-bind="checked: settings.plugins.CalibrationTools.eSteps.turnOffHeater"></div>
|
<div class="span6"><input id="turnOffHotend" type="checkbox" data-bind="checked: settings.plugins.CalibrationTools.eSteps.turnOffHotend,
|
||||||
|
disable: settings.plugins.CalibrationTools.eSteps.userControlsTemp">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ snipped.field("Extrusion temperature", "The temperature used to extrude in testing
Is better to be a bit higher then usual for reducing the nuzzle pressure",
|
{{ snipped.field("Extrusion temperature", "The temperature used to extrude in testing
Is better to be a bit higher then usual for reducing the nuzzle pressure",
|
||||||
|
|||||||
Reference in New Issue
Block a user