Skip to content

Commit

Permalink
Merge pull request #354 from Esri/v.next
Browse files Browse the repository at this point in the history
Upgrading to DSA 1.1.6.
  • Loading branch information
anmacdonald authored Feb 23, 2021
2 parents 390fc1d + 71745c2 commit cafde76
Show file tree
Hide file tree
Showing 87 changed files with 1,561 additions and 460 deletions.
7 changes: 0 additions & 7 deletions DSA.pro
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ TEMPLATE = subdirs

CONFIG += ordered

# check to see if the toolkit repo exists locally in any known locations
include($$PWD/Shared/build/resolvelocaltoolkit.pri)
message($$CppToolkitLocation)
!isEmpty(CppToolkitLocation) {
SUBDIRS += $$CppToolkitLocation/ArcGISRuntimeToolkit_StaticLib.pro
}

SUBDIRS += \
Handheld \
Vehicle
Expand Down
2 changes: 1 addition & 1 deletion Handheld/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<manifest package="com.esri.arcgisruntime.opensourceapps.DSA_Handheld_Qt" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.1.5" android:versionCode="6" android:installLocation="auto">
<manifest package="com.esri.arcgisruntime.opensourceapps.DSA_Handheld_Qt" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.1.6" android:versionCode="7" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
Expand Down
2 changes: 1 addition & 1 deletion Handheld/AppInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define kOrganizationDomain "esri.com"

#define kApplicationName "DSA_Handheld_Qt"
#define kApplicationVersion "1.1.5"
#define kApplicationVersion "1.1.6"
#define kApplicationDescription "Dynamic Situational Awareness - Handheld app"

#define kApplicationSourceUrl "qrc:/qml/main.qml"
Expand Down
1 change: 0 additions & 1 deletion Handheld/Handheld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "SceneQuickView.h"

using namespace Esri::ArcGISRuntime;
using namespace Esri::ArcGISRuntime::Toolkit;

namespace Dsa {
namespace Handheld {
Expand Down
4 changes: 2 additions & 2 deletions Handheld/Handheld.pro
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ TEMPLATE = app
QT += core gui opengl network positioning sensors qml quick xml
CONFIG += c++14

ARCGIS_RUNTIME_VERSION = 100.9
ARCGIS_RUNTIME_VERSION = 100.10
include($$PWD/../Shared/build/arcgisruntime.pri)
include($$PWD/../Shared/build/arcgisruntimecpptoolkit.pri)

INCLUDEPATH += $$PWD/../Shared/ \
$$PWD/../Shared/alerts \
Expand Down Expand Up @@ -92,3 +91,4 @@ DISTFILES += \
../qdoc/dsa-overview.qdoc



4 changes: 2 additions & 2 deletions Handheld/iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.5</string>
<string>1.1.6</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.5</string>
<string>1.1.6</string>
<key>NOTE</key>
<string>Built with ArcGIS Runtime SDK for Qt.</string>
<key>UIFileSharingEnabled</key>
Expand Down
15 changes: 5 additions & 10 deletions Handheld/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
#include "ViewedAlertsController.h"
#include "ViewshedController.h"
#include "PackageImageProvider.h"
#include "CoordinateConversionToolProxy.h"

// toolkit headers
#include "ArcGISCompassController.h"
#include "ArcGISRuntimeToolkit.h"
#include "Esri/ArcGISRuntime/Toolkit/register.h"

// C++ API headers
#include "ArcGISRuntimeEnvironment.h"
Expand Down Expand Up @@ -90,7 +90,6 @@
//------------------------------------------------------------------------------

using namespace Esri::ArcGISRuntime;
using namespace Esri::ArcGISRuntime::Toolkit;

QObject* dsaStylesProvider(QQmlEngine* engine, QJSEngine* scriptEngine);
QObject* dsaResourcesProvider(QQmlEngine* engine, QJSEngine* scriptEngine);
Expand Down Expand Up @@ -147,34 +146,30 @@ int main(int argc, char *argv[])
qmlRegisterType<Dsa::AnalysisListController>("Esri.ArcGISRuntime.OpenSourceApps.DSA", 1, 1, "AnalysisListController");
qmlRegisterType<Dsa::ObservationReportController>("Esri.ArcGISRuntime.OpenSourceApps.DSA", 1, 1, "ObservationReportController");
qmlRegisterType<Dsa::OpenMobileScenePackageController>("Esri.ArcGISRuntime.OpenSourceApps.DSA", 1, 1, "OpenMobileScenePackageController");

// Register Toolkit Component Types
ArcGISRuntimeToolkit::registerToolkitTypes();
qmlRegisterType<Dsa::CoordinateConversionToolProxy>("Esri.ArcGISRuntime.OpenSourceApps.DSA", 1, 1, "CoordinateConversionToolProxy");

// Initialize application view
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);

view.engine()->addImageProvider(QStringLiteral("packages"), new Dsa::PackageImageProvider());

Esri::ArcGISRuntime::Toolkit::registerComponents(*view.engine());

#ifndef DEPLOYMENT_BUILD
// Add the import Path
view.engine()->addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath("qml"));
QString arcGISRuntimeImportPath = QUOTE(ARCGIS_RUNTIME_IMPORT_PATH);
QString arcGISToolkitImportPath = QUOTE(ARCGIS_TOOLKIT_IMPORT_PATH);

