Class: VORuby::STC::V1_30::OrbitType

Inherits:
CoordinateType show all
Defined in:
lib/voruby/stc/1.30/stc.rb

Overview

Orbit defined by six orbital elements.

Instance Attribute Summary collapse

Attributes inherited from CoordinateType

#frame_id, #name

Attributes included from STCReference

#id, #idref, #ucd, #xlink_href, #xlink_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CoordinateType

coordinate_from_xml

Methods inherited from STCBaseType

stc_base_from_xml

Methods included from STCReference

#stc_reference_eq, stc_reference_from_xml, #stc_reference_to_xml

Methods included from SerializableToXml

#element

Constructor Details

#initialize(a, e, i, node, aop, t, options = {}) ⇒ OrbitType

Returns a new instance of OrbitType.



3320
3321
3322
3323
3324
3325
3326
3327
3328
# File 'lib/voruby/stc/1.30/stc.rb', line 3320

def initialize(a, e, i, node, aop, t, options={})
  self.a = a
  self.e = e
  self.i = i
  self.node = node
  self.aop = aop
  self.t = t
  super(options)
end

Instance Attribute Details

#aObject

Returns the value of attribute a.



3318
3319
3320
# File 'lib/voruby/stc/1.30/stc.rb', line 3318

def a
  @a
end

#aopObject

Returns the value of attribute aop.



3318
3319
3320
# File 'lib/voruby/stc/1.30/stc.rb', line 3318

def aop
  @aop
end

#eObject

Returns the value of attribute e.



3318
3319
3320
# File 'lib/voruby/stc/1.30/stc.rb', line 3318

def e
  @e
end

#iObject

Returns the value of attribute i.



3318
3319
3320
# File 'lib/voruby/stc/1.30/stc.rb', line 3318

def i
  @i
end

#nodeObject

Returns the value of attribute node.



3318
3319
3320
# File 'lib/voruby/stc/1.30/stc.rb', line 3318

def node
  @node
end

#tObject

Returns the value of attribute t.



3318
3319
3320
# File 'lib/voruby/stc/1.30/stc.rb', line 3318

def t
  @t
end

Class Method Details

.from_xml(xml) ⇒ Object



3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
# File 'lib/voruby/stc/1.30/stc.rb', line 3406

def self.from_xml(xml)
  root = element_from(xml)
  
  a_el = REXML::XPath.first(root, 'x:a', {'x' => obj_ns.uri})
  a = a_el ? Double1Type.from_xml(a_el) : nil
  
  e_el = REXML::XPath.first(root, 'x:e', {'x' => obj_ns.uri})
  e = e_el ? Double1Type.from_xml(e_el) : nil
  
  i_el = REXML::XPath.first(root, 'x:i', {'x' => obj_ns.uri})
  i = i_el ? Double1Type.from_xml(i_el) : nil
  
  node_el = REXML::XPath.first(root, 'x:Node', {'x' => obj_ns.uri})
  node = node_el ? Double1Type.from_xml(node_el) : nil
  
  aop_el = REXML::XPath.first(root, 'x:Aop', {'x' => obj_ns.uri})
  aop = aop_el ? Double1Type.from_xml(aop_el) : nil
  
  t_el = REXML::XPath.first(root, 'x:T', {'x' => obj_ns.uri})
  t = t_el ? AstronTimeType.from_xml(t_el) : nil
  
  self.new(a, e, i, node, aop, t, CoordinateType.coordinate_from_xml(root))
end

Instance Method Details

#==(o) ⇒ Object



3382
3383
3384
3385
3386
3387
3388
3389
3390
# File 'lib/voruby/stc/1.30/stc.rb', line 3382

def ==(o)
  super(o) and
  self.a == o.a and
  self.e == o.e and
  self.i == o.i and
  self.node == o.node and
  self.aop == o.aop and
  self.t == o.t
end

#to_xml(name = nil) ⇒ Object



3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
# File 'lib/voruby/stc/1.30/stc.rb', line 3392

def to_xml(name=nil)
  el = super(name)
  
  el.add_element(self.a.to_xml('a')) if self.a
  el.add_element(self.e.to_xml('e')) if self.e
  el.add_element(self.i.to_xml('i')) if self.i
  el.add_element(self.node.to_xml('Node')) if self.node
  el.add_element(self.aop.to_xml('Aop')) if self.aop
  el.add_element(self.t.to_xml('T'))
  
  collapse_namespaces(el)
  el
end