@luxonis/depthai-pipeline-lib 1.15.0 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -25,11 +25,14 @@ function nodeStateToState(state) {
|
|
|
25
25
|
function formatIOStates(values) {
|
|
26
26
|
let returnObj = {};
|
|
27
27
|
for (const [key, value] of Object.entries(values)) {
|
|
28
|
+
const dotColor = isNaN(Number(value.state))
|
|
29
|
+
? 'gray'
|
|
30
|
+
: nodeStateToDotColor(value.state);
|
|
28
31
|
returnObj = {
|
|
29
32
|
...returnObj,
|
|
30
33
|
[key]: {
|
|
31
34
|
...value,
|
|
32
|
-
dotColor:
|
|
35
|
+
dotColor: dotColor,
|
|
33
36
|
},
|
|
34
37
|
};
|
|
35
38
|
}
|
|
@@ -39,7 +42,10 @@ export function parsePipelineState(rawPayload) {
|
|
|
39
42
|
const { nodeStates } = rawPayload;
|
|
40
43
|
const parsedNodeStates = [];
|
|
41
44
|
for (const [nodeId, nodeState] of nodeStates) {
|
|
42
|
-
const
|
|
45
|
+
const parsedState = Number(nodeState?.state);
|
|
46
|
+
const state = isNaN(parsedState)
|
|
47
|
+
? 'IDLE'
|
|
48
|
+
: nodeStateToState(parsedState);
|
|
43
49
|
const currentNode = {
|
|
44
50
|
id: nodeId,
|
|
45
51
|
inputs: formatIOStates(nodeState.inputStates),
|