@@ -18,15 +18,15 def ws_connect(message, code, plot): | |||
|
18 | 18 | message.reply_channel.send({'accept': True}) |
|
19 | 19 | pk = message.content['query_string'].split('=')[1] |
|
20 | 20 | Group('{}_{}'.format(pk, plot)).add(message.reply_channel) |
|
21 |
print('New connection from: {}, |
|
|
21 | print('New connection from: {}, Group: {}_{}'.format(message.content['client'][0], pk, plot)) | |
|
22 | 22 | |
|
23 | 23 | def ws_message(message, code, plot): |
|
24 | 24 | # Accept the incoming connection |
|
25 | 25 | print 'incoming message' |
|
26 | 26 | dt = datetime.strptime(str(json.loads(message.content['text'])['date']), '%d/%m/%Y') |
|
27 | 27 | exp = DB.exp_meta.find_one({'code': int(code), 'date': dt}) |
|
28 | print exp | |
|
29 | if exp: | |
|
28 | ||
|
29 | if exp and plot in exp['plots']: | |
|
30 | 30 | if plot == 'spc': |
|
31 | 31 | datas = DB.exp_data.find({'expmeta': exp['_id']}, ['time', 'data']).sort('time', -1).limit(1)[0] |
|
32 | 32 | exp['time'] = [datas['time']] |
@@ -155,9 +155,10 class PcolorBuffer{ | |||
|
155 | 155 | for (var i = 0; i < obj[this.key].length; i++){ |
|
156 | 156 | this.zbuffer[i].push(obj[this.key][i]); |
|
157 | 157 | // update title |
|
158 | var title = this.props.title || '' | |
|
158 | 159 |
|
|
159 | 160 | Plotly.relayout(div, { |
|
160 | title: 'Channel ' + i + ' - ' + t.toLocaleString(), | |
|
161 | title: title + ': Channel ' + i + ' - ' + t.toLocaleString(), | |
|
161 | 162 | }); |
|
162 | 163 | } |
|
163 | 164 |
@@ -94,7 +94,7 | |||
|
94 | 94 | |
|
95 | 95 | socket.onmessage = function message(event) { |
|
96 | 96 | var data = JSON.parse(event.data); |
|
97 | console.log(data); | |
|
97 | console.log(data.time); | |
|
98 | 98 | if (data.interval == 0) { |
|
99 | 99 | $("#loader").removeClass("loader").addClass("no-data"); |
|
100 | 100 | $("#loader").html("No data found"); |
@@ -10,7 +10,7 | |||
|
10 | 10 | div: 'plot', |
|
11 | 11 | data: data, |
|
12 | 12 | key: 'rti', |
|
13 |
props: { title: '{{title}}', zmin: 15, zmax: 3 |
|
|
13 | props: { title: '{{title}}', zmin: 15, zmax: 35, throttle: 10, timespan: 12, colormap: 'Jet' }, | |
|
14 | 14 | }); |
|
15 | 15 | return true; |
|
16 | 16 | } else { |
@@ -16,7 +16,7 | |||
|
16 | 16 | div: 'plot', |
|
17 | 17 | data: data, |
|
18 | 18 | key: '{{plot}}', |
|
19 |
props: {title: '{{title}}', ylabel:'Noise [dB]', ymin:1 |
|
|
19 | props: {title: '{{title}}', ylabel:'Noise [dB]', ymin:18, ymax:22 }, | |
|
20 | 20 | }); |
|
21 | 21 | return true; |
|
22 | 22 | } else { |
@@ -70,7 +70,7 def main(request, code=None, plot=None): | |||
|
70 | 70 | } |
|
71 | 71 | |
|
72 | 72 | if code and exps: |
|
73 | kwargs['title'] = [t[1] for t in exps if t[0]==int(code)][0] | |
|
73 | kwargs['title'] = [t[1] for t in exps if int(t[0])==int(code)][0] | |
|
74 | 74 | else: |
|
75 | 75 | kwargs['title'] = 'JRO' |
|
76 | 76 |
@@ -104,7 +104,7 | |||
|
104 | 104 | "name" : "JULIA Imaging" |
|
105 | 105 | }, |
|
106 | 106 | { |
|
107 |
"code" : 20 |
|
|
107 | "code" : 204, | |
|
108 | 108 | "name" : "JULIA Bistatic" |
|
109 | 109 | } |
|
110 | 110 | ] No newline at end of file |
@@ -73,7 +73,10 def main(): | |||
|
73 | 73 | for plot in buffer['data']: |
|
74 | 74 | dum = buffer.copy() |
|
75 | 75 | dum['time'] = [buffer['time']] |
|
76 | dum[plot] = buffer['data'][plot] | |
|
76 | if plot=='noise': | |
|
77 | dum[plot] = [[x] for x in buffer['data'][plot]] | |
|
78 | else: | |
|
79 | dum[plot] = buffer['data'][plot] | |
|
77 | 80 | dum.pop('data') |
|
78 | 81 | dum.pop('exp_code') |
|
79 | 82 | channel.send_group(u'{}_{}'.format(code, plot), {'text': simplejson.dumps(dum, ignore_nan=True)}) |
General Comments 0
You need to be logged in to leave comments.
Login now