Skip to content

Change ENgetcontol#37

Open
BlomTbl wants to merge 1 commit intoVitens:masterfrom
BlomTbl:patch-1
Open

Change ENgetcontol#37
BlomTbl wants to merge 1 commit intoVitens:masterfrom
BlomTbl:patch-1

Conversation

@BlomTbl
Copy link
Copy Markdown

@BlomTbl BlomTbl commented Sep 26, 2022

In the following function (line 378)

def ENgetcontrol(self, cindex, ctype, lindex, setting, nindex, level ): <------------- solved: change to ENgetcontrol(self, index)
"""Retrieves the parameters of a simple control statement.
Arguments:
cindex: control statement index
ctype: control type code EN_LOWLEVEL (Low Level Control)
EN_HILEVEL (High Level Control)
EN_TIMER (Timer Control)
EN_TIMEOFDAY (Time-of-Day Control)
lindex: index of link being controlled
setting: value of the control setting
nindex: index of controlling node
level: value of controlling water level or pressure for level controls
or of time of control action (in seconds) for time-based controls"""
#int ENgetcontrol(int cindex, int* ctype, int* lindex, float* setting, int* nindex, float* level )
ierr= self._lib.EN_getcontrol(self.ph, ctypes.c_int(cindex), ctypes.c_int(ctype),
ctypes.c_int(lindex), ctypes.c_float(setting),
ctypes.c_int(nindex), ctypes.c_float(level) )
if ierr!=0: raise ENtoolkitError(self, ierr)

In the following function (line 378)
   
def ENgetcontrol(self, cindex, ctype, lindex, setting, nindex, level ):   <------------- solved: change to ENgetcontrol(self, index)
        """Retrieves the parameters of a simple control statement.
        Arguments:
           cindex:  control statement index
           ctype:   control type code EN_LOWLEVEL   (Low Level Control)
                                      EN_HILEVEL    (High Level Control)
                                      EN_TIMER      (Timer Control)       
                                      EN_TIMEOFDAY  (Time-of-Day Control)
           lindex:  index of link being controlled
           setting: value of the control setting
           nindex:  index of controlling node
           level:   value of controlling water level or pressure for level controls 
                    or of time of control action (in seconds) for time-based controls"""
        #int ENgetcontrol(int cindex, int* ctype, int* lindex, float* setting, int* nindex, float* level )
        ierr= self._lib.EN_getcontrol(self.ph, ctypes.c_int(cindex), ctypes.c_int(ctype), 
                                ctypes.c_int(lindex), ctypes.c_float(setting), 
                                ctypes.c_int(nindex), ctypes.c_float(level) )
        if ierr!=0: raise ENtoolkitError(self, ierr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant