mirror of
https://github.com/luc-github/ESP3D-WEBUI.git
synced 2026-02-20 01:11:21 +01:00
Add Ok parsing to speedup response processing from @ jamespearson04 suggestion
This commit is contained in:
BIN
dist/CNC/GRBL/index.html.gz
vendored
BIN
dist/CNC/GRBL/index.html.gz
vendored
Binary file not shown.
BIN
dist/CNC/GRBLHal/index.html.gz
vendored
BIN
dist/CNC/GRBLHal/index.html.gz
vendored
Binary file not shown.
BIN
dist/Plotter/HP-GL/index.html.gz
vendored
BIN
dist/Plotter/HP-GL/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Marlin-embedded/index.html.gz
vendored
BIN
dist/Printer3D/Marlin-embedded/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Marlin/index.html.gz
vendored
BIN
dist/Printer3D/Marlin/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Repetier/index.html.gz
vendored
BIN
dist/Printer3D/Repetier/index.html.gz
vendored
Binary file not shown.
BIN
dist/Printer3D/Smoothieware/index.html.gz
vendored
BIN
dist/Printer3D/Smoothieware/index.html.gz
vendored
Binary file not shown.
BIN
dist/SandTable/GRBL/index.html.gz
vendored
BIN
dist/SandTable/GRBL/index.html.gz
vendored
Binary file not shown.
805
package-lock.json
generated
805
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -28,6 +28,7 @@ import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import { eventsList, variablesList } from "."
|
||||
import {
|
||||
isOk,
|
||||
isStatus,
|
||||
getStatus,
|
||||
isStates,
|
||||
@@ -97,8 +98,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
//sensors
|
||||
//status
|
||||
if (type === "stream") {
|
||||
//status
|
||||
if (isStatus(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isStatus(data)) {//status
|
||||
const response = getStatus(data)
|
||||
//For Pn we need to keep the last value to keep trace the pin is detected or not,
|
||||
//so we can display the pin icon when disabled even no data is received
|
||||
|
||||
@@ -26,6 +26,15 @@ import { gcode_parser_modes } from "./gcode_parser_modes"
|
||||
let wpos = []
|
||||
let mpos = []
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str=="ok") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// Status format is : <...>
|
||||
@@ -380,6 +389,7 @@ const getStreamingStatus = (str) => {
|
||||
return { status: res.data }
|
||||
}
|
||||
export {
|
||||
isOk,
|
||||
isStatus,
|
||||
getStatus,
|
||||
isStates,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import { eventsList, variablesList } from "."
|
||||
import {
|
||||
isOk,
|
||||
isStatus,
|
||||
getStatus,
|
||||
isStates,
|
||||
@@ -114,8 +115,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
}
|
||||
}
|
||||
if (type === "stream") {
|
||||
//status
|
||||
if (isStatus(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isStatus(data)) {//status
|
||||
const response = getStatus(data)
|
||||
//For Pn we need to keep the last value to keep trace the pin is detected or not,
|
||||
//so we can display the pin icon when disabled even no data is received
|
||||
|
||||
@@ -26,6 +26,16 @@ import { gcode_parser_modes } from "./gcode_parser_modes"
|
||||
let wpos = []
|
||||
let mpos = []
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str=="ok") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// Status format is : <...>
|
||||
@@ -395,6 +405,7 @@ const getStreamingStatus = (str) => {
|
||||
return { status: res.data }
|
||||
}
|
||||
export {
|
||||
isOk,
|
||||
isStatus,
|
||||
getStatus,
|
||||
isStates,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useDatasContext } from "../../../contexts"
|
||||
import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
@@ -169,7 +170,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
//sensors
|
||||
|
||||
if (type === "stream") {
|
||||
if (isTemperatures(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isTemperatures(data)) {
|
||||
const t = getTemperatures(data)
|
||||
setTemperatures(t)
|
||||
add2TemperaturesList({ temperatures: t, time: new Date() })
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
import { h } from "preact"
|
||||
import { useSettingsContextFn } from "../../../contexts"
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str.startsWith("ok") && !str.startsWith("ok T:")) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
//Temperatures
|
||||
@@ -300,6 +310,7 @@ const getSensor = (str) => {
|
||||
}
|
||||
|
||||
export {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useDatasContext } from "../../../contexts"
|
||||
import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
@@ -171,7 +172,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
//sensors
|
||||
|
||||
if (type === "stream") {
|
||||
if (isTemperatures(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isTemperatures(data)) {
|
||||
const t = getTemperatures(data)
|
||||
setTemperatures(t)
|
||||
add2TemperaturesList({ temperatures: t, time: new Date() })
|
||||
|
||||
@@ -20,6 +20,18 @@
|
||||
import { h } from "preact"
|
||||
import { useSettingsContextFn } from "../../../contexts"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str.startsWith("ok") && !str.startsWith("ok T:")) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
//Temperatures
|
||||
@@ -337,6 +349,7 @@ const getSensor = (str) => {
|
||||
}
|
||||
|
||||
export {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useDatasContext } from "../../../contexts"
|
||||
import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
@@ -152,7 +153,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
const dispatchInternally = (type, data) => {
|
||||
processor.handle(type, data)
|
||||
if (type === "stream") {
|
||||
if (isTemperatures(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isTemperatures(data)) {
|
||||
const t = getTemperatures(data)
|
||||
setTemperatures(t)
|
||||
add2TemperaturesList({ temperatures: t, time: new Date() })
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
import { h } from "preact"
|
||||
import { useSettingsContextFn } from "../../../contexts"
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str.startsWith("ok")) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
//Temperatures
|
||||
@@ -335,6 +345,7 @@ const getSensor = (str) => {
|
||||
}
|
||||
|
||||
export {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { useDatasContext } from "../../../contexts"
|
||||
import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
@@ -153,7 +154,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
//sensors
|
||||
|
||||
if (type === "stream") {
|
||||
if (isTemperatures(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isTemperatures(data)) {
|
||||
const t = getTemperatures(data)
|
||||
setTemperatures(t)
|
||||
add2TemperaturesList({ temperatures: t, time: new Date() })
|
||||
|
||||
@@ -20,6 +20,16 @@
|
||||
import { h } from "preact"
|
||||
import { useSettingsContextFn } from "../../../contexts"
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str.startsWith("ok")) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
//Temperatures
|
||||
@@ -268,6 +278,7 @@ const getSensor = (str) => {
|
||||
}
|
||||
|
||||
export {
|
||||
isOk,
|
||||
isTemperatures,
|
||||
getTemperatures,
|
||||
isPositions,
|
||||
|
||||
@@ -28,6 +28,7 @@ import { processor } from "./processor"
|
||||
import { isVerboseOnly } from "./stream"
|
||||
import { eventsList, variablesList } from "."
|
||||
import {
|
||||
isOk,
|
||||
isStatus,
|
||||
getStatus,
|
||||
isStates,
|
||||
@@ -96,8 +97,9 @@ const TargetContextProvider = ({ children }) => {
|
||||
//sensors
|
||||
//status
|
||||
if (type === "stream") {
|
||||
//status
|
||||
if (isStatus(data)) {
|
||||
if (isOk(data)) {
|
||||
//just ignore this one so we can continue
|
||||
} else if (isStatus(data)) {//status
|
||||
const response = getStatus(data)
|
||||
//For Pn we need to keep the last value to keep trace the pin is detected or not,
|
||||
//so we can display the pin icon when disabled even no data is received
|
||||
|
||||
@@ -26,6 +26,16 @@ import { gcode_parser_modes } from "./gcode_parser_modes"
|
||||
let wpos = []
|
||||
let mpos = []
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// ok acknowledge
|
||||
const isOk = (str) => {
|
||||
if (str=="ok") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// Status format is : <...>
|
||||
@@ -380,6 +390,7 @@ const getStreamingStatus = (str) => {
|
||||
return { status: res.data }
|
||||
}
|
||||
export {
|
||||
isOk,
|
||||
isStatus,
|
||||
getStatus,
|
||||
isStates,
|
||||
|
||||
Reference in New Issue
Block a user