mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-30 20:40:20 -04:00 
			
		
		
		
	Web API: AM demod: added pll and syncAMOperation settings processing
This commit is contained in:
		
							parent
							
								
									eef1ce9a64
								
							
						
					
					
						commit
						8dd65e70f2
					
				
							
								
								
									
										1
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/changelog
									
									
									
									
										vendored
									
									
								
							| @ -1,6 +1,7 @@ | ||||
| sdrangel (4.0.6-1) unstable; urgency=medium | ||||
| 
 | ||||
|   * Web API: RTL-SDR: fixed RF bandwidth setting | ||||
|   * Web API: enhnaced DV serial and AM demod interfaces | ||||
| 
 | ||||
|  -- Edouard Griffiths, F4EXB <f4exb06@gmail.com>  Sun, 05 Aug 2018 09:14:18 +0200 | ||||
|    | ||||
|  | ||||
| @ -549,6 +549,17 @@ int AMDemod::webapiSettingsPutPatch( | ||||
|         settings.m_audioDeviceName = *response.getAmDemodSettings()->getAudioDeviceName(); | ||||
|     } | ||||
| 
 | ||||
|     if (channelSettingsKeys.contains("pll")) { | ||||
|         settings.m_pll = response.getAmDemodSettings()->getPll(); | ||||
|     } | ||||
| 
 | ||||
|     if (channelSettingsKeys.contains("syncAMOperation")) { | ||||
|         qint32 syncAMOperationCode = response.getAmDemodSettings()->getSyncAmOperation(); | ||||
|         settings.m_syncAMOperation = syncAMOperationCode < 0 ? | ||||
|                 AMDemodSettings::SyncAMDSB : syncAMOperationCode > 2 ? | ||||
|                         AMDemodSettings::SyncAMDSB : (AMDemodSettings::SyncAMOperation) syncAMOperationCode; | ||||
|     } | ||||
| 
 | ||||
|     if (frequencyOffsetChanged) | ||||
|     { | ||||
|         MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create( | ||||
| @ -602,6 +613,9 @@ void AMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& respo | ||||
|     } else { | ||||
|         response.getAmDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName)); | ||||
|     } | ||||
| 
 | ||||
|     response.getAmDemodSettings()->setPll(settings.m_pll ? 1 : 0); | ||||
|     response.getAmDemodSettings()->setSyncAmOperation((int) m_settings.m_syncAMOperation); | ||||
| } | ||||
| 
 | ||||
| void AMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response) | ||||
|  | ||||
| @ -752,6 +752,14 @@ margin-bottom: 20px; | ||||
|     }, | ||||
|     "audioDeviceName" : { | ||||
|       "type" : "string" | ||||
|     }, | ||||
|     "pll" : { | ||||
|       "type" : "integer", | ||||
|       "description" : "PLL active (for synchronous AM)" | ||||
|     }, | ||||
|     "syncAMOperation" : { | ||||
|       "type" : "integer", | ||||
|       "description" : "Synchronous AM sidebands mode (DSB, USB, LSB)" | ||||
|     } | ||||
|   }, | ||||
|   "description" : "AMDemod" | ||||
| @ -22947,7 +22955,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2018-08-02T21:39:46.879+02:00 | ||||
|               Generated 2018-08-02T23:13:51.054+02:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -27,6 +27,12 @@ AMDemodSettings: | ||||
|       type: string | ||||
|     audioDeviceName: | ||||
|       type: string | ||||
|     pll: | ||||
|       description: PLL active (for synchronous AM) | ||||
|       type: integer | ||||
|     syncAMOperation: | ||||
|       description: Synchronous AM sidebands mode (DSB, USB, LSB) | ||||
|       type: integer | ||||
| 
 | ||||
| AMDemodReport: | ||||
|   description: AMDemod | ||||
|  | ||||
| @ -27,6 +27,12 @@ AMDemodSettings: | ||||
|       type: string | ||||
|     audioDeviceName: | ||||
|       type: string | ||||
|     pll: | ||||
|       description: PLL active (for synchronous AM) | ||||
|       type: integer | ||||
|     syncAMOperation: | ||||
|       description: Synchronous AM sidebands mode (DSB, USB, LSB) | ||||
|       type: integer | ||||
| 
 | ||||
| AMDemodReport: | ||||
|   description: AMDemod | ||||
|  | ||||
| @ -752,6 +752,14 @@ margin-bottom: 20px; | ||||
|     }, | ||||
|     "audioDeviceName" : { | ||||
|       "type" : "string" | ||||
|     }, | ||||
|     "pll" : { | ||||
|       "type" : "integer", | ||||
|       "description" : "PLL active (for synchronous AM)" | ||||
|     }, | ||||
|     "syncAMOperation" : { | ||||
|       "type" : "integer", | ||||
|       "description" : "Synchronous AM sidebands mode (DSB, USB, LSB)" | ||||
|     } | ||||
|   }, | ||||
|   "description" : "AMDemod" | ||||
| @ -22947,7 +22955,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2018-08-02T21:39:46.879+02:00 | ||||
|               Generated 2018-08-02T23:13:51.054+02:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -46,6 +46,10 @@ SWGAMDemodSettings::SWGAMDemodSettings() { | ||||
|     m_title_isSet = false; | ||||
|     audio_device_name = nullptr; | ||||
|     m_audio_device_name_isSet = false; | ||||
|     pll = 0; | ||||
|     m_pll_isSet = false; | ||||
|     sync_am_operation = 0; | ||||
|     m_sync_am_operation_isSet = false; | ||||
| } | ||||
| 
 | ||||
