| 39 | } |
| 40 | |
| 41 | QString buildMemoryRecallSliceFixupCommand(int sliceId, const MemoryEntry& memory) |
| 42 | { |
| 43 | QStringList fields; |
| 44 | |
| 45 | const QString direction = normalizedRepeaterDirection(memory.offsetDir); |
| 46 | if (!direction.isEmpty()) { |
| 47 | const double offsetMhz = std::abs(memory.repeaterOffset); |
| 48 | fields << QString("repeater_offset_dir=%1").arg(direction); |
| 49 | fields << QString("fm_repeater_offset_freq=%1").arg(offsetMhz, 0, 'f', 6); |
| 50 | fields << QString("tx_offset_freq=%1") |
| 51 | .arg(memoryRepeaterTxOffsetFreq(memory), 0, 'f', 6); |
| 52 | } |
| 53 | |
| 54 | const QString toneMode = memory.toneMode.trimmed().toLower(); |
| 55 | if (!toneMode.isEmpty()) |
| 56 | fields << QString("fm_tone_mode=%1").arg(toneMode); |
| 57 | if (!toneMode.isEmpty() || memory.toneValue > 0.0) |
| 58 | fields << QString("fm_tone_value=%1").arg(memory.toneValue, 0, 'f', 1); |
| 59 | |
| 60 | if (fields.isEmpty()) |
| 61 | return {}; |
| 62 | return QString("slice set %1 %2").arg(sliceId).arg(fields.join(' ')); |
| 63 | } |
| 64 | |
| 65 | } // namespace AetherSDR |