adiwg-mdtranslator 2.20.0.pre.beta.10 → 2.21.0.pre.beta.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/Gemfile.lock +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +46 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_acquisition.rb +133 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_environment.rb +47 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_event.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrument.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEvent.rb +77 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEventList.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +11 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_objective.rb +104 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_operation.rb +119 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_pass.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_plan.rb +80 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_platform.rb +87 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requestedDate.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requirement.rb +98 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_revision.rb +50 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_acquisition.rb +199 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_acquisition.rb +103 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_environment.rb +82 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_event.rb +123 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrument.rb +92 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrumentationEvent.rb +83 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrumentationEventList.rb +73 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_mdMetadata.rb +11 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_objective.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_operation.rb +131 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_pass.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_plan.rb +76 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_platform.rb +102 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_requestedDate.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_requirement.rb +111 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_acquisition.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_environment.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_event.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrument.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEvent.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEventList.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_objective.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_operation.rb +34 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_pass.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_plan.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_platform.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requestedDate.rb +26 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requirement.rb +36 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb +195 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +18 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_revision.rb +55 -0
- metadata +72 -2
@@ -0,0 +1,117 @@
|
|
1
|
+
require_relative 'html_identifier'
|
2
|
+
require_relative 'html_citation'
|
3
|
+
require_relative 'html_responsibility'
|
4
|
+
require_relative 'html_instrument'
|
5
|
+
require_relative 'html_instrumentationEventList'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Html
|
11
|
+
class Html_Platform
|
12
|
+
def initialize(html)
|
13
|
+
@html = html
|
14
|
+
end
|
15
|
+
|
16
|
+
def writeHtml(hPlatform)
|
17
|
+
identifierClass = Html_Identifier.new(@html)
|
18
|
+
citationClass = Html_Citation.new(@html)
|
19
|
+
responsibilityClass = Html_Responsibility.new(@html)
|
20
|
+
instrumentClass = Html_Instrument.new(@html)
|
21
|
+
instrumentationEventListClass = Html_InstrumentationEventList.new(@html)
|
22
|
+
|
23
|
+
# platformId
|
24
|
+
unless hPlatform[:platformId].nil?
|
25
|
+
@html.em('Platform ID: ')
|
26
|
+
@html.text!(hPlatform[:platformId])
|
27
|
+
@html.br
|
28
|
+
end
|
29
|
+
|
30
|
+
# citation
|
31
|
+
unless hPlatform[:citation].empty?
|
32
|
+
@html.section(:class => 'block') do
|
33
|
+
@html.details do
|
34
|
+
@html.summary('Citation', {'class' => 'h4'})
|
35
|
+
@html.section(:class => 'block') do
|
36
|
+
citationClass.writeHtml(hPlatform[:citation])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# identifier
|
43
|
+
unless hPlatform[:identifier].empty?
|
44
|
+
@html.section(:class => 'block') do
|
45
|
+
@html.details do
|
46
|
+
@html.summary('Identifier', {'class' => 'h4'})
|
47
|
+
@html.section(:class => 'block') do
|
48
|
+
identifierClass.writeHtml(hPlatform[:identifier])
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
# description
|
55
|
+
unless hPlatform[:description].nil?
|
56
|
+
@html.em('Description: ')
|
57
|
+
@html.text!(hPlatform[:description])
|
58
|
+
@html.br
|
59
|
+
end
|
60
|
+
|
61
|
+
# sponsor
|
62
|
+
unless hPlatform[:sponsors].empty?
|
63
|
+
@html.section(:class => 'block') do
|
64
|
+
@html.details do
|
65
|
+
@html.summary('Sponsors', {'class' => 'h4'})
|
66
|
+
hPlatform[:sponsors].each do |responsibility|
|
67
|
+
@html.section(:class => 'block') do
|
68
|
+
@html.details do
|
69
|
+
@html.summary('Responsibility', {'class' => 'h5'})
|
70
|
+
responsibilityClass.writeHtml(responsibility)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# instrument
|
79
|
+
unless hPlatform[:instruments].empty?
|
80
|
+
@html.section(:class => 'block') do
|
81
|
+
@html.details do
|
82
|
+
@html.summary('Instruments', {'class' => 'h4'})
|
83
|
+
hPlatform[:instruments].each do |instrument|
|
84
|
+
@html.section(:class => 'block') do
|
85
|
+
@html.details do
|
86
|
+
@html.summary('Instrument', {'class' => 'h5'})
|
87
|
+
instrumentClass.writeHtml(instrument)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
# history
|
96
|
+
unless hPlatform[:history].empty?
|
97
|
+
@html.section(:class => 'block') do
|
98
|
+
@html.details do
|
99
|
+
@html.summary('History', {'class' => 'h4'})
|
100
|
+
hPlatform[:history].each do |instrumentationEventList|
|
101
|
+
@html.section(:class => 'block') do
|
102
|
+
@html.details do
|
103
|
+
@html.summary('Instrumentation Event List', {'class' => 'h5'})
|
104
|
+
instrumentationEventListClass.writeHtml(instrumentationEventList)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'html_datetime'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module Html
|
7
|
+
class Html_RequestedDate
|
8
|
+
def initialize(html)
|
9
|
+
@html = html
|
10
|
+
end
|
11
|
+
|
12
|
+
def writeHtml(hRequestedDate)
|
13
|
+
datetimeClass = Html_Datetime.new(@html)
|
14
|
+
|
15
|
+
# requestedDateOfCollection
|
16
|
+
unless hRequestedDate[:requestedDateOfCollection].empty?
|
17
|
+
@html.em('Requested Date of Collection: ')
|
18
|
+
@html.text!(hRequestedDate[:requestedDateOfCollection][:dateTime].to_s)
|
19
|
+
@html.br
|
20
|
+
end
|
21
|
+
|
22
|
+
# latestAcceptableDate
|
23
|
+
unless hRequestedDate[:latestAcceptableDate].empty?
|
24
|
+
@html.em('Latest Acceptable Date: ')
|
25
|
+
@html.text!(hRequestedDate[:latestAcceptableDate][:dateTime].to_s)
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
require_relative 'html_citation'
|
2
|
+
require_relative 'html_identifier'
|
3
|
+
require_relative 'html_responsibility'
|
4
|
+
require_relative 'html_requestedDate'
|
5
|
+
require_relative 'html_date'
|
6
|
+
require_relative 'html_plan'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Html
|
12
|
+
class Html_Requirement
|
13
|
+
def initialize(html)
|
14
|
+
@html = html
|
15
|
+
end
|
16
|
+
|
17
|
+
def writeHtml(hRequirement)
|
18
|
+
citationClass = Html_Citation.new(@html)
|
19
|
+
identifierClass = Html_Identifier.new(@html)
|
20
|
+
responsibilityClass = Html_Responsibility.new(@html)
|
21
|
+
requestedDateClass = Html_RequestedDate.new(@html)
|
22
|
+
dateClass = Html_Date.new(@html)
|
23
|
+
planClass = Html_Plan.new(@html)
|
24
|
+
|
25
|
+
# requirementId
|
26
|
+
unless hRequirement[:requirementId].nil?
|
27
|
+
@html.em('Requirement ID: ')
|
28
|
+
@html.text!(hRequirement[:requirementId])
|
29
|
+
@html.br
|
30
|
+
end
|
31
|
+
|
32
|
+
# citation
|
33
|
+
unless hRequirement[:citation].empty?
|
34
|
+
@html.section(:class => 'block') do
|
35
|
+
@html.details do
|
36
|
+
@html.summary('Citation', {'class' => 'h4'})
|
37
|
+
@html.section(:class => 'block') do
|
38
|
+
citationClass.writeHtml(hRequirement[:citation])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# identifier
|
45
|
+
unless hRequirement[:identifier].empty?
|
46
|
+
@html.section(:class => 'block') do
|
47
|
+
@html.details do
|
48
|
+
@html.summary('Identifier ', {'class' => 'h4'})
|
49
|
+
@html.section(:class => 'block') do
|
50
|
+
identifierClass.writeHtml(hRequirement[:identifier])
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# requestor
|
57
|
+
unless hRequirement[:requestors].empty?
|
58
|
+
@html.section(:class => 'block') do
|
59
|
+
@html.details do
|
60
|
+
@html.summary('Requestors', {'class' => 'h4'})
|
61
|
+
hRequirement[:requestors].each do |requestor|
|
62
|
+
@html.section(:class => 'block') do
|
63
|
+
@html.details do
|
64
|
+
@html.summary('Requestor', {'class' => 'h5'})
|
65
|
+
operationClass.writeHtml(requestor)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# recipient
|
74
|
+
unless hRequirement[:recipients].empty?
|
75
|
+
@html.section(:class => 'block') do
|
76
|
+
@html.details do
|
77
|
+
@html.summary('Recipients', {'class' => 'h4'})
|
78
|
+
hRequirement[:recipients].each do |recipient|
|
79
|
+
@html.section(:class => 'block') do
|
80
|
+
@html.details do
|
81
|
+
@html.summary('Recipient', {'class' => 'h5'})
|
82
|
+
operationClass.writeHtml(recipient)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# priority
|
91
|
+
unless hRequirement[:priority].nil?
|
92
|
+
@html.em('Priority: ')
|
93
|
+
@html.text!(hRequirement[:priority])
|
94
|
+
@html.br
|
95
|
+
end
|
96
|
+
|
97
|
+
# requested date
|
98
|
+
unless hRequirement[:requestedDate].empty?
|
99
|
+
@html.section(:class => 'block') do
|
100
|
+
@html.details do
|
101
|
+
@html.summary('Requested Date ', {'class' => 'h4'})
|
102
|
+
@html.section(:class => 'block') do
|
103
|
+
requestedDateClass.writeHtml(hRequirement[:requestedDate])
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# expiry date
|
110
|
+
unless hRequirement[:expiryDate].nil?
|
111
|
+
@html.em('Expiry Date: ')
|
112
|
+
@html.text!(hRequirement[:expiryDate])
|
113
|
+
@html.br
|
114
|
+
end
|
115
|
+
|
116
|
+
# satisfied plan
|
117
|
+
unless hRequirement[:satisfiedPlans].empty?
|
118
|
+
@html.section(:class => 'block') do
|
119
|
+
@html.details do
|
120
|
+
@html.summary('Satisfied Plans', {'class' => 'h4'})
|
121
|
+
hRequirement[:satisfiedPlans].each do |plan|
|
122
|
+
@html.section(:class => 'block') do
|
123
|
+
@html.details do
|
124
|
+
@html.summary('Plan', {'class' => 'h5'})
|
125
|
+
planClass.writeHtml(plan)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
end # writeHtml
|
134
|
+
end # Html_Requirement
|
135
|
+
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative 'html_responsibility'
|
2
|
+
require_relative 'html_date'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module Html
|
8
|
+
class Html_Revision
|
9
|
+
def initialize(html)
|
10
|
+
@html = html
|
11
|
+
end
|
12
|
+
|
13
|
+
def writeHtml(hRevision)
|
14
|
+
responsibilityClass = Html_Responsibility.new(@html)
|
15
|
+
dateClass = Html_Date.new(@html)
|
16
|
+
|
17
|
+
# description
|
18
|
+
unless hRevision[:description].nil?
|
19
|
+
@html.em('Description: ')
|
20
|
+
@html.text!(hRevision[:description])
|
21
|
+
@html.br
|
22
|
+
end
|
23
|
+
|
24
|
+
# responsibleParty
|
25
|
+
unless hRevision[:responsibleParty].empty?
|
26
|
+
@html.section(:class => 'block') do
|
27
|
+
@html.details do
|
28
|
+
@html.summary('Responsible Party', {'class' => 'h4'})
|
29
|
+
@html.section(:class => 'block') do
|
30
|
+
responsibilityClass.writeHtml(hRevision[:responsibleParty])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
# dateInfo
|
37
|
+
unless hRevision[:dateInfo].empty?
|
38
|
+
@html.section(:class => 'block') do
|
39
|
+
@html.details do
|
40
|
+
@html.summary('Date Info', {'class' => 'h4'})
|
41
|
+
hRevision[:dateInfo].each do |date|
|
42
|
+
@html.em('Datetime: ')
|
43
|
+
@html.text!(date[:dateTime].to_s)
|
44
|
+
@html.br
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
require_relative 'class_scope'
|
2
|
+
require_relative 'class_plan'
|
3
|
+
require_relative 'class_requirement'
|
4
|
+
require_relative 'class_environment'
|
5
|
+
require_relative 'class_instrument'
|
6
|
+
require_relative 'class_objective'
|
7
|
+
require_relative 'class_operation'
|
8
|
+
require_relative 'class_platform'
|
9
|
+
|
10
|
+
module ADIWG
|
11
|
+
module Mdtranslator
|
12
|
+
module Writers
|
13
|
+
module Iso19115_3
|
14
|
+
|
15
|
+
class MI_AcquisitionInformation
|
16
|
+
def initialize(xml, hResponseObj)
|
17
|
+
@xml = xml
|
18
|
+
@hResponseObj = hResponseObj
|
19
|
+
end
|
20
|
+
|
21
|
+
def writeXML(hAcquisition)
|
22
|
+
|
23
|
+
scopeClass = MD_Scope.new(@xml, @hResponseObj)
|
24
|
+
planClass = MI_Plan.new(@xml, @hResponseObj)
|
25
|
+
requirementClass = MI_Requirement.new(@xml, @hResponseObj)
|
26
|
+
environmentClass = MI_EnvironmentalRecord.new(@xml, @hResponseObj)
|
27
|
+
instrumentClass = MI_Instrument.new(@xml, @hResponseObj)
|
28
|
+
objectiveClass = MI_Objective.new(@xml, @hResponseObj)
|
29
|
+
operationClass = MI_Operation.new(@xml, @hResponseObj)
|
30
|
+
platformClass = MI_Platform.new(@xml, @hResponseObj)
|
31
|
+
|
32
|
+
unless hAcquisition.empty?
|
33
|
+
@xml.tag!('mac:MI_AcquisitionInformation') do
|
34
|
+
unless hAcquisition[:scope].empty?
|
35
|
+
@xml.tag!('mac:scope') do
|
36
|
+
scopeClass.writeXML(hAcquisition[:scope])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
unless hAcquisition[:plans].empty?
|
41
|
+
hAcquisition[:plans].each do |hPlan|
|
42
|
+
@xml.tag!('mac:acquisitionPlan') do
|
43
|
+
planClass.writeXML(hPlan)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
unless hAcquisition[:requirements].empty?
|
49
|
+
hAcquisition[:requirements].each do |hRequirement|
|
50
|
+
@xml.tag!('mac:acquisitionRequirement') do
|
51
|
+
requirementClass.writeXML(hRequirement)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
unless hAcquisition[:environment].empty?
|
57
|
+
@xml.tag!('mac:environmentalConditions') do
|
58
|
+
environmentClass.writeXML(hAcquisition[:environment])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
unless hAcquisition[:instruments].empty?
|
63
|
+
hAcquisition[:instruments].each do |hInstrument|
|
64
|
+
@xml.tag!('mac:instrument') do
|
65
|
+
instrumentClass.writeXML(hInstrument)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
unless hAcquisition[:objectives].empty?
|
71
|
+
hAcquisition[:objectives].each do |hObjective|
|
72
|
+
@xml.tag!('mac:objective') do
|
73
|
+
objectiveClass.writeXML(hObjective)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
unless hAcquisition[:operations].empty?
|
79
|
+
hAcquisition[:operations].each do |hOperation|
|
80
|
+
@xml.tag!('mac:operation') do
|
81
|
+
operationClass.writeXML(hOperation)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
unless hAcquisition[:platforms].empty?
|
87
|
+
hAcquisition[:platforms].each do |hPlatform|
|
88
|
+
@xml.tag!('mac:platform') do
|
89
|
+
platformClass.writeXML(hPlatform)
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
end
|
98
|
+
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
module ADIWG
|
2
|
+
module Mdtranslator
|
3
|
+
module Writers
|
4
|
+
module Iso19115_3
|
5
|
+
|
6
|
+
class MI_EnvironmentalRecord
|
7
|
+
def initialize(xml, hResponseObj)
|
8
|
+
@xml = xml
|
9
|
+
@hResponseObj = hResponseObj
|
10
|
+
end
|
11
|
+
|
12
|
+
def writeXML(hEnvironment)
|
13
|
+
|
14
|
+
@xml.tag!('mac:MI_EnvironmentalRecord') do
|
15
|
+
unless hEnvironment[:averageAirTemperature].nil?
|
16
|
+
@xml.tag!('mac:averageAirTemperature') do
|
17
|
+
@xml.tag!('gco:Real', hEnvironment[:averageAirTemperature])
|
18
|
+
end
|
19
|
+
else
|
20
|
+
if @hResponseObj[:writerShowTags]
|
21
|
+
@xml.tag!('mac:averageAirTemperature')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
unless hEnvironment[:maxRelativeHumidity].nil?
|
26
|
+
@xml.tag!('mac:maxRelativeHumidity') do
|
27
|
+
@xml.tag!('gco:Real', hEnvironment[:maxRelativeHumidity])
|
28
|
+
end
|
29
|
+
else
|
30
|
+
if @hResponseObj[:writerShowTags]
|
31
|
+
@xml.tag!('mac:maxRelativeHumidity')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
unless hEnvironment[:maxAltitude].nil?
|
36
|
+
@xml.tag!('mac:maxAltitude') do
|
37
|
+
@xml.tag!('gco:Real', hEnvironment[:maxAltitude])
|
38
|
+
end
|
39
|
+
else
|
40
|
+
if @hResponseObj[:writerShowTags]
|
41
|
+
@xml.tag!('mac:maxAltitude')
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
unless hEnvironment[:meteorologicalConditions].nil?
|
46
|
+
@xml.tag!('mac:meteorologicalConditions') do
|
47
|
+
@xml.tag!('gco:CharacterString', hEnvironment[:meteorologicalConditions])
|
48
|
+
end
|
49
|
+
else
|
50
|
+
if @hResponseObj[:writerShowTags]
|
51
|
+
@xml.tag!('mac:meteorologicalConditions')
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
unless hEnvironment[:solarAzimuth].nil?
|
56
|
+
@xml.tag!('mac:solarAzimuth') do
|
57
|
+
@xml.tag!('gco:Real', hEnvironment[:solarAzimuth])
|
58
|
+
end
|
59
|
+
else
|
60
|
+
if @hResponseObj[:writerShowTags]
|
61
|
+
@xml.tag!('mac:solarAzimuth')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
unless hEnvironment[:solarElevation].nil?
|
66
|
+
@xml.tag!('mac:solarElevation') do
|
67
|
+
@xml.tag!('gco:Real', hEnvironment[:solarElevation])
|
68
|
+
end
|
69
|
+
else
|
70
|
+
if @hResponseObj[:writerShowTags]
|
71
|
+
@xml.tag!('mac:solarElevation')
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,123 @@
|
|
1
|
+
require_relative 'class_identifier'
|
2
|
+
require_relative 'class_codelist'
|
3
|
+
require_relative 'class_gcoDateTime'
|
4
|
+
require_relative 'class_objective'
|
5
|
+
require_relative 'class_pass'
|
6
|
+
require_relative 'class_instrument'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso19115_3
|
12
|
+
|
13
|
+
class MI_Event
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hEvent)
|
20
|
+
|
21
|
+
identifierClass = Identifier.new(@xml, @hResponseObj)
|
22
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
23
|
+
gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
|
24
|
+
objectiveClass = MI_Objective.new(@xml, @hResponseObj)
|
25
|
+
passClass = MI_Pass.new(@xml, @hResponseObj)
|
26
|
+
instrumentClass = MI_Instrument.new(@xml, @hResponseObj)
|
27
|
+
|
28
|
+
@xml.tag!('mac:MI_Event', id: hEvent[:eventId]) do
|
29
|
+
|
30
|
+
unless hEvent[:identifier].empty?
|
31
|
+
@xml.tag!('mac:identifier') do
|
32
|
+
identifierClass.writeXML(hEvent[:identifier])
|
33
|
+
end
|
34
|
+
else
|
35
|
+
if @hResponseObj[:writerShowTags]
|
36
|
+
@xml.tag!('mac:identifier')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
unless hEvent[:trigger].nil?
|
41
|
+
@xml.tag!('mac:trigger') do
|
42
|
+
codelistClass.writeXML('mac', 'iso_triggerCode', hEvent[:trigger])
|
43
|
+
end
|
44
|
+
else
|
45
|
+
if @hResponseObj[:writerShowTags]
|
46
|
+
@xml.tag!('mac:trigger')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
unless hEvent[:context].nil?
|
51
|
+
@xml.tag!('mac:context') do
|
52
|
+
codeListClass.writeXML('mac', 'iso_contextCode', hEvent[:context])
|
53
|
+
end
|
54
|
+
else
|
55
|
+
if @hResponseObj[:writerShowTags]
|
56
|
+
@xml.tag!('mac:context')
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
unless hEvent[:sequence].nil?
|
61
|
+
@xml.tag!('mac:sequence') do
|
62
|
+
codelistClass.writeXML('mac', 'iso_sequenceCode', hEvent[:sequence])
|
63
|
+
end
|
64
|
+
else
|
65
|
+
if @hResponseObj[:writerShowTags]
|
66
|
+
@xml.tag!('mac:sequence')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
unless hEvent[:time].nil?
|
71
|
+
@xml.tag!('mac:time') do
|
72
|
+
gcoDateTimeClass.writeXML(hEvent[:time])
|
73
|
+
end
|
74
|
+
else
|
75
|
+
if @hResponseObj[:writerShowTags]
|
76
|
+
@xml.tag!('mac:time')
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
unless hEvent[:expectedObjectives].empty?
|
81
|
+
hEvent[:expectedObjectives].each do |hObjective|
|
82
|
+
@xml.tag!('mac:expectedObjective') do
|
83
|
+
objectiveClass.writeXML(hObjective)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
else
|
87
|
+
if @hResponseObj[:writerShowTags]
|
88
|
+
@xml.tag!('mac:expectedObjective')
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
unless hEvent[:relatedPass].empty?
|
93
|
+
hEvent[:relatedPass].each do |hPass|
|
94
|
+
@xml.tag!('mac:relatedPass') do
|
95
|
+
passClass.writeXML(hPass)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
else
|
99
|
+
if @hResponseObj[:writerShowTags]
|
100
|
+
@xml.tag!('mac:relatedPass')
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
unless hEvent[:relatedSensors].empty?
|
105
|
+
hEvent[:relatedSensors].each do |hSensor|
|
106
|
+
@xml.tag!('mac:relatedInstrument') do
|
107
|
+
instrumentClass.writeXML(hSensor)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
else
|
111
|
+
if @hResponseObj[:writerShowTags]
|
112
|
+
@xml.tag!('mac:relatedInstrument')
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|