|
|
|
@ -194,6 +194,20 @@ class VarTableModel(QAbstractTableModel):
|
|
|
|
|
self.datas[sourceRow], self.datas[destinationChild] = self.datas[destinationChild], self.datas[sourceRow]
|
|
|
|
|
self.table.proxy.invalidate()
|
|
|
|
|
|
|
|
|
|
def refreshComboBox(self):
|
|
|
|
|
for i in range(len(self.datas)):
|
|
|
|
|
cbRow = str('cb' + str(i) + '5')
|
|
|
|
|
index = self.index(i, 5)
|
|
|
|
|
delegate = self.table.itemDelegate(index)
|
|
|
|
|
comboBox = getattr(delegate, cbRow)
|
|
|
|
|
|
|
|
|
|
if self.datas[i][5] in [0, 1]:
|
|
|
|
|
comboBox.setCurrentIndex(self.datas[i][5])
|
|
|
|
|
elif self.datas[i][5] in [3, 4]:
|
|
|
|
|
comboBox.setCurrentIndex(self.datas[i][5] - 1)
|
|
|
|
|
else:
|
|
|
|
|
comboBox.setCurrentIndex(-1)
|
|
|
|
|
|
|
|
|
|
class ModBusTCPSlaveModel(VarTableModel):
|
|
|
|
|
def __init__(self, header, data: list, table = None):
|
|
|
|
|
'''
|
|
|
|
|