Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #52 from jmccausland/master
Browse files Browse the repository at this point in the history
Pull request for current sprint ending March 17/18th
  • Loading branch information
Gary Sheppard committed Mar 19, 2015
2 parents d6ba29e + a6c7cca commit 74e844b
Show file tree
Hide file tree
Showing 26 changed files with 945 additions and 103 deletions.
4 changes: 2 additions & 2 deletions application/MilitaryPlanner.application
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
<framework targetVersion="4.5" profile="Full" supportedRuntime="4.0.30319" />
</compatibleFrameworks>
<dependency>
<dependentAssembly dependencyType="install" codebase="MilitaryPlanner.exe.manifest" size="50188">
<dependentAssembly dependencyType="install" codebase="MilitaryPlanner.exe.manifest" size="50189">
<assemblyIdentity name="MilitaryPlanner.exe" version="1.0.0.2" publicKeyToken="0000000000000000" language="neutral" processorArchitecture="x86" type="win32" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>wfO19QTf/faxHsMlkhXLFJbx9h+eWETz1IlR0ayr1E0=</dsig:DigestValue>
<dsig:DigestValue>EMBPjPlzoXVeFky1SyVEP4NsgoCr3m+Xv+PAJDb8xcU=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down
Binary file modified application/MilitaryPlanner.exe
Binary file not shown.
24 changes: 24 additions & 0 deletions application/MilitaryPlanner.exe.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MilitaryPlanner.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
Expand All @@ -12,4 +17,23 @@
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
<MilitaryPlanner.Properties.Settings>
<setting name="Left" serializeAs="String">
<value>200</value>
</setting>
<setting name="Top" serializeAs="String">
<value>100</value>
</setting>
<setting name="Width" serializeAs="String">
<value>900</value>
</setting>
<setting name="Height" serializeAs="String">
<value>480</value>
</setting>
<setting name="WindowState" serializeAs="String">
<value>0</value>
</setting>
</MilitaryPlanner.Properties.Settings>
</userSettings>
</configuration>
8 changes: 4 additions & 4 deletions application/MilitaryPlanner.exe.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,14 @@
</dependentAssembly>
</dependency>
<dependency>
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MilitaryPlanner.exe" size="130560">
<dependentAssembly dependencyType="install" allowDelayedBinding="true" codebase="MilitaryPlanner.exe" size="149504">
<assemblyIdentity name="MilitaryPlanner" version="1.0.0.0" language="neutral" processorArchitecture="x86" />
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>a5SKu54QOu2khusYWxVDmu0G8BieM5iulCWWsH8Cup0=</dsig:DigestValue>
<dsig:DigestValue>RFmclQc6UiyJNvUGBVCnzozRHyEDN7u+/7LWwd8hIxg=</dsig:DigestValue>
</hash>
</dependentAssembly>
</dependency>
Expand Down Expand Up @@ -839,13 +839,13 @@
<dsig:DigestValue>7p8UwQtRbihveyTowoZ6eDC/QsqKyRt14M9oWkwQocU=</dsig:DigestValue>
</hash>
</file>
<file name="MilitaryPlanner.exe.config" size="541">
<file name="MilitaryPlanner.exe.config" size="1627">
<hash>
<dsig:Transforms>
<dsig:Transform Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity" />
</dsig:Transforms>
<dsig:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha256" />
<dsig:DigestValue>JgF8u+SmlekVyttocpovsnMnjGwSmU+c9zec8rkLsgE=</dsig:DigestValue>
<dsig:DigestValue>rbyHaVCrS1SIk4LeaaXZ4OQJXQWS499dkBdRJJMprms=</dsig:DigestValue>
</hash>
</file>
</asmv1:assembly>
3 changes: 2 additions & 1 deletion source/MilitaryPlanner/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Application x:Class="MilitaryPlanner.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views\MainWindow.xaml">
StartupUri="Views\MainWindow.xaml"
Exit="Application_Exit">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
7 changes: 5 additions & 2 deletions source/MilitaryPlanner/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ private void Application_Startup(object sender, StartupEventArgs e)
}

}
}


private void Application_Exit(object sender, ExitEventArgs e)
{
MilitaryPlanner.Properties.Settings.Default.Save();
}
}
}
109 changes: 109 additions & 0 deletions source/MilitaryPlanner/Controllers/BasemapGalleryController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
// Copyright 2015 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.

using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using Esri.ArcGISRuntime.Layers;
using Esri.ArcGISRuntime.Portal;
using Esri.ArcGISRuntime.WebMap;
using MilitaryPlanner.Helpers;
using MilitaryPlanner.Views;
using MapView = Esri.ArcGISRuntime.Controls.MapView;

