diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp
index b9e1f9e8f2..0f49787711 100644
--- a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp
+++ b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp
@@ -233,11 +233,16 @@ bool RadiosondeDemod::handleMessage(const Message& cmd)
if (frame->m_posValid)
{
m_logStream << frame->m_latitude << ","
- << frame->m_longitude << ",";
+ << frame->m_longitude << ","
+ << frame->m_height << ","
+ << frame->m_speed << ","
+ << frame->m_verticalRate << ","
+ << frame->m_heading << ","
+ ;
}
else
{
- m_logStream << ",,";
+ m_logStream << ",,,,,,";
}
if (frame->m_measValid)
{
@@ -378,7 +383,7 @@ void RadiosondeDemod::applySettings(const RadiosondeDemodSettings& settings, boo
if (newFile)
{
// Write header
- m_logStream << "Date,Time,Data,Serial,Frame,Lat,Lon,P (hPa),T (C), U (%)\n";
+ m_logStream << "Date,Time,Data,Serial,Frame,Lat,Lon,Alt (m),Speed (m/s),V/R (m/s),Heading,P (hPa),T (C), U (%)\n";
}
}
else
diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp
index ebbb5d0de2..713549267c 100644
--- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp
+++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.cpp
@@ -86,6 +86,8 @@ void RadiosondeDemodGUI::resizeTable()
ui->frames->setItem(row, FRAME_COL_GPS_SATS, new QTableWidgetItem("12"));
ui->frames->setItem(row, FRAME_COL_ECC, new QTableWidgetItem("12"));
ui->frames->setItem(row, FRAME_COL_CORR, new QTableWidgetItem("-500"));
+ ui->frames->setItem(row, FRAME_COL_RANGE, new QTableWidgetItem("200.0"));
+ ui->frames->setItem(row, FRAME_COL_FREQUENCY, new QTableWidgetItem("434.125"));
ui->frames->resizeColumnsToContents();
ui->frames->removeRow(row);
}
@@ -172,7 +174,7 @@ bool RadiosondeDemodGUI::deserialize(const QByteArray& data)
}
// Add row to table
-void RadiosondeDemodGUI::frameReceived(const QByteArray& frame, const QDateTime& dateTime, int errorsCorrected, int threshold)
+void RadiosondeDemodGUI::frameReceived(const QByteArray& frame, const QDateTime& dateTime, int errorsCorrected, int threshold, bool loadCSV)
{
RS41Frame *radiosonde;
@@ -214,6 +216,8 @@ void RadiosondeDemodGUI::frameReceived(const QByteArray& frame, const QDateTime&
QTableWidgetItem *gpsSatsItem = new QTableWidgetItem();
QTableWidgetItem *eccItem = new QTableWidgetItem();
QTableWidgetItem *thItem = new QTableWidgetItem();
+ QTableWidgetItem *rangeItem = new QTableWidgetItem();
+ QTableWidgetItem *frequencyItem = new QTableWidgetItem();
ui->frames->setItem(row, FRAME_COL_DATE, dateItem);
ui->frames->setItem(row, FRAME_COL_TIME, timeItem);
@@ -241,6 +245,8 @@ void RadiosondeDemodGUI::frameReceived(const QByteArray& frame, const QDateTime&
ui->frames->setItem(row, FRAME_COL_GPS_SATS, gpsSatsItem);
ui->frames->setItem(row, FRAME_COL_ECC, eccItem);
ui->frames->setItem(row, FRAME_COL_CORR, thItem);
+ ui->frames->setItem(row, FRAME_COL_RANGE, rangeItem);
+ ui->frames->setItem(row, FRAME_COL_FREQUENCY, frequencyItem);
dateItem->setData(Qt::DisplayRole, dateTime.date());
timeItem->setData(Qt::DisplayRole, dateTime.time());
@@ -281,6 +287,14 @@ void RadiosondeDemodGUI::frameReceived(const QByteArray& frame, const QDateTime&
verticalRateItem->setData(Qt::DisplayRole, radiosonde->m_verticalRate);
headingItem->setData(Qt::DisplayRole, radiosonde->m_heading);
gpsSatsItem->setData(Qt::DisplayRole, radiosonde->m_satellitesUsed);
+ // Calc distance from My Position to Radiosone
+ Real stationLatitude = MainCore::instance()->getSettings().getLatitude();
+ Real stationLongitude = MainCore::instance()->getSettings().getLongitude();
+ Real stationAltitude = MainCore::instance()->getSettings().getAltitude();
+ QGeoCoordinate stationPosition(stationLatitude, stationLongitude, stationAltitude);
+ QGeoCoordinate radiosondePosition(radiosonde->m_latitude, radiosonde->m_longitude, radiosonde->m_height);
+ float distance = stationPosition.distanceTo(radiosondePosition);
+ rangeItem->setData(Qt::DisplayRole, (int)std::round(distance / 1000.0));
}
if (radiosonde->m_gpsInfoValid)
@@ -295,8 +309,12 @@ void RadiosondeDemodGUI::frameReceived(const QByteArray& frame, const QDateTime&
humidityItem->setData(Qt::DisplayRole, radiosonde->getHumidityString(subframe));
}
- eccItem->setData(Qt::DisplayRole, errorsCorrected);
- thItem->setData(Qt::DisplayRole, threshold);
+ if (!loadCSV)
+ {
+ eccItem->setData(Qt::DisplayRole, errorsCorrected);
+ thItem->setData(Qt::DisplayRole, threshold);
+ frequencyItem->setData(Qt::DisplayRole, (m_deviceCenterFrequency + m_settings.m_inputFrequencyOffset) / 1000000.0);
+ }
filterRow(row);
ui->frames->setSortingEnabled(true);
@@ -324,7 +342,7 @@ bool RadiosondeDemodGUI::handleMessage(const Message& frame)
else if (RadiosondeDemod::MsgMessage::match(frame))
{
RadiosondeDemod::MsgMessage& report = (RadiosondeDemod::MsgMessage&) frame;
- frameReceived(report.getMessage(), report.getDateTime(), report.getErrorsCorrected(), report.getThreshold());
+ frameReceived(report.getMessage(), report.getDateTime(), report.getErrorsCorrected(), report.getThreshold(), false);
return true;
}
else if (DSPSignalNotification::match(frame))
@@ -643,6 +661,7 @@ RadiosondeDemodGUI::RadiosondeDemodGUI(PluginAPI* pluginAPI, DeviceUISet *device
ui->frames->setItemDelegateForColumn(FRAME_COL_VERTICAL_RATE, new DecimalDelegate(1));
ui->frames->setItemDelegateForColumn(FRAME_COL_HEADING, new DecimalDelegate(1));
ui->frames->setItemDelegateForColumn(FRAME_COL_GPS_TIME, new DateTimeDelegate("yyyy/MM/dd hh:mm:ss"));
+ ui->frames->setItemDelegateForColumn(FRAME_COL_FREQUENCY, new DecimalDelegate(3));
ui->scopeContainer->setVisible(false);
@@ -869,7 +888,7 @@ void RadiosondeDemodGUI::on_logOpen_clicked()
QByteArray bytes = QByteArray::fromHex(cols[dataCol].toLatin1());
// Add to table
- frameReceived(bytes, dateTime, 0, 0);
+ frameReceived(bytes, dateTime, 0, 0, true);
// Forward to Radiosonde feature
for (const auto& pipe : radiosondePipes)
diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.h b/plugins/channelrx/demodradiosonde/radiosondedemodgui.h
index 0e987abbd3..fa288179be 100644
--- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.h
+++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.h
@@ -96,7 +96,7 @@ public slots:
void blockApplySettings(bool block);
void applySettings(bool force = false);
void displaySettings();
- void frameReceived(const QByteArray& frame, const QDateTime& dateTime, int errorsCorrected, int threshold);
+ void frameReceived(const QByteArray& frame, const QDateTime& dateTime, int errorsCorrected, int threshold, bool loadCSV);
bool handleMessage(const Message& message);
void makeUIConnections();
void updateAbsoluteCenterFrequency();
@@ -133,7 +133,9 @@ public slots:
FRAME_COL_GPS_TIME,
FRAME_COL_GPS_SATS,
FRAME_COL_ECC,
- FRAME_COL_CORR
+ FRAME_COL_CORR,
+ FRAME_COL_RANGE,
+ FRAME_COL_FREQUENCY
};
private slots:
diff --git a/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui b/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui
index 51a75c1b21..9d9f046ea1 100644
--- a/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui
+++ b/plugins/channelrx/demodradiosonde/radiosondedemodgui.ui
@@ -846,6 +846,22 @@