Skip to content

Commit

Permalink
🚧 Settings work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 24, 2024
1 parent ff90db5 commit 4c3f7b9
Show file tree
Hide file tree
Showing 13 changed files with 1,204 additions and 151 deletions.
128 changes: 128 additions & 0 deletions _features/runout_sensor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: Filament Runout Sensor
description: Detect the presence of filament in the extruder and handle filament runout.
tag: runout

author: thinkyhead
category: [ features, runout ]

code: |
/**
* @section filament runout sensors
*
* Filament Runout Sensors
* Mechanical or opto endstops are used to check for the presence of filament.
*
* IMPORTANT: Runout will only trigger if Marlin is aware that a print job is running.
* Marlin knows a print job is running when:
* 1. Running a print job from media started with M24.
* 2. The Print Job Timer has been started with M75.
* 3. The heaters were turned on and PRINTJOB_TIMER_AUTOSTART is enabled.
*
* RAMPS-based boards use SERVO3_PIN for the first runout sensor.
* For other boards you may need to define FIL_RUNOUT_PIN, FIL_RUNOUT2_PIN, etc.
*/
//#define FILAMENT_RUNOUT_SENSOR
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
#define FIL_RUNOUT_ENABLED_DEFAULT true // Enable the sensor on startup. Override with M412 followed by M500.
#define NUM_RUNOUT_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_RUNOUT#_PIN for each.
#define FIL_RUNOUT_STATE LOW // Pin state indicating that filament is NOT present.
#define FIL_RUNOUT_PULLUP // Use internal pullup for filament runout pins.
//#define FIL_RUNOUT_PULLDOWN // Use internal pulldown for filament runout pins.
//#define WATCH_ALL_RUNOUT_SENSORS // Execute runout script on any triggering sensor, not only for the active extruder.
// This is automatically enabled for MIXING_EXTRUDERs.
// Override individually if the runout sensors vary
//#define FIL_RUNOUT1_STATE LOW
//#define FIL_RUNOUT1_PULLUP
//#define FIL_RUNOUT1_PULLDOWN
//#define FIL_RUNOUT2_STATE LOW
//#define FIL_RUNOUT2_PULLUP
//#define FIL_RUNOUT2_PULLDOWN
//#define FIL_RUNOUT3_STATE LOW
//#define FIL_RUNOUT3_PULLUP
//#define FIL_RUNOUT3_PULLDOWN
//#define FIL_RUNOUT4_STATE LOW
//#define FIL_RUNOUT4_PULLUP
//#define FIL_RUNOUT4_PULLDOWN
//#define FIL_RUNOUT5_STATE LOW
//#define FIL_RUNOUT5_PULLUP
//#define FIL_RUNOUT5_PULLDOWN
//#define FIL_RUNOUT6_STATE LOW
//#define FIL_RUNOUT6_PULLUP
//#define FIL_RUNOUT6_PULLDOWN
//#define FIL_RUNOUT7_STATE LOW
//#define FIL_RUNOUT7_PULLUP
//#define FIL_RUNOUT7_PULLDOWN
//#define FIL_RUNOUT8_STATE LOW
//#define FIL_RUNOUT8_PULLUP
//#define FIL_RUNOUT8_PULLDOWN
// Commands to execute on filament runout.
// With multiple runout sensors use the %c placeholder for the current tool in commands (e.g., "M600 T%c")
// NOTE: After 'M412 H1' the host handles filament runout and this script does not apply.
#define FILAMENT_RUNOUT_SCRIPT "M600"
// After a runout is detected, continue printing this length of filament
// before executing the runout script. Useful for a sensor at the end of
// a feed tube. Requires 4 bytes SRAM per sensor, plus 4 bytes overhead.
//#define FILAMENT_RUNOUT_DISTANCE_MM 25
#ifdef FILAMENT_RUNOUT_DISTANCE_MM
// Enable this option to use an encoder disc that toggles the runout pin
// as the filament moves. (Be sure to set FILAMENT_RUNOUT_DISTANCE_MM
// large enough to avoid false positives.)
//#define FILAMENT_MOTION_SENSOR
#if ENABLED(FILAMENT_MOTION_SENSOR)
//#define FILAMENT_SWITCH_AND_MOTION
#if ENABLED(FILAMENT_SWITCH_AND_MOTION)
#define NUM_MOTION_SENSORS 1 // Number of sensors, up to one per extruder. Define a FIL_MOTION#_PIN for each.
//#define FIL_MOTION1_PIN -1
// Override individually if the motion sensors vary
//#define FIL_MOTION1_STATE LOW
//#define FIL_MOTION1_PULLUP
//#define FIL_MOTION1_PULLDOWN
//#define FIL_MOTION2_STATE LOW
//#define FIL_MOTION2_PULLUP
//#define FIL_MOTION2_PULLDOWN
//#define FIL_MOTION3_STATE LOW
//#define FIL_MOTION3_PULLUP
//#define FIL_MOTION3_PULLDOWN
//#define FIL_MOTION4_STATE LOW
//#define FIL_MOTION4_PULLUP
//#define FIL_MOTION4_PULLDOWN
//#define FIL_MOTION5_STATE LOW
//#define FIL_MOTION5_PULLUP
//#define FIL_MOTION5_PULLDOWN
//#define FIL_MOTION6_STATE LOW
//#define FIL_MOTION6_PULLUP
//#define FIL_MOTION6_PULLDOWN
//#define FIL_MOTION7_STATE LOW
//#define FIL_MOTION7_PULLUP
//#define FIL_MOTION7_PULLDOWN
//#define FIL_MOTION8_STATE LOW
//#define FIL_MOTION8_PULLUP
//#define FIL_MOTION8_PULLDOWN
#endif
#endif
#endif
#endif // FILAMENT_RUNOUT_SENSOR
---
28 changes: 17 additions & 11 deletions _includes/setting-info.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@
{% endif %}
{%- if options %}
<div class="options">
<{{ h3 }}>Options</{{ h3 }}>
{% if options[0].value %}
<table{% if options.size > 4 %} class="table-striped"{% endif %}>
<{{ h3 }}>Options</{{ h3 }}>
<table{% if options.size > 4 or options[0].brief %} class="table-striped"{% endif %}>
{%- for op in options -%}
<tr><th>{{ op.value }}</th><td>{% if op.brief %}{{ op.brief }}{% endif %}</td></tr>
{%- endfor -%}
</table>
{% else %}
{{ options | join: ", " }}
<strong>Options:</strong> {{ options | join: ", " }}
{% endif %}
</div>
{% endif %}
Expand All @@ -97,7 +97,7 @@
{% else %}{% assign example = false %}{% endif %}
{%- if example %}
<div class="examples">
<{{ h3 }}>Example{% if example[1] %}s{% endif %}</{{ h3 }}>
<{{ h3 }}>Example{% if example.size > 1 %}s{% endif %}</{{ h3 }}>
{% for ex in example %}
{% if ex.pre %}
{% for line in ex.pre %}
Expand Down Expand Up @@ -134,12 +134,18 @@ <h4>{{ ttl }}</h4>

