Class: Cosmos::Plot
- Defined in:
- lib/cosmos/tools/tlm_grapher/plots/plot.rb
Overview
Represents a plot
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data_objects ⇒ Object
Array of data objects in the plot.
-
#gui_object ⇒ Object
GUI object associated with this plot.
-
#plot_type ⇒ Object
Type of plot.
-
#redraw_needed ⇒ Object
Flag to indicate if plot redraw is needed.
-
#tab ⇒ Object
Tab containing this plot.
Instance Method Summary collapse
-
#configuration_string ⇒ Object
Returns the configuration lines used to create this plot.
-
#handle_keyword(parser, keyword, parameters) ⇒ Object
Handles plot specific keywords.
-
#initialize ⇒ Plot
constructor
Creates a new Plot.
Constructor Details
#initialize ⇒ Plot
Creates a new Plot
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 34 def initialize @tab = nil @data_objects = [] @gui_object = nil @redraw_needed = false # Type is classname without Plot @plot_type = self.class.to_s[0..-5].upcase @plot_type = @plot_type.split("::")[-1] # Remove Cosmos:: if present end |
Instance Attribute Details
#data_objects ⇒ Object
Array of data objects in the plot
22 23 24 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 22 def data_objects @data_objects end |
#gui_object ⇒ Object
GUI object associated with this plot
25 26 27 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 25 def gui_object @gui_object end |
#plot_type ⇒ Object
Type of plot
28 29 30 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 28 def plot_type @plot_type end |
#redraw_needed ⇒ Object
Flag to indicate if plot redraw is needed
31 32 33 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 31 def redraw_needed @redraw_needed end |
#tab ⇒ Object
Tab containing this plot
19 20 21 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 19 def tab @tab end |
Instance Method Details
#configuration_string ⇒ Object
Returns the configuration lines used to create this plot
46 47 48 49 50 51 52 53 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 46 def configuration_string string = " PLOT #{@plot_type}\n" string << plot_configuration_string() @data_objects.each do |data_object| string << data_object.configuration_string end string end |
#handle_keyword(parser, keyword, parameters) ⇒ Object
Handles plot specific keywords
56 57 58 |
# File 'lib/cosmos/tools/tlm_grapher/plots/plot.rb', line 56 def handle_keyword(parser, keyword, parameters) raise ArgumentError, "Unknown keyword received by #{self.class}: #{keyword}" end |