remobe generated ts and load proto file directly

This commit is contained in:
Sinuhe Tellez
2021-08-14 23:24:17 -04:00
parent e708e1d0c7
commit 531af31490
7 changed files with 232 additions and 2417 deletions

View File

@@ -5,7 +5,7 @@ import PlotHistory from './Chart/Chart'
import { Base64Message } from '../../../backend/src/Model/Base64Message'
import { toPlottableValue } from './Sidebar/CodeDiff/util'
import { PlotCurveTypes } from '../reducers/Charts'
import { Payload } from '../../../backend/src/Model/sparkplug'
import { Payload } from '../../../backend/src/Model/sparkplugb'
const parseDuration = require('parse-duration')
interface Props {
@@ -41,12 +41,7 @@ function nodeDotPathToHistory(startTime: number | undefined, history: q.MessageH
let json: any = {}
try {
json = message.payload ? JSON.parse(Base64Message.toUnicodeString(message.payload)) : {}
} catch (ignore) {
// sparkplugb
try {
json = message.payload ? Payload.toJSON(Payload.decode(Base64Message.toUint8Array(message.payload))) : {}
} catch (ignore) {}
}
} catch (ignore) {}
const value = dotProp.get(json, dotPath)