Monday, May 27, 2013

Building proj.dll for 64 bit windows




1-Download source code from (http://trac.osgeo.org/proj/)
At the time of writing this post 4.8.0 was latest (http://download.osgeo.org/proj/proj-4.8.0.tar.gz)

2-Extract all files to c:\proj
(this is important to follow this path or you need to change this file path in make files)

3-find the x64 nmake path on your system, you can use "where" command it will list all nmake versions that you have on your machine. make sure you are using x64 command prompt or it will list only x86 nmake files.

Even if you are unable to find the x64 command prompt x64 version of nmake resides inside amd64 folder on the same path. Following are example path for nmake.

x86
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\nmake.exe
x64
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake.exe

4-Once you find the path of x64 verion of nmake, first you need to prepare environment variables.
Execute the following command
c:\proj\src>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat
 5-Build the source
C:\proj\src>C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\nmake.exe /f makefile.vc
 6-Find the 64 bit dll at "C:\proj\src\proj.dll"

You can also download the 64 bit version of this file from here. proj.dll x64

Standard Electrical Formulas Used for Power Consumption Calculations


TO DETERMINE:
SINGLE-PHASE
THREE-PHASE
DIRECT
CURRENT
KVA
I x E
1000
I x E x 1.73
1000
--------
Kilowatts
I x E x PF
1000
I x E x 1.73 x PF
1000
I x E
1000
Horsepower
I x E x %EFF x PF
746
I x E x 1.732 x %EFF x PF
746
I x E x %EFF
746
Amperes (when HP is known)
HP x 746
E x %EFF x PF
HP x 746
1.73 x E x %EFF x PF
HP x 746
E x %EFF
Amperes (when kW is known)
KW x 1000
E x PF
KW x 1000
1.73 x E x PF
KW x 1000
E
Amperes (when KVA is known)
KVA x 1000
E
KVA x 1000
1.73 x E
--------
1 HP = 7457 Watts
1000 Watts (1KW) = 1.25 KVA with PE=0.8
1 KW = 1 KVA with PE=1.0
Usually observed in generators
1 HP = 571.42
No PE given

Summerizing all worksheet columns into first worksheet

Sub Macro1()
Dim ws As Worksheet
Dim wsInfo As Worksheet
Set wsInfo = ActiveWorkbook.Sheets(1)
Dim Counter As Integer
Counter = 1
For Each ws In ActiveWorkbook.Sheets
Dim columnCounter As Integer
Dim wsColumnCounter As Integer
columnCounter = 2
wsInfo.Cells(Counter, "A").Value = ws.Name

wsColumnCounter = 1
Do While ws.Cells(1, i) <> ""
wsInfo.Cells(Counter, columnCounter).Value = ws.Cells(1, wsColumnCounter)
columnCounter = columnCounter + 1
wsColumnCounter = wsColumnCounter + 1
Loop

Counter = Counter + 1
Next
End Sub


"This code is not tested"