Save PIREP route to ACARS data table #102
This commit is contained in:
15
app/Database/factories/NavdataFactory.php
Normal file
15
app/Database/factories/NavdataFactory.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
use \App\Models\Enums\NavaidType;
|
||||
|
||||
$factory->define(App\Models\Navdata::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => substr($faker->unique()->word, 0, 5),
|
||||
'name' => $faker->unique()->text(10),
|
||||
'type' => $faker->randomElement([NavaidType::VOR, NavaidType::NDB]),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'freq' => $faker->randomFloat(2, 100, 1000),
|
||||
];
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Navpoint::class, function (Faker $faker) {
|
||||
return [
|
||||
'id' => $faker->unique()->numberBetween(10, 100000),
|
||||
'name' => $faker->unique()->text(10),
|
||||
'title' => $faker->unique()->text(25),
|
||||
'airway' => $faker->unique()->text(7),
|
||||
'lat' => $faker->latitude,
|
||||
'lon' => $faker->longitude,
|
||||
'freq' => $faker->randomFloat(2, 100, 1000),
|
||||
];
|
||||
});
|
||||
@@ -28,6 +28,7 @@ class CreatePirepTables extends Migration
|
||||
$table->string('dpt_airport_id', 5);
|
||||
$table->string('arr_airport_id', 5);
|
||||
$table->unsignedInteger('altitude')->nullable();
|
||||
$table->unsignedInteger('level')->nullable();
|
||||
$table->unsignedDecimal('flight_time', 19)->nullable();
|
||||
$table->unsignedDecimal('planned_flight_time', 19)->nullable();
|
||||
$table->unsignedDecimal('gross_weight', 19)->nullable();
|
||||
|
||||
@@ -18,7 +18,7 @@ class CreateNavdataTables extends Migration
|
||||
* https://github.com/skiselkov/openfmc/blob/master/airac.h
|
||||
*/
|
||||
Schema::create('navdata', function (Blueprint $table) {
|
||||
$table->string('id', 4);
|
||||
$table->string('id', 5);
|
||||
$table->string('name', 24);
|
||||
$table->unsignedInteger('type');
|
||||
$table->float('lat', 7, 4)->default(0.0);
|
||||
|
||||
@@ -17,6 +17,8 @@ class CreateAcarsTables extends Migration
|
||||
$table->string('id', 12);
|
||||
$table->string('pirep_id', 12);
|
||||
$table->unsignedTinyInteger('type');
|
||||
$table->unsignedInteger('nav_type')->nullable();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('log')->nullable();
|
||||
$table->float('lat', 7, 4)->default(0.0);
|
||||
$table->float('lon', 7, 4)->default(0.0);
|
||||
|
||||
@@ -280,6 +280,7 @@ pireps:
|
||||
user_id: 1
|
||||
airline_id: 1
|
||||
flight_id: flightid_1
|
||||
flight_number: 100
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KAUS
|
||||
arr_airport_id: KJFK
|
||||
@@ -293,6 +294,7 @@ pireps:
|
||||
user_id: 1
|
||||
airline_id: 1
|
||||
flight_id: flightid_2
|
||||
flight_number: 101
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
@@ -306,6 +308,7 @@ pireps:
|
||||
user_id: 1
|
||||
airline_id: 1
|
||||
flight_id: flightid_2
|
||||
flight_number: 101
|
||||
aircraft_id: 1
|
||||
dpt_airport_id: KJFK
|
||||
arr_airport_id: KAUS
|
||||
|
||||
Reference in New Issue
Block a user