Es/FlightGear Newsletter November 2013: Difference between revisions

Jump to navigation Jump to search
Getting started with CppBind: traducido
m (Cambié avión por aeronave)
(Getting started with CppBind: traducido)
Line 38: Line 38:
Por favor, contáctate si tienes alguna pregunta o si te gustaría unirte en alguna forma.
Por favor, contáctate si tienes alguna pregunta o si te gustaría unirte en alguna forma.


=== Getting started with CppBind ===
=== Comenzando con CppBind ===
[[Nasal]], el lenguaje de scripting integrado en FlightGear, viene con un conjunto de librerías estándar y puede ser extendido usando las APIs específicas de FlightGear.


FlightGear's built-in [[Nasal]] scripting language comes with a set of standard libraries, and can be extended using FlightGear specific APIs.
Hasta FlightGear 2.8, el motor de scripting de [[Nasal]] sólo entragaba una API C para exponer ciertos vínculos (hooks, bindings) al espacio de scripting o para exponer estructuras de datos del espacio de scripting de regreso a C/C++.


Until FlightGear 2.8, the [[Nasal]] scripting engine only provided a C API to expose such hooks/bindings to scripting space or to expose scripting space data structures back to C/C++.  
Exponer el aspecto interno del simulador a un espacio de scripting es un asunto útil y bastante común, porque permite a los desarrolladores del paquete base acceder a estas partes internas sin tener que compilar FlightGear desde los fuentes, tal que la barrera de entrada es significativamente menor y hemos visto un incremento en el número de características novedosas implementadas completamente en el espacio de scripting, gracias a las poderosas APIs disponibles para desarrolladores de aeronaves y del paquete base.


Exposing simulator internals to scripting space is a fairly common and useful thing, because it enables base package developers to access these internals without having to build FlightGear from source, so the barrier to entry is significantly lower and we've seen an increasing number of novel features purely implemented in scripting space, due to powerful APIs being available to aircraft developers and other base package developers.
A diferencia del núcleo de Nasal, el cual está escrito en C, FlightGear está programado y siendo escrito principalmente en C++. Eso significa que, hace un tiempo, la API Nasal fue casi de "bajo nivel" y a veces también complicado de usar al crear funciones, estructuras de datos u objetos accesibles entre C++ y Nasal.
Unlike the core Nasal engine itself (which is C), FlightGear however is mostly written and being developed in C++. For quite a while, that meant that the Nasal APIs were a bit low-level, and sometimes also awkward to use when making functions, data structures or objects accessible between C++ and Nasal.


Thanks to Tom's [[Canvas]] system, there's now a new bindings framework to be found in simgear/nasal/cppbind. This is fully object oriented and supports modern C++ features.
Gracias al sistema [[Canvas]] de Tom, ahora hay un nuevo framework de vínculos que se encuentran en simgear/nasal/cppbind. Es completamente orientado a objeto y soporta características modernas de C++.


You will find that most of the "old" code in $FG_SRC/Scripting still uses those old C-APIs for interacting with the Nasal engine. Only the new code, #include'ing <simgear/nasal/cppbind>, uses boost templates to hide low level details.
Notarás que la mayoría del código "antiguo" en $FG_SRC/Scripting aún usa esas viejas APIs-C para interactuar con el motor Nasal. Sólo el nuevo código, #include'ing <simgear/nasal/cppbind>, usa las plantillas potenciadas que esconden los detalles de bajo nivel.


Most of the code in the Nasal subsystem itself (FGNasalSys) also still uses the legacy C APIs - this is just to explain the two approaches, to avoid unnecessary confusion. You will find the old, low-level APIs explained at [[Howto:Extend Nasal]].
La mayoría del código en el subsistema Nasal (FGNasalSys) también aún usa las APIs de C antiguas - esto es sólo para explicar las dos soluciones, para evitar confusiones innecesarias. Las antiguas APIs de bajo nivel las encontrarás explicadas en [[Howto:Extend Nasal]].


The cppbind framework is much more generic and high level than the bare C APIs, cppbind includes unit testing support and makes use of modern C++ features like templates and STL support, including SimGear specific types like SGPath/SGGeod etc, its overhead is fairly small (not just performance, but also LoC to create new bindings). The cppbind framework is already extensively used by the Canvas system and the NasalPositioned_cppbind bindings, both of which are a good place to look for code examples.
El framework CppBind es mucho más genérico y de alto nivel que las APIs C puras, cppbind incluye soporte para pruebas unitarias y hace uso de características modernas de C++ como templates y soporte STL, incluyendo tipos específicos de SimGear como SGPath/SGGeod, etc, su gasto es bastante pequeño (no sólo rendimiento, sino también líneas de código para crear nuevos vínculos). El framework cppbind ya es extensamente usado por el sistema Canvas y los vínculos NasalPositioned_cppbind, ambos muy buenos lugares para buscar ejemplos de código.


Continue reading at [[Nasal/CppBind]]...
Continúa leyendo en [[Nasal/CppBind]]...


=== JSBSim Flight Dynamics Model Validation Effort ===
=== JSBSim Flight Dynamics Model Validation Effort ===
99

edits

Navigation menu