| 24 | const graphs: Graph[] = []; |
| 25 | |
| 26 | function processConfiguration(message: GrapherConfigurationMessage) { |
| 27 | window.datasource = new GraphDataSource(); |
| 28 | |
| 29 | message.graphs.forEach((config: any) => { |
| 30 | if (config.type === 'realtime') { |
| 31 | const graph = new TimeseriesGraph(config as TimeseriesGraphConfiguration, window.datasource); |
| 32 | graphs.push(graph); |
| 33 | if (message.status === 'stopped' || message.status === 'terminated') { graph.stop(); } |
| 34 | } |
| 35 | else if (config.type === 'x-y-plot') { |
| 36 | const graph = new XYGraph(config as XYGraphConfiguration, window.datasource); |
| 37 | graphs.push(graph); |
| 38 | if (message.status === 'stopped' || message.status === 'terminated') { graph.stop(); } |
| 39 | } |
| 40 | }); |
| 41 | |
| 42 | // const psg: ProgramStatsGraph = new ProgramStatsGraph(window.datasource); |
| 43 | // if (message.status === 'stopped' || message.status === 'terminated') { psg.stop(); } |
| 44 | // graphs.push(psg); |
| 45 | } |
| 46 | |
| 47 | function processStatus(message: GrapherStatusMessage) { |
| 48 | if (message.status === 'stopped' || message.status === 'terminated') { |