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) ⇒ 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) ⇒ GpsLog
Returns a new instance of GpsLog.
3 4 5 6 7 8 9 10 11 12 13 14 |
# 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 @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 end |
Instance Method Details
#csv_line ⇒ Object
48 49 50 |
# File 'lib/comtec-dr/gps_log.rb', line 48 def csv_line [lat, lon, speed, jst, msec, x_acceleration, y_acceleration, z_acceleration] end |
#jst ⇒ Object
28 29 30 |
# File 'lib/comtec-dr/gps_log.rb', line 28 def jst Time.parse "20#{@jst}}+0900" end |
#lat ⇒ Object
16 17 18 |
# File 'lib/comtec-dr/gps_log.rb', line 16 def lat (dmm_to_dms(@lat) * (@lat_sign == 'N' ? 1 : -1)).to_f end |
#lon ⇒ Object
20 21 22 |
# File 'lib/comtec-dr/gps_log.rb', line 20 def lon (dmm_to_dms(@lon) * (@lon_sign == 'E' ? 1 : -1)).to_f end |
#msec ⇒ Object
32 33 34 |
# File 'lib/comtec-dr/gps_log.rb', line 32 def msec @msec.to_i end |
#speed ⇒ Object
24 25 26 |
# File 'lib/comtec-dr/gps_log.rb', line 24 def speed @speed.to_i end |
#x_acceleration ⇒ Object
36 37 38 |
# File 'lib/comtec-dr/gps_log.rb', line 36 def x_acceleration @x_acceleration.to_f/1000 end |
#y_acceleration ⇒ Object
40 41 42 |
# File 'lib/comtec-dr/gps_log.rb', line 40 def y_acceleration @y_acceleration.to_f/1000 end |
#z_acceleration ⇒ Object
44 45 46 |
# File 'lib/comtec-dr/gps_log.rb', line 44 def z_acceleration @z_acceleration.to_f/1000 end |