class RTP::SimulationField
The simulation field class.
@note Relations:
* Parent: Prescription * Children: none
Attributes
The Record
which this instance belongs to.
Public Class Methods
Creates a new SimulationField
by parsing a RTPConnect string line.
@param [#to_s] string the simulation field definition record string line @param [Record] parent a record which is used to determine the proper parent of this instance @return [Field] the created SimulationField
instance @raise [ArgumentError] if given a string containing an invalid number of elements
# File lib/rtp-connect/simulation_field.rb, line 72 def self.load(string, parent) sf = self.new(parent) sf.load(string) end
Creates a new SimulationField
.
@param [Record] parent a record which is used to determine the proper parent of this instance
RTP::Record::new
# 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
Public Instance Methods
Checks for equality.
Other and self are considered equivalent if they are of compatible types and their attributes are equivalent.
@param other an object to be compared with self. @return [Boolean] true if self and other are considered equivalent
# File lib/rtp-connect/simulation_field.rb, line 152 def ==(other) if other.respond_to?(:to_simulation_field) other.send(:state) == state end end
Sets the ap_separation
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 358 def ap_separation=(value) @ap_separation = value && value.to_s end
Sets the blade_x_mode
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 486 def blade_x_mode=(value) @blade_x_mode = value && value.to_s end
Sets the blade_y_mode
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 518 def blade_y_mode=(value) @blade_y_mode = value && value.to_s end
Collects the child records of this instance in a properly sorted array.
@return [Array] an emtpy array
# File lib/rtp-connect/simulation_field.rb, line 164 def children return Array.new end
Sets the collimator_angle
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 238 def collimator_angle=(value) @collimator_angle = value && value.to_s.strip end
Sets the collimator_x1
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 262 def collimator_x1=(value) @collimator_x1 = value && value.to_s.strip end
Sets the collimator_x2
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 270 def collimator_x2=(value) @collimator_x2 = value && value.to_s.strip end
Sets the collimator_y1
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 294 def collimator_y1=(value) @collimator_y1 = value && value.to_s.strip end
Sets the collimator_y2
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 302 def collimator_y2=(value) @collimator_y2 = value && value.to_s.strip end
Sets the couch_angle
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 334 def couch_angle=(value) @couch_angle = value && value.to_s.strip.strip end
Sets the couch_lateral
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 318 def couch_lateral=(value) @couch_lateral = value && value.to_s.strip end
Sets the couch_longitudinal
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 326 def couch_longitudinal=(value) @couch_longitudinal = value && value.to_s.strip end
Sets the couch_pedestal
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 342 def couch_pedestal=(value) @couch_pedestal = value && value.to_s.strip end
Sets the couch_vertical
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 310 def couch_vertical=(value) @couch_vertical = value && value.to_s.strip end
Sets the field_name
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 198 def field_name=(value) @field_name = value && value.to_s end
Sets the field_note
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 214 def field_note=(value) @field_note = value && value.to_s end
Sets the field_x_mode
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 246 def field_x_mode=(value) @field_x_mode = value && value.to_s end
Sets the field_y_mode
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 278 def field_y_mode=(value) @field_y_mode = value && value.to_s end
Sets the gantry_angle
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 230 def gantry_angle=(value) @gantry_angle = value && value.to_s.strip end
Computes a hash code for this object.
@note Two objects with the same attributes will have the same hash code.
@return [Fixnum] the object's hash code
# File lib/rtp-connect/simulation_field.rb, line 174 def hash state.hash end
Sets the ii_lateral
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 550 def ii_lateral=(value) @ii_lateral = value && value.to_s end
Sets the ii_longitudinal
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 558 def ii_longitudinal=(value) @ii_longitudinal = value && value.to_s end
Sets the ii_vertical
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 566 def ii_vertical=(value) @ii_vertical = value && value.to_s end
Sets the kvp attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 574 def kvp=(value) @kvp = value && value.to_s end
Sets the lateral_separation
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 374 def lateral_separation=(value) @lateral_separation = value && value.to_s.strip end
Sets the ma attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 582 def ma=(value) @ma = value && value.to_s end
Sets the other_label_1
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 390 def other_label_1=(value) @other_label_1 = value && value.to_s end
Sets the other_label_2
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 414 def other_label_2=(value) @other_label_2 = value && value.to_s end
Sets the other_label_3
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 438 def other_label_3=(value) @other_label_3 = value && value.to_s end
Sets the other_label_4
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 462 def other_label_4=(value) @other_label_4 = value && value.to_s end
Sets the other_measurement_1
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 422 def other_measurement_1=(value) @other_measurement_1 = value && value.to_s end
Sets the other_measurement_2
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 430 def other_measurement_2=(value) @other_measurement_2 = value && value.to_s end
Sets the other_measurement_3
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 446 def other_measurement_3=(value) @other_measurement_3 = value && value.to_s end
Sets the other_measurement_4
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 454 def other_measurement_4=(value) @other_measurement_4 = value && value.to_s end
Sets the other_measurement_5
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 470 def other_measurement_5=(value) @other_measurement_5 = value && value.to_s end
Sets the other_measurement_6
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 478 def other_measurement_6=(value) @other_measurement_6 = value && value.to_s end
Sets the pa_separation
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 366 def pa_separation=(value) @pa_separation = value && value.to_s.strip end
Sets the rx_site_name
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 190 def rx_site_name=(value) @rx_site_name = value && value.to_s end
Sets the sad attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 350 def sad=(value) @sad = value && value.to_s.strip end
Sets the seconds attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 590 def seconds=(value) @seconds = value && value.to_s end
Sets the tangential_separation
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 382 def tangential_separation=(value) @tangential_separation = value && value.to_s.strip end
Returns self.
@return [SimulationField] self
# File lib/rtp-connect/simulation_field.rb, line 182 def to_simulation_field self end
Sets the treatment_machine
attribute.
@param [nil, to_s
] value the new attribute value
# File lib/rtp-connect/simulation_field.rb, line 222 def treatment_machine=(value) @treatment_machine = value && value.to_s end