| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | #ifndef WSJTX_UDP_CLIENT_WIDGET_MODEL_HPP__
 | 
					
						
							|  |  |  | #define WSJTX_UDP_CLIENT_WIDGET_MODEL_HPP__
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  | #include <QDockWidget>
 | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | #include <QObject>
 | 
					
						
							|  |  |  | #include <QSortFilterProxyModel>
 | 
					
						
							|  |  |  | #include <QString>
 | 
					
						
							|  |  |  | #include <QRegularExpression>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "MessageServer.hpp"
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class QAbstractItemModel; | 
					
						
							|  |  |  | class QModelIndex; | 
					
						
							| 
									
										
										
										
											2018-03-28 22:25:46 +00:00
										 |  |  | class QColor; | 
					
						
							| 
									
										
										
										
											2019-02-03 00:49:35 +00:00
										 |  |  | class QAction; | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  | class QListWidget; | 
					
						
							|  |  |  | class QFormLayout; | 
					
						
							|  |  |  | class QVBoxLayout; | 
					
						
							|  |  |  | class QHBoxLayout; | 
					
						
							|  |  |  | class QStackedLayout; | 
					
						
							|  |  |  | class QTableView; | 
					
						
							|  |  |  | class QLineEdit; | 
					
						
							|  |  |  | class QAbstractButton; | 
					
						
							|  |  |  | class QLabel; | 
					
						
							|  |  |  | class QCheckBox; | 
					
						
							|  |  |  | class QSpinBox; | 
					
						
							|  |  |  | class QFrame; | 
					
						
							|  |  |  | class QStatusBar; | 
					
						
							|  |  |  | class QDialogButtonBox; | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | using Frequency = MessageServer::Frequency; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class ClientWidget | 
					
						
							|  |  |  |   : public QDockWidget | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   Q_OBJECT; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   using ClientKey = MessageServer::ClientKey; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | public: | 
					
						
							|  |  |  |   explicit ClientWidget (QAbstractItemModel * decodes_model, QAbstractItemModel * beacons_model | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |                          , ClientKey const& key, QString const& version, QString const& revision | 
					
						
							| 
									
										
										
										
											2018-03-28 22:25:46 +00:00
										 |  |  |                          , QListWidget const * calls_of_interest, QWidget * parent = nullptr); | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |   void dispose (); | 
					
						
							| 
									
										
										
										
											2018-03-28 22:25:46 +00:00
										 |  |  |   ~ClientWidget (); | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |   bool fast_mode () const; | 
					
						
							| 
									
										
										
										
											2016-12-16 19:36:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SLOT void update_status (ClientKey const& key, Frequency f, QString const& mode, QString const& dx_call | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  |                              , QString const& report, QString const& tx_mode, bool tx_enabled | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |                              , bool transmitting, bool decoding, quint32 rx_df, quint32 tx_df | 
					
						
							| 
									
										
										
										
											2016-07-10 22:20:30 +00:00
										 |  |  |                              , QString const& de_call, QString const& de_grid, QString const& dx_grid | 
					
						
							| 
									
										
										
										
											2018-12-02 23:19:08 +00:00
										 |  |  |                              , bool watchdog_timeout, QString const& sub_mode, bool fast_mode | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |                              , quint8 special_op_mode, quint32 frequency_tolerance, quint32 tr_period | 
					
						
							|  |  |  |                              , QString const& configuration_name); | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SLOT void decode_added (bool is_new, ClientKey const& key, QTime, qint32 snr | 
					
						
							| 
									
										
										
										
											2016-07-10 22:20:30 +00:00
										 |  |  |                             , float delta_time, quint32 delta_frequency, QString const& mode | 
					
						
							| 
									
										
										
										
											2017-09-16 22:20:59 +00:00
										 |  |  |                             , QString const& message, bool low_confidence, bool off_air); | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SLOT void beacon_spot_added (bool is_new, ClientKey const& key, QTime, qint32 snr | 
					
						
							| 
									
										
										
										
											2016-07-10 22:20:30 +00:00
										 |  |  |                                  , float delta_time, Frequency delta_frequency, qint32 drift | 
					
						
							| 
									
										
										
										
											2017-09-16 22:20:59 +00:00
										 |  |  |                                  , QString const& callsign, QString const& grid, qint32 power | 
					
						
							|  |  |  |                                  , bool off_air); | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SLOT void decodes_cleared (ClientKey const& key); | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SIGNAL void do_clear_decodes (ClientKey const& key, quint8 window = 0); | 
					
						
							|  |  |  |   Q_SIGNAL void do_close (ClientKey const& key); | 
					
						
							| 
									
										
										
										
											2017-09-22 15:36:24 +00:00
										 |  |  |   Q_SIGNAL void do_reply (QModelIndex const&, quint8 modifier); | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SIGNAL void do_halt_tx (ClientKey const& key, bool auto_only); | 
					
						
							|  |  |  |   Q_SIGNAL void do_free_text (ClientKey const& key, QString const& text, bool); | 
					
						
							|  |  |  |   Q_SIGNAL void location (ClientKey const& key, QString const& text); | 
					
						
							|  |  |  |   Q_SIGNAL void highlight_callsign (ClientKey const& key, QString const& call | 
					
						
							| 
									
										
										
										
											2018-03-28 22:25:46 +00:00
										 |  |  |                                     , QColor const& bg = QColor {}, QColor const& fg = QColor {} | 
					
						
							|  |  |  |                                     , bool last_only = false); | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   Q_SIGNAL void switch_configuration (ClientKey const& key, QString const& configuration_name); | 
					
						
							|  |  |  |   Q_SIGNAL void configure (ClientKey const& key, QString const& mode, quint32 frequency_tolerance | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |                            , QString const& submode, bool fast_mode, quint32 tr_period, quint32 rx_df | 
					
						
							|  |  |  |                            , QString const& dx_call, QString const& dx_grid, bool generate_messages); | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |   class IdFilterModel final | 
					
						
							|  |  |  |     : public QSortFilterProxyModel | 
					
						
							|  |  |  |   { | 
					
						
							|  |  |  |   public: | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |     IdFilterModel (ClientKey const& key, QObject * = nullptr); | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void de_call (QString const&); | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |     void rx_df (quint32); | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     QVariant data (QModelIndex const& proxy_index, int role = Qt::DisplayRole) const override; | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |   private: | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  |     bool filterAcceptsRow (int source_row, QModelIndex const& source_parent) const override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |     ClientKey key_; | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  |     QString call_; | 
					
						
							|  |  |  |     QRegularExpression base_call_re_; | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |     quint32 rx_df_; | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   void closeEvent (QCloseEvent *) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-02 21:35:48 +00:00
										 |  |  |   ClientKey key_; | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |   bool done_; | 
					
						
							|  |  |  |   QListWidget const * calls_of_interest_; | 
					
						
							|  |  |  |   IdFilterModel decodes_proxy_model_; | 
					
						
							|  |  |  |   IdFilterModel beacons_proxy_model_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-02-03 00:49:35 +00:00
										 |  |  |   QAction * erase_action_; | 
					
						
							|  |  |  |   QAction * erase_rx_frequency_action_; | 
					
						
							|  |  |  |   QAction * erase_both_action_; | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  |   QTableView * decodes_table_view_; | 
					
						
							|  |  |  |   QTableView * beacons_table_view_; | 
					
						
							|  |  |  |   QLineEdit * message_line_edit_; | 
					
						
							| 
									
										
										
										
											2018-02-04 22:42:35 +00:00
										 |  |  |   QLineEdit * grid_line_edit_; | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |   QAbstractButton * generate_messages_push_button_; | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  |   QAbstractButton * auto_off_button_; | 
					
						
							|  |  |  |   QAbstractButton * halt_tx_button_; | 
					
						
							| 
									
										
										
										
											2018-02-04 22:42:35 +00:00
										 |  |  |   QLabel * de_label_; | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  |   QLabel * frequency_label_; | 
					
						
							|  |  |  |   QLabel * tx_df_label_; | 
					
						
							|  |  |  |   QLabel * report_label_; | 
					
						
							| 
									
										
										
										
											2019-06-13 01:44:28 +01:00
										 |  |  |   QLineEdit * configuration_line_edit_; | 
					
						
							| 
									
										
										
										
											2019-06-25 14:35:58 +01:00
										 |  |  |   QLineEdit * mode_line_edit_; | 
					
						
							|  |  |  |   QSpinBox * frequency_tolerance_spin_box_; | 
					
						
							|  |  |  |   QLabel * tx_mode_label_; | 
					
						
							|  |  |  |   QLineEdit * submode_line_edit_; | 
					
						
							|  |  |  |   QCheckBox * fast_mode_check_box_; | 
					
						
							|  |  |  |   QSpinBox * tr_period_spin_box_; | 
					
						
							|  |  |  |   QSpinBox * rx_df_spin_box_; | 
					
						
							|  |  |  |   QLineEdit * dx_call_line_edit_; | 
					
						
							|  |  |  |   QLineEdit * dx_grid_line_edit_; | 
					
						
							|  |  |  |   QWidget * decodes_page_; | 
					
						
							|  |  |  |   QWidget * beacons_page_; | 
					
						
							|  |  |  |   QFrame * content_widget_; | 
					
						
							|  |  |  |   QStatusBar * status_bar_; | 
					
						
							|  |  |  |   QDialogButtonBox * control_button_box_; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   QFormLayout * form_layout_; | 
					
						
							|  |  |  |   QHBoxLayout * horizontal_layout_; | 
					
						
							|  |  |  |   QFormLayout * subform1_layout_; | 
					
						
							|  |  |  |   QFormLayout * subform2_layout_; | 
					
						
							|  |  |  |   QFormLayout * subform3_layout_; | 
					
						
							|  |  |  |   QVBoxLayout * decodes_layout_; | 
					
						
							|  |  |  |   QVBoxLayout * beacons_layout_; | 
					
						
							|  |  |  |   QVBoxLayout * content_layout_; | 
					
						
							|  |  |  |   QStackedLayout * decodes_stack_; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-09-22 22:08:41 +00:00
										 |  |  |   bool columns_resized_; | 
					
						
							| 
									
										
										
										
											2016-05-24 10:08:35 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |