* When changing wefax slant, prompts to save configuration on exit.
  * Changed wefaxNNN to wefaxNNN_modem
  * Changed sample rate initialization
  * Fixed prototype for wefax::getfile
  * Fixed logging of fax images.
pull/1/head
David Freese 2011-12-08 08:02:34 -06:00
rodzic ee1ab43ae4
commit 0c064c64a4
6 zmienionych plików z 27 dodań i 63 usunięć

Wyświetl plik

@ -76,8 +76,8 @@ const struct mode_info_t mode_info[NUM_MODES] = {
{ MODE_MFSK31, &mfsk31_modem, "MFSK31", "MFSK-31", "MFSK31", "MFSK31", "MK31" },
{ MODE_MFSK64, &mfsk64_modem, "MFSK64", "MFSK-64", "MFSK64", "MFSK64", "MK64" },
{ MODE_WEFAX_576, &wefax576, "WEFAX576", "WEFAX-IOC576", "WEFAXIOC576", "FAX", "FX576" },
{ MODE_WEFAX_288, &wefax288, "WEFAX288", "WEFAX-IOC288", "WEFAXIOC288", "FAX", "FX288" },
{ MODE_WEFAX_576, &wefax576_modem, "WEFAX576", "WEFAX-IOC576", "WEFAXIOC576", "FAX", "FX576" },
{ MODE_WEFAX_288, &wefax288_modem, "WEFAX288", "WEFAX-IOC288", "WEFAXIOC288", "FAX", "FX288" },
{ MODE_MT63_500, &mt63_500_modem, "MT63-500", "MT63-500", "MT63-500", "MT63", "MT63-500" },
{ MODE_MT63_1000, &mt63_1000_modem, "MT63-1K", "MT63-1000", "MT63-1XX", "MT63", "MT63 1K" },

Wyświetl plik

@ -197,8 +197,8 @@ extern modem *mfsk22_modem;
extern modem *mfsk31_modem;
extern modem *mfsk64_modem;
extern modem *wefax576;
extern modem *wefax288;
extern modem *wefax576_modem;
extern modem *wefax288_modem;
extern modem *mt63_500_modem;
extern modem *mt63_1000_modem;

Wyświetl plik

@ -10,10 +10,6 @@
#include "mbuffer.h"
#include "logbook.h"
#define WEFAXSampleRate 11025
// #define WEFAXSampleRate 8000
/// Forward definition.
class fax_implementation ;
@ -119,7 +115,7 @@ public:
void put_received_file(const std::string & filnam);
/// Used by XML-RPC to get the list of received files.
std::string get_received_file(double max_seconds=max_delay);
std::string get_received_file(int max_seconds=max_delay);
/// Called by XML-RPC to send a file which resides on the machine where fldigi runs.
std::string send_file( const std::string & filnam, double max_seconds=max_delay);

Wyświetl plik

@ -55,8 +55,8 @@ modem *mfsk22_modem = 0;
modem *mfsk31_modem = 0;
modem *mfsk64_modem = 0;
modem *wefax576 = 0;
modem *wefax288 = 0;
modem *wefax576_modem = 0;
modem *wefax288_modem = 0;
modem *mt63_500_modem = 0;
modem *mt63_1000_modem = 0;

Wyświetl plik

@ -726,6 +726,9 @@ static void wefax_cb_pic_ratio( Fl_Widget *, void * )
/// And we update the configuration structure.
progdefaults.wefax_slant = rx_slant_ratio ;
/// Will prompt for saving configuration when exiting.
progdefaults.changed = true;
}
/// Possible zooms. The value is processed by class picture.
@ -1041,7 +1044,7 @@ void wefax_pic::create_rx_viewer(void)
wefax_cnt_rx_ratio->align(FL_ALIGN_LEFT);
wefax_cnt_rx_ratio->type(FL_SIMPLE_COUNTER);
wefax_cnt_rx_ratio->callback(wefax_cb_pic_ratio, 0);
wefax_cnt_rx_ratio->tooltip("Adjust imge slant to correct soundcard clock error.");
wefax_cnt_rx_ratio->tooltip("Adjust image slant to correct soundcard clock error.");
static const char * title_center = "Center" ;
wid_off_low += wid_btn_curr + fl_width( title_center );

Wyświetl plik

