Skip to content

Commit

Permalink
Merge pull request #77 from makermadecnc/1.1.4-prerelease
Browse files Browse the repository at this point in the history
updated tooltips and axis dropdowns
  • Loading branch information
skilescm committed Aug 2, 2021
2 parents 0d6034d + 52f7ce9 commit f34bc13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
19 changes: 9 additions & 10 deletions src/app/widgets/Axes/DisplayPanel.jsx
@@ -1,7 +1,7 @@
import chainedFunction from 'chained-function';
import ensureArray from 'ensure-array';
import includes from 'lodash/includes';
import noop from 'lodash/noop';
//import noop from 'lodash/noop';
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
import Dropdown, { MenuItem } from 'app/components/Dropdown';
Expand Down Expand Up @@ -1015,7 +1015,7 @@ class DisplayPanel extends PureComponent {
renderAxis = (axis) => {
const { canClick, units, machinePosition, workPosition, jog } = this.props;
const { actions } = this.props;
const wcs = actions.getWorkCoordinateSystem();
//const wcs = actions.getWorkCoordinateSystem();
const lengthUnits = (units === METRIC_UNITS) ? i18n._('mm') : i18n._('in');
const degreeUnits = i18n._('deg');
const axisSettings = this.workspace.axes[axis];
Expand All @@ -1033,15 +1033,15 @@ class DisplayPanel extends PureComponent {
[AXIS_B]: degreeUnits,
[AXIS_C]: degreeUnits
}[axis] || '';
const renderActionDropdown = {
/*const renderActionDropdown = {
[AXIS_E]: this.renderActionDropdownForAxisE,
[AXIS_X]: this.renderActionDropdownForAxisX,
[AXIS_Y]: this.renderActionDropdownForAxisY,
[AXIS_Z]: this.renderActionDropdownForAxisZ,
[AXIS_A]: this.renderActionDropdownForAxisA,
[AXIS_B]: this.renderActionDropdownForAxisB,
[AXIS_C]: this.renderActionDropdownForAxisC
}[axis] || noop;
}[axis] || noop;*/
//const canZeroOutMachine = canClick;
//const canHomeMachine = canClick;
//const canMoveBackward = canClick;
Expand Down Expand Up @@ -1146,24 +1146,23 @@ class DisplayPanel extends PureComponent {
</div>
</Taskbar>*/}
</td>
<td className={styles.action}>
{/*<td className={styles.action}>
{renderActionDropdown({ wcs })}
</td>
</td>*/}
</tr>
);
};

render() {
const { axes, machinePosition, workPosition } = this.props;
const wcs = this.props.actions.getWorkCoordinateSystem();
//const wcs = this.props.actions.getWorkCoordinateSystem();
const hasAxisE = (machinePosition.e !== undefined && workPosition.e !== undefined);
const hasAxisX = includes(axes, AXIS_X);
const hasAxisY = includes(axes, AXIS_Y);
const hasAxisZ = includes(axes, AXIS_Z);
const hasAxisA = includes(axes, AXIS_A);
const hasAxisB = includes(axes, AXIS_B);
const hasAxisC = includes(axes, AXIS_C);
console.log(workPosition, 'work position value');

return (
<Panel className={styles.displayPanel}>
Expand All @@ -1173,9 +1172,9 @@ class DisplayPanel extends PureComponent {
<th style={{ textAlign: 'center' }} title={i18n._('Axis')}>{i18n._('Axis')}</th>
<th style={{ textAlign: 'center' }} title={i18n._('Machine Position')}>{i18n._('Machine Position')}</th>
<th style={{ textAlign: 'center' }} title={i18n._('Work Position')}>{i18n._('Work Position')}</th>
<th className={styles.action}>
{/*<th className={styles.action}>
{this.renderActionDropdown({ wcs })}
</th>
</th>*/}
</tr>
</thead>
<tbody>
Expand Down
8 changes: 4 additions & 4 deletions src/app/widgets/Axes/Keypad.jsx
Expand Up @@ -586,7 +586,7 @@ class Keypad extends PureComponent {
this.handleSelect('G92 Z0');
}}
disabled={!canClickXY}
title={i18n._('Set Z-axis Zero')}
title={i18n._('Sets current position of the z-axis to zero, so project commands will be relative to that point.')}
>
<KeypadText>Set Z-axis Zero</KeypadText>
</Button>
Expand All @@ -599,7 +599,7 @@ class Keypad extends PureComponent {
this.handleSelect('G92 X0 Y0');
}}
disabled={!canClickXY}
title={i18n._('Set Work Home')}
title={i18n._('Sets the current position to temporary XY zero so that project commands will be relative to this position.')}
>
<KeypadText>Set Work Home</KeypadText>
</Button>
Expand All @@ -612,7 +612,7 @@ class Keypad extends PureComponent {
this.handleSelect('G92.1');
}}
disabled={!canClickXY}
title={i18n._('Clear Work Home')}
title={i18n._('Clears any existing Work Home and all commands are relative to Machine Home again.')}
>
<KeypadText>Clear Work Home</KeypadText>
</Button>
Expand All @@ -625,7 +625,7 @@ class Keypad extends PureComponent {
this.handleSelect('G53 G0 X0 Y0');
}}
disabled={!canClickXY}
title={i18n._('Go To Machine Home')}
title={i18n._('Sends the sled back to the Home position that was set during calibration.')}
>
<KeypadText>Go To Machine Home</KeypadText>
</Button>
Expand Down

0 comments on commit f34bc13

Please sign in to comment.