mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-04 16:01:14 -05:00
Tx ph.1: show preset mode (Rx or Tx) in the presets tree. Reformatted preset tree. SerializeDeserialize preset mode
This commit is contained in:
parent
717b240157
commit
7d941ccb37
@ -397,12 +397,14 @@ QTreeWidgetItem* MainWindow::addPresetToTree(const Preset* preset)
|
||||
}
|
||||
|
||||
QStringList sl;
|
||||
sl.append(QString("%1 kHz").arg(preset->getCenterFrequency() / 1000));
|
||||
sl.append(preset->getDescription());
|
||||
sl.append(QString("%1").arg(preset->getCenterFrequency() / 1e6f, 0, 'f', 3)); // frequency column
|
||||
sl.append(QString("%1").arg(preset->isSourcePreset() ? 'R' : 'T')); // mode column
|
||||
sl.append(preset->getDescription()); // description column
|
||||
PresetItem* item = new PresetItem(group, sl, preset->getCenterFrequency(), PItem);
|
||||
item->setTextAlignment(0, Qt::AlignRight);
|
||||
item->setData(0, Qt::UserRole, qVariantFromValue(preset));
|
||||
ui->presetTree->resizeColumnToContents(0);
|
||||
ui->presetTree->resizeColumnToContents(0); // Resize frequency column to minimum
|
||||
ui->presetTree->resizeColumnToContents(1); // Resize mode column to minimum
|
||||
|
||||
updatePresetControls();
|
||||
return item;
|
||||
|
@ -244,12 +244,29 @@
|
||||
</item>
|
||||
<item row="1" column="1" rowspan="4" colspan="12">
|
||||
<widget class="QTreeWidget" name="presetTree">
|
||||
<property name="indentation">
|
||||
<number>10</number>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerMinimumSectionSize">
|
||||
<number>5</number>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Frequency</string>
|
||||
<string>Freq (MHz)</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Center frequency in MHz</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>M</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Mode: R: Rx or source, T: Tx or sink</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
|
@ -24,8 +24,9 @@ void Preset::resetToDefaults()
|
||||
|
||||
QByteArray Preset::serialize() const
|
||||
{
|
||||
qDebug("Preset::serialize: m_group: %s m_description: %s m_centerFrequency: %llu",
|
||||
qDebug("Preset::serialize: m_group: %s mode: %s m_description: %s m_centerFrequency: %llu",
|
||||
qPrintable(m_group),
|
||||
m_sourcePreset ? "Rx" : "Tx",
|
||||
qPrintable(m_description),
|
||||
m_centerFrequency);
|
||||
|
||||
@ -36,6 +37,7 @@ QByteArray Preset::serialize() const
|
||||
s.writeU64(3, m_centerFrequency);
|
||||
s.writeBlob(4, m_layout);
|
||||
s.writeBlob(5, m_spectrumConfig);
|
||||
s.writeBool(6, m_sourcePreset);
|
||||
|
||||
s.writeS32(20, m_deviceConfigs.size());
|
||||
|
||||
@ -87,9 +89,11 @@ bool Preset::deserialize(const QByteArray& data)
|
||||
d.readU64(3, &m_centerFrequency, 0);
|
||||
d.readBlob(4, &m_layout);
|
||||
d.readBlob(5, &m_spectrumConfig);
|
||||
d.readBool(6, &m_sourcePreset, true);
|
||||
|
||||
qDebug("Preset::deserialize: m_group: %s m_description: %s m_centerFrequency: %llu",
|
||||
qDebug("Preset::deserialize: m_group: %s mode: %s m_description: %s m_centerFrequency: %llu",
|
||||
qPrintable(m_group),
|
||||
m_sourcePreset ? "Rx" : "Tx",
|
||||
qPrintable(m_description),
|
||||
m_centerFrequency);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user