nabeelio / phpvms

virtual airline management
http://www.phpvms.net
Other
169 stars 138 forks source link

Simbrief Fleet Assignments #922

Closed trevorhannant closed 3 years ago

trevorhannant commented 3 years ago

When testing an installation of the software, I created:

When proceeding to the Simbrief flight planning form, the aircraft dropdown list still requires selection from the full listing of sub-fleets.

Request that this list be:

FatihKoz commented 3 years ago

Currently I am working on SimBrief flight planning form which includes a solution for this request too ... If the airline db is correctly configured then selecting assigned subfleet/subfleets (and its/their members) for flight planning is not a big deal.

Basically you need to have a registration and a correct ICAO type designator for all your aircrafts 'cause SimBrief uses the ICAO type designator to identify your aircraft type for fuel planning (unless you specify full aircraft specs to their system via the api).

Anyway, I will provide my solution soon.

nabeelio commented 3 years ago

If you have that ICAO list, I can add the colums to populate it per-aircraft in the admin panel or CSV

FatihKoz commented 3 years ago

I do not have the full icao type designator list, never needed it to be honest ... But having a complete list embedded to a database or csv would not solve the issue 'cause in the end it will be the users responsbility to choose the correct one for his/her aircraft. (we can not automate this process)

Also the biggest problem here is at SimBrief side because they do not support all aircrafts at the moment and sending a non-recognized or non-supported icao type will broke the api process.

For example, ICAO designator of A321 NEO is A21N, we can use this value in our databases but sending this code to SimBrief would not work. Either you have to choose a similar type like A321 or send your full aircraft details as json string to force the system to make an approximate fuel calculation with the details you provided. (Same applies to A320 Neo and B737 MAX series too)

To overcome this little problem, I choosed to use the correct designator at my database and write a simple code to change it within the form itself to a supported one (simple if clause to change A21N to A321)

Either way, to provide a simple solution for this issue ;

  1. Flights must have an at least one subfleet assigned to them
  2. That subfleet must have some aircrafts in it
  3. Aircrafts must have proper ICAO type designator values (https://en.wikipedia.org/wiki/List_of_aircraft_type_designators)

I am still working on my code, actually working to transfer it to the default template ;) Will attach the file to here if it is allowed.

FatihKoz commented 3 years ago

Hi again @nabeelio ,

A simplified version of my default view simbrief form is attached. Did not wanted to create a pull request directly 'cause I am not familiar with its usage and rules etc.

What I did ;

  1. Used an sql code (with laravel syntax) to retrieve data from subfleet and aircraft tables to generate the option values for selection
  2. Used some tiny Javascripts to read the values, correct and assign them to proper form fields (icao designator, registration and flight date field)
  3. Provided a simple solution for A320 NEO and A321 NEO, they will use classic A320 and A321 codes.
  4. Added Route and Flight Level form fields
  5. Disabled some fixed time values (not deleted them just disabled) 'cause we need them to be proper times not just fixed values (Scheduled dep time, Scheduled enroute time)
  6. Added some fixed hidden form fields to use automatic SID/STAR options of SimBrief

Hope it helps.

simbrief-1

simbrief-2

Update : This is now a PR , please check https://github.com/nabeelio/phpvms/pull/949 if required.

wbox commented 3 years ago

I do not have the full icao type designator list, never needed it to be honest ... But having a complete list embedded to a database or csv would not solve the issue 'cause in the end it will be the users responsbility to choose the correct one for his/her aircraft. (we can not automate this process)

Also the biggest problem here is at SimBrief side because they do not support all aircrafts at the moment and sending a non-recognized or non-supported icao type will broke the api process.

For example, ICAO designator of A321 NEO is A21N, we can use this value in our databases but sending this code to SimBrief would not work. Either you have to choose a similar type like A321 or send your full aircraft details as json string to force the system to make an approximate fuel calculation with the details you provided. (Same applies to A320 Neo and B737 MAX series too)

To overcome this little problem, I choosed to use the correct designator at my database and write a simple code to change it within the form itself to a supported one (simple if clause to change A21N to A321)

Either way, to provide a simple solution for this issue ;

  1. Flights must have an at least one subfleet assigned to them
  2. That subfleet must have some aircrafts in it
  3. Aircrafts must have proper ICAO type designator values (https://en.wikipedia.org/wiki/List_of_aircraft_type_designators)

I am still working on my code, actually working to transfer it to the default template ;) Will attach the file to here if it is allowed.

I believe using their API is possible to designate a different type of aircraft. Check this -> https://www.simbrief.com/forum/viewtopic.php?f=6&t=243&sid=ff66d7303872dabb71f062580c22b07c

FatihKoz commented 3 years ago

Much easier way is to create a user defined airframe in simbrief and use it as the simbrief aircraft type ... Either solution have to be applied by the end user.

I prefer having a user defined airframe in my simbrief account 'cause it gives me the ability to fine tune the fuel burn and flight level capping adjustments.

In my setup, I defined A320 NEO and A321 NEO at Simbrief Fleet section and using their simbrief id's in the form instead of converting them to A320/A321's.

@php
  $simbrieftype = $acdetails->icao ;
  if($acdetails->icao == 'A20N') { $simbrieftype = 'my_verylongidfora320N' ; }
  if($acdetails->icao == 'A21N') { $simbrieftype = 'my_anotherlongidfora321N' ; }
@endphp

And later down in the code, I am sending the $simbrieftype to simbrief.

<input type="hidden" id="type" name="type" value="{{ $simbrieftype }}"/>

FatihKoz commented 3 years ago

With the latest dev build including the improved simbrief planning system, this issue may be closed.