Skip to content

Commit f767836

Browse files
author
Luc
committed
Fix MKS output on Marlin sowing 2 extruders even only one is enabled
1 parent cd7d308 commit f767836

File tree

6 files changed

+26
-31
lines changed

6 files changed

+26
-31
lines changed

dist/grbl/debug/index.html.gz

0 Bytes
Binary file not shown.

dist/grbl/production/index.html.gz

0 Bytes
Binary file not shown.

dist/printer/debug/index.html.gz

15 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

src/components/printer/temperatures.js

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -167,15 +167,9 @@ function processTemperatures(buffer) {
167167
parseFloat(buffer.heaters[index]) < 5
168168
)
169169
value = "error"
170-
else
171-
value = parseFloat(buffer.heaters[index])
172-
.toFixed(2)
173-
.toString()
170+
else value = parseFloat(buffer.heaters[index]).toFixed(2).toString()
174171
if (isNaN(parseFloat(buffer.active[index]))) value2 = "0.00"
175-
else
176-
value2 = parseFloat(buffer.active[index])
177-
.toFixed(2)
178-
.toString()
172+
else value2 = parseFloat(buffer.active[index]).toFixed(2).toString()
179173
//FIXME - TODO
180174
//how to detect chamber with M408?
181175
if (tool.startsWith("T") || tool.startsWith("B")) {
@@ -204,18 +198,12 @@ function processTemperatures(buffer) {
204198
var value2
205199
if (
206200
(isNaN(parseFloat(result[4])) || parseFloat(result[4]) < 5) &&
207-
result[4] != "0.0"
201+
parseInt(result[4]) != 0
208202
)
209203
value = "error"
210-
else
211-
value = parseFloat(result[4])
212-
.toFixed(2)
213-
.toString()
204+
else value = parseFloat(result[4]).toFixed(2).toString()
214205
if (isNaN(parseFloat(result[6]))) value2 = "0.00"
215-
else
216-
value2 = parseFloat(result[6])
217-
.toFixed(2)
218-
.toString()
206+
else value2 = parseFloat(result[6]).toFixed(2).toString()
219207
if (
220208
tool.startsWith("T") ||
221209
tool.startsWith("B") ||
@@ -251,9 +239,16 @@ function processTemperatures(buffer) {
251239
default:
252240
break
253241
}
242+
console.log(
243+
tool[0],
244+
" ",
245+
esp3dSettings.serialprotocol,
246+
" ",
247+
value
248+
)
254249
if (
255250
!(
256-
value == "0.00" &&
251+
parseInt(value) == 0 &&
257252
esp3dSettings.serialprotocol == "MKS"
258253
)
259254
)
@@ -263,7 +258,7 @@ function processTemperatures(buffer) {
263258
target: value2,
264259
})
265260
} else {
266-
console.log("no dispatch")
261+
console.log("no dispatch--------")
267262
}
268263
}
269264
}
@@ -516,25 +511,25 @@ const TemperatureSlider = ({ id, type, index }) => {
516511
typeof TC[index].target != "undefined" ? TC[index].target : "0.00"
517512
}
518513

519-
const onInputTemperatureSlider = e => {
514+
const onInputTemperatureSlider = (e) => {
520515
document.getElementById(id + "_input").value = e.target.value
521516
currentTemperature[type][index] = e.target.value
522517
updateState(e.target.value, id)
523518
}
524-
const onInputTemperatureInput = e => {
519+
const onInputTemperatureInput = (e) => {
525520
document.getElementById(id + "_slider").value = e.target.value
526521
currentTemperature[type][index] = e.target.value
527522
updateState(e.target.value, id)
528523
}
529-
const onSet = e => {
524+
const onSet = (e) => {
530525
setTemperature(currentTemperature[type][index], type, index)
531526
}
532527

533-
const onStop = e => {
528+
const onStop = (e) => {
534529
setTemperature(0, type, index)
535530
}
536531

537-
const onChange = e => {
532+
const onChange = (e) => {
538533
if (e.target.value.length > 0) {
539534
document.getElementById(id + "_input").value = e.target.value
540535
currentTemperature[type][index] = e.target.value
@@ -694,7 +689,7 @@ const TemperatureSlider = ({ id, type, index }) => {
694689
const TemperaturesGraphs = ({ visible }) => {
695690
const { TT, TB, TC, TList } = useStoreon("TT", "TB", "TC", "TList")
696691
if (!visible) return null
697-
const exportcharts = e => {
692+
const exportcharts = (e) => {
698693
let data, file
699694
let nb = 0
700695
const filename = "esp3dcharts.csv"
@@ -781,13 +776,13 @@ const TemperaturesGraphs = ({ visible }) => {
781776
a.download = filename
782777
document.body.appendChild(a)
783778
a.click()
784-
setTimeout(function() {
779+
setTimeout(function () {
785780
document.body.removeChild(a)
786781
window.URL.revokeObjectURL(url)
787782
}, 0)
788783
}
789784
}
790-
const clearcharts = e => {
785+
const clearcharts = (e) => {
791786
const { dispatch } = useStoreon()
792787
dispatch("temperatures/clear")
793788
fillCharts(true)
@@ -1110,18 +1105,18 @@ const TemperaturesPanel = () => {
11101105
if (!showTemperatures) {
11111106
return null
11121107
}
1113-
const onClose = e => {
1108+
const onClose = (e) => {
11141109
const { dispatch } = useStoreon()
11151110
dispatch("panel/showtemperatures", false)
11161111
}
1117-
const onToogleView = e => {
1112+
const onToogleView = (e) => {
11181113
graphsView = !graphsView
11191114
showDialog({ displayDialog: false, refreshPage: true })
11201115
}
11211116

11221117
let panelClass = "order-" + index + " w-100 panelCard"
11231118

1124-
const onStopAll = e => {
1119+
const onStopAll = (e) => {
11251120
if (typeof currentTemperature["extruder"] != "undefined") {
11261121
for (let i = 0; i < currentTemperature["extruder"].length; i++)
11271122
setTemperature(0, "extruder", i)

src/components/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
*/
2020
import { h } from "preact"
2121

22-
export const Esp3dVersion = () => <span>3.0.0.82</span>
22+
export const Esp3dVersion = () => <span>3.0.0.83</span>

0 commit comments

Comments
 (0)