Merge branch 'sm0svx:master' into mute-rx-onpty

This commit is contained in:
Adi Bier 2022-08-04 10:04:39 +02:00 committed by GitHub
commit 8edbfbdb54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 83 additions and 32 deletions

View File

@ -171,15 +171,15 @@ class StateMachine
[&](Timer*)
{
assert(m_state != nullptr);
static_cast<StateTopBaseT*>(m_state)->timeoutEvent();
clearTimeout();
static_cast<StateTopBaseT*>(m_state)->timeoutEvent();
});
m_at_timer.expired.connect(
[&](AtTimer*)
{
assert(m_state != nullptr);
static_cast<StateTopBaseT*>(m_state)->timeoutAtEvent();
clearTimeoutAt();
static_cast<StateTopBaseT*>(m_state)->timeoutAtEvent();
});
}
@ -299,6 +299,10 @@ class StateMachine
*/
void setTimeout(int timeout_ms)
{
#ifdef ASYNC_STATE_MACHINE_DEBUG
std::cout << "### StateMachine: setTimeout(" << timeout_ms << ")"
<< std::endl;
#endif
m_timer.setTimeout(timeout_ms);
m_timer.setEnable(true);
}
@ -327,6 +331,9 @@ class StateMachine
*/
void clearTimeout(void)
{
#ifdef ASYNC_STATE_MACHINE_DEBUG
std::cout << "### StateMachine: clearTimeout()" << std::endl;
#endif
m_timer.setEnable(false);
}

View File

@ -481,7 +481,7 @@ class TcpPrioClientBase::Machine
: Async::StateBase<StateConnected, StateConnectedLowerPrio>
{
static constexpr auto NAME = "ConnectedLowerPrio";
}; /* StateConnecting */
}; /* StateConnectedLowerPrio */
struct StateConnectedLowerPrioIdle

View File

@ -54,10 +54,10 @@ neighbouring channels. The default value is 5000Hz.
.BI "-H|--headroom=" "headroom in dB"
The headroom is the margin to add above the maximum deviation level. Adding a
headroom will allow SvxLink to handle levels above the maximum deviation level
without causing immediate distorsion. The default is 6dB which mean that
without causing immediate distortion. The default is 6dB which mean that
SvxLink can handle twice the specified maximum deviation. If both maxdev and
headroom are left at their default this will mean that SvxLink can handle 10kHz
deviation without distorsion.
deviation without distortion.
Changing the headroom cause a lot of different effects so don't do that unless
you are prepared to deal with the problems. For example, increasing the

View File

@ -1477,7 +1477,7 @@
the input volume. It is enabled by setting the PEAK_METER variable in
the receiver configuration section. Start SvxLink and open the squelch on
the receiver so that only noise is available on the input. Adjust the input
volume until you see messages printed about distorsion. Then lower the
volume until you see messages printed about distortion. Then lower the
volume until there are no more messages.
* Now using libsigc++ version 1.2 instead of the old and outdated 1.0.

View File

@ -83,6 +83,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
****************************************************************************/
using namespace std;
using namespace std::placeholders;
using namespace Async;
@ -501,7 +502,7 @@ int main(int argc, const char *argv[])
vector<float> mod_idxs(mod_fqs.size());
transform(mod_fqs.begin(), mod_fqs.end(), mod_idxs.begin(),
bind1st(divides<float>(), caldev));
std::bind(divides<float>(), caldev, _1));
float mod_level = 100.0 * caldev / (maxdev * pow(10.0, headroom_db / 20.0));
cout << "--- Modulation frequencies [Hz] : ";
copy(mod_fqs.begin(), mod_fqs.end(), ostream_iterator<float>(cout, " "));

View File

