Skip to content

Commit

Permalink
Merge branch 'dev-app'
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielhvz committed Aug 11, 2021
2 parents 0377150 + 6668a99 commit f888b43
Show file tree
Hide file tree
Showing 23 changed files with 412 additions and 702 deletions.
Binary file modified Documents/GSC FIELD APP GUIDE PRINTABLE BOOKLET.pptx
Binary file not shown.
Binary file added Documents/GSC FIELD APP GUIDE.pdf
Binary file not shown.
Binary file removed Documents/GSC-FIELD-APP-GUIDE.pdf
Binary file not shown.
36 changes: 16 additions & 20 deletions GSCFieldApp/GSCFieldApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,33 @@
<AssemblyName>GSCFieldApp</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PackageCertificateKeyFile>
</PackageCertificateKeyFile>
<PackageCertificateKeyFile>GSCFieldApp_TemporaryKey.pfx</PackageCertificateKeyFile>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundle>Never</AppxBundle>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppxBundlePlatforms>x64</AppxBundlePlatforms>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<RuntimeIdentifiers>win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot</RuntimeIdentifiers>
<PackageCertificateThumbprint>C89C75FA507D7B17DC7F8711114D563DC6EEBDFB</PackageCertificateThumbprint>
<AppxPackageDir>D:\gab\dev\GSCFieldAppPackages\</AppxPackageDir>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppInstallerUpdateFrequency>0</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
<PackageCertificateThumbprint>
</PackageCertificateThumbprint>
<AppxPackageDir>C:\Users\ghuotvez\Documents\dev\gscFieldApp\</AppxPackageDir>
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
<AppInstallerUpdateFrequency>365</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>Daily</AppInstallerCheckForUpdateFrequency>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<HoursBetweenUpdateChecks>8760</HoursBetweenUpdateChecks>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<AppInstallerUri>https://github.com/NRCan/GSC-Field-Application/releases</AppInstallerUri>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -397,29 +398,24 @@
<Version>100.4.0</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.2.9</Version>
<Version>6.2.12</Version>
</PackageReference>
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
<Version>2.0.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>10.0.3</Version>
</PackageReference>
<PackageReference Include="SQLite.Net-PCL">
<Version>3.1.1</Version>
</PackageReference>
<PackageReference Include="SQLite.uwp">
<Version>3.34.1</Version>
</PackageReference>
<PackageReference Include="System.Data.SQLite">
<Version>1.0.112</Version>
<Version>1.0.113.7</Version>
</PackageReference>
<PackageReference Include="Template10">
<Version>1.1.13-preview-20161207</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<SDKReference Include="SQLite.UWP.2015, Version=3.30.1">
<Name>SQLite for Universal Windows Platform %28SQLite.UWP.2015, Version=3.30.1%29</Name>
</SDKReference>
</ItemGroup>
<ItemGroup>
<Folder Include="BundleArtifacts\" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion GSCFieldApp/Models/Metadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public bool isValid
get
{
if (MetaID != string.Empty && UserCode != string.Empty && FieldworkType != string.Empty && ProjectName != string.Empty &&
ProjectUser_FN != string.Empty && ProjectUser_LN != string.Empty && Version != string.Empty && StationStartNumber != string.Empty && Convert.ToInt16(StationStartNumber) < 9999)
ProjectUser_FN != string.Empty && ProjectUser_LN != string.Empty && Version != string.Empty && VersionSchema != string.Empty && StationStartNumber != string.Empty && Convert.ToInt16(StationStartNumber) < 9999)
{
return true;
}
Expand Down
13 changes: 11 additions & 2 deletions GSCFieldApp/Models/Structure.cs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ public bool? isRelatedStructuresAzimuthValid
{
get
{
if (StructureClass != null &&StructureClass != string.Empty && StructureRelated != string.Empty && StructureAzimuth != string.Empty)
if (StructureClass != null &&StructureClass != string.Empty
&& StructureRelated != string.Empty
&& StructureAzimuth != string.Empty
&& StructureRelated != Dictionaries.DatabaseLiterals.picklistNACode)
{
//Init variables
int azimuthPlanar = int.MinValue;
Expand Down Expand Up @@ -280,7 +283,13 @@ public bool? isRelatedStructuresDipValid
{
get
{
if (StructureClass != null && StructureRelated != null && StructureAzimuth != null && StructureClass != string.Empty && StructureRelated != string.Empty && StructureAzimuth != string.Empty)
if (StructureClass != null
&& StructureRelated != null
&& StructureAzimuth != null
&& StructureClass != string.Empty
&& StructureRelated != string.Empty
&& StructureAzimuth != string.Empty
&& StructureRelated != Dictionaries.DatabaseLiterals.picklistNACode)
{
//Init variables
int dipPlanar = int.MinValue;
Expand Down
4 changes: 2 additions & 2 deletions GSCFieldApp/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="GSCFieldApp" Publisher="CN=Geological Survey Canada - Self signed" Version="1.0.0.0" />
<Identity Name="GSCFieldApp" Publisher="CN=ghuotvez" Version="1.2.0.0" />
<mp:PhoneIdentity PhoneProductId="9b781dd2-bba3-4612-9973-3876fc739b3f" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>GSC Field App</DisplayName>
Expand Down Expand Up @@ -40,11 +40,11 @@
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap:Capability Name="removableStorage" />
<!--<uap:Capability Name="documentsLibrary" />
<uap:Capability Name="picturesLibrary" />-->
<!--Add for date stamp backup for field work database. - Gab-->
<DeviceCapability Name="location" />
<DeviceCapability Name="serialcommunication"/>
</Capabilities>
</Package>
8 changes: 7 additions & 1 deletion GSCFieldApp/Resources/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ Shimamura, Kaz – Senior Advisor</value>
<value>Picklists values have been replaced.</value>
</data>
<data name="SettingPagePicklistButton.Label" xml:space="preserve">
<value>Load and replace Picklists</value>
<value>Import Picklists</value>
</data>
<data name="UserInfoDialogPGeologistFirstName.Header" xml:space="preserve">
<value>First Name</value>
Expand Down Expand Up @@ -1452,4 +1452,10 @@ Shimamura, Kaz – Senior Advisor</value>
<data name="MapInfoLocationLabel.Text" xml:space="preserve">
<value>Location: </value>
</data>
<data name="FieldBookUpgradeContentInvalid" xml:space="preserve">
<value>Current field book is already latest. </value>
</data>
<data name="MapPageLocationCommand.Label" xml:space="preserve">
<value>Manual XY</value>
</data>
</root>
8 changes: 7 additions & 1 deletion GSCFieldApp/Resources/fr/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ Shimamura, Kaz – Conseiller</value>
<value>Les vocabulaires ont été remplacés.</value>
</data>
<data name="SettingPagePicklistButton.Label" xml:space="preserve">
<value>Ajouter et remplacer le vocabulaire</value>
<value>Importer le vocabulaire</value>
</data>
<data name="UserInfoDialogPGeologistFirstName.Header" xml:space="preserve">
<value>Prénom</value>
Expand Down Expand Up @@ -1452,4 +1452,10 @@ Shimamura, Kaz – Conseiller</value>
<data name="MapInfoLocationLabel.Text" xml:space="preserve">
<value>Position: </value>
</data>
<data name="FieldBookUpgradeContentInvalid" xml:space="preserve">
<value>Le présent carnet est déjà de la plus récente version.</value>
</data>
<data name="MapPageLocationCommand.Label" xml:space="preserve">
<value>Entrée XY</value>
</data>
</root>
39 changes: 38 additions & 1 deletion GSCFieldApp/Services/DatabaseServices/DataAccess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,15 @@ public void DoUpgradeSchema(string inDBPath, SQLiteConnection outToDBConnection,

foreach (string q in queryList)
{
db.Execute(q);
try
{
db.Execute(q);
}
catch (Exception)
{

}

}


Expand All @@ -545,6 +553,35 @@ public void DoUpgradeSchema(string inDBPath, SQLiteConnection outToDBConnection,
}
}

/// <summary>
/// Will take select fieldbook db path and will perform some checks to validate if
/// database can be upgraded or not
/// </summary>
public bool CanUpgrade()
{
//Variables
bool canUpgrade = false;
string dbSchemaVersionQuery = "SELECT fm." + DatabaseLiterals.FieldUserInfoVersionSchema + " from " + DatabaseLiterals.TableMetadata + " fm";

//Perform checks to filter newly created database and/or empty ones

//Check #1
FieldLocation fieldLocationQuery = new FieldLocation();
int locationCount = GetTableCount(fieldLocationQuery.GetType());
//Check #2
Metadata metadataQuery = new Metadata();
List<object> mVersions = ReadTable(metadataQuery.GetType(), dbSchemaVersionQuery);
double d_mVersions = 0.0;
Double.TryParse(mVersions[0].ToString(), out d_mVersions);

if (locationCount > 0 && mVersions[0].ToString() != DatabaseLiterals.DBVersion && d_mVersions != 0.0 && d_mVersions < 1.44)
{
canUpgrade = true;
}

return canUpgrade;
}

#endregion

#region GET METHODS (usually needs a connection object)
Expand Down
13 changes: 1 addition & 12 deletions GSCFieldApp/Services/DatabaseServices/DataLocalSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ public void WipeUserInfoSettings()
/// </summary>
public void WipeUserMapSettings_deprecated()
{
if (currentLocalSettings.Containers[containerName].Values.ContainsKey("mapScale"))
{
currentLocalSettings.Containers[containerName].Values.Remove("mapScale");
}

if (currentLocalSettings.Containers[containerName].Values.ContainsKey("mapLayers"))
{
currentLocalSettings.Containers[containerName].Values.Remove("mapLayers");
Expand All @@ -85,14 +82,6 @@ public void WipeUserMapSettings_deprecated()
/// </summary>
public void WipeUserMapSettings()
{
//if (currentLocalSettings.Containers[containerName].Values.ContainsKey(ApplicationLiterals.KeywordMapViewLayersOrder))
//{
// currentLocalSettings.Containers[containerName].Values.Remove(ApplicationLiterals.KeywordMapViewLayersOrder);
//}
if (currentLocalSettings.Containers[containerName].Values.ContainsKey(ApplicationLiterals.KeywordMapViewScale))
{
currentLocalSettings.Containers[containerName].Values.Remove(ApplicationLiterals.KeywordMapViewScale);
}
if (currentLocalSettings.Containers[containerName].Values.ContainsKey(ApplicationLiterals.KeywordMapViewRotation))
{
currentLocalSettings.Containers[containerName].Values.Remove(ApplicationLiterals.KeywordMapViewRotation);
Expand Down
Loading

0 comments on commit f888b43

Please sign in to comment.