mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-04 05:50:31 -05:00 
			
		
		
		
	1. Implement PTT control via HRD.
2. Fix two more g95 compiler warnings. 3. Remove some unused code in getfile.cpp. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3305 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									bfef326b25
								
							
						
					
					
						commit
						207116f574
					
				@ -337,9 +337,7 @@ void DevSetup::on_cbPSKReporter_clicked(bool b)
 | 
				
			|||||||
void DevSetup::on_pttMethodComboBox_activated(int index)
 | 
					void DevSetup::on_pttMethodComboBox_activated(int index)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  m_pttMethodIndex=index;
 | 
					  m_pttMethodIndex=index;
 | 
				
			||||||
  bool b=m_pttMethodIndex==1 or m_pttMethodIndex==2 or
 | 
					  enableWidgets();
 | 
				
			||||||
      (m_catEnabled and m_pttMethodIndex==0 and m_rig!=9999);
 | 
					 | 
				
			||||||
  ui.testPTTButton->setEnabled(b);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void DevSetup::on_catPortComboBox_activated(int index)
 | 
					void DevSetup::on_catPortComboBox_activated(int index)
 | 
				
			||||||
@ -526,6 +524,6 @@ void DevSetup::enableWidgets()
 | 
				
			|||||||
  ui.pollSpinBox->setEnabled(m_catEnabled);
 | 
					  ui.pollSpinBox->setEnabled(m_catEnabled);
 | 
				
			||||||
  bool b=(m_pttMethodIndex==1 or m_pttMethodIndex==2) and m_rig!=9999;
 | 
					  bool b=(m_pttMethodIndex==1 or m_pttMethodIndex==2) and m_rig!=9999;
 | 
				
			||||||
  ui.pttComboBox->setEnabled(b);
 | 
					  ui.pttComboBox->setEnabled(b);
 | 
				
			||||||
  b=b or m_catEnabled;
 | 
					  b=b or (m_catEnabled and m_pttMethodIndex==0);
 | 
				
			||||||
  ui.testPTTButton->setEnabled(b);
 | 
					  ui.testPTTButton->setEnabled(b);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										49
									
								
								getfile.cpp
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								getfile.cpp
									
									
									
									
									
								
							@ -121,50 +121,6 @@ float gran()
 | 
				
			|||||||
  return v2*fac;
 | 
					  return v2*fac;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/*
 | 
					 | 
				
			||||||
int ptt(int nport, int ntx, int *iptt)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
#ifdef WIN32
 | 
					 | 
				
			||||||
  static HANDLE hFile;
 | 
					 | 
				
			||||||
  static int open=0;
 | 
					 | 
				
			||||||
  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 && (!open)) {
 | 
					 | 
				
			||||||
    sprintf(s,"\\\\.\\COM%d",nport);
 | 
					 | 
				
			||||||
    hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING,
 | 
					 | 
				
			||||||
                     FILE_ATTRIBUTE_NORMAL,NULL);
 | 
					 | 
				
			||||||
    if(hFile==INVALID_HANDLE_VALUE) {
 | 
					 | 
				
			||||||
      //      printf("PTT: Cannot open COM port %d.\n",nport);
 | 
					 | 
				
			||||||
      return 1;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    open=1;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  if(ntx && open) {
 | 
					 | 
				
			||||||
    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;
 | 
					 | 
				
			||||||
    open=0;
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
*/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
int ptt(int nport, int ntx, int* iptt, int* nopen)
 | 
					int ptt(int nport, int ntx, int* iptt, int* nopen)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
#ifdef WIN32
 | 
					#ifdef WIN32
 | 
				
			||||||
@ -206,8 +162,3 @@ int ptt(int nport, int ntx, int* iptt, int* nopen)
 | 
				
			|||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
int hamlibError(int retcode)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  qDebug() << "Hamlib error" << retcode;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -43,8 +43,6 @@ program jt9
 | 
				
			|||||||
  nfb=2000
 | 
					  nfb=2000
 | 
				
			||||||
  mousefqso=1500
 | 
					  mousefqso=1500
 | 
				
			||||||
  newdat=1
 | 
					  newdat=1
 | 
				
			||||||
  nb=0
 | 
					 | 
				
			||||||
  nbslider=30
 | 
					 | 
				
			||||||
  ndiskdat=1
 | 
					  ndiskdat=1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  do ifile=ifile1,nargs
 | 
					  do ifile=ifile1,nargs
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
//-------------------------------------------------------------- MainWindow
 | 
					//------------------------------------------------------------- MainWindow
 | 
				
			||||||
#include "mainwindow.h"
 | 
					#include "mainwindow.h"
 | 
				
			||||||
#include "ui_mainwindow.h"
 | 
					#include "ui_mainwindow.h"
 | 
				
			||||||
#include "devsetup.h"
 | 
					#include "devsetup.h"
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										15
									
								
								rigclass.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								rigclass.cpp
									
									
									
									
									
								
							@ -176,7 +176,22 @@ vfo_t Rig::getVFO()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int Rig::setPTT(ptt_t ptt, vfo_t vfo)
 | 
					int Rig::setPTT(ptt_t ptt, vfo_t vfo)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					  if(m_hrd) {
 | 
				
			||||||
 | 
					#ifdef WIN32
 | 
				
			||||||
 | 
					    const wchar_t* cmnd = (const wchar_t*) (m_context +
 | 
				
			||||||
 | 
					       "Set Button-Select Send 1").utf16();
 | 
				
			||||||
 | 
					    const wchar_t* result=HRDInterfaceSendMessage(cmnd);
 | 
				
			||||||
 | 
					    QString t2=QString::fromWCharArray (result,-1);
 | 
				
			||||||
 | 
					    HRDInterfaceFreeString(result);
 | 
				
			||||||
 | 
					    if(t2=="OK") {
 | 
				
			||||||
 | 
					      return 0;
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					      return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					  } else {
 | 
				
			||||||
    return rig_set_ptt(theRig, vfo, ptt);
 | 
					    return rig_set_ptt(theRig, vfo, ptt);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ptt_t Rig::getPTT(vfo_t vfo)
 | 
					ptt_t Rig::getPTT(vfo_t vfo)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user