VBV001

Arrival Time

Recommended Posts

Hello everybody,

Just a quick questions about the est arrival time. On the picture the top 3 pilots

are usinf smartCARS, the rest KAcars or the IPS system. The arrivaltimes by users

of smartCARS are always off till you are on the approach then they are changing.

Does somebody has any idea to fix this.

As always with regards,

Cor

 

Clipboard01.jpg

Share this post


Link to post
Share on other sites
On 4/8/2018 at 5:56 AM, VBV001 said:

Hello everybody,

Just a quick questions about the est arrival time. On the picture the top 3 pilots

are usinf smartCARS, the rest KAcars or the IPS system. The arrivaltimes by users

of smartCARS are always off till you are on the approach then they are changing.

Does somebody has any idea to fix this.

As always with regards,

Cor

 

Clipboard01.jpg

I'm not entirely sure what you mean? what does smartCARS report in-app as the arrival time or TTG?

Share this post


Link to post
Share on other sites

Hi Joshua

Take Larry McFadden. Systemtime is 12:50 UTC (14:50 server time). He still has a est arrivaltime of 12:00.

That is the time what is written in de Acarsdata of PHPVMS. Like V-Bird ACARS (KAcars) that time is changing

every step of the flight. I looked it up in the file and I think it is this part in the KAcars module.

 

# Estimate the time remaining
                        if($xml->liveupdate->groundSpeed > 80) {
                            $Minutes = round($dist_remain / $xml->liveupdate->groundSpeed * 60);
                            $time_remain = self::ConvertMinutes2Hours($Minutes);
                            $time = date("H:i:s");
                            $time_arr = ($time - $time_remain);
                        } else {
                            $time_remain = '00:00';
                        }
                        
                        $TR = explode(':', $time_remain);                        
                        $arrtime = mktime(date("H")+$TR[0], date("i")+$TR[1]);                        
                        $arrtime = date("H:i", $arrtime);

 

The same with the IPS system

function GetArrtUnix($distodes, $gs, $status) {
    $currtime = '';
    if ($gs <= 40)
    {
        $currtime = '';
    }
    else
    {
        $currtime = time();
        $tmp = $distodes / $gs;
        $tmp2 = $tmp * 60;
        $tmp3 = $tmp2 % 60;
        $tmp = $tmp2 - $tmp3;
        $tmp2 = $tmp / 60;
        if ($status == "A") $tmp3 = $tmp3 - 20;
        if ($status == "C") $tmp3 = $tmp3 - 10;
        if ($status == "R") $tmp3 = $tmp3 + 10;
        if ($status == "E") $tmp3 = $tmp3 + 10;
        if ($status == "I") $tmp3 = $tmp3 + 5;
        if ($status == "F") $tmp3 = $tmp3 + 3;
        if ($status == "L") $tmp3 = $tmp3 + 1;
        $tmp3 = ($tmp3 + ($tmp2 * 60)) * 60;
        $currtime += round($tmp3);
    }
    return $currtime;
}

The last pilot in the picture Isaac Conwell is using IPS and the arrival time

is the Dutch time which 16:22 UTC.

Hope you got the info you need.

Regards,


Cor

 

Share this post


Link to post
Share on other sites
14 hours ago, VBV001 said:

Hi Joshua

Take Larry McFadden. Systemtime is 12:50 UTC (14:50 server time). He still has a est arrivaltime of 12:00.

That is the time what is written in de Acarsdata of PHPVMS. Like V-Bird ACARS (KAcars) that time is changing

every step of the flight. I looked it up in the file and I think it is this part in the KAcars module.

 

# Estimate the time remaining
                        if($xml->liveupdate->groundSpeed > 80) {
                            $Minutes = round($dist_remain / $xml->liveupdate->groundSpeed * 60);
                            $time_remain = self::ConvertMinutes2Hours($Minutes);
                            $time = date("H:i:s");
                            $time_arr = ($time - $time_remain);
                        } else {
                            $time_remain = '00:00';
                        }
                        
                        $TR = explode(':', $time_remain);                        
                        $arrtime = mktime(date("H")+$TR[0], date("i")+$TR[1]);                        
                        $arrtime = date("H:i", $arrtime);

 

The same with the IPS system

function GetArrtUnix($distodes, $gs, $status) {
    $currtime = '';
    if ($gs <= 40)
    {
        $currtime = '';
    }
    else
    {
        $currtime = time();
        $tmp = $distodes / $gs;
        $tmp2 = $tmp * 60;
        $tmp3 = $tmp2 % 60;
        $tmp = $tmp2 - $tmp3;
        $tmp2 = $tmp / 60;
        if ($status == "A") $tmp3 = $tmp3 - 20;
        if ($status == "C") $tmp3 = $tmp3 - 10;
        if ($status == "R") $tmp3 = $tmp3 + 10;
        if ($status == "E") $tmp3 = $tmp3 + 10;
        if ($status == "I") $tmp3 = $tmp3 + 5;
        if ($status == "F") $tmp3 = $tmp3 + 3;
        if ($status == "L") $tmp3 = $tmp3 + 1;
        $tmp3 = ($tmp3 + ($tmp2 * 60)) * 60;
        $currtime += round($tmp3);
    }
    return $currtime;
}

The last pilot in the picture Isaac Conwell is using IPS and the arrival time

is the Dutch time which 16:22 UTC.

Hope you got the info you need.

Regards,


Cor

 

@turbofandude thoughts?

Share this post


Link to post
Share on other sites

