Work-in-progress with Fox-mode code. Contains incomplete and untested code!

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8270 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-11-30 18:45:51 +00:00
parent bc31f581bd
commit 00e0d76fc2
5 changed files with 199 additions and 105 deletions

View File

@ -81,6 +81,8 @@ extern struct {
extern struct {
float wave[606720];
int nslots;
char cmsg[5][32];
} foxcom_;
#ifdef __cplusplus

View File

@ -1,8 +1,9 @@
subroutine foxgen(mycall,mygrid6,nslots,t)
subroutine foxgen(mycall,mygrid6,t)
parameter (NN=79,KK=87,NSPS=4*1920)
parameter (NWAVE=NN*NSPS,NFFT=614400,NH=NFFT/2)
character*(*) t
character*32 cmsg
character*22 msg,msgsent
character*12 t1
character*6 mycall,mygrid6,mygrid,call1,call2
@ -10,15 +11,14 @@ subroutine foxgen(mycall,mygrid6,nslots,t)
integer itone(NN)
integer*1 msgbits(KK)
integer*8 count0,count1,clkfreq
real wave(NWAVE)
real x(NFFT),y(NFFT)
real*8 dt,twopi,f0,fstep,dfreq,phi,dphi
complex cx(0:NH),cy(0:NH)
common/foxcom/wave
common/foxcom/wave(NWAVE),nslots,cmsg(5)
equivalence (x,cx),(y,cy)
mygrid=mygrid6(1:4)//' '
print*,mycall,' ',mygrid6,' ',nslots,len(t),t
! print*,mycall,' ',mygrid6,' ',nslots,len(t),t
call system_clock(count0,clkfreq)
bcontest=.false.
i3bit=0
@ -38,7 +38,7 @@ subroutine foxgen(mycall,mygrid6,nslots,t)
endif
call2=t(ia+11:ia+16)
read(t(ia+18:ia+21),*) irpt2
print*,n,call1,irpt1,call2,irpt2
! print*,n,call1,irpt1,call2,irpt2
call genft8(msg,mygrid,bcontest,i3bit,msgsent,msgbits,itone)

View File

@ -135,7 +135,7 @@ extern "C" {
void calibrate_(char data_dir[], int* iz, double* a, double* b, double* rms,
double* sigmaa, double* sigmab, int* irc, int len1);
void foxgen_(char* mycall, char* mygrid, int* nslots, char* tb3, int len1, int len2, int len3);
void foxgen_(char* mycall, char* mygrid, char* tb3, int len1, int len2, int len3);
}
int volatile itone[NUM_ISCAT_SYMBOLS]; //Audio tones for all Tx symbols
@ -1159,6 +1159,10 @@ void MainWindow::setDecodedTextFont (QFont const& font)
ui->decodedTextBrowser2->setContentFont (font);
ui->textBrowser3->setContentFont(font);
ui->textBrowser4->setContentFont(font);
ui->textBrowser3->displayFoxToBeCalled(" ","#ffffff");
ui->textBrowser4->displayFoxToBeCalled(" ","#ffffff");
ui->textBrowser3->setText("");
ui->textBrowser4->setText("");
auto style_sheet = "QLabel {" + font_as_stylesheet (font) + '}';
ui->decodedTextLabel->setStyleSheet (ui->decodedTextLabel->styleSheet () + style_sheet);
ui->decodedTextLabel2->setStyleSheet (ui->decodedTextLabel2->styleSheet () + style_sheet);
@ -1719,18 +1723,6 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
{
if(m_config.bFox()) {
switch (e->key()) {
case Qt::Key_7:
if(m_isort>-4) m_isort--;
return;
case Qt::Key_8:
if(m_isort<4) m_isort++;
return;
case Qt::Key_9:
if(m_max_dB > -15) m_max_dB--;
return;
case Qt::Key_0:
if(m_max_dB < 30) m_max_dB++;
return;
case Qt::Key_Return:
doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier));
return;
@ -1738,7 +1730,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier));
return;
case Qt::Key_Backspace:
qDebug() << "a" << m_toBeCalled;
qDebug() << "Key Backspace" << m_toBeCalled;
return;
}
QMainWindow::keyPressEvent (e);
@ -2756,7 +2748,6 @@ void MainWindow::decodeDone ()
QFile f(m_config.temp_dir().absoluteFilePath("foxcalls.txt"));
if(f.open(QIODevice::ReadOnly | QIODevice::Text)) {
QTextStream s(&f);
// QString t=s.readAll();
QString t="";
QString t0;
QString c2;
@ -2767,7 +2758,7 @@ void MainWindow::decodeDone ()
b=false;
if(ui->textBrowser3->toPlainText().indexOf(c2) >= 0) b=true;
if(ui->textBrowser4->toPlainText().indexOf(c2) >= 0) b=true;
if(!b) t += (t0 + "\n"); //Don't include calls already in the queue
if(!b) t += (t0 + "\n"); //Don't list calls already in QSO or in the stack
}
if(t.length()>30) {
m_isort=ui->comboBoxFoxSort->currentIndex();
@ -2812,14 +2803,7 @@ void MainWindow::readFromStdout() //readFromStdout
if(navg>1 or t.indexOf("f*")>0) bAvgMsg=true;
}
}
/*
if(m_mode=="FT8" and m_bDXped) {
int i3bit=t.mid(44,1).toInt();
t=t.mid(0,44) + " " + t.mid(45);
if(i3bit==1) t=t.mid(0,24) + "RR73 NOW " + t.mid(24);
if(i3bit==2) t=t.mid(0,24) + "NIL NOW " + t.mid(24);
}
*/
QFile f {m_config.writeable_data_dir ().absoluteFilePath ("ALL.TXT")};
if (f.open(QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append)) {
QTextStream out(&f);
@ -2849,25 +2833,28 @@ void MainWindow::readFromStdout() //readFromStdout
DecodedText decodedtext {QString::fromUtf8 (t.constData ()).remove (QRegularExpression {"\r|\n"}), "FT8" == m_mode &&
ui->cbVHFcontest->isChecked(), m_config.my_grid ()};
QString c2,g2;
decodedtext.deCallAndGrid(/*out*/c2,g2);
if(g2.mid(0,2)=="R+" or g2.mid(0,2)=="R-") {
QString a=ui->textBrowser3->toPlainText();
int i0=a.indexOf(c2);
if(i0 >= 0) {
QString b=a.mid(i0);
QStringList c=a.split("\n");
ui->textBrowser3->setText("");
for (int i=0; i<c.length(); i++) {
QString d=c.at(i);
if(d.indexOf(c2)<0 and d.indexOf("RR73")<0) {
ui->textBrowser3->displayFoxToBeCalled(d,"#ffffff");
} else {
if(d.indexOf("RR73")<0) {
int i1=qMax(d.indexOf("+"),d.indexOf("-"));
d=d.mid(0,i1-1) + " RR73";
if(m_mode=="FT8" and m_config.bFox()) {
QString c2,g2;
decodedtext.deCallAndGrid(/*out*/c2,g2);
if(g2.mid(0,2)=="R+" or g2.mid(0,2)=="R-") {
QString a=ui->textBrowser3->toPlainText();
int i0=a.indexOf(c2);
if(i0 >= 0) {
QString b=a.mid(i0);
QStringList c=a.split("\n");
ui->textBrowser3->setText("");
for (int i=0; i<c.length(); i++) {
QString d=c.at(i);
if(d.indexOf(c2)<0 and d.indexOf("RR73")<0) {
ui->textBrowser3->displayFoxToBeCalled(d,"#ffffff");
} else {
if(d.indexOf("RR73")<0) {
int i1=qMax(d.indexOf("+"),d.indexOf("-"));
d=d.mid(0,i1-1) + " RR73";
}
ui->textBrowser3->displayFoxToBeCalled(d,"#ff99ff");
}
ui->textBrowser3->displayFoxToBeCalled(d,"#ff99ff");
}
}
}
@ -3231,6 +3218,7 @@ void MainWindow::guiUpdate()
}
}
// Calculate Tx tones when needed
if((g_iptt==1 && m_iptt0==0) || m_restart) {
//----------------------------------------------------------------------
@ -3268,21 +3256,6 @@ void MainWindow::guiUpdate()
if(m_ntx == 8) ba=ui->freeTextMsg->currentText().toLocal8Bit();
}
m_i3bit=0;
if(m_mode=="FT8" and m_bDXped) {
ba0=ba;
QString t=QString::fromUtf8(ba0);
if(t.startsWith("RR73 NOW ")) {
t=t.mid(9);
m_i3bit=1;
}
if(t.startsWith("NIL NOW ")) {
t=t.mid(8);
m_i3bit=2;
}
ba=t.toLocal8Bit();
}
ba2msg(ba,message);
int ichk=0;
if (m_lastMessageSent != m_currentMessage
@ -3328,20 +3301,28 @@ void MainWindow::guiUpdate()
}
if(m_modeTx=="FT8") {
if(m_config.bFox()) {
int islots=0;
QString msg[5];
QString t1="";
QString t3=ui->textBrowser3->toPlainText() + "\n";
QString t4=ui->textBrowser4->toPlainText() + "\n";
int nslots=ui->sbNslots->value();
for(int i=0; i<nslots; i++) {
for(int i=0; i<m_Nslots; i++) {
QString t0=t3.split("\n").at(i);
if(t0=="") break;
if(t0.length()==10) t0 += " ";
t1 += t0;
t0=t4.split("\n").at(i);
if(t0.length()==10) t0 += " ";
t1 += t0;
QString t2=t4.split("\n").at(i);
if(t2=="") break;
if(t2.length()==10) t2 += " ";
t1 += t2;
islots=i;
}
int len3=t1.length();
foxgen_(MyCall, MyGrid, &nslots, const_cast <char *> (t1.toLatin1().constData()),6,6,len3);
// qDebug() << "aa" << len3 << t1;
foxcom_.nslots=islots;
if(len3>10) {
foxgen_(MyCall, MyGrid, const_cast <char *> (t1.toLatin1().constData()),6,6,len3);
}
} else {
genft8_(message, MyGrid, &bcontest, &m_i3bit, msgsent, const_cast<char *> (ft8msgbits),
const_cast<int *> (itone), 22, 6, 22);
@ -7187,3 +7168,12 @@ void MainWindow::on_sbMax_dB_valueChanged(int n)
{
m_max_dB=n;
}
void MainWindow::on_pbFoxReset_clicked()
{
QString t="";
for(int i=0; i<m_Nslots; i++) {
t += ui->comboBoxCQ->currentText() + "\n";
}
ui->textBrowser3->setText(t);
}

View File

@ -285,6 +285,7 @@ private slots:
void on_sbNsig_valueChanged(int n);
void on_sbNslots_valueChanged(int n);
void on_sbMax_dB_valueChanged(int n);
void on_pbFoxReset_clicked();
private:
Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo,

View File

@ -1628,32 +1628,98 @@ list. The list can be maintained in Settings (F2).</string>
</item>
<item row="0" column="1" rowspan="2">
<layout class="QGridLayout" name="gridLayout_10">
<item row="1" column="0">
<widget class="QSpinBox" name="sbNsig">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="prefix">
<string>N Sigs </string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>12</number>
</property>
<item row="5" column="0">
<widget class="QComboBox" name="comboBoxCQ">
<item>
<property name="text">
<string>CQ</string>
</property>
</item>
<item>
<property name="text">
<string>CQ AF</string>
</property>
</item>
<item>
<property name="text">
<string>CQ AN</string>
</property>
</item>
<item>
<property name="text">
<string>CQ AS</string>
</property>
</item>
<item>
<property name="text">
<string>CQ EU</string>
</property>
</item>
<item>
<property name="text">
<string>CQ NA</string>
</property>
</item>
<item>
<property name="text">
<string>CQ OC</string>
</property>
</item>
<item>
<property name="text">
<string>CQ SA</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 0</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 1</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 2</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 3</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 4</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 5</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 6</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 7</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 8</string>
</property>
</item>
<item>
<property name="text">
<string>CQ 9</string>
</property>
</item>
</widget>
</item>
<item row="0" column="0">
@ -1759,6 +1825,47 @@ list. The list can be maintained in Settings (F2).</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QSpinBox" name="sbNsig">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="prefix">
<string>N Sigs </string>
</property>
<property name="minimum">
<number>5</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="value">
<number>12</number>
</property>
</widget>
</item>
<item row="7" column="0">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="3" column="0">
<widget class="QSpinBox" name="sbNslots">
<property name="sizePolicy">
@ -1790,18 +1897,12 @@ list. The list can be maintained in Settings (F2).</string>
</property>
</widget>
</item>
<item row="5" column="0">
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Vertical</enum>
<item row="6" column="0">
<widget class="QPushButton" name="pbFoxReset">
<property name="text">
<string>Reset</string>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</widget>
</item>
</layout>
</item>