mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-10-31 04:50:34 -04:00 
			
		
		
		
	Samples are downloaded from a web server, currently the SF download server. The samples are stored in the source controlled samples directory and the CMake script there builds a suitable directory tree for upload to the web server under samples/web containing the samples hierarchy and the generated JSON contents database file. The samples CMake script also defines an 'upload-samples' target that uses rsync to efficiently upload the samples and the accompanying contents JSON database file. Any directory structure under the samples directory may be created, to add a new sample file simply add the file to source control and amend the list of sample files (SAMPLE_FILES) in samples/CMakeLists.txt. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6308 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef WSPRNET_H
 | |
| #define WSPRNET_H
 | |
| 
 | |
| #include <QObject>
 | |
| #include <QString>
 | |
| #include <QList>
 | |
| #include <QHash>
 | |
| #include <QQueue>
 | |
| 
 | |
| class QNetworkAccessManager;
 | |
| class QTimer;
 | |
| class QNetworkReply;
 | |
| 
 | |
| class WSPRNet : public QObject
 | |
| {
 | |
|   Q_OBJECT;
 | |
| 
 | |
| public:
 | |
|   explicit WSPRNet(QNetworkAccessManager *, QObject *parent = nullptr);
 | |
|     void upload(QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq,
 | |
|                 QString const& mode, QString const& tpct, QString const& dbm, QString const& version,
 | |
|                 QString const& fileName);
 | |
|     static bool decodeLine(QString const& line, QHash<QString,QString> &query);
 | |
| 
 | |
| signals:
 | |
|     void uploadStatus(QString);
 | |
| 
 | |
| public slots:
 | |
|     void networkReply(QNetworkReply *);
 | |
|     void work();
 | |
|     void abortOutstandingRequests ();
 | |
| 
 | |
| private:
 | |
|     QNetworkAccessManager *networkManager;
 | |
|     QList<QNetworkReply *> m_outstandingRequests;
 | |
|     QString m_call, m_grid, m_rfreq, m_tfreq, m_mode, m_tpct, m_dbm, m_vers, m_file;
 | |
|     QQueue<QString> urlQueue;
 | |
|     QTimer *uploadTimer;
 | |
|     int m_urlQueueSize;
 | |
|     int m_uploadType;
 | |
| 
 | |
|     QString urlEncodeNoSpot();
 | |
|     QString urlEncodeSpot(QHash<QString,QString> const& spot);
 | |
| };
 | |
| 
 | |
| #endif // WSPRNET_H
 |