Add native QCustomPlot renderer and shared plot adapters
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
"""Tektronix-style record-length selector, including instrument readback."""
|
||||
try:
|
||||
from PySide6.QtWidgets import QComboBox
|
||||
except ImportError:
|
||||
from PySide2.QtWidgets import QComboBox
|
||||
from set_devices.tektronix_presets import RECORD_LENGTHS
|
||||
|
||||
|
||||
class RecordLengthBox(QComboBox):
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
for value in RECORD_LENGTHS:
|
||||
self.addItem(f"{value:,}".replace(",", " ") + " точек", value)
|
||||
|
||||
def value(self):
|
||||
return int(self.currentData())
|
||||
|
||||
def setValue(self, value):
|
||||
value = int(value)
|
||||
index = self.findData(value)
|
||||
if index < 0:
|
||||
self.addItem(f"{value:,}".replace(",", " ") + " точек", value)
|
||||
index = self.count() - 1
|
||||
self.setCurrentIndex(index)
|
||||
Reference in New Issue
Block a user