mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-31 04:50:29 -04:00 
			
		
		
		
	Demod Analyzer: REST API update. AMMod: fixed include issue
This commit is contained in:
		
							parent
							
								
									d93186e059
								
							
						
					
					
						commit
						e8ea0665fe
					
				| @ -20,6 +20,7 @@ | ||||
| 
 | ||||
| #include <QObject> | ||||
| #include <QMutex> | ||||
| #include <QVector> | ||||
| 
 | ||||
| #include <iostream> | ||||
| #include <fstream> | ||||
|  | ||||
| @ -402,6 +402,7 @@ void DemodAnalyzer::webapiFormatFeatureSettings( | ||||
|         response.getDemodAnalyzerSettings()->setTitle(new QString(settings.m_title)); | ||||
|     } | ||||
| 
 | ||||
|     response.getDemodAnalyzerSettings()->setLog2Decim(settings.m_log2Decim); | ||||
|     response.getDemodAnalyzerSettings()->setRgbColor(settings.m_rgbColor); | ||||
|     response.getDemodAnalyzerSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0); | ||||
| 
 | ||||
| @ -421,6 +422,9 @@ void DemodAnalyzer::webapiUpdateFeatureSettings( | ||||
|     const QStringList& featureSettingsKeys, | ||||
|     SWGSDRangel::SWGFeatureSettings& response) | ||||
| { | ||||
|     if (featureSettingsKeys.contains("log2Decim")) { | ||||
|         settings.m_log2Decim = response.getDemodAnalyzerSettings()->getLog2Decim(); | ||||
|     } | ||||
|     if (featureSettingsKeys.contains("title")) { | ||||
|         settings.m_title = *response.getDemodAnalyzerSettings()->getTitle(); | ||||
|     } | ||||
| @ -455,6 +459,9 @@ void DemodAnalyzer::webapiReverseSendSettings(QList<QString>& featureSettingsKey | ||||
| 
 | ||||
|     // transfer data that has been modified. When force is on transfer all data except reverse API data
 | ||||
| 
 | ||||
|     if (featureSettingsKeys.contains("log2Decim") || force) { | ||||
|         swgDemodAnalyzerSettings->setLog2Decim(settings.m_log2Decim); | ||||
|     } | ||||
|     if (featureSettingsKeys.contains("title") || force) { | ||||
|         swgDemodAnalyzerSettings->setTitle(new QString(settings.m_title)); | ||||
|     } | ||||
|  | ||||
| @ -3403,10 +3403,7 @@ margin-bottom: 20px; | ||||
| }; | ||||
|             defs.DemodAnalyzerSettings = { | ||||
|   "properties" : { | ||||
|     "deviceIndex" : { | ||||
|       "type" : "integer" | ||||
|     }, | ||||
|     "channelIndex" : { | ||||
|     "log2Decim" : { | ||||
|       "type" : "integer" | ||||
|     }, | ||||
|     "title" : { | ||||
| @ -44920,7 +44917,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2020-12-16T13:53:51.605+01:00 | ||||
|               Generated 2020-12-20T18:34:47.837+01:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -1,9 +1,7 @@ | ||||
| DemodAnalyzerSettings: | ||||
|   description: DemodAnalyzer | ||||
|   properties: | ||||
|     deviceIndex: | ||||
|       type: integer | ||||
|     channelIndex: | ||||
|     log2Decim: | ||||
|       type: integer | ||||
|     title: | ||||
|       type: string | ||||
|  | ||||
| @ -1,9 +1,7 @@ | ||||
| DemodAnalyzerSettings: | ||||
|   description: DemodAnalyzer | ||||
|   properties: | ||||
|     deviceIndex: | ||||
|       type: integer | ||||
|     channelIndex: | ||||
|     log2Decim: | ||||
|       type: integer | ||||
|     title: | ||||
|       type: string | ||||
|  | ||||
| @ -3403,10 +3403,7 @@ margin-bottom: 20px; | ||||
| }; | ||||
|             defs.DemodAnalyzerSettings = { | ||||
|   "properties" : { | ||||
|     "deviceIndex" : { | ||||
|       "type" : "integer" | ||||
|     }, | ||||
|     "channelIndex" : { | ||||
|     "log2Decim" : { | ||||
|       "type" : "integer" | ||||
|     }, | ||||
|     "title" : { | ||||
| @ -44920,7 +44917,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2020-12-16T13:53:51.605+01:00 | ||||
|               Generated 2020-12-20T18:34:47.837+01:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -28,10 +28,8 @@ SWGDemodAnalyzerSettings::SWGDemodAnalyzerSettings(QString* json) { | ||||
| } | ||||
| 
 | ||||
| SWGDemodAnalyzerSettings::SWGDemodAnalyzerSettings() { | ||||
|     device_index = 0; | ||||
|     m_device_index_isSet = false; | ||||
|     channel_index = 0; | ||||
|     m_channel_index_isSet = false; | ||||
|     log2_decim = 0; | ||||
|     m_log2_decim_isSet = false; | ||||
|     title = nullptr; | ||||
|     m_title_isSet = false; | ||||
|     rgb_color = 0; | ||||
| @ -58,10 +56,8 @@ SWGDemodAnalyzerSettings::~SWGDemodAnalyzerSettings() { | ||||
| 
 | ||||
| void | ||||
| SWGDemodAnalyzerSettings::init() { | ||||
|     device_index = 0; | ||||
|     m_device_index_isSet = false; | ||||
|     channel_index = 0; | ||||
|     m_channel_index_isSet = false; | ||||
|     log2_decim = 0; | ||||
|     m_log2_decim_isSet = false; | ||||
|     title = new QString(""); | ||||
|     m_title_isSet = false; | ||||
|     rgb_color = 0; | ||||
| @ -85,7 +81,6 @@ SWGDemodAnalyzerSettings::init() { | ||||
| void | ||||
| SWGDemodAnalyzerSettings::cleanup() { | ||||
| 
 | ||||
| 
 | ||||
|     if(title != nullptr) {  | ||||
|         delete title; | ||||
|     } | ||||
| @ -116,9 +111,7 @@ SWGDemodAnalyzerSettings::fromJson(QString &json) { | ||||
| 
 | ||||
| void | ||||
| SWGDemodAnalyzerSettings::fromJsonObject(QJsonObject &pJson) { | ||||
|     ::SWGSDRangel::setValue(&device_index, pJson["deviceIndex"], "qint32", ""); | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&channel_index, pJson["channelIndex"], "qint32", ""); | ||||
|     ::SWGSDRangel::setValue(&log2_decim, pJson["log2Decim"], "qint32", ""); | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); | ||||
|      | ||||
| @ -154,11 +147,8 @@ SWGDemodAnalyzerSettings::asJson () | ||||
| QJsonObject* | ||||
| SWGDemodAnalyzerSettings::asJsonObject() { | ||||
|     QJsonObject* obj = new QJsonObject(); | ||||
|     if(m_device_index_isSet){ | ||||
|         obj->insert("deviceIndex", QJsonValue(device_index)); | ||||
|     } | ||||
|     if(m_channel_index_isSet){ | ||||
|         obj->insert("channelIndex", QJsonValue(channel_index)); | ||||
|     if(m_log2_decim_isSet){ | ||||
|         obj->insert("log2Decim", QJsonValue(log2_decim)); | ||||
|     } | ||||
|     if(title != nullptr && *title != QString("")){ | ||||
|         toJsonValue(QString("title"), title, obj, QString("QString")); | ||||
| @ -192,23 +182,13 @@ SWGDemodAnalyzerSettings::asJsonObject() { | ||||
| } | ||||
| 
 | ||||
| qint32 | ||||
| SWGDemodAnalyzerSettings::getDeviceIndex() { | ||||
|     return device_index; | ||||
| SWGDemodAnalyzerSettings::getLog2Decim() { | ||||
|     return log2_decim; | ||||
| } | ||||
| void | ||||
| SWGDemodAnalyzerSettings::setDeviceIndex(qint32 device_index) { | ||||
|     this->device_index = device_index; | ||||
|     this->m_device_index_isSet = true; | ||||
| } | ||||
| 
 | ||||
| qint32 | ||||
| SWGDemodAnalyzerSettings::getChannelIndex() { | ||||
|     return channel_index; | ||||
| } | ||||
| void | ||||
| SWGDemodAnalyzerSettings::setChannelIndex(qint32 channel_index) { | ||||
|     this->channel_index = channel_index; | ||||
|     this->m_channel_index_isSet = true; | ||||
| SWGDemodAnalyzerSettings::setLog2Decim(qint32 log2_decim) { | ||||
|     this->log2_decim = log2_decim; | ||||
|     this->m_log2_decim_isSet = true; | ||||
| } | ||||
| 
 | ||||
| QString* | ||||
| @ -306,10 +286,7 @@ bool | ||||
| SWGDemodAnalyzerSettings::isSet(){ | ||||
|     bool isObjectUpdated = false; | ||||
|     do{ | ||||
|         if(m_device_index_isSet){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|         if(m_channel_index_isSet){ | ||||
|         if(m_log2_decim_isSet){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|         if(title && *title != QString("")){ | ||||
|  | ||||
| @ -44,11 +44,8 @@ public: | ||||
|     virtual void fromJsonObject(QJsonObject &json) override; | ||||
|     virtual SWGDemodAnalyzerSettings* fromJson(QString &jsonString) override; | ||||
| 
 | ||||
|     qint32 getDeviceIndex(); | ||||
|     void setDeviceIndex(qint32 device_index); | ||||
| 
 | ||||
|     qint32 getChannelIndex(); | ||||
|     void setChannelIndex(qint32 channel_index); | ||||
|     qint32 getLog2Decim(); | ||||
|     void setLog2Decim(qint32 log2_decim); | ||||
| 
 | ||||
|     QString* getTitle(); | ||||
|     void setTitle(QString* title); | ||||
| @ -81,11 +78,8 @@ public: | ||||
|     virtual bool isSet() override; | ||||
| 
 | ||||
| private: | ||||
|     qint32 device_index; | ||||
|     bool m_device_index_isSet; | ||||
| 
 | ||||
|     qint32 channel_index; | ||||
|     bool m_channel_index_isSet; | ||||
|     qint32 log2_decim; | ||||
|     bool m_log2_decim_isSet; | ||||
| 
 | ||||
|     QString* title; | ||||
|     bool m_title_isSet; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user