|
42 | 42 | <v-col class="category-header" tag="strong">{{ $t('panel.status.sensors') }}</v-col> |
43 | 43 | </v-card-title> |
44 | 44 | <v-card-text> |
45 | | - <v-row align-content="top" class="flex-nowrap" no-gutters> |
| 45 | + <v-row class="flex-nowrap" no-gutters> |
46 | 46 | <v-col> |
47 | 47 | <v-row align-content="center" justify="center" no-gutters> |
48 | 48 | <v-col class="d-flex flex-column align-center" v-if="boards.length && boards[0].vIn.current > 0"> |
|
97 | 97 | </v-row> |
98 | 98 | </v-card-text> |
99 | 99 | </v-card> |
100 | | - </v-col> |
| 100 | + </v-col> |
101 | 101 | <v-col cols="12" order="7"> |
102 | 102 | <cnc-axes-position :machinePosition="false" class="fill-height"></cnc-axes-position> |
103 | 103 | </v-col> |
104 | | - |
105 | 104 | </v-row> |
106 | 105 | </div> |
107 | 106 | </template> |
108 | 107 |
|
109 | 108 | <script> |
110 | 109 | import {mapState} from 'vuex'; |
111 | | -import {ProbeType} from '../../store/machine/modelEnums.js'; |
| 110 | +import {ProbeType, isPrinting} from '../../store/machine/modelEnums.js'; |
112 | 111 | export default { |
113 | 112 | computed: { |
114 | 113 | ...mapState('machine/model', { |
@@ -140,20 +139,36 @@ export default { |
140 | 139 | return this.sensors.probes.filter((probe) => probe !== null && probe.type !== ProbeType.none); |
141 | 140 | }, |
142 | 141 | 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; |
150 | 143 | }, |
151 | 144 | }, |
152 | 145 | methods: { |
153 | 146 | displayAxisPosition(axis) { |
154 | 147 | const position = this.displayToolPosition ? axis.userPosition : axis.machinePosition; |
155 | 148 | return axis.letter === 'Z' ? this.$displayZ(position, false) : this.$display(position, 1); |
156 | 149 | }, |
| 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 | + }, |
157 | 172 | }, |
158 | 173 | }; |
159 | 174 | </script> |
0 commit comments