{% if conf.links %}
<div class="links">
<{{ h3 }}>External Links</{{ h3 }}>
<ul>
{% for link in conf.links %}
<li><a href="{{ link.url }}">{{ link.label }}</a></li>
{% endfor %}
</ul>
{% if conf.links.size > 1 %}
<{{ h3 }}>External Links</{{ h3 }}>
<ul>
{% for link in conf.links %}{% assign label = link.label | default: link.url %}
<li><a href="{{ link.url }}">{{ label }}</a></li>
{% endfor %}
</ul>
{% else %}
{% assign link = conf.links[0] %}
{% assign label = link.label | default: link.url %}
<strong>External Link:</strong> <a href="{{ link.url }}">{{ label }}</a>
{% endif %}
</div>
{% endif %}

Expand All @@ -159,7 +165,7 @@ <h4>{{ ttl }}</h4>
{% if sub %}
{% assign confbak = conf %}
{% assign aprefixbak = aprefix %}
{% if conf.name %}{% assign aprefix = aprefix | append: conf.name | append: '-' %}{% else %}{% assign aprefix = '' %}{% endif %}
{% if conf.name %}{% assign aprefix = aprefix | append: conf.name | append: '-' %}{% endif %}
{% for conf in sub %}
{% if conf contains 'since' %}{% else %}{% assign parsince = conf.since %}{% endif %}
{% if conf contains 'tags' %}{% else %}{% assign partags = conf.tags %}{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions _includes/setting-summ.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ <h2><a href="{{ conf.url | prepend: site.baseurl }}">{% if conf.label %}{{ conf.
{% for opt in conf.settings %}
<div class="group">
<a class="opt" href="{{ conf.url | prepend: site.baseurl }}#{{opt.name}}">{{opt.name}}</a>
{% if opt contains 'subopts' %}
{% if opt.subopts %}
<div class="sub">
{% for sub1 in opt.subopts %}
<a class="opt" href="{{ conf.url | prepend: site.baseurl }}#{{opt.name}}-{{sub1.name}}">{{sub1.name}}</a>
{% if sub1 contains 'subopts' %}
{% if sub1.subopts %}
<div class="sub">
{% for sub2 in sub1.subopts %}
<a class="opt" href="{{ conf.url | prepend: site.baseurl }}#{{opt.name}}-{{sub1.name}}-{{sub2.name}}">{{sub2.name}}</a>
{% if sub2 contains 'subopts' %}
{% if sub2.subopts %}
<div class="sub">
{% for sub3 in sub2.subopts %}
<a class="opt" href="{{ conf.url | prepend: site.baseurl }}#{{opt.name}}-{{sub1.name}}-{{sub2.name}}-{{sub3.name}}">{{sub3.name}}</a>
Expand Down
30 changes: 23 additions & 7 deletions _layouts/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,35 @@
{%- if active -%}
<!-- div id="toc-prefab"></div -->
<ul class="tocify-subheader nav nav-list">
{% for opt in conf.settings %}
{% for opt in conf.settings -%}
<li class="tocify-item"><a href="#{{ opt.name }}">{{ opt.name }}</a>
{%- if opt.subopts -%}
<ul class="tocify-subheader nav nav-list">
{% for sub in opt.subopts %}
<li class="tocify-item"><a href="#{{ sub.name }}">{{ sub.name }}</a></li>
{%- endfor %}
{%- for sub1 in opt.subopts -%}
<li class="tocify-item"><a href="#{{ opt.name }}-{{ sub1.name }}">{{ sub1.name }}</a>
{%- if sub1.subopts -%}
<ul class="tocify-subheader nav nav-list">
{% for sub2 in sub1.subopts -%}
<li class="tocify-item"><a href="#{{ opt.name }}-{{ sub1.name }}-{{ sub2.name }}">{{ sub2.name }}</a>
{%- if sub2.subopts -%}
<ul class="tocify-subheader nav nav-list">
{%- for sub3 in sub2.subopts -%}
<li class="tocify-item"><a href="#{{ opt.name }}-{{ sub1.name }}-{{ sub2.name }}-{{ sub3.name }}">{{ sub3.name }}</a></li>
{%- endfor =%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif -%}
</li>
{%- endfor -%}
</ul>
{%- endif %}
{%- endif -%}
</li>
{%- endfor %}
{%- endfor -%}
</ul>
{% endif %}
{%- endif -%}
{%- endfor -%}
</ul>
</div>
Expand Down
9 changes: 4 additions & 5 deletions _sass/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -625,11 +625,10 @@ div.alert-danger {

div.container.detail, div.container.config {
div.row {
h4, h5, h6 { background: var(--color-code-bg); color: var(--color-code); }
h5 {
background: var(--color-gcode-h5-bg); color: var(--color-gcode-h5);
code { background: var(--color-gcode-h5-code-bg); color: var(--color-gcode-h5-code); }
}
h4, h6 { background: var(--color-code-bg); color: var(--color-code); }
h5 { background: var(--color-gcode-h5-bg); }
h5, strong { color: var(--color-gcode-h5); }
h5 code { background: var(--color-gcode-h5-code-bg); color: var(--color-gcode-h5-code); }
}
div.row.examples pre { background: var(--color-gcode-examples-bg); }
div.row.gallery p { color: var(--color-gcode-gallery); }
Expand Down
39 changes: 0 additions & 39 deletions _setting/coming_soon.md

This file was deleted.

Loading

0 comments on commit 4c3f7b9

Please sign in to comment.