Commit 56088cc2 authored by sarrvesh's avatar sarrvesh

add observation date to pdf

parent d2058b39
......@@ -190,13 +190,15 @@ def on_resolve_click(n, close_msg_box, target_name, is_open):
State('msgboxGenPdf', 'is_open'),
State('elevation-plot', 'figure'),
State('distance-table', 'figure')
State('distance-table', 'figure'),
State('dateRow', 'date')
]
)
def on_genpdf_click(n_clicks, close_msg_box, obs_t, n_core, n_remote, n_int, n_chan,
n_sb, integ_t, ant_set, pipe_type, t_avg, f_avg, is_dysco,
im_noise_val, raw_size, proc_size, pipe_time, is_msg_box_open,
elevation_fig, distance_table):
elevation_fig, distance_table, obs_date):
"""Function defines what to do when the generate pdf button is clicked"""
if is_msg_box_open is True and close_msg_box is not None:
# The message box is open and the user has clicked the close
......@@ -219,7 +221,7 @@ def on_genpdf_click(n_clicks, close_msg_box, obs_t, n_core, n_remote, n_int, n_c
g.generate_pdf(rel_path, obs_t, n_core, n_remote, n_int, n_chan,
n_sb, integ_t, ant_set, pipe_type, t_avg, f_avg,
is_dysco, im_noise_val, raw_size, proc_size, pipe_time,
elevation_fig, distance_table)
elevation_fig, distance_table, obs_date)
return {'display':'block'}, '/luci/{}'.format(rel_path), False
@app.server.route('/luci/static/<resource>')
......
......@@ -46,7 +46,8 @@ def make_pdf_plot(elevation_fig, outfilename):
def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t,
antenna_set, pipe_type, t_avg, f_avg, is_dysco, im_noise_val,
raw_size, proc_size, pipe_time, elevation_fig, distance_table):
raw_size, proc_size, pipe_time, elevation_fig, distance_table,
obs_date):
"""Function to generate a pdf file summarizing the content of the calculator.
Return nothing."""
# Create an A4 sheet
......@@ -72,6 +73,12 @@ def generate_pdf(pdf_file, obs_t, n_core, n_remote, n_int, n_chan, n_sb, integ_t
string += '<tr><td>Antenna set</td>'
string += ' <td>{}</td></tr>'.format(antenna_set)
string += '<tr></tr>'
if elevation_fig != {}:
# User has specified at least one source in the target setup
# Display the observation date in the table
string += '<tr><td>Observation date</td>'
string += ' <td>{}</td></tr>'.format(obs_date)
string += '<tr></tr>'
string += '<tr><td>Pipeline type</td>'
if pipe_type == 'none':
string += ' <td>{}</td></tr>'.format('None')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment