class RTP::SimulationField

The simulation field class.

@note Relations:

* Parent: Prescription
* Children: none

Attributes

ap_separation[R]
blade_x[R]
blade_x1[R]
blade_x2[R]
blade_x_mode[R]
blade_y[R]
blade_y1[R]
blade_y2[R]
blade_y_mode[R]
collimator_angle[R]
collimator_x1[R]
collimator_x2[R]
collimator_y1[R]
collimator_y2[R]
couch_angle[R]
couch_lateral[R]
couch_longitudinal[R]
couch_pedestal[R]
couch_vertical[R]
field_id[R]
field_name[R]
field_note[R]
field_x[R]
field_x_mode[R]
field_y[R]
field_y_mode[R]
gantry_angle[R]
ii_lateral[R]
ii_longitudinal[R]
ii_vertical[R]
kvp[R]
lateral_separation[R]
ma[R]
other_label_1[R]
other_label_2[R]
other_label_3[R]
other_label_4[R]
other_measurement_1[R]
other_measurement_2[R]
other_measurement_3[R]
other_measurement_4[R]
other_measurement_5[R]
other_measurement_6[R]
pa_separation[R]
parent[RW]

The Record which this instance belongs to.

rx_site_name[R]
sad[R]
seconds[R]
sfd_1[R]
ssd_1[R]
tangential_separation[R]
treatment_machine[R]

Public Class Methods

load(string, parent) click to toggle source

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
new(parent) click to toggle source

Creates a new SimulationField.

@param [Record] parent a record which is used to determine the proper parent of this instance

Calls superclass method 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

==(other) click to toggle source

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
Also aliased as: eql?
ap_separation=(value) click to toggle source

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
blade_x1=(value) click to toggle source

Sets the blade_x1 attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 502
def blade_x1=(value)
  @blade_x1 = value && value.to_s
end
blade_x2=(value) click to toggle source

Sets the blade_x2 attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 510
def blade_x2=(value)
  @blade_x2 = value && value.to_s
end
blade_x=(value) click to toggle source

Sets the blade_x attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 494
def blade_x=(value)
  @blade_x = value && value.to_s
end
blade_x_mode=(value) click to toggle source

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
blade_y1=(value) click to toggle source

Sets the blade_y1 attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 534
def blade_y1=(value)
  @blade_y1 = value && value.to_s
end
blade_y2=(value) click to toggle source

Sets the blade_y2 attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 542
def blade_y2=(value)
  @blade_y2 = value && value.to_s
end
blade_y=(value) click to toggle source

Sets the blade_y attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 526
def blade_y=(value)
  @blade_y = value && value.to_s
end
blade_y_mode=(value) click to toggle source

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
children() click to toggle source

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
collimator_angle=(value) click to toggle source

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
collimator_x1=(value) click to toggle source

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
collimator_x2=(value) click to toggle source

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
collimator_y1=(value) click to toggle source

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
collimator_y2=(value) click to toggle source

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
couch_angle=(value) click to toggle source

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
couch_lateral=(value) click to toggle source

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
couch_longitudinal=(value) click to toggle source

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
couch_pedestal=(value) click to toggle source

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
couch_vertical=(value) click to toggle source

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
eql?(other)
Alias for: ==
field_id=(value) click to toggle source

Sets the field_id attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 206
def field_id=(value)
  @field_id = value && value.to_s
end
field_name=(value) click to toggle source

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
field_note=(value) click to toggle source

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
field_x=(value) click to toggle source

Sets the field_x attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 254
def field_x=(value)
  @field_x = value && value.to_s.strip
end
field_x_mode=(value) click to toggle source

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
field_y=(value) click to toggle source

Sets the field_y attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 286
def field_y=(value)
  @field_y = value && value.to_s.strip
end
field_y_mode=(value) click to toggle source

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
gantry_angle=(value) click to toggle source

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
hash() click to toggle source

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
ii_lateral=(value) click to toggle source

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
ii_longitudinal=(value) click to toggle source

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
ii_vertical=(value) click to toggle source

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
kvp=(value) click to toggle source

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
lateral_separation=(value) click to toggle source

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
ma=(value) click to toggle source

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
other_label_1=(value) click to toggle source

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
other_label_2=(value) click to toggle source

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
other_label_3=(value) click to toggle source

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
other_label_4=(value) click to toggle source

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
other_measurement_1=(value) click to toggle source

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
other_measurement_2=(value) click to toggle source

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
other_measurement_3=(value) click to toggle source

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
other_measurement_4=(value) click to toggle source

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
other_measurement_5=(value) click to toggle source

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
other_measurement_6=(value) click to toggle source

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
pa_separation=(value) click to toggle source

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
rx_site_name=(value) click to toggle source

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
sad=(value) click to toggle source

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
seconds=(value) click to toggle source

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
sfd_1=(value) click to toggle source

Sets the sfd_1 attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 406
def sfd_1=(value)
  @sfd_1 = value && value.to_s
end
ssd_1=(value) click to toggle source

Sets the ssd_1 attribute.

@param [nil, to_s] value the new attribute value

# File lib/rtp-connect/simulation_field.rb, line 398
def ssd_1=(value)
  @ssd_1 = value && value.to_s
end
tangential_separation=(value) click to toggle source

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
to_simulation_field() click to toggle source

Returns self.

@return [SimulationField] self

# File lib/rtp-connect/simulation_field.rb, line 182
def to_simulation_field
  self
end
treatment_machine=(value) click to toggle source

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