@ -764,11 +764,11 @@ public:
}
/// Returns a received file name, by chronological order.
std::string get_received_file( double max_seconds )
std::string get_received_file( int max_seconds )
{
guard_lock g( m_sync_rx.mtxp() );
LOG_INFO(_("delay=%f"), max_seconds );
LOG_INFO(_("delay=%d"), max_seconds );
if( m_received_files.empty() )
{
if( ! m_sync_rx.wait(max_seconds) ) return std::string();
@ -946,13 +946,10 @@ public:
static size_t cnt_upd = 0 ;
if( cnt_upd == 0 ) {
if( m_correlation_buffer.size() != corr_buff_sz ) {
m_correlation_buffer.resize( corr_buff_sz, 0 );
m_current_corr = 0.0 ;
m_curr_corr_avg = 0.0 ;
return ;
}
if( m_correlation_buffer.size() != corr_buff_sz ) {
m_correlation_buffer.resize( corr_buff_sz, 0 );
m_current_corr = 0.0 ;
m_curr_corr_avg = 0.0 ;
}
if( ( cnt_upd % corr_samples_line ) == 0 ) {
@ -1839,7 +1836,7 @@ wefax::wefax(trx_mode wefax_mode) : modem()
wefax::mode = wefax_mode;
modem::samplerate = WEFAXSampleRate ;
modem::samplerate = 11025;
m_impl = new fax_implementation(wefax_mode, this);
@ -2104,34 +2101,10 @@ void wefax::qso_rec_init(void)
/// Ideally we should find out the name of the fax station.
m_qso_rec.putField(CALL, "Wefax");
m_qso_rec.putField(NAME, "Weather fax");
m_qso_rec.setDateTime(true);
m_qso_rec.setFrequency( wf->rfcarrier() );
time_t tmp_time = time(NULL);
struct tm tmp_tm ;
localtime_r( &tmp_time, &tmp_tm );
char buf_date[64] ;
snprintf( buf_date, sizeof(buf_date),
"%04d%02d%02d",
1900 + tmp_tm.tm_year,
1 + tmp_tm.tm_mon,
tmp_tm.tm_mday );
m_qso_rec.putField(QSO_DATE, buf_date);
char buf_timeon[64] ;
snprintf( buf_timeon, sizeof(buf_timeon),
"%02d%02d",
tmp_tm.tm_hour,
tmp_tm.tm_min );
m_qso_rec.putField(TIME_ON, buf_timeon);
long long tmp_fl = wf->rfcarrier() ;
double freq_dbl = tmp_fl / 1000000.0 ;
char buf_freq[64];
snprintf( buf_freq, sizeof(buf_freq), "%lf", freq_dbl );
m_qso_rec.putField(FREQ, buf_freq );
/// The method get_mode should be const.
m_qso_rec.putField(MODE, mode_info[ const_cast<wefax*>(this)->get_mode()].adif_name );
m_qso_rec.putField(MODE, mode_info[get_mode()].adif_name );
// m_qso_rec.putField(QTH, inpQth_log->value());
// m_qso_rec.putField(STATE, inpState_log->value());
@ -2161,21 +2134,13 @@ void wefax::qso_rec_save(void)
return ;
}
time_t tmp_time = time(NULL);
struct tm tmp_tm ;
localtime_r( &tmp_time, &tmp_tm );
char buf_timeoff[64] ;
snprintf( buf_timeoff, sizeof(buf_timeoff),
"%02d%02d",
tmp_tm.tm_hour,
tmp_tm.tm_min );
m_qso_rec.putField(TIME_OFF, buf_timeoff);
adifFile.writeLog (logbook_filename.c_str(), &qsodb);
qsodb.isdirty(0);
m_qso_rec.setDateTime(false);
qsodb.qsoNewRec (&m_qso_rec);
qsodb.isdirty(0);
loadBrowser(true);
adifFile.writeLog (logbook_filename.c_str(), &qsodb);
// dxcc_entity_cache_add(&rec);
LOG_INFO( _("Updating log book %s"), logbook_filename.c_str() );
}
@ -2201,7 +2166,7 @@ void wefax::put_received_file( const std::string &filnam )
}
/// Returns a received file name, by chronological order.
std::string wefax::get_received_file( double max_seconds )
std::string wefax::get_received_file( int max_seconds )
{
return m_impl->get_received_file( max_seconds );
}