Cache calls for easier display
This commit is contained in:
		
							parent
							
								
									0dfc805a49
								
							
						
					
					
						commit
						04bdf8574a
					
				| @ -3021,7 +3021,6 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
|             d.timestamp = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch(); |             d.timestamp = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch(); | ||||||
|             d.snr = decodedtext.snr(); |             d.snr = decodedtext.snr(); | ||||||
|             m_bandActivity[offset].append(d); |             m_bandActivity[offset].append(d); | ||||||
| 
 |  | ||||||
|             while(m_bandActivity[offset].count() > 10){ |             while(m_bandActivity[offset].count() > 10){ | ||||||
|                 m_bandActivity[offset].removeFirst(); |                 m_bandActivity[offset].removeFirst(); | ||||||
|             } |             } | ||||||
| @ -3068,6 +3067,10 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
|         if(abs(audioFreq - m_wideGraph->rxFreq()) <= 10) bDisplayRight=true; |         if(abs(audioFreq - m_wideGraph->rxFreq()) <= 10) bDisplayRight=true; | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|  |       if(!bDisplayRight){ | ||||||
|  |           bDisplayRight = m_rxDirectedCache.contains(audioFreq/10*10); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|       if (bDisplayRight) { |       if (bDisplayRight) { | ||||||
|         // This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg,
 |         // This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg,
 | ||||||
|         // or contains MyCall
 |         // or contains MyCall
 | ||||||
| @ -3083,12 +3086,15 @@ void MainWindow::readFromStdout()                             //readFromStdout | |||||||
|         m_QSOText = decodedtext.string ().trimmed (); |         m_QSOText = decodedtext.string ().trimmed (); | ||||||
| 
 | 
 | ||||||
|         // TODO: jsherer - parse decode...
 |         // TODO: jsherer - parse decode...
 | ||||||
|         //logRxTxMessageText(decodedtext.messageWords().first().trimmed(), false);
 |  | ||||||
|         RXDetail d; |         RXDetail d; | ||||||
|         d.freq = audioFreq; |         d.freq = audioFreq; | ||||||
|         d.text = decodedtext.messageWords().first(); |         d.text = decodedtext.messageWords().first(); | ||||||
|         d.timestamp = QDateTime::currentDateTimeUtc().toSecsSinceEpoch(); |         d.timestamp = QDateTime::currentDateTimeUtc().toSecsSinceEpoch(); | ||||||
|         m_rxFrameQueue.append(d); |         m_rxFrameQueue.append(d); | ||||||
|  | 
 | ||||||
|  |         if(d.text.contains(m_config.my_callsign())){ | ||||||
|  |             m_rxDirectedCache.insert(audioFreq/10*10, new QDateTime(QDateTime::currentDateTimeUtc()), 25); | ||||||
|  |         } | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       if(m_mode=="FT8" and m_config.bHound()) { |       if(m_mode=="FT8" and m_config.bHound()) { | ||||||
| @ -6364,6 +6370,10 @@ void MainWindow::on_cqMacroButton_clicked(){ | |||||||
|     addMessageText(text); |     addMessageText(text); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | void MainWindow::on_deMacroButton_clicked(){ | ||||||
|  |     addMessageText(m_config.my_callsign()); | ||||||
|  | } | ||||||
|  | 
 | ||||||
| void MainWindow::on_replyMacroButton_clicked(){ | void MainWindow::on_replyMacroButton_clicked(){ | ||||||
|     auto items = ui->tableWidgetCalls->selectedItems(); |     auto items = ui->tableWidgetCalls->selectedItems(); | ||||||
|     if(!items.isEmpty()){ |     if(!items.isEmpty()){ | ||||||
| @ -6407,6 +6417,12 @@ void MainWindow::on_macrosMacroButton_clicked(){ | |||||||
|         QAction *action = menu->addAction(macro); |         QAction *action = menu->addAction(macro); | ||||||
|         connect(action, &QAction::triggered, this, [this, macro](){ addMessageText(macro); }); |         connect(action, &QAction::triggered, this, [this, macro](){ addMessageText(macro); }); | ||||||
|     } |     } | ||||||
|  |     menu->addSeparator(); | ||||||
|  |     auto action = new QAction(QIcon::fromTheme("edit-edit"), "Edit"); | ||||||
|  |     menu->addAction(action); | ||||||
|  |     connect(action, &QAction::triggered, this, &MainWindow::on_actionSettings_triggered); | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|     ui->macrosMacroButton->setMenu(menu); |     ui->macrosMacroButton->setMenu(menu); | ||||||
|     ui->macrosMacroButton->showMenu(); |     ui->macrosMacroButton->showMenu(); | ||||||
| } | } | ||||||
| @ -7409,7 +7425,7 @@ void MainWindow::postDecode (bool is_new, QString const& message) | |||||||
|               textItem->setBackground(QBrush(m_config.color_CQ())); |               textItem->setBackground(QBrush(m_config.color_CQ())); | ||||||
|           } |           } | ||||||
| 
 | 
 | ||||||
|           if (text.last().contains(m_config.my_callsign())){ |           if (text.last().contains(m_config.my_callsign()) || m_rxDirectedCache.contains(offset/10*10)){ | ||||||
|               offsetItem->setBackground(QBrush(m_config.color_MyCall())); |               offsetItem->setBackground(QBrush(m_config.color_MyCall())); | ||||||
|               snrItem->setBackground(QBrush(m_config.color_MyCall())); |               snrItem->setBackground(QBrush(m_config.color_MyCall())); | ||||||
|               textItem->setBackground(QBrush(m_config.color_MyCall())); |               textItem->setBackground(QBrush(m_config.color_MyCall())); | ||||||
|  | |||||||
| @ -231,6 +231,7 @@ private slots: | |||||||
|   void on_rbFreeText_clicked(bool checked); |   void on_rbFreeText_clicked(bool checked); | ||||||
|   void on_clearAction_triggered(QObject * sender); |   void on_clearAction_triggered(QObject * sender); | ||||||
|   void on_cqMacroButton_clicked(); |   void on_cqMacroButton_clicked(); | ||||||
|  |   void on_deMacroButton_clicked(); | ||||||
|   void on_replyMacroButton_clicked(); |   void on_replyMacroButton_clicked(); | ||||||
|   void on_snrMacroButton_clicked(); |   void on_snrMacroButton_clicked(); | ||||||
|   void on_macrosMacroButton_clicked(); |   void on_macrosMacroButton_clicked(); | ||||||
| @ -651,6 +652,8 @@ private: | |||||||
|   int m_txFrameCount; |   int m_txFrameCount; | ||||||
|   QQueue<QString> m_txFrameQueue; |   QQueue<QString> m_txFrameQueue; | ||||||
|   QQueue<RXDetail> m_rxFrameQueue; |   QQueue<RXDetail> m_rxFrameQueue; | ||||||
|  |   QCache<int, QDateTime> m_rxDirectedCache; // freq -> last directed rx
 | ||||||
|  |   QCache<QString, int> m_rxCallCache; // call -> last freq seen
 | ||||||
|   QMap<int, int> m_rxFrameBlockNumbers; // freq -> block
 |   QMap<int, int> m_rxFrameBlockNumbers; // freq -> block
 | ||||||
|   QMap<int, QList<ActivityDetail>> m_bandActivity; // freq -> [(text, last timestamp), ...]
 |   QMap<int, QList<ActivityDetail>> m_bandActivity; // freq -> [(text, last timestamp), ...]
 | ||||||
|   QMap<QString, CallDetail> m_callActivity; // call -> (last freq, last timestamp)
 |   QMap<QString, CallDetail> m_callActivity; // call -> (last freq, last timestamp)
 | ||||||
|  | |||||||
							
								
								
									
										127
									
								
								mainwindow.ui
									
									
									
									
									
								
							
							
						
						
									
										127
									
								
								mainwindow.ui
									
									
									
									
									
								
							| @ -60,7 +60,7 @@ | |||||||
|        <property name="minimumSize"> |        <property name="minimumSize"> | ||||||
|         <size> |         <size> | ||||||
|          <width>0</width> |          <width>0</width> | ||||||
|          <height>120</height> |          <height>140</height> | ||||||
|         </size> |         </size> | ||||||
|        </property> |        </property> | ||||||
|        <property name="maximumSize"> |        <property name="maximumSize"> | ||||||
| @ -966,7 +966,7 @@ QTextEdit[readOnly="true"] { | |||||||
|           </property> |           </property> | ||||||
|          </widget> |          </widget> | ||||||
|         </item> |         </item> | ||||||
|         <item row="1" column="1"> |         <item row="1" column="2"> | ||||||
|          <widget class="QPushButton" name="replyMacroButton"> |          <widget class="QPushButton" name="replyMacroButton"> | ||||||
|           <property name="minimumSize"> |           <property name="minimumSize"> | ||||||
|            <size> |            <size> | ||||||
| @ -979,62 +979,7 @@ QTextEdit[readOnly="true"] { | |||||||
|           </property> |           </property> | ||||||
|          </widget> |          </widget> | ||||||
|         </item> |         </item> | ||||||
|         <item row="1" column="2"> |  | ||||||
|          <widget class="QPushButton" name="snrMacroButton"> |  | ||||||
|           <property name="minimumSize"> |  | ||||||
|            <size> |  | ||||||
|             <width>0</width> |  | ||||||
|             <height>30</height> |  | ||||||
|            </size> |  | ||||||
|           </property> |  | ||||||
|           <property name="text"> |  | ||||||
|            <string>SNR</string> |  | ||||||
|           </property> |  | ||||||
|          </widget> |  | ||||||
|         </item> |  | ||||||
|         <item row="1" column="4"> |  | ||||||
|          <spacer name="horizontalSpacer_5"> |  | ||||||
|           <property name="orientation"> |  | ||||||
|            <enum>Qt::Horizontal</enum> |  | ||||||
|           </property> |  | ||||||
|           <property name="sizeType"> |  | ||||||
|            <enum>QSizePolicy::Fixed</enum> |  | ||||||
|           </property> |  | ||||||
|           <property name="sizeHint" stdset="0"> |  | ||||||
|            <size> |  | ||||||
|             <width>40</width> |  | ||||||
|             <height>20</height> |  | ||||||
|            </size> |  | ||||||
|           </property> |  | ||||||
|          </spacer> |  | ||||||
|         </item> |  | ||||||
|         <item row="1" column="6"> |         <item row="1" column="6"> | ||||||
|          <widget class="QPushButton" name="stopTxButton"> |  | ||||||
|           <property name="minimumSize"> |  | ||||||
|            <size> |  | ||||||
|             <width>0</width> |  | ||||||
|             <height>30</height> |  | ||||||
|            </size> |  | ||||||
|           </property> |  | ||||||
|           <property name="text"> |  | ||||||
|            <string>Halt</string> |  | ||||||
|           </property> |  | ||||||
|          </widget> |  | ||||||
|         </item> |  | ||||||
|         <item row="1" column="3"> |  | ||||||
|          <widget class="QPushButton" name="macrosMacroButton"> |  | ||||||
|           <property name="minimumSize"> |  | ||||||
|            <size> |  | ||||||
|             <width>0</width> |  | ||||||
|             <height>30</height> |  | ||||||
|            </size> |  | ||||||
|           </property> |  | ||||||
|           <property name="text"> |  | ||||||
|            <string>Macros</string> |  | ||||||
|           </property> |  | ||||||
|          </widget> |  | ||||||
|         </item> |  | ||||||
|         <item row="1" column="5"> |  | ||||||
|          <widget class="QPushButton" name="startTxButton"> |          <widget class="QPushButton" name="startTxButton"> | ||||||
|           <property name="enabled"> |           <property name="enabled"> | ||||||
|            <bool>false</bool> |            <bool>false</bool> | ||||||
| @ -1061,6 +1006,74 @@ background:yellow; | |||||||
|           </property> |           </property> | ||||||
|          </widget> |          </widget> | ||||||
|         </item> |         </item> | ||||||
|  |         <item row="1" column="4"> | ||||||
|  |          <widget class="QPushButton" name="macrosMacroButton"> | ||||||
|  |           <property name="minimumSize"> | ||||||
|  |            <size> | ||||||
|  |             <width>0</width> | ||||||
|  |             <height>30</height> | ||||||
|  |            </size> | ||||||
|  |           </property> | ||||||
|  |           <property name="text"> | ||||||
|  |            <string>Macros</string> | ||||||
|  |           </property> | ||||||
|  |          </widget> | ||||||
|  |         </item> | ||||||
|  |         <item row="1" column="7"> | ||||||
|  |          <widget class="QPushButton" name="stopTxButton"> | ||||||
|  |           <property name="minimumSize"> | ||||||
|  |            <size> | ||||||
|  |             <width>0</width> | ||||||
|  |             <height>30</height> | ||||||
|  |            </size> | ||||||
|  |           </property> | ||||||
|  |           <property name="text"> | ||||||
|  |            <string>Halt</string> | ||||||
|  |           </property> | ||||||
|  |          </widget> | ||||||
|  |         </item> | ||||||
|  |         <item row="1" column="5"> | ||||||
|  |          <spacer name="horizontalSpacer_5"> | ||||||
|  |           <property name="orientation"> | ||||||
|  |            <enum>Qt::Horizontal</enum> | ||||||
|  |           </property> | ||||||
|  |           <property name="sizeType"> | ||||||
|  |            <enum>QSizePolicy::Fixed</enum> | ||||||
|  |           </property> | ||||||
|  |           <property name="sizeHint" stdset="0"> | ||||||
|  |            <size> | ||||||
|  |             <width>40</width> | ||||||
|  |             <height>20</height> | ||||||
|  |            </size> | ||||||
|  |           </property> | ||||||
|  |          </spacer> | ||||||
|  |         </item> | ||||||
|  |         <item row="1" column="3"> | ||||||
|  |          <widget class="QPushButton" name="snrMacroButton"> | ||||||
|  |           <property name="minimumSize"> | ||||||
|  |            <size> | ||||||
|  |             <width>0</width> | ||||||
|  |             <height>30</height> | ||||||
|  |            </size> | ||||||
|  |           </property> | ||||||
|  |           <property name="text"> | ||||||
|  |            <string>SNR</string> | ||||||
|  |           </property> | ||||||
|  |          </widget> | ||||||
|  |         </item> | ||||||
|  |         <item row="1" column="1"> | ||||||
|  |          <widget class="QPushButton" name="deMacroButton"> | ||||||
|  |           <property name="minimumSize"> | ||||||
|  |            <size> | ||||||
|  |             <width>0</width> | ||||||
|  |             <height>30</height> | ||||||
|  |            </size> | ||||||
|  |           </property> | ||||||
|  |           <property name="text"> | ||||||
|  |            <string>DE</string> | ||||||
|  |           </property> | ||||||
|  |          </widget> | ||||||
|  |         </item> | ||||||
|        </layout> |        </layout> | ||||||
|       </widget> |       </widget> | ||||||
|       <widget class="QFrame" name="frame_5"> |       <widget class="QFrame" name="frame_5"> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Jordan Sherer
						Jordan Sherer