* Fix for assigning to non-existent variables (#1708)
This fix modifies Trick's convert_swig script. It
adds a directive to not accept dynamic attributes.
The directive will ensure that modelers do not
assign to non-existent parameter in their input files.
The prior fix (issues #1288 and/or #1603) did not
cover C structures, so this commit is really an
addendum to that fix. With this commit, the convert_swig
script will generate a non-dynamic directive foreach
class and structure.
This fix also stops generating swig interface code
for typedef structure definitions since swig only
produces an interface to the actual typedef name.
For example, with this typedef:
typedef struct StructureName {
double main_engine_thrust; /* N Thrust of main engine */
struct StructureName* next; /* ** Next pointer */
} TypeDefName;
swig creates an interface for "TypeDefName", and not
"StructureName", so there is no need for Trick to
produce anything in regards "StructureName".
* Fix for issue with classes defined in ifndef SWIG block
convert_swig takes in the raw header and does no preprocessing,
so blocks of c/c++ header code which are meant to be skipped
by Swig are processed by convert_swig. This causes an issue
with the generated python code that try to access classes
that are ifndef SWIGed out.
To fix this, check for class existence in the generated python
code e.g:
if 'MomMom' in globals():
MomMom.__setattr__ = _swig_setattr_nondynamic_instance_variable(object.__setattr__)
* Fix for assignment to swig_double and swig_int primitives
The previous commit(s) on this branch fixed bad assignments
like (misspell position an attribute of BSTATE_IN):
ball.state.input.positiaaaan = 4.0
This commit fixes bad assignments to leaf/primitive attributes
like (try to add attribute to primitive/leaf double type):
ball.state.input.position.fred = 4.0
* Moved _swig_setattr_nondynamic_instance_variable to right after each class in process_class and removed duplicate _swig_setattr_nondynamic_instance_variable blocks for classes that are not in a namespace.
* Add the call for __setattr__ for class templates.
---------
Co-authored-by: Hong Chen <hong.chen-1@nasa.gov>
* Rework swig template declarations to be written before used in the containing class so that private methods are honored
* Fix SIM_test_ip for swig 4.2.0 and implemented review suggestions
* Additional review comment fixes
---------
Co-authored-by: Thomas Brain <thomas.a.brain@nasa.gov>
* Add trickeifed classes.resource to sie generation after cp.
* Go through all trickified classes.resource files if available and don't die on any if not found.
convert_swig did not previously understand the "enum class". Made a regular
expression to catch it. We don't have to do anything special with it for
convert_swig, the matched contents are written to the output file as is.
In convert_swig added a line to override the __setattr__ function. This makes
the new SWIG behave like older SWIG versions. the _swig_setattr_nondynamic_instance_variable
function is provided by SWIG and is similar to what our version of _swig_setattr_nondynamic
above is. If later we need to override _swig_setattr_nondynamic_instance_variable it can
be done the same way as before.
* Disambiguate python use #1250
Changed all calls to /usr/bin/python to /usr/bin/env python3. Removed execute permissions on a lot of files that are not executable.
closes#1250
ICG and make_makefile_swig create py_link_list and io_link_list files
listing the files to be linked during sim builds. Trickified projects
require slightly altered lists.
Fixes#1155
In later versions of gcc, gcc -dumpversion only shows the major version. You have to use gcc -dumpfullversion instead. This was first seen from a Trick user who is running on Ubuntu 18.04.
* Merging changes from cmake branch to master
* Fixing includes for renamed header files
* still need build rule
* Adding warning for swig code for gcc8+
* Adding CMakeLists.txt for data products
* Cmake merge #901
Making adjustments to get cmake working on the Mac (Mojave)
* Cmake merge #901
Changing string append to list append
The reason for .NOTPARALLEL was to prevent mixing of the download
progress messages, so use the -s and -S curl options to silence output,
except for errors.
If we can't find python in the configure script then search for
python3. If python3 is found use python3-config to get the
include directories and libraries. Call python scripts using the
PYTHON environment variable.
Added a new hash of deprecated values into trick-gte. If a deprecated
value is requested, a warning message is printed with the value. If
all of the values are printed, the deprecated values are printed in
their own section.