Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DWEL pause support for marlin firmware #587

Open
wants to merge 1 commit into
base: dev-es6
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/components/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ class Settings extends React.Component {
<TextField {...{ object: this.props.settings, field: 'gcodeEnd', setAttrs: setSettingsAttrs, description: 'Gcode End', rows: 5, style: { resize: "vertical" } }} />
<TextField {...{ object: this.props.settings, field: 'gcodeHoming', setAttrs: setSettingsAttrs, description: 'Gcode Homing', rows: 5, style: { resize: "vertical" } }} />
<TextField {...{ object: this.props.settings, field: 'gcodeToolOn', setAttrs: setSettingsAttrs, description: 'Tool ON', rows: 5, style: { resize: "vertical" } }} />
<TextField {...{ object: this.props.settings, field: 'gcodeToolPause', setAttrs: setSettingsAttrs, description: 'Tool Pause(Dwell)', rows: 5, style: { resize: "vertical" } }} />
<TextField {...{ object: this.props.settings, field: 'gcodeToolOff', setAttrs: setSettingsAttrs, description: 'Tool OFF', rows: 5, style: { resize: "vertical" } }} />
<TextField {...{ object: this.props.settings, field: 'gcodeLaserIntensity', setAttrs: setSettingsAttrs, description: 'Laser Intensity', style: { resize: "vertical" } }} />
<ToggleField {... { object: this.props.settings, field: 'gcodeLaserIntensitySeparateLine', setAttrs: setSettingsAttrs, description: 'Intensity Separate Line' }} />
Expand All @@ -283,7 +284,7 @@ class Settings extends React.Component {
<NumberField {...{ object: this.props.settings, field: 'gcodeCurvePrecision', setAttrs: setSettingsAttrs, description: 'Gcode Curve Linearization factor', units: '', info: Info(<p className="help-block">
Enter from 0.1 (Ultra High Precision - Slow) to 2.0 (Low Precision - Fast) to achieve different levels of curve to gcode performance
</p>,"Gcode Linearization Factor")} } />

</SettingsPanel>
<SettingsPanel collapsible header="Application" eventKey="4" bsStyle="info" errors={this.state.errors}>
<h5 className="header">Grid</h5>
Expand All @@ -294,17 +295,17 @@ class Settings extends React.Component {
<NumberField {...{ object: this.props.settings, field: 'toolGridMajorSpacing', setAttrs: setSettingsAttrs, description: 'Grid Major Spacing', units: 'mm' }} />
<hr/>
<SelectField {...{ object: this.props.settings, field: 'toolFeedUnits', setAttrs: setSettingsAttrs, data: ['mm/s', 'mm/min'], defaultValue: 'mm/min', description: 'Feed Units', selectProps: { clearable: false } }} />
<hr/>
<hr/>
<ToggleField {... { object: this.props.settings, field: 'toolUseNumpad', setAttrs: setSettingsAttrs, description: 'Use Numpad', info: Info(<p className="help-block">
X <Label>4</Label> <Label>6</Label><br/>
Y <Label>2</Label> <Label>8</Label><br/>
Z <Label>+</Label> <Label>-</Label><br/>
A <Label>*</Label> <Label>/</Label>
</p>,"Jog using Numpad")}} />

<ToggleField {... { object: this.props.settings, field: 'toolUseGamepad', setAttrs: setSettingsAttrs, description: 'Use Gamepad',info: Info(<p className="help-block">Gamepad for jogging. Use analog left stick (XY) or right stick (Z) to move on Jog tab.</p>) }} />
<ToggleField {... { object: this.props.settings, field: 'toolCreateEmptyOps', setAttrs: setSettingsAttrs, description: 'Create Empty Operations' }} />

<QuadrantField {... { object: this.props.settings, field: 'toolImagePosition', setAttrs: setSettingsAttrs, description: 'Raster Image Position' }} />
<hr/>
<p className="help-block">Enable Display cache. Disable animations.</p>
Expand Down Expand Up @@ -335,7 +336,7 @@ class Settings extends React.Component {
</div>
</Collapse>


</Panel>

<Panel collapsible header="Macros" bsStyle="info" eventKey="7">
Expand Down
2 changes: 2 additions & 0 deletions src/lib/action2gcode/generators/default-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class DefaultGenerator extends AbstractGenerator{

if(params.hasOwnProperty("i"))
gcode = gcode.split("$INTENSITY").join(params.i);
if(this.settings.gcodeToolPause)
gcode += `${this.settings.gcodeToolPause}\r\n`;
return gcode;
}

Expand Down
2 changes: 2 additions & 0 deletions src/lib/action2gcode/generators/marlin-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class MarlinGenerator extends AbstractGenerator{
gcode += `${this.settings.gcodeToolOn} ${params.i}\r\n`;
}
}
if(this.settings.gcodeToolPause && this.settings.gcodeToolPause.length > 0 && (params.hasOwnProperty("i") || params.hasOwnProperty("s")))
gcode += `${this.settings.gcodeToolPause}\r\n`;

gcode += prefix;

Expand Down
5 changes: 3 additions & 2 deletions src/lib/cam-gcode-laser-cut.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

Expand Down Expand Up @@ -266,6 +266,7 @@ export function getLaserCutGcodeFromOp(settings, opIndex, op, geometry, openGeom
aAxisDiameter: op.aAxisDiameter,
tabGeometry: tabGeometry,
gcodeToolOn: settings.gcodeToolOn,
gcodeToolPause: settings.gcodeToolPause,
gcodeToolOff: settings.gcodeToolOff,
gcodeLaserIntensity: settings.gcodeLaserIntensity,
gcodeLaserIntensitySeparateLine: settings.gcodeLaserIntensitySeparateLine,
Expand Down
1 change: 1 addition & 0 deletions src/lib/cam-gcode-raster.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ export function getLaserRasterGcodeFromOp(settings, opIndex, op, docsWithImages,
overscan: op.overScan,
gcodeGenerator : settings.gcodeGenerator,
gcodeToolOn : settings.gcodeToolOn,
gcodeToolPause: settings.gcodeToolPause,
gcodeToolOff : settings.gcodeToolOff,
gcodeLaserIntensity: settings.gcodeLaserIntensity,
nonBlocking: false,
Expand Down
7 changes: 4 additions & 3 deletions src/reducers/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const SETTINGS_INITIALSTATE = {
A: {min: 1, max:50000},
S: {min: 0, max:30000},
},

machineXYProbeOffset: 0,

machineZEnabled: false,
Expand All @@ -88,7 +88,7 @@ export const SETTINGS_INITIALSTATE = {
pxPerInch: 96,
forcePxPerInch: false,
dpiBitmap: 300,


toolGridWidth: 500,
toolGridHeight: 500,
Expand All @@ -107,7 +107,7 @@ export const SETTINGS_INITIALSTATE = {
toolVideoLens: { a: 1, b: 1, F: 1, scale: 1 },
toolVideoFov: { x: 1, y: 1 },
toolVideoResolution: "720p(HD)",

toolVideoOMR: false,
toolVideoOMROffsetX: 0,
toolVideoOMROffsetY: 0,
Expand All @@ -123,6 +123,7 @@ export const SETTINGS_INITIALSTATE = {
gcodeHoming: "",
gcodeGenerator: "default",
gcodeToolOn: "",
gcodeToolPause: "",
gcodeToolOff: "",
gcodeLaserIntensity: 'S',
gcodeLaserIntensitySeparateLine: false,
Expand Down