mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-09-30 09:06:38 -04:00
Working on Rig Control... Not complete yet, but psogram should compile
and run with PTT control via DTR/RTS. Will need to replace a "labAzDist" label in mainwindow.ui. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3080 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
a571077996
commit
ee01b0b544
52
getfile.cpp
52
getfile.cpp
@ -121,6 +121,7 @@ float gran()
|
|||||||
return v2*fac;
|
return v2*fac;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
int ptt(int nport, int ntx, int *iptt)
|
int ptt(int nport, int ntx, int *iptt)
|
||||||
{
|
{
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -159,14 +160,49 @@ int ptt(int nport, int ntx, int *iptt)
|
|||||||
*iptt=0;
|
*iptt=0;
|
||||||
open=0;
|
open=0;
|
||||||
}
|
}
|
||||||
/*
|
return 0;
|
||||||
if(i3==0) return -(SETRTS);
|
#endif
|
||||||
if(i4==0) return -(CLRRTS);
|
}
|
||||||
if(i5==0) return -(SETDTR);
|
*/
|
||||||
if(i6==0) return -(CLRDTR);
|
|
||||||
if(i9==0) return -(CLRBREAK);
|
int ptt(int nport, int ntx, int* iptt, int* nopen)
|
||||||
if(i00==0) return -10;
|
{
|
||||||
*/
|
#ifdef WIN32
|
||||||
|
static HANDLE hFile;
|
||||||
|
char s[10];
|
||||||
|
int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1;
|
||||||
|
|
||||||
|
if(nport==0) {
|
||||||
|
*iptt=ntx;
|
||||||
|
return(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ntx && (!(*nopen))) {
|
||||||
|
sprintf(s,"\\\\.\\COM%d",nport);
|
||||||
|
hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING,
|
||||||
|
FILE_ATTRIBUTE_NORMAL,NULL);
|
||||||
|
if(hFile==INVALID_HANDLE_VALUE) {
|
||||||
|
QString t;
|
||||||
|
t.sprintf("Cannot open COM port %d for PTT\n",nport);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
*nopen=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(ntx && *nopen) {
|
||||||
|
i3=EscapeCommFunction(hFile,SETRTS);
|
||||||
|
i5=EscapeCommFunction(hFile,SETDTR);
|
||||||
|
*iptt=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
else {
|
||||||
|
i4=EscapeCommFunction(hFile,CLRRTS);
|
||||||
|
i6=EscapeCommFunction(hFile,CLRDTR);
|
||||||
|
i9=EscapeCommFunction(hFile,CLRBREAK);
|
||||||
|
i00=CloseHandle(hFile);
|
||||||
|
*iptt=0;
|
||||||
|
*nopen=0;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
void getfile(QString fname, int ntrperiod);
|
void getfile(QString fname, int ntrperiod);
|
||||||
float gran();
|
float gran();
|
||||||
int ptt(int* nport, int* ntx, int* iptt);
|
//int ptt(int* nport, int* ntx, int* iptt);
|
||||||
|
int ptt(int nport, int ntx, int* iptt, int* nopen);
|
||||||
|
|
||||||
|
|
||||||
#endif // GETFILE_H
|
#endif // GETFILE_H
|
||||||
|
@ -100,6 +100,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
QTimer *guiTimer = new QTimer(this);
|
QTimer *guiTimer = new QTimer(this);
|
||||||
connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate()));
|
connect(guiTimer, SIGNAL(timeout()), this, SLOT(guiUpdate()));
|
||||||
guiTimer->start(100); //Don't change the 100 ms!
|
guiTimer->start(100); //Don't change the 100 ms!
|
||||||
|
|
||||||
m_auto=false;
|
m_auto=false;
|
||||||
m_waterfallAvg = 1;
|
m_waterfallAvg = 1;
|
||||||
m_txFirst=false;
|
m_txFirst=false;
|
||||||
@ -130,6 +131,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
m_TRperiod=60;
|
m_TRperiod=60;
|
||||||
m_inGain=0;
|
m_inGain=0;
|
||||||
m_dataAvailable=false;
|
m_dataAvailable=false;
|
||||||
|
m_iptt=0;
|
||||||
|
m_COMportOpen=0;
|
||||||
decodeBusy(false);
|
decodeBusy(false);
|
||||||
|
|
||||||
ui->xThermo->setFillBrush(Qt::green);
|
ui->xThermo->setFillBrush(Qt::green);
|
||||||
@ -1229,10 +1232,6 @@ void MainWindow::guiUpdate()
|
|||||||
bTxTime=true;
|
bTxTime=true;
|
||||||
|
|
||||||
if(bTxTime and iptt==0 and !btxMute) {
|
if(bTxTime and iptt==0 and !btxMute) {
|
||||||
|
|
||||||
int itx=1;
|
|
||||||
int ierr = ptt(m_pttPort,itx,&iptt); // Raise PTT
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//Raise PTT
|
//Raise PTT
|
||||||
if(m_pttMethodIndex==0) {
|
if(m_pttMethodIndex==0) {
|
||||||
@ -1241,10 +1240,15 @@ void MainWindow::guiUpdate()
|
|||||||
p3.waitForFinished();
|
p3.waitForFinished();
|
||||||
}
|
}
|
||||||
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
|
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
|
||||||
// ptt(m_pttPort,1,&m_iptt,&m_COMportOpen);
|
ptt(m_pttPort,1,&m_iptt,&m_COMportOpen);
|
||||||
ptt(m_pttPort,1,&m_iptt);
|
// ptt(m_pttPort,1,&m_iptt);
|
||||||
}
|
}
|
||||||
|
qDebug() << "ptt1Timer A";
|
||||||
|
ptt1Timer->start(200); //Sequencer delay
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int itx=1;
|
||||||
|
ptt(m_pttPort,itx,&iptt,&m_COMportOpen); // Raise PTT
|
||||||
if(!soundOutThread.isRunning()) {
|
if(!soundOutThread.isRunning()) {
|
||||||
QString t=ui->tx6->text();
|
QString t=ui->tx6->text();
|
||||||
double snr=t.mid(1,5).toDouble();
|
double snr=t.mid(1,5).toDouble();
|
||||||
@ -1252,6 +1256,7 @@ void MainWindow::guiUpdate()
|
|||||||
soundOutThread.setTxSNR(snr);
|
soundOutThread.setTxSNR(snr);
|
||||||
soundOutThread.start(QThread::HighPriority);
|
soundOutThread.start(QThread::HighPriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!bTxTime || btxMute) {
|
if(!bTxTime || btxMute) {
|
||||||
btxok=false;
|
btxok=false;
|
||||||
@ -1332,8 +1337,6 @@ void MainWindow::guiUpdate()
|
|||||||
nc0++;
|
nc0++;
|
||||||
}
|
}
|
||||||
if(nc0 == 0) {
|
if(nc0 == 0) {
|
||||||
int itx=0;
|
|
||||||
int ierr=ptt(m_pttPort,itx,&iptt); // Lower PTT
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//Lower PTT
|
//Lower PTT
|
||||||
@ -1343,11 +1346,14 @@ void MainWindow::guiUpdate()
|
|||||||
p3.waitForFinished();
|
p3.waitForFinished();
|
||||||
}
|
}
|
||||||
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
|
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
|
||||||
// ptt(m_pttPort,0,&m_iptt,&m_COMportOpen);
|
ptt(m_pttPort,0,&m_iptt,&m_COMportOpen);
|
||||||
ptt(m_pttPort,0,&m_iptt);
|
// ptt(m_pttPort,0,&m_iptt);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
int itx=0;
|
||||||
|
ptt(m_pttPort,itx,&iptt,&m_COMportOpen); // Lower PTT
|
||||||
|
|
||||||
if(!btxMute) soundOutThread.quitExecution=true;
|
if(!btxMute) soundOutThread.quitExecution=true;
|
||||||
m_transmitting=false;
|
m_transmitting=false;
|
||||||
if(m_auto) {
|
if(m_auto) {
|
||||||
@ -1405,19 +1411,6 @@ void MainWindow::guiUpdate()
|
|||||||
m_hsym0=khsym;
|
m_hsym0=khsym;
|
||||||
m_sec0=nsec;
|
m_sec0=nsec;
|
||||||
|
|
||||||
/*
|
|
||||||
if(m_myCall=="K1JT") {
|
|
||||||
char s[20];
|
|
||||||
double t1=1.0;
|
|
||||||
//Better: use signals from sound threads?
|
|
||||||
if(soundInThread.isRunning()) t1=soundInThread.samFacIn();
|
|
||||||
double t2=1.0;
|
|
||||||
if(soundOutThread.isRunning()) t2=soundOutThread.samFacOut();
|
|
||||||
sprintf(s,"%6.4f %6.4f",t1,t2);
|
|
||||||
lab5->setText(s);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
iptt0=iptt;
|
iptt0=iptt;
|
||||||
btxok0=btxok;
|
btxok0=btxok;
|
||||||
|
@ -113,7 +113,6 @@ private slots:
|
|||||||
void dialFreqChanged2(double f);
|
void dialFreqChanged2(double f);
|
||||||
void on_actionErase_ALL_TXT_triggered();
|
void on_actionErase_ALL_TXT_triggered();
|
||||||
void on_actionErase_wsjtx_log_adi_triggered();
|
void on_actionErase_wsjtx_log_adi_triggered();
|
||||||
|
|
||||||
void showMacros(const QPoint& pos);
|
void showMacros(const QPoint& pos);
|
||||||
void onPopup1();
|
void onPopup1();
|
||||||
void onPopup2();
|
void onPopup2();
|
||||||
@ -127,7 +126,6 @@ private slots:
|
|||||||
void onPopup10();
|
void onPopup10();
|
||||||
void on_actionConvert_JT9_x_to_RTTY_triggered(bool checked);
|
void on_actionConvert_JT9_x_to_RTTY_triggered(bool checked);
|
||||||
void on_actionLog_JT9_without_submode_triggered(bool checked);
|
void on_actionLog_JT9_without_submode_triggered(bool checked);
|
||||||
|
|
||||||
void on_actionLog_dB_reports_to_Comments_triggered(bool checked);
|
void on_actionLog_dB_reports_to_Comments_triggered(bool checked);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user