Class: Kuby::Link
- Inherits:
-
Object
- Object
- Kuby::Link
- Includes:
- ApiMethods, FlightMethods, NavbalMethods, PausedMethods, VesselMethods
- Defined in:
- lib/kuby/link.rb,
lib/kuby/link/api_methods.rb,
lib/kuby/link/flight_methods.rb,
lib/kuby/link/navbal_methods.rb,
lib/kuby/link/paused_methods.rb,
lib/kuby/link/vessel_methods.rb
Defined Under Namespace
Modules: ApiMethods, FlightMethods, NavbalMethods, PausedMethods, VesselMethods
Constant Summary collapse
- MIN_TELEMACHUS_VERSION =
Gem::Version.new('1.4.6.0')
Constants included from PausedMethods
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
- #connect! ⇒ Object
-
#initialize(options = {}) ⇒ Link
constructor
A new instance of Link.
Methods included from VesselMethods
#altitude, #angular_velocity, #atmospheric_density, #dynamic_pressure, #height, #lat, #long, #mission_time, #name, #orbital_velocity, #surface_speed, #surface_velocity, #surface_velocity_x, #surface_velocity_y, #surface_velocity_z, #terrain_height, #vertical_speed
Methods included from PausedMethods
Methods included from NavbalMethods
Methods included from FlightMethods
#abort, #brake, #set_throttle, #stage!, #throttle, #throttle_down, #throttle_full, #throttle_up, #throttle_zero, #toggle_gear, #toggle_light, #toggle_rcs, #toggle_sas
Methods included from ApiMethods
Constructor Details
#initialize(options = {}) ⇒ Link
Returns a new instance of Link.
19 20 21 22 23 |
# File 'lib/kuby/link.rb', line 19 def initialize(={}) @host = .fetch(:host, '127.0.0.1') @port = .fetch(:port, 8085).to_i @path = 'telemachus/datalink' end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
11 12 13 |
# File 'lib/kuby/link.rb', line 11 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
11 12 13 |
# File 'lib/kuby/link.rb', line 11 def port @port end |
Instance Method Details
#connect! ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/kuby/link.rb', line 25 def connect! # Raise error when the telemachus version is not supported, this also automatically # checks if the connection can be made unless supported_version? raise Kuby::UnsupportedTelemachusVersion.new("Please install Telemachus #{MIN_TELEMACHUS_VERSION} or higher") end true end |