namespace MilitaryPlanner.Controllers
{
class BasemapGalleryController
{
private readonly MapView _mapView;
private readonly BasemapGalleryView _basemapGalleryView;
private ArcGISPortal _arcGisPortal;

public BasemapGalleryController(MapView mapView)
{
_mapView = mapView;

_basemapGalleryView = new BasemapGalleryView { PlacementTarget = mapView, ViewModel = { mapView = mapView } };

var owner = Window.GetWindow(mapView);

if (owner != null)
{
owner.LocationChanged += (sender, e) =>
{
_basemapGalleryView.HorizontalOffset += 1;
_basemapGalleryView.HorizontalOffset -= 1;
};
}

InitializeArcGISPortal();

Mediator.Register(Constants.ACTION_UPDATE_BASEMAP, DoUpdateBasemap);
}

public void Toggle()
{
_basemapGalleryView.ViewModel.Toggle();
}

private async void InitializeArcGISPortal()
{
_arcGisPortal = await ArcGISPortal.CreateAsync();

// Load portal basemaps
var result = await _arcGisPortal.ArcGISPortalInfo.SearchBasemapGalleryAsync();
_basemapGalleryView.ViewModel.Basemaps = new ObservableCollection<ArcGISPortalItem>(result.Results);
}

private async void DoUpdateBasemap(object obj)
{
try
{
var item = obj as ArcGISPortalItem;

if (item != null)
{
var webmap = await WebMap.FromPortalItemAsync(item);

while (_mapView.Map.Layers.Any(l => l.ID == "basemap"))
{
_mapView.Map.Layers.Remove("basemap");
}

foreach (var s in webmap.Basemap.Layers.Reverse())
{
switch (s.LayerType)
{
case WebMapLayerType.ArcGISTiledMapServiceLayer:
case WebMapLayerType.Unknown:
_mapView.Map.Layers.Insert(0,new ArcGISTiledMapServiceLayer(new Uri(s.Url)){ID="basemap"});
break;
case WebMapLayerType.OpenStreetMap:
var layer = new OpenStreetMapLayer(){ID="basemap"};
_mapView.Map.Layers.Insert(0,layer);
break;
default:
break;
}
}
}
}
catch (Exception)
{

}
}
}
}
7 changes: 7 additions & 0 deletions source/MilitaryPlanner/Helpers/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ static public class Constants

public const string ACTION_EDIT_MISSION_PHASES = "EditMissionPhases";
public const string ACTION_MISSION_CLONED = "EditMissionCloned";
public const string ACTION_CLONE_MISSION = "CloneMission";

public const string MSG_ACTION_UPDATE = "update";
public const string MSG_ACTION_REMOVE = "remove";
Expand All @@ -45,6 +46,12 @@ static public class Constants

public const string ACTION_COORDINATE_READOUT_FORMAT_CHANGED = "ActionCoordinateReadoutFormatChanged";

public const string ACTION_EDIT_GEOMETRY = "ActionEditGeometry";
public const string ACTION_EDIT_UNDO = "ActionEditUndo";
public const string ACTION_EDIT_REDO = "ActionEditRedo";

public const string ACTION_UPDATE_BASEMAP = "ActionUpdateBasemap";

public const int SAVE_AS_MISSION = 1;
public const int SAVE_AS_GEOMESSAGES = 2;
public const string SAVE_AS_DELIMITER = "::";
Expand Down
25 changes: 25 additions & 0 deletions source/MilitaryPlanner/Helpers/SettingBindingExtension.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Windows.Data;
using MilitaryPlanner.Properties;

namespace MilitaryPlanner.Helpers
{
public class SettingBindingExtension : Binding
{
public SettingBindingExtension()
{
Initialize();
}

public SettingBindingExtension(string path)
: base(path)
{
Initialize();
}

private void Initialize()
{
this.Source = Settings.Default;
this.Mode = BindingMode.TwoWay;
}
}
}
3 changes: 3 additions & 0 deletions source/MilitaryPlanner/Helpers/TimeAwareMessageLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
using System.Xml.Schema;
using System.Xml.Serialization;
using Esri.ArcGISRuntime.Data;
using Esri.ArcGISRuntime.Geometry;
using Esri.ArcGISRuntime.Symbology.Specialized;

namespace MilitaryPlanner.Helpers
Expand All @@ -39,6 +40,8 @@ public TimeExtent VisibleTimeExtent
set;
}

public Geometry SymbolGeometry { get; set; }

public Dictionary<string, string> PhaseControlPointsDictionary = new Dictionary<string, string>();

public void StoreControlPoints(string phaseID, MilitaryMessage msg)
Expand Down
10 changes: 10 additions & 0 deletions source/MilitaryPlanner/MilitaryPlanner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@
<Compile Include="Behavior\IDropable.cs" />
<Compile Include="Behavior\TreeViewDragBehavoir.cs" />
<Compile Include="Behavior\TreeViewItemBehavior.cs" />
<Compile Include="Controllers\BasemapGalleryController.cs" />
<Compile Include="Controllers\CoordinateReadoutController.cs" />
<Compile Include="Controllers\GotoXYToolController.cs" />
<Compile Include="Controllers\NetworkingToolController.cs" />
Expand All @@ -144,8 +145,10 @@
<Compile Include="Helpers\EventToCommand.cs" />
<Compile Include="Helpers\GotoItem.cs" />
<Compile Include="Helpers\Mediator.cs" />
<Compile Include="Helpers\SettingBindingExtension.cs" />
<Compile Include="Helpers\TimeAwareMessageLayer.cs" />
<Compile Include="Models\Mission.cs" />
<Compile Include="ViewModels\BasemapGalleryViewModel.cs" />
<Compile Include="ViewModels\BaseToolViewModel.cs" />
<Compile Include="ViewModels\GotoXYToolViewModel.cs" />
<Compile Include="ViewModels\MapViewModel.cs" />
Expand All @@ -156,6 +159,9 @@
<Compile Include="ViewModels\SymbolTreeViewModel.cs" />
<Compile Include="ViewModels\SymbolViewModel.cs" />
<Compile Include="ViewModels\ViewShedToolViewModel.cs" />
<Compile Include="Views\BasemapGalleryView.xaml.cs">
<DependentUpon>BasemapGalleryView.xaml</DependentUpon>
</Compile>
<Compile Include="Views\EditMissionPhasesView.xaml.cs">
<DependentUpon>EditMissionPhasesView.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -189,6 +195,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\BasemapGalleryView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\EditMissionPhasesView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
Loading

0 comments on commit 74e844b

Please sign in to comment.