Class: ComtecDR::GpsLog
- Inherits:
-
Object
- Object
- ComtecDR::GpsLog
- Defined in:
- lib/comtec-dr/gps_log.rb
Instance Method Summary collapse
- #csv_line ⇒ Object
-
#initialize(lat, lat_s, lon, lon_s, speed, jst, msec, x_a, y_a, z_a, filename) ⇒ GpsLog
constructor
A new instance of GpsLog.
- #jst ⇒ Object
- #lat ⇒ Object
- #lon ⇒ Object
- #msec ⇒ Object
- #speed ⇒ Object
- #x_acceleration ⇒ Object
- #y_acceleration ⇒ Object
- #z_acceleration ⇒ Object
Constructor Details
#initialize(lat, lat_s, lon, lon_s, speed, jst, msec, x_a, y_a, z_a, filename) ⇒ GpsLog
Returns a new instance of GpsLog.
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/comtec-dr/gps_log.rb', line 3 def initialize lat, lat_s, lon, lon_s, speed, jst, msec, x_a, y_a, z_a, filename @lat = lat @lat_sign = lat_s @lon = lon @lon_sign = lon_s @speed = speed @jst = jst @msec = msec @x_acceleration = x_a @y_acceleration = y_a @z_acceleration = z_a @filename = filename end |
Instance Method Details
#csv_line ⇒ Object
49 50 51 |
# File 'lib/comtec-dr/gps_log.rb', line 49 def csv_line [lat, lon, speed, jst, msec, x_acceleration, y_acceleration, z_acceleration, @filename] end |
#jst ⇒ Object
29 30 31 |
# File 'lib/comtec-dr/gps_log.rb', line 29 def jst Time.parse "20#{@jst}}+0900" end |
#lat ⇒ Object
17 18 19 |
# File 'lib/comtec-dr/gps_log.rb', line 17 def lat (dmm_to_dms(@lat) * (@lat_sign == 'N' ? 1 : -1)).to_f end |
#lon ⇒ Object
21 22 23 |
# File 'lib/comtec-dr/gps_log.rb', line 21 def lon (dmm_to_dms(@lon) * (@lon_sign == 'E' ? 1 : -1)).to_f end |
#msec ⇒ Object
33 34 35 |
# File 'lib/comtec-dr/gps_log.rb', line 33 def msec @msec.to_i end |
#speed ⇒ Object
25 26 27 |
# File 'lib/comtec-dr/gps_log.rb', line 25 def speed @speed.to_i end |
#x_acceleration ⇒ Object
37 38 39 |
# File 'lib/comtec-dr/gps_log.rb', line 37 def x_acceleration @x_acceleration.to_f/1000 end |
#y_acceleration ⇒ Object
41 42 43 |
# File 'lib/comtec-dr/gps_log.rb', line 41 def y_acceleration @y_acceleration.to_f/1000 end |
#z_acceleration ⇒ Object
45 46 47 |
# File 'lib/comtec-dr/gps_log.rb', line 45 def z_acceleration @z_acceleration.to_f/1000 end |