diff --git a/Python/API/VzenseDS_api.py b/Python/API/VzenseDS_api.py index 5d8e5ed..690b965 100644 --- a/Python/API/VzenseDS_api.py +++ b/Python/API/VzenseDS_api.py @@ -8,50 +8,10 @@ class VzenseTofCam(): device_handle = c_void_p(0) def __init__(self): - system_ = platform.system().lower() - machine_ = platform.machine().lower() - architecture_ = platform.architecture()[0] - print('system:',system_) - print('machine_:',machine_) - print('architecture:',architecture_) - if system_ == 'linux': - if machine_ == 'x86_64': - os_info = os.uname() - print('os_info:',type(os_info)) - system_info = os_info.version - print('version:',system_info) - if system_info.find('18.04') != -1 or system_info.find('20.04') != -1: - libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Ubuntu18.04/Lib/libNebula_api.so" - print(libpath) - self.vz_cam_lib = cdll.LoadLibrary(libpath) - else: - libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Ubuntu16.04/Lib/libNebula_api.so" - print(libpath) - self.vz_cam_lib = cdll.LoadLibrary(libpath) - elif machine_ == 'aarch64': - libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/AArch64/Lib/libNebula_api.so" - print(libpath) - self.vz_cam_lib = cdll.LoadLibrary(libpath) - else: - print('do not supported OS', system_, machine_) - exit() - elif platform.system() == 'Windows': - if machine_ == 'amd64': - if architecture_ == '64bit': - libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Windows/Bin/x64/Nebula_api.dll" - print(libpath) - self.vz_cam_lib = cdll.LoadLibrary(libpath) - else: - libpath = (os.path.abspath(os.path.dirname(os.getcwd()) + os.path.sep + "../../../"))+"/Windows/Bin/x86/Nebula_api.dll" - print(libpath) - self.vz_cam_lib = cdll.LoadLibrary(libpath) - else: - print('do not supported OS', system_, machine_) - exit() - else: - print('do not supported OS', system_, machine_) - exit() - + + libpath = (os.path.abspath(os.path.dirname(os.path.realpath(__file__)) + os.path.sep)) + "/Ubuntu18.04/Lib/libNebula_api.so" + self.vz_cam_lib = cdll.LoadLibrary(libpath) + self.device_handle = c_void_p(0) self.vz_cam_lib.VZ_Initialize() diff --git a/Python/API/VzenseDS_enums.py b/Python/API/VzenseDS_enums.py index 270f85b..4b8d788 100644 --- a/Python/API/VzenseDS_enums.py +++ b/Python/API/VzenseDS_enums.py @@ -41,6 +41,12 @@ class VzReturnStatus(Enum): VzRetUpgradeImgError = -17 VzRetUpgradeImgPathTooLong = -18 VzRetUpgradeCallbackNotSet = -19 + VzRetProductNotSupport = -20 + VzRetNoConfigFolder = -21 + VzRetWebServerStartError = -22 + VzRetGetOverStayFrame = -23 + VzRetCreateLogDirError = -24 + VzRetCreateLogFileError = -25 VzRetNoAdapterConnected = -100 VzRetReInitialized = -101 VzRetNoInitialized = -102 @@ -50,6 +56,7 @@ class VzReturnStatus(Enum): VzRetIPNotMatch = -106 VzRetNotStopStream = -107 VzRetNotStartStream = -108 + VzRetNoDriversFolder = -109 VzRetOthers = -255 class VzConnectStatus(Enum): diff --git a/Python/API/__init__.py b/Python/API/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Python/MANIFEST.in b/Python/MANIFEST.in new file mode 100644 index 0000000..b961870 --- /dev/null +++ b/Python/MANIFEST.in @@ -0,0 +1,5 @@ +include API/LICENSE +recursive-include API/Ubuntu18.04/Lib * +recursive-include API/Ubuntu18.04/Include * +recursive-include API/Ubuntu16.04/Lib * +recursive-include API/Ubuntu16.04/Include * diff --git a/Python/setup.py b/Python/setup.py new file mode 100644 index 0000000..d6960f9 --- /dev/null +++ b/Python/setup.py @@ -0,0 +1,17 @@ +import os +from setuptools import setup + +version = os.environ.get("PKG_VERSION", "0.1") + +setup( + name="nebula", + version=version, + description="Nebula SDK source code", + author="Vzense Technology", + author_email="info@vzense.com", + url='https://github.com/Vzense/NebulaSDK', + packages=["API"], + include_package_data=True, + license="BSD", + install_requires=['numpy'], +)