Fix sensor not displayed since reporting is in stream instead of core

This commit is contained in:
Luc
2024-12-17 16:33:21 +08:00
parent f9dbf5caef
commit 8858149474
13 changed files with 31 additions and 3 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -17,7 +17,7 @@
*/
import { h } from "preact"
import { webUIbuild } from "../../targets"
export const webUIversion = "3.0.0-a83"
export const webUIversion = "3.0.0-a84"
export const Esp3dVersion = () => (
<span>
{webUIversion}.{webUIbuild}

View File

@@ -293,7 +293,7 @@ const ExtraInputControl = ({ element, index, size, pos }) => {
}
const ExtraControlsPanel = () => {
const { temperatures, fanSpeed, flowRate, feedRate } = useTargetContext()
const { temperatures, fanSpeed, flowRate, feedRate, sensor } = useTargetContext()
const id = "extraControlsPanel"
const inputList = [
{ name: "P91", list: fanSpeed },
@@ -346,7 +346,7 @@ const ExtraControlsPanel = () => {
})}
</div>
)}
{temperatures["T"].length == 0 && (
{temperatures["T"].length == 0 && (!sensor.S || sensor.S.length == 0) && (
<div class="loading-panel">
<div class="m-2">
<div class="m-1">{T("P89")}</div>

View File

@@ -226,6 +226,13 @@ const TargetContextProvider = ({ children }) => {
value: cap.value,
})
})
} else if (isSensor(data)) {
const result = getSensor(data)
setSensorData({ S: result })
add2SensorDataList({
temperatures: { S: result },
time: new Date(),
})
}
} else if (type === "core") {
if (isSensor(data)) {

View File

@@ -237,6 +237,13 @@ const TargetContextProvider = ({ children }) => {
value: cap.value,
})
})
} else if (isSensor(data)) {
const result = getSensor(data)
setSensorData({ S: result })
add2SensorDataList({
temperatures: { S: result },
time: new Date(),
})
}
} else if (type === "core") {
if (isSensor(data)) {

View File

@@ -195,6 +195,13 @@ const TargetContextProvider = ({ children }) => {
value: cap.value,
})
})
} else if (isSensor(data)) {
const result = getSensor(data)
setSensorData({ S: result })
add2SensorDataList({
temperatures: { S: result },
time: new Date(),
})
}
} else if (type === "core") {
if (isSensor(data)) {

View File

@@ -191,6 +191,13 @@ const TargetContextProvider = ({ children }) => {
})
})
//console.log(printerCapabilities)
} else if (isSensor(data)) {
const result = getSensor(data)
setSensorData({ S: result })
add2SensorDataList({
temperatures: { S: result },
time: new Date(),
})
}
} else if (type === "core") {
if (isSensor(data)) {