From ce35c80e598941fd9219d9fb017d4aa1fdde7876 Mon Sep 17 00:00:00 2001 From: Dan Howe Date: Tue, 17 Sep 2019 08:02:41 +1000 Subject: [PATCH] Only show tabe for wave probes --- daqviewer/daqviewer.py | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/daqviewer/daqviewer.py b/daqviewer/daqviewer.py index f0d9842..615d264 100644 --- a/daqviewer/daqviewer.py +++ b/daqviewer/daqviewer.py @@ -108,6 +108,7 @@ def parse_contents(contents, filename): json_data['spectrum'] = dfs.to_json(orient='table') json_data['statistics'] = stats.to_json(orient='table') json_data['filename'] = filename + json_data['instrument type'] = inst_type return json.dumps(json_data) @@ -204,14 +205,21 @@ def read_json_data(json_data): }, ) - elements = html.Div([ - graph_timeseries, - html.Div([ - html.Div([graph_energy], className='six columns'), - html.Div([table_energy], className='six columns') - ]), - html.Div(id='datatable-row-ids-container') - ]) + if json.loads(json_data)['instrument type'] == 'WP': + elements = html.Div([ + graph_timeseries, + html.Div([ + html.Div([graph_energy], className='six columns'), + html.Div([table_energy], className='six columns') + ]), + html.Div(id='datatable-row-ids-container') + ]) + + else: + # Don't include spectral data for non-wave instruments + elements = html.Div( + [graph_timeseries, + html.Div(id='datatable-row-ids-container')]) return elements