diff --git a/octoprint_CalibrationTools/__init__.py b/octoprint_CalibrationTools/__init__.py index 80d5afc..98134b0 100644 --- a/octoprint_CalibrationTools/__init__.py +++ b/octoprint_CalibrationTools/__init__.py @@ -5,6 +5,14 @@ import octoprint.plugin from octoprint_CalibrationTools import (api, hooks, models) +defaultSettings = { + "eSteps": { + "extrudeTemp": 210, + "extrudeLength": 100, + "extrudeSpeed": 50, + "markLength": 120 + } +} class CalibrationtoolsPlugin( octoprint.plugin.StartupPlugin, @@ -36,6 +44,25 @@ class CalibrationtoolsPlugin( "css": ["css/style.css"] } + def get_settings_defaults(self): + return defaultSettings + + def get_template_configs(self): + return [ + { + "type": "tab", + "name": "Calibration Tools", + "template": "CalibrationTools_tab.jinja2", + "custom_bindings": True, + }, + { + "type": "settings", + "name": "Calibration settings", + "template": "CalibrationTools_settings.jinja2", + "custom_bindings": False, + }, + ] + def get_update_information(self): # Define the configuration for your plugin to use with the Software Update # Plugin here. See https://docs.octoprint.org/en/master/bundledplugins/softwareupdate.html diff --git a/octoprint_CalibrationTools/static/js/CalibrationTools.js b/octoprint_CalibrationTools/static/js/CalibrationTools.js index dd62392..68e6f9a 100644 --- a/octoprint_CalibrationTools/static/js/CalibrationTools.js +++ b/octoprint_CalibrationTools/static/js/CalibrationTools.js @@ -1,6 +1,7 @@ $(function () { function CalibrationToolsViewModel(parameters) { var self = this; + console.log(gettext("test")); self.loginStateViewModel = parameters[0]; self.settingsViewModel = parameters[1]; self.controlViewModel = parameters[2]; diff --git a/octoprint_CalibrationTools/templates/CalibrationTools_settings.jinja2 b/octoprint_CalibrationTools/templates/CalibrationTools_settings.jinja2 index 5762b7c..e18dfb9 100644 --- a/octoprint_CalibrationTools/templates/CalibrationTools_settings.jinja2 +++ b/octoprint_CalibrationTools/templates/CalibrationTools_settings.jinja2 @@ -1,7 +1,29 @@ -
-

Something in settings

-
Actual extrusion:
-
New steps value:
-
Extrusion marking length:
-
Measured value:
-
\ No newline at end of file +{% import "macros.jinja2" as snipped %} +{{ snipped.subSection("E-Steps default settings", true) }} + +{{ 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", + "number", "settings.plugins.CalibrationTools.eSteps.extrudeTemp", "true", "ºC", 1) }} + +{{ snipped.field("Filament extrusion length", "The length of filament to be extruded in testing", + "number", "settings.plugins.CalibrationTools.eSteps.extrudeLength", "true", "mm", 1) }} + +{{ snipped.field("Filament extrusion speed", "How fast the filament should be extruded in test A lower value is recommended for avoiding skipping steps", + "number", "settings.plugins.CalibrationTools.eSteps.extrudeSpeed", "true", "mm/s", 1) }} + +{{ snipped.field("Filament mark length", "The length marked on filament", + "number", "settings.plugins.CalibrationTools.eSteps.markLength", "true", "mm") }} + + diff --git a/octoprint_CalibrationTools/templates/CalibrationTools_tab.jinja2 b/octoprint_CalibrationTools/templates/CalibrationTools_tab.jinja2 index 63a22b2..38c4373 100644 --- a/octoprint_CalibrationTools/templates/CalibrationTools_tab.jinja2 +++ b/octoprint_CalibrationTools/templates/CalibrationTools_tab.jinja2 @@ -31,10 +31,10 @@ Documentation
  • - X-Y-Z + E-Steps
  • - E-Steps + X-Y-Z-Steps
  • PID diff --git a/octoprint_CalibrationTools/templates/macros.jinja2 b/octoprint_CalibrationTools/templates/macros.jinja2 index d7d4d4f..8752094 100644 --- a/octoprint_CalibrationTools/templates/macros.jinja2 +++ b/octoprint_CalibrationTools/templates/macros.jinja2 @@ -17,7 +17,8 @@ {% endmacro %} -{% macro field(label, title, type, binding, enable, unit) %} +{% macro field(label, title, type, binding, enable, unit, step) %} +{% set step = step|default('0.01') %}
    - + {{ _(unit) }}
    diff --git a/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 b/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 index 3a65f47..a21bf76 100644 --- a/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 +++ b/octoprint_CalibrationTools/templates/tabs/tab-esteps.jinja2 @@ -12,7 +12,7 @@
    M104    S -
    @@ -27,10 +27,10 @@
    G1   E -    F -
    @@ -91,4 +91,6 @@ First \ No newline at end of file diff --git a/octoprint_CalibrationTools/translations/de/LC_MESSAGES/messages.mo b/octoprint_CalibrationTools/translations/de/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..6b95cc9 Binary files /dev/null and b/octoprint_CalibrationTools/translations/de/LC_MESSAGES/messages.mo differ diff --git a/octoprint_CalibrationTools/translations/de/LC_MESSAGES/messages.po b/octoprint_CalibrationTools/translations/de/LC_MESSAGES/messages.po new file mode 100644 index 0000000..869199d --- /dev/null +++ b/octoprint_CalibrationTools/translations/de/LC_MESSAGES/messages.po @@ -0,0 +1,25 @@ +# German translations for OctoPrint-CalibrationTools. +# Copyright (C) 2022 The OctoPrint Project +# This file is distributed under the same license as the +# OctoPrint-CalibrationTools project. +# FIRST AUTHOR , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: OctoPrint-CalibrationTools 0.1.0\n" +"Report-Msgid-Bugs-To: i18n@octoprint.org\n" +"POT-Creation-Date: 2022-01-30 12:36+0000\n" +"PO-Revision-Date: 2022-01-30 12:36+0000\n" +"Last-Translator: FULL NAME \n" +"Language: de\n" +"Language-Team: de \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.9.1\n" + +#: octoprint_CalibrationTools/static/js/CalibrationTools.js:4 +msgid "test" +msgstr "somethingElse" + diff --git a/octoprint_CalibrationTools/translations/en/LC_MESSAGES/messages.mo b/octoprint_CalibrationTools/translations/en/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..39eb8d4 Binary files /dev/null and b/octoprint_CalibrationTools/translations/en/LC_MESSAGES/messages.mo differ diff --git a/octoprint_CalibrationTools/translations/en/LC_MESSAGES/messages.po b/octoprint_CalibrationTools/translations/en/LC_MESSAGES/messages.po new file mode 100644 index 0000000..b9b8920 --- /dev/null +++ b/octoprint_CalibrationTools/translations/en/LC_MESSAGES/messages.po @@ -0,0 +1,25 @@ +# English translations for OctoPrint-CalibrationTools. +# Copyright (C) 2022 The OctoPrint Project +# This file is distributed under the same license as the +# OctoPrint-CalibrationTools project. +# FIRST AUTHOR , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: OctoPrint-CalibrationTools 0.1.0\n" +"Report-Msgid-Bugs-To: i18n@octoprint.org\n" +"POT-Creation-Date: 2022-01-30 12:36+0000\n" +"PO-Revision-Date: 2022-01-30 12:18+0000\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.9.1\n" + +#: octoprint_CalibrationTools/static/js/CalibrationTools.js:4 +msgid "test" +msgstr "something" + diff --git a/translations/de/LC_MESSAGES/messages.mo b/translations/de/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..6b95cc9 Binary files /dev/null and b/translations/de/LC_MESSAGES/messages.mo differ diff --git a/translations/de/LC_MESSAGES/messages.po b/translations/de/LC_MESSAGES/messages.po new file mode 100644 index 0000000..869199d --- /dev/null +++ b/translations/de/LC_MESSAGES/messages.po @@ -0,0 +1,25 @@ +# German translations for OctoPrint-CalibrationTools. +# Copyright (C) 2022 The OctoPrint Project +# This file is distributed under the same license as the +# OctoPrint-CalibrationTools project. +# FIRST AUTHOR , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: OctoPrint-CalibrationTools 0.1.0\n" +"Report-Msgid-Bugs-To: i18n@octoprint.org\n" +"POT-Creation-Date: 2022-01-30 12:36+0000\n" +"PO-Revision-Date: 2022-01-30 12:36+0000\n" +"Last-Translator: FULL NAME \n" +"Language: de\n" +"Language-Team: de \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.9.1\n" + +#: octoprint_CalibrationTools/static/js/CalibrationTools.js:4 +msgid "test" +msgstr "somethingElse" + diff --git a/translations/en/LC_MESSAGES/messages.mo b/translations/en/LC_MESSAGES/messages.mo new file mode 100644 index 0000000..39eb8d4 Binary files /dev/null and b/translations/en/LC_MESSAGES/messages.mo differ diff --git a/translations/en/LC_MESSAGES/messages.po b/translations/en/LC_MESSAGES/messages.po new file mode 100644 index 0000000..b9b8920 --- /dev/null +++ b/translations/en/LC_MESSAGES/messages.po @@ -0,0 +1,25 @@ +# English translations for OctoPrint-CalibrationTools. +# Copyright (C) 2022 The OctoPrint Project +# This file is distributed under the same license as the +# OctoPrint-CalibrationTools project. +# FIRST AUTHOR , 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: OctoPrint-CalibrationTools 0.1.0\n" +"Report-Msgid-Bugs-To: i18n@octoprint.org\n" +"POT-Creation-Date: 2022-01-30 12:36+0000\n" +"PO-Revision-Date: 2022-01-30 12:18+0000\n" +"Last-Translator: FULL NAME \n" +"Language: en\n" +"Language-Team: en \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.9.1\n" + +#: octoprint_CalibrationTools/static/js/CalibrationTools.js:4 +msgid "test" +msgstr "something" + diff --git a/translations/messages.pot b/translations/messages.pot new file mode 100644 index 0000000..ab65caf --- /dev/null +++ b/translations/messages.pot @@ -0,0 +1,24 @@ +# Translations template for OctoPrint-CalibrationTools. +# Copyright (C) 2022 The OctoPrint Project +# This file is distributed under the same license as the +# OctoPrint-CalibrationTools project. +# FIRST AUTHOR , 2022. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: OctoPrint-CalibrationTools 0.1.0\n" +"Report-Msgid-Bugs-To: i18n@octoprint.org\n" +"POT-Creation-Date: 2022-01-30 12:36+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.9.1\n" + +#: octoprint_CalibrationTools/static/js/CalibrationTools.js:4 +msgid "test" +msgstr "something" +