diff --git a/CapServer/20051130220909421.jpg b/CapServer/20051130220909421.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220909421.jpg differ
diff --git a/CapServer/20051130220911609.jpg b/CapServer/20051130220911609.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220911609.jpg differ
diff --git a/CapServer/20051130220913750.jpg b/CapServer/20051130220913750.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220913750.jpg differ
diff --git a/CapServer/20051130220915921.jpg b/CapServer/20051130220915921.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220915921.jpg differ
diff --git a/CapServer/20051130220918187.jpg b/CapServer/20051130220918187.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220918187.jpg differ
diff --git a/CapServer/20051130220920453.jpg b/CapServer/20051130220920453.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220920453.jpg differ
diff --git a/CapServer/20051130220922703.jpg b/CapServer/20051130220922703.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220922703.jpg differ
diff --git a/CapServer/20051130220924875.jpg b/CapServer/20051130220924875.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220924875.jpg differ
diff --git a/CapServer/2005113022092715.jpg b/CapServer/2005113022092715.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/2005113022092715.jpg differ
diff --git a/CapServer/20051130220929187.jpg b/CapServer/20051130220929187.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220929187.jpg differ
diff --git a/CapServer/20051130220931453.jpg b/CapServer/20051130220931453.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220931453.jpg differ
diff --git a/CapServer/20051130220933703.jpg b/CapServer/20051130220933703.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220933703.jpg differ
diff --git a/CapServer/20051130220935968.jpg b/CapServer/20051130220935968.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220935968.jpg differ
diff --git a/CapServer/20051130220938156.jpg b/CapServer/20051130220938156.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220938156.jpg differ
diff --git a/CapServer/20051130220940296.jpg b/CapServer/20051130220940296.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220940296.jpg differ
diff --git a/CapServer/20051130220942468.jpg b/CapServer/20051130220942468.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220942468.jpg differ
diff --git a/CapServer/20051130220944734.jpg b/CapServer/20051130220944734.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130220944734.jpg differ
diff --git a/CapServer/20051130221457468.jpg b/CapServer/20051130221457468.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221457468.jpg differ
diff --git a/CapServer/20051130221459734.jpg b/CapServer/20051130221459734.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221459734.jpg differ
diff --git a/CapServer/20051130221501984.jpg b/CapServer/20051130221501984.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221501984.jpg differ
diff --git a/CapServer/20051130221504156.jpg b/CapServer/20051130221504156.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221504156.jpg differ
diff --git a/CapServer/20051130221506296.jpg b/CapServer/20051130221506296.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221506296.jpg differ
diff --git a/CapServer/20051130221508484.jpg b/CapServer/20051130221508484.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221508484.jpg differ
diff --git a/CapServer/20051130221510734.jpg b/CapServer/20051130221510734.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221510734.jpg differ
diff --git a/CapServer/20051130221512984.jpg b/CapServer/20051130221512984.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221512984.jpg differ
diff --git a/CapServer/20051130221515156.jpg b/CapServer/20051130221515156.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221515156.jpg differ
diff --git a/CapServer/20051130221517296.jpg b/CapServer/20051130221517296.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221517296.jpg differ
diff --git a/CapServer/20051130221519468.jpg b/CapServer/20051130221519468.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221519468.jpg differ
diff --git a/CapServer/20051130221521750.jpg b/CapServer/20051130221521750.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221521750.jpg differ
diff --git a/CapServer/2005113022152415.jpg b/CapServer/2005113022152415.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/2005113022152415.jpg differ
diff --git a/CapServer/20051130221526250.jpg b/CapServer/20051130221526250.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221526250.jpg differ
diff --git a/CapServer/20051130221528421.jpg b/CapServer/20051130221528421.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221528421.jpg differ
diff --git a/CapServer/20051130221530578.jpg b/CapServer/20051130221530578.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221530578.jpg differ
diff --git a/CapServer/20051130221532765.jpg b/CapServer/20051130221532765.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221532765.jpg differ
diff --git a/CapServer/2005113022153515.jpg b/CapServer/2005113022153515.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/2005113022153515.jpg differ
diff --git a/CapServer/20051130221537390.jpg b/CapServer/20051130221537390.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221537390.jpg differ
diff --git a/CapServer/20051130221539531.jpg b/CapServer/20051130221539531.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221539531.jpg differ
diff --git a/CapServer/20051130221541703.jpg b/CapServer/20051130221541703.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221541703.jpg differ
diff --git a/CapServer/20051130221543843.jpg b/CapServer/20051130221543843.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221543843.jpg differ
diff --git a/CapServer/2005113022154631.jpg b/CapServer/2005113022154631.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/2005113022154631.jpg differ
diff --git a/CapServer/20051130221548265.jpg b/CapServer/20051130221548265.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221548265.jpg differ
diff --git a/CapServer/20051130221550437.jpg b/CapServer/20051130221550437.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130221550437.jpg differ
diff --git a/CapServer/20051130222002343.bmp b/CapServer/20051130222002343.bmp
new file mode 100644
index 0000000..3b36403
Binary files /dev/null and b/CapServer/20051130222002343.bmp differ
diff --git a/CapServer/20051130222445656.bmp b/CapServer/20051130222445656.bmp
new file mode 100644
index 0000000..3b36403
Binary files /dev/null and b/CapServer/20051130222445656.bmp differ
diff --git a/CapServer/20051130223038812tmp.jpg b/CapServer/20051130223038812tmp.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130223038812tmp.jpg differ
diff --git a/CapServer/20051130224123468tmp.jpg b/CapServer/20051130224123468tmp.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130224123468tmp.jpg differ
diff --git a/CapServer/20051130224729375.jpg b/CapServer/20051130224729375.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130224729375.jpg differ
diff --git a/CapServer/20051130224729453.bmp b/CapServer/20051130224729453.bmp
new file mode 100644
index 0000000..3b36403
Binary files /dev/null and b/CapServer/20051130224729453.bmp differ
diff --git a/CapServer/20051130225022656.jpg b/CapServer/20051130225022656.jpg
new file mode 100644
index 0000000..c95b8d7
Binary files /dev/null and b/CapServer/20051130225022656.jpg differ
diff --git a/CapServer/CapServer.aps b/CapServer/CapServer.aps
new file mode 100644
index 0000000..e3318c7
Binary files /dev/null and b/CapServer/CapServer.aps differ
diff --git a/CapServer/CapServer.dsp b/CapServer/CapServer.dsp
new file mode 100644
index 0000000..be83abd
--- /dev/null
+++ b/CapServer/CapServer.dsp
@@ -0,0 +1,133 @@
+# Microsoft Developer Studio Project File - Name="CapServer" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=CapServer - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "CapServer.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "CapServer.mak" CFG="CapServer - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "CapServer - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "CapServer - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "CapServer - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "CapServer - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /Gz /MTd /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "STRICT" /D "__FLAT__" /D "_COMMON_USENLS_" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib vfw32.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "CapServer - Win32 Release"
+# Name "CapServer - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\gensrv.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Main.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MainApplication.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\MonitorThread.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Params.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\SocketHeader.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\SocketServer.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\WDMCap.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\CapServer.rc
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/CapServer/CapServer.dsw b/CapServer/CapServer.dsw
new file mode 100644
index 0000000..e2efabe
--- /dev/null
+++ b/CapServer/CapServer.dsw
@@ -0,0 +1,134 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "CapServer"=.\CapServer.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name bsptree
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name codec
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name common
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name jpeg6b
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name socket
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name vidcaplib
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name thread
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "bsptree"=..\bsptree\bsptree.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "codec"=..\codec\codec.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "common"=..\common\common.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "jpeg6b"="..\..\parts\jpeg-6b\jpeg6b.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "socket"=..\socket\socket.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "thread"=..\thread\thread.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "vidcaplib"=..\vidcap\vidcaplib.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/CapServer/CapServer.h b/CapServer/CapServer.h
new file mode 100644
index 0000000..cfef402
--- /dev/null
+++ b/CapServer/CapServer.h
@@ -0,0 +1,4 @@
+#ifndef _CAPSEVER_CAPSERVER_H_
+#define _CAPSEVER_CAPSERVER_H_
+
+#endif
diff --git a/CapServer/CapServer.ncb b/CapServer/CapServer.ncb
new file mode 100644
index 0000000..a145cc4
Binary files /dev/null and b/CapServer/CapServer.ncb differ
diff --git a/CapServer/CapServer.opt b/CapServer/CapServer.opt
new file mode 100644
index 0000000..e9a3a88
Binary files /dev/null and b/CapServer/CapServer.opt differ
diff --git a/CapServer/CapServer.plg b/CapServer/CapServer.plg
new file mode 100644
index 0000000..8f444a2
--- /dev/null
+++ b/CapServer/CapServer.plg
@@ -0,0 +1,55 @@
+
+
+
+Build Log
+
+--------------------Configuration: vidcaplib - Win32 Debug--------------------
+
+Command Lines
+Creating temporary file "C:\DOCUME~1\sean\LOCALS~1\Temp\RSP251.tmp" with contents
+[
+/nologo /Gz /MTd /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "STRICT" /D "__FLAT__" /Fp"debug/vidcaplib.pch" /YX /Fo"debug/" /Fd"debug/" /FD /GZ /c
+"D:\work\vidcap\BMPCAP.CPP"
+]
+Creating command line "cl.exe @C:\DOCUME~1\sean\LOCALS~1\Temp\RSP251.tmp"
+Creating command line "link.exe -lib /nologo /out:"debug\vidcaplib.lib" .\debug\BMPCAP.OBJ .\debug\VIDCAP.OBJ .\debug\VidReg.obj "
+Output Window
+Compiling...
+BMPCAP.CPP
+Creating library...
+
+--------------------Configuration: CapServer - Win32 Debug--------------------
+
+Command Lines
+Creating temporary file "C:\DOCUME~1\sean\LOCALS~1\Temp\RSP252.tmp" with contents
+[
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib vfw32.lib wsock32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/CapServer.pdb" /debug /machine:I386 /out:"Debug/CapServer.exe" /pdbtype:sept
+.\Debug\gensrv.obj
+.\Debug\Main.obj
+.\Debug\MainApplication.obj
+.\Debug\MonitorThread.obj
+.\Debug\Params.obj
+.\Debug\SocketHeader.obj
+.\Debug\SocketServer.obj
+.\Debug\WDMCap.obj
+.\Debug\CapServer.res
+\work\exe\msbsp.lib
+\work\codec\Debug\codec.lib
+\work\exe\mscommon.lib
+"\parts\jpeg-6b\lib\jpeg6b.lib"
+\work\exe\mssocket.lib
+\work\vidcap\debug\vidcaplib.lib
+\work\exe\msthread.lib
+]
+Creating command line "link.exe @C:\DOCUME~1\sean\LOCALS~1\Temp\RSP252.tmp"
+Output Window
+Linking...
+ Creating library Debug/CapServer.lib and object Debug/CapServer.exp
+
+
+
+Results
+CapServer.exe - 0 error(s), 0 warning(s)
+
+
+
diff --git a/CapServer/CapServer.rc b/CapServer/CapServer.rc
new file mode 100644
index 0000000..5f26b51
--- /dev/null
+++ b/CapServer/CapServer.rc
@@ -0,0 +1,2 @@
+#include
+
diff --git a/CapServer/Debug/CapServer.exe b/CapServer/Debug/CapServer.exe
new file mode 100644
index 0000000..dc6f1c2
Binary files /dev/null and b/CapServer/Debug/CapServer.exe differ
diff --git a/CapServer/Debug/CapServer.exp b/CapServer/Debug/CapServer.exp
new file mode 100644
index 0000000..5c6fc09
Binary files /dev/null and b/CapServer/Debug/CapServer.exp differ
diff --git a/CapServer/Debug/CapServer.ilk b/CapServer/Debug/CapServer.ilk
new file mode 100644
index 0000000..8f967b7
Binary files /dev/null and b/CapServer/Debug/CapServer.ilk differ
diff --git a/CapServer/Debug/CapServer.lib b/CapServer/Debug/CapServer.lib
new file mode 100644
index 0000000..55a7eca
Binary files /dev/null and b/CapServer/Debug/CapServer.lib differ
diff --git a/CapServer/Debug/CapServer.pdb b/CapServer/Debug/CapServer.pdb
new file mode 100644
index 0000000..dfb7cf8
Binary files /dev/null and b/CapServer/Debug/CapServer.pdb differ
diff --git a/CapServer/Debug/CapServer.res b/CapServer/Debug/CapServer.res
new file mode 100644
index 0000000..36f26e2
Binary files /dev/null and b/CapServer/Debug/CapServer.res differ
diff --git a/CapServer/Debug/Main.obj b/CapServer/Debug/Main.obj
new file mode 100644
index 0000000..9335a0b
Binary files /dev/null and b/CapServer/Debug/Main.obj differ
diff --git a/CapServer/Debug/MainApplication.obj b/CapServer/Debug/MainApplication.obj
new file mode 100644
index 0000000..719153f
Binary files /dev/null and b/CapServer/Debug/MainApplication.obj differ
diff --git a/CapServer/Debug/MonitorThread.obj b/CapServer/Debug/MonitorThread.obj
new file mode 100644
index 0000000..c1f6937
Binary files /dev/null and b/CapServer/Debug/MonitorThread.obj differ
diff --git a/CapServer/Debug/Params.obj b/CapServer/Debug/Params.obj
new file mode 100644
index 0000000..b08ad74
Binary files /dev/null and b/CapServer/Debug/Params.obj differ
diff --git a/CapServer/Debug/SocketHeader.obj b/CapServer/Debug/SocketHeader.obj
new file mode 100644
index 0000000..bbf3437
Binary files /dev/null and b/CapServer/Debug/SocketHeader.obj differ
diff --git a/CapServer/Debug/SocketServer.obj b/CapServer/Debug/SocketServer.obj
new file mode 100644
index 0000000..8c247fa
Binary files /dev/null and b/CapServer/Debug/SocketServer.obj differ
diff --git a/CapServer/Debug/WDMCap.obj b/CapServer/Debug/WDMCap.obj
new file mode 100644
index 0000000..07409c9
Binary files /dev/null and b/CapServer/Debug/WDMCap.obj differ
diff --git a/CapServer/Debug/gensrv.obj b/CapServer/Debug/gensrv.obj
new file mode 100644
index 0000000..909b123
Binary files /dev/null and b/CapServer/Debug/gensrv.obj differ
diff --git a/CapServer/Debug/image.jpg b/CapServer/Debug/image.jpg
new file mode 100644
index 0000000..2018a1d
Binary files /dev/null and b/CapServer/Debug/image.jpg differ
diff --git a/CapServer/Debug/read.bat b/CapServer/Debug/read.bat
new file mode 100644
index 0000000..ee66a79
--- /dev/null
+++ b/CapServer/Debug/read.bat
@@ -0,0 +1,3 @@
+:loop
+capserver client
+goto loop
diff --git a/CapServer/Debug/vc60.idb b/CapServer/Debug/vc60.idb
new file mode 100644
index 0000000..0afab62
Binary files /dev/null and b/CapServer/Debug/vc60.idb differ
diff --git a/CapServer/Debug/vc60.pdb b/CapServer/Debug/vc60.pdb
new file mode 100644
index 0000000..4e725e3
Binary files /dev/null and b/CapServer/Debug/vc60.pdb differ
diff --git a/CapServer/Main.cpp b/CapServer/Main.cpp
new file mode 100644
index 0000000..6e1babc
--- /dev/null
+++ b/CapServer/Main.cpp
@@ -0,0 +1,25 @@
+#include
+#include
+#include
+
+int handlerRoutine(DWORD ctrlType);
+
+bool running=true;
+
+MainApplication mainApplication;
+
+void main(int argc,char **argv)
+{
+ mainApplication.run(argc,argv);
+}
+
+int handlerRoutine(DWORD eventType) // this is connected ad-hoc to generic server, could be cleaner
+{
+ if(CTRL_C_EVENT==eventType)
+ {
+ ::printf("Caught Ctrl-C...\n");
+ running=false;
+ return true;
+ }
+ return false;
+}
diff --git a/CapServer/MainApplication.cpp b/CapServer/MainApplication.cpp
new file mode 100644
index 0000000..d7e795b
--- /dev/null
+++ b/CapServer/MainApplication.cpp
@@ -0,0 +1,125 @@
+#include
+
+MainApplication::MainApplication()
+{
+}
+
+MainApplication::~MainApplication()
+{
+}
+
+int MainApplication::run(int argc,char **argv)
+{
+ String command;
+
+ mParams.setArgs(argc,argv);
+ switch(mParams.getRequest())
+ {
+ case Params::Client :
+ mParams.showParams();
+ handleClient(mParams.getServer(),mParams.getPort().toInt());
+ break;
+ case Params::Server :
+ mParams.showParams();
+ handleServer(mParams.getHost(),mParams.getPort().toInt(),mParams.getTimeout().toInt(),mParams.getDevice().toInt(),mParams.getRetain(),mParams.getDebug(),mParams.getShowSrcDlg());
+ break;
+ case Params::Settings :
+ mParams.showParams();
+ handleSettings(mParams.getShowSrcDlg());
+ break;
+ case Params::None :
+ displayUsage();
+ break;
+ }
+ return 0;
+}
+
+void MainApplication::handleServer(const String &host,int port,int timeout,int deviceIndex,bool retain,bool debug,bool showSrcDlg)
+{
+ message("[MainApplication::handleServer]starting server");
+ SocketServer socketServer(host,port,deviceIndex,retain,debug,showSrcDlg,timeout);
+ socketServer.listen(host,port);
+}
+
+void MainApplication::handleClient(const String &host,int port)
+{
+ INETSocketAddress internetSocketAddress;
+ InternetAddress internetAddress(127,0,0,1);
+ Socket socket;
+ SocketHeader socketHeader;
+ Array content;
+
+ message("[MainApplication::handleClient]starting client");
+ internetSocketAddress.family(PF_INET);
+ internetSocketAddress.port(1024);
+ internetSocketAddress.internetAddress(internetAddress);
+ if(!socket.create())
+ {
+ message("[MainApplication::handleClient]create failed...");
+ return;
+ }
+ if(!socket.connect(internetSocketAddress))
+ {
+ message("[MainApplication::handleClient]connect failed...");
+ return;
+ }
+ message("[MainApplication::handleClient]reading socket header...");
+ socketHeader.unmarshall(socket);
+ message("[MainApplication::handleClient]header length",socketHeader.getSizeHeader());
+ message("[MainApplication::handleClient]version",socketHeader.getVersion());
+ message("[MainApplication::handleClient]content length",socketHeader.getContentLength());
+ message("[MainApplication::handleClient]content type",(int)socketHeader.getContentType());
+ content.size(socketHeader.getContentLength());
+ message("[MainApplication::handleClient]reading content...");
+ socket.receive((char*)&content[0],content.size());
+ message("[MainApplication::handleClient]done...");
+ socket.destroy();
+}
+
+void MainApplication::handleSettings(bool showSrcDlg)
+{
+ VidReg vidReg;
+ Block driverInfoBlock;
+
+ VidCap::getDrivers(driverInfoBlock);
+ message("[MainApplication::handleSettings]Capture File",vidReg.getCaptureFile());
+ message("[MainApplication::handleSettings]Sequencing",vidReg.getSequencing()?"true":"false");
+ message("[MainApplication::handleSettings]Preview Rate",vidReg.getPreviewRate());
+ message("[MainApplication::handleSettings]Preview Width",vidReg.getPreviewWidth());
+ message("[MainApplication::handleSettings]Preview Height",vidReg.getPreviewHeight());
+ message("[MainApplication::handleSettings]Capture Width",vidReg.getCaptureWidth());
+ message("[MainApplication::handleSettings]Capture Height",vidReg.getCaptureHeight());
+ message("[MainApplication::handleSettings]Capture Quality",vidReg.getQuality());
+ message("[MainApplication::handleSettings]***********CAPTURE DEVICE LIST*********");
+ if(!driverInfoBlock.size())message("[MainApplication::handleSettings]No capture devices on system.");
+ for(int index=0;index | ");
+ message(" host= | ");
+ message(" port=");
+ message(" device=");
+ message(" retain={true} | {false}");
+ message(" debug={true} | {false}");
+ message(" showsrcdlg={true} | {false}");
+ message(" timeout= (Delay between frame grab for retain mode. (ms))");
+ message(" ");
+ message(" CapServer run=server host=127.0.0.1 port=1024");
+ message(" CapServer run=server host=127.0.0.1 port=1024 device=0");
+ message(" CapServer run=client server=127.0.0.1 port=1024");
+ message(" CapServer run=settings");
+}
+
diff --git a/CapServer/MainApplication.hpp b/CapServer/MainApplication.hpp
new file mode 100644
index 0000000..1022e91
--- /dev/null
+++ b/CapServer/MainApplication.hpp
@@ -0,0 +1,55 @@
+#ifndef _CAPSERVER_MAINAPPLICATION_HPP_
+#define _CAPSERVER_MAINAPPLICATION_HPP_
+#ifndef _CAPSERVER_SOCKET_HEADER_HPP_
+#include
+#endif
+#ifndef _SOCKET_WSADATA_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_SOCKETSERVER_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_PARAMS_HPP_
+#include
+#endif
+#ifndef _VIDCAP_VIDREG_HPP_
+#include
+#endif
+
+class MainApplication
+{
+public:
+ MainApplication();
+ virtual ~MainApplication();
+ int run(int argc,char **argv);
+private:
+ void message(const String &message);
+ void message(const String &message,int arg);
+ void message(const String &message,const String &arg);
+ void handleServer(const String &host,int port,int timeout,int deviceIndex,bool retain,bool debug,bool showSrcDlg);
+ void handleClient(const String &server,int port);
+ void handleSettings(bool showSrcDlg);
+ void displayUsage(void);
+
+ WSASystem mWSASystem;
+ Params mParams;
+};
+
+inline
+void MainApplication::message(const String &message)
+{
+ printf("%s\n",message.str());
+}
+
+inline
+void MainApplication::message(const String &message,int arg)
+{
+ printf("%s=%d\n",message.str(),arg);
+}
+
+inline
+void MainApplication::message(const String &message,const String &arg)
+{
+ printf("%s=%s\n",message.str(),arg.str());
+}
+#endif
diff --git a/CapServer/MonitorThread.cpp b/CapServer/MonitorThread.cpp
new file mode 100644
index 0000000..2703abf
--- /dev/null
+++ b/CapServer/MonitorThread.cpp
@@ -0,0 +1,161 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+MonitorThread::MonitorThread()
+: mIsRunning(false), mTimeout(DefaultTimeout)
+{
+ mCallback.setCallback(this,&MonitorThread::threadCallback);
+ insertHandler(&mCallback);
+}
+
+MonitorThread::~MonitorThread()
+{
+ stop();
+ removeHandler(&mCallback);
+}
+
+void MonitorThread::startMonitor(const String &host,int port,DWORD timeout)
+{
+ message("MonitorThread::startMonitor");
+ ThreadMessage threadMessage(ThreadMessage::TM_USER,MsgMonitorStart);
+ mHost=host;
+ mPort=port;
+ mTimeout=timeout;
+ getHostAddress();
+ postMessage(threadMessage);
+}
+
+void MonitorThread::stopMonitor(void)
+{
+ message("MonitorThread::startMonitor");
+ ThreadMessage threadMessage(ThreadMessage::TM_USER,MsgMonitorStop);
+ postMessage(threadMessage);
+ mMonitorEvent.waitEvent();
+}
+
+DWORD MonitorThread::threadCallback(ThreadMessage &threadMessage)
+{
+ switch(threadMessage.message())
+ {
+ case ThreadMessage::TM_CREATE :
+ break;
+ case ThreadMessage::TM_DESTROY :
+ break;
+ case ThreadMessage::TM_USER :
+ switch(MonitorThMsg(threadMessage.userDataOne()))
+ {
+ case MsgMonitorStart :
+ handleMonitorStart();
+ break;
+ case MsgMonitorStop :
+ handleMonitorStop();
+ break;
+ }
+ break;
+ }
+ return 0;
+}
+
+void MonitorThread::handleMonitorStart()
+{
+ DWORD elapsedTime;
+ message("[MonitorThread::handleMonitorStart]ENTER");
+ mIsRunning=true;
+ message(String("[MonitorThread::handleMonitorStart]InitDelay=")+String().fromInt(InitDelay)+String(" (ms)."));
+ ::Sleep(InitDelay);
+ while(mIsRunning)
+ {
+ elapsedTime=::GetTickCount();
+ getImage();
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message("[MonitorThread::handleMonitorStart]GetImage Took "+String().fromInt(elapsedTime)+String(" (ms)."));
+ ::Sleep(mTimeout);
+ }
+ message("]MonitorThread::handleMonitorStart]LEAVE");
+}
+
+void MonitorThread::handleMonitorStop()
+{
+ message("[MonitorThread::handleMonitorStop]ENTER");
+ message("[MonitorThread::handleMonitorStop]LEAVE");
+ mIsRunning=false;
+}
+
+void MonitorThread::getHostAddress()
+{
+ Block internetAddresses;
+ HostEnt hostEnt;
+
+ hostEnt.hostByName(mHost);
+ internetAddresses=hostEnt.addresses();
+ if(!internetAddresses.size())return;
+ for(int index=0;index")+internetAddresses[0].toString());
+ }
+ mInternetAddress=internetAddresses[0];
+}
+
+void MonitorThread::getImage()
+{
+ INETSocketAddress internetSocketAddress;
+ Socket socket;
+ SocketHeader socketHeader;
+ Array content;
+
+ message("[MonitorThread::getImage]starting client");
+ internetSocketAddress.family(PF_INET);
+ internetSocketAddress.port(mPort);
+ internetSocketAddress.internetAddress(mInternetAddress);
+ if(!socket.create())
+ {
+ message("[MonitorThread::getImage]create socket failed...");
+ return;
+ }
+ if(!socket.connect(internetSocketAddress))
+ {
+ message(String("[MonitorThread::getImage]connect to '")+internetSocketAddress.toString()+String("' failed..."));
+ return;
+ }
+ message("[MonitorThread::getImage]reading socket header...");
+ socketHeader.unmarshall(socket);
+ message("[MonitorThread::getImage]header length",socketHeader.getSizeHeader());
+ message("[MonitorThread::getImage]version",socketHeader.getVersion());
+ message("[MonitorThread::getImage]content length",socketHeader.getContentLength());
+ message("[MonitorThread::getImage]content type",(int)socketHeader.getContentType());
+ content.size(socketHeader.getContentLength());
+ message("[MonitorThread::getImage]reading content...");
+ socket.receive((char*)&content[0],content.size());
+ saveImage(content);
+ message("[MonitorThread::getImage]done...");
+ socket.destroy();
+}
+
+bool MonitorThread::saveImage(Array &imageData)
+{
+ SystemTime systemTime;
+ String strPathImageFile;
+ FileHandle openFile;
+
+ if(!imageData.size())return message("[MonitorThread::saveImage] No Data"),false;
+ strPathImageFile.reserve(1024);
+ ::sprintf(strPathImageFile,"%04d%02d%02d%02d%02d%02d%02d.jpg",
+ systemTime.year(),systemTime.month(),systemTime.day(),
+ systemTime.hour(),systemTime.minute(),systemTime.second(),
+ systemTime.milliseconds());
+ if(!openFile.open(strPathImageFile,FileHandle::Write,FileHandle::ShareRead,FileHandle::Overwrite))
+ {
+ message(String("[MonitorThread::saveImage]Open '")+strPathImageFile+String("' for write Failed."));
+ return false;
+ }
+ openFile.write(&imageData[0],imageData.size());
+ openFile.close();
+ return true;
+}
+
+
diff --git a/CapServer/MonitorThread.hpp b/CapServer/MonitorThread.hpp
new file mode 100644
index 0000000..293be97
--- /dev/null
+++ b/CapServer/MonitorThread.hpp
@@ -0,0 +1,50 @@
+#ifndef _CAPSERVER_MONITORTHREAD_HPP_
+#define _CAPSERVER_MONITORTHREAD_HPP_
+#ifndef _SOCKET_SOCKET_HPP_
+#include
+#endif
+#ifndef _THREAD_MESSAGETHREAD_HPP_
+#include
+#endif
+
+class MonitorThread : private MessageThread
+{
+public:
+ MonitorThread();
+ virtual ~MonitorThread();
+ void startMonitor(const String &host,int port,DWORD timeout);
+ void stopMonitor(void);
+private:
+ typedef enum MonitorThMsg{MsgMonitorStart,MsgMonitorStop};
+ enum{DefaultTimeout=1000,InitDelay=0}; // InitDelay=10000
+ DWORD threadCallback(ThreadMessage &threadMessage);
+ void handleMonitorStart(void);
+ void handleMonitorStop(void);
+ void message(const String &string);
+ void message(const String &string,int value);
+ void getHostAddress(void);
+ void getImage(void);
+ bool saveImage(Array &imageData);
+
+ ThreadCallback mCallback;
+ InternetAddress mInternetAddress;
+ Event mMonitorEvent;
+ bool mIsRunning;
+ String mHost;
+ int mPort;
+ DWORD mTimeout;
+};
+
+inline
+void MonitorThread::message(const String &string)
+{
+ ::printf("%s\n",string.str());
+}
+
+inline
+void MonitorThread::message(const String &string,int value)
+{
+ ::printf("%s=%d\n",string.str(),value);
+}
+#endif
+
diff --git a/CapServer/NameValuePair.hpp b/CapServer/NameValuePair.hpp
new file mode 100644
index 0000000..86a5650
--- /dev/null
+++ b/CapServer/NameValuePair.hpp
@@ -0,0 +1,72 @@
+#ifndef _CAPSERVER_NAMEVALUE_HPP_
+#define _CAPSERVER_NAMEVALUE_HPP_
+#ifndef _COMMON_STRING_HPP_
+#include
+#endif
+
+class NameValuePair
+{
+public:
+ NameValuePair();
+ NameValuePair(const String &name,const String &value);
+ const String &getName(void)const;
+ void setName(const String &name);
+ const String &getValue(void)const;
+ void setValue(const String &value);
+ bool fromString(const String &string);
+ String toString(void)const;
+private:
+ String mName;
+ String mValue;
+};
+
+inline
+NameValuePair::NameValuePair()
+{
+}
+
+inline
+NameValuePair::NameValuePair(const String &name,const String &value)
+: mName(name), mValue(value)
+{
+}
+
+inline
+const String &NameValuePair::getName(void)const
+{
+ return mName;
+}
+
+inline
+void NameValuePair::setName(const String &name)
+{
+ mName=name;
+}
+
+inline
+const String &NameValuePair::getValue(void)const
+{
+ return mValue;
+}
+
+inline
+void NameValuePair::setValue(const String &value)
+{
+ mValue=value;
+}
+
+inline
+bool NameValuePair::fromString(const String &string)
+{
+ if(string.isNull())return false;
+ mName=string.betweenString(0,'=');
+ mValue=string.betweenString('=',0);
+ return true;
+}
+
+inline
+String NameValuePair::toString(void)const
+{
+ return mName+String("=")+mValue;
+}
+#endif
diff --git a/CapServer/Params.cpp b/CapServer/Params.cpp
new file mode 100644
index 0000000..b02afa6
--- /dev/null
+++ b/CapServer/Params.cpp
@@ -0,0 +1,86 @@
+#include
+#include
+
+void Params::setArgs(int argc,char **argv)
+{
+ String strArg;
+ getParams(argc,argv);
+ if(getServer().isNull())setServer("127.0.0.1");
+ if(getHost().isNull())setHost("127.0.0.1");
+ if(getPort().isNull())setPort("1024");
+ if(getTimeout().isNull())setTimeout("1000");
+ if(getDevice().isNull())setDevice("0");
+ strArg=getValue(mRetainKey);
+ strArg.lower();
+ if(!(strArg==String("true")) && !(strArg==String("false")))setRetain(false);
+ else if(strArg==String("true"))setRetain(true);
+ else setRetain(false);
+ strArg=getValue(mDebugKey);
+ strArg.lower();
+ if(!(strArg==String("true")) && !(strArg==String("false")))setDebug(false);
+ else if(strArg==String("true"))setDebug(true);
+ else setDebug(false);
+ strArg=getValue(mShowSrcDlgKey);
+ strArg.lower();
+ if(!(strArg==String("true")) && !(strArg==String("false")))setShowSrcDlg(false);
+ else if(strArg==String("true"))setShowSrcDlg(true);
+ else setShowSrcDlg(false);
+}
+
+int Params::getParams(int argc,char**argv)
+{
+ mNameValuePairs.remove();
+ for(int index=0;index
+#endif
+#ifndef _CAPSERVER_NAMEVALUE_HPP_
+#include
+#endif
+
+class Params
+{
+public:
+ typedef enum Request{Server,Client,Settings,None};
+ Params(int argc,char **argv);
+ Params();
+ virtual ~Params();
+ Request getRequest(void)const;
+ String getServer(void)const;
+ String getHost(void)const;
+ String getPort(void)const;
+ String getDevice(void)const;
+ bool getRetain(void)const;
+ bool getDebug(void)const;
+ String getTimeout(void)const;
+ bool getShowSrcDlg(void)const;
+ void setArgs(int argc,char **argv);
+ void showParams(void);
+private:
+ int getParams(int argc,char **argv);
+ String getValue(const String &key)const;
+ void setValue(const String &key,const String &value);
+ String getRun(void)const;
+ void setServer(const String &server);
+ void setHost(const String &host);
+ void setPort(const String &port);
+ void setDevice(const String &device);
+ void setRetain(bool retain);
+ void setDebug(bool debug);
+ void setTimeout(const String &timeout);
+ void setShowSrcDlg(bool showSrcDlg);
+
+ Block mNameValuePairs;
+ String mRunKey;
+ String mServerKey;
+ String mHostKey;
+ String mPortKey;
+ String mDeviceKey;
+ String mRetainKey;
+ String mDebugKey;
+ String mShowSrcDlgKey;
+ String mTimeoutKey;
+};
+
+inline
+Params::Params(int argc,char **argv)
+: mRunKey("run"), mServerKey("server"), mHostKey("host"), mPortKey("port"), mDeviceKey("device"),
+ mRetainKey("retain"), mDebugKey("debug"), mShowSrcDlgKey("showsrcdlg"), mTimeoutKey("timeout")
+{
+ getParams(argc,argv);
+}
+
+inline
+Params::Params()
+: mRunKey("run"), mServerKey("server"), mHostKey("host"), mPortKey("port"), mDeviceKey("device"),
+ mRetainKey("retain"), mDebugKey("debug"), mShowSrcDlgKey("showsrcdlg"), mTimeoutKey("timeout")
+{
+}
+
+inline
+Params::~Params()
+{
+}
+
+inline
+String Params::getRun(void)const
+{
+ return getValue(mRunKey);
+}
+
+inline
+String Params::getServer(void)const
+{
+ return getValue(mServerKey);
+}
+
+inline
+String Params::getHost(void)const
+{
+ return getValue(mHostKey);
+}
+
+inline
+String Params::getPort(void)const
+{
+ return getValue(mPortKey);
+}
+
+inline
+String Params::getDevice(void)const
+{
+ return getValue(mDeviceKey);
+}
+
+inline
+bool Params::getRetain(void)const
+{
+ String strRetain(getValue(mRetainKey));
+ if(strRetain=="true")return true;
+ return false;
+}
+
+inline
+bool Params::getDebug(void)const
+{
+ String strDebug(getValue(mDebugKey));
+ if(strDebug=="true")return true;
+ return false;
+}
+
+inline
+bool Params::getShowSrcDlg(void)const
+{
+ String strValue(getValue(mShowSrcDlgKey));
+ if(strValue=="true")return true;
+ return false;
+}
+
+inline
+void Params::setServer(const String &server)
+{
+ setValue(mServerKey,server);
+}
+
+inline
+void Params::setHost(const String &host)
+{
+ setValue(mHostKey,host);
+}
+
+inline
+void Params::setPort(const String &port)
+{
+ setValue(mPortKey,port);
+}
+
+inline
+void Params::setDevice(const String &device)
+{
+ setValue(mDeviceKey,device);
+}
+
+inline
+void Params::setRetain(bool retain)
+{
+ if(retain)setValue(mRetainKey,"true");
+ else setValue(mRetainKey,"false");
+}
+
+inline
+void Params::setDebug(bool debug)
+{
+ if(debug)setValue(mDebugKey,"true");
+ else setValue(mDebugKey,"false");
+}
+
+inline
+void Params::setShowSrcDlg(bool showSrcDlg)
+{
+ if(showSrcDlg)setValue(mShowSrcDlgKey,"true");
+ else setValue(mShowSrcDlgKey,"false");
+}
+
+inline
+String Params::getTimeout(void)const
+{
+ return getValue(mTimeoutKey);
+}
+
+inline
+void Params::setTimeout(const String &timeout)
+{
+ setValue(mTimeoutKey,timeout);
+}
+#endif
diff --git a/CapServer/SocketHeader.cpp b/CapServer/SocketHeader.cpp
new file mode 100644
index 0000000..f487ab4
--- /dev/null
+++ b/CapServer/SocketHeader.cpp
@@ -0,0 +1,64 @@
+#include
+
+SocketHeader::SocketHeader()
+: mSizeHeader(sizeof(mSizeHeader)+sizeof(mVersion)+sizeof(mContentLength)+sizeof(mContentType)),
+ mVersion(0), mContentLength(0), mContentType(Unknown)
+{
+}
+
+SocketHeader::~SocketHeader()
+{
+}
+
+int SocketHeader::getSizeHeader(void)const
+{
+ return mSizeHeader;
+}
+
+int SocketHeader::getVersion(void)const
+{
+ return mVersion;
+}
+
+void SocketHeader::setVersion(int version)
+{
+ mVersion=version;
+}
+
+int SocketHeader::getContentLength(void)const
+{
+ return mContentLength;
+}
+
+void SocketHeader::setContentLength(int contentLength)
+{
+ mContentLength=contentLength;
+}
+
+SocketHeader::ContentType SocketHeader::getContentType(void)const
+{
+ return (ContentType)mContentType;
+}
+
+void SocketHeader::setContentType(int contentType)
+{
+ mContentType=(ContentType)contentType;
+}
+
+bool SocketHeader::marshall(Socket &socket)
+{
+ if(!socket.send((char*)&mSizeHeader,sizeof(int)))return false;
+ if(!socket.send((char*)&mVersion,sizeof(int)))return false;
+ if(!socket.send((char*)&mContentLength,sizeof(int)))return false;
+ if(!socket.send((char*)&mContentType,sizeof(int)))return false;
+ return true;
+}
+
+bool SocketHeader::unmarshall(Socket &socket)
+{
+ if(!socket.receive((char*)&mSizeHeader,sizeof(int)))return false;
+ if(!socket.receive((char*)&mVersion,sizeof(int)))return false;
+ if(!socket.receive((char*)&mContentLength,sizeof(int)))return false;
+ if(!socket.receive((char*)&mContentType,sizeof(int)))return false;
+ return true;
+}
\ No newline at end of file
diff --git a/CapServer/SocketHeader.hpp b/CapServer/SocketHeader.hpp
new file mode 100644
index 0000000..cf9dd25
--- /dev/null
+++ b/CapServer/SocketHeader.hpp
@@ -0,0 +1,31 @@
+#ifndef _CAPSERVER_SOCKET_HEADER_HPP_
+#define _CAPSERVER_SOCKET_HEADER_HPP_
+#ifndef _COMMON_WINDOWS_HPP_
+#include
+#endif
+#ifndef _SOCKET_SOCKET_HPP_
+#include
+#endif
+
+class SocketHeader
+{
+public:
+ typedef enum ContentType{Unknown,ImageJPG};
+ SocketHeader();
+ virtual ~SocketHeader();
+ int getSizeHeader(void)const;
+ int getVersion(void)const;
+ void setVersion(int version);
+ int getContentLength(void)const;
+ void setContentLength(int contentLength);
+ ContentType getContentType(void)const;
+ void setContentType(int contentType);
+ bool marshall(Socket &socket);
+ bool unmarshall(Socket &socket);
+private:
+ int mSizeHeader;
+ int mVersion;
+ int mContentLength;
+ int mContentType;
+};
+#endif
\ No newline at end of file
diff --git a/CapServer/SocketServer.cpp b/CapServer/SocketServer.cpp
new file mode 100644
index 0000000..7ce1bc8
--- /dev/null
+++ b/CapServer/SocketServer.cpp
@@ -0,0 +1,105 @@
+#include
+#include
+#include
+#include
+#include
+
+SocketServer::SocketServer(const String &host,int port,int deviceIndex,bool retain,bool debug,bool showSrcDlg,int timeout)
+: mWDMCap(deviceIndex), mDebug(debug)
+{
+ if(showSrcDlg)mWDMCap.dialogVideoSource();
+ if(retain)mMonitorThread.startMonitor(host,port,timeout);
+}
+
+SocketServer::~SocketServer()
+{
+ mMonitorThread.stopMonitor();
+}
+
+void SocketServer::acceptHandler(SmartPointer &socketControl)
+{
+ if(mDebug)sendDebugFrame(*socketControl);
+ else sendFrame(*socketControl);
+
+}
+
+void SocketServer::message(const String &string)
+{
+ ::printf("%s\n",string.str());
+}
+
+void SocketServer::sendFrame(Socket &socketControl)
+{
+ DiskInfo diskInfo;
+ SystemTime systemTime;
+ String strPathCaptureFile;
+ SocketHeader socketHeader;
+ Array charBytes;
+ FileHandle openFile;
+ DWORD elapsedTime;
+
+ socketHeader.setVersion(1);
+ socketHeader.setContentType(SocketHeader::ImageJPG);
+ socketHeader.setContentLength(0);
+ strPathCaptureFile.reserve(1024);
+ ::sprintf(strPathCaptureFile,"%04d%02d%02d%02d%02d%02d%02d.jpg",
+ systemTime.year(),systemTime.month(),systemTime.day(),
+ systemTime.hour(),systemTime.minute(),systemTime.second(),
+ systemTime.milliseconds());
+ elapsedTime=::GetTickCount();
+ mWDMCap.setCaptureFileName(strPathCaptureFile);
+ mWDMCap.grabFrameNoStop();
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[SocketServer::sendFrame] Grab frame took ")+String().fromInt(elapsedTime)+String(" (ms)"));
+ if(!openFile.open(strPathCaptureFile,FileHandle::Read,FileHandle::ShareRead))
+ {
+ socketHeader.marshall(socketControl);
+ }
+ else
+ {
+ charBytes.size(openFile.size());
+ socketHeader.setContentLength(charBytes.size());
+ elapsedTime=::GetTickCount();
+ openFile.read((BYTE*)&charBytes[0],charBytes.size());
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[SocketServer::sendFrame] Read ")+String().fromInt(charBytes.size())+String(" bytes took ")+String().fromInt(elapsedTime)+String(" (ms)"));
+ elapsedTime=::GetTickCount();
+ socketHeader.marshall(socketControl);
+ socketControl.send((char*)&charBytes[0],charBytes.size());
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[SocketServer::sendFrame] Send ")+String().fromInt(charBytes.size())+String(" bytes took ")+String().fromInt(elapsedTime)+String(" (ms)"));
+ openFile.close();
+ diskInfo.unlink(strPathCaptureFile);
+ }
+ message(String("[SocketServer::sendFrame]Sent ")+String().fromInt(charBytes.size())+String(" bytes"));
+ return;
+}
+
+void SocketServer::sendDebugFrame(Socket &socketControl)
+{
+ DiskInfo diskInfo;
+ Array charBytes;
+ FileHandle openFile;
+ SocketHeader socketHeader;
+ String strPathFileName;
+
+ strPathFileName="./image.jpg";
+ socketHeader.setVersion(1);
+ socketHeader.setContentType(SocketHeader::ImageJPG);
+ socketHeader.setContentLength(0);
+ if(!openFile.open(strPathFileName,FileHandle::Read,FileHandle::ShareRead))
+ {
+ message("[SocketServer::sendDebugFrame] 'image.jpg' was not found, sending empty content");
+ socketHeader.marshall(socketControl);
+ }
+ else
+ {
+ charBytes.size(openFile.size());
+ socketHeader.setContentLength(charBytes.size());
+ openFile.read((BYTE*)&charBytes[0],charBytes.size());
+ socketHeader.marshall(socketControl);
+ socketControl.send((char*)&charBytes[0],charBytes.size());
+ message(String("[SocketServer::sendDebugFrame] Send ")+String().fromInt(charBytes.size()));
+ openFile.close();
+ }
+}
diff --git a/CapServer/SocketServer.hpp b/CapServer/SocketServer.hpp
new file mode 100644
index 0000000..b26c01c
--- /dev/null
+++ b/CapServer/SocketServer.hpp
@@ -0,0 +1,36 @@
+#ifndef _CAPSERVER_SOCKETSERVER_HPP_
+#define _CAPSERVER_SOCKETSERVER_HPP_
+#ifndef _COMMON_BLOCK_HPP_
+#include
+#endif
+#ifndef _THREAD_MONITOR_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_WDMCAP_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_GENERICSERVER_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_MONITORTHREAD_HPP_
+#include
+#endif
+
+class SocketServer : public GenericServer
+{
+public:
+ SocketServer(const String &host,int port,int deviceIndex=0,bool retain=false,bool debug=false,bool showSrcDlg=false,int timeout=1000);
+ virtual ~SocketServer();
+protected:
+ virtual void acceptHandler(SmartPointer &socketControl);
+ virtual void message(const String &message);
+private:
+ void sendFrame(Socket &socketControl);
+ void sendDebugFrame(Socket &socketControl);
+
+ MonitorThread mMonitorThread;
+ WDMCap mWDMCap;
+ VidCap mVidCap;
+ bool mDebug;
+};
+#endif
diff --git a/CapServer/WDMCap.cpp b/CapServer/WDMCap.cpp
new file mode 100644
index 0000000..cca61f0
--- /dev/null
+++ b/CapServer/WDMCap.cpp
@@ -0,0 +1,101 @@
+#include
+#include
+
+WDMCap::WDMCap(int deviceIndex)
+: mDriverIndex(deviceIndex)
+{
+ initialize();
+}
+
+WDMCap::~WDMCap()
+{
+}
+
+void WDMCap::setCaptureFileName(const String &strPathCaptureFile)
+{
+ BmpCap::setCaptureFileName(strPathCaptureFile);
+}
+
+const String &WDMCap::getCaptureFileName(void)const
+{
+ return BmpCap::getCaptureFileName();
+}
+
+bool WDMCap::initialize(void)
+{
+ String pathOutputFileName="capture.jpg";
+ VidReg vidReg;
+
+ vidReg.setCaptureFile(pathOutputFileName);
+ vidReg.setSequencing(false);
+ VidCap::getDrivers(mDriverInfoBlock);
+ if(!mDriverInfoBlock.size())
+ {
+ message("No drivers found! drivercount",mDriverInfoBlock.size());
+ return false;
+ }
+ if(mDriverIndex>=mDriverInfoBlock.size())
+ {
+ message("[WDMCap::initilialize]Driver not found! device",mDriverIndex);
+ return false;
+ }
+ showSettings();
+ mControl=::new Control();
+ mControl.disposition(PointerDisposition::Delete);
+ mControl->createControl("BUTTON","",0,Rect(0,0,vidReg.getCaptureWidth(),vidReg.getCaptureHeight()),::GetDesktopWindow(),ControlID);
+ BmpCap::initialize(mControl->getHandle(),mDriverIndex);
+ if(!connect(mDriverIndex))
+ {
+ ::printf("\007");
+ message("[WDMCap::initilialize]Failed to connect to device",mDriverInfoBlock[mDriverIndex].driverName());
+ return false;
+ }
+ saveFrames(true);
+ return isConnected();
+}
+
+void WDMCap::showSettings(void)
+{
+ VidReg vidReg;
+
+ message("[WDMCap::initilialize]Capture File",vidReg.getCaptureFile());
+ message("[WDMCap::initilialize]Sequencing",vidReg.getSequencing()?"true":"false");
+ message("[WDMCap::initilialize]Preview Rate",vidReg.getPreviewRate());
+ message("[WDMCap::initilialize]Preview Width",vidReg.getPreviewWidth());
+ message("[WDMCap::initilialize]Preview Height",vidReg.getPreviewHeight());
+ message("[WDMCap::initilialize]Capture Width",vidReg.getCaptureWidth());
+ message("[WDMCap::initilialize]Capture Height",vidReg.getCaptureHeight());
+ message("[WDMCap::initilialize]Capture Quality",vidReg.getQuality());
+ for(int index=0;index
+#endif
+#ifndef _COMMON_BLOCK_HPP_
+#include
+#endif
+#ifndef _COMMON_CONTROL_HPP_
+#include
+#endif
+#ifndef _THREAD_EVENT_HPP_
+#include
+#endif
+#ifndef _VIDCAP_BMPCAP_HPP_
+#include
+#endif
+
+class WDMCap : private BmpCap
+{
+public:
+ WDMCap(int deviceIndex=0);
+ virtual ~WDMCap();
+ bool grabFrame(void);
+ bool grabFrameNoStop(void);
+ bool dialogVideoSource(void);
+ bool isConnected(void)const;
+ bool getDriverCaps(DriverCaps &someDriverCaps);
+ bool getCaptureParams(CaptureParams &someCaptureParams);
+ void setCaptureFileName(const String &strPathCaptureFile);
+ const String &getCaptureFileName(void)const;
+protected:
+ virtual void frameHandler(VIDEOHDR &videoHeader);
+private:
+ enum{ControlID=100};
+ bool initialize(void);
+ void showSettings(void);
+ void message(const String &message);
+ void message(const String &message,const String &arg);
+ void message(const String &message,int arg);
+
+ SmartPointer mControl;
+ Block mDriverInfoBlock;
+ Event mFrameEvent;
+ DWORD mDriverIndex;
+ DWORD mGrabTime;
+};
+
+inline
+bool WDMCap::dialogVideoSource(void)
+{
+ return BmpCap::dialogVideoSource();
+}
+
+inline
+bool WDMCap::isConnected(void)const
+{
+ return BmpCap::isConnected();
+}
+
+inline
+bool WDMCap::getDriverCaps(DriverCaps &someDriverCaps)
+{
+ return BmpCap::getDriverCaps(someDriverCaps);
+}
+
+inline
+bool WDMCap::getCaptureParams(CaptureParams &someCaptureParams)
+{
+ return BmpCap::getCaptureParams(someCaptureParams);
+}
+
+inline
+void WDMCap::message(const String &message,int arg)
+{
+ ::printf("%s=%d\n",message.str(),arg);
+}
+
+inline
+void WDMCap::message(const String &message,const String &arg)
+{
+ ::printf("%s=%s\n",message.str(),arg.str());
+}
+
+inline
+void WDMCap::message(const String &message)
+{
+ ::printf("%s\n",message.str());
+}
+#endif
diff --git a/CapServer/gensrv.cpp b/CapServer/gensrv.cpp
new file mode 100644
index 0000000..3e5f028
--- /dev/null
+++ b/CapServer/gensrv.cpp
@@ -0,0 +1,96 @@
+#include
+#include
+#include
+
+extern bool running;
+
+GenericServer::GenericServer(void)
+: mIsRunning(TRUE)
+{
+}
+
+GenericServer::~GenericServer()
+{
+ message("[GenericServer::~GenericServer]Server is destructing...");
+}
+
+void GenericServer::close(void)
+{
+ mIsRunning=FALSE;
+}
+
+WORD GenericServer::listen(const String &hostName,short portNum)
+{
+ HostEnt hostEntry;
+ ServEnt serverEntry;
+ String stringData;
+ SystemTime systemTime;
+ DWORD elapsedTime;
+
+ message(String("[GenericServer::listen]trying host'")+hostName+String("'..."));
+ if(!mWSASystem.isInitialized()){message("[GenericServer::listen]WINSOCK initialization failure.");return FALSE;}
+ InternetAddress internetAddress(hostName);
+ if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("[GenericServer::listen]no DNS entry for ")+hostName);return FALSE;}}
+ else if(!hostEntry.hostByName(hostName)){message(String("[GenericServer::listen]no DNS entry for ")+hostName);return FALSE;}
+ message(String("[GenericServer::listen]connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
+ mInternetSocketAddress.internetAddress((hostEntry.addresses())[0]);
+ mInternetSocketAddress.family(PF_INET);
+ mInternetSocketAddress.port(portNum);
+ if(!mGenericControl.create()){message("[GenericServer::listen]socket initialization failure.");return FALSE;}
+ mGenericControl.reuseAddress();
+ if(!mGenericControl.bind(mInternetSocketAddress)){message("[GenericServer::listen]bind failed");return FALSE;}
+ while(mIsRunning&&running)
+ {
+ SmartPointer socketControl;
+ socketControl=::new Socket();
+// socketControl.disposition(PointerDisposition::Assume);
+ socketControl.disposition(PointerDisposition::Delete);
+ INETSocketAddress internetSocketAddress;
+ message(String("[GenericServer::listen]host='")+(hostEntry.addresses())[0]+String("' port=")+String().fromInt(portNum));
+ String strLocalHost((String)mInternetSocketAddress.internetAddress());
+ message(String("[GenericServer::listen]local address is ")+strLocalHost);
+ if(!mGenericControl.listen()){message("[GenericServer::listen]listen failed");return FALSE;}
+ message("[GenericServer::listen]waiting for connection...");
+ if(!mGenericControl.accept(*socketControl,internetSocketAddress)){message("[GenericServer::listen]accept returned FALSE;");return FALSE;}
+
+// socketControl->setLinger(0);
+// socketControl->bind(internetSocketAddress);
+
+ systemTime.refresh();
+ message(String("[GenericServer::listen]service started from ")+internetSocketAddress.internetAddress().toString()+String(" on ")+systemTime.toString());
+ elapsedTime=::GetTickCount();
+ acceptHandler(socketControl);
+ socketControl->destroy();
+ socketControl.destroy();
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[GenericServer::listen]service took ")+String().fromInt(elapsedTime)+String("(ms)"));
+ }
+ mGenericControl.destroy();
+ message("[GenericServer::listen]terminating connection");
+ return TRUE;
+}
+
+// virtuals
+
+void GenericServer::message(const String &message)
+{
+ ::OutputDebugString(message+String("\n"));
+}
+
+void GenericServer::message(Block &msgData)
+{
+ for(int msgIndex=0;msgIndex &socket)
+{
+ SmartPointer socketControl;
+
+ socketControl=socket;
+ socketControl.disposition(PointerDisposition::Delete);
+ String acceptString("[GenericServer::acceptHandler]200 GenericServer::acceptHandler accepting connection.");
+ socketControl->send(acceptString);
+ message(acceptString);
+ return;
+}
+
diff --git a/CapServer/gensrv.hpp b/CapServer/gensrv.hpp
new file mode 100644
index 0000000..7e94a03
--- /dev/null
+++ b/CapServer/gensrv.hpp
@@ -0,0 +1,42 @@
+#ifndef _CAPSERVER_GENERICSERVER_HPP_
+#define _CAPSERVER_GENERICSERVER_HPP_
+#ifndef _COMMON_STRING_HPP_
+#include
+#endif
+#ifndef _COMMON_SMARTPOINTER_HPP_
+#include
+#endif
+#ifndef _SOCKET_HOSTENT_HPP_
+#include
+#endif
+#ifndef _SOCKET_SERVENT_HPP_
+#include
+#endif
+#ifndef _SOCKET_INETSOCKETADDRESS_HPP_
+#include
+#endif
+#ifndef _SOCKET_SOCKET_HPP_
+#include
+#endif
+
+class GenericServer
+{
+public:
+ GenericServer(void);
+ virtual ~GenericServer();
+ WORD listen(const String &hostName,short portNum);
+ WORD receive(char &charData,BOOL waitForData=TRUE);
+ void close(void);
+protected:
+ virtual void acceptHandler(SmartPointer &socketControl);
+ virtual void message(const String &message);
+ virtual void message(Block &msgData);
+private:
+ enum{TimeOut=1000};
+ INETSocketAddress mInternetSocketAddress;
+ Socket mGenericControl;
+ WSASystem mWSASystem;
+ BOOL mIsRunning;
+};
+
+#endif
\ No newline at end of file
diff --git a/CapServer/hold/Main.cpp b/CapServer/hold/Main.cpp
new file mode 100644
index 0000000..6e1babc
--- /dev/null
+++ b/CapServer/hold/Main.cpp
@@ -0,0 +1,25 @@
+#include
+#include
+#include
+
+int handlerRoutine(DWORD ctrlType);
+
+bool running=true;
+
+MainApplication mainApplication;
+
+void main(int argc,char **argv)
+{
+ mainApplication.run(argc,argv);
+}
+
+int handlerRoutine(DWORD eventType) // this is connected ad-hoc to generic server, could be cleaner
+{
+ if(CTRL_C_EVENT==eventType)
+ {
+ ::printf("Caught Ctrl-C...\n");
+ running=false;
+ return true;
+ }
+ return false;
+}
diff --git a/CapServer/hold/MainApplication.cpp b/CapServer/hold/MainApplication.cpp
new file mode 100644
index 0000000..163ac11
--- /dev/null
+++ b/CapServer/hold/MainApplication.cpp
@@ -0,0 +1,124 @@
+#include
+
+MainApplication::MainApplication()
+{
+}
+
+MainApplication::~MainApplication()
+{
+}
+
+int MainApplication::run(int argc,char **argv)
+{
+ String command;
+
+ mParams.setArgs(argc,argv);
+ switch(mParams.getRequest())
+ {
+ case Params::Client :
+ mParams.showParams();
+ handleClient(mParams.getServer(),mParams.getPort().toInt());
+ break;
+ case Params::Server :
+ mParams.showParams();
+ handleServer(mParams.getHost(),mParams.getPort().toInt(),mParams.getDevice().toInt(),mParams.getRetain(),mParams.getDebug(),mParams.getShowSrcDlg());
+ break;
+ case Params::Settings :
+ mParams.showParams();
+ handleSettings(mParams.getShowSrcDlg());
+ break;
+ case Params::None :
+ displayUsage();
+ break;
+ }
+ return 0;
+}
+
+void MainApplication::handleServer(const String &host,int port,int deviceIndex,bool retain,bool debug,bool showSrcDlg)
+{
+ message("[MainApplication::handleServer]starting server");
+ SocketServer socketServer(deviceIndex,retain,debug,showSrcDlg);
+ socketServer.listen(host,port);
+}
+
+void MainApplication::handleClient(const String &host,int port)
+{
+ INETSocketAddress internetSocketAddress;
+ InternetAddress internetAddress(127,0,0,1);
+ Socket socket;
+ SocketHeader socketHeader;
+ Array content;
+
+ message("[MainApplication::handleClient]starting client");
+ internetSocketAddress.family(PF_INET);
+ internetSocketAddress.port(1024);
+ internetSocketAddress.internetAddress(internetAddress);
+ if(!socket.create())
+ {
+ message("[MainApplication::handleClient]create failed...");
+ return;
+ }
+ if(!socket.connect(internetSocketAddress))
+ {
+ message("[MainApplication::handleClient]connect failed...");
+ return;
+ }
+ message("[MainApplication::handleClient]reading socket header...");
+ socketHeader.unmarshall(socket);
+ message("[MainApplication::handleClient]header length",socketHeader.getSizeHeader());
+ message("[MainApplication::handleClient]version",socketHeader.getVersion());
+ message("[MainApplication::handleClient]content length",socketHeader.getContentLength());
+ message("[MainApplication::handleClient]content type",(int)socketHeader.getContentType());
+ content.size(socketHeader.getContentLength());
+ message("[MainApplication::handleClient]reading content...");
+ socket.receive((char*)&content[0],content.size());
+ message("[MainApplication::handleClient]done...");
+ socket.destroy();
+}
+
+void MainApplication::handleSettings(bool showSrcDlg)
+{
+ VidReg vidReg;
+ Block driverInfoBlock;
+
+ VidCap::getDrivers(driverInfoBlock);
+ message("[MainApplication::handleSettings]Capture File",vidReg.getCaptureFile());
+ message("[MainApplication::handleSettings]Sequencing",vidReg.getSequencing()?"true":"false");
+ message("[MainApplication::handleSettings]Preview Rate",vidReg.getPreviewRate());
+ message("[MainApplication::handleSettings]Preview Width",vidReg.getPreviewWidth());
+ message("[MainApplication::handleSettings]Preview Height",vidReg.getPreviewHeight());
+ message("[MainApplication::handleSettings]Capture Width",vidReg.getCaptureWidth());
+ message("[MainApplication::handleSettings]Capture Height",vidReg.getCaptureHeight());
+ message("[MainApplication::handleSettings]Capture Quality",vidReg.getQuality());
+ message("[MainApplication::handleSettings]***********CAPTURE DEVICE LIST*********");
+ if(!driverInfoBlock.size())message("[MainApplication::handleSettings]No capture devices on system.");
+ for(int index=0;index | ");
+ message(" host= | ");
+ message(" port=");
+ message(" device=");
+ message(" retain={true} | {false}");
+ message(" debug={true} | {false}");
+ message(" showsrcdlg={true} | {false}");
+ message(" ");
+ message(" CapServer run=server host=127.0.0.1 port=1024");
+ message(" CapServer run=server host=127.0.0.1 port=1024 device=0");
+ message(" CapServer run=client server=127.0.0.1 port=1024");
+ message(" CapServer run=settings");
+}
+
diff --git a/CapServer/hold/MainApplication.hpp b/CapServer/hold/MainApplication.hpp
new file mode 100644
index 0000000..d010e02
--- /dev/null
+++ b/CapServer/hold/MainApplication.hpp
@@ -0,0 +1,55 @@
+#ifndef _CAPSERVER_MAINAPPLICATION_HPP_
+#define _CAPSERVER_MAINAPPLICATION_HPP_
+#ifndef _CAPSERVER_SOCKET_HEADER_HPP_
+#include
+#endif
+#ifndef _SOCKET_WSADATA_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_SOCKETSERVER_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_PARAMS_HPP_
+#include
+#endif
+#ifndef _VIDCAP_VIDREG_HPP_
+#include
+#endif
+
+class MainApplication
+{
+public:
+ MainApplication();
+ virtual ~MainApplication();
+ int run(int argc,char **argv);
+private:
+ void message(const String &message);
+ void message(const String &message,int arg);
+ void message(const String &message,const String &arg);
+ void handleServer(const String &host,int port,int deviceIndex,bool retain,bool debug,bool showSrcDlg);
+ void handleClient(const String &server,int port);
+ void handleSettings(bool showSrcDlg);
+ void displayUsage(void);
+
+ WSASystem mWSASystem;
+ Params mParams;
+};
+
+inline
+void MainApplication::message(const String &message)
+{
+ printf("%s\n",message.str());
+}
+
+inline
+void MainApplication::message(const String &message,int arg)
+{
+ printf("%s=%d\n",message.str(),arg);
+}
+
+inline
+void MainApplication::message(const String &message,const String &arg)
+{
+ printf("%s=%s\n",message.str(),arg.str());
+}
+#endif
diff --git a/CapServer/hold/NameValuePair.hpp b/CapServer/hold/NameValuePair.hpp
new file mode 100644
index 0000000..480917b
--- /dev/null
+++ b/CapServer/hold/NameValuePair.hpp
@@ -0,0 +1,65 @@
+#ifndef _CAPSERVER_NAMEVALUE_HPP_
+#define _CAPSERVER_NAMEVALUE_HPP_
+#ifndef _COMMON_STRING_HPP_
+#include
+#endif
+
+class NameValuePair
+{
+public:
+ NameValuePair();
+ NameValuePair(const String &name,const String &value);
+ const String &getName(void)const;
+ void setName(const String &name);
+ const String &getValue(void)const;
+ void setValue(const String &value);
+ bool fromString(const String &string);
+private:
+ String mName;
+ String mValue;
+};
+
+inline
+NameValuePair::NameValuePair()
+{
+}
+
+inline
+NameValuePair::NameValuePair(const String &name,const String &value)
+: mName(name), mValue(value)
+{
+}
+
+inline
+const String &NameValuePair::getName(void)const
+{
+ return mName;
+}
+
+inline
+void NameValuePair::setName(const String &name)
+{
+ mName=name;
+}
+
+inline
+const String &NameValuePair::getValue(void)const
+{
+ return mValue;
+}
+
+inline
+void NameValuePair::setValue(const String &value)
+{
+ mValue=value;
+}
+
+inline
+bool NameValuePair::fromString(const String &string)
+{
+ if(string.isNull())return false;
+ mName=string.betweenString(0,'=');
+ mValue=string.betweenString('=',0);
+ return true;
+}
+#endif
diff --git a/CapServer/hold/Params.cpp b/CapServer/hold/Params.cpp
new file mode 100644
index 0000000..9b8db0b
--- /dev/null
+++ b/CapServer/hold/Params.cpp
@@ -0,0 +1,84 @@
+#include
+#include
+
+void Params::setArgs(int argc,char **argv)
+{
+ String strArg;
+ getParams(argc,argv);
+ if(getServer().isNull())setServer("127.0.0.1");
+ if(getHost().isNull())setHost("127.0.0.1");
+ if(getPort().isNull())setPort("1024");
+ if(getDevice().isNull())setDevice("0");
+ strArg=getValue(mRetainKey);
+ strArg.lower();
+ if(!(strArg==String("true")) && !(strArg==String("false")))setRetain(false);
+ else if(strArg==String("true"))setRetain(true);
+ else setRetain(false);
+ strArg=getValue(mDebugKey);
+ strArg.lower();
+ if(!(strArg==String("true")) && !(strArg==String("false")))setDebug(false);
+ else if(strArg==String("true"))setDebug(true);
+ else setDebug(false);
+ strArg=getValue(mShowSrcDlgKey);
+ strArg.lower();
+ if(!(strArg==String("true")) && !(strArg==String("false")))setShowSrcDlg(false);
+ else if(strArg==String("true"))setShowSrcDlg(true);
+ else setShowSrcDlg(false);
+}
+
+int Params::getParams(int argc,char**argv)
+{
+ mNameValuePairs.remove();
+ for(int index=0;index
+#endif
+#ifndef _CAPSERVER_NAMEVALUE_HPP_
+#include
+#endif
+
+class Params
+{
+public:
+ typedef enum Request{Server,Client,Settings,None};
+ Params(int argc,char **argv);
+ Params();
+ virtual ~Params();
+ Request getRequest(void)const;
+ String getServer(void)const;
+ String getHost(void)const;
+ String getPort(void)const;
+ String getDevice(void)const;
+ bool getRetain(void)const;
+ bool getDebug(void)const;
+ bool getShowSrcDlg(void)const;
+ void setArgs(int argc,char **argv);
+ void showParams(void);
+private:
+ int getParams(int argc,char **argv);
+ String getValue(const String &key)const;
+ void setValue(const String &key,const String &value);
+ String getRun(void)const;
+ void setServer(const String &server);
+ void setHost(const String &host);
+ void setPort(const String &port);
+ void setDevice(const String &device);
+ void setRetain(bool retain);
+ void setDebug(bool debug);
+ void setShowSrcDlg(bool showSrcDlg);
+
+ Block mNameValuePairs;
+ String mRunKey;
+ String mServerKey;
+ String mHostKey;
+ String mPortKey;
+ String mDeviceKey;
+ String mRetainKey;
+ String mDebugKey;
+ String mShowSrcDlgKey;
+};
+
+inline
+Params::Params(int argc,char **argv)
+: mRunKey("run"), mServerKey("server"), mHostKey("host"), mPortKey("port"), mDeviceKey("device"),
+ mRetainKey("retain"), mDebugKey("debug"), mShowSrcDlgKey("showsrcdlg")
+{
+ getParams(argc,argv);
+}
+
+inline
+Params::Params()
+: mRunKey("run"), mServerKey("server"), mHostKey("host"), mPortKey("port"), mDeviceKey("device"),
+ mRetainKey("retain"), mDebugKey("debug"), mShowSrcDlgKey("showsrcdlg")
+{
+}
+
+inline
+Params::~Params()
+{
+}
+
+inline
+String Params::getRun(void)const
+{
+ return getValue(mRunKey);
+}
+
+inline
+String Params::getServer(void)const
+{
+ return getValue(mServerKey);
+}
+
+inline
+String Params::getHost(void)const
+{
+ return getValue(mHostKey);
+}
+
+inline
+String Params::getPort(void)const
+{
+ return getValue(mPortKey);
+}
+
+inline
+String Params::getDevice(void)const
+{
+ return getValue(mDeviceKey);
+}
+
+inline
+bool Params::getRetain(void)const
+{
+ String strRetain(getValue(mRetainKey));
+ if(strRetain=="true")return true;
+ return false;
+}
+
+inline
+bool Params::getDebug(void)const
+{
+ String strDebug(getValue(mDebugKey));
+ if(strDebug=="true")return true;
+ return false;
+}
+
+inline
+bool Params::getShowSrcDlg(void)const
+{
+ String strValue(getValue(mShowSrcDlgKey));
+ if(strValue=="true")return true;
+ return false;
+}
+
+inline
+void Params::setServer(const String &server)
+{
+ setValue(mServerKey,server);
+}
+
+inline
+void Params::setHost(const String &host)
+{
+ setValue(mHostKey,host);
+}
+
+inline
+void Params::setPort(const String &port)
+{
+ setValue(mPortKey,port);
+}
+
+inline
+void Params::setDevice(const String &device)
+{
+ setValue(mDeviceKey,device);
+}
+
+inline
+void Params::setRetain(bool retain)
+{
+ if(retain)setValue(mRetainKey,"true");
+ else setValue(mRetainKey,"false");
+}
+
+inline
+void Params::setDebug(bool debug)
+{
+ if(debug)setValue(mDebugKey,"true");
+ else setValue(mDebugKey,"false");
+}
+
+inline
+void Params::setShowSrcDlg(bool showSrcDlg)
+{
+ if(showSrcDlg)setValue(mShowSrcDlgKey,"true");
+ else setValue(mShowSrcDlgKey,"false");
+}
+#endif
diff --git a/CapServer/hold/SocketHeader.hpp b/CapServer/hold/SocketHeader.hpp
new file mode 100644
index 0000000..8cf77dc
--- /dev/null
+++ b/CapServer/hold/SocketHeader.hpp
@@ -0,0 +1,105 @@
+#ifndef _CAPSERVER_SOCKET_HEADER_HPP_
+#define _CAPSERVER_SOCKET_HEADER_HPP_
+#ifndef _COMMON_WINDOWS_HPP_
+#include
+#endif
+#ifndef _SOCKET_SOCKET_HPP_
+#include
+#endif
+
+class SocketHeader
+{
+public:
+ typedef enum ContentType{Unknown,ImageJPG};
+ SocketHeader();
+ virtual ~SocketHeader();
+ int getSizeHeader(void)const;
+ int getVersion(void)const;
+ void setVersion(int version);
+ int getContentLength(void)const;
+ void setContentLength(int contentLength);
+ ContentType getContentType(void)const;
+ void setContentType(int contentType);
+ bool marshall(Socket &socket);
+ bool unmarshall(Socket &socket);
+private:
+ int mSizeHeader;
+ int mVersion;
+ int mContentLength;
+ int mContentType;
+};
+
+inline
+SocketHeader::SocketHeader()
+: mSizeHeader(sizeof(int)+sizeof(int)+sizeof(int)+sizeof(int)),
+ mVersion(0), mContentLength(0), mContentType(Unknown)
+{
+}
+
+inline
+SocketHeader::~SocketHeader()
+{
+}
+
+inline
+int SocketHeader::getSizeHeader(void)const
+{
+ return mSizeHeader;
+}
+
+inline
+int SocketHeader::getVersion(void)const
+{
+ return mVersion;
+}
+
+inline
+void SocketHeader::setVersion(int version)
+{
+ mVersion=version;
+}
+
+inline
+int SocketHeader::getContentLength(void)const
+{
+ return mContentLength;
+}
+
+inline
+void SocketHeader::setContentLength(int contentLength)
+{
+ mContentLength=contentLength;
+}
+
+inline
+SocketHeader::ContentType SocketHeader::getContentType(void)const
+{
+ return (ContentType)mContentType;
+}
+
+inline
+void SocketHeader::setContentType(int contentType)
+{
+ mContentType=(ContentType)contentType;
+}
+
+inline
+bool SocketHeader::marshall(Socket &socket)
+{
+ if(!socket.send((char*)&mSizeHeader,sizeof(int)))return false;
+ if(!socket.send((char*)&mVersion,sizeof(int)))return false;
+ if(!socket.send((char*)&mContentLength,sizeof(int)))return false;
+ if(!socket.send((char*)&mContentType,sizeof(int)))return false;
+ return true;
+}
+
+inline
+bool SocketHeader::unmarshall(Socket &socket)
+{
+ if(!socket.receive((char*)&mSizeHeader,sizeof(int)))return false;
+ if(!socket.receive((char*)&mVersion,sizeof(int)))return false;
+ if(!socket.receive((char*)&mContentLength,sizeof(int)))return false;
+ if(!socket.receive((char*)&mContentType,sizeof(int)))return false;
+ return true;
+}
+#endif
\ No newline at end of file
diff --git a/CapServer/hold/SocketServer.cpp b/CapServer/hold/SocketServer.cpp
new file mode 100644
index 0000000..1b877d7
--- /dev/null
+++ b/CapServer/hold/SocketServer.cpp
@@ -0,0 +1,103 @@
+#include
+#include
+#include
+#include
+#include
+
+SocketServer::SocketServer(int deviceIndex,bool retain,bool debug,bool showSrcDlg)
+: mWDMCap(deviceIndex), mRetainImage(retain), mDebug(debug)
+{
+ if(showSrcDlg)mWDMCap.dialogVideoSource();
+}
+
+SocketServer::~SocketServer()
+{
+}
+
+void SocketServer::acceptHandler(SmartPointer &socketControl)
+{
+ if(mDebug)sendDebugFrame(*socketControl);
+ else sendFrame(*socketControl);
+
+}
+
+void SocketServer::message(const String &string)
+{
+ ::printf("%s\n",string.str());
+}
+
+void SocketServer::sendFrame(Socket &socketControl)
+{
+ DiskInfo diskInfo;
+ SystemTime systemTime;
+ String strPathCaptureFile;
+ SocketHeader socketHeader;
+ Array charBytes;
+ FileHandle openFile;
+ DWORD elapsedTime;
+
+ socketHeader.setVersion(1);
+ socketHeader.setContentType(SocketHeader::ImageJPG);
+ socketHeader.setContentLength(0);
+ strPathCaptureFile.reserve(1024);
+ ::sprintf(strPathCaptureFile,"%04d%02d%02d%02d%02d%02d%02d.jpg",
+ systemTime.year(),systemTime.month(),systemTime.day(),
+ systemTime.hour(),systemTime.minute(),systemTime.second(),
+ systemTime.milliseconds());
+ elapsedTime=::GetTickCount();
+ mWDMCap.setCaptureFileName(strPathCaptureFile);
+ mWDMCap.grabFrameNoStop();
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[SocketServer::sendFrame] Grab frame took ")+String().fromInt(elapsedTime)+String(" (ms)"));
+ if(!openFile.open(strPathCaptureFile,FileHandle::Read,FileHandle::ShareRead))
+ {
+ socketHeader.marshall(socketControl);
+ }
+ else
+ {
+ charBytes.size(openFile.size());
+ socketHeader.setContentLength(charBytes.size());
+ elapsedTime=::GetTickCount();
+ openFile.read((BYTE*)&charBytes[0],charBytes.size());
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[SocketServer::sendFrame] Read ")+String().fromInt(charBytes.size())+String(" bytes took ")+String().fromInt(elapsedTime)+String(" (ms)"));
+ elapsedTime=::GetTickCount();
+ socketHeader.marshall(socketControl);
+ socketControl.send((char*)&charBytes[0],charBytes.size());
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[SocketServer::sendFrame] Send ")+String().fromInt(charBytes.size())+String(" bytes took ")+String().fromInt(elapsedTime)+String(" (ms)"));
+ openFile.close();
+ if(!mRetainImage)diskInfo.unlink(strPathCaptureFile);
+ }
+ message(String("[SocketServer::sendFrame]Sent ")+String().fromInt(charBytes.size())+String(" bytes"));
+ return;
+}
+
+void SocketServer::sendDebugFrame(Socket &socketControl)
+{
+ DiskInfo diskInfo;
+ Array charBytes;
+ FileHandle openFile;
+ SocketHeader socketHeader;
+ String strPathFileName;
+
+ strPathFileName="./image.jpg";
+ socketHeader.setVersion(1);
+ socketHeader.setContentType(SocketHeader::ImageJPG);
+ socketHeader.setContentLength(0);
+ if(!openFile.open(strPathFileName,FileHandle::Read,FileHandle::ShareRead))
+ {
+ message("[SocketServer::sendDebugFrame] 'image.jpg' was not found, sending empty content");
+ socketHeader.marshall(socketControl);
+ }
+ else
+ {
+ charBytes.size(openFile.size());
+ socketHeader.setContentLength(charBytes.size());
+ openFile.read((BYTE*)&charBytes[0],charBytes.size());
+ socketHeader.marshall(socketControl);
+ socketControl.send((char*)&charBytes[0],charBytes.size());
+ message(String("[SocketServer::sendDebugFrame] Send ")+String().fromInt(charBytes.size()));
+ openFile.close();
+ }
+}
diff --git a/CapServer/hold/SocketServer.hpp b/CapServer/hold/SocketServer.hpp
new file mode 100644
index 0000000..4a0dd5b
--- /dev/null
+++ b/CapServer/hold/SocketServer.hpp
@@ -0,0 +1,32 @@
+#ifndef _CAPSERVER_SOCKETSERVER_HPP_
+#define _CAPSERVER_SOCKETSERVER_HPP_
+#ifndef _COMMON_BLOCK_HPP_
+#include
+#endif
+#ifndef _THREAD_MONITOR_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_WDMCAP_HPP_
+#include
+#endif
+#ifndef _CAPSERVER_GENERICSERVER_HPP_
+#include
+#endif
+
+class SocketServer : public GenericServer
+{
+public:
+ SocketServer(int deviceIndex=0,bool retain=false,bool debug=false,bool showSrcDlg=false);
+ virtual ~SocketServer();
+protected:
+ virtual void acceptHandler(SmartPointer &socketControl);
+ virtual void message(const String &message);
+private:
+ void sendFrame(Socket &socketControl);
+ void sendDebugFrame(Socket &socketControl);
+
+ WDMCap mWDMCap;
+ bool mRetainImage;
+ bool mDebug;
+};
+#endif
diff --git a/CapServer/hold/WDMCap.cpp b/CapServer/hold/WDMCap.cpp
new file mode 100644
index 0000000..cca61f0
--- /dev/null
+++ b/CapServer/hold/WDMCap.cpp
@@ -0,0 +1,101 @@
+#include
+#include
+
+WDMCap::WDMCap(int deviceIndex)
+: mDriverIndex(deviceIndex)
+{
+ initialize();
+}
+
+WDMCap::~WDMCap()
+{
+}
+
+void WDMCap::setCaptureFileName(const String &strPathCaptureFile)
+{
+ BmpCap::setCaptureFileName(strPathCaptureFile);
+}
+
+const String &WDMCap::getCaptureFileName(void)const
+{
+ return BmpCap::getCaptureFileName();
+}
+
+bool WDMCap::initialize(void)
+{
+ String pathOutputFileName="capture.jpg";
+ VidReg vidReg;
+
+ vidReg.setCaptureFile(pathOutputFileName);
+ vidReg.setSequencing(false);
+ VidCap::getDrivers(mDriverInfoBlock);
+ if(!mDriverInfoBlock.size())
+ {
+ message("No drivers found! drivercount",mDriverInfoBlock.size());
+ return false;
+ }
+ if(mDriverIndex>=mDriverInfoBlock.size())
+ {
+ message("[WDMCap::initilialize]Driver not found! device",mDriverIndex);
+ return false;
+ }
+ showSettings();
+ mControl=::new Control();
+ mControl.disposition(PointerDisposition::Delete);
+ mControl->createControl("BUTTON","",0,Rect(0,0,vidReg.getCaptureWidth(),vidReg.getCaptureHeight()),::GetDesktopWindow(),ControlID);
+ BmpCap::initialize(mControl->getHandle(),mDriverIndex);
+ if(!connect(mDriverIndex))
+ {
+ ::printf("\007");
+ message("[WDMCap::initilialize]Failed to connect to device",mDriverInfoBlock[mDriverIndex].driverName());
+ return false;
+ }
+ saveFrames(true);
+ return isConnected();
+}
+
+void WDMCap::showSettings(void)
+{
+ VidReg vidReg;
+
+ message("[WDMCap::initilialize]Capture File",vidReg.getCaptureFile());
+ message("[WDMCap::initilialize]Sequencing",vidReg.getSequencing()?"true":"false");
+ message("[WDMCap::initilialize]Preview Rate",vidReg.getPreviewRate());
+ message("[WDMCap::initilialize]Preview Width",vidReg.getPreviewWidth());
+ message("[WDMCap::initilialize]Preview Height",vidReg.getPreviewHeight());
+ message("[WDMCap::initilialize]Capture Width",vidReg.getCaptureWidth());
+ message("[WDMCap::initilialize]Capture Height",vidReg.getCaptureHeight());
+ message("[WDMCap::initilialize]Capture Quality",vidReg.getQuality());
+ for(int index=0;index
+#endif
+#ifndef _COMMON_BLOCK_HPP_
+#include
+#endif
+#ifndef _COMMON_CONTROL_HPP_
+#include
+#endif
+#ifndef _THREAD_EVENT_HPP_
+#include
+#endif
+#ifndef _VIDCAP_BMPCAP_HPP_
+#include
+#endif
+
+class WDMCap : private BmpCap
+{
+public:
+ WDMCap(int deviceIndex=0);
+ virtual ~WDMCap();
+ bool grabFrame(void);
+ bool grabFrameNoStop(void);
+ bool dialogVideoSource(void);
+ bool isConnected(void)const;
+ bool getDriverCaps(DriverCaps &someDriverCaps);
+ bool getCaptureParams(CaptureParams &someCaptureParams);
+ void setCaptureFileName(const String &strPathCaptureFile);
+ const String &getCaptureFileName(void)const;
+protected:
+ virtual void frameHandler(VIDEOHDR &videoHeader);
+private:
+ enum{ControlID=100};
+ bool initialize(void);
+ void showSettings(void);
+ void message(const String &message);
+ void message(const String &message,const String &arg);
+ void message(const String &message,int arg);
+
+ SmartPointer mControl;
+ Block mDriverInfoBlock;
+ Event mFrameEvent;
+ DWORD mDriverIndex;
+ DWORD mGrabTime;
+};
+
+inline
+bool WDMCap::dialogVideoSource(void)
+{
+ return BmpCap::dialogVideoSource();
+}
+
+inline
+bool WDMCap::isConnected(void)const
+{
+ return BmpCap::isConnected();
+}
+
+inline
+bool WDMCap::getDriverCaps(DriverCaps &someDriverCaps)
+{
+ return BmpCap::getDriverCaps(someDriverCaps);
+}
+
+inline
+bool WDMCap::getCaptureParams(CaptureParams &someCaptureParams)
+{
+ return BmpCap::getCaptureParams(someCaptureParams);
+}
+
+inline
+void WDMCap::message(const String &message,int arg)
+{
+ ::printf("%s=%d\n",message.str(),arg);
+}
+
+inline
+void WDMCap::message(const String &message,const String &arg)
+{
+ ::printf("%s=%s\n",message.str(),arg.str());
+}
+
+inline
+void WDMCap::message(const String &message)
+{
+ ::printf("%s\n",message.str());
+}
+#endif
diff --git a/CapServer/hold/gensrv.cpp b/CapServer/hold/gensrv.cpp
new file mode 100644
index 0000000..3e5f028
--- /dev/null
+++ b/CapServer/hold/gensrv.cpp
@@ -0,0 +1,96 @@
+#include
+#include
+#include
+
+extern bool running;
+
+GenericServer::GenericServer(void)
+: mIsRunning(TRUE)
+{
+}
+
+GenericServer::~GenericServer()
+{
+ message("[GenericServer::~GenericServer]Server is destructing...");
+}
+
+void GenericServer::close(void)
+{
+ mIsRunning=FALSE;
+}
+
+WORD GenericServer::listen(const String &hostName,short portNum)
+{
+ HostEnt hostEntry;
+ ServEnt serverEntry;
+ String stringData;
+ SystemTime systemTime;
+ DWORD elapsedTime;
+
+ message(String("[GenericServer::listen]trying host'")+hostName+String("'..."));
+ if(!mWSASystem.isInitialized()){message("[GenericServer::listen]WINSOCK initialization failure.");return FALSE;}
+ InternetAddress internetAddress(hostName);
+ if(!internetAddress.isZero()){if(!hostEntry.hostByAddress(internetAddress)){message(String("[GenericServer::listen]no DNS entry for ")+hostName);return FALSE;}}
+ else if(!hostEntry.hostByName(hostName)){message(String("[GenericServer::listen]no DNS entry for ")+hostName);return FALSE;}
+ message(String("[GenericServer::listen]connect...")+String("'")+hostEntry.hostName()+String("' (")+(String)(hostEntry.addresses())[0]+String(")"));
+ mInternetSocketAddress.internetAddress((hostEntry.addresses())[0]);
+ mInternetSocketAddress.family(PF_INET);
+ mInternetSocketAddress.port(portNum);
+ if(!mGenericControl.create()){message("[GenericServer::listen]socket initialization failure.");return FALSE;}
+ mGenericControl.reuseAddress();
+ if(!mGenericControl.bind(mInternetSocketAddress)){message("[GenericServer::listen]bind failed");return FALSE;}
+ while(mIsRunning&&running)
+ {
+ SmartPointer socketControl;
+ socketControl=::new Socket();
+// socketControl.disposition(PointerDisposition::Assume);
+ socketControl.disposition(PointerDisposition::Delete);
+ INETSocketAddress internetSocketAddress;
+ message(String("[GenericServer::listen]host='")+(hostEntry.addresses())[0]+String("' port=")+String().fromInt(portNum));
+ String strLocalHost((String)mInternetSocketAddress.internetAddress());
+ message(String("[GenericServer::listen]local address is ")+strLocalHost);
+ if(!mGenericControl.listen()){message("[GenericServer::listen]listen failed");return FALSE;}
+ message("[GenericServer::listen]waiting for connection...");
+ if(!mGenericControl.accept(*socketControl,internetSocketAddress)){message("[GenericServer::listen]accept returned FALSE;");return FALSE;}
+
+// socketControl->setLinger(0);
+// socketControl->bind(internetSocketAddress);
+
+ systemTime.refresh();
+ message(String("[GenericServer::listen]service started from ")+internetSocketAddress.internetAddress().toString()+String(" on ")+systemTime.toString());
+ elapsedTime=::GetTickCount();
+ acceptHandler(socketControl);
+ socketControl->destroy();
+ socketControl.destroy();
+ elapsedTime=::GetTickCount()-elapsedTime;
+ message(String("[GenericServer::listen]service took ")+String().fromInt(elapsedTime)+String("(ms)"));
+ }
+ mGenericControl.destroy();
+ message("[GenericServer::listen]terminating connection");
+ return TRUE;
+}
+
+// virtuals
+
+void GenericServer::message(const String &message)
+{
+ ::OutputDebugString(message+String("\n"));
+}
+
+void GenericServer::message(Block &msgData)
+{
+ for(int msgIndex=0;msgIndex &socket)
+{
+ SmartPointer socketControl;
+
+ socketControl=socket;
+ socketControl.disposition(PointerDisposition::Delete);
+ String acceptString("[GenericServer::acceptHandler]200 GenericServer::acceptHandler accepting connection.");
+ socketControl->send(acceptString);
+ message(acceptString);
+ return;
+}
+
diff --git a/CapServer/hold/gensrv.hpp b/CapServer/hold/gensrv.hpp
new file mode 100644
index 0000000..7e94a03
--- /dev/null
+++ b/CapServer/hold/gensrv.hpp
@@ -0,0 +1,42 @@
+#ifndef _CAPSERVER_GENERICSERVER_HPP_
+#define _CAPSERVER_GENERICSERVER_HPP_
+#ifndef _COMMON_STRING_HPP_
+#include
+#endif
+#ifndef _COMMON_SMARTPOINTER_HPP_
+#include
+#endif
+#ifndef _SOCKET_HOSTENT_HPP_
+#include
+#endif
+#ifndef _SOCKET_SERVENT_HPP_
+#include
+#endif
+#ifndef _SOCKET_INETSOCKETADDRESS_HPP_
+#include
+#endif
+#ifndef _SOCKET_SOCKET_HPP_
+#include
+#endif
+
+class GenericServer
+{
+public:
+ GenericServer(void);
+ virtual ~GenericServer();
+ WORD listen(const String &hostName,short portNum);
+ WORD receive(char &charData,BOOL waitForData=TRUE);
+ void close(void);
+protected:
+ virtual void acceptHandler(SmartPointer &socketControl);
+ virtual void message(const String &message);
+ virtual void message(Block &msgData);
+private:
+ enum{TimeOut=1000};
+ INETSocketAddress mInternetSocketAddress;
+ Socket mGenericControl;
+ WSASystem mWSASystem;
+ BOOL mIsRunning;
+};
+
+#endif
\ No newline at end of file
diff --git a/CapServer/image.jpg b/CapServer/image.jpg
new file mode 100644
index 0000000..2018a1d
Binary files /dev/null and b/CapServer/image.jpg differ
diff --git a/CapServer/pspbrwse.jbf b/CapServer/pspbrwse.jbf
new file mode 100644
index 0000000..7696e8e
Binary files /dev/null and b/CapServer/pspbrwse.jbf differ
diff --git a/CapServer/scraps.txt b/CapServer/scraps.txt
new file mode 100644
index 0000000..d26acf3
--- /dev/null
+++ b/CapServer/scraps.txt
@@ -0,0 +1,205 @@
+/* while(running)
+ {
+ ::printf("Grabbing Frame...\n");
+ bmpCap->grabFrame();
+ ::Sleep(timeout);
+ } */
+
+
+// portControl.bind(internetSocketAddress);
+// acceptHandler(portControl);
+// if(mPortControl.receive(stringData))stringHandler(stringData);
+/* Block receiveStrings;
+ printf("Received data...");
+ if(mPortControl.receive(receiveStrings))
+ {
+ for(int index=0;index drivers;
+ SmartPointer bmpCap;
+ SmartPointer control;
+ String pathOutputFileName;
+ int timeout;
+ VidReg vidReg;
+
+ if(3!=argc)
+ {
+ ::printf("CAPTURE \n");
+ return;
+ }
+ ::SetConsoleCtrlHandler(&handlerRoutine,true);
+ pathOutputFileName=argv[1];
+ timeout=String(argv[2]).toInt();
+ vidReg.setCaptureWidth(320);
+ vidReg.setCaptureHeight(240);
+ vidReg.setCaptureFile(pathOutputFileName);
+ vidReg.setSequencing(false);
+ ::printf("Capture File:%s\n",vidReg.getCaptureFile().str());
+ ::printf("Sequencing:%s\n",vidReg.getSequencing()?"true":"false");
+ ::printf("Preview Rate:%d\n",vidReg.getPreviewRate());
+ ::printf("Preview Width:%d\n",vidReg.getPreviewWidth());
+ ::printf("Preview Height:%d\n",vidReg.getPreviewHeight());
+ ::printf("Capture Width:%d\n",vidReg.getCaptureWidth());
+ ::printf("Capture Height:%d\n",vidReg.getCaptureHeight());
+ ::printf("Refresh:%d\n",timeout/1000);
+
+ VidCap::getDrivers(drivers);
+ if(!drivers.size())
+ {
+ ::printf("No drivers found!\n");
+ return;
+ }
+ for(int index=0;indexcreateControl("BUTTON","",0,Rect(0,0,320,240),::GetDesktopWindow(),100);
+
+ bmpCap=::new BmpCap(control->getHandle(),0);
+ bmpCap.disposition(PointerDisposition::Delete);
+ if(!bmpCap->connect(0))
+ {
+ ::printf("Failed to connect to device '%s'\n",drivers[0].driverName().str());
+ return;
+ }
+ bmpCap->saveFrames(true);
+ while(running)
+ {
+ ::printf("Grabbing Frame...\n");
+ bmpCap->grabFrame();
+ ::Sleep(timeout);
+ }
+ return;
+}
+*/
+
+
+/*
+ int sizeHeader=htons(mSizeHeader);
+ int version=htons(mVersion);
+ int contentLength=htons(mContentLength);
+ int contentType=htons(mContentType);
+
+
+ if(!socket.send((char*)&sizeHeader,sizeof(int)))return false;
+ if(!socket.send((char*)&version,sizeof(int)))return false;
+ if(!socket.send((char*)&contentLength,sizeof(int)))return false;
+ if(!socket.send((char*)&contentType,sizeof(int)))return false;
+*/
+
+
+
+
+
+/*
+#include
+
+void main(int argc,char **argv)
+{
+ ::printf("convert %s %s",argv[1],argv[2]);
+ ImageConverter::convert(argv[1],argv[2],75);
+}
+*/
+
+
+
+/*
+
+
+
+ WSASystem wsaSystem;
+ String strOption;
+
+
+
+ if(argc!=2)
+ {
+ ::printf("CapServer {server}{client}\n");
+ return;
+ }
+ strOption=argv[1];
+ ::SetConsoleCtrlHandler(&handlerRoutine,true);
+
+
+
+ if(strOption=="server")
+ {
+ ::printf("starting server\n");
+ SocketServer socketServer;
+ socketServer.listen("rocinante",1024);
+ }
+ else
+ {
+ INETSocketAddress internetSocketAddress;
+ InternetAddress internetAddress(127,0,0,1);
+ Socket socket;
+ SocketHeader socketHeader;
+ Array content;
+
+ ::printf("starting client\n");
+ internetSocketAddress.family(PF_INET);
+ internetSocketAddress.port(1024);
+ internetSocketAddress.internetAddress(internetAddress);
+ if(!socket.create())
+ {
+ ::printf("create failed...\n");
+ return;
+ }
+ if(!socket.connect(internetSocketAddress))
+ {
+ ::printf("connect failed...\n");
+ return;
+ }
+ ::printf("reading socket header...\n");
+ socketHeader.unmarshall(socket);
+ ::printf("size header is %d bytes\n",socketHeader.getSizeHeader());
+ ::printf("version is %d \n",socketHeader.getVersion());
+ ::printf("content length is %d bytes\n",socketHeader.getContentLength());
+ ::printf("content type is %d \n",(int)socketHeader.getContentType());
+ content.size(socketHeader.getContentLength());
+ ::printf("reading content...\n");
+ socket.receive((char*)&content[0],content.size());
+ ::printf("done...\n");
+ socket.destroy();
+ }
+*/
+
+
+
+ socketHeader.setVersion(1);
+ socketHeader.setContentType(SocketHeader::ImageJPG);
+ socketHeader.setContentLength(0);
+ strPathCaptureFile.reserve(1024);
+ ::sprintf(strPathCaptureFile,"%04d%02d%02d%02d%02d%02d%02d.jpg",
+ systemTime.year(),systemTime.month(),systemTime.day(),
+ systemTime.hour(),systemTime.minute(),systemTime.second(),
+ systemTime.milliseconds());
+// strPathCaptureFile="image000.jpg";
+ mWDMCap.setCaptureFileName(strPathCaptureFile);
+ mWDMCap.grabFrame();
+ if(!openFile.open(strPathCaptureFile,FileHandle::Read,FileHandle::ShareRead))
+ {
+ socketHeader.marshall(socketControl);
+ }
+
+
+
+ int mSizeHeader;
+ int mVersion;
+ int mContentLength;
+ int mContentType;
diff --git a/ClassGen/Debug/classgen.exe b/ClassGen/Debug/classgen.exe
new file mode 100644
index 0000000..5aeab03
Binary files /dev/null and b/ClassGen/Debug/classgen.exe differ
diff --git a/ClassGen/Debug/classgen.pdb b/ClassGen/Debug/classgen.pdb
new file mode 100644
index 0000000..9c0090d
Binary files /dev/null and b/ClassGen/Debug/classgen.pdb differ
diff --git a/ClassGen/Debug/vc60.idb b/ClassGen/Debug/vc60.idb
new file mode 100644
index 0000000..b90f29e
Binary files /dev/null and b/ClassGen/Debug/vc60.idb differ
diff --git a/ClassGen/Debug/vc60.pdb b/ClassGen/Debug/vc60.pdb
new file mode 100644
index 0000000..b65134e
Binary files /dev/null and b/ClassGen/Debug/vc60.pdb differ
diff --git a/ClassGen/Historic.cs b/ClassGen/Historic.cs
new file mode 100644
index 0000000..7673797
--- /dev/null
+++ b/ClassGen/Historic.cs
@@ -0,0 +1,628 @@
+using System;
+
+
+namespace ZBI.Risk.Server.Mapped
+{
+ [Serializable]
+ public class Historic
+ {
+ private DateTime tradeDate;
+ private string tradeDateTxt;
+ private string portfolio;
+ private string subPortfolio;
+ private string ticker;
+ private string tickerDesc;
+ private string uticker;
+ private string instrument;
+ private decimal contractSize;
+ private string hedgeIndex;
+ private string hedgeSector;
+ private string area;
+ private string areaSector;
+ private decimal yClose;
+ private decimal utickerClose;
+ private decimal yUtickerClose;
+ private decimal delta;
+ private decimal yDelta;
+ private decimal hedgeBeta;
+ private decimal areaBeta;
+ private decimal sectorBeta;
+ private decimal groupBeta;
+ private decimal qty;
+ private decimal yQty;
+ private decimal qtyChange;
+ private decimal hedgeClose;
+ private decimal hedgePerc;
+ private decimal areaClose;
+ private decimal areaPerc;
+ private decimal sectorClose;
+ private decimal sectorPerc;
+ private decimal mktValue;
+ private decimal yMktValue;
+ private decimal exposure;
+ private decimal yExposure;
+ private decimal hbExposure;
+ private decimal yHbExposure;
+ private decimal abExposure;
+ private decimal yAbExposure;
+ private decimal sbExposure;
+ private decimal ySbExposure;
+ private decimal pnl;
+ private decimal pnlPerc;
+ private decimal priceChange;
+ private decimal priceChangePerc;
+ private decimal priceChangeAmt;
+ private decimal sectorAlphaPerc;
+ private decimal groupAlphaPerc;
+ private decimal areaAlphaPerc;
+ private decimal hedgeAlphaPerc;
+ private decimal areaPnlAmt;
+ private decimal sectorPnlAmt;
+ private decimal sectorAlphaAmt;
+ private decimal groupAlphaAmt;
+ private decimal areaAlphaAmt;
+ private decimal hedgeAlphaAmt;
+ private decimal abReturnAmt;
+ private decimal abReturnPerc;
+ private decimal altIndexReturnPerc;
+ private decimal altIndexReturnAmt;
+ private decimal indexBetaAdjPerc;
+ private decimal indexBetaAdjAmt;
+ private decimal intradayPerc;
+ private decimal intradayAmt;
+ private decimal optionalityPerc;
+ private decimal optionalityAmt;
+ private string currency;
+ private decimal baseClose;
+ private decimal yBaseClose;
+ private decimal fxPerc;
+ private decimal fxAmt;
+ private decimal fxRate;
+ private decimal yFxRate;
+ private string exposureView;
+ private string marketView;
+ private string callPut;
+ private int daysExpire;
+ private decimal strikePrice;
+ private string associate;
+ private bool ipo;
+ private decimal ratio;
+ private bool exported;
+ private string source;
+ private decimal vwap;
+ private decimal vwapPnl;
+ private decimal adh;
+ private decimal aac;
+ private decimal azap;
+ private DateTime goAround;
+ private decimal alphaGoAround;
+ private decimal alphaReal;
+ private decimal alphaUnreal;
+ private decimal pnlReal;
+ private decimal pnlUnreal;
+ private decimal cashFlow;
+ private decimal betaCashFlow;
+ private DateTime lastTradeDate;
+ private decimal lastTradeQty;
+ private decimal enterpriseValue;
+ private decimal mktCap;
+ private decimal wgtAve;
+ private decimal volume;
+ private long rowID;
+ public DateTime TradeDate
+ {
+ get{return tradeDate;}
+ set{tradeDate=value;}
+ }
+ public string TradeDateTxt
+ {
+ get{return tradeDateTxt;}
+ set{tradeDateTxt=value;}
+ }
+ public string Portfolio
+ {
+ get{return portfolio;}
+ set{portfolio=value;}
+ }
+ public string SubPortfolio
+ {
+ get{return subPortfolio;}
+ set{subPortfolio=value;}
+ }
+ public string Ticker
+ {
+ get{return ticker;}
+ set{ticker=value;}
+ }
+ public string TickerDesc
+ {
+ get{return tickerDesc;}
+ set{tickerDesc=value;}
+ }
+ public string Uticker
+ {
+ get{return uticker;}
+ set{uticker=value;}
+ }
+ public string Instrument
+ {
+ get{return instrument;}
+ set{instrument=value;}
+ }
+ public decimal ContractSize
+ {
+ get{return contractSize;}
+ set{contractSize=value;}
+ }
+ public string HedgeIndex
+ {
+ get{return hedgeIndex;}
+ set{hedgeIndex=value;}
+ }
+ public string HedgeSector
+ {
+ get{return hedgeSector;}
+ set{hedgeSector=value;}
+ }
+ public string Area
+ {
+ get{return area;}
+ set{area=value;}
+ }
+ public string AreaSector
+ {
+ get{return areaSector;}
+ set{areaSector=value;}
+ }
+ public decimal YClose
+ {
+ get{return yClose;}
+ set{yClose=value;}
+ }
+ public decimal UtickerClose
+ {
+ get{return utickerClose;}
+ set{utickerClose=value;}
+ }
+ public decimal YUtickerClose
+ {
+ get{return yUtickerClose;}
+ set{yUtickerClose=value;}
+ }
+ public decimal Delta
+ {
+ get{return delta;}
+ set{delta=value;}
+ }
+ public decimal YDelta
+ {
+ get{return yDelta;}
+ set{yDelta=value;}
+ }
+ public decimal HedgeBeta
+ {
+ get{return hedgeBeta;}
+ set{hedgeBeta=value;}
+ }
+ public decimal AreaBeta
+ {
+ get{return areaBeta;}
+ set{areaBeta=value;}
+ }
+ public decimal SectorBeta
+ {
+ get{return sectorBeta;}
+ set{sectorBeta=value;}
+ }
+ public decimal GroupBeta
+ {
+ get{return groupBeta;}
+ set{groupBeta=value;}
+ }
+ public decimal Qty
+ {
+ get{return qty;}
+ set{qty=value;}
+ }
+ public decimal YQty
+ {
+ get{return yQty;}
+ set{yQty=value;}
+ }
+ public decimal QtyChange
+ {
+ get{return qtyChange;}
+ set{qtyChange=value;}
+ }
+ public decimal HedgeClose
+ {
+ get{return hedgeClose;}
+ set{hedgeClose=value;}
+ }
+ public decimal HedgePerc
+ {
+ get{return hedgePerc;}
+ set{hedgePerc=value;}
+ }
+ public decimal AreaClose
+ {
+ get{return areaClose;}
+ set{areaClose=value;}
+ }
+ public decimal AreaPerc
+ {
+ get{return areaPerc;}
+ set{areaPerc=value;}
+ }
+ public decimal SectorClose
+ {
+ get{return sectorClose;}
+ set{sectorClose=value;}
+ }
+ public decimal SectorPerc
+ {
+ get{return sectorPerc;}
+ set{sectorPerc=value;}
+ }
+ public decimal MktValue
+ {
+ get{return mktValue;}
+ set{mktValue=value;}
+ }
+ public decimal YMktValue
+ {
+ get{return yMktValue;}
+ set{yMktValue=value;}
+ }
+ public decimal Exposure
+ {
+ get{return exposure;}
+ set{exposure=value;}
+ }
+ public decimal YExposure
+ {
+ get{return yExposure;}
+ set{yExposure=value;}
+ }
+ public decimal HbExposure
+ {
+ get{return hbExposure;}
+ set{hbExposure=value;}
+ }
+ public decimal YHbExposure
+ {
+ get{return yHbExposure;}
+ set{yHbExposure=value;}
+ }
+ public decimal AbExposure
+ {
+ get{return abExposure;}
+ set{abExposure=value;}
+ }
+ public decimal YAbExposure
+ {
+ get{return yAbExposure;}
+ set{yAbExposure=value;}
+ }
+ public decimal SbExposure
+ {
+ get{return sbExposure;}
+ set{sbExposure=value;}
+ }
+ public decimal YSbExposure
+ {
+ get{return ySbExposure;}
+ set{ySbExposure=value;}
+ }
+ public decimal Pnl
+ {
+ get{return pnl;}
+ set{pnl=value;}
+ }
+ public decimal PnlPerc
+ {
+ get{return pnlPerc;}
+ set{pnlPerc=value;}
+ }
+ public decimal PriceChange
+ {
+ get{return priceChange;}
+ set{priceChange=value;}
+ }
+ public decimal PriceChangePerc
+ {
+ get{return priceChangePerc;}
+ set{priceChangePerc=value;}
+ }
+ public decimal PriceChangeAmt
+ {
+ get{return priceChangeAmt;}
+ set{priceChangeAmt=value;}
+ }
+ public decimal SectorAlphaPerc
+ {
+ get{return sectorAlphaPerc;}
+ set{sectorAlphaPerc=value;}
+ }
+ public decimal GroupAlphaPerc
+ {
+ get{return groupAlphaPerc;}
+ set{groupAlphaPerc=value;}
+ }
+ public decimal AreaAlphaPerc
+ {
+ get{return areaAlphaPerc;}
+ set{areaAlphaPerc=value;}
+ }
+ public decimal HedgeAlphaPerc
+ {
+ get{return hedgeAlphaPerc;}
+ set{hedgeAlphaPerc=value;}
+ }
+ public decimal AreaPnlAmt
+ {
+ get{return areaPnlAmt;}
+ set{areaPnlAmt=value;}
+ }
+ public decimal SectorPnlAmt
+ {
+ get{return sectorPnlAmt;}
+ set{sectorPnlAmt=value;}
+ }
+ public decimal SectorAlphaAmt
+ {
+ get{return sectorAlphaAmt;}
+ set{sectorAlphaAmt=value;}
+ }
+ public decimal GroupAlphaAmt
+ {
+ get{return groupAlphaAmt;}
+ set{groupAlphaAmt=value;}
+ }
+ public decimal AreaAlphaAmt
+ {
+ get{return areaAlphaAmt;}
+ set{areaAlphaAmt=value;}
+ }
+ public decimal HedgeAlphaAmt
+ {
+ get{return hedgeAlphaAmt;}
+ set{hedgeAlphaAmt=value;}
+ }
+ public decimal AbReturnAmt
+ {
+ get{return abReturnAmt;}
+ set{abReturnAmt=value;}
+ }
+ public decimal AbReturnPerc
+ {
+ get{return abReturnPerc;}
+ set{abReturnPerc=value;}
+ }
+ public decimal AltIndexReturnPerc
+ {
+ get{return altIndexReturnPerc;}
+ set{altIndexReturnPerc=value;}
+ }
+ public decimal AltIndexReturnAmt
+ {
+ get{return altIndexReturnAmt;}
+ set{altIndexReturnAmt=value;}
+ }
+ public decimal IndexBetaAdjPerc
+ {
+ get{return indexBetaAdjPerc;}
+ set{indexBetaAdjPerc=value;}
+ }
+ public decimal IndexBetaAdjAmt
+ {
+ get{return indexBetaAdjAmt;}
+ set{indexBetaAdjAmt=value;}
+ }
+ public decimal IntradayPerc
+ {
+ get{return intradayPerc;}
+ set{intradayPerc=value;}
+ }
+ public decimal IntradayAmt
+ {
+ get{return intradayAmt;}
+ set{intradayAmt=value;}
+ }
+ public decimal OptionalityPerc
+ {
+ get{return optionalityPerc;}
+ set{optionalityPerc=value;}
+ }
+ public decimal OptionalityAmt
+ {
+ get{return optionalityAmt;}
+ set{optionalityAmt=value;}
+ }
+ public string Currency
+ {
+ get{return currency;}
+ set{currency=value;}
+ }
+ public decimal BaseClose
+ {
+ get{return baseClose;}
+ set{baseClose=value;}
+ }
+ public decimal YBaseClose
+ {
+ get{return yBaseClose;}
+ set{yBaseClose=value;}
+ }
+ public decimal FxPerc
+ {
+ get{return fxPerc;}
+ set{fxPerc=value;}
+ }
+ public decimal FxAmt
+ {
+ get{return fxAmt;}
+ set{fxAmt=value;}
+ }
+ public decimal FxRate
+ {
+ get{return fxRate;}
+ set{fxRate=value;}
+ }
+ public decimal YFxRate
+ {
+ get{return yFxRate;}
+ set{yFxRate=value;}
+ }
+ public string ExposureView
+ {
+ get{return exposureView;}
+ set{exposureView=value;}
+ }
+ public string MarketView
+ {
+ get{return marketView;}
+ set{marketView=value;}
+ }
+ public string CallPut
+ {
+ get{return callPut;}
+ set{callPut=value;}
+ }
+ public int DaysExpire
+ {
+ get{return daysExpire;}
+ set{daysExpire=value;}
+ }
+ public decimal StrikePrice
+ {
+ get{return strikePrice;}
+ set{strikePrice=value;}
+ }
+ public string Associate
+ {
+ get{return associate;}
+ set{associate=value;}
+ }
+ public bool Ipo
+ {
+ get{return ipo;}
+ set{ipo=value;}
+ }
+ public decimal Ratio
+ {
+ get{return ratio;}
+ set{ratio=value;}
+ }
+ public bool Exported
+ {
+ get{return exported;}
+ set{exported=value;}
+ }
+ public string Source
+ {
+ get{return source;}
+ set{source=value;}
+ }
+ public decimal Vwap
+ {
+ get{return vwap;}
+ set{vwap=value;}
+ }
+ public decimal VwapPnl
+ {
+ get{return vwapPnl;}
+ set{vwapPnl=value;}
+ }
+ public decimal Adh
+ {
+ get{return adh;}
+ set{adh=value;}
+ }
+ public decimal Aac
+ {
+ get{return aac;}
+ set{aac=value;}
+ }
+ public decimal Azap
+ {
+ get{return azap;}
+ set{azap=value;}
+ }
+ public DateTime GoAround
+ {
+ get{return goAround;}
+ set{goAround=value;}
+ }
+ public decimal AlphaGoAround
+ {
+ get{return alphaGoAround;}
+ set{alphaGoAround=value;}
+ }
+ public decimal AlphaReal
+ {
+ get{return alphaReal;}
+ set{alphaReal=value;}
+ }
+ public decimal AlphaUnreal
+ {
+ get{return alphaUnreal;}
+ set{alphaUnreal=value;}
+ }
+ public decimal PnlReal
+ {
+ get{return pnlReal;}
+ set{pnlReal=value;}
+ }
+ public decimal PnlUnreal
+ {
+ get{return pnlUnreal;}
+ set{pnlUnreal=value;}
+ }
+ public decimal CashFlow
+ {
+ get{return cashFlow;}
+ set{cashFlow=value;}
+ }
+ public decimal BetaCashFlow
+ {
+ get{return betaCashFlow;}
+ set{betaCashFlow=value;}
+ }
+ public DateTime LastTradeDate
+ {
+ get{return lastTradeDate;}
+ set{lastTradeDate=value;}
+ }
+ public decimal LastTradeQty
+ {
+ get{return lastTradeQty;}
+ set{lastTradeQty=value;}
+ }
+ public decimal EnterpriseValue
+ {
+ get{return enterpriseValue;}
+ set{enterpriseValue=value;}
+ }
+ public decimal MktCap
+ {
+ get{return mktCap;}
+ set{mktCap=value;}
+ }
+ public decimal WgtAve
+ {
+ get{return wgtAve;}
+ set{wgtAve=value;}
+ }
+ public decimal Volume
+ {
+ get{return volume;}
+ set{volume=value;}
+ }
+ public long RowID
+ {
+ get{return rowID;}
+ set{rowID=value;}
+ }
+ }
+}
diff --git a/ClassGen/Historic.java b/ClassGen/Historic.java
new file mode 100644
index 0000000..71c97ad
--- /dev/null
+++ b/ClassGen/Historic.java
@@ -0,0 +1,951 @@
+package zbi.risk.server.vhi.mapped
+
+
+public class Historic
+{
+ private Timestamp tradeDate;
+ private String tradeDateTxt;
+ private String portfolio;
+ private String subPortfolio;
+ private String ticker;
+ private String tickerDesc;
+ private String uticker;
+ private String instrument;
+ private float mktCap;
+ private float wgtAve;
+ private float volume;
+ private float contractSize;
+ private String hedgeIndex;
+ private String hedgeSector;
+ private String area;
+ private String areaSector;
+ private float close;
+ private float yClose;
+ private float utickerClose;
+ private float yUtickerClose;
+ private float delta;
+ private float yDelta;
+ private int daysExpire;
+ private float strikePrice;
+ private float hedgeBeta;
+ private float areaBeta;
+ private float sectorBeta;
+ private float groupBeta;
+ private float qty;
+ private float yQty;
+ private float qtyChange;
+ private float hedgeClose;
+ private float hedgePerc;
+ private float areaClose;
+ private float areaPerc;
+ private float sectorClose;
+ private float sectorPerc;
+ private float mktValue;
+ private float yMktValue;
+ private float pnl;
+ private float exposure;
+ private float yExposure;
+ private float hbExposure;
+ private float yHbExposure;
+ private float abExposure;
+ private float yAbExposure;
+ private float sbExposure;
+ private float ySbExposure;
+ private float areaPnlAmt;
+ private float sectorPnlAmt;
+ private float pnlPerc;
+ private float priceChange;
+ private float priceChangePerc;
+ private float priceChangeAmt;
+ private float sectorAlphaPerc;
+ private float groupAlphaPerc;
+ private float areaAlphaPerc;
+ private float sectorAlphaAmt;
+ private float groupAlphaAmt;
+ private float areaAlphaAmt;
+ private float abReturnAmt;
+ private float abReturnPerc;
+ private float intradayPerc;
+ private float intradayAmt;
+ private float optionalityAmt;
+ private float optionalityPerc;
+ private String currency;
+ private float baseClose;
+ private float yBaseClose;
+ private float fxPerc;
+ private float fxAmt;
+ private float fxRate;
+ private float yFxRate;
+ private float altIndexReturnPerc;
+ private float altIndexReturnAmt;
+ private float indexBetaAdjPerc;
+ private float indexBetaAdjAmt;
+ private float vwap;
+ private float vwapPnl;
+ private float hedgeAlphaAmt;
+ private String exposureView;
+ private String marketView;
+ private String callPut;
+ private String [month];
+ private boolean private;
+ private boolean ipo;
+ private float ratio;
+ private String source;
+ private Timestamp goAround;
+ private float adh;
+ private float aac;
+ private float azap;
+ private boolean exported;
+ private float hedgeAlphaPerc;
+ private float alphaGoAround;
+ private float alphaReal;
+ private float alphaUnreal;
+ private float pnlReal;
+ private float pnlUnreal;
+ private float cashFlow;
+ private float betaCashFlow;
+ private Timestamp lastTradeDate;
+ private float lastTradeQty;
+ private float enterpriseValue;
+ private String associate;
+ public Timestamp getTradeDate()
+ {
+ return tradeDate;
+ }
+ public void setTradeDate(Timestamp tradeDate)
+ {
+ this.tradeDate=tradeDate;
+ }
+ public String getTradeDateTxt()
+ {
+ return tradeDateTxt;
+ }
+ public void setTradeDateTxt(String tradeDateTxt)
+ {
+ this.tradeDateTxt=tradeDateTxt;
+ }
+ public String getPortfolio()
+ {
+ return portfolio;
+ }
+ public void setPortfolio(String portfolio)
+ {
+ this.portfolio=portfolio;
+ }
+ public String getSubPortfolio()
+ {
+ return subPortfolio;
+ }
+ public void setSubPortfolio(String subPortfolio)
+ {
+ this.subPortfolio=subPortfolio;
+ }
+ public String getTicker()
+ {
+ return ticker;
+ }
+ public void setTicker(String ticker)
+ {
+ this.ticker=ticker;
+ }
+ public String getTickerDesc()
+ {
+ return tickerDesc;
+ }
+ public void setTickerDesc(String tickerDesc)
+ {
+ this.tickerDesc=tickerDesc;
+ }
+ public String getUticker()
+ {
+ return uticker;
+ }
+ public void setUticker(String uticker)
+ {
+ this.uticker=uticker;
+ }
+ public String getInstrument()
+ {
+ return instrument;
+ }
+ public void setInstrument(String instrument)
+ {
+ this.instrument=instrument;
+ }
+ public float getMktCap()
+ {
+ return mktCap;
+ }
+ public void setMktCap(float mktCap)
+ {
+ this.mktCap=mktCap;
+ }
+ public float getWgtAve()
+ {
+ return wgtAve;
+ }
+ public void setWgtAve(float wgtAve)
+ {
+ this.wgtAve=wgtAve;
+ }
+ public float getVolume()
+ {
+ return volume;
+ }
+ public void setVolume(float volume)
+ {
+ this.volume=volume;
+ }
+ public float getContractSize()
+ {
+ return contractSize;
+ }
+ public void setContractSize(float contractSize)
+ {
+ this.contractSize=contractSize;
+ }
+ public String getHedgeIndex()
+ {
+ return hedgeIndex;
+ }
+ public void setHedgeIndex(String hedgeIndex)
+ {
+ this.hedgeIndex=hedgeIndex;
+ }
+ public String getHedgeSector()
+ {
+ return hedgeSector;
+ }
+ public void setHedgeSector(String hedgeSector)
+ {
+ this.hedgeSector=hedgeSector;
+ }
+ public String getArea()
+ {
+ return area;
+ }
+ public void setArea(String area)
+ {
+ this.area=area;
+ }
+ public String getAreaSector()
+ {
+ return areaSector;
+ }
+ public void setAreaSector(String areaSector)
+ {
+ this.areaSector=areaSector;
+ }
+ public float get[close]()
+ {
+ return [close];
+ }
+ public void set[close](float [close])
+ {
+ this.[close]=[close];
+ }
+ public float getYClose()
+ {
+ return yClose;
+ }
+ public void setYClose(float yClose)
+ {
+ this.yClose=yClose;
+ }
+ public float getUtickerClose()
+ {
+ return utickerClose;
+ }
+ public void setUtickerClose(float utickerClose)
+ {
+ this.utickerClose=utickerClose;
+ }
+ public float getYUtickerClose()
+ {
+ return yUtickerClose;
+ }
+ public void setYUtickerClose(float yUtickerClose)
+ {
+ this.yUtickerClose=yUtickerClose;
+ }
+ public float getDelta()
+ {
+ return delta;
+ }
+ public void setDelta(float delta)
+ {
+ this.delta=delta;
+ }
+ public float getYDelta()
+ {
+ return yDelta;
+ }
+ public void setYDelta(float yDelta)
+ {
+ this.yDelta=yDelta;
+ }
+ public int getDaysExpire()
+ {
+ return daysExpire;
+ }
+ public void setDaysExpire(int daysExpire)
+ {
+ this.daysExpire=daysExpire;
+ }
+ public float getStrikePrice()
+ {
+ return strikePrice;
+ }
+ public void setStrikePrice(float strikePrice)
+ {
+ this.strikePrice=strikePrice;
+ }
+ public float getHedgeBeta()
+ {
+ return hedgeBeta;
+ }
+ public void setHedgeBeta(float hedgeBeta)
+ {
+ this.hedgeBeta=hedgeBeta;
+ }
+ public float getAreaBeta()
+ {
+ return areaBeta;
+ }
+ public void setAreaBeta(float areaBeta)
+ {
+ this.areaBeta=areaBeta;
+ }
+ public float getSectorBeta()
+ {
+ return sectorBeta;
+ }
+ public void setSectorBeta(float sectorBeta)
+ {
+ this.sectorBeta=sectorBeta;
+ }
+ public float getGroupBeta()
+ {
+ return groupBeta;
+ }
+ public void setGroupBeta(float groupBeta)
+ {
+ this.groupBeta=groupBeta;
+ }
+ public float getQty()
+ {
+ return qty;
+ }
+ public void setQty(float qty)
+ {
+ this.qty=qty;
+ }
+ public float getYQty()
+ {
+ return yQty;
+ }
+ public void setYQty(float yQty)
+ {
+ this.yQty=yQty;
+ }
+ public float getQtyChange()
+ {
+ return qtyChange;
+ }
+ public void setQtyChange(float qtyChange)
+ {
+ this.qtyChange=qtyChange;
+ }
+ public float getHedgeClose()
+ {
+ return hedgeClose;
+ }
+ public void setHedgeClose(float hedgeClose)
+ {
+ this.hedgeClose=hedgeClose;
+ }
+ public float getHedgePerc()
+ {
+ return hedgePerc;
+ }
+ public void setHedgePerc(float hedgePerc)
+ {
+ this.hedgePerc=hedgePerc;
+ }
+ public float getAreaClose()
+ {
+ return areaClose;
+ }
+ public void setAreaClose(float areaClose)
+ {
+ this.areaClose=areaClose;
+ }
+ public float getAreaPerc()
+ {
+ return areaPerc;
+ }
+ public void setAreaPerc(float areaPerc)
+ {
+ this.areaPerc=areaPerc;
+ }
+ public float getSectorClose()
+ {
+ return sectorClose;
+ }
+ public void setSectorClose(float sectorClose)
+ {
+ this.sectorClose=sectorClose;
+ }
+ public float getSectorPerc()
+ {
+ return sectorPerc;
+ }
+ public void setSectorPerc(float sectorPerc)
+ {
+ this.sectorPerc=sectorPerc;
+ }
+ public float getMktValue()
+ {
+ return mktValue;
+ }
+ public void setMktValue(float mktValue)
+ {
+ this.mktValue=mktValue;
+ }
+ public float getYMktValue()
+ {
+ return yMktValue;
+ }
+ public void setYMktValue(float yMktValue)
+ {
+ this.yMktValue=yMktValue;
+ }
+ public float getPnl()
+ {
+ return pnl;
+ }
+ public void setPnl(float pnl)
+ {
+ this.pnl=pnl;
+ }
+ public float getExposure()
+ {
+ return exposure;
+ }
+ public void setExposure(float exposure)
+ {
+ this.exposure=exposure;
+ }
+ public float getYExposure()
+ {
+ return yExposure;
+ }
+ public void setYExposure(float yExposure)
+ {
+ this.yExposure=yExposure;
+ }
+ public float getHbExposure()
+ {
+ return hbExposure;
+ }
+ public void setHbExposure(float hbExposure)
+ {
+ this.hbExposure=hbExposure;
+ }
+ public float getYHbExposure()
+ {
+ return yHbExposure;
+ }
+ public void setYHbExposure(float yHbExposure)
+ {
+ this.yHbExposure=yHbExposure;
+ }
+ public float getAbExposure()
+ {
+ return abExposure;
+ }
+ public void setAbExposure(float abExposure)
+ {
+ this.abExposure=abExposure;
+ }
+ public float getYAbExposure()
+ {
+ return yAbExposure;
+ }
+ public void setYAbExposure(float yAbExposure)
+ {
+ this.yAbExposure=yAbExposure;
+ }
+ public float getSbExposure()
+ {
+ return sbExposure;
+ }
+ public void setSbExposure(float sbExposure)
+ {
+ this.sbExposure=sbExposure;
+ }
+ public float getYSbExposure()
+ {
+ return ySbExposure;
+ }
+ public void setYSbExposure(float ySbExposure)
+ {
+ this.ySbExposure=ySbExposure;
+ }
+ public float getAreaPnlAmt()
+ {
+ return areaPnlAmt;
+ }
+ public void setAreaPnlAmt(float areaPnlAmt)
+ {
+ this.areaPnlAmt=areaPnlAmt;
+ }
+ public float getSectorPnlAmt()
+ {
+ return sectorPnlAmt;
+ }
+ public void setSectorPnlAmt(float sectorPnlAmt)
+ {
+ this.sectorPnlAmt=sectorPnlAmt;
+ }
+ public float getPnlPerc()
+ {
+ return pnlPerc;
+ }
+ public void setPnlPerc(float pnlPerc)
+ {
+ this.pnlPerc=pnlPerc;
+ }
+ public float getPriceChange()
+ {
+ return priceChange;
+ }
+ public void setPriceChange(float priceChange)
+ {
+ this.priceChange=priceChange;
+ }
+ public float getPriceChangePerc()
+ {
+ return priceChangePerc;
+ }
+ public void setPriceChangePerc(float priceChangePerc)
+ {
+ this.priceChangePerc=priceChangePerc;
+ }
+ public float getPriceChangeAmt()
+ {
+ return priceChangeAmt;
+ }
+ public void setPriceChangeAmt(float priceChangeAmt)
+ {
+ this.priceChangeAmt=priceChangeAmt;
+ }
+ public float getSectorAlphaPerc()
+ {
+ return sectorAlphaPerc;
+ }
+ public void setSectorAlphaPerc(float sectorAlphaPerc)
+ {
+ this.sectorAlphaPerc=sectorAlphaPerc;
+ }
+ public float getGroupAlphaPerc()
+ {
+ return groupAlphaPerc;
+ }
+ public void setGroupAlphaPerc(float groupAlphaPerc)
+ {
+ this.groupAlphaPerc=groupAlphaPerc;
+ }
+ public float getAreaAlphaPerc()
+ {
+ return areaAlphaPerc;
+ }
+ public void setAreaAlphaPerc(float areaAlphaPerc)
+ {
+ this.areaAlphaPerc=areaAlphaPerc;
+ }
+ public float getSectorAlphaAmt()
+ {
+ return sectorAlphaAmt;
+ }
+ public void setSectorAlphaAmt(float sectorAlphaAmt)
+ {
+ this.sectorAlphaAmt=sectorAlphaAmt;
+ }
+ public float getGroupAlphaAmt()
+ {
+ return groupAlphaAmt;
+ }
+ public void setGroupAlphaAmt(float groupAlphaAmt)
+ {
+ this.groupAlphaAmt=groupAlphaAmt;
+ }
+ public float getAreaAlphaAmt()
+ {
+ return areaAlphaAmt;
+ }
+ public void setAreaAlphaAmt(float areaAlphaAmt)
+ {
+ this.areaAlphaAmt=areaAlphaAmt;
+ }
+ public float getAbReturnAmt()
+ {
+ return abReturnAmt;
+ }
+ public void setAbReturnAmt(float abReturnAmt)
+ {
+ this.abReturnAmt=abReturnAmt;
+ }
+ public float getAbReturnPerc()
+ {
+ return abReturnPerc;
+ }
+ public void setAbReturnPerc(float abReturnPerc)
+ {
+ this.abReturnPerc=abReturnPerc;
+ }
+ public float getIntradayPerc()
+ {
+ return intradayPerc;
+ }
+ public void setIntradayPerc(float intradayPerc)
+ {
+ this.intradayPerc=intradayPerc;
+ }
+ public float getIntradayAmt()
+ {
+ return intradayAmt;
+ }
+ public void setIntradayAmt(float intradayAmt)
+ {
+ this.intradayAmt=intradayAmt;
+ }
+ public float getOptionalityAmt()
+ {
+ return optionalityAmt;
+ }
+ public void setOptionalityAmt(float optionalityAmt)
+ {
+ this.optionalityAmt=optionalityAmt;
+ }
+ public float getOptionalityPerc()
+ {
+ return optionalityPerc;
+ }
+ public void setOptionalityPerc(float optionalityPerc)
+ {
+ this.optionalityPerc=optionalityPerc;
+ }
+ public String getCurrency()
+ {
+ return currency;
+ }
+ public void setCurrency(String currency)
+ {
+ this.currency=currency;
+ }
+ public float getBaseClose()
+ {
+ return baseClose;
+ }
+ public void setBaseClose(float baseClose)
+ {
+ this.baseClose=baseClose;
+ }
+ public float getYBaseClose()
+ {
+ return yBaseClose;
+ }
+ public void setYBaseClose(float yBaseClose)
+ {
+ this.yBaseClose=yBaseClose;
+ }
+ public float getFxPerc()
+ {
+ return fxPerc;
+ }
+ public void setFxPerc(float fxPerc)
+ {
+ this.fxPerc=fxPerc;
+ }
+ public float getFxAmt()
+ {
+ return fxAmt;
+ }
+ public void setFxAmt(float fxAmt)
+ {
+ this.fxAmt=fxAmt;
+ }
+ public float getFxRate()
+ {
+ return fxRate;
+ }
+ public void setFxRate(float fxRate)
+ {
+ this.fxRate=fxRate;
+ }
+ public float getYFxRate()
+ {
+ return yFxRate;
+ }
+ public void setYFxRate(float yFxRate)
+ {
+ this.yFxRate=yFxRate;
+ }
+ public float getAltIndexReturnPerc()
+ {
+ return altIndexReturnPerc;
+ }
+ public void setAltIndexReturnPerc(float altIndexReturnPerc)
+ {
+ this.altIndexReturnPerc=altIndexReturnPerc;
+ }
+ public float getAltIndexReturnAmt()
+ {
+ return altIndexReturnAmt;
+ }
+ public void setAltIndexReturnAmt(float altIndexReturnAmt)
+ {
+ this.altIndexReturnAmt=altIndexReturnAmt;
+ }
+ public float getIndexBetaAdjPerc()
+ {
+ return indexBetaAdjPerc;
+ }
+ public void setIndexBetaAdjPerc(float indexBetaAdjPerc)
+ {
+ this.indexBetaAdjPerc=indexBetaAdjPerc;
+ }
+ public float getIndexBetaAdjAmt()
+ {
+ return indexBetaAdjAmt;
+ }
+ public void setIndexBetaAdjAmt(float indexBetaAdjAmt)
+ {
+ this.indexBetaAdjAmt=indexBetaAdjAmt;
+ }
+ public float getVwap()
+ {
+ return vwap;
+ }
+ public void setVwap(float vwap)
+ {
+ this.vwap=vwap;
+ }
+ public float getVwapPnl()
+ {
+ return vwapPnl;
+ }
+ public void setVwapPnl(float vwapPnl)
+ {
+ this.vwapPnl=vwapPnl;
+ }
+ public float getHedgeAlphaAmt()
+ {
+ return hedgeAlphaAmt;
+ }
+ public void setHedgeAlphaAmt(float hedgeAlphaAmt)
+ {
+ this.hedgeAlphaAmt=hedgeAlphaAmt;
+ }
+ public String getExposureView()
+ {
+ return exposureView;
+ }
+ public void setExposureView(String exposureView)
+ {
+ this.exposureView=exposureView;
+ }
+ public String getMarketView()
+ {
+ return marketView;
+ }
+ public void setMarketView(String marketView)
+ {
+ this.marketView=marketView;
+ }
+ public String getCallPut()
+ {
+ return callPut;
+ }
+ public void setCallPut(String callPut)
+ {
+ this.callPut=callPut;
+ }
+ public String get[month]()
+ {
+ return [month];
+ }
+ public void set[month](String [month])
+ {
+ this.[month]=[month];
+ }
+ public boolean getPrivate()
+ {
+ return private;
+ }
+ public void setPrivate(boolean private)
+ {
+ this.private=private;
+ }
+ public boolean getIpo()
+ {
+ return ipo;
+ }
+ public void setIpo(boolean ipo)
+ {
+ this.ipo=ipo;
+ }
+ public float getRatio()
+ {
+ return ratio;
+ }
+ public void setRatio(float ratio)
+ {
+ this.ratio=ratio;
+ }
+ public String getSource()
+ {
+ return source;
+ }
+ public void setSource(String source)
+ {
+ this.source=source;
+ }
+ public Timestamp getGoAround()
+ {
+ return goAround;
+ }
+ public void setGoAround(Timestamp goAround)
+ {
+ this.goAround=goAround;
+ }
+ public float getAdh()
+ {
+ return adh;
+ }
+ public void setAdh(float adh)
+ {
+ this.adh=adh;
+ }
+ public float getAac()
+ {
+ return aac;
+ }
+ public void setAac(float aac)
+ {
+ this.aac=aac;
+ }
+ public float getAzap()
+ {
+ return azap;
+ }
+ public void setAzap(float azap)
+ {
+ this.azap=azap;
+ }
+ public boolean getExported()
+ {
+ return exported;
+ }
+ public void setExported(boolean exported)
+ {
+ this.exported=exported;
+ }
+ public float getHedgeAlphaPerc()
+ {
+ return hedgeAlphaPerc;
+ }
+ public void setHedgeAlphaPerc(float hedgeAlphaPerc)
+ {
+ this.hedgeAlphaPerc=hedgeAlphaPerc;
+ }
+ public float getAlphaGoAround()
+ {
+ return alphaGoAround;
+ }
+ public void setAlphaGoAround(float alphaGoAround)
+ {
+ this.alphaGoAround=alphaGoAround;
+ }
+ public float getAlphaReal()
+ {
+ return alphaReal;
+ }
+ public void setAlphaReal(float alphaReal)
+ {
+ this.alphaReal=alphaReal;
+ }
+ public float getAlphaUnreal()
+ {
+ return alphaUnreal;
+ }
+ public void setAlphaUnreal(float alphaUnreal)
+ {
+ this.alphaUnreal=alphaUnreal;
+ }
+ public float getPnlReal()
+ {
+ return pnlReal;
+ }
+ public void setPnlReal(float pnlReal)
+ {
+ this.pnlReal=pnlReal;
+ }
+ public float getPnlUnreal()
+ {
+ return pnlUnreal;
+ }
+ public void setPnlUnreal(float pnlUnreal)
+ {
+ this.pnlUnreal=pnlUnreal;
+ }
+ public float getCashFlow()
+ {
+ return cashFlow;
+ }
+ public void setCashFlow(float cashFlow)
+ {
+ this.cashFlow=cashFlow;
+ }
+ public float getBetaCashFlow()
+ {
+ return betaCashFlow;
+ }
+ public void setBetaCashFlow(float betaCashFlow)
+ {
+ this.betaCashFlow=betaCashFlow;
+ }
+ public Timestamp getLastTradeDate()
+ {
+ return lastTradeDate;
+ }
+ public void setLastTradeDate(Timestamp lastTradeDate)
+ {
+ this.lastTradeDate=lastTradeDate;
+ }
+ public float getLastTradeQty()
+ {
+ return lastTradeQty;
+ }
+ public void setLastTradeQty(float lastTradeQty)
+ {
+ this.lastTradeQty=lastTradeQty;
+ }
+ public float getEnterpriseValue()
+ {
+ return enterpriseValue;
+ }
+ public void setEnterpriseValue(float enterpriseValue)
+ {
+ this.enterpriseValue=enterpriseValue;
+ }
+ public String getAssociate()
+ {
+ return associate;
+ }
+ public void setAssociate(String associate)
+ {
+ this.associate=associate;
+ }
+};
diff --git a/ClassGen/HistoricDA.cs b/ClassGen/HistoricDA.cs
new file mode 100644
index 0000000..856df25
--- /dev/null
+++ b/ClassGen/HistoricDA.cs
@@ -0,0 +1,153 @@
+using System;
+using System.Collections;
+using System.Data.SqlClient;
+
+namespace ZBI.Risk.Server.Mapped
+{
+ public class HistoricDA
+ {
+ public ArrayList readAll()
+ {
+ SqlConnection sqlConnection=null;
+ SqlDataReader sqlDataReader=null;
+ SqlCommand sqlCommand=null;
+ try
+ {
+ ArrayList arrayList=new ArrayList();
+ string strQuery="select trade_date, trade_date_txt, portfolio, sub_portfolio, ticker, ticker_desc, uticker, instrument, contract_size, hedge_index, hedge_sector, area, area_sector, y_close, uticker_close, y_uticker_close, delta, y_delta, hedge_beta, area_beta, sector_beta, group_beta, qty, y_qty, qty_change, hedge_close, hedge_perc, area_close, area_perc, sector_close, sector_perc, mkt_value, y_mkt_value, exposure, y_exposure, hb_exposure, y_hb_exposure, ab_exposure, y_ab_exposure, sb_exposure, y_sb_exposure, pnl, pnl_perc, price_change, price_change_perc, price_change_amt, sector_alpha_perc, group_alpha_perc, area_alpha_perc, hedge_alpha_perc, area_pnl_amt, sector_pnl_amt, sector_alpha_amt, group_alpha_amt, area_alpha_amt, hedge_alpha_amt, ab_return_amt, ab_return_perc, alt_index_return_perc, alt_index_return_amt, index_beta_adj_perc, index_beta_adj_amt, intraday_perc, intraday_amt, optionality_perc, optionality_amt, currency, base_close, y_base_close, fx_perc, fx_amt, fx_rate, y_fx_rate, exposure_view, market_view, call_put, days_expire, strike_price, associate, ipo, ratio, exported, source, vwap, vwap_pnl, adh, aac, azap, go_around, alpha_go_around, alpha_real, alpha_unreal, pnl_real, pnl_unreal, cash_flow, beta_cash_flow, last_trade_date, last_trade_qty, enterprise_value, mkt_cap, wgt_ave, volume, RowID from dt_main_positions";
+ sqlConnection=createSqlConnection(DRMS,dt_main_positions,"sa","");
+ sqlCommand=new SqlCommand(strQuery,sqlConnection);
+ sqlDataReader=sqlCommand.ExecuteReader();
+ while(sqlDataReader.Read())
+ {
+ Historic historic=new Historic();
+ historic.TradeDate=sqlDataReader.getDateTime(0);
+ historic.TradeDateTxt=sqlDataReader.getString(1);
+ historic.Portfolio=sqlDataReader.getString(2);
+ historic.SubPortfolio=sqlDataReader.getString(3);
+ historic.Ticker=sqlDataReader.getString(4);
+ historic.TickerDesc=sqlDataReader.getString(5);
+ historic.Uticker=sqlDataReader.getString(6);
+ historic.Instrument=sqlDataReader.getString(7);
+ historic.ContractSize=sqlDataReader.getDecimal(8);
+ historic.HedgeIndex=sqlDataReader.getString(9);
+ historic.HedgeSector=sqlDataReader.getString(10);
+ historic.Area=sqlDataReader.getString(11);
+ historic.AreaSector=sqlDataReader.getString(12);
+ historic.YClose=sqlDataReader.getDecimal(13);
+ historic.UtickerClose=sqlDataReader.getDecimal(14);
+ historic.YUtickerClose=sqlDataReader.getDecimal(15);
+ historic.Delta=sqlDataReader.getDecimal(16);
+ historic.YDelta=sqlDataReader.getDecimal(17);
+ historic.HedgeBeta=sqlDataReader.getDecimal(18);
+ historic.AreaBeta=sqlDataReader.getDecimal(19);
+ historic.SectorBeta=sqlDataReader.getDecimal(20);
+ historic.GroupBeta=sqlDataReader.getDecimal(21);
+ historic.Qty=sqlDataReader.getDecimal(22);
+ historic.YQty=sqlDataReader.getDecimal(23);
+ historic.QtyChange=sqlDataReader.getDecimal(24);
+ historic.HedgeClose=sqlDataReader.getDecimal(25);
+ historic.HedgePerc=sqlDataReader.getDecimal(26);
+ historic.AreaClose=sqlDataReader.getDecimal(27);
+ historic.AreaPerc=sqlDataReader.getDecimal(28);
+ historic.SectorClose=sqlDataReader.getDecimal(29);
+ historic.SectorPerc=sqlDataReader.getDecimal(30);
+ historic.MktValue=sqlDataReader.getDecimal(31);
+ historic.YMktValue=sqlDataReader.getDecimal(32);
+ historic.Exposure=sqlDataReader.getDecimal(33);
+ historic.YExposure=sqlDataReader.getDecimal(34);
+ historic.HbExposure=sqlDataReader.getDecimal(35);
+ historic.YHbExposure=sqlDataReader.getDecimal(36);
+ historic.AbExposure=sqlDataReader.getDecimal(37);
+ historic.YAbExposure=sqlDataReader.getDecimal(38);
+ historic.SbExposure=sqlDataReader.getDecimal(39);
+ historic.YSbExposure=sqlDataReader.getDecimal(40);
+ historic.Pnl=sqlDataReader.getDecimal(41);
+ historic.PnlPerc=sqlDataReader.getDecimal(42);
+ historic.PriceChange=sqlDataReader.getDecimal(43);
+ historic.PriceChangePerc=sqlDataReader.getDecimal(44);
+ historic.PriceChangeAmt=sqlDataReader.getDecimal(45);
+ historic.SectorAlphaPerc=sqlDataReader.getDecimal(46);
+ historic.GroupAlphaPerc=sqlDataReader.getDecimal(47);
+ historic.AreaAlphaPerc=sqlDataReader.getDecimal(48);
+ historic.HedgeAlphaPerc=sqlDataReader.getDecimal(49);
+ historic.AreaPnlAmt=sqlDataReader.getDecimal(50);
+ historic.SectorPnlAmt=sqlDataReader.getDecimal(51);
+ historic.SectorAlphaAmt=sqlDataReader.getDecimal(52);
+ historic.GroupAlphaAmt=sqlDataReader.getDecimal(53);
+ historic.AreaAlphaAmt=sqlDataReader.getDecimal(54);
+ historic.HedgeAlphaAmt=sqlDataReader.getDecimal(55);
+ historic.AbReturnAmt=sqlDataReader.getDecimal(56);
+ historic.AbReturnPerc=sqlDataReader.getDecimal(57);
+ historic.AltIndexReturnPerc=sqlDataReader.getDecimal(58);
+ historic.AltIndexReturnAmt=sqlDataReader.getDecimal(59);
+ historic.IndexBetaAdjPerc=sqlDataReader.getDecimal(60);
+ historic.IndexBetaAdjAmt=sqlDataReader.getDecimal(61);
+ historic.IntradayPerc=sqlDataReader.getDecimal(62);
+ historic.IntradayAmt=sqlDataReader.getDecimal(63);
+ historic.OptionalityPerc=sqlDataReader.getDecimal(64);
+ historic.OptionalityAmt=sqlDataReader.getDecimal(65);
+ historic.Currency=sqlDataReader.getString(66);
+ historic.BaseClose=sqlDataReader.getDecimal(67);
+ historic.YBaseClose=sqlDataReader.getDecimal(68);
+ historic.FxPerc=sqlDataReader.getDecimal(69);
+ historic.FxAmt=sqlDataReader.getDecimal(70);
+ historic.FxRate=sqlDataReader.getDecimal(71);
+ historic.YFxRate=sqlDataReader.getDecimal(72);
+ historic.ExposureView=sqlDataReader.getString(73);
+ historic.MarketView=sqlDataReader.getString(74);
+ historic.CallPut=sqlDataReader.getString(75);
+ historic.DaysExpire=sqlDataReader.getInt(76);
+ historic.StrikePrice=sqlDataReader.getDecimal(77);
+ historic.Associate=sqlDataReader.getString(78);
+ historic.Ipo=sqlDataReader.getBool(79);
+ historic.Ratio=sqlDataReader.getDecimal(80);
+ historic.Exported=sqlDataReader.getBool(81);
+ historic.Source=sqlDataReader.getString(82);
+ historic.Vwap=sqlDataReader.getDecimal(83);
+ historic.VwapPnl=sqlDataReader.getDecimal(84);
+ historic.Adh=sqlDataReader.getDecimal(85);
+ historic.Aac=sqlDataReader.getDecimal(86);
+ historic.Azap=sqlDataReader.getDecimal(87);
+ historic.GoAround=sqlDataReader.getDateTime(88);
+ historic.AlphaGoAround=sqlDataReader.getDecimal(89);
+ historic.AlphaReal=sqlDataReader.getDecimal(90);
+ historic.AlphaUnreal=sqlDataReader.getDecimal(91);
+ historic.PnlReal=sqlDataReader.getDecimal(92);
+ historic.PnlUnreal=sqlDataReader.getDecimal(93);
+ historic.CashFlow=sqlDataReader.getDecimal(94);
+ historic.BetaCashFlow=sqlDataReader.getDecimal(95);
+ historic.LastTradeDate=sqlDataReader.getDateTime(96);
+ historic.LastTradeQty=sqlDataReader.getDecimal(97);
+ historic.EnterpriseValue=sqlDataReader.getDecimal(98);
+ historic.MktCap=sqlDataReader.getDecimal(99);
+ historic.WgtAve=sqlDataReader.getDecimal(100);
+ historic.Volume=sqlDataReader.getDecimal(101);
+ historic.RowID=sqlDataReader.getLong(102);
+ arrayList.add(historic);
+ }
+ return arrayList;
+ }
+ finally
+ {
+ if(null!=sqlDataReader)sqlDataReader.Close();
+ if(null!=sqlConnection)sqlConnection.Close();
+ }
+ }
+ private static SqlConnection createSqlConnection(string datssource,string database,string username,string password)
+ {
+ try
+ {
+ string connectionString="Data Source=DRMS;User ID=sa;password=";
+ SqlConnection connection=new SqlConnection(connectionString);
+ connection.Open();
+ return connection;
+ }
+ catch(SqlException exception)
+ {
+ Console.WriteLine(exception.ToString());
+ return null;
+ }
+ }
+ }
+}
diff --git a/ClassGen/HistoricDA.java b/ClassGen/HistoricDA.java
new file mode 100644
index 0000000..c54940a
--- /dev/null
+++ b/ClassGen/HistoricDA.java
@@ -0,0 +1,154 @@
+package zbi.risk.server.vhi.mapped
+
+
+public class HistoricDA
+{
+ public List readAll()throws SQLException
+ {
+ Statement statement=null;
+ ResultSet rs=null;
+ Connection connection=null;
+ String strQuery=null;
+ List list=null;
+
+ try
+ {
+ Historic historic = new Historic();
+ connection=getConnection();
+ statement=connection.createStatement();
+ list=new ArrayList();
+ strQuery="select trade_date, trade_date_txt, portfolio, sub_portfolio, ticker, ticker_desc, uticker, instrument, mkt_cap, wgt_ave, volume, contract_size, hedge_index, hedge_sector, area, area_sector, [close], y_close, uticker_close, y_uticker_close, delta, y_delta, days_expire, strike_price, hedge_beta, area_beta, sector_beta, group_beta, qty, y_qty, qty_change, hedge_close, hedge_perc, area_close, area_perc, sector_close, sector_perc, mkt_value, y_mkt_value, pnl, exposure, y_exposure, hb_exposure, y_hb_exposure, ab_exposure, y_ab_exposure, sb_exposure, y_sb_exposure, area_pnl_amt, sector_pnl_amt, pnl_perc, price_change, price_change_perc, price_change_amt, sector_alpha_perc, group_alpha_perc, area_alpha_perc, sector_alpha_amt, group_alpha_amt, area_alpha_amt, ab_return_amt, ab_return_perc, intraday_perc, intraday_amt, optionality_amt, optionality_perc, currency, base_close, y_base_close, fx_perc, fx_amt, fx_rate, y_fx_rate, alt_index_return_perc, alt_index_return_amt, index_beta_adj_perc, index_beta_adj_amt, vwap, vwap_pnl, hedge_alpha_amt, exposure_view, market_view, call_put, [month], private, ipo, ratio, source, go_around, adh, aac, azap, exported, hedge_alpha_perc, alpha_go_around, alpha_real, alpha_unreal, pnl_real, pnl_unreal, cash_flow, beta_cash_flow, last_trade_date, last_trade_qty, enterprise_value, associate from dt_main_positions";
+ rs=statement.executeQuery(strQuery);
+ while(rs.next())
+ {
+ historic.setTradeDate(rs.getTimestamp("trade_date"));
+ historic.setTradeDateTxt(rs.getString("trade_date_txt"));
+ historic.setPortfolio(rs.getString("portfolio"));
+ historic.setSubPortfolio(rs.getString("sub_portfolio"));
+ historic.setTicker(rs.getString("ticker"));
+ historic.setTickerDesc(rs.getString("ticker_desc"));
+ historic.setUticker(rs.getString("uticker"));
+ historic.setInstrument(rs.getString("instrument"));
+ historic.setMktCap(rs.getFloat("mkt_cap"));
+ historic.setWgtAve(rs.getFloat("wgt_ave"));
+ historic.setVolume(rs.getFloat("volume"));
+ historic.setContractSize(rs.getFloat("contract_size"));
+ historic.setHedgeIndex(rs.getString("hedge_index"));
+ historic.setHedgeSector(rs.getString("hedge_sector"));
+ historic.setArea(rs.getString("area"));
+ historic.setAreaSector(rs.getString("area_sector"));
+ historic.set[close](rs.getFloat("[close]"));
+ historic.setYClose(rs.getFloat("y_close"));
+ historic.setUtickerClose(rs.getFloat("uticker_close"));
+ historic.setYUtickerClose(rs.getFloat("y_uticker_close"));
+ historic.setDelta(rs.getFloat("delta"));
+ historic.setYDelta(rs.getFloat("y_delta"));
+ historic.setDaysExpire(rs.getInt("days_expire"));
+ historic.setStrikePrice(rs.getFloat("strike_price"));
+ historic.setHedgeBeta(rs.getFloat("hedge_beta"));
+ historic.setAreaBeta(rs.getFloat("area_beta"));
+ historic.setSectorBeta(rs.getFloat("sector_beta"));
+ historic.setGroupBeta(rs.getFloat("group_beta"));
+ historic.setQty(rs.getFloat("qty"));
+ historic.setYQty(rs.getFloat("y_qty"));
+ historic.setQtyChange(rs.getFloat("qty_change"));
+ historic.setHedgeClose(rs.getFloat("hedge_close"));
+ historic.setHedgePerc(rs.getFloat("hedge_perc"));
+ historic.setAreaClose(rs.getFloat("area_close"));
+ historic.setAreaPerc(rs.getFloat("area_perc"));
+ historic.setSectorClose(rs.getFloat("sector_close"));
+ historic.setSectorPerc(rs.getFloat("sector_perc"));
+ historic.setMktValue(rs.getFloat("mkt_value"));
+ historic.setYMktValue(rs.getFloat("y_mkt_value"));
+ historic.setPnl(rs.getFloat("pnl"));
+ historic.setExposure(rs.getFloat("exposure"));
+ historic.setYExposure(rs.getFloat("y_exposure"));
+ historic.setHbExposure(rs.getFloat("hb_exposure"));
+ historic.setYHbExposure(rs.getFloat("y_hb_exposure"));
+ historic.setAbExposure(rs.getFloat("ab_exposure"));
+ historic.setYAbExposure(rs.getFloat("y_ab_exposure"));
+ historic.setSbExposure(rs.getFloat("sb_exposure"));
+ historic.setYSbExposure(rs.getFloat("y_sb_exposure"));
+ historic.setAreaPnlAmt(rs.getFloat("area_pnl_amt"));
+ historic.setSectorPnlAmt(rs.getFloat("sector_pnl_amt"));
+ historic.setPnlPerc(rs.getFloat("pnl_perc"));
+ historic.setPriceChange(rs.getFloat("price_change"));
+ historic.setPriceChangePerc(rs.getFloat("price_change_perc"));
+ historic.setPriceChangeAmt(rs.getFloat("price_change_amt"));
+ historic.setSectorAlphaPerc(rs.getFloat("sector_alpha_perc"));
+ historic.setGroupAlphaPerc(rs.getFloat("group_alpha_perc"));
+ historic.setAreaAlphaPerc(rs.getFloat("area_alpha_perc"));
+ historic.setSectorAlphaAmt(rs.getFloat("sector_alpha_amt"));
+ historic.setGroupAlphaAmt(rs.getFloat("group_alpha_amt"));
+ historic.setAreaAlphaAmt(rs.getFloat("area_alpha_amt"));
+ historic.setAbReturnAmt(rs.getFloat("ab_return_amt"));
+ historic.setAbReturnPerc(rs.getFloat("ab_return_perc"));
+ historic.setIntradayPerc(rs.getFloat("intraday_perc"));
+ historic.setIntradayAmt(rs.getFloat("intraday_amt"));
+ historic.setOptionalityAmt(rs.getFloat("optionality_amt"));
+ historic.setOptionalityPerc(rs.getFloat("optionality_perc"));
+ historic.setCurrency(rs.getString("currency"));
+ historic.setBaseClose(rs.getFloat("base_close"));
+ historic.setYBaseClose(rs.getFloat("y_base_close"));
+ historic.setFxPerc(rs.getFloat("fx_perc"));
+ historic.setFxAmt(rs.getFloat("fx_amt"));
+ historic.setFxRate(rs.getFloat("fx_rate"));
+ historic.setYFxRate(rs.getFloat("y_fx_rate"));
+ historic.setAltIndexReturnPerc(rs.getFloat("alt_index_return_perc"));
+ historic.setAltIndexReturnAmt(rs.getFloat("alt_index_return_amt"));
+ historic.setIndexBetaAdjPerc(rs.getFloat("index_beta_adj_perc"));
+ historic.setIndexBetaAdjAmt(rs.getFloat("index_beta_adj_amt"));
+ historic.setVwap(rs.getFloat("vwap"));
+ historic.setVwapPnl(rs.getFloat("vwap_pnl"));
+ historic.setHedgeAlphaAmt(rs.getFloat("hedge_alpha_amt"));
+ historic.setExposureView(rs.getString("exposure_view"));
+ historic.setMarketView(rs.getString("market_view"));
+ historic.setCallPut(rs.getString("call_put"));
+ historic.set[month](rs.getString("[month]"));
+ historic.setPrivate(rs.getBoolean("private"));
+ historic.setIpo(rs.getBoolean("ipo"));
+ historic.setRatio(rs.getFloat("ratio"));
+ historic.setSource(rs.getString("source"));
+ historic.setGoAround(rs.getTimestamp("go_around"));
+ historic.setAdh(rs.getFloat("adh"));
+ historic.setAac(rs.getFloat("aac"));
+ historic.setAzap(rs.getFloat("azap"));
+ historic.setExported(rs.getBoolean("exported"));
+ historic.setHedgeAlphaPerc(rs.getFloat("hedge_alpha_perc"));
+ historic.setAlphaGoAround(rs.getFloat("alpha_go_around"));
+ historic.setAlphaReal(rs.getFloat("alpha_real"));
+ historic.setAlphaUnreal(rs.getFloat("alpha_unreal"));
+ historic.setPnlReal(rs.getFloat("pnl_real"));
+ historic.setPnlUnreal(rs.getFloat("pnl_unreal"));
+ historic.setCashFlow(rs.getFloat("cash_flow"));
+ historic.setBetaCashFlow(rs.getFloat("beta_cash_flow"));
+ historic.setLastTradeDate(rs.getTimestamp("last_trade_date"));
+ historic.setLastTradeQty(rs.getFloat("last_trade_qty"));
+ historic.setEnterpriseValue(rs.getFloat("enterprise_value"));
+ historic.setAssociate(rs.getString("associate"));
+ list.add(historic);
+ }
+ return list;
+ }
+ finally
+ {
+ if(null!=rs)rs.close();
+ if(null!=statement)statement.close();
+ }
+ }
+ private Connection getConnection()throws SQLException
+ {
+ try
+ {
+ InitialContext jndiCntx=new InitialContext();
+ DataSource ds=(DataSource)jndiCntx.lookup("java:DRMS")
+ jndiCntx.close();
+ return ds.getConnection();
+ }
+ catch(NamingException exception)
+ {
+ message("[getConnection] Object not found");
+ throw new EJBException(exception);
+ }
+ }
+};
diff --git a/ClassGen/Main.cpp b/ClassGen/Main.cpp
new file mode 100644
index 0000000..786c61a
--- /dev/null
+++ b/ClassGen/Main.cpp
@@ -0,0 +1,425 @@
+#include
+#include
+#include
+#include
+#include
+
+class ClassMapper
+{
+public:
+ ClassMapper();
+ virtual ~ClassMapper();
+ bool createClass(const String &language,const String &packageName,String className,const String &databaseName,const String &tableName,const String &strPathMapFile,const String &strPathTable);
+private:
+ bool loadMapping(const String &strPathMapFile);
+ bool mapType(const String &type,String &mapped);
+ bool createCSharpClass(const String &packageName,const String &className,Block &variables);
+ bool createCSharpDataAccess(const String &packageName,const String &className,const String &instanceName,const String &databaseName,const String &tableName,Block &variables,Block &originals);
+ bool createJAVAClass(const String &packageName,const String &className,Block &variables);
+ bool createJAVADataAccess(const String &packageName,const String &className,const String &instanceName,const String &databaseName,const String &tableName,Block &variables,Block &originals);
+
+ String makeHungarian(const String &name);
+ String makeAccessor(const String &name);
+ String makeMutator(const String &name);
+ String makeFirstUpper(const String &name);
+ String makeFirstLower(const String &name);
+ Block mNameValuePairs;
+};
+
+ClassMapper::ClassMapper()
+{
+}
+
+ClassMapper::~ClassMapper()
+{
+}
+
+bool ClassMapper::createClass(const String &language,const String &packageName,String className,const String &databaseName,const String &tableName,const String &strPathMapFile,const String &strPathTable)
+{
+ File inFile;
+ String strLine;
+ String name;
+ String value;
+ String instanceName;
+ Block variables;
+ Block originals;
+ int errors=0;
+
+ if(!loadMapping(strPathMapFile))return false;
+ if(!inFile.open(strPathTable,"rb"))return false;
+ while(true)
+ {
+ inFile.readLine(strLine);
+ if(strLine.isNull())break;
+ name=strLine.betweenString(0,' ');
+ value=strLine.betweenString(' ',' ');
+ if(!mapType(value,value))
+ {
+ printf("Don't know how to map %s\n",value.str());
+ errors++;
+ continue;
+ }
+ variables.insert(&NameValuePair(makeFirstLower(makeHungarian(name)),value));
+ originals.insert(&NameValuePair(name,value));
+ }
+ inFile.close();
+ if(errors)return false;
+ if(!variables.size())return false;
+ instanceName=makeFirstLower(className);
+ className=makeFirstUpper(className);
+ if(language=="JAVA")
+ {
+ createJAVAClass(packageName,className,variables);
+ createJAVADataAccess(packageName,className,instanceName,databaseName,tableName,variables,originals);\
+ }
+ else if(language=="C#")
+ {
+ createCSharpClass(packageName,className,variables);
+ createCSharpDataAccess(packageName,className,instanceName,databaseName,tableName,variables,originals);\
+ }
+ printf("generation completed.\n");
+ return true;
+}
+
+bool ClassMapper::createCSharpClass(const String &packageName,const String &className,Block &variables)
+{
+ File outFile;
+ bool closeNameSpace=false;
+
+ if(!outFile.open(className+String(".cs"),"wb"))return false;
+ outFile.writeLine("using System;");
+ outFile.writeLine("\t");
+ outFile.writeLine("\t");
+
+ if(!packageName.isNull())
+ {
+ outFile.writeLine(String("namespace ")+packageName);
+ outFile.writeLine("{");
+ closeNameSpace=true;
+ }
+ outFile.writeLine(" [Serializable]");
+ outFile.writeLine(String(" public class ")+className);
+ outFile.writeLine(" {");
+ for(int index=0;index &variables,Block &originals)
+{
+ File outFile;
+ String select;
+ bool closeNameSpace=false;
+
+ if(!outFile.open(className+String("DA")+String(".cs"),"wb"))return false;
+ outFile.writeLine("using System;");
+ outFile.writeLine("using System.Collections;");
+ outFile.writeLine("using System.Data.SqlClient;");
+ outFile.writeLine("\t");
+ if(!packageName.isNull())
+ {
+ outFile.writeLine(String("namespace ")+packageName);
+ outFile.writeLine("{");
+ closeNameSpace=true;
+ }
+ outFile.writeLine(String(" public class ")+className+String("DA"));
+ outFile.writeLine(" {");
+ outFile.writeLine(" public ArrayList readAll()");
+ outFile.writeLine(" {");
+ outFile.writeLine(" SqlConnection sqlConnection=null;");
+ outFile.writeLine(" SqlDataReader sqlDataReader=null;");
+ outFile.writeLine(" SqlCommand sqlCommand=null;");
+ outFile.writeLine(" try");
+ outFile.writeLine(" {");
+ outFile.writeLine(" ArrayList arrayList=new ArrayList();");
+ select=" string strQuery=\"select ";
+ for(int index=0;index &variables)
+{
+ File outFile;
+
+ if(!outFile.open(className+String(".java"),"wb"))return false;
+ if(!packageName.isNull())outFile.writeLine(String("package ")+packageName);
+ outFile.writeLine("\t");
+ outFile.writeLine("\t");
+ outFile.writeLine(String("public class ")+className);
+ outFile.writeLine("{");
+ for(int index=0;index &variables,Block &originals)
+{
+ File outFile;
+ String select;
+
+ if(!outFile.open(className+String("DA")+String(".java"),"wb"))return false;
+ if(!packageName.isNull())outFile.writeLine(String("package ")+packageName);
+ outFile.writeLine("import java.util.*;");
+ outFile.writeLine("import javax.naming.*;");
+ outFile.writeLine("import java.sql.*;");
+ outFile.writeLine("import javax.sql.*;");
+ outFile.writeLine("import javax.ejb.*");
+
+ outFile.writeLine("\t");
+ outFile.writeLine("\t");
+
+ outFile.writeLine(String("public class ")+className+String("DA"));
+ outFile.writeLine("{");
+ outFile.writeLine(" public List readAll()throws SQLException");
+ outFile.writeLine(" {");
+ outFile.writeLine(" Statement statement=null;");
+ outFile.writeLine(" ResultSet rs=null;");
+ outFile.writeLine(" Connection connection=null;");
+ outFile.writeLine(" String strQuery=null;");
+ outFile.writeLine(" List list=null;");
+ outFile.writeLine("\t");
+
+ outFile.writeLine(" try");
+ outFile.writeLine(" {");
+ outFile.writeLine(String(" ")+className+String(" ")+instanceName+String(" = new ")+className+String("();"));
+ outFile.writeLine(" connection=getConnection();");
+ outFile.writeLine(" statement=connection.createStatement();");
+ outFile.writeLine(" list=new ArrayList();");
+ select=" strQuery=\"select ";
+ for(int index=0;index=length)break;
+ index++;
+ ch=toupper(name.charAt(index));
+ hungarianName+=ch;
+ }
+ else hungarianName+=ch;
+ }
+ return hungarianName;
+}
+
+String ClassMapper::makeAccessor(const String &name)
+{
+ String str;
+
+ str+="get";
+ str+=toupper(name.charAt(0));
+ str+=name.substr(1);
+ return str;
+}
+
+String ClassMapper::makeMutator(const String &name)
+{
+ String str;
+
+ str+="set";
+ str+=toupper(name.charAt(0));
+ str+=name.substr(1);
+ return str;
+}
+
+String ClassMapper::makeFirstUpper(const String &name)
+{
+ String str;
+ str+=toupper(name.charAt(0));
+ str+=name.substr(1);
+ return str;
+}
+
+String ClassMapper::makeFirstLower(const String &name)
+{
+ String str;
+ str+=tolower(name.charAt(0));
+ str+=name.substr(1);
+ return str;
+}
+
+int main(int argc,char **argv)
+{
+ if(8!=argc)
+ {
+ printf("USAGE: mapclass \n");
+ printf("(ie) mapclass c# zbi.risk.server.vhi.mapped Historic DRMS dt_main_positions c:\\work\\classgen\\mapping.txt c:\\work\\classgen\\table.txt\n");
+ printf("where 'table.txt' contains lines of pairs...\n");
+ printf("trade_date smalldatetime 4 0\n\n");
+ printf("and 'mapping.txt' contains lines of pairs...\n");
+ printf("nvarchar=string\n");
+ printf("decimal=decimal\n");
+ return 0;
+ }
+ ClassMapper classMapper;
+ if(!classMapper.createClass(argv[1],argv[2],argv[3],argv[4],argv[5],argv[6],argv[7]))return 1;
+ return 0;
+}
+
+
diff --git a/ClassGen/NameValuePair.hpp b/ClassGen/NameValuePair.hpp
new file mode 100644
index 0000000..226e712
--- /dev/null
+++ b/ClassGen/NameValuePair.hpp
@@ -0,0 +1,72 @@
+#ifndef _PROTO_NAMEVALUE_HPP_
+#define _PROTO_NAMEVALUE_HPP_
+#ifndef _COMMON_STRING_HPP_
+#include
+#endif
+
+class NameValuePair
+{
+public:
+ NameValuePair();
+ NameValuePair(const String &name,const String &value);
+ const String &getName(void)const;
+ void setName(const String &name);
+ const String &getValue(void)const;
+ void setValue(const String &value);
+ bool fromString(const String &string);
+ String toString(void)const;
+private:
+ String mName;
+ String mValue;
+};
+
+inline
+NameValuePair::NameValuePair()
+{
+}
+
+inline
+NameValuePair::NameValuePair(const String &name,const String &value)
+: mName(name), mValue(value)
+{
+}
+
+inline
+const String &NameValuePair::getName(void)const
+{
+ return mName;
+}
+
+inline
+void NameValuePair::setName(const String &name)
+{
+ mName=name;
+}
+
+inline
+const String &NameValuePair::getValue(void)const
+{
+ return mValue;
+}
+
+inline
+void NameValuePair::setValue(const String &value)
+{
+ mValue=value;
+}
+
+inline
+bool NameValuePair::fromString(const String &string)
+{
+ if(string.isNull())return false;
+ mName=string.betweenString(0,'=');
+ mValue=string.betweenString('=',0);
+ return true;
+}
+
+inline
+String NameValuePair::toString(void)const
+{
+ return mName+String("=")+mValue;
+}
+#endif
diff --git a/ClassGen/classgen.dsp b/ClassGen/classgen.dsp
new file mode 100644
index 0000000..4ab6f39
--- /dev/null
+++ b/ClassGen/classgen.dsp
@@ -0,0 +1,101 @@
+# Microsoft Developer Studio Project File - Name="classgen" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=classgen - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "classgen.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "classgen.mak" CFG="classgen - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "classgen - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "classgen - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "classgen - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+
+!ELSEIF "$(CFG)" == "classgen - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /Gz /MTd /W1 /Gm /GX /ZI /Od /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /D "STRICT" /D "__FLAT__" /YX /FD /GZ /c
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "classgen - Win32 Release"
+# Name "classgen - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\Main.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# End Group
+# End Target
+# End Project
diff --git a/ClassGen/classgen.dsw b/ClassGen/classgen.dsw
new file mode 100644
index 0000000..d7f2cea
--- /dev/null
+++ b/ClassGen/classgen.dsw
@@ -0,0 +1,44 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "classgen"=.\classgen.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name common
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "common"=..\common\common.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/ClassGen/classgen.opt b/ClassGen/classgen.opt
new file mode 100644
index 0000000..8a15c1f
Binary files /dev/null and b/ClassGen/classgen.opt differ
diff --git a/ClassGen/classgen.plg b/ClassGen/classgen.plg
new file mode 100644
index 0000000..b709e6f
--- /dev/null
+++ b/ClassGen/classgen.plg
@@ -0,0 +1,33 @@
+
+
+
+Build Log
+
+--------------------Configuration: classgen - Win32 Debug--------------------
+
+Command Lines
+Creating temporary file "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP17B.tmp" with contents
+[
+/nologo /Gz /MTd /Gm /GX /ZI /Od /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "WIN32" /D "STRICT" /D "__FLAT__" /Fp"Debug/classgen.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"D:\work\ClassGen\Main.cpp"
+]
+Creating command line "cl.exe @C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP17B.tmp"
+Creating temporary file "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP17C.tmp" with contents
+[
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"Debug/classgen.pdb" /debug /machine:I386 /out:"Debug/classgen.exe" /pdbtype:sept
+.\Debug\Main.obj
+\work\exe\mscommon.lib
+]
+Creating command line "link.exe @C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP17C.tmp"
+Output Window
+Compiling...
+Main.cpp
+Linking...
+
+
+
+Results
+classgen.exe - 0 error(s), 0 warning(s)
+
+
+
diff --git a/ClassGen/historic.txt b/ClassGen/historic.txt
new file mode 100644
index 0000000..22dbfdd
--- /dev/null
+++ b/ClassGen/historic.txt
@@ -0,0 +1,103 @@
+trade_date smalldatetime 4 0
+trade_date_txt varchar 10 1
+portfolio varchar 30 0
+sub_portfolio varchar 30 0
+ticker varchar 25 0
+ticker_desc varchar 60 1
+uticker varchar 25 0
+instrument varchar 3 0
+contract_size decimal 9 1
+hedge_index varchar 4 1
+hedge_sector varchar 4 1
+area varchar 6 1
+area_sector varchar 6 1
+y_close decimal 9 1
+uticker_close decimal 9 1
+y_uticker_close decimal 9 1
+delta decimal 9 1
+y_delta decimal 9 1
+hedge_beta decimal 5 1
+area_beta decimal 5 1
+sector_beta decimal 5 1
+group_beta decimal 5 1
+qty decimal 9 0
+y_qty decimal 9 0
+qty_change decimal 9 1
+hedge_close decimal 9 1
+hedge_perc decimal 9 1
+area_close decimal 9 1
+area_perc decimal 9 1
+sector_close decimal 9 1
+sector_perc decimal 9 1
+mkt_value decimal 13 1
+y_mkt_value decimal 13 1
+exposure decimal 13 1
+y_exposure decimal 13 1
+hb_exposure decimal 13 1
+y_hb_exposure decimal 13 1
+ab_exposure decimal 13 1
+y_ab_exposure decimal 13 1
+sb_exposure decimal 13 1
+y_sb_exposure decimal 13 1
+pnl decimal 13 1
+pnl_perc decimal 13 1
+price_change decimal 13 1
+price_change_perc decimal 13 1
+price_change_amt decimal 13 1
+sector_alpha_perc decimal 13 1
+group_alpha_perc decimal 13 1
+area_alpha_perc decimal 13 1
+hedge_alpha_perc decimal 13 1
+area_pnl_amt decimal 13 1
+sector_pnl_amt decimal 13 1
+sector_alpha_amt decimal 13 1
+group_alpha_amt decimal 13 1
+area_alpha_amt decimal 13 1
+hedge_alpha_amt decimal 13 1
+ab_return_amt decimal 13 1
+ab_return_perc decimal 13 1
+alt_index_return_perc decimal 13 1
+alt_index_return_amt decimal 13 1
+index_beta_adj_perc decimal 13 1
+index_beta_adj_amt decimal 13 1
+intraday_perc decimal 13 1
+intraday_amt decimal 13 1
+optionality_perc decimal 13 1
+optionality_amt decimal 13 1
+currency varchar 5 1
+base_close decimal 9 1
+y_base_close decimal 9 1
+fx_perc decimal 9 1
+fx_amt decimal 9 1
+fx_rate decimal 9 1
+y_fx_rate decimal 9 1
+exposure_view varchar 5 1
+market_view varchar 5 0
+call_put varchar 4 1
+days_expire int 4 1
+strike_price decimal 9 1
+associate nvarchar 30 1
+ipo bit 1 1
+ratio decimal 9 1
+exported bit 1 0
+source varchar 10 1
+vwap decimal 13 1
+vwap_pnl decimal 13 1
+adh decimal 13 1
+aac decimal 13 1
+azap decimal 13 1
+go_around smalldatetime 4 1
+alpha_go_around decimal 13 1
+alpha_real decimal 13 1
+alpha_unreal decimal 13 1
+pnl_real decimal 13 1
+pnl_unreal decimal 13 1
+cash_flow decimal 13 1
+beta_cash_flow decimal 13 1
+last_trade_date smalldatetime 4 1
+last_trade_qty decimal 9 1
+enterprise_value decimal 13 1
+mkt_cap decimal 13 1
+wgt_ave decimal 9 1
+volume decimal 13 1
+RowID bigint 8 0
\ No newline at end of file
diff --git a/ClassGen/mapping.txt b/ClassGen/mapping.txt
new file mode 100644
index 0000000..3e9ba4b
--- /dev/null
+++ b/ClassGen/mapping.txt
@@ -0,0 +1,8 @@
+nvarchar=string
+decimal=decimal
+float=float
+varchar=string
+smalldatetime=DateTime
+int=int
+bit=bool
+bigint=long
diff --git a/ClassGen/scraps.txt b/ClassGen/scraps.txt
new file mode 100644
index 0000000..c8a284a
--- /dev/null
+++ b/ClassGen/scraps.txt
@@ -0,0 +1,25 @@
+/*
+bool ClassMapper::createResultClass(const String &packageName,const String &className,const String &instanceName,Block &variables,Block &originals)
+{
+ File outFile;
+
+ if(!outFile.open(className+String("RS")+String(".java"),"wb"))return false;
+ if(!packageName.isNull())outFile.writeLine(String("package ")+packageName);
+ outFile.writeLine("\t");
+ outFile.writeLine("\t");
+ outFile.writeLine("public void processResult()");
+ outFile.writeLine("{");
+ outFile.writeLine(String(" ")+className+String(" ")+instanceName+String(";"));
+ outFile.writeLine(" ResultSet rs;");
+ outFile.writeLine("// fill in the blanks");
+ for(int index=0;index
+#include
+#include
+#include
+#include
+
+int PASCAL WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpszCmdLine,int nCmdShow)
+{
+ SplashScreen splashScreen("SPLASH",String(STRING_SPLASHURL),String(STRING_APPNAME)+String(" ")+String(STRING_VERSION));
+ splashScreen.perform();
+ DiveDlg diveDlg;
+ diveDlg.perform();
+ return false;
+}
diff --git a/aladin/RCa00848 b/aladin/RCa00848
new file mode 100644
index 0000000..6d8219d
Binary files /dev/null and b/aladin/RCa00848 differ
diff --git a/aladin/RDa00848 b/aladin/RDa00848
new file mode 100644
index 0000000..e69de29
diff --git a/aladin/aladin.aps b/aladin/aladin.aps
new file mode 100644
index 0000000..6619f50
Binary files /dev/null and b/aladin/aladin.aps differ
diff --git a/aladin/aladin.bmp b/aladin/aladin.bmp
new file mode 100644
index 0000000..9010571
Binary files /dev/null and b/aladin/aladin.bmp differ
diff --git a/aladin/aladin.cpp b/aladin/aladin.cpp
new file mode 100644
index 0000000..8fffb0e
--- /dev/null
+++ b/aladin/aladin.cpp
@@ -0,0 +1,293 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+Aladin::Aladin()
+: mIsOkay(false)
+{
+ mRawData.size(2046);
+}
+
+Aladin::~Aladin()
+{
+}
+
+bool Aladin::openRaw(const String &strPathFileName)
+{
+ BYTE header[4];
+ FileHandle inFile;
+
+ if(!inFile.open(strPathFileName,FileHandle::Read,FileHandle::ShareRead,FileHandle::Open,FileHandle::Normal))return false;
+ if(inFile.size()!=mRawData.size()+sizeof(header))return false;
+ if(!inFile.read(header,sizeof(header)))return false;
+ if(::memcmp(header,"UUU\0",sizeof(header)))return false;
+ if(!inFile.read(&mRawData[0],mRawData.size()))return false;
+ mIsOkay=readRaw(mRawData);
+ return mIsOkay;
+}
+
+bool Aladin::openLog(const String &strPathFileName)
+{
+ File inFile;
+ char header[]={'L','O','G','1'};
+ char rdHeader[sizeof(header)];
+
+ if(!inFile.open(strPathFileName,"rb"))return false;
+ if(!inFile.read(&rdHeader,sizeof(rdHeader)))return false;
+ if(::memcmp(rdHeader,header,sizeof(rdHeader)))return false;
+ if(!mStatus.readFrom(inFile))return false;
+ if(!mInformation.readFrom(inFile))return false;
+ if(!mLogBook.readFrom(inFile))return false;
+ if(!mProfiles.readFrom(inFile))return false;
+ inFile.close();
+ mIsOkay=true;
+ return true;
+}
+
+bool Aladin::openDevice(const String &port,GUIWindow &parent)
+{
+ DeviceControlBlock dcb;
+ CommControl control;
+ String strCommState;
+ AppReg appReg;
+ Block iconNames;
+
+ mIsOkay=false;
+ if(IDCANCEL==::MessageBox(parent,"Place computer in Log Book mode and press OK to continue.","Prompt",MB_OKCANCEL))return false;
+ if(port.isNull())return false;
+ if(!control.open(CommControl::stringToPort(port)))return false;
+ strCommState+=String("baud=")+appReg.getBaud()+String(" ");
+ strCommState+=String("parity=")+appReg.getParity()+String(" ");
+ strCommState+=String("data=")+appReg.getDataBits()+String(" ");
+ strCommState+=String("stop=")+appReg.getStopBits()+String(" ");
+ control.setDeviceControlBlock(strCommState);
+ control.getDeviceControlBlock(dcb);
+ dcb.dtrControl(DeviceControlBlock::DtrControlEnable);
+ dcb.rtsControl(DeviceControlBlock::RtsControlDisable);
+ control.setDeviceControlBlock(dcb);
+
+ iconNames.insert(&String("ASM1"));
+ iconNames.insert(&String("ASM2"));
+ iconNames.insert(&String("ASM3"));
+ iconNames.insert(&String("ASM4"));
+ iconNames.insert(&String("ASM5"));
+ iconNames.insert(&String("ASM6"));
+ iconNames.insert(&String("ASM7"));
+ iconNames.insert(&String("ASM8"));
+ iconNames.insert(&String("ASM9"));
+ iconNames.insert(&String("ASM10"));
+ Progress progress(parent,"Sync..., (Press ESC to cancel)",iconNames);
+ progress.range(3);
+ progress.canCancel(true);
+ progress.show(true);
+ progress.setText("Performing sync-point on device...");
+ progress++;
+ while(!(mIsOkay=getControlData(control,progress)))
+ {
+ progress.setText("Performing sync-point on device...");
+ progress.yieldTask();
+ parent.update();
+ if(!progress.isOkay())break;
+ progress.reset();
+ progress.range(3);
+ progress++;
+ }
+ progress.destroy();
+ ::MessageBeep(0);
+ ::MessageBox(parent,"Please disconnect the device","Acquisition",MB_OK);
+ dcb.dtrControl(DeviceControlBlock::DtrControlDisable);
+ dcb.rtsControl(DeviceControlBlock::RtsControlDisable);
+ control.setDeviceControlBlock(dcb);
+ control.close();
+ if(mIsOkay)return mIsOkay=readRaw(mRawData);
+ ::MessageBox(parent,"Capture Failed","Acquisition",MB_OK);
+ return mIsOkay;
+}
+
+bool Aladin::saveRaw(const String &strPathFileName)
+{
+ char header[]={'U','U','U','\0'};
+ File outFile;
+ if(!outFile.open(strPathFileName,"wb"))return false;
+ if(!outFile.write(header,sizeof(header)))return false;
+ if(!outFile.write(&mRawData[0],mRawData.size()))return false;
+ return true;
+}
+
+bool Aladin::saveText(const String &strPathFileName)
+{
+ File outFile;
+
+ if(!outFile.open(strPathFileName,"wb"))return false;
+ outFile.writeLine("Entry Time Max Depth Bottom Time Surface Time Temperature (C)");
+ outFile.writeLine("-----------------------------------------------------------------------");
+ for(int index=0;index&)mProfiles)[pIndex];
+ outFile.writeLine(" ");
+ outFile.writeLine(" ");
+ outFile.writeLine(String("Profile_")+String().fromInt(pIndex+1));
+ outFile.writeLine("Time Depth");
+ for(int diveIndex=0;diveIndex &body)
+{
+ if(!mStatus.readFrom(body))return false;
+ if(!mInformation.readFrom(body))return false;
+ if(!mProfiles.readFrom(body,mInformation,mStatus))return false;
+ if(!mLogBook.readFrom(body,mStatus))return false;
+ return true;
+}
+
+void Aladin::addDiveLog(Worksheet &worksheet,const LogBook &logBook,int startRow,int startCol)
+{
+ worksheet.setAt(startRow,startCol+(5/2),"DiveLog");
+ worksheet.setAt(startRow,startCol,"Entry Time");
+ worksheet.setAt(startRow,startCol+1,"Max Depth");
+ worksheet.setAt(startRow,startCol+2,"Bottom Time");
+ worksheet.setAt(startRow,startCol+3,"Surface Time");
+ worksheet.setAt(startRow,startCol+4,"Temperature");
+ for(int index=0;index&)profiles)[pIndex];
+ sRow=startRow;
+ String strTitle(String("Profile_")+String().fromInt(pIndex+1));
+ worksheet.setAt(sRow++,startCol,strTitle);
+ worksheet.setAt(sRow,startCol,"Time");
+ worksheet.setAt(sRow++,startCol+1,"Depth");
+ for(int diveIndex=0;diveIndex
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Application" 0x0101
+
+CFG=aladin - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "aladin.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "aladin.mak" CFG="aladin - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "aladin - Win32 Release" (based on "Win32 (x86) Application")
+!MESSAGE "aladin - Win32 Debug" (based on "Win32 (x86) Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "aladin - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "NDEBUG"
+# ADD RSC /l 0x409 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
+
+!ELSEIF "$(CFG)" == "aladin - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "STRICT" /D "__FLAT__" /FR /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x409 /d "_DEBUG"
+# ADD RSC /l 0x409 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib comctl32.lib winmm.lib wsock32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
+# SUBTRACT LINK32 /incremental:no
+
+!ENDIF
+
+# Begin Target
+
+# Name "aladin - Win32 Release"
+# Name "aladin - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\aladin.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\appreg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\divedlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\divelog.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\diveprofile.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\graph.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\information.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\logbook.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Main.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\profiles.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\serdlg.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\splash.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\status.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\aladin.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\appicon.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM1.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM10.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM2.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM3.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM4.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM5.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM6.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM7.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM8.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\ASM9.ICO
+# End Source File
+# Begin Source File
+
+SOURCE=.\flag.ico
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/aladin/aladin.dsw b/aladin/aladin.dsw
new file mode 100644
index 0000000..494a428
--- /dev/null
+++ b/aladin/aladin.dsw
@@ -0,0 +1,194 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "aladin"=.\aladin.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+ Begin Project Dependency
+ Project_Dep_Name common
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name statbar
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name commctrl
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name thread
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name worksht
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name fileio
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name engine
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name bsptree
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name jpgimg
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name socket
+ End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name jpeg6b
+ End Project Dependency
+}}}
+
+###############################################################################
+
+Project: "bsptree"=..\bsptree\bsptree.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "commctrl"=..\commctrl\commctrl.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "common"=..\common\common.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "engine"=..\engine\engine.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "fileio"=..\fileio\fileio.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "jpeg6b"="..\..\parts\jpeg-6b\jpeg6b.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "jpgimg"=..\jpgimg\jpgimg.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "socket"=..\socket\socket.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "statbar"=..\statbar\Statbar.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "thread"=..\thread\thread.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Project: "worksht"=..\worksht\WORKSHT.DSP - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/aladin/aladin.h b/aladin/aladin.h
new file mode 100644
index 0000000..b0051a6
--- /dev/null
+++ b/aladin/aladin.h
@@ -0,0 +1,90 @@
+#ifndef _ALADIN_ALADIN_H_
+#define _ALADIN_ALADIN_H_
+#endif
+
+#define IDC_STATIC -1
+
+// MENU DEFINES
+#define APPMENU_FILE_EXIT 10000
+#define APPMENU_FILE_OPENDEVICE 10001
+#define APPMENU_FILE_OPENLOG 10002
+#define APPMENU_FILE_IMPORT 10003
+#define APPMENU_FILE_NEW 10004
+
+#define APPMENU_FILE_SAVEWORKSHEET 10010
+#define APPMENU_FILE_SAVERAW 10011
+#define APPMENU_FILE_SAVETEXT 10012
+#define APPMENU_FILE_SAVE 10013
+#define APPMENU_FILE_SAVEGRAPH 10014
+
+#define APPMENU_SETTINGS_SERIAL 10020
+
+#define APPMENU_HELP_ABOUT 10030
+#define APPMENU_HELP_REGISTER 10031
+#define APPMENU_HELP_HOME 10032
+#define APPMENU_HELP_HELP 10033
+#define APPMENU_HELP_INTERFACES 10034
+
+// DIALOG DEFINES
+#define DB_NITROX 1000
+#define DB_O2 1001
+#define DB_COMPUTER 1002
+#define DB_STANDARD 1006
+#define DB_BATTERY 1007
+#define DB_LOGLIST 1008
+#define DB_PFLIST 1009
+#define DB_IMPORT 1010
+#define DB_PROFILES 1011
+#define DB_GRAPH 1012
+#define DB_PFBOTTOMTIME 1013
+#define DB_PFMAXDEPTH 1014
+
+#define STRING_ALADINKEYNAME 600
+#define STRING_HISTORYKEYNAME 601
+#define STRING_SETTINGSKEYNAME 602
+#define STRING_SERIALKEYNAME 603
+#define STRING_HISTORYKEYSHORTNAME 604
+#define STRING_SETTINGSEMAIL 605
+#define STRING_SERIALPORT 606
+#define STRING_SERIALBAUD 607
+#define STRING_SERIALDATA 608
+#define STRING_SERIALPARITY 609
+#define STRING_SERIALSTOP 610
+#define STRING_COM1 611
+#define STRING_COM2 612
+#define STRING_COM3 613
+#define STRING_COM4 614
+#define STRING_VERSION 615
+#define STRING_APPNAME 616
+#define STRING_HOMEPAGE 617
+#define STRING_REGISTERPAGE 618
+#define STRING_HELPPAGE 619
+#define STRING_BROWSERKEY 620
+#define STRING_BROWSERKEYALT 621
+#define STRING_BROWSERCOMMAND 622
+#define STRING_SPLASHURL 623
+#define STRING_HOST 624
+#define STRING_LINKURL 625
+
+#define STRING_CURRENTVERSIONKEYNAME 700
+#define STRING_CURRENTVERSIONNTKEYNAME 701
+#define STRING_PRODUCTNAME 702
+#define STRING_REGISTEREDOWNER 703
+#define STRING_PRODUCTID 704
+#define STRING_VERSIONNUMBER 705
+
+
+
+
+// SERIAL DIALOG
+#define SERIAL_STOP 104
+#define SERIAL_PARITY 105
+#define SERIAL_APPLY 106
+#define SERIAL_DATA 103
+#define SERIAL_BAUD 102
+#define SERIAL_PORT 101
+#define SERIAL_RESET 107
+
+
+
+
diff --git a/aladin/aladin.hpp b/aladin/aladin.hpp
new file mode 100644
index 0000000..73390ba
--- /dev/null
+++ b/aladin/aladin.hpp
@@ -0,0 +1,72 @@
+#ifndef _ALADIN_ALADIN_HPP_
+#define _ALADIN_ALADIN_HPP_
+#ifndef _PROTO_STATUS_HPP_
+#include
+#endif
+#ifndef _ALADIN_INFORMATION_HPP_
+#include
+#endif
+#ifndef _ALADIN_PROFILES_HPP_
+#include
+#endif
+#ifndef _ALADIN_PROFILEDATA_HPP_
+#include
+#endif
+#ifndef _ALADIN_LOGBOOK_HPP_
+#include
+#endif
+#ifndef _ALADIN_RAWDATA_HPP_
+#include
+#endif
+
+class CommControl;
+class GUIWindow;
+class Progress;
+class Worksheet;
+
+class Aladin
+{
+public:
+ Aladin();
+ virtual ~Aladin();
+ bool openRaw(const String &strPathFileName);
+ bool openDevice(const String &port,GUIWindow &parent);
+ bool openLog(const String &pathFileName);
+ bool saveRaw(const String &strPathFileName);
+ bool saveWorksheet(const String &strPathFileName);
+ bool saveText(const String &strPathFileName);
+ bool saveLog(const String &strPathFileName);
+ const CurrentStatus &getStatus(void)const;
+ const Information &getInformation(void)const;
+ const Profiles &getProfile(void)const;
+ const LogBook &getLogBook(void)const;
+ void clear(void);
+ bool isOkay(void)const;
+private:
+ bool readRaw(Array &body);
+ bool getControlData(CommControl &control,Progress &progress);
+ void addProfile(Worksheet &worksheet,const Profiles &profiles,int startRow,int startCol);
+ void addDiveLog(Worksheet &worksheet,const LogBook &logBook,int startRow,int startCol);
+
+ CurrentStatus mStatus;
+ Information mInformation;
+ Profiles mProfiles;
+ LogBook mLogBook;
+ RawData mRawData;
+ bool mIsOkay;
+};
+
+inline
+bool Aladin::isOkay(void)const
+{
+ return mIsOkay;
+}
+
+inline
+void Aladin::clear(void)
+{
+ mProfiles.remove();
+ mLogBook.remove();
+ mIsOkay=false;
+}
+#endif
\ No newline at end of file
diff --git a/aladin/aladin.ncb b/aladin/aladin.ncb
new file mode 100644
index 0000000..d10336a
Binary files /dev/null and b/aladin/aladin.ncb differ
diff --git a/aladin/aladin.opt b/aladin/aladin.opt
new file mode 100644
index 0000000..1213ee8
Binary files /dev/null and b/aladin/aladin.opt differ
diff --git a/aladin/aladin.plg b/aladin/aladin.plg
new file mode 100644
index 0000000..baad13d
--- /dev/null
+++ b/aladin/aladin.plg
@@ -0,0 +1,101 @@
+
+
+
+Build Log
+
+--------------------Configuration: aladin - Win32 Debug--------------------
+
+Command Lines
+Creating temporary file "C:\DOCUME~1\TERNET~1\LOCALS~1\Temp\RSP23A.tmp" with contents
+[
+/nologo /MTd /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "STRICT" /D "__FLAT__" /FR"Debug/" /Fp"Debug/aladin.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"F:\work\aladin\aladin.cpp"
+"F:\work\aladin\appreg.cpp"
+"F:\work\aladin\divedlg.cpp"
+"F:\work\aladin\divelog.cpp"
+"F:\work\aladin\diveprofile.cpp"
+"F:\work\aladin\graph.cpp"
+"F:\work\aladin\information.cpp"
+"F:\work\aladin\logbook.cpp"
+"F:\work\aladin\Main.cpp"
+"F:\work\aladin\profiles.cpp"
+"F:\work\aladin\serdlg.cpp"
+"F:\work\aladin\splash.cpp"
+"F:\work\aladin\status.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\TERNET~1\LOCALS~1\Temp\RSP23A.tmp"
+Output Window
+Compiling...
+aladin.cpp
+appreg.cpp
+divedlg.cpp
+divelog.cpp
+diveprofile.cpp
+graph.cpp
+information.cpp
+logbook.cpp
+Main.cpp
+profiles.cpp
+serdlg.cpp
+splash.cpp
+status.cpp
+Creating temporary file "C:\DOCUME~1\TERNET~1\LOCALS~1\Temp\RSP23B.tmp" with contents
+[
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib comctl32.lib winmm.lib wsock32.lib /nologo /subsystem:windows /incremental:yes /pdb:"Debug/aladin.pdb" /debug /machine:I386 /out:"Debug/aladin.exe" /pdbtype:sept
+.\Debug\aladin.obj
+.\Debug\appreg.obj
+.\Debug\divedlg.obj
+.\Debug\divelog.obj
+.\Debug\diveprofile.obj
+.\Debug\graph.obj
+.\Debug\information.obj
+.\Debug\logbook.obj
+.\Debug\Main.obj
+.\Debug\profiles.obj
+.\Debug\serdlg.obj
+.\Debug\splash.obj
+.\Debug\status.obj
+.\Debug\aladin.res
+\work\exe\mscommon.lib
+\work\exe\statbar.lib
+\work\commctrl\Debug\commctrl.lib
+\work\exe\msthread.lib
+\work\exe\worksht.lib
+\work\exe\msfileio.lib
+\work\exe\msengine.lib
+\work\exe\msbsp.lib
+\work\exe\jpgimg.lib
+\work\exe\mssocket.lib
+"\parts\jpeg-6b\lib\jpeg6b.lib"
+]
+Creating command line "link.exe @C:\DOCUME~1\TERNET~1\LOCALS~1\Temp\RSP23B.tmp"
+Output Window
+Linking...
+ Creating library Debug/aladin.lib and object Debug/aladin.exp
+Creating temporary file "C:\DOCUME~1\TERNET~1\LOCALS~1\Temp\RSP23F.tmp" with contents
+[
+/nologo /o"Debug/aladin.bsc"
+.\Debug\aladin.sbr
+.\Debug\appreg.sbr
+.\Debug\divedlg.sbr
+.\Debug\divelog.sbr
+.\Debug\diveprofile.sbr
+.\Debug\graph.sbr
+.\Debug\information.sbr
+.\Debug\logbook.sbr
+.\Debug\Main.sbr
+.\Debug\profiles.sbr
+.\Debug\serdlg.sbr
+.\Debug\splash.sbr
+.\Debug\status.sbr]
+Creating command line "bscmake.exe @C:\DOCUME~1\TERNET~1\LOCALS~1\Temp\RSP23F.tmp"
+Creating browse info file...
+Output Window
+
+
+
+Results
+aladin.exe - 0 error(s), 0 warning(s)
+
+
+
diff --git a/aladin/aladin.rc b/aladin/aladin.rc
new file mode 100644
index 0000000..1707ee8
--- /dev/null
+++ b/aladin/aladin.rc
@@ -0,0 +1,289 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+#include "aladin.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+APPICON ICON DISCARDABLE "APPICON.ICO"
+ASM1 ICON DISCARDABLE "ASM1.ICO"
+ASM2 ICON DISCARDABLE "ASM2.ICO"
+ASM3 ICON DISCARDABLE "ASM3.ICO"
+ASM4 ICON DISCARDABLE "ASM4.ICO"
+ASM5 ICON DISCARDABLE "ASM5.ICO"
+ASM6 ICON DISCARDABLE "ASM6.ICO"
+ASM7 ICON DISCARDABLE "ASM7.ICO"
+ASM8 ICON DISCARDABLE "ASM8.ICO"
+ASM9 ICON DISCARDABLE "ASM9.ICO"
+ASM10 ICON DISCARDABLE "ASM10.ICO"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+SPLASH BITMAP MOVEABLE PURE "ALADIN2.BMP"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+MAINMENU MENU DISCARDABLE
+BEGIN
+ POPUP "&File"
+ BEGIN
+ MENUITEM "&New...", APPMENU_FILE_NEW
+ MENUITEM "&Open Log", APPMENU_FILE_OPENLOG
+ MENUITEM "Open &Device", APPMENU_FILE_OPENDEVICE
+ MENUITEM SEPARATOR
+ MENUITEM "&Import Raw File...", APPMENU_FILE_IMPORT
+ MENUITEM SEPARATOR
+ MENUITEM "&Save...", APPMENU_FILE_SAVE
+ MENUITEM "Save As (.&wk1)...", APPMENU_FILE_SAVEWORKSHEET
+ MENUITEM "Save As &Raw...", APPMENU_FILE_SAVERAW
+ MENUITEM "Save As &Text...", APPMENU_FILE_SAVETEXT
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", APPMENU_FILE_EXIT
+ END
+ POPUP "&Settings"
+ BEGIN
+ MENUITEM "&Serial...", APPMENU_SETTINGS_SERIAL
+ END
+ POPUP "&Help"
+ BEGIN
+ MENUITEM "&Help...", APPMENU_HELP_HELP
+ MENUITEM "H&ome...", APPMENU_HELP_HOME
+ MENUITEM "&Registration...", APPMENU_HELP_REGISTER
+ MENUITEM SEPARATOR
+ MENUITEM "&About...", APPMENU_HELP_ABOUT
+ MENUITEM "About &interfaces...", APPMENU_HELP_INTERFACES
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+SERIAL DIALOG DISCARDABLE 6, 15, 207, 111
+STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION |
+ WS_SYSMENU
+CAPTION "Serial Setup"
+FONT 6, "MS Sans Serif"
+BEGIN
+ DEFPUSHBUTTON "OK",IDOK,153,3,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,153,18,50,14
+ PUSHBUTTON "Reset",SERIAL_RESET,153,32,50,14
+ COMBOBOX SERIAL_BAUD,30,24,49,50,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ COMBOBOX SERIAL_DATA,30,37,49,50,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ COMBOBOX SERIAL_PARITY,30,63,49,50,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ COMBOBOX SERIAL_PORT,30,11,49,50,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "Port:",-1,3,14,18,8
+ LTEXT "Baud:",-1,3,27,21,8
+ LTEXT "Data:",-1,3,40,20,8
+ LTEXT "Stop:",-1,4,53,19,8
+ LTEXT "Parity:",-1,3,65,19,8
+ COMBOBOX SERIAL_STOP,30,50,49,50,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ PUSHBUTTON "Apply",SERIAL_APPLY,153,46,50,14
+END
+
+DIVEBOOK DIALOG DISCARDABLE 0, 0, 347, 226
+STYLE DS_MODALFRAME | DS_3DLOOK | WS_MINIMIZEBOX | WS_POPUP | WS_VISIBLE |
+ WS_CAPTION | WS_SYSMENU
+CAPTION "DiveBook"
+MENU MAINMENU
+FONT 8, "MS Sans Serif"
+BEGIN
+ CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,1,1,364,1
+ LTEXT "Computer:",IDC_STATIC,5,7,33,8
+ CONTROL "Nitrox",DB_NITROX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 215,6,34,10
+ CONTROL "O2",DB_O2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,215,18,
+ 25,10
+ EDITTEXT DB_COMPUTER,42,4,136,14,ES_AUTOHSCROLL | ES_READONLY
+ LISTBOX DB_LOGLIST,3,126,336,94,LBS_OWNERDRAWFIXED |
+ LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "Standard:",IDC_STATIC,116,24,32,8
+ EDITTEXT DB_STANDARD,154,22,40,14,ES_AUTOHSCROLL | ES_READONLY
+ LTEXT "Remaining Battery:",IDC_STATIC,5,24,60,8
+ EDITTEXT DB_BATTERY,69,22,40,14,ES_AUTOHSCROLL | ES_READONLY
+ CTEXT "Date",IDC_STATIC,10,113,66,11,SS_CENTERIMAGE
+ CTEXT "Max Depth (ft.)",IDC_STATIC,110,113,55,11
+ CTEXT "Bottom Time (mins.)",IDC_STATIC,172,113,63,11
+ LTEXT "Interval (hh:mm)",IDC_STATIC,242,113,53,11
+ COMBOBOX DB_PROFILES,4,60,61,48,CBS_DROPDOWNLIST | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ LISTBOX DB_PFLIST,69,60,108,48,LBS_OWNERDRAWFIXED |
+ LBS_HASSTRINGS | LBS_USETABSTOPS | LBS_NOINTEGRALHEIGHT |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "Dive Profiles",IDC_STATIC,12,47,48,8
+ LTEXT "Time (secs.)",IDC_STATIC,75,50,39,8
+ LTEXT "Depth (ft.)",IDC_STATIC,128,50,32,8
+ LTEXT "Temp (C)",IDC_STATIC,297,113,30,8
+ CONTROL "",DB_GRAPH,"Button",BS_OWNERDRAW | BS_BITMAP |
+ WS_TABSTOP,189,45,141,63
+ LTEXT "Max Depth:",IDC_STATIC,3,76,38,8
+ LTEXT "Bottom Time:",IDC_STATIC,3,90,42,8
+ EDITTEXT DB_PFBOTTOMTIME,47,88,20,14,ES_AUTOHSCROLL | ES_READONLY
+ EDITTEXT DB_PFMAXDEPTH,47,74,19,14,ES_AUTOHSCROLL | ES_READONLY
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""windows.h""\r\n"
+ "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+ "#include ""aladin.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ "SERIAL", DIALOG
+ BEGIN
+ RIGHTMARGIN, 203
+ END
+
+ "DIVEBOOK", DIALOG
+ BEGIN
+ RIGHTMARGIN, 342
+ BOTTOMMARGIN, 193
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ STRING_ALADINKEYNAME "Software\\Diversified\\Aladin"
+ STRING_HISTORYKEYNAME "Software\\Diversified\\Aladin\\History"
+ STRING_SERIALKEYNAME "Software\\Diversified\\Aladin\\Serial"
+ STRING_HISTORYKEYSHORTNAME "History"
+ STRING_SETTINGSEMAIL "EMAIL"
+ STRING_SERIALPORT "Port"
+ STRING_SERIALBAUD "Baud"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ STRING_HOST "http://www.diversified-software.com"
+ STRING_LINKURL "http://www.tele.ucl.ac.be/PEOPLE/DOUXCHAMPS/aladin/english/home.html"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ STRING_SERIALDATA "Data"
+ STRING_SERIALPARITY "Parity"
+ STRING_SERIALSTOP "Stop"
+ STRING_COM1 "COM1"
+ STRING_COM2 "COM2"
+ STRING_COM3 "COM3"
+ STRING_COM4 "COM4"
+ STRING_VERSION "v1.02"
+ STRING_APPNAME "Aladin"
+ STRING_HOMEPAGE "/DivePlanner/DivePlanner.html"
+ STRING_REGISTERPAGE "/DivePlanner/Aladin/Register.html"
+ STRING_HELPPAGE "/DivePlanner/Aladin/Help.html"
+ STRING_BROWSERKEY "Software\\Classes\\htmlfile\\shell\\opennew\\command"
+ STRING_BROWSERKEYALT "SOFTWARE\\Classes\\http\\shell\\open\\command"
+ STRING_BROWSERCOMMAND "command"
+ STRING_SPLASHURL "http://www.diversified-software.com"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ STRING_CURRENTVERSIONKEYNAME
+ "Software\\Microsoft\\Windows\\CurrentVersion"
+ STRING_CURRENTVERSIONNTKEYNAME
+ "Software\\Microsoft\\Windows NT\\CurrentVersion"
+ STRING_PRODUCTNAME "ProductName"
+ STRING_REGISTEREDOWNER "RegisteredOwner"
+END
+
+STRINGTABLE DISCARDABLE
+BEGIN
+ STRING_PRODUCTID "ProductId"
+ STRING_VERSIONNUMBER "VersionNumber"
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/aladin/aladin2.bmp b/aladin/aladin2.bmp
new file mode 100644
index 0000000..1049613
Binary files /dev/null and b/aladin/aladin2.bmp differ
diff --git a/aladin/aladinrc.hpp b/aladin/aladinrc.hpp
new file mode 100644
index 0000000..c495d29
--- /dev/null
+++ b/aladin/aladinrc.hpp
@@ -0,0 +1,6 @@
+#ifndef _ALADIN_ALADINRC_HPP_
+#define _ALADIN_ALADINRC_HPP_
+#ifndef _ALADIN_ALADIN_H_
+#include
+#endif
+#endif
diff --git a/aladin/appicon.ico b/aladin/appicon.ico
new file mode 100644
index 0000000..ac6311c
Binary files /dev/null and b/aladin/appicon.ico differ
diff --git a/aladin/appreg.cpp b/aladin/appreg.cpp
new file mode 100644
index 0000000..94fa338
--- /dev/null
+++ b/aladin/appreg.cpp
@@ -0,0 +1,195 @@
+#include
+#include
+
+AppReg::AppReg(void)
+: mAladinKeyName(STRING_ALADINKEYNAME),
+ mSerialKeyName(STRING_SERIALKEYNAME),
+ mSettingsEMAIL(STRING_SETTINGSEMAIL),
+ mSerialPort(STRING_SERIALPORT),
+ mSerialBaud(STRING_SERIALBAUD),
+ mSerialData(STRING_SERIALDATA),
+ mSerialParity(STRING_SERIALPARITY),
+ mSerialStop(STRING_SERIALSTOP),
+ mHistoryKeyName(STRING_HISTORYKEYNAME),
+ mHistoryKeyShortName(STRING_HISTORYKEYSHORTNAME),
+ mRegKeySerial(RegKey::CurrentUser)
+{
+ guarantee();
+ cacheHistory();
+}
+
+AppReg::AppReg(const AppReg &someAppReg)
+: mAladinKeyName(STRING_ALADINKEYNAME),
+ mSerialKeyName(STRING_SERIALKEYNAME),
+ mSettingsEMAIL(STRING_SETTINGSEMAIL),
+ mSerialPort(STRING_SERIALPORT),
+ mSerialBaud(STRING_SERIALBAUD),
+ mSerialData(STRING_SERIALDATA),
+ mSerialParity(STRING_SERIALPARITY),
+ mSerialStop(STRING_SERIALSTOP),
+ mRegKeySerial(RegKey::CurrentUser)
+{
+ *this=someAppReg;
+}
+
+AppReg::~AppReg()
+{
+}
+
+AppReg &AppReg::operator=(const AppReg &/*someAppReg*/)
+{
+ return *this;
+}
+
+bool AppReg::getHistory(Block &nameList)
+{
+ nameList=mCachedNames;
+ return nameList.size()?true:false;
+}
+
+bool AppReg::setHistory(Block &nameList)
+{
+ RegKey regKey(RegKey::CurrentUser);
+ mRegKeyHistory.closeKey();
+ regKey.openKey(String(STRING_ALADINKEYNAME));
+ regKey.deleteKey(mHistoryKeyShortName);
+ regKey.closeKey();
+ mRegKeyHistory.createKey(mHistoryKeyName,"");
+ mRegKeyHistory.openKey(mHistoryKeyName);
+ for(int itemIndex=0;itemIndexMaxCachedNames)
+ {
+ Block mruCachedNames;
+ for(int itemIndex=0;itemIndex deviceList;
+
+ commControl.enumerateDevices(deviceList);
+ mRegKeySerial.createKey(mSerialKeyName,"");
+ mRegKeySerial.openKey(mSerialKeyName);
+ setBaud("19200");
+ setParity("N");
+ setDataBits("8");
+ setStopBits("1");
+ setPort(deviceList.size()?deviceList[0]:"COM1");
+ }
+ if(!mRegKeyHistory.openKey(mHistoryKeyName))
+ {
+ mRegKeyHistory.createKey(mHistoryKeyName,"");
+ mRegKeyHistory.openKey(mHistoryKeyName);
+ }
+}
+
+BOOL AppReg::isOkay(void)const
+{
+ return mRegKeySerial.isOkay();
+}
+
diff --git a/aladin/appreg.hpp b/aladin/appreg.hpp
new file mode 100644
index 0000000..e3c90ef
--- /dev/null
+++ b/aladin/appreg.hpp
@@ -0,0 +1,57 @@
+#ifndef _ALADIN_APPREG_HPP_
+#define _ALADIN_APPREG_HPP_
+#ifndef _COMMON_REGKEY_HPP_
+#include
+#endif
+#ifndef _COMMON_STRING_HPP_
+#include
+#endif
+#ifndef _COMMON_BLOCK_HPP_
+#include
+#endif
+#ifndef _ALADIN_ALADINRC_HPP_
+#include
+#endif
+
+class AppReg
+{
+public:
+ AppReg(void);
+ AppReg(const AppReg &someAppReg);
+ virtual ~AppReg();
+ AppReg &operator=(const AppReg &someAppReg);
+ bool getHistory(Block &nameList);
+ bool setHistory(Block &nameList);
+ bool insertHistory(const String &strName);
+ bool setBaud(const String &strBaud);
+ String getBaud(void);
+ bool setParity(const String &strParity);
+ String getParity(void);
+ bool setDataBits(const String &strDataBits);
+ String getDataBits(void);
+ bool setStopBits(const String &stopBits);
+ String getStopBits(void);
+ bool setPort(const String &strPort);
+ String getPort(void);
+ String getSerialSettings(void);
+ BOOL isOkay(void)const;
+private:
+ enum{MaxCachedNames=7};
+ void guarantee(void);
+ void cacheHistory(void);
+
+ String mHistoryKeyName;
+ String mHistoryKeyShortName;
+ String mSerialKeyName;
+ String mSettingsEMAIL;
+ String mAladinKeyName;
+ String mSerialPort;
+ String mSerialBaud;
+ String mSerialData;
+ String mSerialParity;
+ String mSerialStop;
+ RegKey mRegKeySerial;
+ RegKey mRegKeyHistory;
+ Block mCachedNames;
+};
+#endif
diff --git a/aladin/bitmanip.hpp b/aladin/bitmanip.hpp
new file mode 100644
index 0000000..035aee8
--- /dev/null
+++ b/aladin/bitmanip.hpp
@@ -0,0 +1,39 @@
+#ifndef _ALADIN_BITMANIP_HPP_
+#define _ALADIN_BITMANIP_HPP_
+#ifndef _COMMON_WINDOWS_HPP_
+#include
+#endif
+
+class BitManip
+{
+public:
+ static BYTE reverse(BYTE byte);
+ static WORD reverse(WORD word);
+};
+
+inline
+BYTE BitManip::reverse(BYTE byte)
+{
+ BYTE temp=0;
+
+ temp|=(byte&0x80)>>7;
+ temp|=(byte&0x40)>>5;
+ temp|=(byte&0x20)>>3;
+ temp|=(byte&0x10)>>1;
+ temp|=(byte&0x08)<<1;
+ temp|=(byte&0x04)<<3;
+ temp|=(byte&0x02)<<5;
+ temp|=(byte&0x01)<<7;
+ return temp;
+}
+
+inline
+WORD BitManip::reverse(WORD someData)
+{
+ WORD tempData(someData);
+
+ someData>>=8;
+ someData+=tempData<<8;
+ return someData;
+}
+#endif
\ No newline at end of file
diff --git a/aladin/data/aladin.txt b/aladin/data/aladin.txt
new file mode 100644
index 0000000..a1d1f2f
--- /dev/null
+++ b/aladin/data/aladin.txt
@@ -0,0 +1,128 @@
+A0 09 64 02 A0 00 00 20 04 20 08 E0 10 09 A0 0A ..d.... . ......
+E0 0A 60 10 09 60 05 64 00 20 00 00 20 FF 52 5F ..`..`.d. .. .R_
+0B 67 0B 6B 0B E6 0B 67 0C 73 0C 0B 0C B8 0B 00 .g.k...g.s......
+00 00 1E 90 04 20 0A A0 10 20 10 13 E0 15 20 19 ..... ... .... .
+A0 10 1B E0 1D A0 1E A0 10 1E E0 1D 60 1B 60 10 ............`.`.
+1B 60 1D E0 1D E0 10 1F 20 1F 60 1F 20 10 1F 20 .`...... .`. ..
+1E A0 1D A0 10 1D E0 1D E0 1D E0 10 1E A0 1E 60 ...............`
+1E 60 10 1C E0 1B 60 1A 20 10 17 A0 16 A0 12 E4 .`....`. .......
+18 12 60 16 60 18 E0 10 1A 20 19 E0 17 E0 10 17 ..`.`.... ......
+20 15 60 13 E0 10 11 E0 0E 60 0D 60 10 0B A0 0A .`......`.`....
+A0 0C 20 10 0D E0 0E 20 0F 20 10 0F 60 0F A0 0E .. .... . ..`...
+60 10 0D 60 0B A0 08 E0 10 07 24 04 60 03 A0 10 `..`......$.`...
+00 60 00 20 00 20 00 00 20 00 20 00 20 00 00 E0 .`. . .. . . ...
+00 20 00 20 00 FF 45 70 0B 70 0B 70 0B 70 0B 70 . . ..Ep.p.p.p.p
+0B 70 0B 70 0B 70 0B 00 00 00 21 90 02 E0 03 20 .p.p.p....!....
+03 E0 10 04 20 04 60 04 60 10 05 E0 06 20 06 60 .... .`.`.... .`
+10 06 60 06 E0 07 20 10 07 20 07 20 07 20 10 06 ..`... .. . . ..
+E0 07 60 06 E0 10 06 60 06 E0 06 A0 10 05 E0 05 ..`....`........
+20 04 E0 10 04 A0 04 60 04 E0 10 04 60 04 A0 03 ......`....`...
+E0 10 04 20 03 A0 02 E0 10 02 E0 00 20 00 20 00 ... ........ . .
+02 60 03 60 04 60 10 04 E0 05 20 04 E0 10 05 20 .`.`.`.... ....
+05 60 05 E0 10 06 60 06 20 04 A0 10 05 A0 05 60 .`....`. ......`
+05 20 10 05 60 05 A0 05 20 10 05 20 05 A0 05 A0 . ..`... .. ....
+10 05 A0 05 E0 05 E0 18 06 20 05 A0 05 E0 10 05 ......... ......
+A0 05 20 05 60 10 05 20 04 E0 04 A0 10 04 A0 04 .. .`.. ........
+20 04 20 10 03 E0 03 A0 03 A0 10 04 20 04 60 04 . ......... .`.
+60 10 04 A0 04 A0 04 E0 10 04 E0 04 E0 03 E0 10 `...............
+03 A0 02 E0 02 A0 10 01 E0 00 20 00 20 00 00 20 .......... . ..
+00 E0 00 20 00 00 20 00 20 00 20 00 00 20 00 20 ... .. . . .. .
+00 20 00 00 20 00 20 00 20 00 00 20 00 20 00 20 . .. . . .. . .
+00 00 20 0B 70 0B 70 0B 70 0B 70 0B 70 0B 70 0B .. .p.p.p.p.p.p.
+70 0B 00 00 00 40 90 0B A0 16 20 19 60 10 1A E0 p....@.... .`...
+1B 20 19 20 10 1A E0 1C A0 1D A0 10 23 E0 29 20 . . ........#.)
+2A A0 10 30 60 34 60 35 A0 10 32 60 2E A0 2D A0 *..0`4`5..2`..-.
+10 2D 60 2C 60 2B E0 10 29 20 29 A0 2A 60 10 29 .-`,`+..) ).*`.)
+E0 28 E0 29 20 10 2A 60 2B 20 2A A0 10 28 60 25 .(.) .*`+ *..(`%
+A0 24 A0 10 22 20 1F 60 1F A0 10 1E A0 1B E0 19 .$.." .`........
+E0 10 1A A0 1C A0 1C 20 10 1A E0 1C E0 1C E0 10 ....... ........
+1C 20 1D E0 1D E0 10 1D 20 1C E0 1B A0 10 1C 60 . ...... ......`
+1A E0 1A 60 10 1A 60 1A 60 19 A0 10 19 E0 1A 20 ...`..`.`......
+19 60 10 19 A0 1D 20 1E A0 10 1E A4 1C E0 1D 20 .`.... ........
+10 1B 20 19 60 1A 60 10 1B A0 1B A0 1C 60 10 1C .. .`.`......`..
+E0 1C 60 1D 20 10 1D E0 1D 20 1D A4 10 1B A0 18 ..`. .... ......
+E0 16 20 10 13 20 0F E0 0E 20 10 0C 60 0B E0 0A .. .. ... ..`...
+64 10 07 20 08 60 0A A0 10 0B 20 0B 60 0A A0 10 d.. .`.... .`...
+08 A0 08 A0 09 20 10 08 E4 01 E0 00 20 00 00 20 ..... ...... ..
+FF 68 72 0B D4 0B 16 0E 62 10 4F 0F EA 0D C8 0C .hr.....b.O.....
+1F 0C 06 00 49 A7 80 08 20 0F 60 15 E0 10 16 60 ....I... .`....`
+15 E0 15 24 10 11 A0 13 60 13 E0 10 12 E0 13 60 ...$....`......`
+13 E0 10 12 E0 11 E0 12 20 10 12 E0 12 A0 12 E0 ........ .......
+10 12 E0 14 A0 15 20 10 14 E0 14 20 13 A0 10 13 ...... .... ....
+E0 13 E0 13 60 10 14 A0 14 60 13 E0 10 15 20 16 ....`....`.... .
+60 16 A0 10 14 E0 13 20 15 A0 10 15 60 15 60 15 `...... ....`.`.
+60 10 15 A0 15 60 15 60 10 12 20 12 E0 12 E0 10 `....`.`.. .....
+13 60 13 64 0F 60 10 10 20 11 60 0E E0 10 0E 60 .`.d.`.. .`....`
+0E A0 0E E0 10 0E E0 0F 20 0E 60 10 0E A0 0D 60 ........ .`....`
+0E 20 10 0E A0 0E 60 0E 60 10 0E 20 11 A0 11 A0 . ....`.`.. ....
+10 12 A0 14 20 14 A0 10 16 20 16 E0 17 E0 10 17 .... .... ......
+E0 18 20 18 20 10 17 E0 18 20 17 E0 10 17 E0 17 .. . .... ......
+E0 17 E0 10 17 A0 17 A0 17 A0 10 16 20 16 E0 17 ............ ...
+20 10 16 A0 16 60 15 E0 10 15 20 14 60 14 60 10 ....`.... .`.`.
+15 60 13 A0 12 24 10 11 E0 15 E0 15 E0 10 15 60 .`...$.........`
+14 E0 14 E0 10 13 60 12 20 12 60 10 10 20 11 60 ......`. .`.. .`
+11 60 10 0E A0 0D 20 09 60 10 05 E4 04 60 04 A0 .`.... .`....`..
+10 07 A0 07 E0 07 60 10 08 E0 05 A4 00 E0 10 00 ......`.........
+A0 00 20 00 20 00 FF 69 73 0B 71 0B 70 0B 70 0B .. . ..is.q.p.p.
+70 0B 70 0B 90 0B 70 0B 00 00 00 40 90 07 60 07 p.p...p....@..`.
+E0 06 E0 10 07 20 0B E0 0D E0 10 0D 60 0E 60 0F ..... ......`.`.
+20 10 0E E0 0E E0 0E E0 10 0F 20 0F 60 0F A0 10 ......... .`...
+11 20 12 60 12 A0 10 12 20 12 E0 13 20 10 12 E0 . .`.... ... ...
+10 64 0D E0 10 10 60 13 A0 13 E0 10 13 E0 10 A0 .d....`.........
+0D 60 10 10 A0 12 E0 13 E0 10 13 E0 12 20 10 A4 .`........... ..
+10 0D 24 0A 20 0D E0 10 0F 60 0F E0 0F E0 10 0E ..$. ....`......
+E0 0D A4 08 E4 10 09 A0 0B A0 0D 20 10 0D A0 0D ........... ....
+20 0A A0 10 07 E0 07 A0 06 E0 10 06 20 06 60 06 ........... .`.
+60 10 05 A0 05 60 05 60 10 05 A0 05 20 04 60 10 `....`.`.... .`.
+00 E0 02 20 00 20 00 00 20 00 20 00 E0 00 04 A0 ... . .. . .....
+05 20 05 60 10 05 E0 05 E0 06 20 10 06 60 07 60 . .`...... ..`.`
+07 20 10 06 E0 07 20 07 20 10 07 E0 07 E0 08 20 . .... . ......
+10 08 60 06 20 08 A0 10 06 E4 01 60 05 A0 10 07 ..`. ......`....
+A0 06 E0 06 A0 10 06 60 05 60 05 A0 10 05 A4 04 .......`.`......
+A0 04 E0 10 05 20 04 A0 04 A0 10 04 60 04 60 04 ..... ......`.`.
+20 10 03 E0 01 20 00 A0 00 00 20 00 E0 00 20 00 .... .... ... .
+00 20 FF 4C 70 0B 70 0B 70 0B 70 0B 70 0B 70 0B . .Lp.p.p.p.p.p.
+70 0B 70 0B 00 00 00 EA 80 08 20 0D 20 0D 20 10 p.p....... . . .
+0C E0 0D A0 10 E0 10 12 20 11 A0 11 E0 10 12 60 ........ ......`
+14 60 15 E0 10 17 20 1A 20 1C 60 10 1B 60 1B 20 .`.... . .`..`.
+1D 60 10 1D E0 1D 20 1C 20 10 1D 20 1D 20 1D 60 .`.... . .. . .`
+10 1D 60 1E A0 1F 20 10 1E 60 1E A0 1E A0 10 1D ..`... ..`......
+E0 1C E0 1C 60 18 1C 60 1C 20 1E 20 10 1D E0 1E ....`..`. . ....
+60 1E 60 10 1E 20 1D A0 1C 60 10 1A 60 1C 20 1C `.`.. ...`..`. .
+E0 10 1D 60 1D A0 1C 60 10 18 E0 15 E0 12 E0 10 ...`...`........
+10 60 10 20 0C E0 18 0A E0 0A 60 09 20 10 09 24 .`. ......`. ..$
+0B 20 0A E0 10 09 20 0A E0 0A 20 10 07 A0 07 20 . .... ... ....
+05 A0 10 04 20 01 60 00 20 00 00 20 00 20 04 20 .... .`. .. . .
+10 0A E0 0C 20 0C 60 10 0C E0 0C 20 0C A0 10 0A .... .`.... ....
+03 32 13 DE 21 09 00 1B 52 3D 1A 67 01 27 1F 36 .2..!...R=.g.'.6
+03 01 00 1C 0D 72 C6 1C 03 19 1F 52 02 24 00 1C .....r.....R.$..
+0D C4 90 16 00 27 07 4E 17 39 00 1C 22 E3 7D 42 .....'.N.9..".}B
+02 07 4F FB 00 05 00 0E F2 BC BC 4E 02 18 5F E9 ..O........N.._.
+00 05 00 0E F2 C3 4C 4E 00 38 1A 27 02 55 00 18 ......LN.8.'.U..
+62 A5 21 6C 02 45 15 A5 00 54 00 18 62 D3 97 6C b.!l.E...T..b..l
+00 38 1A 81 18 57 00 18 65 42 92 6B 02 38 15 AD .8...W..eB.k.8..
+00 32 00 18 65 65 D3 6C 00 27 15 41 18 34 00 18 .2..ee.l.'.A.4..
+68 1E E2 6D 01 33 1E 57 08 11 00 18 6A 77 5B 6B h..m.3.W....jw[k
+02 46 11 98 00 56 00 18 6A A2 0C 6B 00 41 1A C3 .F...V..j..k.A..
+21 37 00 18 6D 39 EB 6B 02 45 14 91 01 02 00 18 !7..m9.k.E......
+6D 6D 19 6B 00 20 09 FD 02 48 00 18 99 F5 A1 4C mm.k. ...H.....L
+01 02 1A 13 05 53 00 18 BC 54 D1 58 00 15 09 1C .....S...T.X....
+06 41 00 18 F4 97 2F 51 02 15 0D 48 00 12 00 18 .A..../Q...H....
+F4 A5 03 51 02 08 0A 62 00 11 00 18 F4 B1 8B 51 ...Q...b.......Q
+00 39 16 4E 02 12 00 19 18 98 61 73 02 61 0B D2 .9.N......as.a..
+00 47 00 19 18 C2 E7 74 01 14 18 0D 21 01 00 19 .G.....t....!...
+1B 3B F6 74 02 19 0F C7 00 20 00 19 1B 4D AA 75 .;.t..... ...M.u
+02 56 0D 4E 00 53 00 19 1B 70 72 73 01 21 29 24 .V.N.S...prs.!)$
+01 52 00 19 62 71 12 47 02 20 2A 63 01 52 00 19 .R..bq.G. *c.R..
+62 B1 0A 48 00 30 32 90 03 09 00 1B 45 19 28 67 b..H.02.....E.(g
+02 32 23 72 00 48 00 1B 45 3F 55 67 03 25 2D AF .2#r.H..E?Ug.%-.
+22 07 00 1B 47 BE C8 66 02 40 1B 8E 00 43 00 1B "...G..f.@...C..
+47 DF E4 67 02 51 07 25 02 56 00 1B 48 45 CA 6C G..g.Q.%.V..HE.l
+02 30 1D 7D 19 11 00 1B 4A 7B 6F 67 02 33 1F DB .0.}....J{og.3..
+01 07 00 1B 4A AB 9B 64 02 45 11 30 05 57 00 1B ....J..d.E.0.W..
+4B 64 77 67 00 32 35 8E 21 24 00 1B 4F AA F1 67 Kdwg.25.!$..O..g
+02 39 18 13 00 42 00 1B 4F CF 37 68 3F 05 0C 06 .9...B..O.7h?...
+E3 36 DE D0 04 DC 9B 95 E6 D6 E0 BF 72 63 EE E5 .6..........rc..
+33 10 03 06 58 94 54 94 5C 05 0E 00 D4 B9 28 9A 3...X.T.\.....(.
+FF 64 1E 1E 09 1D 18 18 11 44 F6 01 0B 16 82 91 .d.......D......
+CA 00 00 29 04 05 C6 02 1C 8A CA 7F E2 FD ?? ?? ...)..........??
diff --git a/aladin/data/aladin1.dat b/aladin/data/aladin1.dat
new file mode 100644
index 0000000..da95ad0
Binary files /dev/null and b/aladin/data/aladin1.dat differ
diff --git a/aladin/data/aladin2.dat b/aladin/data/aladin2.dat
new file mode 100644
index 0000000..112c5b5
Binary files /dev/null and b/aladin/data/aladin2.dat differ
diff --git a/aladin/data/aladin2.txt b/aladin/data/aladin2.txt
new file mode 100644
index 0000000..5c09528
--- /dev/null
+++ b/aladin/data/aladin2.txt
@@ -0,0 +1,128 @@
+A0 09 64 02 A0 00 00 20 04 20 08 E0 10 09 A0 0A ..d.... . ......
+E0 0A 60 10 09 60 05 64 00 20 00 00 20 FF 52 5F ..`..`.d. .. .R_
+0B 67 0B 6B 0B E6 0B 67 0C 73 0C 0B 0C B8 0B 00 .g.k...g.s......
+00 00 1E 90 04 20 0A A0 10 20 10 13 E0 15 20 19 ..... ... .... .
+A0 10 1B E0 1D A0 1E A0 10 1E E0 1D 60 1B 60 10 ............`.`.
+1B 60 1D E0 1D E0 10 1F 20 1F 60 1F 20 10 1F 20 .`...... .`. ..
+1E A0 1D A0 10 1D E0 1D E0 1D E0 10 1E A0 1E 60 ...............`
+1E 60 10 1C E0 1B 60 1A 20 10 17 A0 16 A0 12 E4 .`....`. .......
+18 12 60 16 60 18 E0 10 1A 20 19 E0 17 E0 10 17 ..`.`.... ......
+20 15 60 13 E0 10 11 E0 0E 60 0D 60 10 0B A0 0A .`......`.`....
+A0 0C 20 10 0D E0 0E 20 0F 20 10 0F 60 0F A0 0E .. .... . ..`...
+60 10 0D 60 0B A0 08 E0 10 07 24 04 60 03 A0 10 `..`......$.`...
+00 60 00 20 00 20 00 00 20 00 20 00 20 00 00 E0 .`. . .. . . ...
+00 20 00 20 00 FF 45 70 0B 70 0B 70 0B 70 0B 70 . . ..Ep.p.p.p.p
+0B 70 0B 70 0B 70 0B 00 00 00 21 90 02 E0 03 20 .p.p.p....!....
+03 E0 10 04 20 04 60 04 60 10 05 E0 06 20 06 60 .... .`.`.... .`
+10 06 60 06 E0 07 20 10 07 20 07 20 07 20 10 06 ..`... .. . . ..
+E0 07 60 06 E0 10 06 60 06 E0 06 A0 10 05 E0 05 ..`....`........
+20 04 E0 10 04 A0 04 60 04 E0 10 04 60 04 A0 03 ......`....`...
+E0 10 04 20 03 A0 02 E0 10 02 E0 00 20 00 20 00 ... ........ . .
+02 60 03 60 04 60 10 04 E0 05 20 04 E0 10 05 20 .`.`.`.... ....
+05 60 05 E0 10 06 60 06 20 04 A0 10 05 A0 05 60 .`....`. ......`
+05 20 10 05 60 05 A0 05 20 10 05 20 05 A0 05 A0 . ..`... .. ....
+10 05 A0 05 E0 05 E0 18 06 20 05 A0 05 E0 10 05 ......... ......
+A0 05 20 05 60 10 05 20 04 E0 04 A0 10 04 A0 04 .. .`.. ........
+20 04 20 10 03 E0 03 A0 03 A0 10 04 20 04 60 04 . ......... .`.
+60 10 04 A0 04 A0 04 E0 10 04 E0 04 E0 03 E0 10 `...............
+03 A0 02 E0 02 A0 10 01 E0 00 20 00 20 00 00 20 .......... . ..
+00 E0 00 20 00 00 20 00 20 00 20 00 00 20 00 20 ... .. . . .. .
+00 20 00 00 20 00 20 00 20 00 00 20 00 20 00 20 . .. . . .. . .
+00 00 20 0B 70 0B 70 0B 70 0B 70 0B 70 0B 70 0B .. .p.p.p.p.p.p.
+70 0B 00 00 00 40 90 0B A0 16 20 19 60 10 1A E0 p....@.... .`...
+1B 20 19 20 10 1A E0 1C A0 1D A0 10 23 E0 29 20 . . ........#.)
+2A A0 10 30 60 34 60 35 A0 10 32 60 2E A0 2D A0 *..0`4`5..2`..-.
+10 2D 60 2C 60 2B E0 10 29 20 29 A0 2A 60 10 29 .-`,`+..) ).*`.)
+E0 28 E0 29 20 10 2A 60 2B 20 2A A0 10 28 60 25 .(.) .*`+ *..(`%
+A0 24 A0 10 22 20 1F 60 1F A0 10 1E A0 1B E0 19 .$.." .`........
+E0 10 1A A0 1C A0 1C 20 10 1A E0 1C E0 1C E0 10 ....... ........
+1C 20 1D E0 1D E0 10 1D 20 1C E0 1B A0 10 1C 60 . ...... ......`
+1A E0 1A 60 10 1A 60 1A 60 19 A0 10 19 E0 1A 20 ...`..`.`......
+19 60 10 19 A0 1D 20 1E A0 10 1E A4 1C E0 1D 20 .`.... ........
+10 1B 20 19 60 1A 60 10 1B A0 1B A0 1C 60 10 1C .. .`.`......`..
+E0 1C 60 1D 20 10 1D E0 1D 20 1D A4 10 1B A0 18 ..`. .... ......
+E0 16 20 10 13 20 0F E0 0E 20 10 0C 60 0B E0 0A .. .. ... ..`...
+64 10 07 20 08 60 0A A0 10 0B 20 0B 60 0A A0 10 d.. .`.... .`...
+08 A0 08 A0 09 20 10 08 E4 01 E0 00 20 00 00 20 ..... ...... ..
+FF 68 72 0B D4 0B 16 0E 62 10 4F 0F EA 0D C8 0C .hr.....b.O.....
+1F 0C 06 00 49 A7 80 08 20 0F 60 15 E0 10 16 60 ....I... .`....`
+15 E0 15 24 10 11 A0 13 60 13 E0 10 12 E0 13 60 ...$....`......`
+13 E0 10 12 E0 11 E0 12 20 10 12 E0 12 A0 12 E0 ........ .......
+10 12 E0 14 A0 15 20 10 14 E0 14 20 13 A0 10 13 ...... .... ....
+E0 13 E0 13 60 10 14 A0 14 60 13 E0 10 15 20 16 ....`....`.... .
+60 16 A0 10 14 E0 13 20 15 A0 10 15 60 15 60 15 `...... ....`.`.
+60 10 15 A0 15 60 15 60 10 12 20 12 E0 12 E0 10 `....`.`.. .....
+13 60 13 64 0F 60 10 10 20 11 60 0E E0 10 0E 60 .`.d.`.. .`....`
+0E A0 0E E0 10 0E E0 0F 20 0E 60 10 0E A0 0D 60 ........ .`....`
+0E 20 10 0E A0 0E 60 0E 60 10 0E 20 11 A0 11 A0 . ....`.`.. ....
+10 12 A0 14 20 14 A0 10 16 20 16 E0 17 E0 10 17 .... .... ......
+E0 18 20 18 20 10 17 E0 18 20 17 E0 10 17 E0 17 .. . .... ......
+E0 17 E0 10 17 A0 17 A0 17 A0 10 16 20 16 E0 17 ............ ...
+20 10 16 A0 16 60 15 E0 10 15 20 14 60 14 60 10 ....`.... .`.`.
+15 60 13 A0 12 24 10 11 E0 15 E0 15 E0 10 15 60 .`...$.........`
+14 E0 14 E0 10 13 60 12 20 12 60 10 10 20 11 60 ......`. .`.. .`
+11 60 10 0E A0 0D 20 09 60 10 05 E4 04 60 04 A0 .`.... .`....`..
+10 07 A0 07 E0 07 60 10 08 E0 05 A4 00 E0 10 00 ......`.........
+A0 00 20 00 20 00 FF 69 73 0B 71 0B 70 0B 70 0B .. . ..is.q.p.p.
+70 0B 70 0B 90 0B 70 0B 00 00 00 40 90 07 60 07 p.p...p....@..`.
+E0 06 E0 10 07 20 0B E0 0D E0 10 0D 60 0E 60 0F ..... ......`.`.
+20 10 0E E0 0E E0 0E E0 10 0F 20 0F 60 0F A0 10 ......... .`...
+11 20 12 60 12 A0 10 12 20 12 E0 13 20 10 12 E0 . .`.... ... ...
+10 64 0D E0 10 10 60 13 A0 13 E0 10 13 E0 10 A0 .d....`.........
+0D 60 10 10 A0 12 E0 13 E0 10 13 E0 12 20 10 A4 .`........... ..
+10 0D 24 0A 20 0D E0 10 0F 60 0F E0 0F E0 10 0E ..$. ....`......
+E0 0D A4 08 E4 10 09 A0 0B A0 0D 20 10 0D A0 0D ........... ....
+20 0A A0 10 07 E0 07 A0 06 E0 10 06 20 06 60 06 ........... .`.
+60 10 05 A0 05 60 05 60 10 05 A0 05 20 04 60 10 `....`.`.... .`.
+00 E0 02 20 00 20 00 00 20 00 20 00 E0 00 04 A0 ... . .. . .....
+05 20 05 60 10 05 E0 05 E0 06 20 10 06 60 07 60 . .`...... ..`.`
+07 20 10 06 E0 07 20 07 20 10 07 E0 07 E0 08 20 . .... . ......
+10 08 60 06 20 08 A0 10 06 E4 01 60 05 A0 10 07 ..`. ......`....
+A0 06 E0 06 A0 10 06 60 05 60 05 A0 10 05 A4 04 .......`.`......
+A0 04 E0 10 05 20 04 A0 04 A0 10 04 60 04 60 04 ..... ......`.`.
+20 10 03 E0 01 20 00 A0 00 00 20 00 E0 00 20 00 .... .... ... .
+00 20 FF 4C 70 0B 70 0B 70 0B 70 0B 70 0B 70 0B . .Lp.p.p.p.p.p.
+70 0B 70 0B 00 00 00 EA 80 08 20 0D 20 0D 20 10 p.p....... . . .
+0C E0 0D A0 10 E0 10 12 20 11 A0 11 E0 10 12 60 ........ ......`
+14 60 15 E0 10 17 20 1A 20 1C 60 10 1B 60 1B 20 .`.... . .`..`.
+1D 60 10 1D E0 1D 20 1C 20 10 1D 20 1D 20 1D 60 .`.... . .. . .`
+10 1D 60 1E A0 1F 20 10 1E 60 1E A0 1E A0 10 1D ..`... ..`......
+E0 1C E0 1C 60 18 1C 60 1C 20 1E 20 10 1D E0 1E ....`..`. . ....
+60 1E 60 10 1E 20 1D A0 1C 60 10 1A 60 1C 20 1C `.`.. ...`..`. .
+E0 10 1D 60 1D A0 1C 60 10 18 E0 15 E0 12 E0 10 ...`...`........
+10 60 10 20 0C E0 18 0A E0 0A 60 09 20 10 09 24 .`. ......`. ..$
+0B 20 0A E0 10 09 20 0A E0 0A 20 10 07 A0 07 20 . .... ... ....
+05 A0 10 04 20 01 60 00 20 00 00 20 00 20 04 20 .... .`. .. . .
+10 0A E0 0C 20 0C 60 10 0C E0 0C 20 0C A0 10 0A .... .`.... ....
+03 32 13 DE 21 09 00 1B 52 3D 1A 67 01 27 1F 36 .2..!...R=.g.'.6
+03 01 00 1C 0D 72 C6 1C 03 19 1F 52 02 24 00 1C .....r.....R.$..
+0D C4 90 16 00 27 07 4E 17 39 00 1C 22 E3 7D 42 .....'.N.9..".}B
+02 07 4F FB 00 05 00 0E F2 BC BC 4E 02 18 5F E9 ..O........N.._.
+00 05 00 0E F2 C3 4C 4E 00 38 1A 27 02 55 00 18 ......LN.8.'.U..
+62 A5 21 6C 02 45 15 A5 00 54 00 18 62 D3 97 6C b.!l.E...T..b..l
+00 38 1A 81 18 57 00 18 65 42 92 6B 02 38 15 AD .8...W..eB.k.8..
+00 32 00 18 65 65 D3 6C 00 27 15 41 18 34 00 18 .2..ee.l.'.A.4..
+68 1E E2 6D 01 33 1E 57 08 11 00 18 6A 77 5B 6B h..m.3.W....jw[k
+02 46 11 98 00 56 00 18 6A A2 0C 6B 00 41 1A C3 .F...V..j..k.A..
+21 37 00 18 6D 39 EB 6B 02 45 14 91 01 02 00 18 !7..m9.k.E......
+6D 6D 19 6B 00 20 09 FD 02 48 00 18 99 F5 A1 4C mm.k. ...H.....L
+01 02 1A 13 05 53 00 18 BC 54 D1 58 00 15 09 1C .....S...T.X....
+06 41 00 18 F4 97 2F 51 02 15 0D 48 00 12 00 18 .A..../Q...H....
+F4 A5 03 51 02 08 0A 62 00 11 00 18 F4 B1 8B 51 ...Q...b.......Q
+00 39 16 4E 02 12 00 19 18 98 61 73 02 61 0B D2 .9.N......as.a..
+00 47 00 19 18 C2 E7 74 01 14 18 0D 21 01 00 19 .G.....t....!...
+1B 3B F6 74 02 19 0F C7 00 20 00 19 1B 4D AA 75 .;.t..... ...M.u
+02 56 0D 4E 00 53 00 19 1B 70 72 73 01 21 29 24 .V.N.S...prs.!)$
+01 52 00 19 62 71 12 47 02 20 2A 63 01 52 00 19 .R..bq.G. *c.R..
+62 B1 0A 48 00 30 32 90 03 09 00 1B 45 19 28 67 b..H.02.....E.(g
+02 32 23 72 00 48 00 1B 45 3F 55 67 03 25 2D AF .2#r.H..E?Ug.%-.
+22 07 00 1B 47 BE C8 66 02 40 1B 8E 00 43 00 1B "...G..f.@...C..
+47 DF E4 67 02 51 07 25 02 56 00 1B 48 45 CA 6C G..g.Q.%.V..HE.l
+02 30 1D 7D 19 11 00 1B 4A 7B 6F 67 02 33 1F DB .0.}....J{og.3..
+01 07 00 1B 4A AB 9B 64 02 45 11 30 05 57 00 1B ....J..d.E.0.W..
+4B 64 77 67 00 32 35 8E 21 24 00 1B 4F AA F1 67 Kdwg.25.!$..O..g
+02 39 18 13 00 42 00 1B 4F CF 37 68 3F 05 0C 06 .9...B..O.7h?...
+E3 36 DE D0 04 DC 9B 95 E6 D6 E0 BF 72 63 EE E5 .6..........rc..
+33 10 03 06 58 94 54 94 5C 05 0E 00 D4 B9 28 9A 3...X.T.\.....(.
+FF 64 1E 1E 09 1D 18 18 11 44 F6 01 0B 16 82 91 .d.......D......
+CA 00 00 29 04 05 C6 02 1C A3 DD E4 73 FE ?? ?? ...)........s.??
diff --git a/aladin/data/aladin3.dat b/aladin/data/aladin3.dat
new file mode 100644
index 0000000..7f174a9
Binary files /dev/null and b/aladin/data/aladin3.dat differ
diff --git a/aladin/data/dives.123 b/aladin/data/dives.123
new file mode 100644
index 0000000..29b0792
Binary files /dev/null and b/aladin/data/dives.123 differ
diff --git a/aladin/data/sean.log b/aladin/data/sean.log
new file mode 100644
index 0000000..e701578
Binary files /dev/null and b/aladin/data/sean.log differ
diff --git a/aladin/data/sean2.log b/aladin/data/sean2.log
new file mode 100644
index 0000000..c73fc7b
Binary files /dev/null and b/aladin/data/sean2.log differ
diff --git a/aladin/data/seans.log b/aladin/data/seans.log
new file mode 100644
index 0000000..0d40622
Binary files /dev/null and b/aladin/data/seans.log differ
diff --git a/aladin/data/seans.log.saf b/aladin/data/seans.log.saf
new file mode 100644
index 0000000..4eaa2f9
Binary files /dev/null and b/aladin/data/seans.log.saf differ
diff --git a/aladin/divedlg.cpp b/aladin/divedlg.cpp
new file mode 100644
index 0000000..fc7555f
--- /dev/null
+++ b/aladin/divedlg.cpp
@@ -0,0 +1,540 @@
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+DiveDlg::DiveDlg(void)
+{
+ mInitHandler.setCallback(this,&DiveDlg::initHandler);
+ mCreateHandler.setCallback(this,&DiveDlg::createHandler);
+ mCloseHandler.setCallback(this,&DiveDlg::closeHandler);
+ mDestroyHandler.setCallback(this,&DiveDlg::destroyHandler);
+ mCommandHandler.setCallback(this,&DiveDlg::commandHandler);
+ insertHandler(VectorHandler::InitDialogHandler,&mInitHandler);
+ insertHandler(VectorHandler::CreateHandler,&mCreateHandler);
+ insertHandler(VectorHandler::CloseHandler,&mCloseHandler);
+ insertHandler(VectorHandler::CommandHandler,&mCommandHandler);
+ insertHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
+}
+
+DiveDlg::DiveDlg(const DiveDlg &someDiveDlg)
+{ // private implementation
+ *this=someDiveDlg;
+}
+
+DiveDlg::~DiveDlg()
+{
+ removeHandler(VectorHandler::InitDialogHandler,&mInitHandler);
+ removeHandler(VectorHandler::CreateHandler,&mCreateHandler);
+ removeHandler(VectorHandler::CloseHandler,&mCloseHandler);
+ removeHandler(VectorHandler::CommandHandler,&mCommandHandler);
+ removeHandler(VectorHandler::DestroyHandler,&mDestroyHandler);
+}
+
+DiveDlg &DiveDlg::operator=(const DiveDlg &someDiveDlg)
+{
+ return *this;
+}
+
+bool DiveDlg::perform(void)
+{
+ return ::DialogBoxParam(processInstance(),(LPSTR)"DIVEBOOK",(HWND)0,DWindow::DlgProc,(LPARAM)(DWindow*)this);
+}
+
+CallbackData::ReturnType DiveDlg::initHandler(CallbackData &someCallbackData)
+{
+ String strClass;
+
+ applyHistory();
+ ::GetClassName(*this,strClass,String::MaxString);
+ ::SetClassLong(*this,GCL_HICON,(LONG)::LoadIcon(processInstance(),"APPICON"));
+ enableMenuItems(false);
+ mOwnerDrawGraph=new OwnerDrawGraph(*this,getItem(DB_GRAPH),DB_GRAPH);
+ mOwnerDrawGraph.disposition(PointerDisposition::Delete);
+ setCaption(String(STRING_APPNAME)+String(" ")+String(STRING_VERSION));
+ Block logStopArray;
+ Block profileStopArray;
+ mLogList=new OwnerDrawListAltColor(*this,getItem(DB_LOGLIST),DB_LOGLIST);
+ mLogList.disposition(PointerDisposition::Delete);
+ mProfileList=new OwnerDrawListAltColor(*this,getItem(DB_PFLIST),DB_PFLIST);
+ mProfileList.disposition(PointerDisposition::Delete);
+ logStopArray.insert(&PureDWORD(50));
+ logStopArray.insert(&PureDWORD(70));
+ logStopArray.insert(&PureDWORD(92));
+ logStopArray.insert(&PureDWORD(112));
+ logStopArray.insert(&PureDWORD(130));
+ mLogList->setTabStops(logStopArray);
+ profileStopArray.insert(&PureDWORD(5));
+ profileStopArray.insert(&PureDWORD(25));
+ profileStopArray.insert(&PureDWORD(50));
+ mProfileList->setTabStops(profileStopArray);
+ ::EnableWindow(getItem(DB_NITROX),false);
+ ::EnableWindow(getItem(DB_O2),false);
+ return (CallbackData::ReturnType)FALSE;
+}
+
+CallbackData::ReturnType DiveDlg::createHandler(CallbackData &someCallbackData)
+{
+ return (CallbackData::ReturnType)FALSE;
+}
+
+CallbackData::ReturnType DiveDlg::closeHandler(CallbackData &someCallbackData)
+{
+ return (CallbackData::ReturnType)FALSE;
+}
+
+CallbackData::ReturnType DiveDlg::destroyHandler(CallbackData &someCallbackData)
+{
+ return (CallbackData::ReturnType)FALSE;
+}
+
+CallbackData::ReturnType DiveDlg::commandHandler(CallbackData &someCallbackData)
+{
+ switch(someCallbackData.wmCommandID())
+ {
+ case APPMENU_FILE_EXIT :
+ case IDCANCEL :
+ handleCancel();
+ break;
+ case APPMENU_FILE_OPENDEVICE :
+ handleFileOpenDevice();
+ break;
+ case APPMENU_FILE_OPENLOG :
+ handleFileOpenLog();
+ break;
+ case APPMENU_FILE_IMPORT :
+ handleImport();
+ break;
+ case APPMENU_FILE_SAVEWORKSHEET :
+ handleSaveAsWorksheet();
+ break;
+ case APPMENU_FILE_SAVERAW :
+ handleSaveAsRaw();
+ break;
+ case APPMENU_FILE_SAVETEXT :
+ handleSaveAsText();
+ break;
+ case APPMENU_FILE_SAVEGRAPH :
+ handleSaveGraph();
+ break;
+ case APPMENU_FILE_SAVE :
+ handleFileSaveLog();
+ break;
+ case APPMENU_FILE_NEW :
+ handleFileNew();
+ break;
+ case APPMENU_SETTINGS_SERIAL :
+ handleSerialSettings();
+ break;
+ case APPMENU_HELP_ABOUT :
+ handleHelpAbout();
+ break;
+ case APPMENU_HELP_REGISTER :
+ handleHelpRegister();
+ break;
+ case APPMENU_HELP_HELP :
+ handleHelpHelp();
+ break;
+ case APPMENU_HELP_HOME :
+ handleHelpHome();
+ break;
+ case APPMENU_HELP_INTERFACES :
+ handleHelpInterfaces();
+ break;
+ case DB_PROFILES :
+ if(CBN_SELCHANGE==someCallbackData.wmCommandCommand())
+ handleProfileChange();
+ break;
+ case DB_GRAPH :
+ handleGraph();
+ break;
+ }
+ if(someCallbackData.wParam()>=StartDynamicID)handleFileOpen(someCallbackData);
+ return (CallbackData::ReturnType)FALSE;
+}
+
+void DiveDlg::handleGraph()
+{
+ GDIPoint cursorPos;
+
+ if(!mOwnerDrawGraph->hasData())return;
+ cursorPos.x(0);
+ cursorPos.y(0);
+ PureMenu popupMenu(PureMenu::PopupMenu);
+ popupMenu.insertMenu(0,PureMenu::ItemString,APPMENU_FILE_SAVEGRAPH,"&Save Bitmap...");
+ popupMenu.trackPopupMenu(*this,cursorPos,PureMenu::CenterAlign|PureMenu::TopAlign);
+}
+
+void DiveDlg::handleSaveGraph()
+{
+ OpenDialog openDialog;
+ String strPathFileName;
+ String strSaveAs;
+
+ sendMessage(DB_PROFILES,WM_GETTEXT,String::MaxString,(LPARAM)(LPSTR)strSaveAs.str());
+ strSaveAs+=".bmp";
+ if(!openDialog.getSaveFileName(".bmp","Save Bitmap",strSaveAs,strPathFileName))return;
+ mOwnerDrawGraph->saveBitmap(strPathFileName);
+}
+
+void DiveDlg::handleCancel()
+{
+ endDialog(false);
+}
+
+void DiveDlg::handleOk()
+{
+ endDialog(true);
+}
+
+void DiveDlg::handleSerialSettings()
+{
+ SerialDlg serialDlg;
+ serialDlg.perform(*this);
+}
+
+void DiveDlg::handleFileOpen(CallbackData &someCallbackData)
+{
+ PureMenu pureMenu(getMenu());
+ PureMenu fileMenu;
+ String menuItemString;
+
+ pureMenu.getSubMenu(0,fileMenu);
+ menuItemString=fileMenu.menuItemString(someCallbackData.wParam(),PureMenu::ByCommand);
+ if(menuItemString.isNull())return;
+ menuItemString=menuItemString.betweenString(')',0);
+ menuItemString.trimLeft();
+ if(menuItemString.strstr(".log"))handleFileOpenLog(menuItemString);
+ else if(menuItemString.strstr(".dat"))handleFileOpenRaw(menuItemString);
+ else ::MessageBox(*this,"Unknown data format","Error",MB_OK);
+}
+
+void DiveDlg::handleFileOpenDevice()
+{
+ AppReg appReg;
+ LRESULT result;
+
+ if(mDiveProfile.isOkay())
+ {
+ result=::MessageBox(*this,"Merge into currently loaded log?","Confirm",MB_YESNOCANCEL);
+ if(IDCANCEL==result)return;
+ if(IDNO==result)mDiveProfile.clear();
+ }
+ if(!mDiveProfile.openDevice(appReg.getPort(),*this))return;
+ enableMenuItems(true,IDYES==result?false:true);
+ setCaption(String(STRING_APPNAME)+String(" ")+String(STRING_VERSION)+String(" (Device:")+appReg.getPort()+String(")"));
+ setData(mDiveProfile);
+}
+
+void DiveDlg::handleImport()
+{
+ String strPathFileName;
+ OpenDialog openDialog;
+
+ if(!openDialog.getOpenFileName(*this,"*.dat","Open File","*.dat",strPathFileName))return;
+ handleFileOpenRaw(strPathFileName);
+}
+
+void DiveDlg::handleFileOpenLog(void)
+{
+ OpenDialog openDialog;
+ String strPathFileName;
+
+ if(!openDialog.getOpenFileName(*this,"*.log","Open Log","*.log",strPathFileName))return;
+ handleFileOpenLog(strPathFileName);
+}
+
+void DiveDlg::handleFileOpenLog(const String &strPathFileName)
+{
+ AppReg appReg;
+ LRESULT result;
+
+ if(mDiveProfile.isOkay())
+ {
+ result=::MessageBox(*this,"Merge into currently loaded log?","Confirm",MB_YESNOCANCEL);
+ if(IDCANCEL==result)return;
+ if(IDNO==result)mDiveProfile.clear();
+ }
+ if(!mDiveProfile.openLog(strPathFileName))
+ {
+ ::MessageBox(*this,"Not a valid log file","Error",MB_OK);
+ return;
+ }
+ appReg.insertHistory(strPathFileName);
+ setCaption(String(STRING_APPNAME)+String(" ")+String(STRING_VERSION)+String(" (")+strPathFileName+String(")"));
+ enableMenuItems(true,false);
+ setData(mDiveProfile);
+}
+
+void DiveDlg::handleFileOpenRaw(const String &strPathFileName)
+{
+ AppReg appReg;
+ LRESULT result;
+
+ if(mDiveProfile.isOkay())
+ {
+ result=::MessageBox(*this,"Merge into currently loaded log?","Confirm",MB_YESNOCANCEL);
+ if(IDCANCEL==result)return;
+ if(IDNO==result)mDiveProfile.clear();
+ }
+ if(!mDiveProfile.openRaw(strPathFileName))
+ {
+ ::MessageBox(*this,"File is not in Aladin data format","Error",MB_OK);
+ return;
+ }
+ setCaption(String(STRING_APPNAME)+String(" ")+String(STRING_VERSION)+String(" (")+strPathFileName+String(")"));
+ enableMenuItems(true,IDYES==result?false:true);
+ setData(mDiveProfile);
+ appReg.insertHistory(strPathFileName);
+}
+
+void DiveDlg::clearData()
+{
+ mDiveProfile.clear();
+ sendMessage(DB_PROFILES,CB_RESETCONTENT,0,0L);
+ setText(DB_COMPUTER,"");
+ setText(DB_BATTERY,"");
+ setText(DB_STANDARD,"");
+ sendMessage(DB_NITROX,BM_SETCHECK,0,0L);
+ sendMessage(DB_O2,BM_SETCHECK,0,0L);
+ mLogList->resetContent();
+ mProfileList->resetContent();
+ mOwnerDrawGraph->clearData();
+ mOwnerDrawGraph->invalidate();
+}
+
+void DiveDlg::setData(Aladin &diveInfo)
+{
+ const Information &information=diveInfo.getInformation();
+ const CurrentStatus &status=diveInfo.getStatus();
+ const LogBook &logBook=diveInfo.getLogBook();
+ const Profiles &profiles=diveInfo.getProfile();
+ int index;
+
+ mLogList->resetContent();
+ mProfileList->resetContent();
+ sendMessage(DB_PROFILES,CB_RESETCONTENT,0,0L);
+ setText(DB_COMPUTER,information.getComputerTypeString());
+ setText(DB_BATTERY,String().fromDouble(status.getRemainingBattery()));
+ setText(DB_STANDARD,information.getStandardString());
+ sendMessage(DB_NITROX,BM_SETCHECK,information.isNitrox(),0L);
+ sendMessage(DB_O2,BM_SETCHECK,information.isO2(),0L);
+ sendMessage(DB_NITROX,WM_ENABLE,FALSE,0);
+ sendMessage(DB_O2,WM_ENABLE,FALSE,0);
+ for(index=0;indexaddString(str);
+ }
+ for(index=0;indexresetContent();
+ DiveProfile &diveProfile=((Block&)profiles)[index];
+ for(index=0;indexaddString(str);
+ }
+ sendMessage(DB_PFMAXDEPTH,WM_SETTEXT,0,(LONG)(LPSTR)String().fromInt(diveProfile.getMaxDepth()));
+ sendMessage(DB_PFBOTTOMTIME,WM_SETTEXT,0,(LONG)(LPSTR)String().fromInt(diveProfile.getBottomTime()));
+ mOwnerDrawGraph->setData(diveProfile);
+ mOwnerDrawGraph->invalidate();
+}
+
+void DiveDlg::handleSaveAsWorksheet()
+{
+ OpenDialog openDialog;
+ String strPathFileName;
+
+ if(!openDialog.getSaveFileName(".123","Save As Lotus Worksheet","",strPathFileName))return;
+ if(!mDiveProfile.saveWorksheet(strPathFileName))
+ {
+ ::MessageBox(*this,"Error saving file.","Error",MB_OK);
+ return;
+ }
+}
+
+void DiveDlg::handleSaveAsRaw()
+{
+ OpenDialog openDialog;
+ String strPathFileName;
+
+ if(!openDialog.getSaveFileName(".dat","Save As Raw Data","",strPathFileName))return;
+ if(!mDiveProfile.saveRaw(strPathFileName))
+ {
+ ::MessageBox(*this,"Error saving file.","Error",MB_OK);
+ return;
+ }
+}
+
+void DiveDlg::handleSaveAsText()
+{
+ OpenDialog openDialog;
+ String strPathFileName;
+
+ if(!openDialog.getSaveFileName(".txt","Save As Text","",strPathFileName))return;
+ if(!mDiveProfile.saveText(strPathFileName))
+ {
+ ::MessageBox(*this,"Error saving file.","Error",MB_OK);
+ return;
+ }
+}
+
+void DiveDlg::handleFileSaveLog(void)
+{
+ OpenDialog openDialog;
+ String strPathFileName;
+
+ if(!openDialog.getSaveFileName(".log","Save Log","",strPathFileName))return;
+ if(!mDiveProfile.saveLog(strPathFileName))
+ {
+ ::MessageBox(*this,"Error saving file.","Error",MB_OK);
+ return;
+ }
+}
+
+void DiveDlg::handleFileNew()
+{
+ if(IDCANCEL==::MessageBox(*this,"Clear contents?","Confirm",MB_OKCANCEL))return;
+ clearData();
+}
+
+void DiveDlg::handleHelpAbout()
+{
+ SplashScreen splashScreen("SPLASH",String(STRING_SPLASHURL),String(STRING_APPNAME));
+ splashScreen.perform();
+}
+
+void DiveDlg::handleHelpHelp()
+{
+ String strCommand;
+ Process process;
+
+ if(!getBrowser(strCommand))return;
+ process.createProcess(strCommand,String(" ")+String(STRING_HOST)+String(STRING_HELPPAGE),false);
+}
+
+void DiveDlg::handleHelpRegister()
+{
+ String strCommand;
+ Process process;
+
+ if(!getBrowser(strCommand))return;
+ process.createProcess(strCommand,String(" ")+String(STRING_HOST)+String(STRING_REGISTERPAGE),false);
+}
+
+void DiveDlg::handleHelpHome()
+{
+ String strCommand;
+ Process process;
+
+ if(!getBrowser(strCommand))return;
+ process.createProcess(strCommand,String(" ")+String(STRING_HOST)+String(STRING_HOMEPAGE),false);
+}
+
+void DiveDlg::handleHelpInterfaces(void)
+{
+ String strCommand;
+ Process process;
+
+ if(!getBrowser(strCommand))return;
+ process.createProcess(strCommand,String(" ")+String(STRING_LINKURL),false);
+}
+
+void DiveDlg::enableMenuItems(bool enable,bool enableSaveRaw)
+{
+ PureMenu windowMenu(::GetMenu(*this));
+ windowMenu.getSubMenu(0,windowMenu);
+ if(enable)
+ {
+ windowMenu.getSubMenu(0,windowMenu);
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVEWORKSHEET,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
+ if(!enableSaveRaw)windowMenu.enableMenuItem(APPMENU_FILE_SAVERAW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemDisabled|PureMenu::ItemGrayed));
+ else windowMenu.enableMenuItem(APPMENU_FILE_SAVERAW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVETEXT,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
+ windowMenu.enableMenuItem(APPMENU_FILE_NEW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
+ }
+ else
+ {
+ windowMenu.getSubMenu(0,windowMenu);
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVEWORKSHEET,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemDisabled|PureMenu::ItemGrayed));
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVERAW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemDisabled|PureMenu::ItemGrayed));
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVETEXT,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemDisabled|PureMenu::ItemGrayed));
+ windowMenu.enableMenuItem(APPMENU_FILE_SAVE,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemDisabled|PureMenu::ItemGrayed));
+ windowMenu.enableMenuItem(APPMENU_FILE_NEW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemDisabled|PureMenu::ItemGrayed));
+ }
+}
+
+bool DiveDlg::getBrowser(String &strBrowser)
+{
+ RegKey regKey(RegKey::LocalMachine);
+ String strCommand;
+ int argPos;
+
+ if(!regKey.openKey(String(STRING_BROWSERKEY)))
+ {
+ if(!regKey.openKey(String(STRING_BROWSERKEYALT)))
+ {
+ ::MessageBox(*this,"Unable to launch browser.","Error",MB_OK);
+ return false;
+ }
+ }
+ if(!regKey.enumValue(0,String(STRING_BROWSERCOMMAND),strCommand)||strCommand.isNull()||!strCommand.length())
+ {
+ ::MessageBox(*this,"Unable to launch browser.","Error",MB_OK);
+ return false;
+ }
+ strCommand.removeTokens("'\"");
+ if(-1!=(argPos=strCommand.strpos("-")))strCommand=strCommand.substr(0,argPos-1);
+ strBrowser=strCommand;
+ return true;
+}
+
+void DiveDlg::applyHistory(void)
+{
+ AppReg appReg;
+ Block nameList;
+ PureMenu fileMenu;
+ String strItem;
+ PureMenu pureMenu(getMenu());
+
+ appReg.getHistory(nameList);
+ if(!nameList.size())return;
+ pureMenu.getSubMenu(0,fileMenu);
+ fileMenu.appendSeparator();
+ for(int itemIndex=0;itemIndex
+#endif
+#ifndef _COMMON_SMARTPOINTER_HPP_
+#include
+#endif
+#ifndef _COMMON_GLOBALDATA_HPP_
+#include
+#endif
+#ifndef _COMMON_CONTROL_HPP_
+#include