From 7566f3548df8fcd647196c5247f11b372e9c2163 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Sun, 26 Jul 2020 02:58:04 +0100 Subject: [PATCH] Post FST4W spots to WSPRNet.org Includes a re-factoring of the WSPRNet class, particularly to handle direct spot posts as well as via a file from wsprd. Switched from GET http request method to POST method. FST4W spots post the same information a WSPR spots except the drift field is always zero (FST4W has no drift compensation, so no drift figure is calculated by the decoder), and the mode field reflects the T/R period in minutes. This means FST4W-120A will be similar to WSPR-2, an FST4W-900 will be similar to WSPR-15. I don't see any way to view the mode field on either the new or old database format queries on WSPRnet, so it is hard to tell if that field is actually stored. --- Network/wsprnet.cpp | 445 +++++++++++++++++++++++++---------------- Network/wsprnet.h | 57 ++++-- widgets/mainwindow.cpp | 68 ++++--- widgets/mainwindow.h | 4 +- 4 files changed, 354 insertions(+), 220 deletions(-) diff --git a/Network/wsprnet.cpp b/Network/wsprnet.cpp index cdfed7683..669ab1554 100644 --- a/Network/wsprnet.cpp +++ b/Network/wsprnet.cpp @@ -8,6 +8,8 @@ #include #include +#include +#include #include #include #include @@ -18,215 +20,314 @@ namespace { - char const * const wsprNetUrl = "http://wsprnet.org/post?"; - // char const * const wsprNetUrl = "http://127.0.0.1/post?"; + char const * const wsprNetUrl = "http://wsprnet.org/post/"; + //char const * const wsprNetUrl = "http://127.0.0.1:5000/post/"; + + // + // tested with this python REST mock of WSPRNet.org + // + /* +# Mock WSPRNet.org RESTful API +from flask import Flask, request, url_for +from flask_restful import Resource, Api + +app = Flask(__name__) + +@app.route ('/post/', methods=['GET', 'POST']) +def spot (): + if request.method == 'POST': + print (request.form) + return "1 spot(s) added" + +with app.test_request_context (): + print (url_for ('spot')) + */ + + // regexp to parse FST4W decodes + QRegularExpression fst4_re {R"( + (?