Commit f6260cb7e75f76c66623d26313f88a659e98e21a
Exists in
rhitier-dev
Merge fixNovember
Showing
4 changed files
with
12 additions
and
11 deletions
Show diff stats
requirements.txt
web/run.py
@@ -328,6 +328,10 @@ def datetime_from_list(time_list): | @@ -328,6 +328,10 @@ def datetime_from_list(time_list): | ||
328 | with DayOfYear starting at 0. We want it starting at 1 because it's what | 328 | with DayOfYear starting at 0. We want it starting at 1 because it's what |
329 | vendor parsers use, both in python and javascript. | 329 | vendor parsers use, both in python and javascript. |
330 | """ | 330 | """ |
331 | + try: | ||
332 | + time_list = [str(i, 'UTF8') for i in time_list] | ||
333 | + except Exception as e: | ||
334 | + log.error(e) | ||
331 | # Day Of Year starts at 0, but for our datetime parser it starts at 1 | 335 | # Day Of Year starts at 0, but for our datetime parser it starts at 1 |
332 | doy = '{:03d}'.format(int(''.join(time_list[4:7])) + 1) | 336 | doy = '{:03d}'.format(int(''.join(time_list[4:7])) + 1) |
333 | return datetime.datetime.strptime( | 337 | return datetime.datetime.strptime( |
@@ -711,10 +715,6 @@ def get_data_for_target(target_config, input_slug, | @@ -711,10 +715,6 @@ def get_data_for_target(target_config, input_slug, | ||
711 | (target_config['name'], orbit_file)) | 715 | (target_config['name'], orbit_file)) |
712 | for ltime, datum_hee in zip(times, data_hee): | 716 | for ltime, datum_hee in zip(times, data_hee): |
713 | try: | 717 | try: |
714 | - try: | ||
715 | - ltime = [str(i, 'UTF8') for i in ltime] | ||
716 | - except Exception as e: | ||
717 | - print(e) | ||
718 | dtime = datetime_from_list(ltime) | 718 | dtime = datetime_from_list(ltime) |
719 | except Exception: | 719 | except Exception: |
720 | log.error("Failed to parse time from get__data_for_target %s." % ltime) | 720 | log.error("Failed to parse time from get__data_for_target %s." % ltime) |
@@ -776,10 +776,6 @@ def get_data_for_target(target_config, input_slug, | @@ -776,10 +776,6 @@ def get_data_for_target(target_config, input_slug, | ||
776 | in zip(times, data_v, data_b, data_t, data_n, data_p, data_a): | 776 | in zip(times, data_v, data_b, data_t, data_n, data_p, data_a): |
777 | 777 | ||
778 | try: | 778 | try: |
779 | - try: | ||
780 | - ltime = [str(i, 'UTF8') for i in ltime] | ||
781 | - except Exception as e: | ||
782 | - print(e) | ||
783 | dtime = datetime_from_list(ltime) | 779 | dtime = datetime_from_list(ltime) |
784 | except Exception: | 780 | except Exception: |
785 | log.error("Failed to parse time from %s." % ltime) | 781 | log.error("Failed to parse time from %s." % ltime) |
web/static/js/main.js
@@ -419,6 +419,8 @@ | @@ -419,6 +419,8 @@ | ||
419 | } | 419 | } |
420 | console.log(target['name'], id, data[id]); | 420 | console.log(target['name'], id, data[id]); |
421 | if (data[id].length) { | 421 | if (data[id].length) { |
422 | + //console.log('-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+') | ||
423 | + console.log(id, title, target, data[id], container) | ||
422 | return app.time_series.push(new TimeSeries(id, title, target, data[id], app.parameters[id].active, container, { | 424 | return app.time_series.push(new TimeSeries(id, title, target, data[id], app.parameters[id].active, container, { |
423 | 'started_at': app.started_at, | 425 | 'started_at': app.started_at, |
424 | 'stopped_at': app.stopped_at | 426 | 'stopped_at': app.stopped_at |
@@ -871,7 +873,10 @@ | @@ -871,7 +873,10 @@ | ||
871 | this.plotWrapper.append('g').classed('x axis', true); | 873 | this.plotWrapper.append('g').classed('x axis', true); |
872 | this.plotWrapper.append('g').classed('y axis', true); | 874 | this.plotWrapper.append('g').classed('y axis', true); |
873 | this.yAxisText = this.plotWrapper.append("text").attr("transform", "rotate(-90)").attr("dy", "1em").style("text-anchor", "middle").text(this.title); | 875 | this.yAxisText = this.plotWrapper.append("text").attr("transform", "rotate(-90)").attr("dy", "1em").style("text-anchor", "middle").text(this.title); |
874 | - this.yAxisTextTarget = this.plotWrapper.append("text").attr("transform", "rotate(-90)").attr("dy", "1em").style("text-anchor", "middle").style("font-style", "oblique").text(this.target.name); | 876 | + let y_title = this.target.name+" from "+$("input[name='input_slug']:checked").siblings(".mdl-radio__label").html(); |
877 | + this.yAxisTextTarget = this.plotWrapper.append("text").attr("transform", "rotate(-90)") | ||
878 | + .attr("dy", "1em").style("text-anchor", "middle") | ||
879 | + .style("font-style", "oblique").text(y_title); | ||
875 | this.focus = this.plotWrapper.append('g').style("display", "none"); | 880 | this.focus = this.plotWrapper.append('g').style("display", "none"); |
876 | this.cursorCircle = this.focus.append("circle").attr("class", "cursor-circle").attr("r", 3); | 881 | this.cursorCircle = this.focus.append("circle").attr("class", "cursor-circle").attr("r", 3); |
877 | dx = 8; | 882 | dx = 8; |
web/view/home.html.jinja2
@@ -182,12 +182,12 @@ | @@ -182,12 +182,12 @@ | ||
182 | title="Send the data to a connected SAMP hub, such as TOPCAT."> | 182 | title="Send the data to a connected SAMP hub, such as TOPCAT."> |
183 | SAMP | 183 | SAMP |
184 | </button> | 184 | </button> |
185 | -#} | ||
186 | <button id="email_alert" | 185 | <button id="email_alert" |
187 | class="mdl-button mdl-button--raised mdl-button--primary" | 186 | class="mdl-button mdl-button--raised mdl-button--primary" |
188 | title="Set an alert to receive an email when the data validates pre-defined conditions." | 187 | title="Set an alert to receive an email when the data validates pre-defined conditions." |
189 | data-href="http://alerts-psws.irap.omp.eu/tao"> | 188 | data-href="http://alerts-psws.irap.omp.eu/tao"> |
190 | Alert | 189 | Alert |
190 | +#} | ||
191 | </button> | 191 | </button> |
192 | {% endif %} | 192 | {% endif %} |
193 | 193 |