#if defined(LINUX_PLATFORM_REPLACEMENT)
// on some linux platforms the string 'linux' is replaced with 1
// fix the replacement paths which were created
QString replaceString = QUOTE(LINUX_PLATFORM_REPLACEMENT);
arcGISRuntimeImportPath = arcGISRuntimeImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
arcGISToolkitImportPath = arcGISToolkitImportPath.replace(replaceString, "linux", Qt::CaseSensitive);
#endif

// Add the Runtime and Extras path
view.engine()->addImportPath(arcGISRuntimeImportPath);
// Add the Toolkit path
view.engine()->addImportPath(arcGISToolkitImportPath);
#endif // DEPLOYMENT_BUILD

// To quit via Qt.quit() from QML, you must connect the QQmlEngine::quit()
Expand Down
67 changes: 41 additions & 26 deletions Handheld/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import QtQml.Models 2.2
import QtGraphicalEffects 1.0
import Esri.ArcGISRuntime.OpenSourceApps.DSA 1.1
import Esri.ArcGISRuntime.OpenSourceApps.Handheld 1.1
import Esri.ArcGISRuntime.Toolkit.Controls 100.5
import Esri.ArcGISRuntime.Toolkit.Controls.CppApi 100.5
import Esri.ArcGISRuntime.Toolkit 100.10 as Toolkit

