File tree Expand file tree Collapse file tree 3 files changed +2
-33
lines changed Expand file tree Collapse file tree 3 files changed +2
-33
lines changed Original file line number Diff line number Diff line change 4747 " mixins" ,
4848 " Explorerdmg" ,
4949 " heapsnapshot" ,
50+ " noconflict"
5051 ]
5152}
Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ import * as React from 'react'
33import CodeDiff from '../CodeDiff'
44import { AppState } from '../../../reducers'
55import { Base64Message } from '../../../../../backend/src/Model/Base64Message'
6- import { SparkplugPayload } from '../../../../../backend/src/Model/SparkplugB'
76import { connect } from 'react-redux'
87import { ValueRendererDisplayMode } from '../../../reducers/Settings'
98import { Fade } from '@material-ui/core'
Original file line number Diff line number Diff line change @@ -2,42 +2,11 @@ import { TreeNodeFactory } from '../'
22import { Base64Message } from '../Base64Message'
33import { TreeNode } from '../TreeNode'
44import { MqttMessage } from '../../../../events'
5- import { SparkplugPayload } from '../sparkplugb'
6-
7- interface Decoder {
8- decode ( input : string ) : string | null
9- }
10-
11- const SparkplugDecoder = {
12- decoderTime : 0 ,
13- encoder : new TextEncoder ( ) ,
14- decode ( input : string ) : string | null {
15- if ( ! SparkplugPayload ) {
16- return null
17- }
18-
19- const start = performance . now ( )
20-
21- let result
22- try {
23- result = JSON . stringify ( SparkplugPayload . toObject ( SparkplugPayload . decode ( this . encoder . encode ( input ) ) ) )
24- } catch { }
25-
26- this . decoderTime += performance . now ( ) - start ;
27- return result ?? null
28- }
29- }
30-
31- let i = 1
32- setInterval ( ( ) => {
33- console . log ( `decoder time after ${ i ++ * 10 } seconds: ${ SparkplugDecoder . decoderTime } ms` )
34- } , 10000 )
355
366export function makeTreeNode ( topic : string , message ?: string ) : TreeNode < any > {
37- let sparkplugMessage = message && SparkplugDecoder . decode ( message )
387 const mqttMessage : MqttMessage = {
398 topic,
40- payload : message ? Base64Message . fromString ( sparkplugMessage ?? message ) : null ,
9+ payload : message ? Base64Message . fromString ( message ) : null ,
4110 qos : 0 ,
4211 retain : false ,
4312 messageId : undefined ,
You can’t perform that action at this time.
0 commit comments