Correctly handle pctx=0.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5718 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2015-07-13 01:12:28 +00:00
parent 27061057f7
commit 310481bcaa
1 changed files with 10 additions and 4 deletions

View File

@ -130,17 +130,23 @@ int create_tx_schedule(int pctx)
needed=60*(pctx/100.0)+0.5;
memset(tx,0,sizeof(char)*60);
if( pctx == 0 ) return 0;
if( pctx <= 25 ) { // Use K1JT's algorithm in this regime
rxavg=100.0/pctx-1.0;
i=0;
while(i<60) {
while(1) {
x=(rand()%100)/100.0;
nrx=(rxavg+3.0*x-1.0); //2-5 for 25%
i=i+nrx+1;
tx[i/10][i%10]=1;
if( i < 60 ) {
tx[i/10][i%10]=1;
} else {
break;
}
}
return 1;
return 0;
} else if( pctx > 25 && pctx < 33 ) {
ntxlim=1;
ntxbandmin=1;