Adding support for VB
Also supporting C89 compiler.
This commit is contained in:
@@ -253,6 +253,12 @@ Public Const EN_R_IS_OPEN = 1 ' Rule status types
|
|||||||
Public Const EN_R_IS_CLOSED = 2
|
Public Const EN_R_IS_CLOSED = 2
|
||||||
Public Const EN_R_IS_ACTIVE = 3
|
Public Const EN_R_IS_ACTIVE = 3
|
||||||
|
|
||||||
|
Public Const EN_STEP_REPORT = 0 ' Types of events that can cause a timestep to end
|
||||||
|
Public Const EN_STEP_HYD = 1
|
||||||
|
Public Const EN_STEP_WQ = 2
|
||||||
|
Public Const EN_STEP_TANKEVENT = 3
|
||||||
|
Public Const EN_STEP_CONTROLEVENT = 4
|
||||||
|
|
||||||
Public Const EN_MISSING As Double = -1.0E10
|
Public Const EN_MISSING As Double = -1.0E10
|
||||||
|
|
||||||
'These are the external functions that comprise the DLL
|
'These are the external functions that comprise the DLL
|
||||||
@@ -302,6 +308,7 @@ Public Const EN_MISSING As Double = -1.0E10
|
|||||||
Declare Function ENgeterror Lib "epanet2.dll" (ByVal errcode As Long, ByVal errmsg As String, ByVal maxLen As Long) As Long
|
Declare Function ENgeterror Lib "epanet2.dll" (ByVal errcode As Long, ByVal errmsg As String, ByVal maxLen As Long) As Long
|
||||||
Declare Function ENgetstatistic Lib "epanet2.dll" (ByVal type_ As Long, ByRef value As Single) As Long
|
Declare Function ENgetstatistic Lib "epanet2.dll" (ByVal type_ As Long, ByRef value As Single) As Long
|
||||||
Declare Function ENgetresultindex Lib "epanet2.dll" (ByVal type_ As Long, ByVal index As Long, ByRef value As Long) As Long
|
Declare Function ENgetresultindex Lib "epanet2.dll" (ByVal type_ As Long, ByVal index As Long, ByRef value As Long) As Long
|
||||||
|
Declare Function ENtimetonextevent Lib "epanet2.dll" (eventType As Long, duration As Long, elementIndex As Long) As Long
|
||||||
|
|
||||||
'Analysis Options Functions
|
'Analysis Options Functions
|
||||||
Declare Function ENgetoption Lib "epanet2.dll" (ByVal option_ As Long, value As Single) As Long
|
Declare Function ENgetoption Lib "epanet2.dll" (ByVal option_ As Long, value As Single) As Long
|
||||||
|
|||||||
@@ -131,3 +131,4 @@ EXPORTS
|
|||||||
ENstepQ = _ENstepQ@4
|
ENstepQ = _ENstepQ@4
|
||||||
ENusehydfile = _ENusehydfile@4
|
ENusehydfile = _ENusehydfile@4
|
||||||
ENwriteline = _ENwriteline@4
|
ENwriteline = _ENwriteline@4
|
||||||
|
ENtimetonextevent = _ENtimetonextevent@12
|
||||||
@@ -1629,13 +1629,14 @@ int DLLEXPORT EN_timetonextevent(EN_Project p, int *eventType, long *duration,
|
|||||||
{
|
{
|
||||||
Times *time = &p->times;
|
Times *time = &p->times;
|
||||||
long hydStep, tankStep, controlStep;
|
long hydStep, tankStep, controlStep;
|
||||||
|
int iTank, iControl;
|
||||||
|
|
||||||
hydStep = time->Hstep;
|
hydStep = time->Hstep;
|
||||||
tankStep = hydStep;
|
tankStep = hydStep;
|
||||||
controlStep = hydStep;
|
controlStep = hydStep;
|
||||||
|
|
||||||
int iTank = tanktimestep(p, &tankStep);
|
iTank = tanktimestep(p, &tankStep);
|
||||||
int iControl = controltimestep(p, &controlStep);
|
iControl = controltimestep(p, &controlStep);
|
||||||
|
|
||||||
// return the lesser of the three step lengths
|
// return the lesser of the three step lengths
|
||||||
if (controlStep < tankStep) {
|
if (controlStep < tankStep) {
|
||||||
|
|||||||
@@ -885,14 +885,14 @@ void writeline(Project *pr, char *s)
|
|||||||
**--------------------------------------------------------------
|
**--------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
Report *rpt = &pr->report;
|
||||||
|
|
||||||
if (pr->report.reportCallback != NULL)
|
if (pr->report.reportCallback != NULL)
|
||||||
{
|
{
|
||||||
pr->report.reportCallback(pr->report.reportCallbackUserData, pr, s);
|
pr->report.reportCallback(pr->report.reportCallbackUserData, pr, s);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Report *rpt = &pr->report;
|
|
||||||
|
|
||||||
if (rpt->RptFile == NULL) return;
|
if (rpt->RptFile == NULL) return;
|
||||||
if (rpt->Rptflag)
|
if (rpt->Rptflag)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user