Receive only SSB modem added to allow occassional logging
   of a voice contact :>)
pull/2/head
David Freese 2010-04-08 12:25:46 -05:00
rodzic 586e3d5ea2
commit 0d77c1bedf
8 zmienionych plików z 145 dodań i 4 usunięć

Wyświetl plik

@ -364,6 +364,7 @@ fldigi_SOURCES += \
include/sound.h \
include/soundconf.h \
include/spot.h \
include/ssb.h \
include/stacktrace.h \
include/status.h \
include/strutil.h \
@ -462,6 +463,7 @@ fldigi_SOURCES += \
spot/notify.cxx \
spot/pskrep.cxx \
spot/spot.cxx \
ssb/ssb.cxx \
throb/throb.cxx \
trx/modem.cxx \
trx/trx.cxx \

Wyświetl plik

@ -85,6 +85,7 @@
#include "throb.h"
#include "wwv.h"
#include "analysis.h"
#include "ssb.h"
#include "ascii.h"
#include "globals.h"
@ -960,6 +961,11 @@ void init_modem(trx_mode mode, int freq)
*mode_info[mode].modem = new anal, freq);
break;
case MODE_SSB:
startup_modem(*mode_info[mode].modem ? *mode_info[mode].modem :
*mode_info[mode].modem = new ssb, freq);
break;
default:
LOG_ERROR("Unknown mode: %" PRIdPTR, mode);
return init_modem(MODE_PSK31, freq);
@ -2473,7 +2479,7 @@ Fl_Menu_Item menu_[] = {
{ mode_info[MODE_THROBX4].name, 0, cb_init_mode, (void *)MODE_THROBX4, 0, FL_NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0},
{"NBEMS modes", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0},
{"NBEMS modes", 0, 0, 0, FL_SUBMENU | FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_DOMINOEX11].name, 0, cb_init_mode, (void *)MODE_DOMINOEX11, 0, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_DOMINOEX22].name, 0, cb_init_mode, (void *)MODE_DOMINOEX22, FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_MFSK16].name, 0, cb_init_mode, (void *)MODE_MFSK16, 0, FL_NORMAL_LABEL, 0, 14, 0},
@ -2482,6 +2488,8 @@ Fl_Menu_Item menu_[] = {
{ mode_info[MODE_PSK250].name, 0, cb_init_mode, (void *)MODE_PSK250, 0, FL_NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0},
{ mode_info[MODE_SSB].name, 0, cb_init_mode, (void *)MODE_SSB, 0, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_WWV].name, 0, cb_init_mode, (void *)MODE_WWV, 0, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_ANALYSIS].name, 0, cb_init_mode, (void *)MODE_ANALYSIS, 0, FL_NORMAL_LABEL, 0, 14, 0},
@ -4018,7 +4026,7 @@ Fl_Menu_Item alt_menu_[] = {
{ mode_info[MODE_THROBX4].name, 0, cb_init_mode, (void *)MODE_THROBX4, 0, FL_NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0},
{"NBEMS modes", 0, 0, 0, FL_SUBMENU, FL_NORMAL_LABEL, 0, 14, 0},
{"NBEMS modes", 0, 0, 0, FL_SUBMENU | FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_DOMINOEX11].name, 0, cb_init_mode, (void *)MODE_DOMINOEX11, 0, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_DOMINOEX22].name, 0, cb_init_mode, (void *)MODE_DOMINOEX22, FL_MENU_DIVIDER, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_MFSK16].name, 0, cb_init_mode, (void *)MODE_MFSK16, 0, FL_NORMAL_LABEL, 0, 14, 0},
@ -4027,6 +4035,8 @@ Fl_Menu_Item alt_menu_[] = {
{ mode_info[MODE_PSK250].name, 0, cb_init_mode, (void *)MODE_PSK250, 0, FL_NORMAL_LABEL, 0, 14, 0},
{0,0,0,0,0,0,0,0,0},
{ mode_info[MODE_SSB].name, 0, cb_init_mode, (void *)MODE_SSB, 0, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_WWV].name, 0, cb_init_mode, (void *)MODE_WWV, 0, FL_NORMAL_LABEL, 0, 14, 0},
{ mode_info[MODE_ANALYSIS].name, 0, cb_init_mode, (void *)MODE_ANALYSIS, 0, FL_NORMAL_LABEL, 0, 14, 0},

