Skip to content

Commit

Permalink
ChirpChat modulator enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
f4exb committed Mar 25, 2024
1 parent a728563 commit c833432
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
4 changes: 2 additions & 2 deletions plugins/channeltx/modchirpchat/chirpchatmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ void ChirpChatMod::applySettings(const ChirpChatModSettings& settings, bool forc

if (getMessageQueueToGUI())
{
MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime);
MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime, symbols.size());
getMessageQueueToGUI()->push(rpt);
}
}
Expand Down Expand Up @@ -1095,7 +1095,7 @@ void ChirpChatMod::udpRx()

if (getMessageQueueToGUI())
{
MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime);
MsgReportPayloadTime *rpt = MsgReportPayloadTime::create(m_currentPayloadTime, symbols.size());
getMessageQueueToGUI()->push(rpt);
}
}
Expand Down
11 changes: 7 additions & 4 deletions plugins/channeltx/modchirpchat/chirpchatmod.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,19 @@ class ChirpChatMod : public BasebandSampleSource, public ChannelAPI {

public:
float getPayloadTimeMs() const { return m_timeMs; }
static MsgReportPayloadTime* create(float timeMs) {
return new MsgReportPayloadTime(timeMs);
std::size_t getNbSymbols() const { return m_nbSymbols; }
static MsgReportPayloadTime* create(float timeMs, std::size_t nbSymbols) {
return new MsgReportPayloadTime(timeMs, nbSymbols);
}

private:
float m_timeMs; //!< time in milliseconds
std::size_t m_nbSymbols; //!< number of symbols

MsgReportPayloadTime(float timeMs) :
MsgReportPayloadTime(float timeMs, std::size_t nbSymbols) :
Message(),
m_timeMs(timeMs)
m_timeMs(timeMs),
m_nbSymbols(nbSymbols)
{}
};

Expand Down
1 change: 1 addition & 0 deletions plugins/channeltx/modchirpchat/chirpchatmodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ bool ChirpChatModGUI::handleMessage(const Message& message)
fourthsChirps += m_settings.hasSyncWord() ? 8 : 0;
fourthsChirps += m_settings.getNbSFDFourths();
float controlMs = fourthsChirps * fourthsMs; // preamble + sync word + SFD
ui->timeMessageLengthText->setText(tr("%1").arg(rpt.getNbSymbols()));
ui->timePayloadText->setText(tr("%1 ms").arg(QString::number(rpt.getPayloadTimeMs(), 'f', 0)));
ui->timeTotalText->setText(tr("%1 ms").arg(QString::number(rpt.getPayloadTimeMs() + controlMs, 'f', 0)));
ui->timeSymbolText->setText(tr("%1 ms").arg(QString::number(4.0*fourthsMs, 'f', 1)));
Expand Down
25 changes: 21 additions & 4 deletions plugins/channeltx/modchirpchat/chirpchatmodgui.ui
Original file line number Diff line number Diff line change
Expand Up @@ -722,12 +722,12 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="report">
<widget class="QLineEdit" name="myLocator">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="toolTip">
<string>Report to callee</string>
<string>Caller QRA locator</string>
</property>
<property name="text">
<string/>
Expand All @@ -751,12 +751,12 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="myLocator">
<widget class="QLineEdit" name="report">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
<property name="toolTip">
<string>Caller QRA locator</string>
<string>Report to callee</string>
</property>
<property name="text">
<string/>
Expand Down Expand Up @@ -1028,6 +1028,23 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="timeMessageLengthLabel">
<property name="text">
<string>ML</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="timeMessageLengthText">
<property name="text">
<string>000</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
Expand Down

0 comments on commit c833432

Please sign in to comment.