Skip to content

Commit

Permalink
Merge pull request #189 from knelson-farmbeltnorth/develop
Browse files Browse the repository at this point in the history
Adding support for swath width on Guidance Patterns
  • Loading branch information
Stuart Rhea authored Sep 14, 2022
2 parents 2dd5ee9 + 9ee874e commit ab42180
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ISOv4Plugin/Mappers/GuidancePatternMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using AgGateway.ADAPT.ISOv4Plugin.ISOEnumerations;
using AgGateway.ADAPT.ISOv4Plugin.ISOModels;
using AgGateway.ADAPT.Representation.UnitSystem;
using AgGateway.ADAPT.ISOv4Plugin.ExtensionMethods;

namespace AgGateway.ADAPT.ISOv4Plugin.Mappers
{
Expand Down Expand Up @@ -237,6 +238,10 @@ public GuidancePattern ImportGuidancePattern(ISOGuidancePattern isoGuidancePatte
LineStringMapper lineStringMapper = new LineStringMapper(TaskDataMapper);
PointMapper pointMapper = new PointMapper(TaskDataMapper);
var isoLineString = isoGuidancePattern.LineString ?? new ISOLineString();
if (isoLineString.LineStringWidth.HasValue)
{
pattern.SwathWidth = ((int)isoLineString.LineStringWidth.Value).AsNumericRepresentationValue("mm");
}
switch (isoGuidancePattern.GuidancePatternType)
{
case ISOGuidancePatternType.AB:
Expand Down
5 changes: 5 additions & 0 deletions ISOv4Plugin/Mappers/LineStringMapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using AgGateway.ADAPT.ApplicationDataModel.Shapes;
using AgGateway.ADAPT.ISOv4Plugin.ISOEnumerations;
using AgGateway.ADAPT.ISOv4Plugin.ISOModels;
using AgGateway.ADAPT.ISOv4Plugin.ExtensionMethods;

namespace AgGateway.ADAPT.ISOv4Plugin.Mappers
{
Expand Down Expand Up @@ -73,6 +74,10 @@ public ISOLineString ExportGuidancePattern(GuidancePattern adaptGuidancePattern)
{
ISOLineString lineString = new ISOLineString(TaskDataMapper.Version);
lineString.LineStringType = ISOLineStringType.GuidancePattern;
if (adaptGuidancePattern.SwathWidth != null)
{
lineString.LineStringWidth = (uint?)adaptGuidancePattern.SwathWidth.AsConvertedInt("mm");
}

PointMapper pointMapper = new PointMapper(TaskDataMapper);

Expand Down

0 comments on commit ab42180

Please sign in to comment.