@ -39,6 +39,22 @@ if {$logic_name != [namespace tail [namespace current]]} {
}
#
# A helper function for announcing a talkgroup.
# If there is an audio clip matching the name talk_group-<tg> it will be played
# instead of spelling the digits. Look at the documentation for playMsg for
# more information on where to put the audio clip.
#
# tg - The talkgroup to announce
#
proc say_talkgroup {tg} {
if [playMsg "Core" "talk_group-$tg" 0] {
} else {
spellNumber $tg
}
}
#
# Executed when an unknown command is received
# cmd - The command string
@ -69,11 +85,11 @@ proc report_tg_status {} {
set prev_announce_time [clock seconds]
set prev_announce_tg $selected_tg
playMsg "Core" "talk_group"
spellNumber $selected_tg
say_talkgroup $selected_tg
} else {
playMsg "Core" "previous"
playMsg "Core" "talk_group"
spellNumber $previous_tg
say_talkgroup $previous_tg
}
}
@ -116,7 +132,7 @@ proc tg_local_activation {new_tg old_tg} {
set prev_announce_tg $new_tg
playSilence 100
playMsg "Core" "talk_group"
spellNumber $new_tg
say_talkgroup $new_tg
}
}
@ -143,7 +159,7 @@ proc tg_remote_activation {new_tg old_tg} {
set prev_announce_tg $new_tg
playSilence 100
playMsg "Core" "talk_group"
spellNumber $new_tg
say_talkgroup $new_tg
}
}
@ -175,7 +191,7 @@ proc tg_command_activation {new_tg old_tg} {
set prev_announce_tg $new_tg
playSilence 100
playMsg "Core" "talk_group"
spellNumber $new_tg
say_talkgroup $new_tg
}
@ -195,7 +211,7 @@ proc tg_default_activation {new_tg old_tg} {
# set prev_announce_tg $new_tg
# playSilence 100
# playMsg "Core" "talk_group"
# spellNumber $new_tg
# say_talkgroup $new_tg
#}
}
@ -216,7 +232,7 @@ proc tg_qsy {new_tg old_tg} {
playSilence 100
playMsg "Core" "qsy"
#playMsg "Core" "talk_group"
spellNumber $new_tg
say_talkgroup $new_tg
}
@ -254,7 +270,7 @@ proc tg_qsy_failed {} {
proc tg_qsy_pending {tg} {
playSilence 100
playMsg "Core" "qsy"
spellNumber $tg
say_talkgroup $tg
playMsg "Core" "pending"
}
@ -269,7 +285,7 @@ proc tg_qsy_ignored {tg} {
playSilence 100
if {!$qsy_pending_active} {
playMsg "Core" "qsy"
spellNumber $tg
say_talkgroup $tg
}
playMsg "Core" "ignored"
playSilence 500
@ -337,7 +353,7 @@ proc tmp_monitor_add {tg} {
#puts "### tmp_monitor_add: $tg"
playSilence 100
playMsg "Core" "monitor"
spellNumber $tg
say_talkgroup $tg
}

View File

@ -18,17 +18,43 @@
# EchoLink, Help, Parrot etc. If a sound is not found in the specified context,
# a search in the "Default" context is done.
#
proc playMsg {context msg} {
# It's also possible to have local overrides by putting files under a "local"
# directory either directly under the "sounds" directory or under the language
# pack directory. For example if context is "Core" and the language is set to
# "en_US" the following paths will be searched:
#
# .../sounds/en_US/local/Core/
# .../sounds/local/Core/
# .../sounds/en_US/Core/
# .../sounds/en_US/local/Default/
# .../sounds/local/Default/
# .../sounds/en_US/Default/
#
# context - The context to look for the sound files in (e.g Default,
# Parrot etc).
# msg - The basename of the file to play
# warn - Set to 0 to not print a warning if no sound clip was found
#
proc playMsg {context msg {warn 1}} {
global basedir
global langdir
set candidates [glob -nocomplain "$langdir/$context/$msg.{wav,raw,gsm}" \
"$langdir/Default/$msg.{wav,raw,gsm}"];
if { [llength $candidates] > 0 } {
set candidates [glob -nocomplain \
"$langdir/local/$context/$msg.{wav,raw,gsm}" \
"$basedir/sounds/local/$context/$msg.{wav,raw,gsm}" \
"$langdir/$context/$msg.{wav,raw,gsm}" \
"$langdir/local/Default/$msg.{wav,raw,gsm}" \
"$basedir/sounds/local/Default/$msg.{wav,raw,gsm}" \
"$langdir/Default/$msg.{wav,raw,gsm}"];
if {[llength $candidates] > 0} {
playFile [lindex $candidates 0];
} else {
puts "*** WARNING: Could not find audio clip \"$msg\" in context \"$context\"";
if {$warn} {
puts "*** WARNING: Could not find audio clip \"$msg\" in context \"$context\"";
}
return 0
}
return 1
}

View File

@ -137,7 +137,7 @@ class PeakMeter : public AudioPassthrough
if (i < ret)
{
cout << name
<< ": Distorsion detected! Please lower the input volume!\n";
<< ": Distortion detected! Please lower the input volume!\n";
}
return ret;

View File

@ -300,7 +300,7 @@ void RtlSdr::handleIq(const complex<uint8_t> *samples, int samp_count)
{
if (dist_print_cnt == static_cast<int>(samp_rate))
{
cout << "*** WARNING: Distorsion detected on Rtl tuner "
cout << "*** WARNING: Distortion detected on Rtl tuner "
<< displayName() << ". Lower the RF gain\n";
}
dist_print_cnt -= samp_count;
@ -423,7 +423,7 @@ int RtlSdr::dataReceived(Async::TcpConnection *con, void *buf, int count)
{
if (dist_print_cnt == static_cast<int>(samp_rate))
{
cout << "*** WARNING: Distorsion detected on RtlSdr tuner "
cout << "*** WARNING: Distortion detected on RtlSdr tuner "
<< con->remoteHost() << ":" << con->remotePort() << ". "
<< "Lower the RF gain\n";
}

View File

@ -143,7 +143,7 @@ class RtlSdr : public sigc::trackable
virtual ~RtlSdr(void);
/**
* @brief Enable printing of distorsion warnings
* @brief Enable printing of distortion warnings
* @param enable Set to \em true to enable printing
*/
void enableDistPrint(bool enable);

View File

@ -71,6 +71,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
****************************************************************************/
using namespace std;
using namespace std::placeholders;
@ -387,7 +388,7 @@ void WbRxRtlSdr::rtlReadyStateChanged(void)
vector<float> tuner_gains;
tuner_gains.assign(int_tuner_gains.begin(), int_tuner_gains.end());
transform(tuner_gains.begin(), tuner_gains.end(),
tuner_gains.begin(), bind2nd(divides<float>(),10.0));
tuner_gains.begin(), std::bind(divides<float>(), _1, 10.0));
cout << "\tValid tuner gains : ";
copy(tuner_gains.begin(), tuner_gains.end(),
ostream_iterator<float>(cout, " "));

View File

@ -8,10 +8,10 @@ QTEL=1.2.4.99.5
LIBECHOLIB=1.3.3.99.2
# Version for the Async library
LIBASYNC=1.6.99.22
LIBASYNC=1.6.99.23
# SvxLink versions
SVXLINK=1.7.99.68
SVXLINK=1.7.99.71
MODULE_HELP=1.0.0
MODULE_PARROT=1.1.1
MODULE_ECHO_LINK=1.5.99.3
@ -25,13 +25,13 @@ MODULE_FRN=1.1.0
MODULE_TRX=1.0.0
# Version for the RemoteTrx application
REMOTE_TRX=1.3.99.9
REMOTE_TRX=1.3.99.11
# Version for the signal level calibration utility
SIGLEV_DET_CAL=1.0.7.99.5
SIGLEV_DET_CAL=1.0.7.99.7
# Version for the deviation calibration utility
DEVCAL=1.0.2.99.6
DEVCAL=1.0.2.99.8
# Version for svxserver
SVXSERVER=0.0.6