Add feedrate previews

Calculate feedrate approximations based on user input, displayed next to user input.
This commit is contained in:
lawgicau
2021-07-20 22:17:58 +10:00
parent ae2e362ac6
commit 191f1837a6
4 changed files with 21 additions and 3 deletions

View File

@ -347,6 +347,15 @@ iframe {
float: left;
}
.summary {
display: inline-block;
padding: 4px 10px;
border: 2px solid rgb(230, 230, 230);
border-radius: 5px;
margin: 2px 5px;
font-size: 1.2em;
}
/* Tabs container */
.r-tabs {
position: relative;

View File

@ -229,8 +229,9 @@ var retractionTower = /*html*/ `<h4>Retraction</h4>
</table>`;
var feedrate = /*html*/ `<h4>Feedrate</h4>
<p>The default printing speed is 60 mm/sec, with modifiers including 60% for perimeters, 80% for solid infill, travel moves 166%, and 50% of these for the first layer. Modify the base feedrate here and the generated gcode will be modified using the same proportions. Please note extruder retraction/unretraction and Z-hop speeds will be unaffected by this.</p>
<p><label>Base feedrate (mm/sec): <input type="number" name="baseFeedrate" value="60" min="5" max="1000" step="1"></label></p>
<p>The default printing speed is 60 mm/sec, with modifiers including 60% for perimeters, 80% for solid infill, travel moves 166%, and 50% of these for the first layer. Modify the base feedrate here and the generated gcode will be modified using the same proportions (<b>calculated feedrates shown in grey</b>). Please note extruder retraction/unretraction and Z-hop speeds will be unaffected by this.</p>
<p><label>Base feedrate (mm/sec): <input type="number" name="baseFeedrate" value="60" min="5" max="1000" step="1" onchange="updateFeeds(form);"></label>
<span class="summary">Perimeters: <b><span class="perimFeed">36</span> mm/s</b></span><span class="summary">Solid infill: <b><span class="solidFeed">48</span> mm/s</b></span><span class="summary">Travel moves: <b><span class="travelFeed">100</span> mm/s</b></span><span class="summary">First layer: <b><span class="firstFeed">30</span> mm/s</b></span></p>
`;
var accel = /*html*/ `<h4>Base feedrate/speed</h4>

View File

@ -103,6 +103,14 @@ function toggleJ() {
}
}
function updateFeeds(formName) {
var feedrate = formName.baseFeedrate.value;
$('.perimFeed').html(Math.round(feedrate*0.6));
$('.solidFeed').html(Math.round(feedrate*0.8));
$('.travelFeed').html(Math.round(feedrate*1.67));
$('.firstFeed').html(Math.round(feedrate*0.5));
}
function processGcode(formName) {
var name = formName.name;
var description = formName.description.value;