mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-01 12:37:11 -05:00
AIS feature: Make settings assignments atomic. Part of #1329
This commit is contained in:
parent
f3c5cd0ab5
commit
1972b74099
@ -242,8 +242,6 @@ void AFC::applySettings(const AFCSettings& settings, const QList<QString>& setti
|
|||||||
{
|
{
|
||||||
qDebug() << "AFC::applySettings:" << settings.getDebugString(settingsKeys, force) << " force: " << force;
|
qDebug() << "AFC::applySettings:" << settings.getDebugString(settingsKeys, force) << " force: " << force;
|
||||||
|
|
||||||
QList<QString> reverseAPIKeys;
|
|
||||||
|
|
||||||
if (settingsKeys.contains("trackerDeviceSetIndex") || force)
|
if (settingsKeys.contains("trackerDeviceSetIndex") || force)
|
||||||
{
|
{
|
||||||
removeTrackerFeatureReference();
|
removeTrackerFeatureReference();
|
||||||
@ -272,7 +270,7 @@ void AFC::applySettings(const AFCSettings& settings, const QList<QString>& setti
|
|||||||
settingsKeys.contains("reverseAPIPort") ||
|
settingsKeys.contains("reverseAPIPort") ||
|
||||||
settingsKeys.contains("reverseAPIFeatureSetIndex") ||
|
settingsKeys.contains("reverseAPIFeatureSetIndex") ||
|
||||||
settingsKeys.contains("m_reverseAPIFeatureIndex");
|
settingsKeys.contains("m_reverseAPIFeatureIndex");
|
||||||
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
|
webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force) {
|
if (force) {
|
||||||
|
@ -435,6 +435,8 @@ void AFCGUI::applySettings(bool force)
|
|||||||
AFC::MsgConfigureAFC* message = AFC::MsgConfigureAFC::create( m_settings, m_settingsKeys, force);
|
AFC::MsgConfigureAFC* message = AFC::MsgConfigureAFC::create( m_settings, m_settingsKeys, force);
|
||||||
m_afc->getInputMessageQueue()->push(message);
|
m_afc->getInputMessageQueue()->push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_settingsKeys.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AFCGUI::makeUIConnections()
|
void AFCGUI::makeUIConnections()
|
||||||
|
@ -98,7 +98,7 @@ bool AIS::handleMessage(const Message& cmd)
|
|||||||
{
|
{
|
||||||
MsgConfigureAIS& cfg = (MsgConfigureAIS&) cmd;
|
MsgConfigureAIS& cfg = (MsgConfigureAIS&) cmd;
|
||||||
qDebug() << "AIS::handleMessage: MsgConfigureAIS";
|
qDebug() << "AIS::handleMessage: MsgConfigureAIS";
|
||||||
applySettings(cfg.getSettings(), cfg.getForce());
|
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -127,51 +127,38 @@ bool AIS::deserialize(const QByteArray& data)
|
|||||||
{
|
{
|
||||||
if (m_settings.deserialize(data))
|
if (m_settings.deserialize(data))
|
||||||
{
|
{
|
||||||
MsgConfigureAIS *msg = MsgConfigureAIS::create(m_settings, true);
|
MsgConfigureAIS *msg = MsgConfigureAIS::create(m_settings, QList<QString>(), true);
|
||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_settings.resetToDefaults();
|
m_settings.resetToDefaults();
|
||||||
MsgConfigureAIS *msg = MsgConfigureAIS::create(m_settings, true);
|
MsgConfigureAIS *msg = MsgConfigureAIS::create(m_settings, QList<QString>(), true);
|
||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS::applySettings(const AISSettings& settings, bool force)
|
void AIS::applySettings(const AISSettings& settings, const QList<QString>& settingsKeys, bool force)
|
||||||
{
|
{
|
||||||
qDebug() << "AIS::applySettings:"
|
qDebug() << "AIS::applySettings:" << settings.getDebugString(settingsKeys, force) << force;
|
||||||
<< " 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;
|
|
||||||
|
|
||||||
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 (settings.m_useReverseAPI)
|
||||||
{
|
{
|
||||||
bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) ||
|
bool fullUpdate = (settingsKeys.contains("useReverseAPI") && settings.m_useReverseAPI) ||
|
||||||
(m_settings.m_reverseAPIAddress != settings.m_reverseAPIAddress) ||
|
settingsKeys.contains("reverseAPIAddress") ||
|
||||||
(m_settings.m_reverseAPIPort != settings.m_reverseAPIPort) ||
|
settingsKeys.contains("reverseAPIPort") ||
|
||||||
(m_settings.m_reverseAPIFeatureSetIndex != settings.m_reverseAPIFeatureSetIndex) ||
|
settingsKeys.contains("reverseAPIFeatureSetIndex") ||
|
||||||
(m_settings.m_reverseAPIFeatureIndex != settings.m_reverseAPIFeatureIndex);
|
settingsKeys.contains("m_reverseAPIFeatureIndex");
|
||||||
webapiReverseSendSettings(reverseAPIKeys, settings, fullUpdate || force);
|
webapiReverseSendSettings(settingsKeys, settings, fullUpdate || force);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (force) {
|
||||||
m_settings = settings;
|
m_settings = settings;
|
||||||
|
} else {
|
||||||
|
m_settings.applySettings(settingsKeys, settings);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int AIS::webapiSettingsGet(
|
int AIS::webapiSettingsGet(
|
||||||
@ -195,12 +182,12 @@ int AIS::webapiSettingsPutPatch(
|
|||||||
AISSettings settings = m_settings;
|
AISSettings settings = m_settings;
|
||||||
webapiUpdateFeatureSettings(settings, featureSettingsKeys, response);
|
webapiUpdateFeatureSettings(settings, featureSettingsKeys, response);
|
||||||
|
|
||||||
MsgConfigureAIS *msg = MsgConfigureAIS::create(settings, force);
|
MsgConfigureAIS *msg = MsgConfigureAIS::create(settings, featureSettingsKeys, force);
|
||||||
m_inputMessageQueue.push(msg);
|
m_inputMessageQueue.push(msg);
|
||||||
|
|
||||||
if (m_guiMessageQueue) // forward to GUI if any
|
if (m_guiMessageQueue) // forward to GUI if any
|
||||||
{
|
{
|
||||||
MsgConfigureAIS *msgToGUI = MsgConfigureAIS::create(settings, force);
|
MsgConfigureAIS *msgToGUI = MsgConfigureAIS::create(settings, featureSettingsKeys, force);
|
||||||
m_guiMessageQueue->push(msgToGUI);
|
m_guiMessageQueue->push(msgToGUI);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,6 +232,26 @@ void AIS::webapiFormatFeatureSettings(
|
|||||||
response.getAisSettings()->setRollupState(swgRollupState);
|
response.getAisSettings()->setRollupState(swgRollupState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!response.getAisSettings()->getVesselColumnIndexes()) {
|
||||||
|
response.getAisSettings()->setVesselColumnIndexes(new QList<int>());
|
||||||
|
}
|
||||||
|
|
||||||
|
response.getAisSettings()->getVesselColumnIndexes()->clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
response.getAisSettings()->getVesselColumnIndexes()->push_back(settings.m_vesselColumnIndexes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!response.getAisSettings()->getVesselColumnSizes()) {
|
||||||
|
response.getAisSettings()->setVesselColumnSizes(new QList<int>());
|
||||||
|
}
|
||||||
|
|
||||||
|
response.getAisSettings()->getVesselColumnSizes()->clear();
|
||||||
|
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
response.getAisSettings()->getVesselColumnSizes()->push_back(settings.m_vesselColumnSizes[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS::webapiUpdateFeatureSettings(
|
void AIS::webapiUpdateFeatureSettings(
|
||||||
@ -276,9 +283,27 @@ void AIS::webapiUpdateFeatureSettings(
|
|||||||
if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) {
|
if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) {
|
||||||
settings.m_rollupState->updateFrom(featureSettingsKeys, response.getAisSettings()->getRollupState());
|
settings.m_rollupState->updateFrom(featureSettingsKeys, response.getAisSettings()->getRollupState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (featureSettingsKeys.contains("vesselColumnIndexes"))
|
||||||
|
{
|
||||||
|
const QList<int> *indexes = response.getAisSettings()->getVesselColumnIndexes();
|
||||||
|
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
settings.m_vesselColumnIndexes[i] = (*indexes)[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS::webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const AISSettings& settings, bool force)
|
if (featureSettingsKeys.contains("vesselColumnSizes"))
|
||||||
|
{
|
||||||
|
const QList<int> *indexes = response.getAisSettings()->getVesselColumnSizes();
|
||||||
|
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
settings.m_vesselColumnSizes[i] = (*indexes)[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AIS::webapiReverseSendSettings(const QList<QString>& featureSettingsKeys, const AISSettings& settings, bool force)
|
||||||
{
|
{
|
||||||
SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings();
|
SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings();
|
||||||
// swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet());
|
// swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet());
|
||||||
|
@ -44,19 +44,22 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const AISSettings& getSettings() const { return m_settings; }
|
const AISSettings& getSettings() const { return m_settings; }
|
||||||
|
const QList<QString>& getSettingsKeys() const { return m_settingsKeys; }
|
||||||
bool getForce() const { return m_force; }
|
bool getForce() const { return m_force; }
|
||||||
|
|
||||||
static MsgConfigureAIS* create(const AISSettings& settings, bool force) {
|
static MsgConfigureAIS* create(const AISSettings& settings, const QList<QString>& settingsKeys, bool force) {
|
||||||
return new MsgConfigureAIS(settings, force);
|
return new MsgConfigureAIS(settings, settingsKeys, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AISSettings m_settings;
|
AISSettings m_settings;
|
||||||
|
QList<QString> m_settingsKeys;
|
||||||
bool m_force;
|
bool m_force;
|
||||||
|
|
||||||
MsgConfigureAIS(const AISSettings& settings, bool force) :
|
MsgConfigureAIS(const AISSettings& settings, const QList<QString>& settingsKeys, bool force) :
|
||||||
Message(),
|
Message(),
|
||||||
m_settings(settings),
|
m_settings(settings),
|
||||||
|
m_settingsKeys(settingsKeys),
|
||||||
m_force(force)
|
m_force(force)
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
@ -104,8 +107,8 @@ private:
|
|||||||
|
|
||||||
void start();
|
void start();
|
||||||
void stop();
|
void stop();
|
||||||
void applySettings(const AISSettings& settings, bool force = false);
|
void applySettings(const AISSettings& settings, const QList<QString>& settingsKeys, bool force = false);
|
||||||
void webapiReverseSendSettings(QList<QString>& featureSettingsKeys, const AISSettings& settings, bool force);
|
void webapiReverseSendSettings(const QList<QString>& featureSettingsKeys, const AISSettings& settings, bool force);
|
||||||
void scanAvailableChannels();
|
void scanAvailableChannels();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
@ -130,7 +130,13 @@ bool AISGUI::handleMessage(const Message& message)
|
|||||||
{
|
{
|
||||||
qDebug("AISGUI::handleMessage: AIS::MsgConfigureAIS");
|
qDebug("AISGUI::handleMessage: AIS::MsgConfigureAIS");
|
||||||
const AIS::MsgConfigureAIS& cfg = (AIS::MsgConfigureAIS&) message;
|
const AIS::MsgConfigureAIS& cfg = (AIS::MsgConfigureAIS&) message;
|
||||||
|
|
||||||
|
if (cfg.getForce()) {
|
||||||
m_settings = cfg.getSettings();
|
m_settings = cfg.getSettings();
|
||||||
|
} else {
|
||||||
|
m_settings.applySettings(cfg.getSettingsKeys(), cfg.getSettings());
|
||||||
|
}
|
||||||
|
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
displaySettings();
|
displaySettings();
|
||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
@ -258,9 +264,11 @@ void AISGUI::displaySettings()
|
|||||||
bool hidden = m_settings.m_vesselColumnSizes[i] == 0;
|
bool hidden = m_settings.m_vesselColumnSizes[i] == 0;
|
||||||
header->setSectionHidden(i, hidden);
|
header->setSectionHidden(i, hidden);
|
||||||
vesselsMenu->actions().at(i)->setChecked(!hidden);
|
vesselsMenu->actions().at(i)->setChecked(!hidden);
|
||||||
|
|
||||||
if (m_settings.m_vesselColumnSizes[i] > 0) {
|
if (m_settings.m_vesselColumnSizes[i] > 0) {
|
||||||
ui->vessels->setColumnWidth(i, m_settings.m_vesselColumnSizes[i]);
|
ui->vessels->setColumnWidth(i, m_settings.m_vesselColumnSizes[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
header->moveSection(header->visualIndex(i), m_settings.m_vesselColumnIndexes[i]);
|
header->moveSection(header->visualIndex(i), m_settings.m_vesselColumnIndexes[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,6 +303,12 @@ void AISGUI::onMenuDialogCalled(const QPoint &p)
|
|||||||
setTitle(m_settings.m_title);
|
setTitle(m_settings.m_title);
|
||||||
setTitleColor(m_settings.m_rgbColor);
|
setTitleColor(m_settings.m_rgbColor);
|
||||||
|
|
||||||
|
m_settingsKeys.append("useReverseAPI");
|
||||||
|
m_settingsKeys.append("reverseAPIAddress");
|
||||||
|
m_settingsKeys.append("reverseAPIPort");
|
||||||
|
m_settingsKeys.append("reverseAPIFeatureSetIndex");
|
||||||
|
m_settingsKeys.append("reverseAPIFeatureIndex");
|
||||||
|
|
||||||
applySettings();
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -333,9 +347,11 @@ void AISGUI::applySettings(bool force)
|
|||||||
{
|
{
|
||||||
if (m_doApplySettings)
|
if (m_doApplySettings)
|
||||||
{
|
{
|
||||||
AIS::MsgConfigureAIS* message = AIS::MsgConfigureAIS::create(m_settings, force);
|
AIS::MsgConfigureAIS* message = AIS::MsgConfigureAIS::create(m_settings, m_settingsKeys, force);
|
||||||
m_ais->getInputMessageQueue()->push(message);
|
m_ais->getInputMessageQueue()->push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_settingsKeys.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AISGUI::resizeTable()
|
void AISGUI::resizeTable()
|
||||||
@ -370,6 +386,8 @@ void AISGUI::vessels_sectionMoved(int logicalIndex, int oldVisualIndex, int newV
|
|||||||
(void) oldVisualIndex;
|
(void) oldVisualIndex;
|
||||||
|
|
||||||
m_settings.m_vesselColumnIndexes[logicalIndex] = newVisualIndex;
|
m_settings.m_vesselColumnIndexes[logicalIndex] = newVisualIndex;
|
||||||
|
m_settingsKeys.append("vesselColumnIndexes");
|
||||||
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Column in table resized (when hidden size is 0)
|
// Column in table resized (when hidden size is 0)
|
||||||
@ -378,6 +396,8 @@ void AISGUI::vessels_sectionResized(int logicalIndex, int oldSize, int newSize)
|
|||||||
(void) oldSize;
|
(void) oldSize;
|
||||||
|
|
||||||
m_settings.m_vesselColumnSizes[logicalIndex] = newSize;
|
m_settings.m_vesselColumnSizes[logicalIndex] = newSize;
|
||||||
|
m_settingsKeys.append("vesselColumnSizes");
|
||||||
|
applySettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right click in table header - show column select menu
|
// Right click in table header - show column select menu
|
||||||
|
@ -67,6 +67,7 @@ private:
|
|||||||
PluginAPI* m_pluginAPI;
|
PluginAPI* m_pluginAPI;
|
||||||
FeatureUISet* m_featureUISet;
|
FeatureUISet* m_featureUISet;
|
||||||
AISSettings m_settings;
|
AISSettings m_settings;
|
||||||
|
QList<QString> m_settingsKeys;
|
||||||
RollupState m_rollupState;
|
RollupState m_rollupState;
|
||||||
bool m_doApplySettings;
|
bool m_doApplySettings;
|
||||||
|
|
||||||
|
@ -145,3 +145,96 @@ bool AISSettings::deserialize(const QByteArray& data)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AISSettings::applySettings(const QStringList& settingsKeys, const AISSettings& 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("workspaceIndex")) {
|
||||||
|
m_workspaceIndex = settings.m_workspaceIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settingsKeys.contains("vesselColumnIndexes"))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
m_vesselColumnIndexes[i] = settings.m_vesselColumnIndexes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settingsKeys.contains("vesselColumnSizes"))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
m_vesselColumnSizes[i] = settings.m_vesselColumnSizes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AISSettings::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("workspaceIndex") || force) {
|
||||||
|
ostr << " m_workspaceIndex: " << m_workspaceIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settingsKeys.contains("vesselColumnIndexes"))
|
||||||
|
{
|
||||||
|
ostr << "m_vesselColumnIndexes:";
|
||||||
|
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
ostr << " " << m_vesselColumnIndexes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (settingsKeys.contains("vesselColumnSizes"))
|
||||||
|
{
|
||||||
|
ostr << "m_vesselColumnSizes:";
|
||||||
|
|
||||||
|
for (int i = 0; i < AIS_VESSEL_COLUMNS; i++) {
|
||||||
|
ostr << " " << m_vesselColumnSizes[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return QString(ostr.str().c_str());
|
||||||
|
}
|
||||||
|
@ -50,6 +50,8 @@ struct AISSettings
|
|||||||
QByteArray serialize() const;
|
QByteArray serialize() const;
|
||||||
bool deserialize(const QByteArray& data);
|
bool deserialize(const QByteArray& data);
|
||||||
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }
|
void setRollupState(Serializable *rollupState) { m_rollupState = rollupState; }
|
||||||
|
void applySettings(const QStringList& settingsKeys, const AISSettings& settings);
|
||||||
|
QString getDebugString(const QStringList& settingsKeys, bool force=false) const;
|
||||||
|
|
||||||
static const QStringList m_pipeTypes;
|
static const QStringList m_pipeTypes;
|
||||||
static const QStringList m_pipeURIs;
|
static const QStringList m_pipeURIs;
|
||||||
|
@ -1245,6 +1245,18 @@ margin-bottom: 20px;
|
|||||||
},
|
},
|
||||||
"rollupState" : {
|
"rollupState" : {
|
||||||
"$ref" : "#/definitions/RollupState"
|
"$ref" : "#/definitions/RollupState"
|
||||||
|
},
|
||||||
|
"vesselColumnIndexes" : {
|
||||||
|
"type" : "array",
|
||||||
|
"items" : {
|
||||||
|
"type" : "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vesselColumnSizes" : {
|
||||||
|
"type" : "array",
|
||||||
|
"items" : {
|
||||||
|
"type" : "integer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description" : "AIS settings"
|
"description" : "AIS settings"
|
||||||
@ -56629,7 +56641,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2022-11-13T19:59:19.161+01:00
|
Generated 2022-11-20T11:19:42.122+01:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,3 +18,11 @@ AISSettings:
|
|||||||
type: integer
|
type: integer
|
||||||
rollupState:
|
rollupState:
|
||||||
$ref: "/doc/swagger/include/RollupState.yaml#/RollupState"
|
$ref: "/doc/swagger/include/RollupState.yaml#/RollupState"
|
||||||
|
vesselColumnIndexes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: integer
|
||||||
|
vesselColumnSizes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: integer
|
||||||
|
@ -18,3 +18,11 @@ AISSettings:
|
|||||||
type: integer
|
type: integer
|
||||||
rollupState:
|
rollupState:
|
||||||
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
|
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
|
||||||
|
vesselColumnIndexes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: integer
|
||||||
|
vesselColumnSizes:
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: integer
|
||||||
|
@ -1245,6 +1245,18 @@ margin-bottom: 20px;
|
|||||||
},
|
},
|
||||||
"rollupState" : {
|
"rollupState" : {
|
||||||
"$ref" : "#/definitions/RollupState"
|
"$ref" : "#/definitions/RollupState"
|
||||||
|
},
|
||||||
|
"vesselColumnIndexes" : {
|
||||||
|
"type" : "array",
|
||||||
|
"items" : {
|
||||||
|
"type" : "integer"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"vesselColumnSizes" : {
|
||||||
|
"type" : "array",
|
||||||
|
"items" : {
|
||||||
|
"type" : "integer"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"description" : "AIS settings"
|
"description" : "AIS settings"
|
||||||
@ -56629,7 +56641,7 @@ except ApiException as e:
|
|||||||
</div>
|
</div>
|
||||||
<div id="generator">
|
<div id="generator">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
Generated 2022-11-13T19:59:19.161+01:00
|
Generated 2022-11-20T11:19:42.122+01:00
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -44,6 +44,10 @@ SWGAISSettings::SWGAISSettings() {
|
|||||||
m_reverse_api_feature_index_isSet = false;
|
m_reverse_api_feature_index_isSet = false;
|
||||||
rollup_state = nullptr;
|
rollup_state = nullptr;
|
||||||
m_rollup_state_isSet = false;
|
m_rollup_state_isSet = false;
|
||||||
|
vessel_column_indexes = new QList<qint32>();
|
||||||
|
m_vessel_column_indexes_isSet = false;
|
||||||
|
vessel_column_sizes = new QList<qint32>();
|
||||||
|
m_vessel_column_sizes_isSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGAISSettings::~SWGAISSettings() {
|
SWGAISSettings::~SWGAISSettings() {
|
||||||
@ -68,6 +72,10 @@ SWGAISSettings::init() {
|
|||||||
m_reverse_api_feature_index_isSet = false;
|
m_reverse_api_feature_index_isSet = false;
|
||||||
rollup_state = new SWGRollupState();
|
rollup_state = new SWGRollupState();
|
||||||
m_rollup_state_isSet = false;
|
m_rollup_state_isSet = false;
|
||||||
|
vessel_column_indexes = new QList<qint32>();
|
||||||
|
m_vessel_column_indexes_isSet = false;
|
||||||
|
vessel_column_sizes = new QList<qint32>();
|
||||||
|
m_vessel_column_sizes_isSet = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -86,6 +94,8 @@ SWGAISSettings::cleanup() {
|
|||||||
if(rollup_state != nullptr) {
|
if(rollup_state != nullptr) {
|
||||||
delete rollup_state;
|
delete rollup_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SWGAISSettings*
|
SWGAISSettings*
|
||||||
@ -115,6 +125,10 @@ SWGAISSettings::fromJsonObject(QJsonObject &pJson) {
|
|||||||
|
|
||||||
::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState");
|
::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState");
|
||||||
|
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&vessel_column_indexes, pJson["vesselColumnIndexes"], "QList", "qint32");
|
||||||
|
|
||||||
|
::SWGSDRangel::setValue(&vessel_column_sizes, pJson["vesselColumnSizes"], "QList", "qint32");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
@ -155,6 +169,12 @@ SWGAISSettings::asJsonObject() {
|
|||||||
if((rollup_state != nullptr) && (rollup_state->isSet())){
|
if((rollup_state != nullptr) && (rollup_state->isSet())){
|
||||||
toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState"));
|
toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState"));
|
||||||
}
|
}
|
||||||
|
if(vessel_column_indexes && vessel_column_indexes->size() > 0){
|
||||||
|
toJsonArray((QList<void*>*)vessel_column_indexes, obj, "vesselColumnIndexes", "");
|
||||||
|
}
|
||||||
|
if(vessel_column_sizes && vessel_column_sizes->size() > 0){
|
||||||
|
toJsonArray((QList<void*>*)vessel_column_sizes, obj, "vesselColumnSizes", "");
|
||||||
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
@ -239,6 +259,26 @@ SWGAISSettings::setRollupState(SWGRollupState* rollup_state) {
|
|||||||
this->m_rollup_state_isSet = true;
|
this->m_rollup_state_isSet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<qint32>*
|
||||||
|
SWGAISSettings::getVesselColumnIndexes() {
|
||||||
|
return vessel_column_indexes;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGAISSettings::setVesselColumnIndexes(QList<qint32>* vessel_column_indexes) {
|
||||||
|
this->vessel_column_indexes = vessel_column_indexes;
|
||||||
|
this->m_vessel_column_indexes_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
QList<qint32>*
|
||||||
|
SWGAISSettings::getVesselColumnSizes() {
|
||||||
|
return vessel_column_sizes;
|
||||||
|
}
|
||||||
|
void
|
||||||
|
SWGAISSettings::setVesselColumnSizes(QList<qint32>* vessel_column_sizes) {
|
||||||
|
this->vessel_column_sizes = vessel_column_sizes;
|
||||||
|
this->m_vessel_column_sizes_isSet = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
SWGAISSettings::isSet(){
|
SWGAISSettings::isSet(){
|
||||||
@ -268,6 +308,18 @@ SWGAISSettings::isSet(){
|
|||||||
if(rollup_state && rollup_state->isSet()){
|
if(rollup_state && rollup_state->isSet()){
|
||||||
isObjectUpdated = true; break;
|
isObjectUpdated = true; break;
|
||||||
}
|
}
|
||||||
|
if(m_vessel_column_indexes_isSet){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
|
if(vessel_column_indexes && (vessel_column_indexes->size() > 0)){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
|
if(m_vessel_column_sizes_isSet){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
|
if(vessel_column_sizes && (vessel_column_sizes->size() > 0)){
|
||||||
|
isObjectUpdated = true; break;
|
||||||
|
}
|
||||||
}while(false);
|
}while(false);
|
||||||
return isObjectUpdated;
|
return isObjectUpdated;
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "SWGRollupState.h"
|
#include "SWGRollupState.h"
|
||||||
|
#include <QList>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
#include "SWGObject.h"
|
#include "SWGObject.h"
|
||||||
@ -67,6 +68,12 @@ public:
|
|||||||
SWGRollupState* getRollupState();
|
SWGRollupState* getRollupState();
|
||||||
void setRollupState(SWGRollupState* rollup_state);
|
void setRollupState(SWGRollupState* rollup_state);
|
||||||
|
|
||||||
|
QList<qint32>* getVesselColumnIndexes();
|
||||||
|
void setVesselColumnIndexes(QList<qint32>* vessel_column_indexes);
|
||||||
|
|
||||||
|
QList<qint32>* getVesselColumnSizes();
|
||||||
|
void setVesselColumnSizes(QList<qint32>* vessel_column_sizes);
|
||||||
|
|
||||||
|
|
||||||
virtual bool isSet() override;
|
virtual bool isSet() override;
|
||||||
|
|
||||||
@ -95,6 +102,12 @@ private:
|
|||||||
SWGRollupState* rollup_state;
|
SWGRollupState* rollup_state;
|
||||||
bool m_rollup_state_isSet;
|
bool m_rollup_state_isSet;
|
||||||
|
|
||||||
|
QList<qint32>* vessel_column_indexes;
|
||||||
|
bool m_vessel_column_indexes_isSet;
|
||||||
|
|
||||||
|
QList<qint32>* vessel_column_sizes;
|
||||||
|
bool m_vessel_column_sizes_isSet;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user