Handheld {
id: appRoot
Expand Down Expand Up @@ -170,38 +169,53 @@ Handheld {
radius: hudRadius
}

ArcGISCompass {
Toolkit.NorthArrow {
id: compass
geoView: sceneView
anchors {
right: parent.right
bottom: sceneView.attributionTop
bottomMargin: 10 * scaleFactor
rightMargin: parent.height < navTool.height * 1.6 ? 60 * scaleFactor : 15 * scaleFactor
}
autoHideCompass: false
autoHide: false
width: DsaStyles.primaryIconSize * scaleFactor
height: width
}

CoordinateConversion {
CoordinateConversionToolProxy {
id: dsaCoordinateController
inInputMode: coordinateConversion.inInputMode
}

Toolkit.CoordinateConversion {
id: coordinateConversion
anchors {
bottom: followHud.visible ? followHud.top : currentLocation.top
left: sceneView.left
right: navTool.left
margins: hudMargins
}

objectName: "coordinateConversion"
visible: false
geoView: sceneView
highlightColor : Material.accent
textColor: Material.foreground
backgroundColor: Material.background
fontSize: DsaStyles.toolFontPixelSize
fontFamily: DsaStyles.fontFamily
backgroundOpacity: hudOpacity
radius: hudRadius
controller: dsaCoordinateController.controller
inputFormat: dsaCoordinateController.inputFormat
visible: dsaCoordinateController.active

palette {
text: Material.foreground
highlight: Material.accent
}

font {
family: DsaStyles.fontFamily
pixelSize: DsaStyles.toolFontPixelSize
}

background: Rectangle {
color: Material.background
opacity: hudOpacity
radius: hudRadius
}

onVisibleChanged: {
if (!visible)
Expand Down Expand Up @@ -368,19 +382,21 @@ Handheld {
}
}

PopupStackView {
Toolkit.PopupStackView {
id: identifyResults
anchors {
left: sceneView.left
top: sceneView.top
right: sceneView.right
bottom: sceneView.attributionTop
}
backgroundColor: Material.primary
attributeNameTextColor: Material.foreground
attributeValueTextColor: Material.foreground
titleTextColor: Material.foreground
closeButtonColor: Material.foreground
palette {
text: Material.foreground
}
background: Rectangle {
color: Material.primary
}
visible: false
}

Drawer {
Expand Down Expand Up @@ -490,11 +506,10 @@ Handheld {
}

onPopupManagersChanged: {
identifyResults.dismiss();
identifyResults.popupManagers = popupManagers;

if (popupManagers.length > 0)
identifyResults.show();
if (popupManagers.length > 0) {
identifyResults.popupManagers = popupManagers;
identifyResults.visible = true;
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release notes

## 1.1.6

- Minumum Runtime Qt SDK version is 100.10.
- Minimum Qt SDK version is Qt 5.15.1.
- DSA now running on the new toolkit architecture.
- Fixed bug where Markups were no longer shared.

## 1.1.5

- An "InitialLocation" config is now written out to file. This parameter is updated whenver the scene is changed (e.g. loaded from an MSPK.) This property can be used to override the startup location of the camera when the app first loads.
Expand Down
135 changes: 135 additions & 0 deletions Shared/AbstractTool.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/*******************************************************************************
* Copyright 2012-2018 Esri
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
******************************************************************************/

#include "AbstractTool.h"

using namespace Esri::ArcGISRuntime;

namespace Dsa
{
/*!
\class Dsa::AbstractTool
\inmodule ArcGISQtToolkit
\brief Base class for classes that implement individual tools.
\since Esri::ArcGISRuntime 100.2
AbstractTool provides functions and properties that all derived tools share.
\note You cannot create an object of this class. Instead, create a tool
object from a derived class.
*/

/*!
\brief The constructor that accepts an optional \a parent object.
*/
AbstractTool::AbstractTool(QObject* parent /*= nullptr*/):
QObject(parent)
{

}

/*!
\brief The destructor.
*/
AbstractTool::~AbstractTool()
{

}

/*!
\brief Reimplement this method in subclasses to handle a click at
geographic coordinate \a pos.
Returns \c false.
*/
bool AbstractTool::handleClick(const Point& pos)
{
Q_UNUSED(pos)
return false;
}

/*!
\brief Reimplement this method in subclasses to set tool properties.
\list
\li \a properties - A QVariantMap containing property settings.
\endlist
A tool property is defined as a key-value pair where the key is a QString
and the value is a QVariant. Properties are useful for general settings
which you wish to persist for the tool, such as default modes.
*/
void AbstractTool::setProperties(const QVariantMap&)
{

}

/*!
\brief Sets whether this tool is active to \a active.
\sa activeChanged
*/
void AbstractTool::setActive(bool active)
{
if (m_active == active)
return;

m_active = active;

emit activeChanged();
}

/*!
\brief Returns whether this tool is active (\c true) or not (\c false).
*/
bool AbstractTool::isActive() const
{
return m_active;
}

// Signals
/*!
\fn void Dsa::AbstractTool::errorOccurred(const Error& error)
\brief Signal emitted when this tool encounters an error.
\list
\li \a error - Details about the error that occurred.
\endlist
*/

/*!
\fn void Dsa::AbstractTool::activeChanged()
\brief Signal emitted when the active property of this tool changes.
*/

/*!
\fn void Dsa::AbstractTool::propertyChanged(const QString& propertyName, const QVariant& propertyValue)
\brief Signal emitted when a property of this tool changes.
\list
\li \a propertyName - The changed property's name.
\li \a propertyValue - The changed property's new value.
\endlist
*/

// Properties

/*!
\fn QString AbstractTool::toolName() const
\brief Returns the name of this tool.
*/

} // Toolkit

Loading

0 comments on commit cafde76

Please sign in to comment.