def ENepanet(self,nomeinp, nomerpt='', nomebin='', vfunc=None):
"""Runs a complete EPANET simulation.
Arguments:
nomeinp: name of the input file
nomerpt: name of an output report file
nomebin: name of an optional binary output file
vfunc : pointer to a user-supplied function which accepts a character string as its argument."""
if vfunc is not None:
CFUNC = ctypes.CFUNCTYPE(ctypes.c_void_p, ctypes.c_char_p)
callback= CFUNC(vfunc)
else:
callback= None
ierr= self._lib.ENepanet(ctypes.c_char_p(nomeinp.encode()),
ctypes.c_char_p(nomerpt.encode()),
ctypes.c_char_p(nomebin.encode()),
callback)
if ierr!=0: raise ENtoolkitError(self, ierr)
评论列表
文章目录