Hey Collin,

I will make a flight this coming weekend and I will try to document all stages of the

flight and how the arrival time is behaving. I think that is the good way to proceed

to see what is really happening.

I will report back on saturday or sunday.

Regards,

Cor

Share this post


Link to post
Share on other sites

Hey Guys,

Made a flight and made some screenshots from the flightboard as from the entry of the database. Held a close look on what happend. 

Preflght is good. Deptime and  arrtime is filled with the local time. In my case UTC +2. When you takeoff the parking breaks the deptime is filled with the UTC

time and the arrtime with the localtime. As soon as you take off and climbing the timeremaining is filled what it does correctly but the calculations does

not make sense.

When you land the arrtime is filled with the local time again.

I made 2 zipfiles 1 with the pics from the flightboard and 1 with the database entry. 

Isaac Conwell also did the same flight and was behind me. His arrival times are good. He is using IPS.

Good luck and hopefully you find a solution for this.

Regards,


Cor

 

 

Database.zip

Flightboard.zip

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/1/2018 at 6:34 AM, VBV001 said:

Hi Guys,

Any info how I can change so the deptime will be UTC +2 ?

Regards,

 

Cor

Are you absolutely sure this is how the data is coming in? If so, it may require an update to the actual smartCARS client code to resolve.

  • Like 1

Share this post


Link to post
Share on other sites

Goodmorning Collin,

Thefore I took the screenshots from the database in serval parts of the flight. Preflight,  always the servertime (for us UTC + 2 )as dep and arrivaltime.

As soon as you take the parking breaks off UTC time als deptime but still as  arrtime the servertime. As soon as you take off the arrival time is changing

but the calculation does not make not any sense to me all the time 😂. See Clipboard03. Deptime 11:31 remaining time 2:55. Arrtime should be 14:26

and not 13:00.

Last week when i did a flight i manually changed the deptime in the database and it was direcly overwritten back to the orginally UTC deptime.

 

maybe it has also something to do what is written in the ACARSData.class.php like this part:

 

// Update times
                elseif($field === 'deptime' || $field === 'arrtime')
                {
                    /*    If undefined, set a default time to now (penalty for malformed data?)
                        Won't be quite accurate.... */
                    if($value == '') 
                    {
                        $value = time();
                    }
                    
                    $upd[] = "`{$field}`=FROM_UNIXTIME({$value})";
                }
                else 
                {                    
                    $upd[] = "`{$field}`='{$value}'";
                }
            }
            
            $upd = implode(',', $upd);
            $query='UPDATE '.TABLE_PREFIX."acarsdata 
                    SET {$upd} 
                    WHERE `id`='{$flight_id}'";
                        
            DB::query($query);
        }
        else
        {
            // form array with $ins[column]=value and then
            //    give it to quick_insert to finish
            $ins = array();
            $vals = array();
            
            foreach($data as $field => $value)
            {
                $ins[] = "`{$field}`";
                if($field === 'deptime' || $field === 'arrtime')
                {
                    if(empty($value)) $value = time();
                    $vals[] = "FROM_UNIXTIME({$value})";
                }
                elseif($field === 'lastupdate')
                {
                    $vals[] = 'NOW()';
                }
                else
                {
                    $value = DB::escape($value);
                    $vals[] = "'{$value}'";
                }
            }
                        
            $ins = implode(',', $ins);
            $vals = implode(',', $vals);
            
            $query = 'INSERT INTO '.TABLE_PREFIX."acarsdata ({$ins}) 
                        VALUES ({$vals})";
        
            DB::query($query);
            
            $data['deptime'] = time();
            $flight_id = DB::$insert_id;
        }

Hope this will help you.

 

Regards,

Cor

Share this post


Link to post
Share on other sites

It may be strangeness with the phpVMS functions, absolutely. I just checked the smartCARS desktop code, and both departure and arrival time are UTC-based. The arrival time estimate is generated by UTC departure time + estimated time remaining.

  • Like 1

Share this post


Link to post
Share on other sites

Is there any way to change this because it looks a little bit strange when you doing a flight together that one has a different time then the other.

From all the acars systems we use and have used is smartCARS the only one that uses UTC time.

Would be nice if that could be done, or can I change something in a script that would do the trick? :-)

Regards,
Cor

Share this post


Link to post
Share on other sites

You can definitely adjust it in the interface.php - I'd say just offset the departure/arrival time before it gets fed into anything. We use UTC in the client, the same way we send all data in lbs, nm, and knots, to ensure the data coming in is always the same scale/units.

Share this post


Link to post
Share on other sites

Goodmorning Collin,

As I am not a professional programmer (learnt a lot over the years but still very basic) can you help me with that

so I don´t mess it up😂

Some things I have changed already succesfully but this one for me is a difficult one;

Thank you in advance

Regards,

Cor

Share this post


Link to post
Share on other sites

Goodmorning,

Did not had the time to do this yet, but I all wanted you to know that this issue is no longer an issue anymore thanks to

Collin and his team.

Again thank you Collin and the rest of TFDI for the patience and the great support.

Regards,

Cor

  • Thanks 1

Share this post


Link to post
Share on other sites
On 9/26/2018 at 5:28 AM, VBV001 said:

Goodmorning,

Did not had the time to do this yet, but I all wanted you to know that this issue is no longer an issue anymore thanks to

Collin and his team.

Again thank you Collin and the rest of TFDI for the patience and the great support.

Regards,

Cor

I'm glad we were able to get something sorted for you!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.