From fbd3058d00e088eaa1b82c8553cb29b7a138facf Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Fri, 5 Jun 2015 19:48:53 +0000 Subject: [PATCH] Fix up WsprTxScheduler.h, place variables in unnamed namespace, etc. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5540 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- WSPRBandHopping.cpp | 2 +- WsprTxScheduler.cpp | 33 +++++++++++---------------------- WsprTxScheduler.h | 21 ++++----------------- 3 files changed, 16 insertions(+), 40 deletions(-) diff --git a/WSPRBandHopping.cpp b/WSPRBandHopping.cpp index e85b7ebaa..eaeb34aa7 100644 --- a/WSPRBandHopping.cpp +++ b/WSPRBandHopping.cpp @@ -8,6 +8,7 @@ #include "SettingsGroup.hpp" #include "Configuration.hpp" #include "FrequencyList.hpp" +#include "WsprTxScheduler.h" #include "pimpl_impl.hpp" #include "moc_WSPRBandHopping.cpp" @@ -22,7 +23,6 @@ extern "C" , int * ntxnext, int my_grid_len); #endif }; -extern int next_tx_state(int pctx); namespace { diff --git a/WsprTxScheduler.cpp b/WsprTxScheduler.cpp index 00c5fa58f..cc6871409 100644 --- a/WsprTxScheduler.cpp +++ b/WsprTxScheduler.cpp @@ -1,4 +1,14 @@ -#include "WsprTxScheduler.h" +#include +#include +#include +#include +#include + +namespace +{ + char tx[6][10]; + int tx_table_2hr_slot=-1, tx_table_pctx=0; +}; int tx_band_sum(char bsum[10]) { @@ -166,27 +176,6 @@ int next_tx_state(int pctx) tx_table_pctx = pctx; } - cout << "Hour " << hour << " Minute " << minute << endl; - cout << "tx_2hr_slot " << tx_2hr_slot << endl; - cout << "tx_20min_slot " << tx_20min_slot << endl; - cout << "tx_2min_slot " << tx_2min_slot << endl; - cout << "tx_table_2hr_slot " << tx_table_2hr_slot << endl; - cout << "Requested % " << pctx << " Actual % " << 100*tx_sum()/60 << endl; tx_print(); return tx[tx_20min_slot][tx_2min_slot]; } -/* -int main(int argc, char *argv[]) -{ - - if( argc == 2 ) { - pctx = atoi(argv[1]); - } else { - pctx = 25; - } - tx_table_2hr_slot = 0; - cout << "Next TX state: " << next_tx_state(m_pctx) << endl; - cout << "Requested % " << pctx << " Actual % " << 100*tx_sum()/60 << endl; - tx_print(); -} -*/ diff --git a/WsprTxScheduler.h b/WsprTxScheduler.h index e19f17456..fa8371657 100644 --- a/WsprTxScheduler.h +++ b/WsprTxScheduler.h @@ -1,19 +1,6 @@ -#include -#include -#include -#include -#include +#ifndef WSPR_TX_SCHEDULER_H_ +#define WSPR_TX_SCHEDULER_H_ -using namespace std; +int next_tx_state (int pctx); -char tx[6][10]; -int tx_table_2hr_slot=-1, tx_table_pctx=0; - -int tx_band_sum(char bsum[10]); -int tx_add_to_band(int band); -int tx_sum(); -int tx_add_one(char* tx); -int tx_trim(char* tx, int ntxlim); -void tx_print(); -int create_tx_schedule(int pctx); -int next_tx_state(int pctx); +#endif