mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-10-27 11:00:31 -04:00 
			
		
		
		
	Radiosonde feature: Make settings assignments atomic. Part of #1329
This commit is contained in:
		
							parent
							
								
									6bba016a7d
								
							
						
					
					
						commit
						ecdc464869
					
				| @ -98,7 +98,7 @@ bool Radiosonde::handleMessage(const Message& cmd) | ||||
|     { | ||||
|         MsgConfigureRadiosonde& cfg = (MsgConfigureRadiosonde&) cmd; | ||||
|         qDebug() << "Radiosonde::handleMessage: MsgConfigureRadiosonde"; | ||||
|         applySettings(cfg.getSettings(), cfg.getForce()); | ||||
|         applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce()); | ||||
| 
 | ||||
|         return true; | ||||
|     } | ||||
| @ -127,51 +127,38 @@ bool Radiosonde::deserialize(const QByteArray& data) | ||||
| { | ||||
|     if (m_settings.deserialize(data)) | ||||
|     { | ||||
|         MsgConfigureRadiosonde *msg = MsgConfigureRadiosonde::create(m_settings, true); | ||||
|         MsgConfigureRadiosonde *msg = MsgConfigureRadiosonde::create(m_settings, QList<QString>(), true); | ||||
|         m_inputMessageQueue.push(msg); | ||||
|         return true; | ||||
|     } | ||||
|     else | ||||
|     { | ||||
|         m_settings.resetToDefaults(); | ||||
|         MsgConfigureRadiosonde *msg = MsgConfigureRadiosonde::create(m_settings, true); | ||||
|         MsgConfigureRadiosonde *msg = MsgConfigureRadiosonde::create(m_settings, QList<QString>(), true); | ||||
|         m_inputMessageQueue.push(msg); | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void Radiosonde::applySettings(const RadiosondeSettings& settings, bool force) | ||||
| void Radiosonde::applySettings(const RadiosondeSettings& settings, const QList<QString>& settingsKeys, bool force) | ||||
| { | ||||
|     qDebug() << "Radiosonde::applySettings:" | ||||
|             << " m_title: " << settings.m_title | ||||
|             << " m_rgbColor: " << settings.m_rgbColor | ||||
|             << " m_useReverseAPI: " << settings.m_useReverseAPI | ||||
|             << " m_reverseAPIAddress: " << settings.m_reverseAPIAddress | ||||
|             << " m_reverseAPIPort: " << settings.m_reverseAPIPort | ||||
|             << " m_reverseAPIFeatureSetIndex: " << settings.m_reverseAPIFeatureSetIndex | ||||
|             << " m_reverseAPIFeatureIndex: " << settings.m_reverseAPIFeatureIndex | ||||
|             << " force: " << force; | ||||
|     qDebug() << "Radiosonde::applySettings:" << settings.getDebugString(settingsKeys, force) << " force: " << force; | ||||
| 
 | ||||
|     QList<QString> reverseAPIKeys; | ||||
| 
 | ||||
|     if ((m_settings.m_title != settings.m_title) || force) { | ||||
|         reverseAPIKeys.append("title"); | ||||
|     } | ||||
|     if ((m_settings.m_rgbColor != settings.m_rgbColor) || force) { | ||||
|         reverseAPIKeys.append("rgbColor"); | ||||
|     } | ||||
| 
 | ||||
|     if (settings.m_useReverseAPI) | ||||
|     if (settingsKeys.contains("useReverseAPI")) | ||||
|     { | ||||
|         bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || | ||||
|                 (m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) || | ||||
|                 (m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) || | ||||
|                 (m_settings.m_reverseAPIFeatureSetIndex != settings.m_reverseAPIFeatureSetIndex) || | ||||
|                 (m_settings.m_reverseAPIFeatureIndex != settings.m_reverseAPIFeatureIndex); | ||||
|         webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force); | ||||
|         bool fullUpdate = (settingsKeys.contains("useReverseAPI") && settings.m_useReverseAPI) || | ||||
|                 settingsKeys.contains("reverseAPIAddress") || | ||||
|                 settingsKeys.contains("reverseAPIPort") || | ||||
|                 settingsKeys.contains("reverseAPIFeatureSetIndex") || | ||||
|                 settingsKeys.contains("m_reverseAPIFeatureIndex"); | ||||
|         webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force); | ||||
|     } | ||||
| 
 | ||||
|     m_settings = settings; | ||||
|     if (force) { | ||||
|         m_settings = settings; | ||||
|     } else { | ||||
|         m_settings.applySettings(settingsKeys, settings); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| int Radiosonde::webapiSettingsGet( | ||||
| @ -195,12 +182,12 @@ int Radiosonde::webapiSettingsPutPatch( | ||||
|     RadiosondeSettings settings = m_settings; | ||||
|     webapiUpdateFeatureSettings(settings, featureSettingsKeys, response); | ||||
| 
 | ||||
|     MsgConfigureRadiosonde *msg = MsgConfigureRadiosonde::create(settings, force); | ||||
|     MsgConfigureRadiosonde *msg = MsgConfigureRadiosonde::create(settings, featureSettingsKeys, force); | ||||
|     m_inputMessageQueue.push(msg); | ||||
| 
 | ||||
|     if (m_guiMessageQueue) // forward to GUI if any
 | ||||
|     { | ||||
|         MsgConfigureRadiosonde *msgToGUI = MsgConfigureRadiosonde::create(settings, force); | ||||
|         MsgConfigureRadiosonde *msgToGUI = MsgConfigureRadiosonde::create(settings, featureSettingsKeys, force); | ||||
|         m_guiMessageQueue->push(msgToGUI); | ||||
|     } | ||||
| 
 | ||||
| @ -245,6 +232,26 @@ void Radiosonde::webapiFormatFeatureSettings( | ||||
|             response.getRadiosondeSettings()->setRollupState(swgRollupState); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (!response.getRadiosondeSettings()->getRadiosondesColumnIndexes()) { | ||||
|         response.getRadiosondeSettings()->setRadiosondesColumnIndexes(new QList<int>()); | ||||
|     } | ||||
| 
 | ||||
|     response.getRadiosondeSettings()->getRadiosondesColumnIndexes()->clear(); | ||||
| 
 | ||||
|     for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|         response.getRadiosondeSettings()->getRadiosondesColumnIndexes()->push_back(settings.m_radiosondesColumnIndexes[i]); | ||||
|     } | ||||
| 
 | ||||
|     if (!response.getRadiosondeSettings()->getRadiosondesColumnSizes()) { | ||||
|         response.getRadiosondeSettings()->setRadiosondesColumnSizes(new QList<int>()); | ||||
|     } | ||||
| 
 | ||||
|     response.getRadiosondeSettings()->getRadiosondesColumnSizes()->clear(); | ||||
| 
 | ||||
|     for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|         response.getRadiosondeSettings()->getRadiosondesColumnSizes()->push_back(settings.m_radiosondesColumnSizes[i]); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void Radiosonde::webapiUpdateFeatureSettings( | ||||
| @ -276,9 +283,27 @@ void Radiosonde::webapiUpdateFeatureSettings( | ||||
|     if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) { | ||||
|         settings.m_rollupState->updateFrom(featureSettingsKeys, response.getRadiosondeSettings()->getRollupState()); | ||||
|     } | ||||
| 
 | ||||
|     if (featureSettingsKeys.contains("radiosondesColumnIndexes")) | ||||
|     { | ||||
|         const QList<int> *indexes = response.getRadiosondeSettings()->getRadiosondesColumnIndexes(); | ||||
| 
 | ||||
|         for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|             settings.m_radiosondesColumnIndexes[i] = (*indexes)[i]; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (featureSettingsKeys.contains("vesselColumnSizes")) | ||||
|     { | ||||
|         const QList<int> *indexes = response.getRadiosondeSettings()->getRadiosondesColumnSizes(); | ||||
| 
 | ||||
|         for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|             settings.m_radiosondesColumnSizes[i] = (*indexes)[i]; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void Radiosonde::webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const RadiosondeSettings& settings, bool force) | ||||
| void Radiosonde::webapiReverseSendSettings(const QList<QString>& featureSettingsKeys, const RadiosondeSettings& settings, bool force) | ||||
| { | ||||
|     SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings(); | ||||
|     // swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet());
 | ||||
|  | ||||
| @ -44,19 +44,22 @@ public: | ||||
| 
 | ||||
|     public: | ||||
|         const RadiosondeSettings& getSettings() const { return m_settings; } | ||||
|         const QList<QString>& getSettingsKeys() const { return m_settingsKeys; } | ||||
|         bool getForce() const { return m_force; } | ||||
| 
 | ||||
|         static MsgConfigureRadiosonde* create(const RadiosondeSettings& settings, bool force) { | ||||
|             return new MsgConfigureRadiosonde(settings, force); | ||||
|         static MsgConfigureRadiosonde* create(const RadiosondeSettings& settings, const QList<QString>& settingsKeys, bool force) { | ||||
|             return new MsgConfigureRadiosonde(settings, settingsKeys, force); | ||||
|         } | ||||
| 
 | ||||
|     private: | ||||
|         RadiosondeSettings m_settings; | ||||
|         QList<QString> m_settingsKeys; | ||||
|         bool m_force; | ||||
| 
 | ||||
|         MsgConfigureRadiosonde(const RadiosondeSettings& settings, bool force) : | ||||
|         MsgConfigureRadiosonde(const RadiosondeSettings& settings, const QList<QString>& settingsKeys, bool force) : | ||||
|             Message(), | ||||
|             m_settings(settings), | ||||
|             m_settingsKeys(settingsKeys), | ||||
|             m_force(force) | ||||
|         { } | ||||
|     }; | ||||
| @ -104,8 +107,8 @@ private: | ||||
| 
 | ||||
|     void start(); | ||||
|     void stop(); | ||||
|     void applySettings(const RadiosondeSettings& settings, bool force = false); | ||||
|     void webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const RadiosondeSettings& settings, bool force); | ||||
|     void applySettings(const RadiosondeSettings& settings, const QList<QString>& settingsKeys, bool force = false); | ||||
|     void webapiReverseSendSettings(const QList<QString>& featureSettingsKeys, const RadiosondeSettings& settings, bool force); | ||||
|     void scanAvailableChannels(); | ||||
| 
 | ||||
| private slots: | ||||
|  | ||||
| @ -81,7 +81,13 @@ bool RadiosondeGUI::handleMessage(const Message& message) | ||||
|     { | ||||
|         qDebug("RadiosondeGUI::handleMessage: Radiosonde::MsgConfigureRadiosonde"); | ||||
|         const Radiosonde::MsgConfigureRadiosonde& cfg = (Radiosonde::MsgConfigureRadiosonde&) message; | ||||
|         m_settings = cfg.getSettings(); | ||||
| 
 | ||||
|         if (cfg.getForce()) { | ||||
|             m_settings = cfg.getSettings(); | ||||
|         } else { | ||||
|             m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings()); | ||||
|         } | ||||
| 
 | ||||
|         blockApplySettings(true); | ||||
|         displaySettings(); | ||||
|         blockApplySettings(false); | ||||
| @ -198,6 +204,7 @@ void RadiosondeGUI::setWorkspaceIndex(int index) | ||||
| { | ||||
|     m_settings.m_workspaceIndex = index; | ||||
|     m_feature->setWorkspaceIndex(index); | ||||
|     m_settingsKeys.append("workspaceIndex"); | ||||
| } | ||||
| 
 | ||||
| void RadiosondeGUI::blockApplySettings(bool block) | ||||
| @ -259,6 +266,14 @@ void RadiosondeGUI::onMenuDialogCalled(const QPoint &p) | ||||
|         setTitle(m_settings.m_title); | ||||
|         setTitleColor(m_settings.m_rgbColor); | ||||
| 
 | ||||
|         m_settingsKeys.append("title"); | ||||
|         m_settingsKeys.append("rgbColor"); | ||||
|         m_settingsKeys.append("useReverseAPI"); | ||||
|         m_settingsKeys.append("reverseAPIAddress"); | ||||
|         m_settingsKeys.append("reverseAPIPort"); | ||||
|         m_settingsKeys.append("reverseAPIFeatureSetIndex"); | ||||
|         m_settingsKeys.append("reverseAPIFeatureIndex"); | ||||
| 
 | ||||
|         applySettings(); | ||||
|     } | ||||
| 
 | ||||
| @ -269,9 +284,11 @@ void RadiosondeGUI::applySettings(bool force) | ||||
| { | ||||
|     if (m_doApplySettings) | ||||
|     { | ||||
|         Radiosonde::MsgConfigureRadiosonde* message = Radiosonde::MsgConfigureRadiosonde::create(m_settings, force); | ||||
|         Radiosonde::MsgConfigureRadiosonde* message = Radiosonde::MsgConfigureRadiosonde::create(m_settings, m_settingsKeys, force); | ||||
|         m_radiosonde->getInputMessageQueue()->push(message); | ||||
|     } | ||||
| 
 | ||||
|     m_settingsKeys.clear(); | ||||
| } | ||||
| 
 | ||||
| void RadiosondeGUI::resizeTable() | ||||
| @ -307,6 +324,7 @@ void RadiosondeGUI::radiosondes_sectionMoved(int logicalIndex, int oldVisualInde | ||||
|     (void) oldVisualIndex; | ||||
| 
 | ||||
|     m_settings.m_radiosondesColumnIndexes[logicalIndex] = newVisualIndex; | ||||
|     m_settingsKeys.append("radiosondesColumnIndexes"); | ||||
| } | ||||
| 
 | ||||
| // Column in table resized (when hidden size is 0)
 | ||||
| @ -315,6 +333,7 @@ void RadiosondeGUI::radiosondes_sectionResized(int logicalIndex, int oldSize, in | ||||
|     (void) oldSize; | ||||
| 
 | ||||
|     m_settings.m_radiosondesColumnSizes[logicalIndex] = newSize; | ||||
|     m_settingsKeys.append("radiosondesColumnSizes"); | ||||
| } | ||||
| 
 | ||||
| // Right click in table header - show column select menu
 | ||||
| @ -682,6 +701,7 @@ void RadiosondeGUI::radiosondes_customContextMenuRequested(QPoint pos) | ||||
| void RadiosondeGUI::on_y1_currentIndexChanged(int index) | ||||
| { | ||||
|     m_settings.m_y1 = (RadiosondeSettings::ChartData)index; | ||||
|     m_settingsKeys.append("y1"); | ||||
|     applySettings(); | ||||
|     plotChart(); | ||||
| } | ||||
| @ -689,6 +709,7 @@ void RadiosondeGUI::on_y1_currentIndexChanged(int index) | ||||
| void RadiosondeGUI::on_y2_currentIndexChanged(int index) | ||||
| { | ||||
|     m_settings.m_y2 = (RadiosondeSettings::ChartData)index; | ||||
|     m_settingsKeys.append("y2"); | ||||
|     applySettings(); | ||||
|     plotChart(); | ||||
| } | ||||
|  | ||||
| @ -86,6 +86,7 @@ private: | ||||
|     PluginAPI* m_pluginAPI; | ||||
|     FeatureUISet* m_featureUISet; | ||||
|     RadiosondeSettings m_settings; | ||||
|     QList<QString> m_settingsKeys; | ||||
|     RollupState m_rollupState; | ||||
|     bool m_doApplySettings; | ||||
| 
 | ||||
|  | ||||
| @ -151,3 +151,107 @@ bool RadiosondeSettings::deserialize(const QByteArray& data) | ||||
|         return false; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| void RadiosondeSettings::applySettings(const QStringList& settingsKeys, const RadiosondeSettings& settings) | ||||
| { | ||||
|     if (settingsKeys.contains("title")) { | ||||
|         m_title = settings.m_title; | ||||
|     } | ||||
|     if (settingsKeys.contains("rgbColor")) { | ||||
|         m_rgbColor = settings.m_rgbColor; | ||||
|     } | ||||
|     if (settingsKeys.contains("useReverseAPI")) { | ||||
|         m_useReverseAPI = settings.m_useReverseAPI; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIAddress")) { | ||||
|         m_reverseAPIAddress = settings.m_reverseAPIAddress; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIPort")) { | ||||
|         m_reverseAPIPort = settings.m_reverseAPIPort; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIFeatureSetIndex")) { | ||||
|         m_reverseAPIFeatureSetIndex = settings.m_reverseAPIFeatureSetIndex; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIFeatureIndex")) { | ||||
|         m_reverseAPIFeatureIndex = settings.m_reverseAPIFeatureIndex; | ||||
|     } | ||||
|     if (settingsKeys.contains("y1")) { | ||||
|         m_y1 = settings.m_y1; | ||||
|     } | ||||
|     if (settingsKeys.contains("y2")) { | ||||
|         m_y2 = settings.m_y2; | ||||
|     } | ||||
|     if (settingsKeys.contains("workspaceIndex")) { | ||||
|         m_workspaceIndex = settings.m_workspaceIndex; | ||||
|     } | ||||
| 
 | ||||
|     if (settingsKeys.contains("radiosondesColumnIndexes")) | ||||
|     { | ||||
|         for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|             m_radiosondesColumnIndexes[i] = settings.m_radiosondesColumnIndexes[i]; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (settingsKeys.contains("radiosondesColumnSizes")) | ||||
|     { | ||||
|         for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|             m_radiosondesColumnSizes[i] = settings.m_radiosondesColumnSizes[i]; | ||||
|         } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| QString RadiosondeSettings::getDebugString(const QStringList& settingsKeys, bool force) const | ||||
| { | ||||
|     std::ostringstream ostr; | ||||
| 
 | ||||
|     if (settingsKeys.contains("title") || force) { | ||||
|         ostr << " m_title: " << m_title.toStdString(); | ||||
|     } | ||||
|     if (settingsKeys.contains("rgbColor") || force) { | ||||
|         ostr << " m_rgbColor: " << m_rgbColor; | ||||
|     } | ||||
|     if (settingsKeys.contains("useReverseAPI") || force) { | ||||
|         ostr << " m_useReverseAPI: " << m_useReverseAPI; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIAddress") || force) { | ||||
|         ostr << " m_reverseAPIAddress: " << m_reverseAPIAddress.toStdString(); | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIPort") || force) { | ||||
|         ostr << " m_reverseAPIPort: " << m_reverseAPIPort; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIFeatureSetIndex") || force) { | ||||
|         ostr << " m_reverseAPIFeatureSetIndex: " << m_reverseAPIFeatureSetIndex; | ||||
|     } | ||||
|     if (settingsKeys.contains("reverseAPIFeatureIndex") || force) { | ||||
|         ostr << " m_reverseAPIFeatureIndex: " << m_reverseAPIFeatureIndex; | ||||
|     } | ||||
|     if (settingsKeys.contains("y1") || force) { | ||||
|         ostr << " m_y1: " << m_y1; | ||||
|     } | ||||
|     if (settingsKeys.contains("y2") || force) { | ||||
|         ostr << " m_y2: " << m_y2; | ||||
|     } | ||||
|     if (settingsKeys.contains("workspaceIndex") || force) { | ||||
|         ostr << " m_workspaceIndex: " << m_workspaceIndex; | ||||
|     } | ||||
| 
 | ||||
|     if (settingsKeys.contains("radiosondesColumnIndexes")) | ||||
|     { | ||||
|         ostr << "m_radiosondesColumnIndexes:"; | ||||
| 
 | ||||
|         for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|             ostr << " " << m_radiosondesColumnIndexes[i]; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (settingsKeys.contains("radiosondesColumnSizes")) | ||||
|     { | ||||
|         ostr << "m_radiosondesColumnSizes:"; | ||||
| 
 | ||||
|         for (int i = 0; i < RADIOSONDES_COLUMNS; i++) { | ||||
|             ostr << " " << m_radiosondesColumnSizes[i]; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     return QString(ostr.str().c_str()); | ||||
| } | ||||
|  | ||||
| @ -64,6 +64,8 @@ struct RadiosondeSettings | ||||
|     QByteArray serialize() const; | ||||
|     bool deserialize(const QByteArray& data); | ||||
|     void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; } | ||||
|     void applySettings(const QStringList& settingsKeys, const RadiosondeSettings& settings); | ||||
|     QString getDebugString(const QStringList& settingsKeys, bool force=false) const; | ||||
| 
 | ||||
|     static const QStringList m_pipeTypes; | ||||
|     static const QStringList m_pipeURIs; | ||||
|  | ||||
| @ -11079,6 +11079,18 @@ margin-bottom: 20px; | ||||
|     }, | ||||
|     "rollupState" : { | ||||
|       "$ref" : "#/definitions/RollupState" | ||||
|     }, | ||||
|     "radiosondesColumnIndexes" : { | ||||
|       "type" : "array", | ||||
|       "items" : { | ||||
|         "type" : "integer" | ||||
|       } | ||||
|     }, | ||||
|     "radiosondesColumnSizes" : { | ||||
|       "type" : "array", | ||||
|       "items" : { | ||||
|         "type" : "integer" | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   "description" : "Radiosonde settings" | ||||
| @ -56713,7 +56725,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2022-11-20T22:35:51.424+01:00 | ||||
|               Generated 2022-11-27T10:57:52.904+01:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -18,3 +18,11 @@ RadiosondeSettings: | ||||
|       type: integer | ||||
|     rollupState: | ||||
|       $ref: "/doc/swagger/include/RollupState.yaml#/RollupState" | ||||
|     radiosondesColumnIndexes: | ||||
|       type: array | ||||
|       items: | ||||
|         type: integer | ||||
|     radiosondesColumnSizes: | ||||
|       type: array | ||||
|       items: | ||||
|         type: integer | ||||
|  | ||||
| @ -18,3 +18,11 @@ RadiosondeSettings: | ||||
|       type: integer | ||||
|     rollupState: | ||||
|       $ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState" | ||||
|     radiosondesColumnIndexes: | ||||
|       type: array | ||||
|       items: | ||||
|         type: integer | ||||
|     radiosondesColumnSizes: | ||||
|       type: array | ||||
|       items: | ||||
|         type: integer | ||||
|  | ||||
| @ -11079,6 +11079,18 @@ margin-bottom: 20px; | ||||
|     }, | ||||
|     "rollupState" : { | ||||
|       "$ref" : "#/definitions/RollupState" | ||||
|     }, | ||||
|     "radiosondesColumnIndexes" : { | ||||
|       "type" : "array", | ||||
|       "items" : { | ||||
|         "type" : "integer" | ||||
|       } | ||||
|     }, | ||||
|     "radiosondesColumnSizes" : { | ||||
|       "type" : "array", | ||||
|       "items" : { | ||||
|         "type" : "integer" | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   "description" : "Radiosonde settings" | ||||
| @ -56713,7 +56725,7 @@ except ApiException as e: | ||||
|           </div> | ||||
|           <div id="generator"> | ||||
|             <div class="content"> | ||||
|               Generated 2022-11-20T22:35:51.424+01:00 | ||||
|               Generated 2022-11-27T10:57:52.904+01:00 | ||||
|             </div> | ||||
|           </div> | ||||
|       </div> | ||||
|  | ||||
| @ -44,6 +44,10 @@ SWGRadiosondeSettings::SWGRadiosondeSettings() { | ||||
|     m_reverse_api_feature_index_isSet = false; | ||||
|     rollup_state = nullptr; | ||||
|     m_rollup_state_isSet = false; | ||||
|     radiosondes_column_indexes = new QList<qint32>(); | ||||
|     m_radiosondes_column_indexes_isSet = false; | ||||
|     radiosondes_column_sizes = new QList<qint32>(); | ||||
|     m_radiosondes_column_sizes_isSet = false; | ||||
| } | ||||
| 
 | ||||
| SWGRadiosondeSettings::~SWGRadiosondeSettings() { | ||||
| @ -68,6 +72,10 @@ SWGRadiosondeSettings::init() { | ||||
|     m_reverse_api_feature_index_isSet = false; | ||||
|     rollup_state = new SWGRollupState(); | ||||
|     m_rollup_state_isSet = false; | ||||
|     radiosondes_column_indexes = new QList<qint32>(); | ||||
|     m_radiosondes_column_indexes_isSet = false; | ||||
|     radiosondes_column_sizes = new QList<qint32>(); | ||||
|     m_radiosondes_column_sizes_isSet = false; | ||||
| } | ||||
| 
 | ||||
| void | ||||
| @ -86,6 +94,8 @@ SWGRadiosondeSettings::cleanup() { | ||||
|     if(rollup_state != nullptr) {  | ||||
|         delete rollup_state; | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| SWGRadiosondeSettings* | ||||
| @ -115,6 +125,10 @@ SWGRadiosondeSettings::fromJsonObject(QJsonObject &pJson) { | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState"); | ||||
|      | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&radiosondes_column_indexes, pJson["radiosondesColumnIndexes"], "QList", "qint32"); | ||||
|      | ||||
|     ::SWGSDRangel::setValue(&radiosondes_column_sizes, pJson["radiosondesColumnSizes"], "QList", "qint32"); | ||||
| } | ||||
| 
 | ||||
| QString | ||||
| @ -155,6 +169,12 @@ SWGRadiosondeSettings::asJsonObject() { | ||||
|     if((rollup_state != nullptr) && (rollup_state->isSet())){ | ||||
|         toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState")); | ||||
|     } | ||||
|     if(radiosondes_column_indexes && radiosondes_column_indexes->size() > 0){ | ||||
|         toJsonArray((QList<void*>*)radiosondes_column_indexes, obj, "radiosondesColumnIndexes", ""); | ||||
|     } | ||||
|     if(radiosondes_column_sizes && radiosondes_column_sizes->size() > 0){ | ||||
|         toJsonArray((QList<void*>*)radiosondes_column_sizes, obj, "radiosondesColumnSizes", ""); | ||||
|     } | ||||
| 
 | ||||
|     return obj; | ||||
| } | ||||
| @ -239,6 +259,26 @@ SWGRadiosondeSettings::setRollupState(SWGRollupState* rollup_state) { | ||||
|     this->m_rollup_state_isSet = true; | ||||
| } | ||||
| 
 | ||||
| QList<qint32>* | ||||
| SWGRadiosondeSettings::getRadiosondesColumnIndexes() { | ||||
|     return radiosondes_column_indexes; | ||||
| } | ||||
| void | ||||
| SWGRadiosondeSettings::setRadiosondesColumnIndexes(QList<qint32>* radiosondes_column_indexes) { | ||||
|     this->radiosondes_column_indexes = radiosondes_column_indexes; | ||||
|     this->m_radiosondes_column_indexes_isSet = true; | ||||
| } | ||||
| 
 | ||||
| QList<qint32>* | ||||
| SWGRadiosondeSettings::getRadiosondesColumnSizes() { | ||||
|     return radiosondes_column_sizes; | ||||
| } | ||||
| void | ||||
| SWGRadiosondeSettings::setRadiosondesColumnSizes(QList<qint32>* radiosondes_column_sizes) { | ||||
|     this->radiosondes_column_sizes = radiosondes_column_sizes; | ||||
|     this->m_radiosondes_column_sizes_isSet = true; | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| bool | ||||
| SWGRadiosondeSettings::isSet(){ | ||||
| @ -268,6 +308,18 @@ SWGRadiosondeSettings::isSet(){ | ||||
|         if(rollup_state && rollup_state->isSet()){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|         if(m_radiosondes_column_indexes_isSet){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|         if(radiosondes_column_indexes && (radiosondes_column_indexes->size() > 0)){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|         if(m_radiosondes_column_sizes_isSet){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|         if(radiosondes_column_sizes && (radiosondes_column_sizes->size() > 0)){ | ||||
|             isObjectUpdated = true; break; | ||||
|         } | ||||
|     }while(false); | ||||
|     return isObjectUpdated; | ||||
| } | ||||
|  | ||||
| @ -23,6 +23,7 @@ | ||||
| 
 | ||||
| 
 | ||||
| #include "SWGRollupState.h" | ||||
| #include <QList> | ||||
| #include <QString> | ||||
| 
 | ||||
| #include "SWGObject.h" | ||||
| @ -67,6 +68,12 @@ public: | ||||
|     SWGRollupState* getRollupState(); | ||||
|     void setRollupState(SWGRollupState* rollup_state); | ||||
| 
 | ||||
|     QList<qint32>* getRadiosondesColumnIndexes(); | ||||
|     void setRadiosondesColumnIndexes(QList<qint32>* radiosondes_column_indexes); | ||||
| 
 | ||||
|     QList<qint32>* getRadiosondesColumnSizes(); | ||||
|     void setRadiosondesColumnSizes(QList<qint32>* radiosondes_column_sizes); | ||||
| 
 | ||||
| 
 | ||||
|     virtual bool isSet() override; | ||||
| 
 | ||||
| @ -95,6 +102,12 @@ private: | ||||
|     SWGRollupState* rollup_state; | ||||
|     bool m_rollup_state_isSet; | ||||
| 
 | ||||
|     QList<qint32>* radiosondes_column_indexes; | ||||
|     bool m_radiosondes_column_indexes_isSet; | ||||
| 
 | ||||
|     QList<qint32>* radiosondes_column_sizes; | ||||
|     bool m_radiosondes_column_sizes_isSet; | ||||
| 
 | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user