| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | // Copyright (C) 2016 F4EXB                                                      //
 | 
					
						
							|  |  |  | // written by Edouard Griffiths                                                  //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is free software; you can redistribute it and/or modify          //
 | 
					
						
							|  |  |  | // it under the terms of the GNU General Public License as published by          //
 | 
					
						
							|  |  |  | // the Free Software Foundation as version 3 of the License, or                  //
 | 
					
						
							| 
									
										
										
										
											2019-04-11 14:43:33 +02:00
										 |  |  | // (at your option) any later version.                                           //
 | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // This program is distributed in the hope that it will be useful,               //
 | 
					
						
							|  |  |  | // but WITHOUT ANY WARRANTY; without even the implied warranty of                //
 | 
					
						
							|  |  |  | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the                  //
 | 
					
						
							|  |  |  | // GNU General Public License V3 for more details.                               //
 | 
					
						
							|  |  |  | //                                                                               //
 | 
					
						
							|  |  |  | // You should have received a copy of the GNU General Public License             //
 | 
					
						
							|  |  |  | // along with this program. If not, see <http://www.gnu.org/licenses/>.          //
 | 
					
						
							|  |  |  | ///////////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef SDRBASE_GUI_CWKEYERGUI_H_
 | 
					
						
							|  |  |  | #define SDRBASE_GUI_CWKEYERGUI_H_
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QWidget>
 | 
					
						
							|  |  |  | #include "dsp/dsptypes.h"
 | 
					
						
							| 
									
										
										
										
											2018-03-20 13:49:21 +01:00
										 |  |  | #include "export.h"
 | 
					
						
							| 
									
										
										
										
											2017-10-10 06:59:13 +02:00
										 |  |  | #include "settings/serializable.h"
 | 
					
						
							| 
									
										
										
										
											2019-07-30 01:31:46 +02:00
										 |  |  | #include "dsp/cwkeyersettings.h"
 | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Ui { | 
					
						
							|  |  |  |     class CWKeyerGUI; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  | class QLabel; | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | class MessageQueue; | 
					
						
							|  |  |  | class CWKeyer; | 
					
						
							| 
									
										
										
										
											2017-12-11 18:18:47 +01:00
										 |  |  | class CWKeyerSettings; | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  | class CommandKeyReceiver; | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-03-03 20:23:38 +01:00
										 |  |  | class SDRGUI_API CWKeyerGUI : public QWidget, public Serializable { | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  |     Q_OBJECT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  |     explicit CWKeyerGUI(QWidget* parent = nullptr); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  |     ~CWKeyerGUI(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-30 01:31:46 +02:00
										 |  |  |     void setCWKeyer(CWKeyer* cwKeyer); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     void resetToDefaults(); | 
					
						
							|  |  |  |     QByteArray serialize() const; | 
					
						
							|  |  |  |     bool deserialize(const QByteArray& data); | 
					
						
							| 
									
										
										
										
											2021-12-01 00:20:14 +01:00
										 |  |  |     virtual void formatTo(SWGSDRangel::SWGObject *swgObject) const; | 
					
						
							|  |  |  |     virtual void updateFrom(const QStringList& keys, const SWGSDRangel::SWGObject *swgObject); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-30 01:31:46 +02:00
										 |  |  |     void setSettings(const CWKeyerSettings& settings) { m_settings = settings; } | 
					
						
							|  |  |  |     void displaySettings(); | 
					
						
							| 
									
										
										
										
											2017-12-11 18:18:47 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | private: | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  |     enum KeyScope | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         NoKeyScope, | 
					
						
							|  |  |  |         DotKeyScope, | 
					
						
							|  |  |  |         DashKeyScope | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  |     Ui::CWKeyerGUI* ui; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     CWKeyer* m_cwKeyer; | 
					
						
							| 
									
										
										
										
											2019-07-30 01:31:46 +02:00
										 |  |  |     CWKeyerSettings m_settings; | 
					
						
							| 
									
										
										
										
											2017-12-11 18:18:47 +01:00
										 |  |  |     bool m_doApplySettings; | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  |     CommandKeyReceiver *m_commandKeyReceiver; | 
					
						
							|  |  |  |     KeyScope m_keyScope; | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-07-30 01:31:46 +02:00
										 |  |  |     void applySettings(bool force = false); | 
					
						
							| 
									
										
										
										
											2017-12-11 18:18:47 +01:00
										 |  |  |     void blockApplySettings(bool block); | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  |     void setKeyLabel(QLabel *label, Qt::Key key, Qt::KeyboardModifiers keyModifiers); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | private slots: | 
					
						
							|  |  |  |     void on_cwTextClear_clicked(bool checked); | 
					
						
							|  |  |  |     void on_cwTextEdit_editingFinished(); | 
					
						
							|  |  |  |     void on_cwSpeed_valueChanged(int value); | 
					
						
							| 
									
										
										
										
											2016-12-11 21:52:53 +01:00
										 |  |  |     void on_playDots_toggled(bool checked); | 
					
						
							|  |  |  |     void on_playDashes_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  |     void on_playText_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2016-12-14 02:54:05 +01:00
										 |  |  |     void on_playLoopCW_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  |     void on_playStop_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2019-07-30 09:27:55 +02:00
										 |  |  |     void on_keyingStyle_toggled(bool checked); | 
					
						
							| 
									
										
										
										
											2019-07-29 18:54:50 +02:00
										 |  |  |     void on_keyDotCapture_toggled(bool checked); | 
					
						
							|  |  |  |     void on_keyDashCapture_toggled(bool checked); | 
					
						
							|  |  |  |     void on_keyboardKeyer_toggled(bool checked); | 
					
						
							|  |  |  |     void commandKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release); | 
					
						
							|  |  |  |     void keyboardKeyPressed(Qt::Key key, Qt::KeyboardModifiers keyModifiers, bool release); | 
					
						
							| 
									
										
										
										
											2016-12-11 11:35:25 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif /* SDRBASE_GUI_CWKEYERGUI_H_ */
 |