Skip to content
This repository was archived by the owner on Jan 16, 2022. It is now read-only.

Commit 08143bc

Browse files
committed
Change go to zero
Go to zero button on movement panel will now call systemdir/workzero.g Dashboard will includes analog sensors and will show the last reported value.
1 parent d18a801 commit 08143bc

File tree

4 files changed

+25
-11
lines changed

4 files changed

+25
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "duetwebcontrol",
3-
"version": "3.3.0-CNC06",
3+
"version": "3.3.0-CNC07",
44
"pkgVersion": "3.3.0",
55
"repository": "github:chrishamm/DuetWebControl",
66
"homepage": "https://forum.duet3d.com/category/27/duet-web-control",

src/components/panels/CNCContainerPanel.vue

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@
9292
<span :class="probeSpanClasses(probe, index)" :key="index" class="pa-1 probe-span" v-for="(probe, index) in probes">{{ formatProbeValue(probe.value) }}</span>
9393
</div>
9494
</v-col>
95+
96+
<v-col class="d-flex flex-column align-center" v-for="(analog, index) in analogs" :key="index" >
97+
<strong>{{analog.name}}</strong>
98+
<div class="d-flex-inline">
99+
<span class="pa-1 probe-span" >{{ analog.lastReading }}</span>
100+
</div>
101+
</v-col>
102+
95103
</v-row>
96104
</v-col>
97105
</v-row>
@@ -107,7 +115,7 @@
107115

108116
<script>
109117
import {mapState} from 'vuex';
110-
import {ProbeType, isPrinting} from '../../store/machine/modelEnums.js';
118+
import {ProbeType, isPrinting, AnalogSensorType} from '../../store/machine/modelEnums.js';
111119
export default {
112120
computed: {
113121
...mapState('machine/model', {
@@ -141,6 +149,12 @@ export default {
141149
sensorsPresent() {
142150
return (this.boards.length && this.boards[0].vIn.current > 0) || (this.boards.length && this.boards[0].v12.current > 0) || (this.boards.length && this.boards[0].mcuTemp.current > -273) || this.fanRPM.length !== 0 || this.probesPresent;
143151
},
152+
analogsPresent() {
153+
return this.sensors.analog.some((analog) => analog && analog.type !== AnalogSensorType.unknown && analog.type !== null);
154+
},
155+
analogs() {
156+
return this.sensors.analog.filter((analog) => analog !== null && analog.name !== null && analog.name !== '' && analog.type !== AnalogSensorType.unknown && analog.type !== null);
157+
},
144158
},
145159
methods: {
146160
displayAxisPosition(axis) {

src/components/panels/CNCMovementPanel.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,15 @@
3636

3737
<v-card>
3838
<v-list>
39-
<template v-show="move.compensation">
39+
<div v-show="move.compensation">
4040
<v-list-item>
4141
<v-spacer></v-spacer>
4242
{{ $t('panel.movement.compensationInUse', [move.compensation.type]) }}
4343
<v-spacer></v-spacer>
4444
</v-list-item>
4545

4646
<v-divider></v-divider>
47-
</template>
47+
</div>
4848

4949
<v-list-item @click="sendCode('G32')">
5050
<v-icon class="mr-1">mdi-format-vertical-align-center</v-icon>
@@ -129,7 +129,7 @@
129129

130130
<v-row dense>
131131
<v-col>
132-
<v-btn color="warning" @click="gotoWorkspaceZero" tile block class="move-btn">GOTO Work XYZ Zero</v-btn>
132+
<v-btn color="warning" @click="gotoWorkspaceZero" tile block class="move-btn">{{$t('panel.movement.workzero')}}</v-btn>
133133
</v-col>
134134
</v-row>
135135
</v-card-text>
@@ -156,13 +156,15 @@
156156
157157
import { mapState, mapGetters, mapActions, mapMutations } from 'vuex';
158158
import { KinematicsName } from '../../store/machine/modelEnums.js';
159+
import { combine } from '../../utils/path'
159160
160161
export default {
161162
computed: {
162163
...mapGetters(['isConnected', 'uiFrozen']),
163164
...mapState('machine/model', {
164165
move: state => state.move,
165166
workspaceNumber: state => state.move.workplaceNumber,
167+
systemDir : state => state.directories.system
166168
}),
167169
...mapState('machine/settings', ['moveFeedrate']),
168170
...mapGetters('machine/settings', ['moveSteps', 'numMoveSteps']),
@@ -226,10 +228,8 @@ export default {
226228
await this.sendCode(`G10 L20 P${this.currentWorkspace}`);
227229
},
228230
async gotoWorkspaceZero() {
229-
let code = `G0`;
230-
this.visibleAxes.forEach(axis => (code += ` ${axis.letter}0 F${this.moveFeedrate}`));
231-
console.log(code);
232-
await this.sendCode(code);
231+
var gotoZeroPath = combine(this.systemDir, 'workzero.g');
232+
await this.sendCode({code : `M98 P"${gotoZeroPath}"`});
233233
},
234234
async updateWorkspaceCoordinate() {
235235
let code;
@@ -255,7 +255,6 @@ export default {
255255
this.moveStepDialog.shown = false;
256256
},
257257
workspaceNumber: function (to) {
258-
console.log(`workplace number change ${to}`);
259258
this.currentWorkspace = to + 1;
260259
},
261260
},

src/i18n/en.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ export default {
642642
runMesh: 'Run Mesh Compensation (G29)',
643643
loadMesh: 'Load Saved Height Map from SD Card (G29 S1)',
644644
axesNotHomed: 'The following axis is not homed:|The following axes are not homed:',
645-
noAxes: 'No Axes'
645+
noAxes: 'No Axes',
646+
workzero: 'Go To Zero'
646647
},
647648
settingsAbout: {
648649
caption: 'About',

0 commit comments

Comments
 (0)