aixm 0.3.10 → 0.3.11
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
- checksums.yaml.gz.sig +1 -1
- data/CHANGELOG.md +18 -3
- data/README.md +14 -4
- data/exe/ckmid +1 -4
- data/exe/mkmid +1 -4
- data/lib/aixm/association.rb +3 -5
- data/lib/aixm/component/frequency.rb +3 -3
- data/lib/aixm/config.rb +1 -0
- data/lib/aixm/f.rb +28 -0
- data/lib/aixm/feature/address.rb +9 -3
- data/lib/aixm/feature/obstacle.rb +2 -2
- data/lib/aixm/shortcuts.rb +2 -2
- data/lib/aixm/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +23 -23
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d86771a98ab156be9da1487e7e2e11615bcd63590824108717a51f07c044e241
|
4
|
+
data.tar.gz: b6fc6d7c2803169145153d434f1675f161be6ae731b54eb1d53b6d2fbcf4807b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e537adc538ba520a2f0e891da01ccb13e768a5e183c8a042fbe3bf55f63bfc9f2a66125cf6a19b1882e7d646d8c9b0f848fc551f095a24323f24216d9a8036a1
|
7
|
+
data.tar.gz: 5a3884e00a329f243835648bce2bc13f1cd0ae701113dc89a86f23e83ebe9a82abf4af7a5c6aa87a8f22b1d7c49bc94fd222b2752a5a9bef42276936def12e60
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
���W۰��.�},�G������s��o����r�o�s��9J�
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
|
+
## 0.3.11
|
2
|
+
|
3
|
+
#### Breaking Changes
|
4
|
+
* Renamed default git branch to `main`
|
5
|
+
* Require Ruby 3.0
|
6
|
+
* `Address#address` requires and returns `AIXM::F` for type `:radio_frequency`
|
7
|
+
|
8
|
+
#### Changes
|
9
|
+
* Fix `Obstacle#source` for OFMX
|
10
|
+
|
11
|
+
#### Additions
|
12
|
+
* Add `f#voice?` and `AIXM.config.voice_channel_separation` to check whether a
|
13
|
+
frequency belongs to the voice communication airband and use it to validate
|
14
|
+
`AIXM::Frequency`
|
15
|
+
|
1
16
|
## 0.3.10
|
2
17
|
|
3
|
-
|
18
|
+
#### Additions
|
4
19
|
* Proper `has_many` and `has_one` associations
|
5
20
|
* `AIXM::Association:Array#find_by|find|duplicate` on `has_many` associations
|
6
21
|
* `AIXM.config.mid` now defines whether `mid` attributes are inserted or not
|
@@ -12,7 +27,7 @@
|
|
12
27
|
* `AIXM::Component::Geometry#point?|circle?|polygon?`
|
13
28
|
* `AIXM::Component::Layer#services`
|
14
29
|
|
15
|
-
|
30
|
+
#### Breaking Changes
|
16
31
|
* Require Ruby 2.7
|
17
32
|
* Moved `region` attribute from `Document` back to features again
|
18
33
|
* Use `Document#add_feature` instead of `Document@features#<<`
|
@@ -25,7 +40,7 @@
|
|
25
40
|
* Refinement `String#payload_hash` removed in favor of `AIXM::PayloadHash` class
|
26
41
|
* Refinements `Array#find|duplicates` removed
|
27
42
|
|
28
|
-
|
43
|
+
#### Changes
|
29
44
|
* Renamed `AIXM.config.mid_region` to `AIXM.config.region`
|
30
45
|
|
31
46
|
## 0.3.8
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ For now, only the parts needed to automize the AIP import of [open flightmaps](h
|
|
20
20
|
This gem is [cryptographically signed](https://guides.rubygems.org/security/#using-gems) in order to assure it hasn't been tampered with. Unless already done, please add the author's public key as a trusted certificate now:
|
21
21
|
|
22
22
|
```
|
23
|
-
gem cert --add <(curl -Ls https://raw.github.com/svoop/aixm/
|
23
|
+
gem cert --add <(curl -Ls https://raw.github.com/svoop/aixm/main/certs/svoop.pem)
|
24
24
|
```
|
25
25
|
|
26
26
|
### Bundler
|
@@ -100,19 +100,29 @@ The `:ofmx` schema requires the [region to be set on all core features](https://
|
|
100
100
|
|
101
101
|
```ruby
|
102
102
|
AIXM.ofmx!
|
103
|
-
AIXM.region = 'LF'
|
103
|
+
AIXM.config.region = 'LF'
|
104
104
|
```
|
105
105
|
|
106
106
|
:warning: This setting has no effect when using the `:aixm` schema.
|
107
107
|
|
108
|
+
### AIXM.voice_channel_separation
|
109
|
+
|
110
|
+
Define which voice channel separation should be used to validate voice communication frequencies.
|
111
|
+
|
112
|
+
```ruby
|
113
|
+
AIXM.voice_channel_separation = :any # both 25 and 8.33 kHz (default)
|
114
|
+
AIXM.voice_channel_separation = 25 # 25 kHz only
|
115
|
+
AIXM.voice_channel_separation = 833 # 8.33 kHz only
|
116
|
+
```
|
117
|
+
|
108
118
|
### AIXM.config.mid
|
109
119
|
|
110
120
|
In order to insert [OFMX-compliant `mid` attributes](https://gitlab.com/openflightmaps/ofmx/wikis/Features#mid) into all `*Uid` elements, you have set the mid configuration option to `true`.
|
111
121
|
|
112
122
|
```ruby
|
113
123
|
AIXM.ofmx!
|
114
|
-
AIXM.config.mid
|
115
|
-
AIXM.config.mid = true
|
124
|
+
AIXM.config.mid = false # don't insert mid attributes (default)
|
125
|
+
AIXM.config.mid = true # insert mid attributes
|
116
126
|
```
|
117
127
|
|
118
128
|
:warning: This setting has no effect when using the `:aixm` schema.
|
data/exe/ckmid
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# TODO: hide deprecations unless in gem root until fully complying with Ruby 2.7
|
4
|
-
Warning[:deprecated] = Dir.pwd.match? /aixm$/
|
5
|
-
|
6
3
|
require 'bundler/inline'
|
7
4
|
|
8
5
|
gemfile do
|
9
6
|
source 'https://rubygems.org'
|
10
|
-
ruby '>=
|
7
|
+
ruby '>= 3.0'
|
11
8
|
gem 'aixm', '~> 0'
|
12
9
|
end
|
13
10
|
|
data/exe/mkmid
CHANGED
@@ -1,13 +1,10 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# TODO: hide deprecations unless in gem root until fully complying with Ruby 2.7
|
4
|
-
Warning[:deprecated] = Dir.pwd.match? /aixm$/
|
5
|
-
|
6
3
|
require 'bundler/inline'
|
7
4
|
|
8
5
|
gemfile do
|
9
6
|
source 'https://rubygems.org'
|
10
|
-
ruby '>=
|
7
|
+
ruby '>= 3.0'
|
11
8
|
gem 'aixm', '~> 0'
|
12
9
|
end
|
13
10
|
|
data/lib/aixm/association.rb
CHANGED
@@ -187,7 +187,7 @@ module AIXM
|
|
187
187
|
add_block.call(object) if add_block
|
188
188
|
end
|
189
189
|
instance_exec(object, **options, &association_block) if association_block
|
190
|
-
fail(ArgumentError, "#{object.__class__} not allowed") unless class_names.
|
190
|
+
fail(ArgumentError, "#{object.__class__} not allowed") unless class_names.any? { |c| object.is_a?(c.to_class) }
|
191
191
|
send(attribute).send(:push, object)
|
192
192
|
object.instance_variable_set(:"@#{inversion}", self)
|
193
193
|
self
|
@@ -220,7 +220,7 @@ module AIXM
|
|
220
220
|
attr_reader attribute
|
221
221
|
# feature= / add_feature
|
222
222
|
define_method(:"#{association}=") do |object|
|
223
|
-
fail(ArgumentError, "#{object.__class__} not allowed") unless class_names.
|
223
|
+
fail(ArgumentError, "#{object.__class__} not allowed") unless class_names.any? { |c| object.is_a?(c.to_class) }
|
224
224
|
instance_variable_get(:"@#{attribute}")&.instance_variable_set(:"@#{inversion}", nil)
|
225
225
|
instance_variable_set(:"@#{attribute}", object)
|
226
226
|
object&.instance_variable_set(:"@#{inversion}", self)
|
@@ -298,9 +298,7 @@ module AIXM
|
|
298
298
|
self.class.new(
|
299
299
|
select do |element|
|
300
300
|
if element.kind_of? klass
|
301
|
-
attributes.
|
302
|
-
memo && element.send(attribute) == value
|
303
|
-
end
|
301
|
+
attributes.all? { |a, v| element.send(a) == v }
|
304
302
|
end
|
305
303
|
end
|
306
304
|
)
|
@@ -3,7 +3,7 @@ using AIXM::Refinements
|
|
3
3
|
module AIXM
|
4
4
|
module Component
|
5
5
|
|
6
|
-
#
|
6
|
+
# Voice frequencies used by a service.
|
7
7
|
#
|
8
8
|
# By default, {#reception_f} is set to the same value as {#transmission_f}
|
9
9
|
# since most services rely on simplex (aka: non-duplex) two-way
|
@@ -73,7 +73,7 @@ module AIXM
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def transmission_f=(value)
|
76
|
-
fail(ArgumentError, "invalid transmission_f") unless value.is_a?
|
76
|
+
fail(ArgumentError, "invalid transmission_f") unless value.is_a?(AIXM::F) && value.voice?
|
77
77
|
@transmission_f = value
|
78
78
|
end
|
79
79
|
|
@@ -83,7 +83,7 @@ module AIXM
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def reception_f=(value)
|
86
|
-
fail(ArgumentError, "invalid reception_f") unless value.nil? || value.is_a?(AIXM::F)
|
86
|
+
fail(ArgumentError, "invalid reception_f") unless value.nil? || value.is_a?(AIXM::F) && value.voice?
|
87
87
|
@reception_f = value
|
88
88
|
end
|
89
89
|
|
data/lib/aixm/config.rb
CHANGED
data/lib/aixm/f.rb
CHANGED
@@ -64,6 +64,34 @@ module AIXM
|
|
64
64
|
to_s.hash
|
65
65
|
end
|
66
66
|
|
67
|
+
# @return [Boolean] whether this frequency is part of the voice airband
|
68
|
+
# for civil aviation using `AIXM.config.voice_channel_separation`
|
69
|
+
def voice?
|
70
|
+
return false unless unit == :mhz
|
71
|
+
case AIXM.config.voice_channel_separation
|
72
|
+
when 25 then voice_25?
|
73
|
+
when 833 then voice_833?
|
74
|
+
when :any then voice_25? || voice_833?
|
75
|
+
else fail(ArgumentError, "unknown voice channel separation")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
# @return [Boolean] whether this frequency is part of the voice airband
|
82
|
+
# for civil aviation using 25 kHz channel separation
|
83
|
+
def voice_25?
|
84
|
+
return false unless unit == :mhz && freq == freq.round(3) && freq.between?(118, 136.975)
|
85
|
+
((freq * 1000).round % 25).zero?
|
86
|
+
end
|
87
|
+
|
88
|
+
# @return [Boolean] whether this frequency is part of the voice airband
|
89
|
+
# for civil aviation using 8.33 kHz channel separation
|
90
|
+
def voice_833?
|
91
|
+
return false unless unit == :mhz && freq == freq.round(3) && freq.between?(118, 136.99)
|
92
|
+
[0.005, 0.01, 0.015].any? { |d| (((freq - d) * 1000).round % 25).zero? }
|
93
|
+
end
|
94
|
+
|
67
95
|
end
|
68
96
|
|
69
97
|
end
|
data/lib/aixm/feature/address.rb
CHANGED
@@ -9,7 +9,7 @@ module AIXM
|
|
9
9
|
# address = AIXM.address(
|
10
10
|
# source: String or nil
|
11
11
|
# type: TYPES
|
12
|
-
# address: String
|
12
|
+
# address: AIXM.f (type :radio_frequency) or String (other types)
|
13
13
|
# )
|
14
14
|
# service.remarks = String or nil
|
15
15
|
#
|
@@ -64,8 +64,14 @@ module AIXM
|
|
64
64
|
end
|
65
65
|
|
66
66
|
def address=(value)
|
67
|
-
|
68
|
-
|
67
|
+
case type
|
68
|
+
when :radio_frequency
|
69
|
+
fail(ArgumentError, "invalid address frequency") unless value.is_a?(AIXM::F)
|
70
|
+
@address = value
|
71
|
+
else
|
72
|
+
fail(ArgumentError, "invalid address") unless value
|
73
|
+
@address = value.to_s
|
74
|
+
end
|
69
75
|
end
|
70
76
|
|
71
77
|
def remarks=(value)
|
@@ -130,7 +130,7 @@ module AIXM
|
|
130
130
|
|
131
131
|
# @return [String]
|
132
132
|
def inspect
|
133
|
-
%Q(#<#{self.class} xy="#{xy.to_s}" type=#{type.inspect}>)
|
133
|
+
%Q(#<#{self.class} xy="#{xy.to_s}" type=#{type.inspect} name=#{name.inspect}>)
|
134
134
|
end
|
135
135
|
|
136
136
|
def name=(value)
|
@@ -238,7 +238,7 @@ module AIXM
|
|
238
238
|
return obstacle_group.to_xml if delegate && obstacle_group && AIXM.ofmx?
|
239
239
|
builder = Builder::XmlMarkup.new(indent: 2)
|
240
240
|
builder.comment! "Obstacle: [#{type}] #{xy.to_s} #{name}".strip
|
241
|
-
builder.Obs do |obs|
|
241
|
+
builder.Obs({ source: (source if AIXM.ofmx?) }.compact) do |obs|
|
242
242
|
obs << to_uid.indent(2)
|
243
243
|
obs << obstacle_group.to_uid.indent(2) if obstacle_group && AIXM.ofmx?
|
244
244
|
obs.txtName(name) if name
|
data/lib/aixm/shortcuts.rb
CHANGED
@@ -4,8 +4,8 @@ module AIXM
|
|
4
4
|
|
5
5
|
# Shortcut initializers
|
6
6
|
CLASSES.each do |element, class_name|
|
7
|
-
define_singleton_method(element) do |*
|
8
|
-
class_name.to_class.new(*
|
7
|
+
define_singleton_method(element) do |*args, **kwargs|
|
8
|
+
class_name.to_class.new(*args, **kwargs)
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
data/lib/aixm/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aixm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ0wCwYDVQQDDARydWJ5
|
14
14
|
MRkwFwYKCZImiZPyLGQBGRYJYml0Y2V0ZXJhMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
|
15
|
+
MB4XDTIxMTEwODE0MzIyM1oXDTIyMTEwODE0MzIyM1owPzENMAsGA1UEAwwEcnVi
|
16
16
|
eTEZMBcGCgmSJomT8ixkARkWCWJpdGNldGVyYTETMBEGCgmSJomT8ixkARkWA2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aMpn
|
30
|
+
1+2Y1+i+4jd1B7qxIgOLxQTNIJiwE0sqU1itFfuesfgUACS7M0IV9u9Bp4hBGNEw
|
31
|
+
5JcY2h7owdMxXIvgk1oakgldFJc=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2021-11-08 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: builder
|
@@ -284,11 +284,11 @@ licenses:
|
|
284
284
|
- MIT
|
285
285
|
metadata:
|
286
286
|
homepage_uri: https://github.com/svoop/aixm
|
287
|
-
changelog_uri: https://github.com/svoop/aixm/blob/
|
287
|
+
changelog_uri: https://github.com/svoop/aixm/blob/main/CHANGELOG.md
|
288
288
|
source_code_uri: https://github.com/svoop/aixm
|
289
289
|
documentation_uri: https://www.rubydoc.info/gems/aixm
|
290
290
|
bug_tracker_uri: https://github.com/svoop/aixm/issues
|
291
|
-
post_install_message:
|
291
|
+
post_install_message:
|
292
292
|
rdoc_options:
|
293
293
|
- "--title"
|
294
294
|
- AIXM/OFMX Builder
|
@@ -303,15 +303,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
303
303
|
requirements:
|
304
304
|
- - ">="
|
305
305
|
- !ruby/object:Gem::Version
|
306
|
-
version:
|
306
|
+
version: 3.0.0
|
307
307
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
308
308
|
requirements:
|
309
309
|
- - ">="
|
310
310
|
- !ruby/object:Gem::Version
|
311
311
|
version: '0'
|
312
312
|
requirements: []
|
313
|
-
rubygems_version: 3.
|
314
|
-
signing_key:
|
313
|
+
rubygems_version: 3.2.30
|
314
|
+
signing_key:
|
315
315
|
specification_version: 4
|
316
316
|
summary: Builder for AIXM/OFMX aeronautical information
|
317
317
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|