Skip to content

Commit

Permalink
Add bot speed setting, resolves #51
Browse files Browse the repository at this point in the history
  • Loading branch information
techninja committed Jan 29, 2016
1 parent 59694d2 commit ac13a7c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions locales/en-US/app-en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
},
"gcode": {
"title": "Print Export Options",
"botspeed": "Print Speed:",
"botspeedinfo": "The percent of the maximum speed that the PancakeBot will move at, defaults to 70%. If this has no effect on your PancakeBot you may need to install the new firmware available on PancakeBot.com. Increasing the speed of the PancakeBot may reduce its life span.",
"flatten": "Flatten resolution:",
"flatteninfo": "The resolution limit when converting curves into polygons for GCODE coordinates. Lower value creates more points and higher resolution, higher value creates fewer points and lower resolution approximation.",
"shutoff": "Line end pre-shutoff distance:",
Expand Down
4 changes: 4 additions & 0 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ var griddleSize = {
height: 267.7
};

// Real world PancakeBot speed maximum.
var botSpeedMax = 6600;

// Define the printable/drawable area in MM from furthest griddle edge
var printableArea = {
offset: {
Expand Down Expand Up @@ -78,6 +81,7 @@ function setRenderSettings() {
renderConfig.fillSpacing = app.settings.v.fillspacing;
renderConfig.fillAngle = app.settings.v.fillangle;
renderConfig.fillGroupThreshold = app.settings.v.fillthresh;
renderConfig.botSpeed = parseInt((app.settings.v.botspeed / 100) * botSpeedMax, 10);
}

// Page loaded
Expand Down
2 changes: 1 addition & 1 deletion src/gcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ module.exports = function(config) {
gc('note', '----------------------------------------'),
gc('workspace', config.printArea),
gc('units'),
gc('speed', 5600),
gc('speed', config.botSpeed),
gc('pumpoff'),
gc('wait', 1000),
gc('off'),
Expand Down
5 changes: 5 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ <h2 data-i18n>settings.title</h2>
<legend data-i18n>settings.gcode.title</legend>

<div>
<label for="botspeed" data-i18n>settings.gcode.botspeed</label>
<input id="botspeed" class="managed" type="number" min="25" default="70" max="100" step="1">
<aside data-i18n>settings.gcode.botspeedinfo</aside>
</div>

<div>
<label for="flatten" data-i18n>settings.gcode.flatten</label>
<input id="flatten" class="managed" type="number" min="2" default="15" max="50" step="1">
Expand Down
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ function settingsInit() {
startwait: 450, // Time to wait for batter flow begin
endwait: 250, // Time to wait for batter flow at end of line
changewait: 35, // Number of seconds to wait between shade changes.
botspeed: 70, // Locked stepper speed percentage written to GCODE
fillspacing: 15, // Space between each trace fill line
fillangle: 23, // Angle of line for trace fill
fillthresh: 27 // Threshold to group zig zags,
fillthresh: 27 // Threshold to group zig zags
},
clear: function() {
fs.removeSync(settingsFile);
Expand Down Expand Up @@ -139,7 +140,7 @@ function windowInit() {
};

// and load the index.html of the app.
mainWindow.loadUrl('file://' + __dirname + '/index.html');
mainWindow.loadURL('file://' + __dirname + '/index.html');


// Save Move/Resize back to file
Expand Down

0 comments on commit ac13a7c

Please sign in to comment.