-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PRJ: try fix travis; PRJ: clean up branch; ENH: add telescope status …
…tab to silab_online_monitor
- Loading branch information
leloup314
committed
Dec 7, 2016
1 parent
37ad078
commit 3123668
Showing
5 changed files
with
73 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |