Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPS Info Message Test - Sample changes #1737

Draft
wants to merge 2 commits into
base: v.next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@

#include "IndoorsLocationDataSourceCreator.h"
#include "ShowDeviceLocationUsingIndoorPositioning.h"
#include "IndoorsLocationDataSource.h"
#include "IndoorsLocationDataSourceConfiguration.h"
#include "IpsInfoMessage.h"
#include "Map.h"
#include "MapQuickView.h"
#include "MapViewTypes.h"
Expand Down Expand Up @@ -89,6 +90,17 @@ void ShowDeviceLocationUsingIndoorPositioning::setupIndoorsLocationDataSource()
connect(indoorsLocationDataSourceCreator, &IndoorsLocationDataSourceCreator::createIndoorsLocationDataSourceCompleted, this, [this](IndoorsLocationDataSource* indoorsLDS)
{
connect(m_mapView->locationDisplay(), &LocationDisplay::locationChanged, this, &ShowDeviceLocationUsingIndoorPositioning::locationChangedHandler);
m_indoorsLocationDataSource.reset(indoorsLDS);
IndoorsLocationDataSourceConfiguration* conf = m_indoorsLocationDataSource->configuration();
conf->setInfoMessagesEnabled(true);
m_indoorsLocationDataSource->setConfiguration(conf);
connect(m_indoorsLocationDataSource.get(), &IndoorsLocationDataSource::messageReceived, this, [this](IpsInfoMessage* ipsInfoMsg)
{
qDebug() << "IPS info Message Received - "<< ipsInfoMsg->message();
m_ipsInfoMessage = ipsInfoMsg->message();
emit ipsInfoMessageChanged();
delete ipsInfoMsg;
});

m_mapView->locationDisplay()->setDataSource(indoorsLDS);
m_mapView->locationDisplay()->setAutoPanMode(LocationDisplayAutoPanMode::Navigation);
Expand Down Expand Up @@ -127,7 +139,12 @@ void ShowDeviceLocationUsingIndoorPositioning::changeFloorDisplay()
}
}

QVariantMap ShowDeviceLocationUsingIndoorPositioning::locationProperties() const
{
return m_locationProperties;
}
QVariantMap ShowDeviceLocationUsingIndoorPositioning::locationProperties() const
{
return m_locationProperties;
}

QString ShowDeviceLocationUsingIndoorPositioning::getIpsInfoMessage() const
{
return m_ipsInfoMessage;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class MapQuickView;
}

#include "Location.h"
#include "IndoorsLocationDataSource.h"

#include <QObject>
#include <QMap>
Expand All @@ -38,6 +39,7 @@ class ShowDeviceLocationUsingIndoorPositioning : public QObject

Q_PROPERTY(Esri::ArcGISRuntime::MapQuickView* mapView READ mapView WRITE setMapView NOTIFY mapViewChanged)
Q_PROPERTY(QVariantMap locationProperties READ locationProperties NOTIFY locationPropertiesChanged)
Q_PROPERTY(QString ipsInfoMessage READ getIpsInfoMessage NOTIFY ipsInfoMessageChanged)

public:
explicit ShowDeviceLocationUsingIndoorPositioning(QObject* parent = nullptr);
Expand All @@ -50,10 +52,12 @@ class ShowDeviceLocationUsingIndoorPositioning : public QObject
signals:
void mapViewChanged();
void locationPropertiesChanged();
void ipsInfoMessageChanged();

private:
Esri::ArcGISRuntime::MapQuickView* mapView() const;
QVariantMap locationProperties() const;
QString getIpsInfoMessage() const;

void setMapView(Esri::ArcGISRuntime::MapQuickView* mapView);
void setupIndoorsLocationDataSource();
Expand All @@ -64,8 +68,10 @@ class ShowDeviceLocationUsingIndoorPositioning : public QObject
Esri::ArcGISRuntime::MapQuickView* m_mapView = nullptr;
Esri::ArcGISRuntime::FeatureTable* m_positioningTable = nullptr;
Esri::ArcGISRuntime::ArcGISFeatureTable* m_pathwaysTable = nullptr;
std::unique_ptr<Esri::ArcGISRuntime::IndoorsLocationDataSource> m_indoorsLocationDataSource = nullptr;
QVariantMap m_locationProperties;
int m_currentFloor;
QString m_ipsInfoMessage = "No message!";
};

#endif // SHOWDEVICELOCATIONUSINGINDOORPOSITIONING_H
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ Item {
text: "Horizontal accuracy: " + (model.locationProperties.horizontalAccuracy ? model.locationProperties.horizontalAccuracy.toFixed(2) + " m" : "undefined")
visible: model.locationProperties.horizontalAccuracy !== undefined
}
Text {
text: "IPS Info Messages: " + model.ipsInfoMessage
visible: true
}
}
}

Expand Down