Ignore:
Timestamp:
Aug 29, 2017, 6:19:00 PM (9 years ago)
Author:
Joachim Langenbach <joachim.langenbach@…>
Branches:
0.5, debian/bullseye, debian/jessie, master
Children:
89c510f
Parents:
fc63b30
Message:

First more or less working version of visualising logfiles on the map

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php

    rfc63b30 r008bce9  
    1919namespace GnuBoat\Nmea\Nmea0183;
    2020
     21/**
     22 * @brief NMEA0183 RMC Naviation sentence
     23 *
     24 * Keep in mind, that the latitude() and longitude() is converted to +/- values
     25 */
    2126class Nmea0183Rmc extends Nmea0183Sentence
    2227{
    … …  
    4954                if($content[2] == 'A')
    5055                        $this->_status = Nmea0183RmcStatus::A;
    51                        
    52                 $this->_latitude = $content[3];
    53                 $this->_latitudeDirection = Nmea0183Rmc::directionToEnum($content[4]);
    5456               
    55                 $this->_longitude = $content[5];
    56                 $this->_longitudeDirection = Nmea0183Rmc::directionToEnum($content[6]);
     57                $this->_latitude = (float)$content[3];
     58                if(Nmea0183Rmc::directionToEnum($content[4]) == Nmea0183Direction::South)
     59                        $this->_latitude = $this->_latitude * -1;
    5760               
    58                 $this->_speedOverGround = $content[7];
     61                $this->_longitude = (float)$content[5];
     62                if(Nmea0183Rmc::directionToEnum($content[6]) == Nmea0183Direction::West)
     63                        $this->_longitude = $this->_longitude * -1;
    5964               
    60                 $this->_courseOverGround = $content[8];
     65                $this->_speedOverGround = (float)$content[7];
    6166               
    62                 $this->_magneticDeclination = $content[10];
     67                $this->_courseOverGround = (float)$content[8];
     68               
     69                $this->_magneticDeclination = (float)$content[10];
    6370                $this->_magneticDeclinationDirection = Nmea0183Rmc::directionToEnum($content[11]);
    6471               
    … …  
    8289        }
    8390       
     91        /**
     92         * @brief Latitude with North (+) and South (-)
     93         */
    8494        public function latitude()
    8595        {
    … …  
    8797        }
    8898       
    89         public function latitudeDirection()
    90         {
    91                 return $this->_latitudeDirection;
    92         }
    93        
     99        /**
     100         * @brief Longitude with East (+) and West (-)
     101         */
    94102        public function longitude()
    95103        {
    96104                return $this->_longitude;
    97         }
    98 
    99         public function longitudeDirection()
    100         {
    101                 return $this->_longitudeDirection;
    102105        }
    103106       
    … …  
    162165        private $_status;
    163166        private $_latitude;
    164         private $_latitudeDirection;
    165167        private $_longitude;
    166         private $_longitudeDirection;
    167168        private $_speedOverGround;
    168169        private $_courseOverGround;
Note: See TracChangeset for help on using the changeset viewer.