-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from AndyTWF/126-ground-networks
feat(groundnetwork): allow ground networks to be modelled
- Loading branch information
Showing
136 changed files
with
2,378 additions
and
1,086 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Compiler.Model; | ||
|
||
namespace Compiler.Collector | ||
{ | ||
public class GroundNetworkCollector : ICompilableElementCollector | ||
{ | ||
private readonly SectorElementCollection sectorElements; | ||
|
||
public GroundNetworkCollector(SectorElementCollection sectorElements) | ||
{ | ||
this.sectorElements = sectorElements; | ||
} | ||
|
||
public IEnumerable<ICompilableElementProvider> GetCompilableElements() | ||
{ | ||
return sectorElements.GroundNetworks.OrderBy(network => network.Airport); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Compiler.Model | ||
{ | ||
/** | ||
* Container for all the ground network elements related to an airport | ||
*/ | ||
public class GroundNetwork: ICompilableElementProvider | ||
{ | ||
public string Airport { get; } | ||
public List<GroundNetworkTaxiway> Taxiways { get; } | ||
public List<GroundNetworkRunwayExit> RunwayExits { get; } | ||
|
||
public GroundNetwork( | ||
string airport, | ||
List<GroundNetworkTaxiway> taxiways, | ||
List<GroundNetworkRunwayExit> runwayExits | ||
) | ||
{ | ||
Airport = airport; | ||
Taxiways = taxiways; | ||
RunwayExits = runwayExits; | ||
} | ||
|
||
public IEnumerable<ICompilableElement> GetCompilableElements() | ||
{ | ||
return Taxiways.Concat<ICompilableElement>(RunwayExits); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace Compiler.Model | ||
{ | ||
public class GroundNetworkCoordinate: AbstractCompilableElement | ||
{ | ||
public Coordinate Coordinate { get; } | ||
|
||
public GroundNetworkCoordinate( | ||
Coordinate coordinate, | ||
Definition definition, | ||
Docblock docblock, | ||
Comment inlineComment | ||
) : base(definition, docblock, inlineComment) | ||
{ | ||
Coordinate = coordinate; | ||
} | ||
|
||
public override string GetCompileData(SectorElementCollection elements) | ||
{ | ||
return $"COORD:{Coordinate.latitude}:{Coordinate.longitude}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Compiler.Model | ||
{ | ||
public class GroundNetworkRunwayExit: AbstractCompilableElement | ||
{ | ||
public string Runway { get; } | ||
public string ExitName { get; } | ||
public string Direction { get; } | ||
public List<GroundNetworkCoordinate> Coordinates { get; } | ||
public int MaximumSpeed { get; } | ||
|
||
public GroundNetworkRunwayExit( | ||
string runway, | ||
string exitName, | ||
string direction, | ||
int maximumSpeed, | ||
List<GroundNetworkCoordinate> coordinates, | ||
Definition definition, | ||
Docblock docblock, | ||
Comment inlineComment | ||
) : base(definition, docblock, inlineComment) | ||
{ | ||
Runway = runway; | ||
ExitName = exitName; | ||
Direction = direction; | ||
Coordinates = coordinates; | ||
MaximumSpeed = maximumSpeed; | ||
} | ||
|
||
public override IEnumerable<ICompilableElement> GetCompilableElements() | ||
{ | ||
return new List<ICompilableElement> {this} | ||
.Concat(this.Coordinates); | ||
} | ||
|
||
public override string GetCompileData(SectorElementCollection elements) | ||
{ | ||
return $"EXIT:{Runway}:{ExitName}:{Direction}:{MaximumSpeed}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Compiler.Model | ||
{ | ||
public class GroundNetworkTaxiway: AbstractCompilableElement | ||
{ | ||
public string Name { get; } | ||
public List<GroundNetworkCoordinate> Coordinates { get; } | ||
public int MaximumSpeed { get; } | ||
public int? UsageFlag { get; } | ||
public string GateName { get; } | ||
|
||
public GroundNetworkTaxiway( | ||
string name, | ||
int maximumSpeed, | ||
int? usageFlag, | ||
string gateName, | ||
List<GroundNetworkCoordinate> coordinates, | ||
Definition definition, | ||
Docblock docblock, | ||
Comment inlineComment | ||
) : base(definition, docblock, inlineComment) | ||
{ | ||
Name = name; | ||
Coordinates = coordinates; | ||
MaximumSpeed = maximumSpeed; | ||
UsageFlag = usageFlag; | ||
GateName = gateName; | ||
} | ||
|
||
public override IEnumerable<ICompilableElement> GetCompilableElements() | ||
{ | ||
return new List<ICompilableElement> {this} | ||
.Concat(this.Coordinates); | ||
} | ||
|
||
public override string GetCompileData(SectorElementCollection elements) | ||
{ | ||
return $"TAXI:{Name}:{MaximumSpeed}:{UsageFlag}:{GateName}"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.