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

Commit d18a801

Browse files
committed
Resolve issue with probe in CNC Dashboard
1 parent b6b9fdb commit d18a801

File tree

3 files changed

+27
-13
lines changed

3 files changed

+27
-13
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-CNC05",
3+
"version": "3.3.0-CNC06",
44
"pkgVersion": "3.3.0",
55
"repository": "github:chrishamm/DuetWebControl",
66
"homepage": "https://forum.duet3d.com/category/27/duet-web-control",

src/components/panels/CNCAxesPosition.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export default {
5757
computed: {
5858
...mapState('machine/model', {
5959
move: state => state.move,
60-
machineMode: state => state.state.machineMode,
6160
status: state => state.state.status,
6261
}),
6362
visibleAxes() {

src/components/panels/CNCContainerPanel.vue

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<v-col class="category-header" tag="strong">{{ $t('panel.status.sensors') }}</v-col>
4343
</v-card-title>
4444
<v-card-text>
45-
<v-row align-content="top" class="flex-nowrap" no-gutters>
45+
<v-row class="flex-nowrap" no-gutters>
4646
<v-col>
4747
<v-row align-content="center" justify="center" no-gutters>
4848
<v-col class="d-flex flex-column align-center" v-if="boards.length && boards[0].vIn.current > 0">
@@ -97,18 +97,17 @@
9797
</v-row>
9898
</v-card-text>
9999
</v-card>
100-
</v-col>
100+
</v-col>
101101
<v-col cols="12" order="7">
102102
<cnc-axes-position :machinePosition="false" class="fill-height"></cnc-axes-position>
103103
</v-col>
104-
105104
</v-row>
106105
</div>
107106
</template>
108107

109108
<script>
110109
import {mapState} from 'vuex';
111-
import {ProbeType} from '../../store/machine/modelEnums.js';
110+
import {ProbeType, isPrinting} from '../../store/machine/modelEnums.js';
112111
export default {
113112
computed: {
114113
...mapState('machine/model', {
@@ -140,20 +139,36 @@ export default {
140139
return this.sensors.probes.filter((probe) => probe !== null && probe.type !== ProbeType.none);
141140
},
142141
sensorsPresent() {
143-
return (
144-
(this.boards.length && this.boards[0].vIn.current > 0) ||
145-
(this.boards.length && this.boards[0].v12.current > 0) ||
146-
(this.boards.length && this.boards[0].mcuTemp.current > -273) ||
147-
this.fanRPM.length !== 0 ||
148-
this.probesPresent
149-
);
142+
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;
150143
},
151144
},
152145
methods: {
153146
displayAxisPosition(axis) {
154147
const position = this.displayToolPosition ? axis.userPosition : axis.machinePosition;
155148
return axis.letter === 'Z' ? this.$displayZ(position, false) : this.$display(position, 1);
156149
},
150+
formatProbeValue(values) {
151+
if (values.length === 1) {
152+
return values[0];
153+
}
154+
return `${values[0]} (${values.slice(1).join(', ')})`;
155+
},
156+
probeSpanClasses(probe, index) {
157+
let result = [];
158+
if (index && this.sensors.probes.length > 1) {
159+
result.push('ml-2');
160+
}
161+
if (!isPrinting(this.stats) && probe.value !== null) {
162+
if (probe.value >= probe.threshold) {
163+
result.push('red');
164+
result.push(this.darkTheme ? 'darken-3' : 'lighten-4');
165+
} else if (probe.value > probe.threshold * 0.9) {
166+
result.push('orange');
167+
result.push(this.darkTheme ? 'darken-2' : 'lighten-4');
168+
}
169+
}
170+
return result;
171+
},
157172
},
158173
};
159174
</script>

0 commit comments

Comments
 (0)