(private sources: {[channel: number]: SocketRTTSource}, args: ConfigurationArguments, extensionPath: string)
| 476 | protected decoders: RTTDecoder[] = []; |
| 477 | |
| 478 | constructor(private sources: {[channel: number]: SocketRTTSource}, args: ConfigurationArguments, extensionPath: string) { |
| 479 | super(); |
| 480 | |
| 481 | if (args.graphConfig.length >= 1) { |
| 482 | this.webview = new SWOWebview(extensionPath, args.graphConfig); |
| 483 | } |
| 484 | |
| 485 | args.rttConfig.decoders.forEach((conf) => { |
| 486 | switch (conf.type) { |
| 487 | case 'graph': |
| 488 | this.addRTTDecoder(this.sources[conf.port]); |
| 489 | const processor = new SWORTTGraphProcessor(conf as any as SWOGraphDecoderConfig); |
| 490 | if (this.webview) { this.webview.registerProcessors(processor); } |
| 491 | this.processors.push(processor); |
| 492 | break; |
| 493 | case 'advanced': |
| 494 | try { |
| 495 | for (const p of conf.ports) { |
| 496 | this.addRTTDecoder(this.sources[p]); |
| 497 | } |
| 498 | const processor = new SWORTTAdvancedProcessor(conf as any as SWOAdvancedDecoderConfig); |
| 499 | if (this.webview) { this.webview.registerProcessors(processor); } |
| 500 | this.processors.push(processor); |
| 501 | break; |
| 502 | } |
| 503 | catch (e) { |
| 504 | vscode.window.showErrorMessage(`Error Initializing Advanced Decoder: ${e.toString()}`); |
| 505 | } |
| 506 | default: |
| 507 | break; |
| 508 | } |
| 509 | }); |
| 510 | } |
| 511 | |
| 512 | private addRTTDecoder(src: SocketRTTSource) { |
| 513 | if (src) { |
nothing calls this directly
no test coverage detected