-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: Refactor, Testing and New Features!
- Loading branch information
Showing
40 changed files
with
2,510 additions
and
1,092 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
name: Stand Status CI | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
schedule: | ||
- cron: "0 12 1 * *" | ||
|
||
jobs: | ||
build: | ||
name: CI on PHP Version ${{ matrix.php_versions }} | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php_versions: ['7.2', '7.3', '7.4'] | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php_versions }} | ||
|
||
- name: Verify PHP Version | ||
run: php -v | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Run PHPUNIT | ||
run: vendor/bin/phpunit --coverage-text |
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
vendor | ||
composer.lock | ||
.idea | ||
build | ||
.phpunit.result.cache | ||
storage/data/*.csv |
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 |
---|---|---|
@@ -1,23 +1,40 @@ | ||
{ | ||
"name": "cobaltgrid/vatsim-stand-status", | ||
"description" : "A PHP library to access the status of aircraft stands on VATSIM", | ||
"keywords" : ["vatsim", "stand", "stands", "flight simulator"], | ||
"homepage" : "https://github.com/atoff/vatsim-stand-status", | ||
"type" : "library", | ||
"license" : "AGPL-3.0-or-later", | ||
"authors" : [ | ||
{ | ||
"name" : "Alex Toff", | ||
"email" : "[email protected]", | ||
"homepage" : "https://www.cobaltgrid.com" | ||
} | ||
], | ||
"require": { | ||
"skymeyer/vatsimphp": "^2.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"CobaltGrid\\VatsimStandStatus\\": "src/" | ||
} | ||
"name": "cobaltgrid/vatsim-stand-status", | ||
"description": "A PHP library to access the status of aircraft stands on VATSIM", | ||
"keywords": [ | ||
"vatsim", | ||
"stand", | ||
"stands", | ||
"flight simulator" | ||
], | ||
"homepage": "https://github.com/atoff/vatsim-stand-status", | ||
"type": "library", | ||
"license": "AGPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "Alex Toff", | ||
"email": "[email protected]", | ||
"homepage": "https://cobaltgrid.com" | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.2", | ||
"skymeyer/vatsimphp": "^2.0", | ||
"guzzlehttp/guzzle": "^6.5" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^8.5", | ||
"mockery/mockery": "^1.3", | ||
"symfony/var-dumper": "^5.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"CobaltGrid\\VatsimStandStatus\\": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Tests\\": "tests/" | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,128 +4,142 @@ | |
|
||
require_once '../vendor/autoload.php'; | ||
|
||
$StandStatus = new StandStatus("EGKK", dirname(__FILE__) . "/standData/egkkstands.csv", 51.148056, -0.190278); | ||
|
||
$StandStatus = new StandStatus(51.148056, -0.190278, StandStatus::COORD_FORMAT_CAA); | ||
$StandStatus->loadStandDataFromCSV(dirname(__FILE__) . "/../tests/Fixtures/SampleData/egkkstands.csv")->parseData(); | ||
?> | ||
|
||
<!-- GMaps & Labels --> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | ||
<script src="https://maps.googleapis.com/maps/api/js?key="></script> | ||
<script src="js/maplabel-min.js"></script> | ||
|
||
<script> | ||
$(document).ready(function(){ | ||
var center = {lat: 51.158, lng: -0.1820}; | ||
map = new google.maps.Map(document.getElementById('map'), { | ||
zoom: 14, | ||
mapTypeId: 'satellite', | ||
center: center, | ||
disableDefaultUI: true | ||
|
||
}); | ||
<?php | ||
foreach($StandStatus->occupiedStands() as $stand){ | ||
?> | ||
var cityCircle = new google.maps.Circle({ | ||
strokeColor: '#FF0000', | ||
strokeOpacity: 0.8, | ||
strokeWeight: 2, | ||
fillColor: '#FF0000', | ||
fillOpacity: 0.35, | ||
map: map, | ||
center: {lat: | ||
<?php | ||
echo $stand['occupied']['latitude']; | ||
?>, lng: | ||
<?php | ||
echo $stand['occupied']['longitude']; | ||
?>}, | ||
radius: 40 | ||
}); | ||
var mapLabel = new MapLabel({ | ||
text: "<?php echo $stand['occupied']['callsign'] ?>", | ||
position: new google.maps.LatLng( | ||
<?php | ||
echo $stand['occupied']['latitude']; | ||
?>, | ||
<?php | ||
echo $stand['occupied']['longitude']; | ||
?>), | ||
map: map, | ||
fontSize: 12, | ||
strokeWeight: 2 | ||
<html> | ||
<head> | ||
<!-- Boostrap 4 --> | ||
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" | ||
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" | ||
crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" | ||
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" | ||
crossorigin="anonymous"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" | ||
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" | ||
crossorigin="anonymous"></script> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" | ||
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | ||
|
||
<script src="//cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script> | ||
<link rel="stylesheet" href="//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"> | ||
|
||
<!-- GMaps & Labels --> | ||
<script src="https://maps.googleapis.com/maps/api/js?key="></script> | ||
<script src="js/maplabel-min.js"></script> | ||
|
||
<!-- Map Script --> | ||
<script> | ||
$(document).ready(function () { | ||
var center = {lat: 51.158, lng: -0.1820}; | ||
map = new google.maps.Map(document.getElementById('map'), { | ||
zoom: 14, | ||
mapTypeId: 'satellite', | ||
center: center, | ||
disableDefaultUI: true | ||
|
||
}); | ||
|
||
<? foreach($StandStatus->occupiedStands() as $stand){ ?> | ||
new google.maps.Circle({ | ||
strokeColor: '#FF0000', | ||
strokeOpacity: 0.8, | ||
strokeWeight: 2, | ||
fillColor: '#FF0000', | ||
fillOpacity: 0.35, | ||
map: map, | ||
center: { | ||
lat: <?= $stand->occupier->latitude; ?>, | ||
lng: <?= $stand->occupier->longitude; ?> | ||
}, | ||
radius: 40 | ||
}); | ||
new MapLabel({ | ||
text: "<?= $stand->occupier->callsign ?>", | ||
position: new google.maps.LatLng( | ||
<?= $stand->occupier->latitude;?>, | ||
<?= $stand->occupier->longitude; ?> | ||
), | ||
map: map, | ||
fontSize: 12, | ||
strokeWeight: 2 | ||
}); | ||
<? } ?> | ||
|
||
$('#standsTable').DataTable(); | ||
}); | ||
<?php | ||
} | ||
|
||
?> | ||
var cityCircle = new google.maps.Circle({ | ||
strokeColor: '#FF0000', | ||
strokeOpacity: 0.8, | ||
strokeWeight: 2, | ||
fillColor: '#FF0000', | ||
fillOpacity: 0.35, | ||
map: map, | ||
center: {lat: 19.505434, lng:-98.919304}, | ||
radius: 100000 | ||
}); | ||
|
||
}); | ||
</script> | ||
<div id="map" style="height: 500px;width: 700px;"></div> | ||
|
||
|
||
<table border="1"> | ||
<tr> | ||
<th>Stand</th> | ||
<th>Occupied</th> | ||
</tr> | ||
<?php | ||
foreach($StandStatus->occupiedStands() as $stand){ | ||
?> | ||
<tr> | ||
<td><?php echo $stand['id'] ?></td> | ||
<td><?php echo $stand['occupied']['callsign'] ?></td> | ||
</tr> | ||
<?php | ||
} | ||
|
||
?> | ||
</table> | ||
|
||
|
||
<table border="1"> | ||
<tr> | ||
<th>Stand</th> | ||
<th>Lat</th> | ||
<th>Long</th> | ||
</tr> | ||
<?php | ||
foreach ($StandStatus->allStands() as $stand) { | ||
|
||
?> | ||
<tr> | ||
<td><?php echo $stand['id'] ?></td> | ||
<td><?php echo $stand['latcoord'] ?></td> | ||
<td><?php echo $stand['longcoord'] ?></td> | ||
<td><?php | ||
if (isset($stand['occupied']['callsign'])){ | ||
echo $stand['occupied']['callsign']; | ||
} | ||
?></td> | ||
</tr> | ||
<?php | ||
|
||
} | ||
?> | ||
</table> | ||
|
||
<div> | ||
<ul> | ||
<?php | ||
foreach($StandStatus->aircraftSearchResults as $pilot){ | ||
echo "<li>" . $pilot['callsign'] . "</li> " . $pilot['latitude'] . " BY " . $pilot['longitude']; | ||
} | ||
?> | ||
</ul> | ||
</script> | ||
|
||
|
||
</head> | ||
<body> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-12 col-md-2 d-flex flex-column justify-content-center"> | ||
<h5>Occupied Stands</h5> | ||
<table class="table table-responsive table-sm text-center align-self-center"> | ||
<tr> | ||
<th>Stand</th> | ||
<th>Occupied By</th> | ||
</tr> | ||
<?php | ||
foreach ($StandStatus->occupiedStands() as $stand) { | ||
?> | ||
<tr> | ||
<td><?= $stand->getName() ?></td> | ||
<td><?= $stand->occupier->callsign ?></td> | ||
</tr> | ||
<?php | ||
} | ||
|
||
?> | ||
</table> | ||
</div> | ||
<div class="col"> | ||
<div id="map" style="height: 500px;width: 100%;"></div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col d-flex flex-column justify-content-center"> | ||
<h5>All Stands</h5> | ||
<table id="standsTable" class="table table-responsive table-sm text-center align-self-center"> | ||
<thead> | ||
<tr> | ||
<th>Stand</th> | ||
<th>Latitude</th> | ||
<th>Longitude</th> | ||
<th>Occupier</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<? foreach ($StandStatus->stands() as $stand) { ?> | ||
<tr> | ||
<td><?= $stand->getName() ?></td> | ||
<td><?= $stand->latitude ?></td> | ||
<td><?= $stand->longitude ?></td> | ||
<td><? echo $stand->isOccupied() ? $stand->occupier->callsign : null ?></td> | ||
</tr> | ||
<? } ?> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="col"> | ||
<h5>Aircraft On The Ground</h5> | ||
<div class="row"> | ||
<?php | ||
foreach ($StandStatus->getAllAircraft() as $pilot) { | ||
if($pilot->onStand()){ | ||
echo "<div class='col-5 bg-primary m-1 text-white'>{$pilot->callsign} ({$pilot->latitude},{$pilot->longitude}) (Stand {$pilot->getStandIndex()})</div>"; | ||
}else{ | ||
echo "<div class='col-5 bg-light m-1'>{$pilot->callsign} ({$pilot->latitude},{$pilot->longitude}) (Not on stand)</div>"; | ||
} | ||
} | ||
?> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.