mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
Quite a few functions aren't wrapped, but the most critical ones for vision should be. This also fixes a couple of issues: - nivision_arm.ini (and imaqdx_arm.ini) are now generated without need for running the output on the RoboRIO. - enum values are generated even if the value is not directly specified.
30 lines
1.2 KiB
Bash
Executable File
30 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
#This script should be able to generate the JNI
|
|
# bindings for NIVision. At some point,
|
|
# it should be integrated into the build system.
|
|
# Assumes running from allwpilib/wpilibj/wpilibJavaJNI/nivision
|
|
|
|
# Get structure sizes.
|
|
python gen_struct_sizer.py ../../../wpilibc/wpilibC++Devices/include/nivision.h nivision_2011.ini
|
|
arm-frc-linux-gnueabi-gcc -I../../../wpilibc/wpilibC++Devices/include -S struct_sizer.c
|
|
cat struct_sizer.s | python get_struct_size.py > nivision_arm.ini
|
|
|
|
python gen_struct_sizer.py ../../../wpilibc/wpilibC++Devices/include/NIIMAQdx.h imaqdx.ini
|
|
arm-frc-linux-gnueabi-gcc -I../../../wpilibc/wpilibC++Devices/include -S struct_sizer.c
|
|
cat struct_sizer.s | python get_struct_size.py > imaqdx_arm.ini
|
|
|
|
# Run python generator.
|
|
python gen_java.py \
|
|
../../../wpilibc/wpilibC++Devices/include/nivision.h \
|
|
nivision_arm.ini \
|
|
nivision_2011.ini \
|
|
\
|
|
../../../wpilibc/wpilibC++Devices/include/NIIMAQdx.h \
|
|
imaqdx_arm.ini \
|
|
imaqdx.ini
|
|
|
|
# Stick generated files into appropriate places.
|
|
cp NIVision.cpp ../lib/NIVisionJNI.cpp
|
|
mkdir -p ../../wpilibJavaDevices/src/main/java/com/ni/vision
|
|
cp *.java ../../wpilibJavaDevices/src/main/java/com/ni/vision/
|