fallo_motor 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f8c1fa202ba8dbc317c3625299dc34ccaa0a6e9
4
- data.tar.gz: 1c0462b24776c05c21d227143080b41587b7bb0a
3
+ metadata.gz: f9b31db75bb41599854d50600ac78e0571ec022d
4
+ data.tar.gz: af78b65c59e702d2c0e4628d633fb243822a7a99
5
5
  SHA512:
6
- metadata.gz: f1f1ca1a75ad490c826ffe78ff2f1722d0c261b7af3fd21f99bac0a17e38aa319108f348d2ff7ac3255ba4b1a3f3348767dc7b22f49b7de1a48d068572e44629
7
- data.tar.gz: 26350c8a3f08c34904f401f79024e6107aa0c22e4ccf0e19d97fbcfa98581133395a116eba57c58c9c12b2aff1501e584e7fa6b7580e18ba3d84f800dbb26351
6
+ metadata.gz: 4bdb150bb4359f00d5ec68b6567255e55bc0065d01572a6847e61ee98ab408a9c47af9b08e103753fb50ea700f02e04055ad8ddf129cd0ae33f6afb35f103b8c
7
+ data.tar.gz: 624ae60598bc1e9fedb2309ab5b6bc6115f96ba03b9544bc44af7e5e9a00ecb05f2bbdcd6fded1e39c3347d52dd4373e392cd0ea1dacbbd5a73590f6eee9474f
data/bin/console CHANGED
@@ -2,9 +2,14 @@
2
2
 
3
3
  require "bundler/setup"
4
4
  require "fallo_motor"
5
+ require "nokogiri"
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
9
+ kml_file = "LEMD_36L_BARDI2L_SSY_EF.KML"
10
+ kml_data = Nokogiri::XML(File.open(kml_file))
11
+ name_node = kml_data.at('Document name')
12
+ # name_node.text = name_node.text.strip + '_NET'
8
13
 
9
14
  # (If you use this, don't forget to add pry to your Gemfile!)
10
15
  require "pry"
data/exe/fallo_motor CHANGED
@@ -41,7 +41,8 @@ end
41
41
 
42
42
  # Constantes
43
43
  meters = 0.3048
44
- lost_engine_coeff = 0.8 / 100
44
+ net_path_coeff = 0.8 / 100
45
+ lost_engine_coeff = 0.55
45
46
 
46
47
  # Datos de actuaciones del avion
47
48
  csv_data = CSV.read(csv_file, converters: :numeric)
@@ -76,13 +77,13 @@ flight_path_coor.each_with_index do |coor, i|
76
77
  # Calcular la nueva altura
77
78
  if engine_failed
78
79
  tan_alpha = (h1 - h0) / (gr1 - gr0)
79
- h1_corregida = (h0_corregida + (tan_alpha - lost_engine_coeff) * (gr1 - gr0)).round(4)
80
+ h1_corregida = (h0_corregida + (tan_alpha - net_path_coeff) * (gr1 - gr0)).round(4)
80
81
 
81
82
  # Valores iniciales para la siguiente iteracion
82
83
  h0 = h1
83
84
  h0_corregida = h1_corregida
84
85
  gr0 = gr1
85
- elsif thrust1 <= thrust0 * 0.6
86
+ elsif thrust1 <= thrust0 * lost_engine_coeff
86
87
  engine_failed = true
87
88
  h1_corregida = h1
88
89
  gr0 = gr1
@@ -121,4 +122,6 @@ kml_data.at('Folder Placemark Polygon').add_child('<altitudeMode>absolute</altit
121
122
  filename = File.basename(kml_file, File.extname(kml_file)) + '_NET.kml'
122
123
  flight_path_node.content = flight_path_coor.map { |el| el.join(',') }.join("\n")
123
124
  splay_node.content = splay_coor.map { |el| el.join(',') }.join("\n")
125
+ name_node = kml_data.at('Document name')
126
+ name_node.content = name_node.text.strip + '_NET'
124
127
  File.write(filename, kml_data.to_xml)
@@ -1,3 +1,3 @@
1
1
  module FalloMotor
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fallo_motor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Marchante
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-09-01 00:00:00.000000000 Z
11
+ date: 2016-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.6.6
137
+ rubygems_version: 2.6.8
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: Un favor para Carlos