Closed ehsanMa86 closed 4 years ago
@ehsanMa86 is this a GUI issue or a problem with the engine API call?
@eladsal It is a GUI issue. In the epanet2.py they pass a reference to API rather than value. It is just a question of minor fix. API works just fine.
fValue2 = ctypes.c_float() fValue2.value = fValue self.errcode = self.ENlib.ENset...value(iIndex, iCode, fValue2)
is the solution to fix it.
@ehsanMa86 How about issuing that fix in a PR? That would be even better!
@michaeltryby sure I will. Thanks!
@ehsanMa86 have you made any progress on that PR?
@michaeltryby ok, the function in question takes in 3 arguments as below
* iIndex = time pattern index
* iPeriod = time pattern period
* fValue = pattern multiplier
the proposed ctypes conversion is for 'fValue
', what about the two integer arguments, ctypes has c_int32
and c_int64
(actually a couple others), I suppose we would use c_int64
. In fact, let's use this one as a guide for the 4 other similar issues posted by @ehsanMa86. Could you help confirm the necessity for this update, especially since the API works in its current state.
Closing old issues, assuming this issue is not relevant to the current version of the software. Feel free to re-open if the problem still occurs.
ENsetpatternvalue sets zero value (passing a reference rather than value)
Version: EPANET MTP4r2 (master branch) Priority: High