Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
kglovern committed Jan 8, 2024
2 parents 45a263b + 3de3ee4 commit 6ddc0fe
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ import styles from '../index.styl';

const AtAGlance = ({ homing, softLimits, homingLocation, reportInches, stepperMotors }) => {
const handleStepperMotorToggle = (value) => {
if (!controller.settings?.settings) {
return;
}

if (value) {
store.replace('workspace.diagnostics.stepperMotor.storedValue', controller.settings.settings.$1);
controller.command('gcode', ['$1=255', '$$']);
Expand Down
21 changes: 12 additions & 9 deletions src/app/lib/GCodeVirtualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,16 +865,19 @@ class GCodeVirtualizer extends EventEmitter {
this.fn = { addLine, addArcCurve, addCurve, callback };
this.collate = collate;

const { xAccel, yAccel, zAccel } = accelerations;
this.xAccel = xAccel;
this.yAccel = yAccel;
this.zAccel = zAccel;

const { xMaxFeed, yMaxFeed, zMaxFeed } = maxFeedrates;
this.xMaxFeed = xMaxFeed;
this.yMaxFeed = yMaxFeed;
this.zMaxFeed = zMaxFeed;
if (accelerations) {
const { xAccel, yAccel, zAccel } = accelerations;
this.xAccel = xAccel;
this.yAccel = yAccel;
this.zAccel = zAccel;
}

if (maxFeedrates) {
const { xMaxFeed, yMaxFeed, zMaxFeed } = maxFeedrates;
this.xMaxFeed = xMaxFeed;
this.yMaxFeed = yMaxFeed;
this.zMaxFeed = zMaxFeed;
}

if (this.collate) {
this.vmState.feedrates = new Set();
Expand Down
8 changes: 3 additions & 5 deletions src/app/lib/diagnostics.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ function generateSupportFile() {
api.alarmList.fetch().then(data => {
const grblAlarmsAndErrors = get(data, 'body.list', []);
[alarms, errors] = partition(grblAlarmsAndErrors, ['type', 'ALARM']);
console.log(alarms);
console.log(errors);
});

let eepromData = [];
Expand Down Expand Up @@ -322,15 +320,15 @@ function generateSupportFile() {
<Text style={styles.textItalic}>
{'    X Max: '}
<Text style={styles.text}>
{machineProfile.limits.xmax + '\n'}
{get(machineProfile, 'limits.xmax', '0') + '\n'}
</Text>
{'    Y Max: '}
<Text style={styles.text}>
{machineProfile.limits.ymax + '\n'}
{get(machineProfile, 'limits.ymax', '0') + '\n'}
</Text>
{'    Z Max: '}
<Text style={styles.text}>
{machineProfile.limits.zmax + '\n'}
{get(machineProfile, 'limits.zmax', '0') + '\n'}
</Text>
</Text>
</Text>
Expand Down
4 changes: 4 additions & 0 deletions src/app/widgets/Console/Terminal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ class TerminalWrapper extends PureComponent {
}

writeln(data) {
if (!this.term) {
return;
}

this.term.write('\r');
if (data.includes('error:')) {
this.term.write(color.xterm(RED)(data));
Expand Down
3 changes: 2 additions & 1 deletion src/app/widgets/Probe/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ class ProbeWidget extends PureComponent {

getInitialState() {
const units = store.get('workspace.units');
const defaultToolDiameter = units === METRIC_UNITS ? 6.35 : 0.25;
const availableTools = store.get('workspace.tools', []);

const touchplateType = store.get('workspace.probeProfile.touchplateType');
Expand All @@ -391,7 +392,7 @@ class ProbeWidget extends PureComponent {
if (touchplateType === TOUCHPLATE_TYPE_AUTOZERO) {
toolDiameter = PROBE_TYPE_AUTO;
} else {
toolDiameter = availableTools[0][units === METRIC_UNITS ? 'metricDiameter' : 'imperialDiameter'];
toolDiameter = availableTools.length === 0 ? defaultToolDiameter : availableTools[0][units === METRIC_UNITS ? 'metricDiameter' : 'imperialDiameter'];
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/server/controllers/Grbl/GrblController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ class GrblController {
const delay = _.get(preferences, 'spindle.delay', false);

if (delay) {
gcode = gcode.replace(/(S[0-9]* M[3-4])|(M[3-4] S[0-9]*)/g, '$& G4 P1');
gcode = gcode.replace(/\b(?:S\d* ?M[34]|M[34] ?S\d*)\b(?! ?G4 ?P?\b)/g, '$& G4 P1');
}

const gcodeWithoutComments = gcode.replace(bracketCommentLine, '');
Expand Down
2 changes: 1 addition & 1 deletion src/server/controllers/Grbl/GrblLineParserResultStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class GrblLineParserResultStatus {
// - Door:1 Machine stopped. Door still ajar. Can't resume until closed.
// - Door:2 Door opened. Hold (or parking retract) in-progress. Reset will throw an alarm.
// - Door:3 Door closed and resuming. Restoring from park, if applicable. Reset will throw an alarm.
const states = (params.shift() || '').split(':');
const states = (params?.shift() || '').split(':');
payload.activeState = states[0] || '';
payload.subState = Number(states[1] || '');
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/controllers/Grblhal/GrblHalController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ class GrblHalController {
const delay = _.get(preferences, 'spindle.delay', false);

if (delay) {
gcode = gcode.replace(/(S[0-9]* M[3-4])|(M[3-4] S[0-9]*)/g, '$& G4 P1');
gcode = gcode.replace(/\b(?:S\d* ?M[34]|M[34] ?S\d*)\b(?! ?G4 ?P?\b)/g, '$& G4 P1');
}

const ok = this.sender.load(name, gcode + '\n', context);
Expand Down

0 comments on commit 6ddc0fe

Please sign in to comment.