cycle_analyst_logger 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.rdoc +0 -0
- data/Rakefile +0 -0
- data/cycle_analyst_logger.gemspec +0 -0
- data/cycle_analyst_logger.rdoc +0 -0
- data/lib/cycle_analyst_logger.rb +0 -0
- data/lib/cycle_analyst_logger/cli.rb +4 -1
- data/lib/cycle_analyst_logger/cycle_analyst.rb +12 -3
- data/lib/cycle_analyst_logger/gli_patch.rb +0 -0
- data/lib/cycle_analyst_logger/gps.rb +5 -4
- data/lib/cycle_analyst_logger/gpx.rb +0 -0
- data/lib/cycle_analyst_logger/version.rb +1 -1
- data/todo.txt +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e885a854ee604b2fcc3de0f076020ad88e30972
|
4
|
+
data.tar.gz: 938b370409f465698bbd7f2bde1706c4280b13b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebbdd12998582bdce46f83954b3972efd2b94279d2e54386723cd75eb3e73d034b4a0a81ef59c75f775284d15242b09b7cc01678010c163811b280b4294e7eb9
|
7
|
+
data.tar.gz: d63f206c042bce110754866f846cd2b68b306741082bbcdca8eb06650a6ec8bc8ce983e069cc455fccfca97ab93f31c64b2eb9362c6e6c0389d09718460e72f7
|
data/.gitignore
CHANGED
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.rdoc
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
File without changes
|
data/cycle_analyst_logger.rdoc
CHANGED
File without changes
|
data/lib/cycle_analyst_logger.rb
CHANGED
File without changes
|
@@ -71,9 +71,12 @@ module CycleAnalystLogger
|
|
71
71
|
|
72
72
|
desc 'Log the Cycle Analyst and optionally GPS and Phaserunner to a file'
|
73
73
|
command :log do |log|
|
74
|
+
log.desc 'Disable writing raw nmea to its own file'
|
75
|
+
log.default_value false
|
76
|
+
log.switch [:disable_nmea_out]
|
74
77
|
log.action do |global_options, options, args|
|
75
78
|
cycle_analyst = CycleAnalyst.new(global_options)
|
76
|
-
cycle_analyst.get_logs(loop_count, quiet)
|
79
|
+
cycle_analyst.get_logs(loop_count, quiet, options[:disable_nmea_out])
|
77
80
|
end
|
78
81
|
end
|
79
82
|
|
@@ -97,11 +97,20 @@ module CycleAnalystLogger
|
|
97
97
|
# @param output_fd [File] File Descriptor of the output file to write to. Don't write to file if nil
|
98
98
|
# @param loop_count [Integer, Symbol] Number of lines to output, or forever if :forever
|
99
99
|
# @param quite [Boolean] Don't output to stdout if true
|
100
|
-
def get_logs(loop_count, quiet)
|
101
|
-
|
100
|
+
def get_logs(loop_count, quiet, disable_nmea_out)
|
101
|
+
timestamp = Time.now.strftime('%Y-%m-%d_%H-%M-%S')
|
102
|
+
filename = "cycle_analyst.#{timestamp}.csv"
|
102
103
|
output_fd = File.open(filename, 'w')
|
103
104
|
|
104
|
-
|
105
|
+
if enable_gps
|
106
|
+
unless disable_nmea_out
|
107
|
+
nmea_filename = "nmea.#{timestamp}.txt"
|
108
|
+
nmea_fd = File.open(nmea_filename, 'w')
|
109
|
+
else
|
110
|
+
nmea_fd = nil
|
111
|
+
end
|
112
|
+
gps_thread = Thread.new { gps.run(nmea_fd, disable_nmea_out) }
|
113
|
+
end
|
105
114
|
|
106
115
|
line_number = 0
|
107
116
|
hdr = %Q(Timestamp,#{log_header})
|
File without changes
|
@@ -41,10 +41,11 @@ module CycleAnalystLogger
|
|
41
41
|
@source_decoder = NMEAPlus::SourceDecoder.new(@serial_io)
|
42
42
|
end
|
43
43
|
|
44
|
-
def run
|
44
|
+
def run(fd = nil, disable_nmea_out = false)
|
45
45
|
source_decoder.each_complete_message do |message|
|
46
|
-
|
47
|
-
|
46
|
+
fd.puts message.original.strip unless disable_nmea_out
|
47
|
+
case message.data_type[2..-1] # Ignore the first two letters
|
48
|
+
when 'GGA'
|
48
49
|
pre_data[:time] = message.fix_time
|
49
50
|
pre_data[:latitude] = message.latitude
|
50
51
|
pre_data[:longitude] = message.longitude
|
@@ -55,7 +56,7 @@ module CycleAnalystLogger
|
|
55
56
|
pre_data[:horizontal_dilution] = message.horizontal_dilution
|
56
57
|
pre_data[:satellites] = message.satellites
|
57
58
|
pre_data[:seconds_since_last_update] = message.seconds_since_last_update
|
58
|
-
when '
|
59
|
+
when 'VTG'
|
59
60
|
pre_data[:speed_kmh] = message.speed_kmh
|
60
61
|
pre_data[:speed_knots] = message.speed_knots
|
61
62
|
pre_data[:faa_mode] = message.faa_mode
|
File without changes
|
data/todo.txt
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cycle_analyst_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert J. Berger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|