mirror of
https://github.com/jopohl/urh.git
synced 2026-03-09 09:46:48 +01:00
catch errors
This commit is contained in:
@@ -48,7 +48,10 @@ class PLabelTableModel(QAbstractTableModel):
|
||||
def data(self, index: QModelIndex, role=Qt.DisplayRole):
|
||||
i, j = index.row(), index.column()
|
||||
if role == Qt.DisplayRole:
|
||||
lbl = self.message_type[i]
|
||||
try:
|
||||
lbl = self.message_type[i]
|
||||
except IndexError:
|
||||
return False
|
||||
if j == 0:
|
||||
return lbl.name
|
||||
elif j == 1:
|
||||
|
||||
@@ -238,8 +238,10 @@ class Signal(QObject):
|
||||
|
||||
@property
|
||||
def real_plot_data(self):
|
||||
return self.data.real
|
||||
|
||||
try:
|
||||
return self.data.real
|
||||
except AttributeError:
|
||||
return np.zeros(0, dtype=np.float32)
|
||||
@property
|
||||
def wave_data(self):
|
||||
return bytearray(np.multiply(-1, (np.round(self.data.real * 127)).astype(np.int8)))
|
||||
|
||||
Reference in New Issue
Block a user