rtp-connect 1.8 → 1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/CHANGELOG.md +124 -114
- data/COPYING +674 -674
- data/Gemfile +2 -2
- data/Gemfile.lock +23 -19
- data/README.md +149 -149
- data/lib/rtp-connect/constants.rb +58 -58
- data/lib/rtp-connect/control_point.rb +38 -95
- data/lib/rtp-connect/dose_tracking.rb +19 -33
- data/lib/rtp-connect/extended_field.rb +1 -20
- data/lib/rtp-connect/extended_plan.rb +115 -134
- data/lib/rtp-connect/field.rb +30 -20
- data/lib/rtp-connect/methods.rb +85 -77
- data/lib/rtp-connect/plan.rb +645 -624
- data/lib/rtp-connect/plan_to_dcm.rb +668 -656
- data/lib/rtp-connect/prescription.rb +39 -20
- data/lib/rtp-connect/record.rb +201 -143
- data/lib/rtp-connect/simulation_field.rb +606 -625
- data/lib/rtp-connect/site_setup.rb +1 -20
- data/lib/rtp-connect/version.rb +5 -5
- data/rtp-connect.gemspec +27 -27
- metadata +32 -32
@@ -9,7 +9,7 @@ module RTP
|
|
9
9
|
class Prescription < Record
|
10
10
|
|
11
11
|
# The Record which this instance belongs to.
|
12
|
-
|
12
|
+
attr_accessor :parent
|
13
13
|
# The SiteSetup record (if any) that belongs to this Prescription.
|
14
14
|
attr_reader :site_setup
|
15
15
|
# An array of SimulationField records (if any) that belongs to this Prescription.
|
@@ -93,6 +93,7 @@ module RTP
|
|
93
93
|
#
|
94
94
|
def add_field(child)
|
95
95
|
@fields << child.to_field
|
96
|
+
child.parent = self
|
96
97
|
end
|
97
98
|
|
98
99
|
# Adds a simulation field record to this instance.
|
@@ -101,6 +102,7 @@ module RTP
|
|
101
102
|
#
|
102
103
|
def add_simulation_field(child)
|
103
104
|
@simulation_fields << child.to_simulation_field
|
105
|
+
child.parent = self
|
104
106
|
end
|
105
107
|
|
106
108
|
# Adds a site setup record to this instance.
|
@@ -109,6 +111,7 @@ module RTP
|
|
109
111
|
#
|
110
112
|
def add_site_setup(child)
|
111
113
|
@site_setup = child.to_site_setup
|
114
|
+
child.parent = self
|
112
115
|
end
|
113
116
|
|
114
117
|
# Collects the child records of this instance in a properly sorted array.
|
@@ -119,6 +122,41 @@ module RTP
|
|
119
122
|
return [@site_setup, @simulation_fields, @fields].flatten.compact
|
120
123
|
end
|
121
124
|
|
125
|
+
# Removes the reference of the given instance from this instance.
|
126
|
+
#
|
127
|
+
# @param [Field, SimulationField, SiteSetup] record a child record to be removed from this instance
|
128
|
+
#
|
129
|
+
def delete(record)
|
130
|
+
case record
|
131
|
+
when Field
|
132
|
+
delete_child(:fields, record)
|
133
|
+
when SimulationField
|
134
|
+
delete_child(:simulation_fields, record)
|
135
|
+
when SiteSetup
|
136
|
+
delete_site_setup
|
137
|
+
else
|
138
|
+
logger.warn("Unknown class (record) given to Prescription#delete: #{record.class}")
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# Removes all field references from this instance.
|
143
|
+
#
|
144
|
+
def delete_fields
|
145
|
+
delete_children(:fields)
|
146
|
+
end
|
147
|
+
|
148
|
+
# Removes all simulation_field references from this instance.
|
149
|
+
#
|
150
|
+
def delete_simulation_fields
|
151
|
+
delete_children(:simulation_fields)
|
152
|
+
end
|
153
|
+
|
154
|
+
# Removes the site setup reference from this instance.
|
155
|
+
#
|
156
|
+
def delete_site_setup
|
157
|
+
delete_child(:site_setup)
|
158
|
+
end
|
159
|
+
|
122
160
|
# Computes a hash code for this object.
|
123
161
|
#
|
124
162
|
# @note Two objects with the same attributes will have the same hash code.
|
@@ -137,25 +175,6 @@ module RTP
|
|
137
175
|
self
|
138
176
|
end
|
139
177
|
|
140
|
-
# Encodes the Prescription object + any hiearchy of child objects,
|
141
|
-
# to a properly formatted RTPConnect ascii string.
|
142
|
-
#
|
143
|
-
# @param [Hash] options an optional hash parameter
|
144
|
-
# @option options [Float] :version the Mosaiq compatibility version number (e.g. 2.4) used for the output
|
145
|
-
# @return [String] an RTP string with a single or multiple lines/records
|
146
|
-
#
|
147
|
-
def to_s(options={})
|
148
|
-
str = encode(options)
|
149
|
-
if children
|
150
|
-
children.each do |child|
|
151
|
-
str += child.to_s(options)
|
152
|
-
end
|
153
|
-
end
|
154
|
-
return str
|
155
|
-
end
|
156
|
-
|
157
|
-
alias :to_str :to_s
|
158
|
-
|
159
178
|
# Sets the course_id attribute.
|
160
179
|
#
|
161
180
|
# @param [nil, #to_s] value the new attribute value
|
data/lib/rtp-connect/record.rb
CHANGED
@@ -1,144 +1,202 @@
|
|
1
|
-
module RTP
|
2
|
-
|
3
|
-
# The Record class contains attributes and methods that are common
|
4
|
-
# for the various record types defined in the RTPConnect standard.
|
5
|
-
#
|
6
|
-
class Record
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
#
|
14
|
-
|
15
|
-
#
|
16
|
-
|
17
|
-
|
18
|
-
#
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
#
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
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
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
#
|
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
|
-
|
143
|
-
|
1
|
+
module RTP
|
2
|
+
|
3
|
+
# The Record class contains attributes and methods that are common
|
4
|
+
# for the various record types defined in the RTPConnect standard.
|
5
|
+
#
|
6
|
+
class Record
|
7
|
+
|
8
|
+
# For most record types, there are no surplus (grouped) attributes.
|
9
|
+
NR_SURPLUS_ATTRIBUTES = 0
|
10
|
+
|
11
|
+
# An array of the record's attributes.
|
12
|
+
attr_reader :attributes
|
13
|
+
# The keyword defines the record type of a particular RTP string line.
|
14
|
+
attr_reader :keyword
|
15
|
+
# The CRC is used to validate the integrity of the content of the RTP string line.
|
16
|
+
attr_reader :crc
|
17
|
+
|
18
|
+
# Creates a new Record.
|
19
|
+
#
|
20
|
+
# @param [String] keyword the keyword which identifies this record
|
21
|
+
# @param [Integer] min_elements the minimum number of data elements required for this record
|
22
|
+
# @param [Integer] max_elements the maximum supported number of data elements for this record
|
23
|
+
#
|
24
|
+
def initialize(keyword, min_elements, max_elements)
|
25
|
+
@keyword = keyword
|
26
|
+
@min_elements = min_elements
|
27
|
+
@max_elements = max_elements
|
28
|
+
end
|
29
|
+
|
30
|
+
# Sets the crc (checksum) attribute.
|
31
|
+
#
|
32
|
+
# @note This value is not used when creating an RTP string from a record (a new crc is calculated)
|
33
|
+
# @param [#to_s] value the new attribute value
|
34
|
+
#
|
35
|
+
def crc=(value)
|
36
|
+
@crc = value.to_s
|
37
|
+
end
|
38
|
+
|
39
|
+
# Encodes a string from the contents of this instance.
|
40
|
+
#
|
41
|
+
# This produces the full record string line, including a computed CRC checksum.
|
42
|
+
#
|
43
|
+
# @param [Hash] options an optional hash parameter
|
44
|
+
# @option options [Float] :version the Mosaiq compatibility version number (e.g. 2.4) used for the output
|
45
|
+
# @return [String] a proper RTPConnect type CSV string
|
46
|
+
#
|
47
|
+
def encode(options={})
|
48
|
+
encoded_values = values.collect {|v| v && v.encode('ISO8859-1')}
|
49
|
+
encoded_values = discard_unsupported_attributes(encoded_values, options) if options[:version]
|
50
|
+
content = CSV.generate_line(encoded_values, force_quotes: true, row_sep: '') + ","
|
51
|
+
checksum = content.checksum
|
52
|
+
# Complete string is content + checksum (in double quotes) + carriage return + line feed
|
53
|
+
return (content + checksum.to_s.wrap + "\r\n").encode('ISO8859-1')
|
54
|
+
end
|
55
|
+
|
56
|
+
# Follows the tree of parents until the appropriate parent of the requesting record is found.
|
57
|
+
#
|
58
|
+
# @param [Record] last_parent the previous parent (the record from the previous line in the RTP file)
|
59
|
+
# @param [Record] klass the expected parent record class of this record (e.g. Plan, Field)
|
60
|
+
#
|
61
|
+
def get_parent(last_parent, klass)
|
62
|
+
if last_parent.is_a?(klass)
|
63
|
+
return last_parent
|
64
|
+
else
|
65
|
+
return last_parent.get_parent(last_parent.parent, klass)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# Verifies a proposed keyword attribute.
|
70
|
+
#
|
71
|
+
# @note Since only a specific string is accepted, this is more of an argument check than a traditional setter method.
|
72
|
+
# @param [#to_s] value the proposed keyword attribute
|
73
|
+
# @raise [ArgumentError] if given an unexpected keyword
|
74
|
+
#
|
75
|
+
def keyword=(value)
|
76
|
+
value = value.to_s.upcase
|
77
|
+
raise ArgumentError, "Invalid keyword. Expected '#{@keyword}', got #{value}." unless value == @keyword
|
78
|
+
end
|
79
|
+
|
80
|
+
# Sets up a record by parsing a RTPConnect string line.
|
81
|
+
#
|
82
|
+
# @param [#to_s] string the extended treatment field definition record string line
|
83
|
+
# @return [Record] the updated Record instance
|
84
|
+
# @raise [ArgumentError] if given a string containing an invalid number of elements
|
85
|
+
#
|
86
|
+
def load(string, options={})
|
87
|
+
# Extract processed values:
|
88
|
+
values = string.to_s.values(options[:repair])
|
89
|
+
raise ArgumentError, "Invalid argument 'string': Expected at least #{@min_elements} elements for #{@keyword}, got #{values.length}." if values.length < @min_elements
|
90
|
+
RTP.logger.warn "The number of given elements (#{values.length}) exceeds the known number of data elements for this record (#{@max_elements}). This may indicate an invalid string record or that the RTP format has recently been expanded with new elements." if values.length > @max_elements
|
91
|
+
self.send(:set_attributes, values)
|
92
|
+
self
|
93
|
+
end
|
94
|
+
|
95
|
+
# Returns self.
|
96
|
+
#
|
97
|
+
# @return [Record] self
|
98
|
+
#
|
99
|
+
def to_record
|
100
|
+
self
|
101
|
+
end
|
102
|
+
|
103
|
+
# Encodes the record + any hiearchy of child objects,
|
104
|
+
# to a properly formatted RTPConnect ascii string.
|
105
|
+
#
|
106
|
+
# @param [Hash] options an optional hash parameter
|
107
|
+
# @option options [Float] :version the Mosaiq compatibility version number (e.g. 2.4) used for the output
|
108
|
+
# @return [String] an RTP string with a single or multiple lines/records
|
109
|
+
#
|
110
|
+
def to_s(options={})
|
111
|
+
str = encode(options)
|
112
|
+
children.each do |child|
|
113
|
+
# Note that the extended plan record was introduced in Mosaiq 2.5.
|
114
|
+
str += child.to_s(options) unless child.class == ExtendedPlan && options[:version].to_f < 2.5
|
115
|
+
end
|
116
|
+
str
|
117
|
+
end
|
118
|
+
|
119
|
+
alias :to_str :to_s
|
120
|
+
|
121
|
+
# Collects the values (attributes) of this instance.
|
122
|
+
#
|
123
|
+
# @note The CRC is not considered part of the actual values and is excluded.
|
124
|
+
# @return [Array<String>] an array of attributes (in the same order as they appear in the RTP string)
|
125
|
+
#
|
126
|
+
def values
|
127
|
+
@attributes.collect {|attribute| self.send(attribute)}
|
128
|
+
end
|
129
|
+
|
130
|
+
|
131
|
+
private
|
132
|
+
|
133
|
+
|
134
|
+
# Removes the reference of the given instance from the attribute of this record.
|
135
|
+
#
|
136
|
+
# @param [Symbol] attribute the name of the child attribute from which to remove a child
|
137
|
+
# @param [Record] instance a child record to be removed from this instance
|
138
|
+
#
|
139
|
+
def delete_child(attribute, instance=nil)
|
140
|
+
if self.send(attribute).is_a?(Array)
|
141
|
+
deleted = self.send(attribute).delete(instance)
|
142
|
+
deleted.parent = nil if deleted
|
143
|
+
else
|
144
|
+
self.send(attribute).parent = nil if self.send(attribute)
|
145
|
+
self.instance_variable_set("@#{attribute}", nil)
|
146
|
+
end
|
147
|
+
end
|
148
|
+
|
149
|
+
# Removes all child references of the given type from this instance.
|
150
|
+
#
|
151
|
+
# @param [Symbol] attribute the name of the child attribute to be cleared
|
152
|
+
#
|
153
|
+
def delete_children(attribute)
|
154
|
+
self.send(attribute).each { |c| c.parent = nil }
|
155
|
+
self.send(attribute).clear
|
156
|
+
end
|
157
|
+
|
158
|
+
# Sets the attributes of the record instance.
|
159
|
+
#
|
160
|
+
# @param [Array<String>] values the record attributes (as parsed from a record string)
|
161
|
+
#
|
162
|
+
def set_attributes(values)
|
163
|
+
import_indices([values.length - 1, @max_elements - 1].min).each_with_index do |indices, i|
|
164
|
+
param = values.values_at(*indices)
|
165
|
+
param = param[0] if param.length == 1
|
166
|
+
self.send("#{@attributes[i]}=", param)
|
167
|
+
end
|
168
|
+
@crc = values[-1]
|
169
|
+
end
|
170
|
+
|
171
|
+
# Gives an array of indices indicating where the attributes of this record gets its
|
172
|
+
# values from in the comma separated string which the instance is created from.
|
173
|
+
#
|
174
|
+
# @param [Integer] length the number of elements to create in the indices array
|
175
|
+
#
|
176
|
+
def import_indices(length)
|
177
|
+
Array.new(length - NR_SURPLUS_ATTRIBUTES) { |i| [i] }
|
178
|
+
end
|
179
|
+
|
180
|
+
# Removes any attributes that are newer than the given compatibility target version.
|
181
|
+
# E.g. if a compatibility version of Mosaiq 2.4 is specified, attributes that were
|
182
|
+
# introduced in Mosaiq 2.5 or later is removed before the RTP string is created.
|
183
|
+
#
|
184
|
+
# @param [Array<String>] values the complete set of values of this record
|
185
|
+
# @param [Hash] options an optional hash parameter
|
186
|
+
# @option options [Float] :version the Mosaiq compatibility version number (e.g. 2.4) used for the output
|
187
|
+
# @return [Array<String>] an array of attributes where some of the recent attributes may have been removed
|
188
|
+
#
|
189
|
+
def discard_unsupported_attributes(values, options={})
|
190
|
+
case self
|
191
|
+
when SiteSetup
|
192
|
+
options[:version].to_f >= 2.6 ? values : values[0..-4]
|
193
|
+
when ExtendedField
|
194
|
+
options[:version].to_f >= 2.4 ? values : values[0..-5]
|
195
|
+
else
|
196
|
+
values
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
end
|
201
|
+
|
144
202
|
end
|
@@ -1,626 +1,607 @@
|
|
1
|
-
module RTP
|
2
|
-
|
3
|
-
# The simulation field class.
|
4
|
-
#
|
5
|
-
# @note Relations:
|
6
|
-
# * Parent: Prescription
|
7
|
-
# * Children: none
|
8
|
-
#
|
9
|
-
class SimulationField < Record
|
10
|
-
|
11
|
-
# The Record which this instance belongs to.
|
12
|
-
|
13
|
-
attr_reader :rx_site_name
|
14
|
-
attr_reader :field_name
|
15
|
-
attr_reader :field_id
|
16
|
-
attr_reader :field_note
|
17
|
-
attr_reader :treatment_machine
|
18
|
-
attr_reader :gantry_angle
|
19
|
-
attr_reader :collimator_angle
|
20
|
-
attr_reader :field_x_mode
|
21
|
-
attr_reader :field_x
|
22
|
-
attr_reader :collimator_x1
|
23
|
-
attr_reader :collimator_x2
|
24
|
-
attr_reader :field_y_mode
|
25
|
-
attr_reader :field_y
|
26
|
-
attr_reader :collimator_y1
|
27
|
-
attr_reader :collimator_y2
|
28
|
-
attr_reader :couch_vertical
|
29
|
-
attr_reader :couch_lateral
|
30
|
-
attr_reader :couch_longitudinal
|
31
|
-
attr_reader :couch_angle
|
32
|
-
attr_reader :couch_pedestal
|
33
|
-
attr_reader :sad
|
34
|
-
attr_reader :ap_separation
|
35
|
-
attr_reader :pa_separation
|
36
|
-
attr_reader :lateral_separation
|
37
|
-
attr_reader :tangential_separation
|
38
|
-
attr_reader :other_label_1
|
39
|
-
attr_reader :ssd_1
|
40
|
-
attr_reader :sfd_1
|
41
|
-
attr_reader :other_label_2
|
42
|
-
attr_reader :other_measurement_1
|
43
|
-
attr_reader :other_measurement_2
|
44
|
-
attr_reader :other_label_3
|
45
|
-
attr_reader :other_measurement_3
|
46
|
-
attr_reader :other_measurement_4
|
47
|
-
attr_reader :other_label_4
|
48
|
-
attr_reader :other_measurement_5
|
49
|
-
attr_reader :other_measurement_6
|
50
|
-
attr_reader :blade_x_mode
|
51
|
-
attr_reader :blade_x
|
52
|
-
attr_reader :blade_x1
|
53
|
-
attr_reader :blade_x2
|
54
|
-
attr_reader :blade_y_mode
|
55
|
-
attr_reader :blade_y
|
56
|
-
attr_reader :blade_y1
|
57
|
-
attr_reader :blade_y2
|
58
|
-
attr_reader :ii_lateral
|
59
|
-
attr_reader :ii_longitudinal
|
60
|
-
attr_reader :ii_vertical
|
61
|
-
attr_reader :kvp
|
62
|
-
attr_reader :ma
|
63
|
-
attr_reader :seconds
|
64
|
-
|
65
|
-
# Creates a new SimulationField by parsing a RTPConnect string line.
|
66
|
-
#
|
67
|
-
# @param [#to_s] string the simulation field definition record string line
|
68
|
-
# @param [Record] parent a record which is used to determine the proper parent of this instance
|
69
|
-
# @return [Field] the created SimulationField instance
|
70
|
-
# @raise [ArgumentError] if given a string containing an invalid number of elements
|
71
|
-
#
|
72
|
-
def self.load(string, parent)
|
73
|
-
sf = self.new(parent)
|
74
|
-
sf.load(string)
|
75
|
-
end
|
76
|
-
|
77
|
-
# Creates a new SimulationField.
|
78
|
-
#
|
79
|
-
# @param [Record] parent a record which is used to determine the proper parent of this instance
|
80
|
-
#
|
81
|
-
def initialize(parent)
|
82
|
-
super('SIM_DEF', 17, 53)
|
83
|
-
# Parent relation (may get more than one type of record here):
|
84
|
-
@parent = get_parent(parent.to_record, Prescription)
|
85
|
-
@parent.add_simulation_field(self)
|
86
|
-
@attributes = [
|
87
|
-
# Required:
|
88
|
-
:keyword,
|
89
|
-
:rx_site_name,
|
90
|
-
:field_name,
|
91
|
-
:field_id,
|
92
|
-
:field_note,
|
93
|
-
:treatment_machine,
|
94
|
-
:gantry_angle,
|
95
|
-
:collimator_angle,
|
96
|
-
:field_x_mode,
|
97
|
-
:field_x,
|
98
|
-
:collimator_x1,
|
99
|
-
:collimator_x2,
|
100
|
-
:field_y_mode,
|
101
|
-
:field_y,
|
102
|
-
:collimator_y1,
|
103
|
-
:collimator_y2,
|
104
|
-
# Optional:
|
105
|
-
:couch_vertical,
|
106
|
-
:couch_lateral,
|
107
|
-
:couch_longitudinal,
|
108
|
-
:couch_angle,
|
109
|
-
:couch_pedestal,
|
110
|
-
:sad,
|
111
|
-
:ap_separation,
|
112
|
-
:pa_separation,
|
113
|
-
:lateral_separation,
|
114
|
-
:tangential_separation,
|
115
|
-
:other_label_1,
|
116
|
-
:ssd_1,
|
117
|
-
:sfd_1,
|
118
|
-
:other_label_2,
|
119
|
-
:other_measurement_1,
|
120
|
-
:other_measurement_2,
|
121
|
-
:other_label_3,
|
122
|
-
:other_measurement_3,
|
123
|
-
:other_measurement_4,
|
124
|
-
:other_label_4,
|
125
|
-
:other_measurement_5,
|
126
|
-
:other_measurement_6,
|
127
|
-
:blade_x_mode,
|
128
|
-
:blade_x,
|
129
|
-
:blade_x1,
|
130
|
-
:blade_x2,
|
131
|
-
:blade_y_mode,
|
132
|
-
:blade_y,
|
133
|
-
:blade_y1,
|
134
|
-
:blade_y2,
|
135
|
-
:ii_lateral,
|
136
|
-
:ii_longitudinal,
|
137
|
-
:ii_vertical,
|
138
|
-
:kvp,
|
139
|
-
:ma,
|
140
|
-
:seconds
|
141
|
-
]
|
142
|
-
end
|
143
|
-
|
144
|
-
# Checks for equality.
|
145
|
-
#
|
146
|
-
# Other and self are considered equivalent if they are
|
147
|
-
# of compatible types and their attributes are equivalent.
|
148
|
-
#
|
149
|
-
# @param other an object to be compared with self.
|
150
|
-
# @return [Boolean] true if self and other are considered equivalent
|
151
|
-
#
|
152
|
-
def ==(other)
|
153
|
-
if other.respond_to?(:to_simulation_field)
|
154
|
-
other.send(:state) == state
|
155
|
-
end
|
156
|
-
end
|
157
|
-
|
158
|
-
alias_method :eql?, :==
|
159
|
-
|
160
|
-
# Collects the child records of this instance in a properly sorted array.
|
161
|
-
#
|
162
|
-
# @return [Array] an emtpy array
|
163
|
-
#
|
164
|
-
def children
|
165
|
-
return Array.new
|
166
|
-
end
|
167
|
-
|
168
|
-
# Computes a hash code for this object.
|
169
|
-
#
|
170
|
-
# @note Two objects with the same attributes will have the same hash code.
|
171
|
-
#
|
172
|
-
# @return [Fixnum] the object's hash code
|
173
|
-
#
|
174
|
-
def hash
|
175
|
-
state.hash
|
176
|
-
end
|
177
|
-
|
178
|
-
# Returns self.
|
179
|
-
#
|
180
|
-
# @return [SimulationField] self
|
181
|
-
#
|
182
|
-
def to_simulation_field
|
183
|
-
self
|
184
|
-
end
|
185
|
-
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
#
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
#
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
#
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
#
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
#
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
#
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
#
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
#
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
#
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
#
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
#
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
#
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
#
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
#
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
#
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
#
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
#
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
#
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
#
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
#
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
#
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
#
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
#
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
#
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
#
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
#
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
#
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
#
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
#
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
#
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
#
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
#
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
#
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
#
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
#
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
#
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
#
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
#
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
#
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
#
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
#
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
#
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
#
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
#
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
#
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
#
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
#
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
#
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
#
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
#
|
599
|
-
#
|
600
|
-
#
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
# @param [nil, #to_s] value the new attribute value
|
608
|
-
#
|
609
|
-
def seconds=(value)
|
610
|
-
@seconds = value && value.to_s
|
611
|
-
end
|
612
|
-
|
613
|
-
|
614
|
-
private
|
615
|
-
|
616
|
-
|
617
|
-
# Collects the attributes of this instance.
|
618
|
-
#
|
619
|
-
# @note The CRC is not considered part of the attributes of interest and is excluded
|
620
|
-
# @return [Array<String>] an array of attributes
|
621
|
-
#
|
622
|
-
alias_method :state, :values
|
623
|
-
|
624
|
-
end
|
625
|
-
|
1
|
+
module RTP
|
2
|
+
|
3
|
+
# The simulation field class.
|
4
|
+
#
|
5
|
+
# @note Relations:
|
6
|
+
# * Parent: Prescription
|
7
|
+
# * Children: none
|
8
|
+
#
|
9
|
+
class SimulationField < Record
|
10
|
+
|
11
|
+
# The Record which this instance belongs to.
|
12
|
+
attr_accessor :parent
|
13
|
+
attr_reader :rx_site_name
|
14
|
+
attr_reader :field_name
|
15
|
+
attr_reader :field_id
|
16
|
+
attr_reader :field_note
|
17
|
+
attr_reader :treatment_machine
|
18
|
+
attr_reader :gantry_angle
|
19
|
+
attr_reader :collimator_angle
|
20
|
+
attr_reader :field_x_mode
|
21
|
+
attr_reader :field_x
|
22
|
+
attr_reader :collimator_x1
|
23
|
+
attr_reader :collimator_x2
|
24
|
+
attr_reader :field_y_mode
|
25
|
+
attr_reader :field_y
|
26
|
+
attr_reader :collimator_y1
|
27
|
+
attr_reader :collimator_y2
|
28
|
+
attr_reader :couch_vertical
|
29
|
+
attr_reader :couch_lateral
|
30
|
+
attr_reader :couch_longitudinal
|
31
|
+
attr_reader :couch_angle
|
32
|
+
attr_reader :couch_pedestal
|
33
|
+
attr_reader :sad
|
34
|
+
attr_reader :ap_separation
|
35
|
+
attr_reader :pa_separation
|
36
|
+
attr_reader :lateral_separation
|
37
|
+
attr_reader :tangential_separation
|
38
|
+
attr_reader :other_label_1
|
39
|
+
attr_reader :ssd_1
|
40
|
+
attr_reader :sfd_1
|
41
|
+
attr_reader :other_label_2
|
42
|
+
attr_reader :other_measurement_1
|
43
|
+
attr_reader :other_measurement_2
|
44
|
+
attr_reader :other_label_3
|
45
|
+
attr_reader :other_measurement_3
|
46
|
+
attr_reader :other_measurement_4
|
47
|
+
attr_reader :other_label_4
|
48
|
+
attr_reader :other_measurement_5
|
49
|
+
attr_reader :other_measurement_6
|
50
|
+
attr_reader :blade_x_mode
|
51
|
+
attr_reader :blade_x
|
52
|
+
attr_reader :blade_x1
|
53
|
+
attr_reader :blade_x2
|
54
|
+
attr_reader :blade_y_mode
|
55
|
+
attr_reader :blade_y
|
56
|
+
attr_reader :blade_y1
|
57
|
+
attr_reader :blade_y2
|
58
|
+
attr_reader :ii_lateral
|
59
|
+
attr_reader :ii_longitudinal
|
60
|
+
attr_reader :ii_vertical
|
61
|
+
attr_reader :kvp
|
62
|
+
attr_reader :ma
|
63
|
+
attr_reader :seconds
|
64
|
+
|
65
|
+
# Creates a new SimulationField by parsing a RTPConnect string line.
|
66
|
+
#
|
67
|
+
# @param [#to_s] string the simulation field definition record string line
|
68
|
+
# @param [Record] parent a record which is used to determine the proper parent of this instance
|
69
|
+
# @return [Field] the created SimulationField instance
|
70
|
+
# @raise [ArgumentError] if given a string containing an invalid number of elements
|
71
|
+
#
|
72
|
+
def self.load(string, parent)
|
73
|
+
sf = self.new(parent)
|
74
|
+
sf.load(string)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Creates a new SimulationField.
|
78
|
+
#
|
79
|
+
# @param [Record] parent a record which is used to determine the proper parent of this instance
|
80
|
+
#
|
81
|
+
def initialize(parent)
|
82
|
+
super('SIM_DEF', 17, 53)
|
83
|
+
# Parent relation (may get more than one type of record here):
|
84
|
+
@parent = get_parent(parent.to_record, Prescription)
|
85
|
+
@parent.add_simulation_field(self)
|
86
|
+
@attributes = [
|
87
|
+
# Required:
|
88
|
+
:keyword,
|
89
|
+
:rx_site_name,
|
90
|
+
:field_name,
|
91
|
+
:field_id,
|
92
|
+
:field_note,
|
93
|
+
:treatment_machine,
|
94
|
+
:gantry_angle,
|
95
|
+
:collimator_angle,
|
96
|
+
:field_x_mode,
|
97
|
+
:field_x,
|
98
|
+
:collimator_x1,
|
99
|
+
:collimator_x2,
|
100
|
+
:field_y_mode,
|
101
|
+
:field_y,
|
102
|
+
:collimator_y1,
|
103
|
+
:collimator_y2,
|
104
|
+
# Optional:
|
105
|
+
:couch_vertical,
|
106
|
+
:couch_lateral,
|
107
|
+
:couch_longitudinal,
|
108
|
+
:couch_angle,
|
109
|
+
:couch_pedestal,
|
110
|
+
:sad,
|
111
|
+
:ap_separation,
|
112
|
+
:pa_separation,
|
113
|
+
:lateral_separation,
|
114
|
+
:tangential_separation,
|
115
|
+
:other_label_1,
|
116
|
+
:ssd_1,
|
117
|
+
:sfd_1,
|
118
|
+
:other_label_2,
|
119
|
+
:other_measurement_1,
|
120
|
+
:other_measurement_2,
|
121
|
+
:other_label_3,
|
122
|
+
:other_measurement_3,
|
123
|
+
:other_measurement_4,
|
124
|
+
:other_label_4,
|
125
|
+
:other_measurement_5,
|
126
|
+
:other_measurement_6,
|
127
|
+
:blade_x_mode,
|
128
|
+
:blade_x,
|
129
|
+
:blade_x1,
|
130
|
+
:blade_x2,
|
131
|
+
:blade_y_mode,
|
132
|
+
:blade_y,
|
133
|
+
:blade_y1,
|
134
|
+
:blade_y2,
|
135
|
+
:ii_lateral,
|
136
|
+
:ii_longitudinal,
|
137
|
+
:ii_vertical,
|
138
|
+
:kvp,
|
139
|
+
:ma,
|
140
|
+
:seconds
|
141
|
+
]
|
142
|
+
end
|
143
|
+
|
144
|
+
# Checks for equality.
|
145
|
+
#
|
146
|
+
# Other and self are considered equivalent if they are
|
147
|
+
# of compatible types and their attributes are equivalent.
|
148
|
+
#
|
149
|
+
# @param other an object to be compared with self.
|
150
|
+
# @return [Boolean] true if self and other are considered equivalent
|
151
|
+
#
|
152
|
+
def ==(other)
|
153
|
+
if other.respond_to?(:to_simulation_field)
|
154
|
+
other.send(:state) == state
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
alias_method :eql?, :==
|
159
|
+
|
160
|
+
# Collects the child records of this instance in a properly sorted array.
|
161
|
+
#
|
162
|
+
# @return [Array] an emtpy array
|
163
|
+
#
|
164
|
+
def children
|
165
|
+
return Array.new
|
166
|
+
end
|
167
|
+
|
168
|
+
# Computes a hash code for this object.
|
169
|
+
#
|
170
|
+
# @note Two objects with the same attributes will have the same hash code.
|
171
|
+
#
|
172
|
+
# @return [Fixnum] the object's hash code
|
173
|
+
#
|
174
|
+
def hash
|
175
|
+
state.hash
|
176
|
+
end
|
177
|
+
|
178
|
+
# Returns self.
|
179
|
+
#
|
180
|
+
# @return [SimulationField] self
|
181
|
+
#
|
182
|
+
def to_simulation_field
|
183
|
+
self
|
184
|
+
end
|
185
|
+
|
186
|
+
# Sets the rx_site_name attribute.
|
187
|
+
#
|
188
|
+
# @param [nil, #to_s] value the new attribute value
|
189
|
+
#
|
190
|
+
def rx_site_name=(value)
|
191
|
+
@rx_site_name = value && value.to_s
|
192
|
+
end
|
193
|
+
|
194
|
+
# Sets the field_name attribute.
|
195
|
+
#
|
196
|
+
# @param [nil, #to_s] value the new attribute value
|
197
|
+
#
|
198
|
+
def field_name=(value)
|
199
|
+
@field_name = value && value.to_s
|
200
|
+
end
|
201
|
+
|
202
|
+
# Sets the field_id attribute.
|
203
|
+
#
|
204
|
+
# @param [nil, #to_s] value the new attribute value
|
205
|
+
#
|
206
|
+
def field_id=(value)
|
207
|
+
@field_id = value && value.to_s
|
208
|
+
end
|
209
|
+
|
210
|
+
# Sets the field_note attribute.
|
211
|
+
#
|
212
|
+
# @param [nil, #to_s] value the new attribute value
|
213
|
+
#
|
214
|
+
def field_note=(value)
|
215
|
+
@field_note = value && value.to_s
|
216
|
+
end
|
217
|
+
|
218
|
+
# Sets the treatment_machine attribute.
|
219
|
+
#
|
220
|
+
# @param [nil, #to_s] value the new attribute value
|
221
|
+
#
|
222
|
+
def treatment_machine=(value)
|
223
|
+
@treatment_machine = value && value.to_s
|
224
|
+
end
|
225
|
+
|
226
|
+
# Sets the gantry_angle attribute.
|
227
|
+
#
|
228
|
+
# @param [nil, #to_s] value the new attribute value
|
229
|
+
#
|
230
|
+
def gantry_angle=(value)
|
231
|
+
@gantry_angle = value && value.to_s.strip
|
232
|
+
end
|
233
|
+
|
234
|
+
# Sets the collimator_angle attribute.
|
235
|
+
#
|
236
|
+
# @param [nil, #to_s] value the new attribute value
|
237
|
+
#
|
238
|
+
def collimator_angle=(value)
|
239
|
+
@collimator_angle = value && value.to_s.strip
|
240
|
+
end
|
241
|
+
|
242
|
+
# Sets the field_x_mode attribute.
|
243
|
+
#
|
244
|
+
# @param [nil, #to_s] value the new attribute value
|
245
|
+
#
|
246
|
+
def field_x_mode=(value)
|
247
|
+
@field_x_mode = value && value.to_s
|
248
|
+
end
|
249
|
+
|
250
|
+
# Sets the field_x attribute.
|
251
|
+
#
|
252
|
+
# @param [nil, #to_s] value the new attribute value
|
253
|
+
#
|
254
|
+
def field_x=(value)
|
255
|
+
@field_x = value && value.to_s.strip
|
256
|
+
end
|
257
|
+
|
258
|
+
# Sets the collimator_x1 attribute.
|
259
|
+
#
|
260
|
+
# @param [nil, #to_s] value the new attribute value
|
261
|
+
#
|
262
|
+
def collimator_x1=(value)
|
263
|
+
@collimator_x1 = value && value.to_s.strip
|
264
|
+
end
|
265
|
+
|
266
|
+
# Sets the collimator_x2 attribute.
|
267
|
+
#
|
268
|
+
# @param [nil, #to_s] value the new attribute value
|
269
|
+
#
|
270
|
+
def collimator_x2=(value)
|
271
|
+
@collimator_x2 = value && value.to_s.strip
|
272
|
+
end
|
273
|
+
|
274
|
+
# Sets the field_y_mode attribute.
|
275
|
+
#
|
276
|
+
# @param [nil, #to_s] value the new attribute value
|
277
|
+
#
|
278
|
+
def field_y_mode=(value)
|
279
|
+
@field_y_mode = value && value.to_s
|
280
|
+
end
|
281
|
+
|
282
|
+
# Sets the field_y attribute.
|
283
|
+
#
|
284
|
+
# @param [nil, #to_s] value the new attribute value
|
285
|
+
#
|
286
|
+
def field_y=(value)
|
287
|
+
@field_y = value && value.to_s.strip
|
288
|
+
end
|
289
|
+
|
290
|
+
# Sets the collimator_y1 attribute.
|
291
|
+
#
|
292
|
+
# @param [nil, #to_s] value the new attribute value
|
293
|
+
#
|
294
|
+
def collimator_y1=(value)
|
295
|
+
@collimator_y1 = value && value.to_s.strip
|
296
|
+
end
|
297
|
+
|
298
|
+
# Sets the collimator_y2 attribute.
|
299
|
+
#
|
300
|
+
# @param [nil, #to_s] value the new attribute value
|
301
|
+
#
|
302
|
+
def collimator_y2=(value)
|
303
|
+
@collimator_y2 = value && value.to_s.strip
|
304
|
+
end
|
305
|
+
|
306
|
+
# Sets the couch_vertical attribute.
|
307
|
+
#
|
308
|
+
# @param [nil, #to_s] value the new attribute value
|
309
|
+
#
|
310
|
+
def couch_vertical=(value)
|
311
|
+
@couch_vertical = value && value.to_s.strip
|
312
|
+
end
|
313
|
+
|
314
|
+
# Sets the couch_lateral attribute.
|
315
|
+
#
|
316
|
+
# @param [nil, #to_s] value the new attribute value
|
317
|
+
#
|
318
|
+
def couch_lateral=(value)
|
319
|
+
@couch_lateral = value && value.to_s.strip
|
320
|
+
end
|
321
|
+
|
322
|
+
# Sets the couch_longitudinal attribute.
|
323
|
+
#
|
324
|
+
# @param [nil, #to_s] value the new attribute value
|
325
|
+
#
|
326
|
+
def couch_longitudinal=(value)
|
327
|
+
@couch_longitudinal = value && value.to_s.strip
|
328
|
+
end
|
329
|
+
|
330
|
+
# Sets the couch_angle attribute.
|
331
|
+
#
|
332
|
+
# @param [nil, #to_s] value the new attribute value
|
333
|
+
#
|
334
|
+
def couch_angle=(value)
|
335
|
+
@couch_angle = value && value.to_s.strip.strip
|
336
|
+
end
|
337
|
+
|
338
|
+
# Sets the couch_pedestal attribute.
|
339
|
+
#
|
340
|
+
# @param [nil, #to_s] value the new attribute value
|
341
|
+
#
|
342
|
+
def couch_pedestal=(value)
|
343
|
+
@couch_pedestal = value && value.to_s.strip
|
344
|
+
end
|
345
|
+
|
346
|
+
# Sets the sad attribute.
|
347
|
+
#
|
348
|
+
# @param [nil, #to_s] value the new attribute value
|
349
|
+
#
|
350
|
+
def sad=(value)
|
351
|
+
@sad = value && value.to_s.strip
|
352
|
+
end
|
353
|
+
|
354
|
+
# Sets the ap_separation attribute.
|
355
|
+
#
|
356
|
+
# @param [nil, #to_s] value the new attribute value
|
357
|
+
#
|
358
|
+
def ap_separation=(value)
|
359
|
+
@ap_separation = value && value.to_s
|
360
|
+
end
|
361
|
+
|
362
|
+
# Sets the pa_separation attribute.
|
363
|
+
#
|
364
|
+
# @param [nil, #to_s] value the new attribute value
|
365
|
+
#
|
366
|
+
def pa_separation=(value)
|
367
|
+
@pa_separation = value && value.to_s.strip
|
368
|
+
end
|
369
|
+
|
370
|
+
# Sets the lateral_separation attribute.
|
371
|
+
#
|
372
|
+
# @param [nil, #to_s] value the new attribute value
|
373
|
+
#
|
374
|
+
def lateral_separation=(value)
|
375
|
+
@lateral_separation = value && value.to_s.strip
|
376
|
+
end
|
377
|
+
|
378
|
+
# Sets the tangential_separation attribute.
|
379
|
+
#
|
380
|
+
# @param [nil, #to_s] value the new attribute value
|
381
|
+
#
|
382
|
+
def tangential_separation=(value)
|
383
|
+
@tangential_separation = value && value.to_s.strip
|
384
|
+
end
|
385
|
+
|
386
|
+
# Sets the other_label_1 attribute.
|
387
|
+
#
|
388
|
+
# @param [nil, #to_s] value the new attribute value
|
389
|
+
#
|
390
|
+
def other_label_1=(value)
|
391
|
+
@other_label_1 = value && value.to_s
|
392
|
+
end
|
393
|
+
|
394
|
+
# Sets the ssd_1 attribute.
|
395
|
+
#
|
396
|
+
# @param [nil, #to_s] value the new attribute value
|
397
|
+
#
|
398
|
+
def ssd_1=(value)
|
399
|
+
@ssd_1 = value && value.to_s
|
400
|
+
end
|
401
|
+
|
402
|
+
# Sets the sfd_1 attribute.
|
403
|
+
#
|
404
|
+
# @param [nil, #to_s] value the new attribute value
|
405
|
+
#
|
406
|
+
def sfd_1=(value)
|
407
|
+
@sfd_1 = value && value.to_s
|
408
|
+
end
|
409
|
+
|
410
|
+
# Sets the other_label_2 attribute.
|
411
|
+
#
|
412
|
+
# @param [nil, #to_s] value the new attribute value
|
413
|
+
#
|
414
|
+
def other_label_2=(value)
|
415
|
+
@other_label_2 = value && value.to_s
|
416
|
+
end
|
417
|
+
|
418
|
+
# Sets the other_measurement_1 attribute.
|
419
|
+
#
|
420
|
+
# @param [nil, #to_s] value the new attribute value
|
421
|
+
#
|
422
|
+
def other_measurement_1=(value)
|
423
|
+
@other_measurement_1 = value && value.to_s
|
424
|
+
end
|
425
|
+
|
426
|
+
# Sets the other_measurement_2 attribute.
|
427
|
+
#
|
428
|
+
# @param [nil, #to_s] value the new attribute value
|
429
|
+
#
|
430
|
+
def other_measurement_2=(value)
|
431
|
+
@other_measurement_2 = value && value.to_s
|
432
|
+
end
|
433
|
+
|
434
|
+
# Sets the other_label_3 attribute.
|
435
|
+
#
|
436
|
+
# @param [nil, #to_s] value the new attribute value
|
437
|
+
#
|
438
|
+
def other_label_3=(value)
|
439
|
+
@other_label_3 = value && value.to_s
|
440
|
+
end
|
441
|
+
|
442
|
+
# Sets the other_measurement_3 attribute.
|
443
|
+
#
|
444
|
+
# @param [nil, #to_s] value the new attribute value
|
445
|
+
#
|
446
|
+
def other_measurement_3=(value)
|
447
|
+
@other_measurement_3 = value && value.to_s
|
448
|
+
end
|
449
|
+
|
450
|
+
# Sets the other_measurement_4 attribute.
|
451
|
+
#
|
452
|
+
# @param [nil, #to_s] value the new attribute value
|
453
|
+
#
|
454
|
+
def other_measurement_4=(value)
|
455
|
+
@other_measurement_4 = value && value.to_s
|
456
|
+
end
|
457
|
+
|
458
|
+
# Sets the other_label_4 attribute.
|
459
|
+
#
|
460
|
+
# @param [nil, #to_s] value the new attribute value
|
461
|
+
#
|
462
|
+
def other_label_4=(value)
|
463
|
+
@other_label_4 = value && value.to_s
|
464
|
+
end
|
465
|
+
|
466
|
+
# Sets the other_measurement_5 attribute.
|
467
|
+
#
|
468
|
+
# @param [nil, #to_s] value the new attribute value
|
469
|
+
#
|
470
|
+
def other_measurement_5=(value)
|
471
|
+
@other_measurement_5 = value && value.to_s
|
472
|
+
end
|
473
|
+
|
474
|
+
# Sets the other_measurement_6 attribute.
|
475
|
+
#
|
476
|
+
# @param [nil, #to_s] value the new attribute value
|
477
|
+
#
|
478
|
+
def other_measurement_6=(value)
|
479
|
+
@other_measurement_6 = value && value.to_s
|
480
|
+
end
|
481
|
+
|
482
|
+
# Sets the blade_x_mode attribute.
|
483
|
+
#
|
484
|
+
# @param [nil, #to_s] value the new attribute value
|
485
|
+
#
|
486
|
+
def blade_x_mode=(value)
|
487
|
+
@blade_x_mode = value && value.to_s
|
488
|
+
end
|
489
|
+
|
490
|
+
# Sets the blade_x attribute.
|
491
|
+
#
|
492
|
+
# @param [nil, #to_s] value the new attribute value
|
493
|
+
#
|
494
|
+
def blade_x=(value)
|
495
|
+
@blade_x = value && value.to_s
|
496
|
+
end
|
497
|
+
|
498
|
+
# Sets the blade_x1 attribute.
|
499
|
+
#
|
500
|
+
# @param [nil, #to_s] value the new attribute value
|
501
|
+
#
|
502
|
+
def blade_x1=(value)
|
503
|
+
@blade_x1 = value && value.to_s
|
504
|
+
end
|
505
|
+
|
506
|
+
# Sets the blade_x2 attribute.
|
507
|
+
#
|
508
|
+
# @param [nil, #to_s] value the new attribute value
|
509
|
+
#
|
510
|
+
def blade_x2=(value)
|
511
|
+
@blade_x2 = value && value.to_s
|
512
|
+
end
|
513
|
+
|
514
|
+
# Sets the blade_y_mode attribute.
|
515
|
+
#
|
516
|
+
# @param [nil, #to_s] value the new attribute value
|
517
|
+
#
|
518
|
+
def blade_y_mode=(value)
|
519
|
+
@blade_y_mode = value && value.to_s
|
520
|
+
end
|
521
|
+
|
522
|
+
# Sets the blade_y attribute.
|
523
|
+
#
|
524
|
+
# @param [nil, #to_s] value the new attribute value
|
525
|
+
#
|
526
|
+
def blade_y=(value)
|
527
|
+
@blade_y = value && value.to_s
|
528
|
+
end
|
529
|
+
|
530
|
+
# Sets the blade_y1 attribute.
|
531
|
+
#
|
532
|
+
# @param [nil, #to_s] value the new attribute value
|
533
|
+
#
|
534
|
+
def blade_y1=(value)
|
535
|
+
@blade_y1 = value && value.to_s
|
536
|
+
end
|
537
|
+
|
538
|
+
# Sets the blade_y2 attribute.
|
539
|
+
#
|
540
|
+
# @param [nil, #to_s] value the new attribute value
|
541
|
+
#
|
542
|
+
def blade_y2=(value)
|
543
|
+
@blade_y2 = value && value.to_s
|
544
|
+
end
|
545
|
+
|
546
|
+
# Sets the ii_lateral attribute.
|
547
|
+
#
|
548
|
+
# @param [nil, #to_s] value the new attribute value
|
549
|
+
#
|
550
|
+
def ii_lateral=(value)
|
551
|
+
@ii_lateral = value && value.to_s
|
552
|
+
end
|
553
|
+
|
554
|
+
# Sets the ii_longitudinal attribute.
|
555
|
+
#
|
556
|
+
# @param [nil, #to_s] value the new attribute value
|
557
|
+
#
|
558
|
+
def ii_longitudinal=(value)
|
559
|
+
@ii_longitudinal = value && value.to_s
|
560
|
+
end
|
561
|
+
|
562
|
+
# Sets the ii_vertical attribute.
|
563
|
+
#
|
564
|
+
# @param [nil, #to_s] value the new attribute value
|
565
|
+
#
|
566
|
+
def ii_vertical=(value)
|
567
|
+
@ii_vertical = value && value.to_s
|
568
|
+
end
|
569
|
+
|
570
|
+
# Sets the kvp attribute.
|
571
|
+
#
|
572
|
+
# @param [nil, #to_s] value the new attribute value
|
573
|
+
#
|
574
|
+
def kvp=(value)
|
575
|
+
@kvp = value && value.to_s
|
576
|
+
end
|
577
|
+
|
578
|
+
# Sets the ma attribute.
|
579
|
+
#
|
580
|
+
# @param [nil, #to_s] value the new attribute value
|
581
|
+
#
|
582
|
+
def ma=(value)
|
583
|
+
@ma = value && value.to_s
|
584
|
+
end
|
585
|
+
|
586
|
+
# Sets the seconds attribute.
|
587
|
+
#
|
588
|
+
# @param [nil, #to_s] value the new attribute value
|
589
|
+
#
|
590
|
+
def seconds=(value)
|
591
|
+
@seconds = value && value.to_s
|
592
|
+
end
|
593
|
+
|
594
|
+
|
595
|
+
private
|
596
|
+
|
597
|
+
|
598
|
+
# Collects the attributes of this instance.
|
599
|
+
#
|
600
|
+
# @note The CRC is not considered part of the attributes of interest and is excluded
|
601
|
+
# @return [Array<String>] an array of attributes
|
602
|
+
#
|
603
|
+
alias_method :state, :values
|
604
|
+
|
605
|
+
end
|
606
|
+
|
626
607
|
end
|