- Timestamp:
- Aug 29, 2017, 6:19:00 PM (9 years ago)
- Branches:
- 0.5, debian/bullseye, debian/jessie, master
- Children:
- 89c510f
- Parents:
- fc63b30
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/webapp/webservice/inc/GnuBoat/Nmea/Nmea0183/Nmea0183Rmc.php
rfc63b30 r008bce9 19 19 namespace GnuBoat\Nmea\Nmea0183; 20 20 21 /** 22 * @brief NMEA0183 RMC Naviation sentence 23 * 24 * Keep in mind, that the latitude() and longitude() is converted to +/- values 25 */ 21 26 class Nmea0183Rmc extends Nmea0183Sentence 22 27 { … … 49 54 if($content[2] == 'A') 50 55 $this->_status = Nmea0183RmcStatus::A; 51 52 $this->_latitude = $content[3];53 $this->_latitudeDirection = Nmea0183Rmc::directionToEnum($content[4]);54 56 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; 57 60 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; 59 64 60 $this->_ courseOverGround = $content[8];65 $this->_speedOverGround = (float)$content[7]; 61 66 62 $this->_magneticDeclination = $content[10]; 67 $this->_courseOverGround = (float)$content[8]; 68 69 $this->_magneticDeclination = (float)$content[10]; 63 70 $this->_magneticDeclinationDirection = Nmea0183Rmc::directionToEnum($content[11]); 64 71 … … 82 89 } 83 90 91 /** 92 * @brief Latitude with North (+) and South (-) 93 */ 84 94 public function latitude() 85 95 { … … 87 97 } 88 98 89 public function latitudeDirection() 90 { 91 return $this->_latitudeDirection; 92 } 93 99 /** 100 * @brief Longitude with East (+) and West (-) 101 */ 94 102 public function longitude() 95 103 { 96 104 return $this->_longitude; 97 }98 99 public function longitudeDirection()100 {101 return $this->_longitudeDirection;102 105 } 103 106 … … 162 165 private $_status; 163 166 private $_latitude; 164 private $_latitudeDirection;165 167 private $_longitude; 166 private $_longitudeDirection;167 168 private $_speedOverGround; 168 169 private $_courseOverGround;
Note:
See TracChangeset
for help on using the changeset viewer.
