Skip to content
This repository has been archived by the owner on Oct 20, 2024. It is now read-only.

2024-02 #164

Merged
merged 11 commits into from
Jul 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change information metar and bug fix
alexcaussades committed Jul 28, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 846f6f50fb47672eb811446fcc71d816476ed3b6
19 changes: 18 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
@@ -3,7 +3,9 @@
namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use App\Http\Controllers\CarteSIAController;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Http;

class Kernel extends ConsoleKernel
{
@@ -12,7 +14,17 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
$schedule->call(function () {
$airac = new CarteSIAController();
$new_airac = $airac->config_Date();
$dateairac = $airac->checkdate();
$date = date("Y-m-d");
if ($new_airac == $date) {
http::post(env("Webhook_url_Airac_Info"), [
"content" => " :warning: Nouvelle Airac disponible version 2024-".$dateairac." :warning: ",
]);
}
})->dailyAt("12:50")->timezone($this->scheduleTimezone());
}

/**
@@ -24,4 +36,9 @@ protected function commands(): void

require base_path('routes/console.php');
}

protected function scheduleTimezone(): string
{
return 'Europe/Paris';
}
}
73 changes: 49 additions & 24 deletions app/Http/Controllers/metarController.php
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@
namespace App\Http\Controllers;

use DateTime;
use GuzzleHttp\Psr7\Response;
use Illuminate\Http\Request;
use Illuminate\Support\Env;
use Illuminate\Support\Facades\Http;
@@ -277,40 +278,64 @@ public function metar($icao)
$whazzup = new whazzupController();
$metar = $whazzup->Get_metar($icao);
$metar = json_decode($metar);
$temp = $this->temp_qnh($metar->metar);
$winds = $this->winds($metar->metar);
$visibility = $this->visibility($metar->metar);
$clouds = $this->clouds($metar->metar) ?? "None";
$station = $this->station($metar->metar);
$times = $this->time($metar->metar);
$tempo = $this->tempo($metar->metar);
$info = $metar->statusCode ?? 200;
if($info == 200 ){
$temp = $this->temp_qnh($metar->metar) ?? "None";
$winds = $this->winds($metar->metar) ?? "None";
$visibility = $this->visibility($metar->metar) ?? "None";
$clouds = $this->clouds($metar->metar) ?? "None";
$station = $this->station($metar->metar) ?? "None";
$times = $this->time($metar->metar) ?? "None";
$tempo = $this->tempo($metar->metar) ?? "None";


$r = [
'metar' => $metar->metar,
'station' => $station,
'visibility' => $visibility ?? "None",
'flight_rules' => "None",
"QNH" => $temp["qnh"] ?? "None",
"tempo" => $tempo ?? null,
"wind" => [
"wind" => $winds["direction"] ?? "None",
"direction" => $winds["direction"] ?? "None",
"wind_variable" => $winds["variable"] ?? "None",
"speed_KT" => $winds["winds"] ?? "None",
"speed_KM" => $winds["winds_KM"],
],
"temperature" => $temp["temp"]["temp"] ?? "None",
"dewpoint" => $temp["temp"]["dewpoint"] ?? "None",
"clouds" => $clouds ?? "None",
"meta_day" => [
"time" => $times. " Z"
],
];
}else{
$r = [
'metar' => $metar->metar,
'station' => $station,
'visibility' => $visibility ?? "None",
'flight_rules' => "None",
"QNH" => $temp["qnh"] ?? "None",
"tempo" => $tempo ?? null,
'metar' => "Not Found",
'station' => "Not Found",
'visibility' => "Not Found",
'flight_rules' => "Not Found",
"QNH" => "Not Found",
"tempo" => "Not Found",
"wind" => [
"wind" => $winds["direction"] ?? "None",
"direction" => $winds["direction"] ?? "None",
"wind_variable" => $winds["variable"] ?? "None",
"speed_KT" => $winds["winds"] ?? "None",
"speed_KM" => $winds["winds_KM"],
"wind" => "Not Found",
"direction" => "Not Found",
"wind_variable" => "Not Found",
"speed_KT" => "Not Found",
"speed_KM" => "Not Found",
],
"temperature" => $temp["temp"]["temp"] ?? "None",
"dewpoint" => $temp["temp"]["dewpoint"] ?? "None",
"clouds" => $clouds ?? "None",
"temperature" => "Not Found",
"dewpoint" => "Not Found",
"clouds" => "Not Found",
"meta_day" => [
"time" => $times. " Z"
"time" => "Not Found"
],
];


}
return $r;
}


public function taf($icao)
{
1,004 changes: 536 additions & 468 deletions composer.lock

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion database/changelog.json
Original file line number Diff line number Diff line change
@@ -304,7 +304,7 @@
"13": {
"id": 14,
"name": "2024 / 02",
"date": "2024-07-23",
"date": "2024-07-31",
"version": "26.3.1",
"option": [
{
@@ -354,6 +354,18 @@
"type": "Feature",
"btn": "success",
"description": "activation pages ATC on the metar plateforme page"
},
{
"id": 8,
"type": "Bug Fix",
"btn": "danger",
"description": "Fixing the metar page fot plateforme is not metar display"
},
{
"id": 9,
"type": "Feature",
"btn": "success",
"description": "Information new airac ont the push notification on discord"
}
]
}
1 change: 0 additions & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
@@ -639,4 +639,3 @@

})->name("test");
});