From dcf1bba8c63c701b2a7b52f95107cd140a67de6f Mon Sep 17 00:00:00 2001 From: Simon Renblad Date: Wed, 31 Jan 2024 15:00:54 +0800 Subject: [PATCH] waveform: implement _create_waveform --- artiq/dashboard/waveform.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/artiq/dashboard/waveform.py b/artiq/dashboard/waveform.py index a9c80b2a8..256de1504 100644 --- a/artiq/dashboard/waveform.py +++ b/artiq/dashboard/waveform.py @@ -421,7 +421,20 @@ class _WaveformView(QtWidgets.QWidget): self._splitter.insertWidget(dest_row, w) def _create_waveform(self, row): - raise NotImplementedError + name = self._model.data(self._model.index(row, 0)) + ty = self._model.data(self._model.index(row, 1)) + width = self._model.data(self._model.index(row, 2)) + waveform_cls = { + WaveformType.BIT: BitWaveform, + WaveformType.VECTOR: BitVectorWaveform, + WaveformType.ANALOG: AnalogWaveform, + WaveformType.LOG: LogWaveform + }[ty] + w = waveform_cls(name, width, parent=self._splitter) + w.setXLink(self._ref_vb) + w.setStoppedX(self._stopped_x) + w.setTimescale(self._timescale) + return w def _resize(self): self._splitter.setFixedHeight(