Class: RTP::SimulationField

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

Overview

Note:

Relations:

  • Parent: Prescription

  • Children: none

The simulation field 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) ⇒ SimulationField

Creates a new SimulationField.

Parameters:

  • parent (Record)

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



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/rtp-connect/simulation_field.rb', line 81

def initialize(parent)
  super('SIM_DEF', 17, 53)
  # Parent relation (may get more than one type of record here):
  @parent = get_parent(parent.to_record, Prescription)
  @parent.add_simulation_field(self)
  @attributes = [
    # Required:
    :keyword,
    :rx_site_name,
    :field_name,
    :field_id,
    :field_note,
    :treatment_machine,
    :gantry_angle,
    :collimator_angle,
    :field_x_mode,
    :field_x,
    :collimator_x1,
    :collimator_x2,
    :field_y_mode,
    :field_y,
    :collimator_y1,
    :collimator_y2,
    # Optional:
    :couch_vertical,
    :couch_lateral,
    :couch_longitudinal,
    :couch_angle,
    :couch_pedestal,
    :sad,
    :ap_separation,
    :pa_separation,
    :lateral_separation,
    :tangential_separation,
    :other_label_1,
    :ssd_1,
    :sfd_1,
    :other_label_2,
    :other_measurement_1,
    :other_measurement_2,
    :other_label_3,
    :other_measurement_3,
    :other_measurement_4,
    :other_label_4,
    :other_measurement_5,
    :other_measurement_6,
    :blade_x_mode,
    :blade_x,
    :blade_x1,
    :blade_x2,
    :blade_y_mode,
    :blade_y,
    :blade_y1,
    :blade_y2,
    :ii_lateral,
    :ii_longitudinal,
    :ii_vertical,
    :kvp,
    :ma,
    :seconds
  ]
end

Instance Attribute Details

#ap_separationObject

Returns the value of attribute ap_separation.



34
35
36
# File 'lib/rtp-connect/simulation_field.rb', line 34

def ap_separation
  @ap_separation
end

#blade_xObject

Returns the value of attribute blade_x.



51
52
53
# File 'lib/rtp-connect/simulation_field.rb', line 51

def blade_x
  @blade_x
end

#blade_x1Object

Returns the value of attribute blade_x1.



52
53
54
# File 'lib/rtp-connect/simulation_field.rb', line 52

def blade_x1
  @blade_x1
end

#blade_x2Object

Returns the value of attribute blade_x2.



53
54
55
# File 'lib/rtp-connect/simulation_field.rb', line 53

def blade_x2
  @blade_x2
end

#blade_x_modeObject

Returns the value of attribute blade_x_mode.



50
51
52
# File 'lib/rtp-connect/simulation_field.rb', line 50

def blade_x_mode
  @blade_x_mode
end

#blade_yObject

Returns the value of attribute blade_y.



55
56
57
# File 'lib/rtp-connect/simulation_field.rb', line 55

def blade_y
  @blade_y
end

#blade_y1Object

Returns the value of attribute blade_y1.



56
57
58
# File 'lib/rtp-connect/simulation_field.rb', line 56

def blade_y1
  @blade_y1
end

#blade_y2Object

Returns the value of attribute blade_y2.



57
58
59
# File 'lib/rtp-connect/simulation_field.rb', line 57

def blade_y2
  @blade_y2
end

#blade_y_modeObject

Returns the value of attribute blade_y_mode.



54
55
56
# File 'lib/rtp-connect/simulation_field.rb', line 54

def blade_y_mode
  @blade_y_mode
end

#collimator_angleObject

Returns the value of attribute collimator_angle.



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

def collimator_angle
  @collimator_angle
end

#collimator_x1Object

Returns the value of attribute collimator_x1.



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

def collimator_x1
  @collimator_x1
end

#collimator_x2Object

Returns the value of attribute collimator_x2.



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

def collimator_x2
  @collimator_x2
end

#collimator_y1Object

Returns the value of attribute collimator_y1.



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

def collimator_y1
  @collimator_y1
end

#collimator_y2Object

Returns the value of attribute collimator_y2.



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

def collimator_y2
  @collimator_y2
end

#couch_angleObject

Returns the value of attribute couch_angle.



31
32
33
# File 'lib/rtp-connect/simulation_field.rb', line 31

def couch_angle
  @couch_angle
end

#couch_lateralObject

Returns the value of attribute couch_lateral.



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

def couch_lateral
  @couch_lateral
end

#couch_longitudinalObject

Returns the value of attribute couch_longitudinal.



30
31
32
# File 'lib/rtp-connect/simulation_field.rb', line 30

def couch_longitudinal
  @couch_longitudinal
end

#couch_pedestalObject

Returns the value of attribute couch_pedestal.



32
33
34
# File 'lib/rtp-connect/simulation_field.rb', line 32

def couch_pedestal
  @couch_pedestal
end

#couch_verticalObject

Returns the value of attribute couch_vertical.



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

def couch_vertical
  @couch_vertical
end

#field_idObject

Returns the value of attribute field_id.



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

def field_id
  @field_id
end

#field_nameObject

Returns the value of attribute field_name.



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

def field_name
  @field_name
end

#field_noteObject

Returns the value of attribute field_note.



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

def field_note
  @field_note
end

#field_xObject

Returns the value of attribute field_x.



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

def field_x
  @field_x
end

#field_x_modeObject

Returns the value of attribute field_x_mode.



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

def field_x_mode
  @field_x_mode
end

#field_yObject

Returns the value of attribute field_y.



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

def field_y
  @field_y
end

#field_y_modeObject

Returns the value of attribute field_y_mode.



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

def field_y_mode
  @field_y_mode