| SWGAMDemodSettings::~SWGAMDemodSettings() { | ||||
| @ -72,6 +76,10 @@ SWGAMDemodSettings::init() { | ||||
|     m_title_isSet = false; | ||||
|     audio_device_name = new QString(""); | ||||
|     m_audio_device_name_isSet = false; | ||||
|     pll = 0; | ||||
|     m_pll_isSet = false; | ||||
|     sync_am_operation = 0; | ||||
|     m_sync_am_operation_isSet = false; | ||||
| } | ||||
| 
 | ||||
| void | ||||
| @ -89,6 +97,8 @@ SWGAMDemodSettings::cleanup() { | ||||
|     if(audio_device_name != nullptr) {  | ||||
|         delete audio_device_name; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| SWGAMDemodSettings* | ||||
| @ -120,6 +130,10 @@ SWGAMDemodSettings::fromJsonObject(QJsonObject &pJson) { | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&audio_device_name, pJson["audioDeviceName"], "QString", "QString"); | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&pll, pJson["pll"], "qint32", ""); | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&sync_am_operation, pJson["syncAMOperation"], "qint32", ""); | ||||
|      | ||||
| } | ||||
| 
 | ||||
| QString | ||||
| @ -163,6 +177,12 @@ SWGAMDemodSettings::asJsonObject() { | ||||
|     if(audio_device_name != nullptr && *audio_device_name != QString("")){ | ||||
|         toJsonValue(QString("audioDeviceName"), audio_device_name, obj, QString("QString")); | ||||
|     } | ||||
|     if(m_pll_isSet){ | ||||
|         obj->insert("pll", QJsonValue(pll)); | ||||
|     } | ||||
|     if(m_sync_am_operation_isSet){ | ||||
|         obj->insert("syncAMOperation", QJsonValue(sync_am_operation)); | ||||
|     } | ||||
| 
 | ||||
|     return obj; | ||||
| } | ||||
| @ -257,6 +277,26 @@ SWGAMDemodSettings::setAudioDeviceName(QString* audio_device_name) { | ||||
|     this->m_audio_device_name_isSet = true; | ||||
| } | ||||
| 
 | ||||
| qint32 | ||||
| SWGAMDemodSettings::getPll() { | ||||
|     return pll; | ||||
| } | ||||
| void | ||||
| SWGAMDemodSettings::setPll(qint32 pll) { | ||||
|     this->pll = pll; | ||||
|     this->m_pll_isSet = true; | ||||
| } | ||||
| 
 | ||||
| qint32 | ||||
| SWGAMDemodSettings::getSyncAmOperation() { | ||||
|     return sync_am_operation; | ||||
| } | ||||
| void | ||||
| SWGAMDemodSettings::setSyncAmOperation(qint32 sync_am_operation) { | ||||
|     this->sync_am_operation = sync_am_operation; | ||||
|     this->m_sync_am_operation_isSet = true; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| bool | ||||
| SWGAMDemodSettings::isSet(){ | ||||
| @ -271,6 +311,8 @@ SWGAMDemodSettings::isSet(){ | ||||
|         if(m_rgb_color_isSet){ isObjectUpdated = true; break;} | ||||
|         if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;} | ||||
|         if(audio_device_name != nullptr && *audio_device_name != QString("")){ isObjectUpdated = true; break;} | ||||
|         if(m_pll_isSet){ isObjectUpdated = true; break;} | ||||
|         if(m_sync_am_operation_isSet){ isObjectUpdated = true; break;} | ||||
|     }while(false); | ||||
|     return isObjectUpdated; | ||||
| } | ||||
|  | ||||
| @ -69,6 +69,12 @@ public: | ||||
|     QString* getAudioDeviceName(); | ||||
|     void setAudioDeviceName(QString* audio_device_name); | ||||
| 
 | ||||
|     qint32 getPll(); | ||||
|     void setPll(qint32 pll); | ||||
| 
 | ||||
|     qint32 getSyncAmOperation(); | ||||
|     void setSyncAmOperation(qint32 sync_am_operation); | ||||
| 
 | ||||
| 
 | ||||
|     virtual bool isSet() override; | ||||
| 
 | ||||
| @ -100,6 +106,12 @@ private: | ||||
|     QString* audio_device_name; | ||||
|     bool m_audio_device_name_isSet; | ||||
| 
 | ||||
|     qint32 pll; | ||||
|     bool m_pll_isSet; | ||||
| 
 | ||||
|     qint32 sync_am_operation; | ||||
|     bool m_sync_am_operation_isSet; | ||||
| 
 | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user