forked from M-Labs/artiq
waveform: changes
This commit is contained in:
parent
c14964b36d
commit
ea0cbefa67
@ -218,7 +218,7 @@ class Waveform(pg.PlotWidget):
|
|||||||
# self.cursor_y = None
|
# self.cursor_y = None
|
||||||
# self.format_cursor_label()
|
# self.format_cursor_label()
|
||||||
|
|
||||||
def onDataChange(self):
|
def onDataChange(self, data):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
#def format_cursor_label(self):
|
#def format_cursor_label(self):
|
||||||
@ -289,6 +289,8 @@ class BitWaveform(Waveform):
|
|||||||
#self.plot_data_item.setDownsampling(ds=1000, method="peak", auto=False)
|
#self.plot_data_item.setDownsampling(ds=1000, method="peak", auto=False)
|
||||||
|
|
||||||
def onDataChange(self, data):
|
def onDataChange(self, data):
|
||||||
|
logger.info("bit waveform ondatachanged triggered")
|
||||||
|
logger.info(str(len(data)))
|
||||||
try:
|
try:
|
||||||
display_y = []
|
display_y = []
|
||||||
display_x = []
|
display_x = []
|
||||||
@ -448,13 +450,14 @@ class _WaveformView(QtWidgets.QWidget):
|
|||||||
|
|
||||||
def onDataChange(self, top, bottom, roles):
|
def onDataChange(self, top, bottom, roles):
|
||||||
first = top.row()
|
first = top.row()
|
||||||
|
logger.info(str(first))
|
||||||
last = bottom.row()
|
last = bottom.row()
|
||||||
|
logger.info(str(last))
|
||||||
for i in range(first, last + 1):
|
for i in range(first, last + 1):
|
||||||
data = self._model.data(self._model.index(i, 2))
|
data = self._model.data(self._model.index(i, 3))
|
||||||
self._splitter.widget(i).onDataChange(data)
|
self._splitter.widget(i).onDataChange(data)
|
||||||
|
|
||||||
def onInsert(self, parent, first, last):
|
def onInsert(self, parent, first, last):
|
||||||
logger.info("inserting widget")
|
|
||||||
for i in range(first, last + 1):
|
for i in range(first, last + 1):
|
||||||
w = self._create_waveform(i)
|
w = self._create_waveform(i)
|
||||||
self._splitter.insertWidget(i, w)
|
self._splitter.insertWidget(i, w)
|
||||||
@ -481,7 +484,9 @@ class _WaveformView(QtWidgets.QWidget):
|
|||||||
WaveformType.ANALOG: AnalogWaveform,
|
WaveformType.ANALOG: AnalogWaveform,
|
||||||
WaveformType.LOG: LogWaveform
|
WaveformType.LOG: LogWaveform
|
||||||
}[ty]
|
}[ty]
|
||||||
return waveform_cls(name, width, parent=self._splitter)
|
w = waveform_cls(name, width, parent=self._splitter)
|
||||||
|
w.setXLink(self._ref_vb)
|
||||||
|
return w
|
||||||
|
|
||||||
def _resize(self):
|
def _resize(self):
|
||||||
self._splitter.setMinimumHeight(Waveform.MIN_HEIGHT * self._model.rowCount())
|
self._splitter.setMinimumHeight(Waveform.MIN_HEIGHT * self._model.rowCount())
|
||||||
@ -523,12 +528,14 @@ class _WaveformModel(QtCore.QAbstractTableModel):
|
|||||||
self.endMoveRows()
|
self.endMoveRows()
|
||||||
|
|
||||||
def update_data(self, waveform_data):
|
def update_data(self, waveform_data):
|
||||||
for i in range(len(self.backing_struct)):
|
for i in range(self.rowCount()):
|
||||||
|
logger.info(str(i))
|
||||||
name = self.data(self.index(i, 0))
|
name = self.data(self.index(i, 0))
|
||||||
if name in waveform_data:
|
if name in waveform_data:
|
||||||
self.backing_struct[i][3] = waveform_data[name]
|
logger.info(name)
|
||||||
|
self.backing_struct[i] = waveform_data[name]
|
||||||
self.dataChanged.emit(self.index(0, 0),
|
self.dataChanged.emit(self.index(0, 0),
|
||||||
self.index(len(self.backing_struct)-1, len(self.headers)))
|
self.index(self.rowCount()-1, self.columnCount()-1))
|
||||||
|
|
||||||
|
|
||||||
class WaveformArea(QtWidgets.QWidget):
|
class WaveformArea(QtWidgets.QWidget):
|
||||||
@ -689,7 +696,7 @@ class _BaseProxyClient:
|
|||||||
self.addr = addr
|
self.addr = addr
|
||||||
self.port = port
|
self.port = port
|
||||||
self._reconnect_event.set()
|
self._reconnect_event.set()
|
||||||
|
|
||||||
# TODO: investigate if need to cancel the connection before connecting again..
|
# TODO: investigate if need to cancel the connection before connecting again..
|
||||||
async def _reconnect(self):
|
async def _reconnect(self):
|
||||||
try:
|
try:
|
||||||
@ -837,7 +844,7 @@ class WaveformDock(QtWidgets.QDockWidget):
|
|||||||
trace = comm_analyzer.decoded_dump_to_waveform_data(ddb, decoded_dump)
|
trace = comm_analyzer.decoded_dump_to_waveform_data(ddb, decoded_dump)
|
||||||
self._waveform_data.update(trace)
|
self._waveform_data.update(trace)
|
||||||
self._channel_model.update(trace['logs'])
|
self._channel_model.update(trace['logs'])
|
||||||
self._waveform_model.update_data(self._waveform_data)
|
self._waveform_model.update_data(trace['data'])
|
||||||
self._dump = data
|
self._dump = data
|
||||||
|
|
||||||
def on_add_channel_click(self):
|
def on_add_channel_click(self):
|
||||||
@ -853,7 +860,7 @@ class WaveformDock(QtWidgets.QDockWidget):
|
|||||||
dialog.open()
|
dialog.open()
|
||||||
channels = await fut
|
channels = await fut
|
||||||
self._waveform_model.extend(channels)
|
self._waveform_model.extend(channels)
|
||||||
self._waveform_model.update_data(self._waveform_data) # TODO use a specific function for this
|
self._waveform_model.update_data(self._waveform_data['data']) # TODO use a specific function for this
|
||||||
|
|
||||||
async def load_trace(self):
|
async def load_trace(self):
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user