Skip to content

Commit

Permalink
Add remaining classes used for acquisition.
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Oliveros committed Jun 11, 2024
1 parent f58515e commit c2191cd
Show file tree
Hide file tree
Showing 14 changed files with 1,294 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
module ADIWG
module Mdtranslator
module Writers
module Html
module Simple_html
class Html_Acquisition
def initialize(html)
@html = html
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
module ADIWG
module Mdtranslator
module Writers
module Simple_html
class Html_Environment
def initialize(html)
@html = html
end

def writeHtml(hEnvironment)
# averageAirTemperature
unless hEnvironment[:averageAirTemperature].nil?
@html.em('Average Air Temperature: ')
@html.text!(hEnvironment[:averageAirTemperature].to_s)
@html.br
end

# maxRelativeHumidity
unless hEnvironment[:maxRelativeHumidity].nil?
@html.em('Maximum Relative Humidity: ')
@html.text!(hEnvironment[:maxRelativeHumidity].to_s)
@html.br
end

# maxAltitude
unless hEnvironment[:maxAltitude].nil?
@html.em('Maximum Altitude: ')
@html.text!(hEnvironment[:maxAltitude].to_s)
@html.br
end

# meteorologicalConditions
unless hEnvironment[:meteorologicalConditions].nil?
@html.em('Meteorological Conditions: ')
@html.text!(hEnvironment[:meteorologicalConditions])
@html.br
end

# solarAzimuth
unless hEnvironment[:solarAzimuth].nil?
@html.em('Solar Azimuth: ')
@html.text!(hEnvironment[:solarAzimuth].to_s)
@html.br
end

# solarElevation
unless hEnvironment[:solarElevation].nil?
@html.em('Solar Elevation: ')
@html.text!(hEnvironment[:solarElevation].to_s)
@html.br
end

end
end
end
end
end
end
121 changes: 121 additions & 0 deletions lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
require_relative 'html_pass'
require_relative 'html_instrument'
require_relative 'html_extent'
require_relative 'html_identifier'

module ADIWG
module Mdtranslator
module Writers
module Simple_html
class Html_Event
def initialize(html)
@html = html
end

def writeHtml(hEvent)
passClass = Html_Pass.new(@html)
instrumentClass = Html_Instrument.new(@html)
extentClass = Html_Extent.new(@html)
identifierClass = Html_Identifier.new(@html)

# eventId
unless hEvent[:eventId].nil?
@html.em('Event ID: ')
@html.text!(hEvent[:eventId])
@html.br
end

# identifier
unless hEvent[:identifier].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Identifier', {'class' => 'h4'})
@html.div(:class => 'block') do
identifierClass.writeHtml(hEvent[:identifier])
end
end
end
end

# trigger
unless hEvent[:trigger].nil?
@html.em('Trigger: ')
@html.text!(hEvent[:trigger])
@html.br
end

# context
unless hEvent[:context].nil?
@html.em('Context: ')
@html.text!(hEvent[:context])
@html.br
end

# sequence
unless hEvent[:sequence].nil?
@html.em('Sequence: ')
@html.text!(hEvent[:sequence])
@html.br
end

# time
unless hEvent[:dateTime].nil? || hEvent[:dateTime].empty?
@html.em('Datetime: ')
@html.div(:class => 'block') do
@html.text!.writeHtml(hEvent[:dateTime][:dateTime].to_s)
end
end

# expectedObjective
unless hEvent[:expectedObjectives].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Expected Objective', {'class' => 'h4'})
hEvent[:expectedObjectives].each do |objective|
@html.div(:class => 'block') do
@html.div do
@html.summary('Objective', {'class' => 'h5'})
objectiveClass.writeHtml(objective)
end
end
end
end
end
end

# relatedPass
unless hEvent[:relatedPass].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Related Pass', {'class' => 'h4'})
@html.div(:class => 'block') do
passClass.writeHtml(hEvent[:relatedPass])
end
end
end
end

