Added RX.ACTIVITY and STATION.STATUS messages to network
This commit is contained in:
		
							parent
							
								
									575f6cc0e8
								
							
						
					
					
						commit
						0a658c706c
					
				@ -4564,8 +4564,6 @@ void MainWindow::decodeBusy(bool b)                             //decodeBusy()
 | 
				
			|||||||
  ui->actionOpen->setEnabled(!b);
 | 
					  ui->actionOpen->setEnabled(!b);
 | 
				
			||||||
  ui->actionOpen_next_in_directory->setEnabled(!b);
 | 
					  ui->actionOpen_next_in_directory->setEnabled(!b);
 | 
				
			||||||
  ui->actionDecode_remaining_files_in_directory->setEnabled(!b);
 | 
					  ui->actionDecode_remaining_files_in_directory->setEnabled(!b);
 | 
				
			||||||
 | 
					 | 
				
			||||||
  statusUpdate ();
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
@ -10210,6 +10208,7 @@ void MainWindow::callsignSelectedChanged(QString /*old*/, QString selectedCall){
 | 
				
			|||||||
    // immediately update the display);
 | 
					    // immediately update the display);
 | 
				
			||||||
    updateButtonDisplay();
 | 
					    updateButtonDisplay();
 | 
				
			||||||
    updateTextDisplay();
 | 
					    updateTextDisplay();
 | 
				
			||||||
 | 
					    statusChanged();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    m_prevSelectedCallsign = selectedCall;
 | 
					    m_prevSelectedCallsign = selectedCall;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -10401,6 +10400,16 @@ void MainWindow::processRxActivity() {
 | 
				
			|||||||
    while (!m_rxActivityQueue.isEmpty()) {
 | 
					    while (!m_rxActivityQueue.isEmpty()) {
 | 
				
			||||||
        ActivityDetail d = m_rxActivityQueue.dequeue();
 | 
					        ActivityDetail d = m_rxActivityQueue.dequeue();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if(canSendNetworkMessage()){
 | 
				
			||||||
 | 
					            sendNetworkMessage("RX.ACTIVITY", d.text, {
 | 
				
			||||||
 | 
					                {"FREQ", QVariant(d.freq)},
 | 
				
			||||||
 | 
					                {"SNR", QVariant(d.snr)},
 | 
				
			||||||
 | 
					                {"SPEED", QVariant(d.submode)},
 | 
				
			||||||
 | 
					                {"TDRIFT", QVariant(d.tdrift)},
 | 
				
			||||||
 | 
					                {"UTC", QVariant(d.utcTimestamp.toMSecsSinceEpoch())}
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        observeTimeDeltaForAverage(d.tdrift);
 | 
					        observeTimeDeltaForAverage(d.tdrift);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // use the actual frequency and check its delta from our current frequency
 | 
					        // use the actual frequency and check its delta from our current frequency
 | 
				
			||||||
@ -10918,17 +10927,21 @@ void MainWindow::processCommandActivity() {
 | 
				
			|||||||
            displayTextForFreq(ad.text, ad.freq, ad.utcTimestamp, false, true, false);
 | 
					            displayTextForFreq(ad.text, ad.freq, ad.utcTimestamp, false, true, false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            // and send it to the network in case we want to interact with it from an external app...
 | 
					            // and send it to the network in case we want to interact with it from an external app...
 | 
				
			||||||
            sendNetworkMessage("RX.DIRECTED", ad.text, {
 | 
					            if(canSendNetworkMessage()){
 | 
				
			||||||
                {"FROM", QVariant(d.from)},
 | 
					                sendNetworkMessage("RX.DIRECTED", ad.text, {
 | 
				
			||||||
                {"TO", QVariant(d.to)},
 | 
					                    {"FROM", QVariant(d.from)},
 | 
				
			||||||
                {"CMD", QVariant(d.cmd)},
 | 
					                    {"TO", QVariant(d.to)},
 | 
				
			||||||
                {"GRID", QVariant(d.grid)},
 | 
					                    {"CMD", QVariant(d.cmd)},
 | 
				
			||||||
                {"EXTRA", QVariant(d.extra)},
 | 
					                    {"GRID", QVariant(d.grid)},
 | 
				
			||||||
                {"TEXT", QVariant(d.text)},
 | 
					                    {"EXTRA", QVariant(d.extra)},
 | 
				
			||||||
                {"FREQ", QVariant(ad.freq)},
 | 
					                    {"TEXT", QVariant(d.text)},
 | 
				
			||||||
                {"SNR", QVariant(ad.snr)},
 | 
					                    {"FREQ", QVariant(ad.freq)},
 | 
				
			||||||
                {"UTC", QVariant(ad.utcTimestamp.toMSecsSinceEpoch())}
 | 
					                    {"SNR", QVariant(ad.snr)},
 | 
				
			||||||
            });
 | 
					                    {"SPEED", QVariant(ad.submode)},
 | 
				
			||||||
 | 
					                    {"TDRIFT", QVariant(ad.tdrift)},
 | 
				
			||||||
 | 
					                    {"UTC", QVariant(ad.utcTimestamp.toMSecsSinceEpoch())}
 | 
				
			||||||
 | 
					                });
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if(!isAllCall){
 | 
					            if(!isAllCall){
 | 
				
			||||||
                // if we've received a message to be displayed, we should bump the repeat buttons...
 | 
					                // if we've received a message to be displayed, we should bump the repeat buttons...
 | 
				
			||||||
@ -11656,13 +11669,15 @@ void MainWindow::processSpots() {
 | 
				
			|||||||
        spotReport(d.submode, d.freq, d.snr, d.call, d.grid);
 | 
					        spotReport(d.submode, d.freq, d.snr, d.call, d.grid);
 | 
				
			||||||
        pskLogReport("JS8", d.freq, d.snr, d.call, d.grid);
 | 
					        pskLogReport("JS8", d.freq, d.snr, d.call, d.grid);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        sendNetworkMessage("RX.SPOT", "", {
 | 
					        if(canSendNetworkMessage()){
 | 
				
			||||||
            {"DIAL", QVariant(dial)},
 | 
					            sendNetworkMessage("RX.SPOT", "", {
 | 
				
			||||||
            {"OFFSET", QVariant(d.freq)},
 | 
					                {"DIAL", QVariant(dial)},
 | 
				
			||||||
            {"CALL", QVariant(d.call)},
 | 
					                {"OFFSET", QVariant(d.freq)},
 | 
				
			||||||
            {"SNR", QVariant(d.snr)},
 | 
					                {"CALL", QVariant(d.call)},
 | 
				
			||||||
            {"GRID", QVariant(d.grid)},
 | 
					                {"SNR", QVariant(d.snr)},
 | 
				
			||||||
        });
 | 
					                {"GRID", QVariant(d.grid)},
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -12704,6 +12719,10 @@ void MainWindow::networkMessage(Message const &message)
 | 
				
			|||||||
    qDebug() << "Unable to process networkMessage:" << type;
 | 
					    qDebug() << "Unable to process networkMessage:" << type;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool MainWindow::canSendNetworkMessage(){
 | 
				
			||||||
 | 
					    return m_config.udpEnabled();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void MainWindow::sendNetworkMessage(QString const &type, QString const &message){
 | 
					void MainWindow::sendNetworkMessage(QString const &type, QString const &message){
 | 
				
			||||||
    if(!m_config.udpEnabled()){
 | 
					    if(!m_config.udpEnabled()){
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
@ -12965,8 +12984,16 @@ void MainWindow::on_cbCQTx_toggled(bool b)
 | 
				
			|||||||
  setXIT (ui->TxFreqSpinBox->value ());
 | 
					  setXIT (ui->TxFreqSpinBox->value ());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void MainWindow::statusUpdate () const
 | 
					void MainWindow::statusUpdate ()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    if(canSendNetworkMessage()){
 | 
				
			||||||
 | 
					        sendNetworkMessage("STATION.STATUS", "", {
 | 
				
			||||||
 | 
					            {"DIAL", QVariant(dialFrequency())},
 | 
				
			||||||
 | 
					            {"OFFSET", QVariant(currentFreqOffset())},
 | 
				
			||||||
 | 
					            {"SPEED", QVariant(m_nSubMode)},
 | 
				
			||||||
 | 
					            {"SELECTED", QVariant(callsignSelected())},
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void MainWindow::childEvent (QChildEvent * e)
 | 
					void MainWindow::childEvent (QChildEvent * e)
 | 
				
			||||||
 | 
				
			|||||||
@ -404,6 +404,7 @@ private slots:
 | 
				
			|||||||
  void emitPTT(bool on);
 | 
					  void emitPTT(bool on);
 | 
				
			||||||
  void emitTones();
 | 
					  void emitTones();
 | 
				
			||||||
  void networkMessage(Message const &message);
 | 
					  void networkMessage(Message const &message);
 | 
				
			||||||
 | 
					  bool canSendNetworkMessage();
 | 
				
			||||||
  void sendNetworkMessage(QString const &type, QString const &message);
 | 
					  void sendNetworkMessage(QString const &type, QString const &message);
 | 
				
			||||||
  void sendNetworkMessage(QString const &type, QString const &message, const QMap<QString, QVariant> ¶ms);
 | 
					  void sendNetworkMessage(QString const &type, QString const &message, const QMap<QString, QVariant> ¶ms);
 | 
				
			||||||
  void networkError (QString const&);
 | 
					  void networkError (QString const&);
 | 
				
			||||||
@ -1029,7 +1030,7 @@ private:
 | 
				
			|||||||
  void resetHeartbeatTimer(bool stop);
 | 
					  void resetHeartbeatTimer(bool stop);
 | 
				
			||||||
  void subProcessFailed (QString program, QStringList args, int exitCode, int status, QString errorString);
 | 
					  void subProcessFailed (QString program, QStringList args, int exitCode, int status, QString errorString);
 | 
				
			||||||
  void subProcessError (QString program, QStringList arguments, int errorCode, QString errorString);
 | 
					  void subProcessError (QString program, QStringList arguments, int errorCode, QString errorString);
 | 
				
			||||||
  void statusUpdate () const;
 | 
					  void statusUpdate ();
 | 
				
			||||||
  void update_watchdog_label ();
 | 
					  void update_watchdog_label ();
 | 
				
			||||||
  void on_the_minute ();
 | 
					  void on_the_minute ();
 | 
				
			||||||
  void tryBandHop();
 | 
					  void tryBandHop();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user