1 Star 0 Fork 0

BingYuJi/2024XXRH

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MultiUSVModel.py 3.46 KB
一键复制 编辑 原始数据 按行查看 历史
BingYuJi 提交于 2024-10-20 15:58 . 1020复赛更新
import ctypes
from StructType import *
class MultiUSVModel(object):
def __init__(self, dll_path="./dll/usvmodel.dll", dll_deps=[r"./dll/Qt5Core.dll"]):
_ = [ctypes.CDLL(i) for i in dll_deps]
self.dll = ctypes.CDLL(dll_path)
self.dll.cmultiUSVModel_new.argtypes = []
self.dll.cmultiUSVModel_new.restype = ctypes.c_void_p
self.dll.cmultiUSVModel_multiInitialize.argtypes = [
ctypes.c_void_p,
ctypes.c_int,
]
self.dll.cmultiUSVModel_multiInitialize.restype = None
self.dll.cmultiUSVModel_updateMultiUSVControl.argtypes = [
ctypes.c_void_p,
ctypes.POINTER(USVInitStructType),
ctypes.c_int,
ctypes.c_double,
ctypes.c_int,
]
self.dll.cmultiUSVModel_updateMultiUSVControl.restype = None
self.dll.cmultiUSVModel_getMultiNaviObsInfo.argtypes = [
ctypes.c_void_p,
ctypes.c_int,
ctypes.POINTER(ctypes.POINTER(USVOutPutStructType)),
ctypes.POINTER(ctypes.c_int),
ctypes.POINTER(ctypes.POINTER(InputOBSStruct)),
ctypes.POINTER(ctypes.c_int),
]
self.dll.cmultiUSVModel_getMultiNaviObsInfo.restype = None
self.dll.cmultiUSVModel_getTaskInfo.argtypes = [
ctypes.c_void_p,
ctypes.POINTER(ctypes.c_int),
ctypes.POINTER(ctypes.POINTER(SFormationTaskInfo)),
ctypes.POINTER(ctypes.c_int),
ctypes.POINTER(ctypes.POINTER(referUSVInfo)),
ctypes.POINTER(ctypes.c_int),
ctypes.c_int,
]
self.dll.cmultiUSVModel_getTaskInfo.restype = ctypes.c_int
self.dll.cmultiUSVModel_taskEnd.argtypes = [
ctypes.c_void_p,
ctypes.c_int,
ctypes.c_int,
]
self.dll.cmultiUSVModel_taskEnd.restype = None
self.cmultiusvmodel = self.dll.cmultiUSVModel_new()
def __del__(self):
ctypes.windll.kernel32.FreeLibrary(ctypes.c_void_p(self.dll._handle))
self.taskEnd(0, 0)
def multiInitialize(self, flagModel):
return self.dll.cmultiUSVModel_multiInitialize(self.cmultiusvmodel, flagModel)
def updateMultiUSVControl(
self, multiUSVInitInfo_data, multiUSVInitInfo_size, curTime, flagModel
):
return self.dll.cmultiUSVModel_updateMultiUSVControl(
self.cmultiusvmodel,
multiUSVInitInfo_data,
multiUSVInitInfo_size,
curTime,
flagModel,
)
def getMultiNaviObsInfo(
self,
iterNum,
multiUSVStatus_data,
multiUSVStatus_size,
curOBSFusion_data,
curOBSFusion_size,
):
return self.dll.cmultiUSVModel_getMultiNaviObsInfo(
self.cmultiusvmodel,
iterNum,
multiUSVStatus_data,
multiUSVStatus_size,
curOBSFusion_data,
curOBSFusion_size,
)
def getTaskInfo(
self,
isEnd_int,
taskPath_data,
taskPath_size,
referInfo_data,
referInfo_size,
iterNum,
):
return self.dll.cmultiUSVModel_getTaskInfo(
self.cmultiusvmodel,
isEnd_int,
taskPath_data,
taskPath_size,
referInfo_data,
referInfo_size,
iterNum,
)
def taskEnd(self, iterNum, modelFlag):
return self.dll.cmultiUSVModel_taskEnd(self.cmultiusvmodel, iterNum, modelFlag)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/bingyuji/2024-xxrh.git
git@gitee.com:bingyuji/2024-xxrh.git
bingyuji
2024-xxrh
2024XXRH
master

搜索帮助