#relatedSensor
unless hEvent[:relatedSensors].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Related Sensors', {'class' => 'h4'})
hEvent[:relatedSensors].each do |instrument|
@html.div(:class => 'block') do
@html.div do
@html.summary('Instrument', {'class' => 'h5'})
instrumentClass.writeHtml(instrument)
end
end
end
end
end
end

end # writeHtml
end # Html_Event

end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
require_relative 'html_identifier'
require_relative 'html_platform'
require_relative 'html_instrumentationEventList'

module ADIWG
module Mdtranslator
module Writers
module Simple_html
class Html_Instrument
def initialize(html)
@html = html
end

def writeHtml(hInstrument)
identifierClass = Html_Identifier.new(@html)
platformClass = Html_Platform.new(@html)
instrumentationEventListClass = Html_InstrumentationEventList.new(@html)

# instrumentId
unless hInstrument[:instrumentId].nil?
@html.em('Instrument ID: ')
@html.text!(hInstrument[:instrumentId])
@html.br
end

# identifier
unless hInstrument[:identifier].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Identifier', {'class' => 'h4'})
@html.div(:class => 'block') do
identifierClass.writeHtml(hInstrument[:identifier])
end
end
end
end

# instrumentType
unless hInstrument[:instrumentType].nil?
@html.em('Instrument Type: ')
@html.text!(hInstrument[:instrumentType])
@html.br
end

# description
unless hInstrument[:description].nil?
@html.em('Description: ')
@html.text!(hInstrument[:description])
@html.br
end

# mountedOn
unless hInstrument[:mountedOn].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Mounted On', {'class' => 'h4'})
@html.div(:class => 'block') do
platformClass.writeHtml(hInstrument[:mountedOn])
end
end
end
end

# history
unless hInstrument[:histories].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Histories', {'class' => 'h4'})
hInstrument[:histories].each do |instrumentationEventList|
@html.div(:class => 'block') do
@html.div do
@html.summary('Instrumentation Event List', {'class' => 'h5'})
instrumentationEventListClass.writeHtml(instrumentationEventList)
end
end
end
end
end
end

# hostId
unless hInstrument[:hostId].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Host ID', {'class' => 'h4'})
@html.div(:class => 'block') do
identifierClass.writeHtml(hInstrument[:hostId])
end
end
end
end

end # writeHtml
end # Html_Instrument
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
require_relative 'html_citation'
require_relative 'html_extent'
require_relative 'html_revision'

module ADIWG
module Mdtranslator
module Writers
module Simple_html
class Html_InstrumentationEvent
def initialize(html)
@html = html
end

def writeHtml(hInstrumentationEvent)
citationClass = Html_Citation.new(@html)
extentClass = Html_Extent.new(@html)
revisionClass = Html_Revision.new(@html)

# citation
unless hInstrumentationEvent[:citations].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Citations', {'class' => 'h4'})
hInstrumentationEvent[:citations].each do |citation|
@html.div(:class => 'block') do
@html.div do
@html.summary('Citation', {'class' => 'h5'})
citationClass.writeHtml(citation)
end
end
end
end
end
end

# description
unless hInstrumentationEvent[:description].nil?
@html.em('Description: ')
@html.text!(hInstrumentationEvent[:description])
@html.br
end

# extent
unless hInstrumentationEvent[:extent].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Extent', {'class' => 'h4'})
@html.div(:class => 'block') do
extentClass.writeHtml(hInstrumentationEvent[:extent])
end
end
end
end

# eventType
unless hInstrumentationEvent[:eventType].nil?
@html.em('Event Type: ')
@html.text!(hInstrumentationEvent[:eventType])
@html.br
end

# revisionHistory
unless hInstrumentationEvent[:revisionHistories].empty?
@html.div(:class => 'block') do
@html.div do
@html.summary('Revision History', {'class' => 'h4'})
hInstrumentationEvent[:revisionHistories].each do |revision|
@html.div(:class => 'block') do
@html.div do
@html.summary('Revision', {'class' => 'h5'})
revisionClass.writeHtml(revision)
end
end
end
end
end
end

end
end
end
end
end
end
Loading

0 comments on commit c2191cd

Please sign in to comment.