Class: RTP::SiteSetup

Inherits:
Record
  • Object
show all
Defined in:
lib/rtp-connect/site_setup.rb

Overview

Note:

Relations:

  • Parent: Prescription

  • Children: none

The SiteSetup class.

Constant Summary

Constants inherited from Record

Record::NR_SURPLUS_ATTRIBUTES

Instance Attribute Summary collapse

Attributes inherited from Record

#attributes, #crc, #keyword

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Record

#encode, #get_parent, #load, #to_record, #to_s, #values

Constructor Details

#initialize(parent) ⇒ SiteSetup

Creates a new SiteSetup.

Parameters:

  • parent (Record)

    a record which is used to determine the proper parent of this instance



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/rtp-connect/site_setup.rb', line 47

def initialize(parent)
  super('SITE_SETUP_DEF', 5, 19)
  # Parent relation (always expecting a Prescription here):
  @parent = get_parent(parent.to_prescription, Prescription)
  @parent.add_site_setup(self)
  @attributes = [
    # Required:
    :keyword,
    :rx_site_name,
    :patient_orientation,
    :treatment_machine,
    # Optional:
    :tolerance_table,
    :iso_pos_x,
    :iso_pos_y,
    :iso_pos_z,
    :structure_set_uid,
    :frame_of_ref_uid,
    :couch_vertical,
    :couch_lateral,
    :couch_longitudinal,
    :couch_angle,
    :couch_pedestal,
    :table_top_vert_displacement,
    :table_top_long_displacement,
    :table_top_lat_displacement
  ]
end

Instance Attribute Details

#couch_angleObject

Returns the value of attribute couch_angle.



25
26
27
# File 'lib/rtp-connect/site_setup.rb', line 25

def couch_angle
  @couch_angle
end

#couch_lateralObject

Returns the value of attribute couch_lateral.



23
24
25
# File 'lib/rtp-connect/site_setup.rb', line 23

def couch_lateral
  @couch_lateral
end

#couch_longitudinalObject

Returns the value of attribute couch_longitudinal.



24
25
26
# File 'lib/rtp-connect/site_setup.rb', line 24

def couch_longitudinal
  @couch_longitudinal
end

#couch_pedestalObject

Returns the value of attribute couch_pedestal.



26
27
28
# File 'lib/rtp-connect/site_setup.rb', line 26

def couch_pedestal
  @couch_pedestal
end

#couch_verticalObject

Returns the value of attribute couch_vertical.



22
23
24
# File 'lib/rtp-connect/site_setup.rb', line 22

def couch_vertical
  @couch_vertical
end

#frame_of_ref_uidObject

Returns the value of attribute frame_of_ref_uid.



21
22
23
# File 'lib/rtp-connect/site_setup.rb', line 21

def frame_of_ref_uid
  @frame_of_ref_uid
end

#iso_pos_xObject

Returns the value of attribute iso_pos_x.



17
18
19
# File 'lib/rtp-connect/site_setup.rb', line 17

def iso_pos_x
  @iso_pos_x
end

#iso_pos_yObject

Returns the value of attribute iso_pos_y.



18
19
20
# File 'lib/rtp-connect/site_setup.rb', line 18

def iso_pos_y
  @iso_pos_y
end

#iso_pos_zObject

Returns the value of attribute iso_pos_z.



19
20
21
# File 'lib/rtp-connect/site_setup.rb', line 19

def iso_pos_z
  @iso_pos_z
end

#parentObject

The Record which this instance belongs to.



12
13
14
# File 'lib/rtp-connect/site_setup.rb', line 12

def parent
  @parent
end

#patient_orientationObject

Returns the value of attribute patient_orientation.



14
15
16
# File 'lib/rtp-connect/site_setup.rb', line 14

def patient_orientation
  @patient_orientation
end

#rx_site_nameObject

Returns the value of attribute rx_site_name.



13
14
15
# File 'lib/rtp-connect/site_setup.rb', line 13

def rx_site_name
  @rx_site_name
end

#structure_set_uidObject

Returns the value of attribute structure_set_uid.



20
21
22
# File 'lib/rtp-connect/site_setup.rb', line 20

def structure_set_uid
  @structure_set_uid
end

#table_top_lat_displacementObject

Returns the value of attribute table_top_lat_displacement.



29
30
31
# File 'lib/rtp-connect/site_setup.rb', line 29

def table_top_lat_displacement
  @table_top_lat_displacement
end

#table_top_long_displacementObject

Returns the value of attribute table_top_long_displacement.



28
29
30
# File 'lib/rtp-connect/site_setup.rb', line 28

def table_top_long_displacement
  @table_top_long_displacement
end

#table_top_vert_displacementObject

Returns the value of attribute table_top_vert_displacement.



27
28
29
# File 'lib/rtp-connect/site_setup.rb', line 27

def table_top_vert_displacement
  @table_top_vert_displacement
end

#tolerance_tableObject

Returns the value of attribute tolerance_table.



16
17
18
# File 'lib/rtp-connect/site_setup.rb', line 16

def tolerance_table
  @tolerance_table
end

#treatment_machineObject

Returns the value of attribute treatment_machine.



15
16
17
# File 'lib/rtp-connect/site_setup.rb', line 15

def treatment_machine
  @treatment_machine
end

Class Method Details

.load(string, parent) ⇒ SiteSetup

Creates a new SiteSetup by parsing a RTPConnect string line.

Parameters:

  • string (#to_s)

    the site setup definition record string line

  • parent (Record)

    a record which is used to determine the proper parent of this instance

Returns:

  • (SiteSetup)

    the created SiteSetup instance

Raises:

  • (ArgumentError)

    if given a string containing an invalid number of elements



38
39
40
41
# File 'lib/rtp-connect/site_setup.rb', line 38

def self.load(string, parent)
  s = self.new(parent)
  s.load(string)
end

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Checks for equality.

Other and self are considered equivalent if they are of compatible types and their attributes are equivalent.

Parameters:

  • other

    an object to be compared with self.

Returns:

  • (Boolean)

    true if self and other are considered equivalent



84
85
86
87
88
# File 'lib/rtp-connect/site_setup.rb', line 84

def ==(other)
  if other.respond_to?(:to_site_setup)
    other.send(:state) == state
  end
end

#childrenArray

Gives an empty array, as these instances are child-less by definition.

Returns:

  • (Array)

    an emtpy array



96
97
98
# File 'lib/rtp-connect/site_setup.rb', line 96

def children
  return Array.new
end

#hashFixnum

Note:

Two objects with the same attributes will have the same hash code.

Computes a hash code for this object.

Returns:

  • (Fixnum)

    the object’s hash code



106
107
108
# File 'lib/rtp-connect/site_setup.rb', line 106

def hash
  state.hash
end

#to_site_setupSiteSetup

Returns self.

Returns:



114
115
116
# File 'lib/rtp-connect/site_setup.rb', line 114

def to_site_setup
  self
end