Wyświetl plik

@ -108,8 +108,8 @@ const struct mode_info_t mode_info[NUM_MODES] = {
{ MODE_THROBX2, &throbx2_modem, "THRBX2", "ThrobX 2", "", "THRBX" },
{ MODE_THROBX4, &throbx4_modem, "THRBX4", "ThrobX 4", "", "THRBX" },
{ MODE_SSB, &ssb_modem, "SSB", "SSB", "", "SSB" },
{ MODE_WWV, &wwv_modem, "WWV", "WWV", "", "" },
{ MODE_ANALYSIS, &anal_modem, "ANALYSIS", "Freq Analysis", "", "" }
};

Wyświetl plik

@ -130,6 +130,7 @@ enum {
MODE_THROB_FIRST = MODE_THROB1,
MODE_THROB_LAST = MODE_THROBX4,
MODE_SSB,
MODE_WWV,
MODE_ANALYSIS,

Wyświetl plik

@ -259,6 +259,7 @@ extern modem *throbx4_modem;
extern modem *wwv_modem;
extern modem *anal_modem;
extern modem *ssb_modem;
#endif

43
src/include/ssb.h 100644
Wyświetl plik

@ -0,0 +1,43 @@
// ----------------------------------------------------------------------------
// ssb.h -- ssb modem
//
// Copyright (C) 2010
// Dave Freese, W1HKJ
//
// This file is part of fldigi.
//
// Fldigi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Fldigi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with fldigi. If not, see <http://www.gnu.org/licenses/>.
// ----------------------------------------------------------------------------
#ifndef _SSB_H
#define _SSB_H
#include "modem.h"
#define ssb_SampleRate 8000
class ssb : public modem
{
public:
ssb();
~ssb();
void init();
void rx_init();
void tx_init(SoundBase *sc);
void restart();
int rx_process(const double *buf, int len);
int tx_process();
};
#endif

81
src/ssb/ssb.cxx 100644
Wyświetl plik

@ -0,0 +1,81 @@
// ----------------------------------------------------------------------------
// ssb.cxx -- ssb modem
//
// Copyright (C) 2010
// Dave Freese, W1HKJ
//
// This file is part of fldigi.
//
// Fldigi is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Fldigi is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with fldigi. If not, see <http://www.gnu.org/licenses/>.
// ----------------------------------------------------------------------------
#include <config.h>
#include "ssb.h"
#include "modem.h"
#include "digiscope.h"
#include "fl_digi.h"
#include "debug.h"
#define ssb_bw 4
void ssb::tx_init(SoundBase *sc)
{
}
void ssb::rx_init()
{
put_MODEstatus(mode);
}
void ssb::init()
{
modem::init();
rx_init();
set_scope_mode(Digiscope::BLANK);
}
ssb::~ssb()
{
}
void ssb::restart()
{
set_bandwidth(ssb_bw);
}
ssb::ssb()
{
mode = MODE_SSB;
samplerate = 8000;
cap &= ~CAP_TX;
restart();
}
// dummy process
int ssb::rx_process(const double *buf, int len)
{
return 0;
}
//=====================================================================
// ssb transmit
// dummy process
//=====================================================================
int ssb::tx_process()
{
return -1;
}

Wyświetl plik

@ -113,6 +113,7 @@ modem *throbx4_modem = 0;
modem *wwv_modem = 0;
modem *anal_modem = 0;
modem *ssb_modem = 0;
trx_mode modem::get_mode()
{
@ -184,7 +185,9 @@ bool modem::freqlocked()
double modem::get_txfreq(void)
{
if (mailserver && progdefaults.PSKmailSweetSpot)
if (unlikely(!(cap & CAP_TX)))
return 0;
else if (mailserver && progdefaults.PSKmailSweetSpot)
return progdefaults.PSKsweetspot;
return tx_frequency;
}