Skip to content

Commit

Permalink
PRJ: try fix travis; PRJ: clean up branch; ENH: add telescope status …
Browse files Browse the repository at this point in the history
…tab to silab_online_monitor
  • Loading branch information
leloup314 committed Dec 7, 2016
1 parent 37ad078 commit 3123668
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
producer_sim :
DAQ0 :
kind : pybar_fei4
# delay : 0.02814
delay : 0.02
delay : 0.03
backend: tcp://127.0.0.1:5500
# path to your h5-file
data_file: /home/leloup/git/silab_online_monitor/examples/pyBAR/122_test_m26_telescope_scan.h5
# data_file: /home/silab/Documents/testbeam/data_elsa_160307/mimosa/30_mmc32_telescope_5.h5

converter :
DUT0_Interpreter :
Expand All @@ -16,7 +15,6 @@ converter :
kind : pybar_fei4
frontend : tcp://127.0.0.1:5500
backend : tcp://127.0.0.1:6600

HIT_Correlator :
kind : hit_correlator
frontend :
Expand All @@ -37,6 +35,10 @@ converter :
kind : pybar_fei4_histogrammer
frontend : tcp://127.0.0.1:6600
backend : tcp://127.0.0.1:6700
# Telescope_Status :
# kind : telescope_status
# frontend : tcp://127.0.0.1:5500
# backend : tcp://127.0.0.1:8700

receiver :
DUT0 :
Expand All @@ -54,5 +56,9 @@ receiver :
max_n_rows_fei4 : 337
max_n_columns_fei4 : 81
max_n_rows_m26 : 576
max_n_columns_m26 : 1152
max_n_columns_m26 : 1152
Telescope_Status :
kind : telescope_status
frontend : tcp://127.0.0.1:8700


6 changes: 0 additions & 6 deletions silab_online_monitor/converter/hit_correlator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
import gc
from online_monitor.converter.transceiver import Transceiver
from online_monitor.utils import utils
from numba import njit

#from testbeam_analysis.tools import analysis_utils

#from pyBAR_mimosa26_interpreter import correlation_functions

from silab_online_monitor.converter import correlation_functions

class HitCorrelator(Transceiver):
Expand Down
29 changes: 29 additions & 0 deletions silab_online_monitor/converter/telescope_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from zmq.utils import jsonapi
import numpy as np
import sys, time
import logging
from online_monitor.converter.transceiver import Transceiver
from online_monitor.utils import utils

class TelescopeStatus(Transceiver):

def setup_transceiver(self):
self.set_bidirectional_communication() # We want to be able to change the histogrammmer settings

def setup_interpretation(self):
return

def deserialze_data(self, data): # According to pyBAR data serilization
datar, meta = utils.simple_dec(data)
if 'hits' in meta:
meta['hits'] = datar
return meta

def interpret_data(self, data):
return data

def serialze_data(self, data):
return jsonapi.dumps(data, cls=utils.NumpyEncoder)

def handle_command(self, command):
return
7 changes: 3 additions & 4 deletions silab_online_monitor/receiver/pybar_mimosa26.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,13 @@ def setup_widgets(self, parent, name):

#Change axis scaling
def scale_axes(scale_state):
if scale_state == 0:
for plot in self.plots:
for plot in self.plots:
if scale_state == 0:
plot.getAxis('bottom').setScale(1.0)
plot.getAxis('left').setScale(1.0)
plot.getAxis('bottom').setLabel('Columns')
plot.getAxis('left').setLabel('Rows')
elif scale_state == 2:
for plot in self.plots:
elif scale_state == 2:
plot.getAxis('bottom').setScale(18.4)
plot.getAxis('left').setScale(18.4)
plot.getAxis('bottom').setLabel('Columns / ' + u'\u03BC'+'m')
Expand Down
30 changes: 30 additions & 0 deletions silab_online_monitor/receiver/telescope_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from online_monitor.receiver.receiver import Receiver
from zmq.utils import jsonapi
import numpy as np
import time

from PyQt5 import Qt
import pyqtgraph as pg
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.ptime as ptime
from pyqtgraph.dockarea import DockArea, Dock

from online_monitor.utils import utils
from PyQt5.Qt import QWidget, QSize

class TelescopeStatus(Receiver):

def setup_receiver(self):
self.set_bidirectional_communication() # We want to change converter settings

def setup_widgets(self, parent, name):
#
dock_area = DockArea()
parent.addTab(dock_area, name)
parent.currentChanged.connect(lambda value: self.send_command('ACTIVETAB %s' % str(parent.tabText(value)))) # send active tab index to converter so that it only does something when user is looking at corresponding receiver
#
dock_status = Dock("Telescope status")
dock_area.addDock(dock_status)

def handle_data(self, data):
return

0 comments on commit 3123668

Please sign in to comment.