MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / syncMemorySpot

Method syncMemorySpot

src/gui/MainWindow.cpp:5464–5490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5462}
5463
5464void MainWindow::syncMemorySpot(int memoryIndex)
5465{
5466 auto it = m_radioModel.memories().constFind(memoryIndex);
5467 if (it == m_radioModel.memories().constEnd()) {
5468 removeMemorySpot(memoryIndex);
5469 return;
5470 }
5471
5472 const MemoryEntry& memory = it.value();
5473 if (memory.freq <= 0.0) {
5474 removeMemorySpot(memoryIndex);
5475 return;
5476 }
5477
5478 QMap<QString, QString> kvs;
5479 kvs["callsign"] = memorySpotLabel(memory).replace(' ', QChar(0x7f));
5480 kvs["rx_freq"] = QString::number(memory.freq, 'f', 6);
5481 kvs["tx_freq"] = QString::number(memory.freq, 'f', 6);
5482 kvs["source"] = "Memory";
5483 kvs["mode"] = memory.mode;
5484 kvs["color"] = "#FFFFC857";
5485 const QString comment = memorySpotComment(memory);
5486 if (!comment.isEmpty())
5487 kvs["comment"] = QString(comment).replace(' ', QChar(0x7f));
5488
5489 m_radioModel.spotModel().applySpotStatus(memorySpotId(memoryIndex), kvs);
5490}
5491
5492void MainWindow::removeMemorySpot(int memoryIndex)
5493{

Callers

nothing calls this directly

Calls 6

memorySpotLabelFunction · 0.85
memorySpotCommentFunction · 0.85
memorySpotIdFunction · 0.85
applySpotStatusMethod · 0.80
valueMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected