diff --git a/tests/scripts/vb6_binary_files_compare/BinaryCompare.vbp b/tests/scripts/vb6_binary_files_compare/BinaryCompare.vbp new file mode 100644 index 0000000..2c450f7 --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/BinaryCompare.vbp @@ -0,0 +1,35 @@ +Type=Exe +Form=frmMain.frm +Module=basShellSync; ShellSync.bas +Module=basNetRes; basNetRes.bas +IconForm="frmMain" +Startup="frmMain" +HelpFile="" +Title="Testing" +ExeName32="BinaryCompare.exe" +Command32="" +Name="BinaryCompare" +HelpContextID="0" +CompatibleMode="0" +MajorVer=1 +MinorVer=0 +RevisionVer=1 +AutoIncrementVer=1 +ServerSupportFiles=0 +VersionComments="by Elad Salomons" +CompilationType=0 +OptimizationType=0 +FavorPentiumPro(tm)=0 +CodeViewDebugInfo=0 +NoAliasing=0 +BoundsCheck=0 +OverflowCheck=0 +FlPointCheck=0 +FDIVCheck=0 +UnroundedFP=0 +StartMode=0 +Unattended=0 +Retained=0 +ThreadPerObject=0 +MaxNumberOfThreads=1 +DebugStartupOption=0 diff --git a/tests/scripts/vb6_binary_files_compare/ShellSync.bas b/tests/scripts/vb6_binary_files_compare/ShellSync.bas new file mode 100644 index 0000000..02c9f49 --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/ShellSync.bas @@ -0,0 +1,39 @@ +Attribute VB_Name = "basShellSync" +Option Explicit + +Private Const INFINITE = &HFFFFFFFF +Private Const SYNCHRONIZE = &H100000 +Private Const PROCESS_QUERY_INFORMATION = &H400& + +Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long +Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long +Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long +Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long +Public Function ShellSync(ByVal PathName As String, ByVal WindowStyle As VbAppWinStyle) As Long +'----------------------------------------------------------------------------------------------- +'Shell and wait. Return exit code result, raise an +'exception on any error. +Dim lngPid As Long +Dim lngHandle As Long +Dim lngExitCode As Long + +lngPid = Shell(PathName, WindowStyle) +If lngPid <> 0 Then + lngHandle = OpenProcess(SYNCHRONIZE Or PROCESS_QUERY_INFORMATION, 0, lngPid) + If lngHandle <> 0 Then + WaitForSingleObject lngHandle, INFINITE + If GetExitCodeProcess(lngHandle, lngExitCode) <> 0 Then + ShellSync = lngExitCode + CloseHandle lngHandle + Else + CloseHandle lngHandle + Err.Raise &H8004AA00, "ShellSync", "Failed to retrieve exit code, error " & CStr(Err.LastDllError) + End If + Else + Err.Raise &H8004AA01, "ShellSync", "Failed to open child process" + End If +Else + Err.Raise &H8004AA02, "ShellSync", "Failed to Shell child process" +End If + +End Function diff --git a/tests/scripts/vb6_binary_files_compare/basNetRes.bas b/tests/scripts/vb6_binary_files_compare/basNetRes.bas new file mode 100644 index 0000000..386858c --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/basNetRes.bas @@ -0,0 +1,188 @@ +Attribute VB_Name = "basNetRes" +Public Type typNetRes + nNodes As Long + nLinks As Long + + NodesID() As String + LinksID() As String + + NodesDemand() As Single + NodesHead() As Single + NodesPressure() As Single + NodesQuality() As Single + + LinksFlow() As Single + LinksHeadloss() As Single + LinksQuality() As Single + LinksSetting() As Single + LinksStatus() As Single + LinksVelocity() As Single + +End Type +Public Function ReadOutputFile(OutFile As String, NetRes As typNetRes) +'--------------------------------------------------------------------------------------- +Dim i As Long, F As Long, r As Long, nRep As Long, j As Long +Dim tmpArr() As Single +Dim pos As Long, N As Long +Dim tmpLong As Long, tmpSingle As Single +Dim ReportingTimeStep As Long, ReportingStartTime As Long +Dim SimulationDuration As Long +Dim ProblemTitletLine As String * 80 +Dim NumberOfNodes As Long +Dim NumberOfLinks As Long +Dim NumberOfReservoirsAndTanks As Long +Dim NumberOfPumps As Long +Dim NumberOfValves As Long +Dim WaterQualityOption As Long +Dim FlowUnitsOption As Long, PressureUnitsOption As Long +Dim NameOfFile As String * 260, tmpString32 As String * 32 +Dim ii As Long +Dim WarningFlag As Long + +With NetRes + pos = 1: N = 0 + F = FreeFile + Open OutFile For Binary As #F + Get #F, pos, tmpLong: pos = pos + 4 + Get #F, pos, tmpLong: pos = pos + 4 + Get #F, pos, NumberOfNodes: pos = pos + 4 + Get #F, pos, NumberOfReservoirsAndTanks: pos = pos + 4 + Get #F, pos, NumberOfLinks: pos = pos + 4 + Get #F, pos, NumberOfPumps: pos = pos + 4 + Get #F, pos, NumberOfValves: pos = pos + 4 + Get #F, pos, WaterQualityOption: pos = pos + 4 + Get #F, pos, tmpLong: pos = pos + 4 + Get #F, pos, FlowUnitsOption: pos = pos + 4 + Get #F, pos, PressureUnitsOption: pos = pos + 4 + Get #F, pos, tmpLong: pos = pos + 4 + Get #F, pos, ReportingStartTime: pos = pos + 4 + Get #F, pos, ReportingTimeStep: pos = pos + 4 + Get #F, pos, SimulationDuration: pos = pos + 4 + Get #F, pos, ProblemTitletLine: pos = pos + 80 + Get #F, pos, ProblemTitletLine: pos = pos + 80 + Get #F, pos, ProblemTitletLine: pos = pos + 80 + Get #F, pos, NameOfFile: pos = pos + 260 + Get #F, pos, NameOfFile: pos = pos + 260 + Get #F, pos, tmpString32: pos = pos + 32 + Get #F, pos, tmpString32: pos = pos + 32 + .nNodes = NumberOfNodes + .nLinks = NumberOfLinks + ReDim .NodesID(.nNodes) + For j = 1 To NumberOfNodes + Get #F, pos, tmpString32: pos = pos + 32 + i = InStr(1, tmpString32, Chr(0)) + .NodesID(j) = Mid(tmpString32, 1, i - 1) + Next j + ReDim .LinksID(.nLinks) + For j = 1 To NumberOfLinks + Get #F, pos, tmpString32: pos = pos + 32 + i = InStr(1, tmpString32, Chr(0)) + .LinksID(j) = Mid(tmpString32, 1, i - 1) + Next j + For j = 1 To NumberOfLinks * 3 'Index of Start Node of Each Link + Index of End Node of Each Link + Type Code of Each Link + Get #F, pos, tmpLong: pos = pos + 4 + Next j + For j = 1 To NumberOfReservoirsAndTanks 'Node Index of Each Tank + Get #F, pos, tmpLong: pos = pos + 4 + Next j + For j = 1 To NumberOfReservoirsAndTanks 'Cross-Sectional Area of Each Tank + Get #F, pos, tmpSingle: pos = pos + 4 + Next j + For j = 1 To NumberOfNodes 'Elevation of Each Node + Get #F, pos, tmpSingle: pos = pos + 4 + Next j + For j = 1 To NumberOfLinks 'Length of Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + Next j + For j = 1 To NumberOfLinks 'Diameter of Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + Next j + For j = 1 To NumberOfPumps 'Energy Use Section + Get #F, pos, tmpLong: pos = pos + 4 'Pump Index in List of Links + Get #F, pos, tmpSingle: pos = pos + 4 'Pump Utilization (%) + Get #F, pos, tmpSingle: pos = pos + 4 'Average Efficiency (%) + Get #F, pos, tmpSingle: pos = pos + 4 'Average Kwatts/Million Gallons (/Meter3) + Get #F, pos, tmpSingle: pos = pos + 4 'Average Kwatts + Get #F, pos, tmpSingle: pos = pos + 4 'Peak Kwatts + Get #F, pos, tmpSingle: pos = pos + 4 'Average Cost Per Day + Next j + Get #F, pos, tmpSingle: pos = pos + 4 'Overall Peak Energy Usage + + 'reporting + nRep = SimulationDuration / ReportingTimeStep + 1 + ReDim tmpArr(nRep) + ReDim .NodesDemand(.nNodes, nRep) + ReDim .NodesHead(.nNodes, nRep) + ReDim .NodesPressure(.nNodes, nRep) + ReDim .NodesQuality(.nNodes, nRep) + + ReDim .LinksFlow(.nLinks, nRep) + ReDim .LinksHeadloss(.nLinks, nRep) + ReDim .LinksQuality(.nLinks, nRep) + ReDim .LinksSetting(.nLinks, nRep) + ReDim .LinksStatus(.nLinks, nRep) + ReDim .LinksVelocity(.nLinks, nRep) + + For r = 1 To nRep + For j = 1 To NumberOfNodes 'Demand at Each Node + Get #F, pos, tmpSingle: pos = pos + 4 + .NodesDemand(j, r) = tmpSingle + Next j + For j = 1 To NumberOfNodes 'Hydraulic Head at Each Node + Get #F, pos, tmpSingle: pos = pos + 4 + .NodesHead(j, r) = tmpSingle + Next j + For j = 1 To NumberOfNodes 'Pressure at Each Node + Get #F, pos, tmpSingle: pos = pos + 4 + .NodesPressure(j, r) = tmpSingle + Next j + For j = 1 To NumberOfNodes 'Water Quality at Each Node + Get #F, pos, tmpSingle: pos = pos + 4 + .NodesPressure(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Flow in Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + .LinksFlow(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Velocity in Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + .LinksVelocity(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Headloss per 1000 Units of Length for Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + .LinksHeadloss(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Average Water Quality in Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + .LinksQuality(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Status Code for Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + .LinksStatus(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Setting for Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + .LinksSetting(j, r) = tmpSingle + Next j + For j = 1 To NumberOfLinks 'Reaction Rate for Each Link (mass/L/day) + Get #F, pos, tmpSingle: pos = pos + 4 + Next j + For j = 1 To NumberOfLinks 'Friction Factor for Each Link + Get #F, pos, tmpSingle: pos = pos + 4 + Next j + Next r + + 'Epilog Section + Get #F, pos, tmpSingle: pos = pos + 4 'Average bulk reaction rate (mass/hr) + Get #F, pos, tmpSingle: pos = pos + 4 'Average wall reaction rate (mass/hr) + Get #F, pos, tmpSingle: pos = pos + 4 'Average tank reaction rate (mass/hr) + Get #F, pos, tmpSingle: pos = pos + 4 'Average source inflow rate (mass/hr) + Get #F, pos, tmpLong: pos = pos + 4 'Number of Reporting Periods + Get #F, pos, WarningFlag: pos = pos + 4 'Warning Flag + Get #F, pos, tmpLong: pos = pos + 4 'Magic Number ( = 516114521) + + Close #F +End With + +End Function + diff --git a/tests/scripts/vb6_binary_files_compare/frmMain.frm b/tests/scripts/vb6_binary_files_compare/frmMain.frm new file mode 100644 index 0000000..b655734 --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/frmMain.frm @@ -0,0 +1,179 @@ +VERSION 5.00 +Begin VB.Form frmMain + Caption = "Form1" + ClientHeight = 5304 + ClientLeft = 48 + ClientTop = 396 + ClientWidth = 9648 + LinkTopic = "Form1" + ScaleHeight = 5304 + ScaleWidth = 9648 + StartUpPosition = 3 'Windows Default + Begin VB.ListBox List1 + Height = 4272 + Left = 1680 + TabIndex = 1 + Top = 360 + Width = 7092 + End + Begin VB.CommandButton cmdRun + Caption = "RUN" + Height = 372 + Left = 360 + TabIndex = 0 + Top = 360 + Width = 972 + End +End +Attribute VB_Name = "frmMain" +Attribute VB_GlobalNameSpace = False +Attribute VB_Creatable = False +Attribute VB_PredeclaredId = True +Attribute VB_Exposed = False +Option Explicit + +Dim NetName As String + +Dim net1 As typNetRes +Dim net2 As typNetRes + +Private Sub CompareVersions(NetName As String) +'----------------------------------------------- +Dim i As Long +Dim v1 As Single, v2 As Single +Dim T As Long +Dim L As Long +Dim maxDiff As Single +Dim diff As Single +Dim nRep As Long +Dim F As Long + +i = ShellSync("epanet2d.exe nets\" & NetName & ".inp nets\" & NetName & "_1.rep nets\" & NetName & "_1.out", vbNormalFocus) +i = ReadOutputFile("nets\" & NetName & "_1.out", net1) + +i = ShellSync("epanet2.exe nets\" & NetName & ".inp nets\" & NetName & "_2.rep nets\" & NetName & "_2.out", vbNormalFocus) +i = ReadOutputFile("nets\" & NetName & "_2.out", net2) + +F = FreeFile +Open App.Path & "\Nets\" & NetName & ".dif" For Output As #F + +nRep = UBound(net1.LinksFlow, 2) + +maxDiff = 100: diff = 101 +For L = 1 To net1.nLinks + For T = 1 To nRep + v1 = net1.LinksFlow(L, T) + v2 = net2.LinksFlow(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Links Flow max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nLinks + For T = 1 To nRep + v1 = net1.LinksHeadloss(L, T) + v2 = net2.LinksHeadloss(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Links Headloss max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nLinks + For T = 1 To nRep + v1 = net1.LinksQuality(L, T) + v2 = net2.LinksQuality(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Links Quality max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nLinks + For T = 1 To nRep + v1 = net1.LinksVelocity(L, T) + v2 = net2.LinksVelocity(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Links Velocity max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nNodes + For T = 1 To nRep + v1 = net1.NodesDemand(L, T) + v2 = net2.NodesDemand(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Nodes Demand max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nNodes + For T = 1 To nRep + v1 = net1.NodesHead(L, T) + v2 = net2.NodesHead(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Nodes Head max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nNodes + For T = 1 To nRep + v1 = net1.NodesPressure(L, T) + v2 = net2.NodesPressure(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2)) / Log(10)) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Nodes Pressure max diff = " & Format(maxDiff, "0") + +maxDiff = 100: diff = 101 +For L = 1 To net1.nNodes + For T = 1 To nRep + v1 = net1.NodesQuality(L, T) + v2 = net2.NodesQuality(L, T) + If Abs(v1 - v2) > 0 Then diff = -Round(Log(Abs(v1 - v2))) / Log(10) + If diff < maxDiff Then maxDiff = diff + Next T +Next L +Print #F, "Nodes Quality max diff = " & Format(maxDiff, "0") + +Close #F + +End Sub + +Private Sub cmdRun_Click() +'---------------------------------------------- +Dim fName As String + +fName = Dir(App.Path & "\Nets\*.inp") +If fName <> "" Then + Do + List1.AddItem fName: DoEvents + fName = StrReverse(fName) + fName = Mid(fName, 5) + fName = StrReverse(fName) + Call CompareVersions(fName) + fName = Dir + Loop Until fName = "" +End If + +End Sub + + +Private Sub Form_Load() + +List1.Clear + +End Sub + + diff --git a/tests/scripts/vb6_binary_files_compare/nets/Net2.dif b/tests/scripts/vb6_binary_files_compare/nets/Net2.dif new file mode 100644 index 0000000..07aed4e --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/nets/Net2.dif @@ -0,0 +1,8 @@ +Links Flow max diff = 3 +Links Headloss max diff = 4 +Links Quality max diff = 3 +Links Velocity max diff = 6 +Nodes Demand max diff = 3 +Nodes Head max diff = 5 +Nodes Pressure max diff = 3 +Nodes Quality max diff = 100 diff --git a/tests/scripts/vb6_binary_files_compare/nets/Net2.inp b/tests/scripts/vb6_binary_files_compare/nets/Net2.inp new file mode 100644 index 0000000..4b55887 --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/nets/Net2.inp @@ -0,0 +1,311 @@ +[TITLE] +EPANET Example Network 2 +Example of modeling a 55-hour fluoride tracer study. +Measured fluoride data is contained in the file Net2-FL.dat +and should be registered with the project to produce a +Calibration Report (select Calibration Data from the Project +menu). + +[JUNCTIONS] +;ID Elev Demand Pattern + 1 50 -694.4 2 ; + 2 100 8 ; + 3 60 14 ; + 4 60 8 ; + 5 100 8 ; + 6 125 5 ; + 7 160 4 ; + 8 110 9 ; + 9 180 14 ; + 10 130 5 ; + 11 185 34.78 ; + 12 2100 16 ; + 13 210 2 ; + 14 200 2 ; + 15 190 2 ; + 16 150 20 ; + 17 180 20 ; + 18 100 20 ; + 19 150 5 ; + 20 170 19 ; + 21 150 16 ; + 22 200 10 ; + 23 230 8 ; + 24 190 11 ; + 25 230 6 ; + 27 130 8 ; + 28 110 0 ; + 29 110 7 ; + 30 130 3 ; + 31 190 17 ; + 32 110 17 ; + 33 180 1.5 ; + 34 190 1.5 ; + 35 110 0 ; + 36 110 1 ; + +[RESERVOIRS] +;ID Head Pattern + +[TANKS] +;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve + 26 235 56.7 50 70 50 0 ; + +[PIPES] +;ID Node1 Node2 Length Diameter Roughness MinorLoss Status + 1 1 2 2400 12 100 0 Open ; + 2 2 5 800 12 100 0 Open ; + 3 2 3 1300 8 100 0 Open ; + 4 3 4 1200 8 100 0 Open ; + 5 4 5 1000 12 100 0 Open ; + 6 5 6 1200 12 100 0 Open ; + 7 6 7 2700 12 100 0 Open ; + 8 7 8 1200 12 140 0 Open ; + 9 7 9 400 12 100 0 Open ; + 10 8 10 1000 8 140 0 Open ; + 11 9 11 700 12 100 0 Open ; + 12 11 12 1900 12 100 0 Open ; + 13 12 13 600 12 100 0 Open ; + 14 13 14 400 12 100 0 Open ; + 15 14 15 300 12 100 0 Open ; + 16 13 16 1500 8 100 0 Open ; + 17 15 17 1500 8 100 0 Open ; + 18 16 17 600 8 100 0 Open ; + 19 17 18 700 12 100 0 Open ; + 20 18 32 350 12 100 0 Open ; + 21 16 19 1400 8 100 0 Open ; + 22 14 20 1100 12 100 0 Open ; + 23 20 21 1300 8 100 0 Open ; + 24 21 22 1300 8 100 0 Open ; + 25 20 22 1300 8 100 0 Open ; + 26 24 23 600 12 100 0 Open ; + 27 15 24 250 12 100 0 Open ; + 28 23 25 300 12 100 0 Open ; + 29 25 26 200 12 100 0 Open ; + 30 25 31 600 12 100 0 Open ; + 31 31 27 400 8 100 0 Open ; + 32 27 29 400 8 100 0 Open ; + 34 29 28 700 8 100 0 Open ; + 35 22 33 1000 8 100 0 Open ; + 36 33 34 400 8 100 0 Open ; + 37 32 19 500 8 100 0 Open ; + 38 29 35 500 8 100 0 Open ; + 39 35 30 1000 8 100 0 Open ; + 40 28 35 700 8 100 0 Open ; + 41 28 36 300 8 100 0 Open ; + +[PUMPS] +;ID Node1 Node2 Parameters + +[VALVES] +;ID Node1 Node2 Diameter Type Setting MinorLoss + +[TAGS] + +[DEMANDS] +;Junction Demand Pattern Category + +[STATUS] +;ID Status/Setting + +[PATTERNS] +;ID Multipliers +;Demand Pattern + 1 1.26 1.04 .97 .97 .89 1.19 + 1 1.28 .67 .67 1.34 2.46 .97 + 1 .92 .68 1.43 .61 .31 .78 + 1 .37 .67 1.26 1.56 1.19 1.26 + 1 .6 1.1 1.03 .73 .88 1.06 + 1 .99 1.72 1.12 1.34 1.12 .97 + 1 1.04 1.15 .91 .61 .68 .46 + 1 .51 .74 1.12 1.34 1.26 .97 + 1 .82 1.37 1.03 .81 .88 .81 + 1 .81 +;Pump Station Outflow Pattern + 2 .96 .96 .96 .96 .96 .96 + 2 .62 0 0 0 0 0 + 2 .8 1 1 1 1 .15 + 2 0 0 0 0 0 0 + 2 .55 .92 .92 .92 .92 .9 + 2 .9 .45 0 0 0 0 + 2 0 .7 1 1 1 1 + 2 .2 0 0 0 0 0 + 2 0 .74 .92 .92 .92 .92 + 2 .92 +;Pump Station Fluoride Pattern + 3 .98 1.02 1.05 .99 .64 .46 + 3 .35 .35 .35 .35 .35 .35 + 3 .17 .17 .13 .13 .13 .15 + 3 .15 .15 .15 .15 .15 .15 + 3 .15 .12 .1 .08 .11 .09 + 3 .09 .08 .08 .08 .08 .08 + 3 .08 .09 .07 .07 .09 .09 + 3 .09 .09 .09 .09 .09 .09 + 3 .09 .08 .35 .72 .82 .92 + 3 1 + +[CURVES] +;ID X-Value Y-Value + +[CONTROLS] + + +[RULES] + + +[ENERGY] + Global Efficiency 75 + Global Price 0.0 + Demand Charge 0.0 + +[EMITTERS] +;Junction Coefficient + +[QUALITY] +;Node InitQual + 1 1.0 + 2 1.0 + 3 1.0 + 4 1.0 + 5 1.0 + 6 1.0 + 7 1.0 + 8 1.0 + 9 1.0 + 10 1.0 + 11 1.0 + 12 1.0 + 13 1.0 + 14 1.0 + 15 1.0 + 16 1.0 + 17 1.0 + 18 1.0 + 19 1.0 + 20 1.0 + 21 1.0 + 22 1.0 + 23 1.0 + 24 1.0 + 25 1.0 + 27 1.0 + 28 1.0 + 29 1.0 + 30 1.0 + 31 1.0 + 32 1.0 + 33 1.0 + 34 1.0 + 35 1.0 + 36 1.0 + 26 1.0 + +[SOURCES] +;Node Type Quality Pattern + 1 CONCEN 1.0 3 + +[REACTIONS] +;Type Pipe/Tank Coefficient + + +[REACTIONS] + Order Bulk 1 + Order Tank 1 + Order Wall 1 + Global Bulk 0.0 + Global Wall 0.0 + Limiting Potential 0.0 + Roughness Correlation 0.0 + +[MIXING] +;Tank Model + +[TIMES] + Duration 55:00 + Hydraulic Timestep 1:00 + Quality Timestep 0:05 + Pattern Timestep 1:00 + Pattern Start 0:00 + Report Timestep 1:00 + Report Start 0:00 + Start ClockTime 8 am + Statistic NONE + +[REPORT] + Status Full + Summary No + Page 0 + +[OPTIONS] + Units GPM + Headloss H-W + Specific Gravity 1.0 + Viscosity 1.0 + Trials 40 + Accuracy 0.001 + CHECKFREQ 2 + MAXCHECK 10 + DAMPLIMIT 0 + Unbalanced Continue 10 + Pattern 1 + Demand Multiplier 1.0 + Emitter Exponent 0.5 + Quality Fluoride mg/L + Diffusivity 1.0 + Tolerance 0.01 + +[COORDINATES] +;Node X-Coord Y-Coord + 1 21.00 4.00 + 2 19.00 20.00 + 3 11.00 21.00 + 4 14.00 28.00 + 5 19.00 25.00 + 6 28.00 23.00 + 7 36.00 39.00 + 8 38.00 30.00 + 9 36.00 42.00 + 10 37.00 23.00 + 11 37.00 49.00 + 12 39.00 60.00 + 13 38.00 64.00 + 14 38.00 66.00 + 15 37.00 69.00 + 16 27.00 65.00 + 17 27.00 69.00 + 18 23.00 68.00 + 19 21.00 59.00 + 20 45.00 68.00 + 21 51.00 62.00 + 22 54.00 69.00 + 23 35.00 74.00 + 24 37.00 71.00 + 25 35.00 76.00 + 27 39.00 87.00 + 28 49.00 85.00 + 29 42.00 86.00 + 30 47.00 80.00 + 31 37.00 80.00 + 32 23.00 64.00 + 33 56.00 73.00 + 34 56.00 77.00 + 35 43.00 81.00 + 36 53.00 87.00 + 26 33.00 76.00 + +[VERTICES] +;Link X-Coord Y-Coord + +[LABELS] +;X-Coord Y-Coord Label & Anchor Node + 24.00 7.00 "Pump" + 24.00 4.00 "Station" + 26.76 77.42 "Tank" + +[BACKDROP] + DIMENSIONS 8.75 -0.15 58.25 91.15 + UNITS None + FILE + OFFSET 0.00 0.00 + +[END] diff --git a/tests/scripts/vb6_binary_files_compare/readme.txt b/tests/scripts/vb6_binary_files_compare/readme.txt new file mode 100644 index 0000000..e78e456 --- /dev/null +++ b/tests/scripts/vb6_binary_files_compare/readme.txt @@ -0,0 +1,12 @@ +The program will run all INP files in the Nets sub-directory. +A report, binary output files and a .dif file will be created for each INP file. +The report is the min(—log10(abs(X1-X2))) where X1 and X2 are the results arrays obtains from the two binary files. + +Files needed in the code directory: +epanet2d.exe is the official EPANET standalone version. +epanet2.exe is the current development version (the one being tested). + +How to use: run the program and click the RUN button. + +By Elad Salomons +email: selad@optiwater.com \ No newline at end of file