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