end

#gantry_angleObject

Returns the value of attribute gantry_angle.



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

def gantry_angle
  @gantry_angle
end

#ii_lateralObject

Returns the value of attribute ii_lateral.



58
59
60
# File 'lib/rtp-connect/simulation_field.rb', line 58

def ii_lateral
  @ii_lateral
end

#ii_longitudinalObject

Returns the value of attribute ii_longitudinal.



59
60
61
# File 'lib/rtp-connect/simulation_field.rb', line 59

def ii_longitudinal
  @ii_longitudinal
end

#ii_verticalObject

Returns the value of attribute ii_vertical.



60
61
62
# File 'lib/rtp-connect/simulation_field.rb', line 60

def ii_vertical
  @ii_vertical
end

#kvpObject

Returns the value of attribute kvp.



61
62
63
# File 'lib/rtp-connect/simulation_field.rb', line 61

def kvp
  @kvp
end

#lateral_separationObject

Returns the value of attribute lateral_separation.



36
37
38
# File 'lib/rtp-connect/simulation_field.rb', line 36

def lateral_separation
  @lateral_separation
end

#maObject

Returns the value of attribute ma.



62
63
64
# File 'lib/rtp-connect/simulation_field.rb', line 62

def ma
  @ma
end

#other_label_1Object

Returns the value of attribute other_label_1.



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

def other_label_1
  @other_label_1
end

#other_label_2Object

Returns the value of attribute other_label_2.



41
42
43
# File 'lib/rtp-connect/simulation_field.rb', line 41

def other_label_2
  @other_label_2
end

#other_label_3Object

Returns the value of attribute other_label_3.



44
45
46
# File 'lib/rtp-connect/simulation_field.rb', line 44

def other_label_3
  @other_label_3
end

#other_label_4Object

Returns the value of attribute other_label_4.



47
48
49
# File 'lib/rtp-connect/simulation_field.rb', line 47

def other_label_4
  @other_label_4
end

#other_measurement_1Object

Returns the value of attribute other_measurement_1.



42
43
44
# File 'lib/rtp-connect/simulation_field.rb', line 42

def other_measurement_1
  @other_measurement_1
end

#other_measurement_2Object

Returns the value of attribute other_measurement_2.



43
44
45
# File 'lib/rtp-connect/simulation_field.rb', line 43

def other_measurement_2
  @other_measurement_2
end

#other_measurement_3Object

Returns the value of attribute other_measurement_3.



45
46
47
# File 'lib/rtp-connect/simulation_field.rb', line 45

def other_measurement_3
  @other_measurement_3
end

#other_measurement_4Object

Returns the value of attribute other_measurement_4.



46
47
48
# File 'lib/rtp-connect/simulation_field.rb', line 46

def other_measurement_4
  @other_measurement_4
end

#other_measurement_5Object

Returns the value of attribute other_measurement_5.



48
49
50
# File 'lib/rtp-connect/simulation_field.rb', line 48

def other_measurement_5
  @other_measurement_5
end

#other_measurement_6Object

Returns the value of attribute other_measurement_6.



49
50
51
# File 'lib/rtp-connect/simulation_field.rb', line 49

def other_measurement_6
  @other_measurement_6
end

#pa_separationObject

Returns the value of attribute pa_separation.



35
36
37
# File 'lib/rtp-connect/simulation_field.rb', line 35

def pa_separation
  @pa_separation
end

#parentObject

The Record which this instance belongs to.



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

def parent
  @parent
end

#rx_site_nameObject

Returns the value of attribute rx_site_name.



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

def rx_site_name
  @rx_site_name
end

#sadObject

Returns the value of attribute sad.



33
34
35
# File 'lib/rtp-connect/simulation_field.rb', line 33

def sad
  @sad
end

#secondsObject

Returns the value of attribute seconds.



63
64
65
# File 'lib/rtp-connect/simulation_field.rb', line 63

def seconds
  @seconds
end

#sfd_1Object

Returns the value of attribute sfd_1.



40
41
42
# File 'lib/rtp-connect/simulation_field.rb', line 40

def sfd_1
  @sfd_1
end

#ssd_1Object

Returns the value of attribute ssd_1.



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

def ssd_1
  @ssd_1
end

#tangential_separationObject

Returns the value of attribute tangential_separation.



37
38
39
# File 'lib/rtp-connect/simulation_field.rb', line 37

def tangential_separation
  @tangential_separation
end

#treatment_machineObject

Returns the value of attribute treatment_machine.



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

def treatment_machine
  @treatment_machine
end

Class Method Details

.load(string, parent) ⇒ Field

Creates a new SimulationField by parsing a RTPConnect string line.

Parameters:

  • string (#to_s)

    the simulation field definition record string line

  • parent (Record)

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

Returns:

  • (Field)

    the created SimulationField instance

Raises:

  • (ArgumentError)

    if given a string containing an invalid number of elements



72
73
74
75
# File 'lib/rtp-connect/simulation_field.rb', line 72

def self.load(string, parent)
  sf = self.new(parent)
  sf.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



152
153
154
155
156
# File 'lib/rtp-connect/simulation_field.rb', line 152

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

#childrenArray

Collects the child records of this instance in a properly sorted array.

Returns:

  • (Array)

    an emtpy array



164
165
166
# File 'lib/rtp-connect/simulation_field.rb', line 164

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



174
175
176
# File 'lib/rtp-connect/simulation_field.rb', line 174

def hash
  state.hash
end

#to_simulation_fieldSimulationField

Returns self.

Returns:



182
183
184
# File 'lib/rtp-connect/simulation_field.rb', line 182

def to_simulation_field
  self
end