diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..37aecc82 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,30 @@ +name: CI + +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + - develop + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Setup .NET '5.0' + uses: actions/setup-dotnet@v1.7.2 + with: + dotnet-version: '5.0.x' + - name: Install dependencies + run: dotnet restore + - name: Application Data Model Test + run: dotnet test ./source/ApplicationDataModelTest/ApplicationDataModelTest.csproj -c Release + - name: Plugin Manager Test + run: dotnet test ./source/PluginManagerTest/PluginManagerTest.csproj -c Release + - name: Representation Test + run: dotnet test ./source/RepresentationTest/RepresentationTest.csproj -c Release \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..07ebd2ce --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" + +jobs: + package-and-release: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Set VERSION variable from tag + run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV + - name: Set VERSION_NUMBER + run: echo "VERSION_NUMBER=$(echo $VERSION | grep -i -P -o '^\d+\.\d+\.\d+')" >> $GITHUB_ENV + - name: Build artifacts + run: dotnet build --configuration Release /p:Version=${{ env.VERSION }} /p:FileVersion=${{ env.VERSION_NUMBER }}.${{ github.run_number }} + - name: Package + run: mkdir -p ./dist; nuget pack ./AgGatewayADAPTFramework.nuspec -outputdirectory ./dist -version ${{ env.VERSION }} + - name: Push release to Github + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./dist/AgGatewayADAPTFramework.${{ env.VERSION }}.nupkg + tag: ${{ github.ref }} + - name: Push release to public Nuget + run: dotnet nuget push ./dist/AgGatewayADAPTFramework.${{ env.VERSION }}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_API_KEY} + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bc1e692e..00000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -language: csharp -dotnet: 2.1.4 - -env: - - FrameworkPathOverride=/usr/lib/mono/4.5/ - -jobs: - include: - - stage: test - mono: none - script: - - dotnet test ./source/ApplicationDataModelTest/ApplicationDataModelTest.csproj -c Release - - dotnet test ./source/PluginManagerTest/PluginManagerTest.csproj -c Release - - dotnet test ./source/RepresentationTest/RepresentationTest.csproj -c Release - - stage: deploy - if: tag =~ ^v\d+\.\d+\.\d+ - mono: 5.8.0 - script: - - VERSION=$(echo $TRAVIS_TAG | grep -i -P -o '(?<=^v)\d+\.\d+\.\d+(?:.+)?$'); VERSION_NUMBER=$(echo $VERSION | grep -i -P -o '^\d+\.\d+\.\d+') - - dotnet build ./ADAPT.sln -c Release /p:Version=$VERSION /p:FileVersion=$VERSION_NUMBER.$TRAVIS_BUILD_NUMBER - - mkdir -p ./dist; nuget pack ./AgGatewayADAPTFramework.nuspec -verbosity detailed -outputdirectory ./dist -version $VERSION - - if [ -n "${NUGET_API_KEY}" ]; then dotnet nuget push ./dist/AgGatewayADAPTFramework.${VERSION}.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json; fi - deploy: - provider: releases - api_key: $GITHUB_OAUTH_TOKEN - file: "./dist/AgGatewayADAPTFramework.${VERSION}.nupkg" - skip_cleanup: true - on: - tags: true diff --git a/README.md b/README.md index cac64987..6f01a93b 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,12 @@ The ADAPT Framework requires the .NET Core 2.x SDK and the .NET 4.5.1 SDK to be built correctly. It is possible to build the projects with just the .NET Core 2.x SDK if you use the .NET CLI and use the *-Framework* flag. ### CI Builds -The ADAPT Framework has it's tests run every time any code changes through a Travis CI job. +The ADAPT Framework has it's tests run every time any code changes through a GitHub Actions pipeline. ### Release Builds -The ADAPT Framework is built by creating a GitHub Release that triggers a Travis CI job. The release tag version should conform to the pattern *vX.X.X-alphaX* for an alpha release, *vX.X.X-betaX* for a beta release, *vX.X.X-rcX* for a release candidate release and *vX.X.X* for a production release. The job takes the release tag version and publishes a NuGet package using that. +The ADAPT Framework is built by creating a GitHub Release that triggers a GitHub Actions pipeline. The release tag version should conform to the pattern *vX.X.X-alphaX* for an alpha release, *vX.X.X-betaX* for a beta release, *vX.X.X-rcX* for a release candidate release and *vX.X.X* for a production release. The job takes the release tag version and publishes a NuGet package using that. -An example would be that the release tag version *v1.2.3-beta2* will create a NuGet package with the version *1.2.3-beta2* and the assemblies would have the file version *1.2.3.N* where **N** is the Travis CI build number. +An example would be that the release tag version *v1.2.3-beta2* will create a NuGet package with the version *1.2.3-beta2* and the assemblies would have the file version *1.2.3.N* where **N** is the GitHub Actions run number. ### Local Builds The ADAPT Framework can be built locally on a developer machine if the repository is cloned. diff --git a/source/ADAPT/LoggedData/SpatialRecord.cs b/source/ADAPT/LoggedData/SpatialRecord.cs index cb8471a7..4651fa21 100644 --- a/source/ADAPT/LoggedData/SpatialRecord.cs +++ b/source/ADAPT/LoggedData/SpatialRecord.cs @@ -41,6 +41,8 @@ public SpatialRecord(int numberOfMeters) public DateTime Timestamp { get; set; } + public EnumeratedValue SignalType { get; set; } + public void SetMeterValue(WorkingData workingData, RepresentationValue value) { _meterValues.Add(workingData.Id.ReferenceId, value); diff --git a/source/ApplicationDataModelTest/ApplicationDataModelTest.csproj b/source/ApplicationDataModelTest/ApplicationDataModelTest.csproj index 0531ae5b..ff8ff37d 100644 --- a/source/ApplicationDataModelTest/ApplicationDataModelTest.csproj +++ b/source/ApplicationDataModelTest/ApplicationDataModelTest.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + net5.0 AgGateway.ADAPT.ApplicationDataModelTest AgGateway.ADAPT.ApplicationDataModelTest AgGateway and ADAPT Contributors diff --git a/source/PluginManagerTest/FileSystemTest.cs b/source/PluginManagerTest/FileSystemTest.cs index e21eaa21..3c8c8884 100644 --- a/source/PluginManagerTest/FileSystemTest.cs +++ b/source/PluginManagerTest/FileSystemTest.cs @@ -65,6 +65,7 @@ public void GetFilesGivenNonExistingPathShouldReturnEmptyList() [Test] public void GetSubDirectoriesGivenPathShouldReturnEmptyList() { + _directoryLocation = Path.Combine(_directoryLocation, Guid.NewGuid().ToString()); var result = _fileSystem.GetSubDirectories(_directoryLocation); Assert.IsEmpty(result); } @@ -72,6 +73,7 @@ public void GetSubDirectoriesGivenPathShouldReturnEmptyList() [Test] public void GetSubDirectoriesGivenPathShouldReturnTwoDirectories() { + _directoryLocation = Path.Combine(_directoryLocation, Guid.NewGuid().ToString()); var subDirectory1 = Path.Combine(_directoryLocation, Guid.NewGuid().ToString()); Directory.CreateDirectory(subDirectory1); diff --git a/source/PluginManagerTest/PluginManagerTest.csproj b/source/PluginManagerTest/PluginManagerTest.csproj index da55662e..ebc4c568 100644 --- a/source/PluginManagerTest/PluginManagerTest.csproj +++ b/source/PluginManagerTest/PluginManagerTest.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + net5.0 AgGateway.ADAPT.PluginManagerTest AgGateway.ADAPT.PluginManagerTest 0.0.0 diff --git a/source/Representation/RepresentationSystem/RepresentationInstanceList.cs b/source/Representation/RepresentationSystem/RepresentationInstanceList.cs index 8bea0fd2..e36e2c7f 100644 --- a/source/Representation/RepresentationSystem/RepresentationInstanceList.cs +++ b/source/Representation/RepresentationSystem/RepresentationInstanceList.cs @@ -1,16 +1,16 @@ -/******************************************************************************* - * Copyright (C) 2015-2016 AgGateway and ADAPT Contributors - * Copyright (C) 2015-2016 Deere and Company - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Tarak Reddy, Tim Shearouse - initial API and implementation +/******************************************************************************* + * Copyright (C) 2015-2016 AgGateway and ADAPT Contributors + * Copyright (C) 2015-2016 Deere and Company + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tarak Reddy, Tim Shearouse - initial API and implementation *******************************************************************************/ - - + + namespace AgGateway.ADAPT.Representation.RepresentationSystem { public class RepresentationInstanceList @@ -117,8 +117,8 @@ public class RepresentationInstanceList public static readonly EnumeratedRepresentation dtFacilityType = (EnumeratedRepresentation)RepresentationManager.Instance.Representations["dtFacilityType"]; - public static readonly EnumeratedRepresentation dtPersonRole = (EnumeratedRepresentation)RepresentationManager.Instance.Representations["dtPersonRole"]; - + public static readonly EnumeratedRepresentation dtPersonRole = (EnumeratedRepresentation)RepresentationManager.Instance.Representations["dtPersonRole"]; + public static readonly EnumeratedRepresentation dtCropNutritionIngredient = (EnumeratedRepresentation)RepresentationManager.Instance.Representations["dtCropNutritionIngredient"]; public static readonly NumericRepresentation vrAppRateVolumeSetPoint = (NumericRepresentation)RepresentationManager.Instance.Representations["vrAppRateVolumeSetPoint"]; @@ -1004,6 +1004,25 @@ public class RepresentationInstanceList public static readonly NumericRepresentation vrWorkingWidthActual = (NumericRepresentation)RepresentationManager.Instance.Representations["vrWorkingWidthActual"]; public static readonly NumericRepresentation vrWorkingWidthDefault = (NumericRepresentation)RepresentationManager.Instance.Representations["vrWorkingWidthDefault"]; + + public static readonly NumericRepresentation vrEnginePower = (NumericRepresentation)RepresentationManager.Instance.Representations["vrEnginePower"]; + + public static readonly NumericRepresentation vrElectricalPowerSetPoint = (NumericRepresentation)RepresentationManager.Instance.Representations["vrElectricalPowerSetPoint"]; + + public static readonly NumericRepresentation vrElectricalPowerActual = (NumericRepresentation)RepresentationManager.Instance.Representations["vrElectricalPowerActual"]; + + public static readonly NumericRepresentation vrPTOLoadCurrentSpeed = (NumericRepresentation)RepresentationManager.Instance.Representations["vrPTOLoadCurrentSpeed"]; + + public static readonly NumericRepresentation vrTransmissionLoadCurrentSpeed = (NumericRepresentation)RepresentationManager.Instance.Representations["vrTransmissionLoadCurrentSpeed"]; + + public static readonly NumericRepresentation vrFuelTotalConsumptionEffective = (NumericRepresentation)RepresentationManager.Instance.Representations["vrFuelTotalConsumptionEffective"]; + + public static readonly NumericRepresentation vrFuelTotalConsumptionIneffective = (NumericRepresentation)RepresentationManager.Instance.Representations["vrFuelTotalConsumptionIneffective"]; + + public static readonly NumericRepresentation vrSlipCurrentSpeed = (NumericRepresentation)RepresentationManager.Instance.Representations["vrSlipCurrentSpeed"]; + + public static readonly NumericRepresentation vrFuelProductivityTotal = (NumericRepresentation)RepresentationManager.Instance.Representations["vrFuelProductivityTotal"]; } + } diff --git a/source/Representation/RepresentationSystem/RepresentationList.cs b/source/Representation/RepresentationSystem/RepresentationList.cs index 597e1849..7533d054 100644 --- a/source/Representation/RepresentationSystem/RepresentationList.cs +++ b/source/Representation/RepresentationSystem/RepresentationList.cs @@ -1,15 +1,15 @@ -/******************************************************************************* - * Copyright (C) 2015-2016 AgGateway and ADAPT Contributors - * Copyright (C) 2015-2016 Deere and Company - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Tarak Reddy, Tim Shearouse - initial API and implementation - *******************************************************************************/ - +/******************************************************************************* + * Copyright (C) 2015-2016 AgGateway and ADAPT Contributors + * Copyright (C) 2015-2016 Deere and Company + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tarak Reddy, Tim Shearouse - initial API and implementation + *******************************************************************************/ + namespace AgGateway.ADAPT.Representation.RepresentationSystem { public enum RepresentationList @@ -1005,5 +1005,25 @@ public enum RepresentationList vrWorkingWidthActual = 557, vrWorkingWidthDefault = 558, + + vrEnginePower = 559, + + vrElectricalPowerSetPoint = 560, + + vrElectricalPowerActual = 561, + + vrPTOLoadCurrentSpeed = 562, + + vrTransmissionLoadCurrentSpeed = 563, + + vrFuelTotalConsumptionEffective = 564, + + vrFuelTotalConsumptionIneffective = 565, + + vrSlipCurrentSpeed = 566, + + vrFuelProductivityTotal = 567, + + } } diff --git a/source/Representation/RepresentationSystem/RepresentationTagList.cs b/source/Representation/RepresentationSystem/RepresentationTagList.cs index 8569addf..5b2f9b6e 100644 --- a/source/Representation/RepresentationSystem/RepresentationTagList.cs +++ b/source/Representation/RepresentationSystem/RepresentationTagList.cs @@ -1,15 +1,15 @@ -/******************************************************************************* - * Copyright (C) 2015-2016 AgGateway and ADAPT Contributors - * Copyright (C) 2015-2016 Deere and Company - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Tarak Reddy, Tim Shearouse - initial API and implementation - *******************************************************************************/ - +/******************************************************************************* + * Copyright (C) 2015-2016 AgGateway and ADAPT Contributors + * Copyright (C) 2015-2016 Deere and Company + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Tarak Reddy, Tim Shearouse - initial API and implementation + *******************************************************************************/ + namespace AgGateway.ADAPT.Representation.RepresentationSystem { public class RepresentationTagList @@ -1003,6 +1003,24 @@ public class RepresentationTagList public const int vrWorkingWidthActual = 557; public const int vrWorkingWidthDefault = 558; + + public const int vrEnginePower = 559; + + public const int vrElectricalPowerSetPoint = 560; + + public const int vrElectricalPowerActual = 561; + + public const int vrPTOLoadCurrentSpeed = 562; + + public const int vrTransmissionLoadCurrentSpeed = 563; + + public const int vrFuelTotalConsumptionEffective = 564; + + public const int vrFuelTotalConsumptionIneffective = 565; + + public const int vrSlipCurrentSpeed = 566; + + public const int vrFuelProductivityTotal = 567; } } diff --git a/source/Representation/Resources/RepresentationSystem.xml b/source/Representation/Resources/RepresentationSystem.xml index c1c2099c..af6d207f 100644 --- a/source/Representation/Resources/RepresentationSystem.xml +++ b/source/Representation/Resources/RepresentationSystem.xml @@ -16182,6 +16182,7 @@ tillage pressure Actual + @@ -17736,20 +17737,20 @@ Harvest wet mass Harvest wet mass - - - - - - solution rate liquid distance - - - - - - - solution rate mass distance - + + + + + + solution rate liquid distance + + + + + + + solution rate mass distance + @@ -17773,6 +17774,100 @@ Working Width Default + + + + + + + Engine Power + + + + + + + + Setpoint Electrical Power of Device Element + + + + + + + + Actual Electrical Power of Device Element + + + + + + + The ratio of actual PTO (Power Take-Off) percent torque (indicated) to maximum indicated torque available at the current PTO speed. + + + + + + + The ratio of actual Transmission percent torque (indicated) to maximum indicated torque available at the current Transmission speed. + + + + + + + + Accumulated total fuel consumption in working position. + + + + + + + + Accumulated total fuel consumption in non working position. + + + + + + + Slip at Current Speed + + + + + + + + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. + Entire Average Fuel Consumption per Area of the device lifetime. ApplicationMethod @@ -27836,5 +27931,6 @@ HumicAcid - + + diff --git a/source/Representation/UnitSystem/UnitSystemManager.cs b/source/Representation/UnitSystem/UnitSystemManager.cs index f0aff5f2..4e51e4d8 100644 --- a/source/Representation/UnitSystem/UnitSystemManager.cs +++ b/source/Representation/UnitSystem/UnitSystemManager.cs @@ -40,7 +40,11 @@ public static string UnitSystemDataLocation public static ApplicationDataModel.Common.UnitOfMeasure GetUnitOfMeasure(string code) { - return InternalUnitSystemManager.Instance.UnitOfMeasures[code].ToModelUom(); + if (InternalUnitSystemManager.Instance.UnitOfMeasures.Contains(code)) + { + return InternalUnitSystemManager.Instance.UnitOfMeasures[code].ToModelUom(); + } + return null; } public static ApplicationDataModel.Common.UnitOfMeasure FromUNRec20Code(string code) diff --git a/source/RepresentationTest/RepresentationTest.csproj b/source/RepresentationTest/RepresentationTest.csproj index 5be76ac6..abc29a68 100644 --- a/source/RepresentationTest/RepresentationTest.csproj +++ b/source/RepresentationTest/RepresentationTest.csproj @@ -1,7 +1,7 @@ - netcoreapp2.0 + net5.0 0.0.0 AgGateway and ADAPT Contributors AgGateway diff --git a/source/RepresentationTest/UnitSystem/UnitSystemManagerTest.cs b/source/RepresentationTest/UnitSystem/UnitSystemManagerTest.cs index 231910a1..6fdc5e3b 100644 --- a/source/RepresentationTest/UnitSystem/UnitSystemManagerTest.cs +++ b/source/RepresentationTest/UnitSystem/UnitSystemManagerTest.cs @@ -129,7 +129,7 @@ public void GivenTwoCompositeUnitsWhenDivideUnitsShouldReturnNewComposite() private Representation.Generated.UnitSystem DeserializeUnitSystem() { - var assemblyLocation = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().CodeBase).LocalPath); + var assemblyLocation = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().Location).LocalPath); var unitSystemXml = Path.Combine(assemblyLocation, "Resources", "UnitSystem.xml"); var serializer = new XmlSerializer(typeof(Representation.Generated.UnitSystem)); using (var stream = File.OpenRead(unitSystemXml))