Hi Mike,

some more comments:

I think it would be sensible to include the instance name in the 
broadcast datagram as a third field. You can use the method 
QApplication::applicationName() result as the instance name.

There is no need to call member functions with an explicit this pointer, 
that is not idiomatic C++, so:

this->member();

becomes:

member();

In MainWindow::doCallCQ() there is no need to write to the RHS decoded 
text window, MainWindow::doubleClickOnCall() does that for you.

Things would be much clearer and more efficient if the first few lines 
of MainWindow::doubleClickOnCall() were made into a method like:

void MainWindow::doubleClickOnCall(bool shift, bool ctrl)
{
   int position;
   QTextCursor cursor;
   if(!m_decodedText2) cursor=ui->decodedTextBrowser2->textCursor();
   if(m_decodedText2) cursor=ui->decodedTextBrowser->textCursor();
   cursor.select(QTextCursor::LineUnderCursor);
   int position {cursor.position()};
   if(shift && position==-9999) return;        //Silence compiler warning

   QString messages;
   if(!m_decodedText2) messages= ui->decodedTextBrowser2->toPlainText(); 
//Full contents
   if(m_decodedText2) messages= ui->decodedTextBrowser->toPlainText();

   processMessage(messages, position);
}

then MainWindow::processMessage(QString, int) becomes the rest of the 
original MainWindow::doubleClickOnCall() member.

You then call MainWindow::processMessage() in your doCallCQ() member.

A better name for MainWindow::doCallCQ() might be MainWindow::replyToCQ().

73
Bill
G4WJS.

On 17/03/2015 22:19, Michael Black wrote:
> I think I got this going pretty well.  I added a Network tab to the
> configuration and the settings are saved in the WSJT-X.ini file.
> Here's the patch as it is now for review and comments.  A link below for a
> client that receives the decoded lines (either localhost on the same
> computer or turn broadcast on and see them on another computer on the
> nework) and you can double-click an entry to send it to WSJT-X for
> processing.
> https://www.dropbox.com/s/pp5z7nqrtdeug9a/UDPClient.exe?dl=0
>
> A few notes.
>
> #1 The defaults are for the server to be enabled, port 2237 and 2238,
> LocalHost only, and it will bring the WSJT-X window to the front.  All
> configurable of course.
> #2 It's broadcasting the decoded lines on the m_udpPortTx prefixed with "@"
> to denote a decodedtext line (making room for other things that may come
> up).  This is what clients like JTAlert can receive.
> #3 Sending a decoded line to m_udpPortRx (without the "@" to WSJT-X will act
> as though you double-clicked on the left hand side for that line, putting
> the text in the right hand side and enabling the response as usual.
> #4 No responses are sent so it's one-way communication right now
> #5 Multi-instance support is interesting..you would only need one instance
> of JTAlert to control multiple WSJT-X instances.  This is a potentially
> powerful way to have multiple rigs running all controlled from JTAlert.
> Since the client (JTAlert) would be sending exact strings of decoded text it
> will only match in the appropriate WSJT-X with that decoded text.
> #6 If m_Broadcast=true you can control WSJT-X from another computer since
> the text lines will be broadcast to all computers as can  the reply from the
> client.
> #7 The WSJT-X window will be restored from a minimized state and brought to
> the front when it receives a valid line for that instance of WSJT-X from the
> UDPClient.
>
> Line format sent to client is just two fields CSV separated with a leading
> "@" to signify a decoded text line which you'll see in the client.
>
> @Band,line
>
> Line format sent to WSJT-X is the "line" portion that was sent to the
> client.
>
> Mike W9MDB


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
wsjt-devel mailing list
wsjt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wsjt-devel

Reply via email to