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
This commit is contained in:
Steven Franke 2015-06-05 19:48:53 +00:00
parent 7cb711779e
commit 29b24c4ca0
3 changed files with 16 additions and 40 deletions

View File

@ -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
{

View File

@ -1,4 +1,14 @@
#include "WsprTxScheduler.h"
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <iostream>
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();
}
*/

View File

@ -1,19 +1,6 @@
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#include <iostream>
#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