diff --git a/extras/fanslider.md b/extras/fanslider.md new file mode 100644 index 0000000..936df86 --- /dev/null +++ b/extras/fanslider.md @@ -0,0 +1,38 @@ +--- +layout: plugin + +id: fanslider +title: Fan Speed Control +description: Control your parts cooling fan +author: ntoff +license: AGPLv3 + + +date: 2017-12-02 + +homepage: https://github.com/ntoff/OctoPrint-FanSpeedSlider +source: https://github.com/ntoff/OctoPrint-FanSpeedSlider +archive: https://github.com/ntoff/OctoPrint-FanSpeedSlider/archive/master.zip + +tags: +- UI +- Controls + +screenshots: +- url: /assets/img/plugins/fanslider/slider.JPG + alt: slider + caption: slider +- url: /assets/img/plugins/fanslider/settings.png + alt: settings + caption: settings + +featuredimage: /assets/img/plugins/fanslider/slider.JPG + +compatibility: + + octoprint: + - 1.3.5 + +--- + +Adds a slider to the controls page for setting the speed of your parts cooling fan, and a settings page that allows limiting the fan's output power. \ No newline at end of file diff --git a/image/settings.png b/image/settings.png new file mode 100644 index 0000000..29578f0 Binary files /dev/null and b/image/settings.png differ diff --git a/octoprint_fanspeedslider/static/css/style.css b/octoprint_fanspeedslider/static/css/style.css index d885502..bc5b673 100644 --- a/octoprint_fanspeedslider/static/css/style.css +++ b/octoprint_fanspeedslider/static/css/style.css @@ -1,20 +1,3 @@ -#touch body #control #control-fan-slider { - padding: 30px 0 15px 15px; - width: 50%; -} - -#touch body #control #control-fan-slider button, #touch body #control #control-fan-slider input { - padding: 10px 20px; - margin: 0 0 20px; - width: 100%; - min-height: 40px; - height: auto; - -ms-box-sizing: border-box; - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - div#settings_plugin_fanspeedslider div { - width: 80%; + width: 90%; } \ No newline at end of file diff --git a/octoprint_fanspeedslider/static/js/fanslider.js b/octoprint_fanspeedslider/static/js/fanslider.js index 878cf68..1ce241c 100644 --- a/octoprint_fanspeedslider/static/js/fanslider.js +++ b/octoprint_fanspeedslider/static/js/fanslider.js @@ -18,6 +18,12 @@ $(function () { self.settings.maxFanSpeed = new ko.observable(100); //and this are percents 0 - 100% self.settings.notifyDelay = new ko.observable(4000); //time in milliseconds + self.settings.commonTitle = ko.observable(gettext("\n\nThis allows limiting the cooling fan without having to re-slice your model.\n\nLimited to prints controlled by OctoPrint.")); + self.settings.defaultTitle = ko.observable(gettext("This is the value the slider will default to when the UI is loaded / refreshed.")); + self.settings.minTitle = ko.observable(gettext("Set this to the lowest value at which your fan will spin.") + self.settings.commonTitle()); + self.settings.maxTitle = ko.observable(gettext("Set this <100% if your cooling fan is too strong on full.") + self.settings.commonTitle()); + self.settings.noticeTitle = ko.observable(gettext("Notifications only apply when setting the speed via the slider + button in the UI. Set to 0 (zero) to disable notifications.")); + self.showNotify = function (self, options) { options.hide = true; options.title = "Fan Speed Control"; @@ -88,14 +94,10 @@ $(function () { \ "); //also add spin box + button below in its own section, button is redundant but convenient - $("#control-jog-extrusion").after("\ -
\ -
\ - \ - \ -
\ -
\ - "); + $("#control-jog-feedrate").append("\ + \ + \ + "); } } catch (error) { diff --git a/octoprint_fanspeedslider/templates/fanspeedslider_settings.jinja2 b/octoprint_fanspeedslider/templates/fanspeedslider_settings.jinja2 index 00a318e..b2811b6 100644 --- a/octoprint_fanspeedslider/templates/fanspeedslider_settings.jinja2 +++ b/octoprint_fanspeedslider/templates/fanspeedslider_settings.jinja2 @@ -5,18 +5,18 @@
- + %
{{ _('The default value the slider will be set to when opening OctoPrint\'s UI') }}
-

{{ _('The settings below can be used to limit the fan\'s output without having to re-slice and re-upload your gcode.') }}

+
- + %
{{ _('Any value sent which is below this value will be increased to meet this speed. Useful if your fan doesn\'t work below a certain threshold.') }} @@ -26,7 +26,7 @@
- + %
{{ _('Any value sent which is above this value will be decreased to meet this speed. Useful if your fan is too strong on full speed.') }} @@ -38,7 +38,7 @@
- + ms
{{ _('Delay (in milliseconds) before notifications are auto-hidden. Set to 0 to disable notifications.') }} diff --git a/setup.py b/setup.py index a477aa6..25ffd14 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ plugin_package = "octoprint_fanspeedslider" plugin_name = "OctoPrint-FanSpeedSlider" # The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module -plugin_version = "0.1.6" +plugin_version = "0.1.7" # The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin # module