gps_pvt 0.10.1 → 0.10.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1191,7 +1191,12 @@ GANSSRefTimeInfo ::= SEQUENCE {
1191
1191
  GANSSTOD ::= INTEGER (0 .. 86399)
1192
1192
 
1193
1193
  -- GANSS TOD uncertainty
1194
- GANSSTODUncertainty ::= INTEGER (0 .. 127) -- Coding according to Annex
1194
+ GANSSTODUncertainty ::= INTEGER (0 .. 127) -- Coding according to Annex
1195
+
1196
+ -- GANSS Reference Time Rel-10 Extension:
1197
+ GANSSReferenceTime-R10-Ext ::= SEQUENCE {
1198
+ ganssDayCycleNumber INTEGER(0..7) -- coding according to annex
1199
+ }
1195
1200
 
1196
1201
  -- GANSS TOD-GSM Time association
1197
1202
  GANSSTOD-GSMTimeAssociation ::= SEQUENCE {
Binary file
@@ -26,6 +26,54 @@ ASN1::dig(upl, :ULP, :"ULP-PDU", :message, :msSUPLPOS, :posPayLoad, :rrlpPayload
26
26
  },
27
27
  })
28
28
 
29
+ ASN1::dig(upl, :"MAP-LCS-DataTypes", :"Ext-GeographicalInformation")[:type][1].merge!({
30
+ :hook_decode => proc{
31
+ gen_ut = proc{|c, x| proc{|k| ((x + 1) ** k - 1) * c} }
32
+ tbl_task = {
33
+ :lat => [3, proc{|v| Rational((v & 0x7FFFFF) * 90, 1 << 23).to_f * (((v >> 23) == 1) ? -1 : 1)}],
34
+ :lng => [3, proc{|v| Rational((v >= (1 << 23) ? v - (1 << 24) : v) * 180, 1 << 23).to_f}],
35
+ :ucode => 1,
36
+ :usmaj => [1, gen_ut.call(10, 0.1)],
37
+ :usmin => [1, gen_ut.call(10, 0.1)],
38
+ :omaj => 1,
39
+ :cnf => 1,
40
+ :alt => [2, proc{|v| (v & 0x7FFF) * (((v >> 15) == 1) ? -1 : 1)}],
41
+ :ualt => [1, gen_ut.call(45, 0.025)],
42
+ :irad => [2, proc{|v| v * 5}],
43
+ :urad => [1, gen_ut.call(10, 0.1)],
44
+ :oang => [1, proc{|v| v * 2}],
45
+ :iang => [1, proc{|v| (v + 1) * 2}],
46
+ }
47
+ tbl_item = { # 7.2 Table 2a in 3GPP TS 23.032
48
+ # (a) 7.3.2 Ellipsoid point with uncertainty Circle
49
+ 1 => [8, :lat, :lng, :ucode],
50
+ # (b) 7.3.3 Ellipsoid point with uncertainty Ellipse
51
+ 3 => [11, :lat, :lng, :usmaj, :usmin, :omaj, :cnf],
52
+ # (c) 7.3.6 Ellipsoid point with altitude and uncertainty Ellipsoid
53
+ 9 => [14, :lat, :lng, :alt, :usmaj, :usmin, :omaj, :ualt, :cnf],
54
+ # (d) 7.3.7 Ellipsoid Arc
55
+ 10 => [13, :lat, :lng, :irad, :urad, :oang, :iang, :cnf],
56
+ # (e) 7.3.1 Ellipsoid Point
57
+ 0 => [7, :lat, :lng],
58
+ }
59
+ proc{|data|
60
+ data.define_singleton_method(:decode){
61
+ len, *items = tbl_item[self[0] >> 4]
62
+ next nil unless self.length == len
63
+ offset = 1
64
+ Hash[*(items.collect{|k|
65
+ len2, task = tbl_task[k]
66
+ v = self.slice(offset, len2).inject(0){|res, v2| (res << 8) + v2}
67
+ v = task.call(v) if task
68
+ offset += len2
69
+ [k, v]
70
+ }.flatten(1))]
71
+ }
72
+ data
73
+ }
74
+ }.call,
75
+ })
76
+
29
77
  # LPP payload conversion
30
78
  ASN1::dig(upl, :ULP, :"ULP-PDU", :message, :msSUPLPOS, :posPayLoad, :"ver2-PosPayLoad-extension", :lPPPayload)[:type][1].merge!({
31
79
  :hook_encode => proc{|data|
data/lib/gps_pvt/util.rb CHANGED
@@ -88,9 +88,15 @@ module Util
88
88
  end
89
89
  nil
90
90
  }.call
91
- is_file = src.kind_of?(File) || src.kind_of?(Tempfile)
92
91
 
93
- return src.path if ((!compressed) and is_file)
92
+ case src
93
+ when File
94
+ next src.path
95
+ when Tempfile
96
+ # Preserve tempfile after leaving open-uri block
97
+ src.define_singleton_method(:close!){close(false)}
98
+ next src # Kernel.open(obj) redirects to obj.open if obj responds to :open
99
+ end unless compressed
94
100
 
95
101
  Tempfile::open(File::basename($0, '.*')){|dst|
96
102
  dst.binmode
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GPS_PVT
4
- VERSION = "0.10.1"
4
+ VERSION = "0.10.3"
5
5
 
6
6
  def GPS_PVT.version_compare(a, b)
7
7
  Gem::Version::new(a) <=> Gem::Version::new(b)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gps_pvt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - fenrir(M.Naruoka)
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-03-28 00:00:00.000000000 Z
11
+ date: 2024-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyserial
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: yard
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
83
97
  - !ruby/object:Gem::Dependency
84
98
  name: github_changelog_generator
85
99
  requirement: !ruby/object:Gem::Requirement
@@ -168,12 +182,14 @@ files:
168
182
  - lib/gps_pvt/ntrip.rb
169
183
  - lib/gps_pvt/receiver.rb
170
184
  - lib/gps_pvt/receiver/agps.rb
185
+ - lib/gps_pvt/receiver/almanac.rb
171
186
  - lib/gps_pvt/receiver/extension.rb
172
187
  - lib/gps_pvt/receiver/rtcm3.rb
173
188
  - lib/gps_pvt/rtcm3.rb
174
189
  - lib/gps_pvt/supl.rb
175
190
  - lib/gps_pvt/ubx.rb
176
191
  - lib/gps_pvt/upl/LPP-V17_5_0-Release17.asn
192
+ - lib/gps_pvt/upl/MAP-LCS-DataTypes-V17_4_0-Release17.asn
177
193
  - lib/gps_pvt/upl/RRLP-V17_0_0-Release17.asn
178
194
  - lib/gps_pvt/upl/ULP-V2_0_6-20200720-D.asn
179
195
  - lib/gps_pvt/upl/upl.json.gz