Prefix "+" in front of Origin Modifier co-ordinates
This commit is contained in:
@@ -892,28 +892,36 @@ void X26DockWidget::updateCookedTripletParameters(const QModelIndex &index)
|
|||||||
// Now deal with cooked row and column spinboxes
|
// Now deal with cooked row and column spinboxes
|
||||||
m_cookedRowSpinBox->blockSignals(true);
|
m_cookedRowSpinBox->blockSignals(true);
|
||||||
m_cookedColumnSpinBox->blockSignals(true);
|
m_cookedColumnSpinBox->blockSignals(true);
|
||||||
QVariant rowVariant = index.model()->data(index.model()->index(index.row(), 0), Qt::EditRole);
|
const QVariant rowVariant = index.model()->data(index.model()->index(index.row(), 0), Qt::EditRole);
|
||||||
if (rowVariant.isNull()) {
|
if (rowVariant.isNull()) {
|
||||||
m_cookedRowSpinBox->setEnabled(false);
|
m_cookedRowSpinBox->setEnabled(false);
|
||||||
m_cookedRowSpinBox->setValue(0);
|
m_cookedRowSpinBox->setValue(0);
|
||||||
|
m_cookedRowSpinBox->setPrefix("");
|
||||||
} else {
|
} else {
|
||||||
m_cookedRowSpinBox->setEnabled(true);
|
m_cookedRowSpinBox->setEnabled(true);
|
||||||
if (index.model()->data(index.model()->index(index.row(), 2), Qt::EditRole) == 0x10)
|
if (modeExt == 0x10) {
|
||||||
m_cookedRowSpinBox->setRange(0, 23);
|
m_cookedRowSpinBox->setRange(0, 23);
|
||||||
else
|
m_cookedRowSpinBox->setPrefix("+");
|
||||||
|
} else {
|
||||||
m_cookedRowSpinBox->setRange(1, 24);
|
m_cookedRowSpinBox->setRange(1, 24);
|
||||||
|
m_cookedRowSpinBox->setPrefix("");
|
||||||
|
}
|
||||||
m_cookedRowSpinBox->setValue(rowVariant.toInt());
|
m_cookedRowSpinBox->setValue(rowVariant.toInt());
|
||||||
}
|
}
|
||||||
QVariant columnVariant = index.model()->data(index.model()->index(index.row(), 1), Qt::EditRole);
|
const QVariant columnVariant = index.model()->data(index.model()->index(index.row(), 1), Qt::EditRole);
|
||||||
if (columnVariant.isNull()) {
|
if (columnVariant.isNull()) {
|
||||||
m_cookedColumnSpinBox->setEnabled(false);
|
m_cookedColumnSpinBox->setEnabled(false);
|
||||||
m_cookedColumnSpinBox->setValue(0);
|
m_cookedColumnSpinBox->setValue(0);
|
||||||
|
m_cookedColumnSpinBox->setPrefix("");
|
||||||
} else {
|
} else {
|
||||||
m_cookedColumnSpinBox->setEnabled(true);
|
m_cookedColumnSpinBox->setEnabled(true);
|
||||||
if (index.model()->data(index.model()->index(index.row(), 2), Qt::EditRole) == 0x10)
|
if (modeExt == 0x10) {
|
||||||
m_cookedColumnSpinBox->setMaximum(71);
|
m_cookedColumnSpinBox->setMaximum(71);
|
||||||
else
|
m_cookedColumnSpinBox->setPrefix("+");
|
||||||
|
} else {
|
||||||
m_cookedColumnSpinBox->setMaximum(39);
|
m_cookedColumnSpinBox->setMaximum(39);
|
||||||
|
m_cookedColumnSpinBox->setPrefix("");
|
||||||
|
}
|
||||||
m_cookedColumnSpinBox->setValue(columnVariant.toInt());
|
m_cookedColumnSpinBox->setValue(columnVariant.toInt());
|
||||||
}
|
}
|
||||||
m_cookedRowSpinBox->blockSignals(false);
|
m_cookedRowSpinBox->blockSignals(false);
|
||||||
|
|||||||
12
x26model.cpp
12
x26model.cpp
@@ -77,14 +77,14 @@ QVariant X26Model::data(const QModelIndex &index, int role) const
|
|||||||
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
if (role == Qt::DisplayRole || role == Qt::EditRole)
|
||||||
switch (index.column()) {
|
switch (index.column()) {
|
||||||
case 0:
|
case 0:
|
||||||
// Show row number only if address part of triplet actually represents a row
|
// Show row number only if address part of triplet actually represents a row:
|
||||||
// i.e. Full row colour, Set Active Position and Origin Modifier
|
// Full row colour, Set Active Position and Origin Modifier
|
||||||
// For Origin Modifier address of 40 refers to same row, so show it as 0
|
// For Origin Modifier address of 40 refers to same row, so show it as 0
|
||||||
if (triplet.modeExt() == 0x10) {
|
if (triplet.modeExt() == 0x10) {
|
||||||
if (triplet.address() == 40)
|
if (triplet.address() == 40)
|
||||||
return 0;
|
return "+0";
|
||||||
else
|
else
|
||||||
return triplet.addressRow();
|
return QString("+%1").arg(triplet.addressRow());
|
||||||
}
|
}
|
||||||
if (triplet.modeExt() == 0x01 || triplet.modeExt() == 0x04)
|
if (triplet.modeExt() == 0x01 || triplet.modeExt() == 0x04)
|
||||||
return triplet.addressRow();
|
return triplet.addressRow();
|
||||||
@@ -94,8 +94,10 @@ QVariant X26Model::data(const QModelIndex &index, int role) const
|
|||||||
if (!triplet.isRowTriplet())
|
if (!triplet.isRowTriplet())
|
||||||
return triplet.addressColumn();
|
return triplet.addressColumn();
|
||||||
// For Set Active Position and Origin Modifier, data is the column
|
// For Set Active Position and Origin Modifier, data is the column
|
||||||
else if (triplet.modeExt() == 0x04 || triplet.modeExt() == 0x10)
|
else if (triplet.modeExt() == 0x04)
|
||||||
return triplet.data();
|
return triplet.data();
|
||||||
|
else if (triplet.modeExt() == 0x10)
|
||||||
|
return QString("+%1").arg(triplet.data());
|
||||||
else
|
else
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user