This commit is contained in:
2024-08-07 09:12:07 -04:00
parent ca445435a0
commit fdfadd5c7e
1021 changed files with 73601 additions and 0 deletions

BIN
aladin/ASM1.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM10.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM2.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM3.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM4.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM5.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM6.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM7.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM8.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/ASM9.ICO Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

BIN
aladin/Debug/Main.obj Normal file

Binary file not shown.

0
aladin/Debug/Main.sbr Normal file
View File

BIN
aladin/Debug/aladin.bsc Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.exe Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.exp Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.ilk Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.lib Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.obj Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.pch Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.pdb Normal file

Binary file not shown.

BIN
aladin/Debug/aladin.res Normal file

Binary file not shown.

0
aladin/Debug/aladin.sbr Normal file
View File

BIN
aladin/Debug/appreg.obj Normal file

Binary file not shown.

0
aladin/Debug/appreg.sbr Normal file
View File

BIN
aladin/Debug/divedlg.obj Normal file

Binary file not shown.

0
aladin/Debug/divedlg.sbr Normal file
View File

BIN
aladin/Debug/divelog.obj Normal file

Binary file not shown.

0
aladin/Debug/divelog.sbr Normal file
View File

Binary file not shown.

View File

BIN
aladin/Debug/graph.obj Normal file

Binary file not shown.

0
aladin/Debug/graph.sbr Normal file
View File

Binary file not shown.

View File

172
aladin/Debug/log.txt Normal file
View File

@@ -0,0 +1,172 @@
MESSAGE:136 HWND:0x000300c4 WPARAM:4 LPARAM:0
MESSAGE:133 HWND:0x000300c4 WPARAM:1 LPARAM:0
MESSAGE:13 HWND:0x000300c4 WPARAM:510 LPARAM:1238544
MESSAGE:20 HWND:0x000300c4 WPARAM:16842837 LPARAM:0
MESSAGE:310 HWND:0x000300c4 WPARAM:16842837 LPARAM:196804
MESSAGE:133 HWND:0x000100c6 WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842835 LPARAM:65734
MESSAGE:133 HWND:0x000100c8 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100c8 WPARAM:16842835 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842835 LPARAM:65736
MESSAGE:133 HWND:0x000100ca WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100ca WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65738
MESSAGE:133 HWND:0x000100cc WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100cc WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65740
MESSAGE:133 HWND:0x000100ce WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100ce WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65742
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65742
MESSAGE:133 HWND:0x000100d0 WPARAM:1 LPARAM:0
MESSAGE:308 HWND:0x000300c4 WPARAM:16842837 LPARAM:65744
MESSAGE:133 HWND:0x000100d2 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100d2 WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65746
MESSAGE:133 HWND:0x000100d4 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100d4 WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65748
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65748
MESSAGE:133 HWND:0x000100d6 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100d6 WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65750
MESSAGE:133 HWND:0x000100d8 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100d8 WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65752
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65752
MESSAGE:133 HWND:0x000100da WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65754
MESSAGE:133 HWND:0x000100dc WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65756
MESSAGE:133 HWND:0x000100de WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65758
MESSAGE:133 HWND:0x000100e0 WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65760
MESSAGE:133 HWND:0x000100e2 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100e2 WPARAM:16842837 LPARAM:0
MESSAGE:307 HWND:0x000300c4 WPARAM:16842837 LPARAM:65762
MESSAGE:392 HWND:0x000100e4 WPARAM:0 LPARAM:0
MESSAGE:394 HWND:0x000100e4 WPARAM:0 LPARAM:0
MESSAGE:394 HWND:0x000100e4 WPARAM:0 LPARAM:0
MESSAGE:393 HWND:0x000100e4 WPARAM:0 LPARAM:1238328
MESSAGE:307 HWND:0x000300c4 WPARAM:16842837 LPARAM:65762
MESSAGE:133 HWND:0x000100e6 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100e6 WPARAM:16842837 LPARAM:0
MESSAGE:308 HWND:0x000300c4 WPARAM:16842837 LPARAM:65766
MESSAGE:308 HWND:0x000300c4 WPARAM:16842837 LPARAM:65766
MESSAGE:43 HWND:0x000300c4 WPARAM:1009 LPARAM:1240404
MESSAGE:394 HWND:0x000100e6 WPARAM:0 LPARAM:0
MESSAGE:393 HWND:0x000100e6 WPARAM:0 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1009 LPARAM:1240404
MESSAGE:394 HWND:0x000100e6 WPARAM:1 LPARAM:0
MESSAGE:393 HWND:0x000100e6 WPARAM:1 LPARAM:1236816
MESSAGE:133 HWND:0x000100e8 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100e8 WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65768
MESSAGE:133 HWND:0x000100ea WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100ea WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65770
MESSAGE:133 HWND:0x000100ec WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100ec WPARAM:16842837 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65772
MESSAGE:133 HWND:0x000100ee WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842837 LPARAM:65774
MESSAGE:133 HWND:0x000100f0 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100f0 WPARAM:16842837 LPARAM:0
MESSAGE:309 HWND:0x000300c4 WPARAM:16842837 LPARAM:65776
MESSAGE:309 HWND:0x000300c4 WPARAM:16842837 LPARAM:65776
MESSAGE:43 HWND:0x000300c4 WPARAM:1012 LPARAM:1240460
MESSAGE:133 HWND:0x000100f2 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100f2 WPARAM:16842836 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842836 LPARAM:65778
MESSAGE:133 HWND:0x000100f4 WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842836 LPARAM:65780
MESSAGE:133 HWND:0x000100f6 WPARAM:1 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842836 LPARAM:65782
MESSAGE:312 HWND:0x000300c4 WPARAM:16842836 LPARAM:65782
MESSAGE:133 HWND:0x000100f8 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100f8 WPARAM:16842836 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842836 LPARAM:65784
MESSAGE:312 HWND:0x000300c4 WPARAM:16842836 LPARAM:65784
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:1639135
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554434
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:2687694
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554437
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:3277511
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554437
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:4588211
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:5833377
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:6423192
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:7733893
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:8323708
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433
MESSAGE:132 HWND:0x000100f0 WPARAM:0 LPARAM:9568874
MESSAGE:32 HWND:0x000100f0 WPARAM:65776 LPARAM:33554433
MESSAGE:32 HWND:0x000300c4 WPARAM:65776 LPARAM:33554433
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:10879576
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433
MESSAGE:132 HWND:0x000100e6 WPARAM:0 LPARAM:11469391
MESSAGE:32 HWND:0x000100e6 WPARAM:65766 LPARAM:33554439
MESSAGE:32 HWND:0x000300c4 WPARAM:65766 LPARAM:33554439
MESSAGE:136 HWND:0x000300c4 WPARAM:4 LPARAM:0
MESSAGE:133 HWND:0x000300c4 WPARAM:-1761344457 LPARAM:0
MESSAGE:13 HWND:0x000300c4 WPARAM:510 LPARAM:1238544
MESSAGE:20 HWND:0x000300c4 WPARAM:16842839 LPARAM:0
MESSAGE:310 HWND:0x000300c4 WPARAM:16842839 LPARAM:196804
MESSAGE:133 HWND:0x000100d0 WPARAM:-1711012809 LPARAM:0
MESSAGE:20 HWND:0x000100d0 WPARAM:16842839 LPARAM:0
MESSAGE:308 HWND:0x000300c4 WPARAM:16842839 LPARAM:65744
MESSAGE:308 HWND:0x000300c4 WPARAM:16842839 LPARAM:65744
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:0 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:0 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:1 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:1 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:2 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:2 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:3 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:3 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:4 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:4 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:5 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:5 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:6 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:6 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:7 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:7 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:8 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:8 LPARAM:1236816
MESSAGE:43 HWND:0x000300c4 WPARAM:1008 LPARAM:1240404
MESSAGE:394 HWND:0x000100d0 WPARAM:9 LPARAM:0
MESSAGE:393 HWND:0x000100d0 WPARAM:9 LPARAM:1236816
MESSAGE:133 HWND:0x000100de WPARAM:-1677458377 LPARAM:0
MESSAGE:20 HWND:0x000100de WPARAM:16842839 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842839 LPARAM:65758
MESSAGE:133 HWND:0x000100e0 WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100e0 WPARAM:16842839 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842839 LPARAM:65760
MESSAGE:133 HWND:0x000100ee WPARAM:1 LPARAM:0
MESSAGE:20 HWND:0x000100ee WPARAM:16842839 LPARAM:0
MESSAGE:312 HWND:0x000300c4 WPARAM:16842839 LPARAM:65774
MESSAGE:133 HWND:0x000100f0 WPARAM:251921067 LPARAM:0
MESSAGE:20 HWND:0x000100f0 WPARAM:16842839 LPARAM:0
MESSAGE:309 HWND:0x000300c4 WPARAM:16842839 LPARAM:65776
MESSAGE:309 HWND:0x000300c4 WPARAM:16842839 LPARAM:65776
MESSAGE:43 HWND:0x000300c4 WPARAM:1012 LPARAM:1240460
MESSAGE:132 HWND:0x000100d0 WPARAM:0 LPARAM:25887099
MESSAGE:32 HWND:0x000100d0 WPARAM:65744 LPARAM:33554433
MESSAGE:32 HWND:0x000300c4 WPARAM:65744 LPARAM:33554433
MESSAGE:132 HWND:0x000300c4 WPARAM:0 LPARAM:27459967
MESSAGE:32 HWND:0x000300c4 WPARAM:196804 LPARAM:33554433

BIN
aladin/Debug/logbook.obj Normal file

Binary file not shown.

0
aladin/Debug/logbook.sbr Normal file
View File

BIN
aladin/Debug/profiles.obj Normal file

Binary file not shown.

View File

BIN
aladin/Debug/serdlg.obj Normal file

Binary file not shown.

0
aladin/Debug/serdlg.sbr Normal file
View File

BIN
aladin/Debug/splash.obj Normal file

Binary file not shown.

0
aladin/Debug/splash.sbr Normal file
View File

BIN
aladin/Debug/status.obj Normal file

Binary file not shown.

0
aladin/Debug/status.sbr Normal file
View File

BIN
aladin/Debug/vc60.idb Normal file

Binary file not shown.

BIN
aladin/Debug/vc60.pdb Normal file

Binary file not shown.

14
aladin/Main.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include <common/windows.hpp>
#include <common/string.hpp>
#include <aladin/divedlg.hpp>
#include <aladin/splash.hpp>
#include <aladin/resource.hpp>
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;
}

BIN
aladin/RCa00848 Normal file

Binary file not shown.

0
aladin/RDa00848 Normal file
View File

BIN
aladin/aladin.aps Normal file

Binary file not shown.

BIN
aladin/aladin.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

293
aladin/aladin.cpp Normal file
View File

@@ -0,0 +1,293 @@
#include <aladin/aladin.hpp>
#include <aladin/appreg.hpp>
#include <aladin/bitmanip.hpp>
#include <worksht/worksht.hpp>
#include <common/file.hpp>
#include <common/openfile.hpp>
#include <common/array.hpp>
#include <common/console.hpp>
#include <commctrl/commctrl.hpp>
#include <commctrl/fmtlines.hpp>
#include <common/guiwnd.hpp>
#include <common/progress.hpp>
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<String> 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<mLogBook.size();index++)
{
const DiveLog &diveLog=((LogBook&)mLogBook)[index];
SystemTime systemTime=diveLog.getEntryTime();
String strLine;
::sprintf(strLine,"%02d-%02d-%4d ",systemTime.month(),systemTime.day(),systemTime.year());
strLine+=String().fromInt(diveLog.getMaxDepth())+String(" ");
strLine+=String().fromInt(diveLog.getBottomTime())+String(" ");
strLine+=diveLog.getSurfaceTime().toString()+String(" ");
strLine+=String().fromInt(diveLog.getWaterTemperature());
outFile.writeLine(strLine);
}
for(int pIndex=0;pIndex<mProfiles.size();pIndex++)
{
DiveProfile &diveProfile=((Block<DiveProfile>&)mProfiles)[pIndex];
outFile.writeLine(" ");
outFile.writeLine(" ");
outFile.writeLine(String("Profile_")+String().fromInt(pIndex+1));
outFile.writeLine("Time Depth");
for(int diveIndex=0;diveIndex<diveProfile.size();diveIndex++)
{
ProfileData &profileData=diveProfile[diveIndex];
outFile.writeLine(String().fromInt(profileData.getStageTime())+String(" ")+String().fromInt(profileData.getDepth()));
}
}
return true;
}
bool Aladin::saveWorksheet(const String &strPathFileName)
{
Worksheet worksheet;
worksheet.setDimensions(100,100);
addDiveLog(worksheet,getLogBook(),0,1);
addProfile(worksheet,getProfile(),0,7);
return worksheet.save(strPathFileName);
}
bool Aladin::saveLog(const String &strPathFileName)
{
File outFile;
char header[]={'L','O','G','1'};
if(!outFile.open(strPathFileName,"wb"))return false;
outFile.write(header,sizeof(header));
if(!mStatus.writeTo(outFile))return false;
if(!mInformation.writeTo(outFile))return false;
if(!mLogBook.writeTo(outFile))return false;
if(!mProfiles.writeTo(outFile))return false;
outFile.close();
return true;
}
const CurrentStatus &Aladin::getStatus(void)const
{
return mStatus;
}
const Information &Aladin::getInformation(void)const
{
return mInformation;
}
const Profiles &Aladin::getProfile(void)const
{
return mProfiles;
}
const LogBook &Aladin::getLogBook(void)const
{
return mLogBook;
}
bool Aladin::getControlData(CommControl &control,Progress &progress)
{
char rcvChar;
char syncBuff[]={'U','U','U','\0'};
int index=0;
int skipped=0;
int waitTime=0;
while(!control.hasData()&&waitTime<500)
{
progress.yieldTask();
::Sleep(100);
waitTime+=100;
}
if(!control.hasData())return false;
::memset(&mRawData[0],0,mRawData.size());
while((sizeof(syncBuff)!=index)&&(skipped<mRawData.size()+4))
{
progress.yieldTask();
if(!progress.isOkay())return false;
control.read(&rcvChar,sizeof(rcvChar));
if(0==rcvChar&&!index){continue;}
if(rcvChar==syncBuff[index])index++;
else {index=0;skipped++;}
}
progress.setCaption("Acquire..., (Press ESC to cancel)");
progress.setText("Acquiring data...");
progress++;
if(sizeof(syncBuff)!=index)return false;
control.readFully((unsigned char*)&mRawData[0],mRawData.size());
for(index=0;index<mRawData.size();index++)mRawData[index]=BitManip::reverse(mRawData[index]);
progress.setCaption("Success");
progress.setText("Data acquisition complete.");
progress++;
return true;
}
bool Aladin::readRaw(Array<BYTE> &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<logBook.size();index++)
{
const DiveLog &diveLog=((LogBook&)logBook)[index];
startRow++;
worksheet.setAt(startRow,startCol,diveLog.getEntryTime().toString());
worksheet.setAt(startRow,startCol+1,diveLog.getMaxDepth());
worksheet.setAt(startRow,startCol+2,diveLog.getBottomTime());
worksheet.setAt(startRow,startCol+3,diveLog.getSurfaceTime().toString());
worksheet.setAt(startRow,startCol+4,diveLog.getWaterTemperature());
}
}
void Aladin::addProfile(Worksheet &worksheet,const Profiles &profiles,int startRow,int startCol)
{
int sRow(startRow);
for(int pIndex=0;pIndex<profiles.size();pIndex++)
{
DiveProfile &diveProfile=((Block<DiveProfile>&)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<diveProfile.size();diveIndex++)
{
ProfileData &profileData=diveProfile[diveIndex];
worksheet.setAt(sRow,startCol,profileData.getStageTime());
worksheet.setAt(sRow++,startCol+1,profileData.getDepth());
}
startCol+=2;
}
}

207
aladin/aladin.dsp Normal file
View File

@@ -0,0 +1,207 @@
# Microsoft Developer Studio Project File - Name="aladin" - Package Owner=<4>
# 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

194
aladin/aladin.dsw Normal file
View File

@@ -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>
{{{
}}}
###############################################################################

90
aladin/aladin.h Normal file
View File

@@ -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

72
aladin/aladin.hpp Normal file
View File

@@ -0,0 +1,72 @@
#ifndef _ALADIN_ALADIN_HPP_
#define _ALADIN_ALADIN_HPP_
#ifndef _PROTO_STATUS_HPP_
#include <aladin/status.hpp>
#endif
#ifndef _ALADIN_INFORMATION_HPP_
#include <aladin/information.hpp>
#endif
#ifndef _ALADIN_PROFILES_HPP_
#include <aladin/profiles.hpp>
#endif
#ifndef _ALADIN_PROFILEDATA_HPP_
#include <aladin/profiledata.hpp>
#endif
#ifndef _ALADIN_LOGBOOK_HPP_
#include <aladin/logbook.hpp>
#endif
#ifndef _ALADIN_RAWDATA_HPP_
#include <aladin/rawdata.hpp>
#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<BYTE> &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

BIN
aladin/aladin.ncb Normal file

Binary file not shown.

BIN
aladin/aladin.opt Normal file

Binary file not shown.

101
aladin/aladin.plg Normal file
View File

@@ -0,0 +1,101 @@
<html>
<body>
<pre>
<h1>Build Log</h1>
<h3>
--------------------Configuration: aladin - Win32 Debug--------------------
</h3>
<h3>Command Lines</h3>
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"
<h3>Output Window</h3>
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"
<h3>Output Window</h3>
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...
<h3>Output Window</h3>
<h3>Results</h3>
aladin.exe - 0 error(s), 0 warning(s)
</pre>
</body>
</html>

289
aladin/aladin.rc Normal file
View File

@@ -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

BIN
aladin/aladin2.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

6
aladin/aladinrc.hpp Normal file
View File

@@ -0,0 +1,6 @@
#ifndef _ALADIN_ALADINRC_HPP_
#define _ALADIN_ALADINRC_HPP_
#ifndef _ALADIN_ALADIN_H_
#include <aladin/aladin.h>
#endif
#endif

BIN
aladin/appicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

195
aladin/appreg.cpp Normal file
View File

@@ -0,0 +1,195 @@
#include <aladin/appreg.hpp>
#include <commctrl/commctrl.hpp>
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<String> &nameList)
{
nameList=mCachedNames;
return nameList.size()?true:false;
}
bool AppReg::setHistory(Block<String> &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;itemIndex<nameList.size();itemIndex++)mRegKeyHistory.setValue(nameList[itemIndex],0);
return nameList.size()?true:false;
}
bool AppReg::insertHistory(const String &strName)
{
for(int itemIndex=0;itemIndex<mCachedNames.size();itemIndex++)if(mCachedNames[itemIndex]==strName)return FALSE;
mCachedNames.insert(&strName);
if(mCachedNames.size()>MaxCachedNames)
{
Block<String> mruCachedNames;
for(int itemIndex=0;itemIndex<MaxCachedNames;itemIndex++)mruCachedNames.insert(&String());
for(itemIndex=0;itemIndex<MaxCachedNames;itemIndex++)mruCachedNames[mruCachedNames.size()-itemIndex-1]=mCachedNames[mCachedNames.size()-itemIndex-1];
mCachedNames=mruCachedNames;
setHistory(mCachedNames);
}
else mRegKeyHistory.setValue(strName,0);
return true;
}
void AppReg::cacheHistory(void)
{
int itemIndex(0);
String entryName;
DWORD status;
mCachedNames.remove();
while(mRegKeyHistory.enumValue(itemIndex++,entryName,status))mCachedNames.insert(&entryName);
}
bool AppReg::setBaud(const String &strBaud)
{
return mRegKeySerial.setValue(mSerialBaud,strBaud);
}
String AppReg::getBaud(void)
{
String strBaud;
mRegKeySerial.queryValue(mSerialBaud,strBaud);
return strBaud;
}
bool AppReg::setParity(const String &strParity)
{
return mRegKeySerial.setValue(mSerialParity,strParity);
}
String AppReg::getParity(void)
{
String strParity;
mRegKeySerial.queryValue(mSerialParity,strParity);
return strParity;
}
bool AppReg::setDataBits(const String &strDataBits)
{
return mRegKeySerial.setValue(mSerialData,strDataBits);
}
String AppReg::getDataBits(void)
{
String strData;
mRegKeySerial.queryValue(mSerialData,strData);
return strData;
}
bool AppReg::setStopBits(const String &stopBits)
{
return mRegKeySerial.setValue(mSerialStop,stopBits);
}
String AppReg::getStopBits(void)
{
String strStop;
mRegKeySerial.queryValue(mSerialStop,strStop);
return strStop;
}
bool AppReg::setPort(const String &strPort)
{
return mRegKeySerial.setValue(mSerialPort,strPort);
}
String AppReg::getPort(void)
{
String strPort;
mRegKeySerial.queryValue(mSerialPort,strPort);
return strPort;
}
String AppReg::getSerialSettings(void)
{
String serialSettings;
serialSettings+="baud=";
serialSettings+=getBaud();
serialSettings+=" ";
serialSettings+="parity=";
serialSettings+=getParity();
serialSettings+=" ";
serialSettings+="data=";
serialSettings+=getDataBits();
serialSettings+=" ";
serialSettings+="stop=";
serialSettings+=getStopBits();
return serialSettings;
}
void AppReg::guarantee(void)
{
if(!mRegKeySerial.openKey(mSerialKeyName))
{
CommControl commControl;
Block<String> 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();
}

57
aladin/appreg.hpp Normal file
View File

@@ -0,0 +1,57 @@
#ifndef _ALADIN_APPREG_HPP_
#define _ALADIN_APPREG_HPP_
#ifndef _COMMON_REGKEY_HPP_
#include <common/regkey.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _ALADIN_ALADINRC_HPP_
#include <aladin/aladinrc.hpp>
#endif
class AppReg
{
public:
AppReg(void);
AppReg(const AppReg &someAppReg);
virtual ~AppReg();
AppReg &operator=(const AppReg &someAppReg);
bool getHistory(Block<String> &nameList);
bool setHistory(Block<String> &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<String> mCachedNames;
};
#endif

39
aladin/bitmanip.hpp Normal file
View File

@@ -0,0 +1,39 @@
#ifndef _ALADIN_BITMANIP_HPP_
#define _ALADIN_BITMANIP_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#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

128
aladin/data/aladin.txt Normal file
View File

@@ -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 ?? ?? ...)..........??

BIN
aladin/data/aladin1.dat Normal file

Binary file not shown.

BIN
aladin/data/aladin2.dat Normal file

Binary file not shown.

128
aladin/data/aladin2.txt Normal file
View File

@@ -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.??

BIN
aladin/data/aladin3.dat Normal file

Binary file not shown.

BIN
aladin/data/dives.123 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
aladin/data/sean.log Normal file

Binary file not shown.

BIN
aladin/data/sean2.log Normal file

Binary file not shown.

BIN
aladin/data/seans.log Normal file

Binary file not shown.

BIN
aladin/data/seans.log.saf Normal file

Binary file not shown.

540
aladin/divedlg.cpp Normal file
View File

@@ -0,0 +1,540 @@
#include <aladin/divedlg.hpp>
#include <aladin/aladinrc.hpp>
#include <aladin/aladin.hpp>
#include <aladin/serdlg.hpp>
#include <aladin/graph.hpp>
#include <aladin/appreg.hpp>
#include <aladin/splash.hpp>
#include <common/odlstalt.hpp>
#include <common/block.hpp>
#include <common/puredwrd.hpp>
#include <common/opendlg.hpp>
#include <common/puremenu.hpp>
#include <common/regkey.hpp>
#include <common/process.hpp>
#include <common/profile.hpp>
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<PureDWORD> logStopArray;
Block<PureDWORD> 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;index<logBook.size();index++)
{
const DiveLog &diveLog=((LogBook&)logBook)[index];
String str=diveLog.getEntryTime().toStringShort()+String("\t");
str+=String().fromInt(diveLog.getMaxDepth())+String("\t");
str+=String().fromInt(diveLog.getBottomTime())+String("\t");
str+=diveLog.getSurfaceTime().toString()+String("\t");
str+=String().fromInt(diveLog.getWaterTemperature());
mLogList->addString(str);
}
for(index=0;index<profiles.size();index++)
{
String str=String("Profile_")+String().fromInt(index+1);
sendMessage(DB_PROFILES,CB_INSERTSTRING,-1,(LPARAM)str.str());
}
sendMessage(DB_PROFILES,CB_SETCURSEL,0,0L);
handleProfileChange();
}
void DiveDlg::handleProfileChange()
{
const Profiles &profiles=mDiveProfile.getProfile();
if(!profiles.size())return;
int index=sendMessage(DB_PROFILES,CB_GETCURSEL,0,0L);
mProfileList->resetContent();
DiveProfile &diveProfile=((Block<DiveProfile>&)profiles)[index];
for(index=0;index<diveProfile.size();index++)
{
ProfileData &profileData=diveProfile[index];
String str=String("\t")+String().fromInt(profileData.getStageTime())+String("\t")+String().fromInt(profileData.getDepth());
mProfileList->addString(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<String> 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<nameList.size();itemIndex++)
{
::sprintf(strItem,"%d) %s",itemIndex+1,(char*)nameList[itemIndex]);
fileMenu.appendMenu(StartDynamicID+itemIndex,strItem);
}
}

80
aladin/divedlg.hpp Normal file
View File

@@ -0,0 +1,80 @@
#ifndef _ALADIN_DIVEDLG_HPP_
#define _ALADIN_DIVEDLG_HPP_
#ifndef _COMMON_DWINDOW_HPP_
#include <common/dwindow.hpp>
#endif
#ifndef _COMMON_SMARTPOINTER_HPP_
#include <common/pointer.hpp>
#endif
#ifndef _COMMON_GLOBALDATA_HPP_
#include <common/gdata.hpp>
#endif
#ifndef _COMMON_CONTROL_HPP_
#include <common/control.hpp>
#endif
#ifndef _ALADIN_ALADIN_HPP_
#include <aladin/aladin.hpp>
#endif
class OwnerDrawListAltColor;
class OwnerDrawGraph;
class Worksheet;
class Profile;
class LogBook;
class DiveDlg : public DWindow
{
public:
DiveDlg(void);
virtual ~DiveDlg();
bool perform(void);
private:
enum{StatusBarID=101,StartDynamicID=20001};
DiveDlg(const DiveDlg &someDiveDlg);
DiveDlg &operator=(const DiveDlg &someDiveDlg);
CallbackData::ReturnType initHandler(CallbackData &someCallbackData);
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
void handleCancel(void);
void handleOk(void);
void setData(Aladin &diveInfo);
void clearData(void);
void handleImport(void);
void handleFileOpen(CallbackData &someCallbackData);
void handleFileOpenDevice(void);
void handleFileOpenLog(void);
void handleProfileChange(void);
void handleSaveAsWorksheet(void);
void handleSaveAsRaw(void);
void handleSaveAsText(void);
void handleSaveGraph(void);
void handleFileSaveLog(void);
void handleFileNew(void);
void handleSerialSettings(void);
void handleHelpAbout(void);
void handleHelpRegister(void);
void handleHelpHome(void);
void handleHelpHelp(void);
void handleHelpInterfaces(void);
void handleGraph(void);
void handleFileOpenLog(const String &strPathFileName);
void handleFileOpenRaw(const String &strPathFileName);
void applyHistory(void);
bool getBrowser(String &strBrowser);
void enableMenuItems(bool enable,bool enableSaveRaw=true);
void addDiveLog(Worksheet &worksheet,const LogBook &logBook,int startRow,int startCol);
void addProfile(Worksheet &worksheet,const Profile &profile,int startRow,int startCol);
Callback<DiveDlg> mInitHandler;
Callback<DiveDlg> mCreateHandler;
Callback<DiveDlg> mCloseHandler;
Callback<DiveDlg> mDestroyHandler;
Callback<DiveDlg> mCommandHandler;
SmartPointer<OwnerDrawListAltColor> mLogList;
SmartPointer<OwnerDrawListAltColor> mProfileList;
SmartPointer<OwnerDrawGraph> mOwnerDrawGraph;
Aladin mDiveProfile;
};
#endif

154
aladin/divelog.cpp Normal file
View File

@@ -0,0 +1,154 @@
#include <aladin/divelog.hpp>
#include <aladin/divetime.hpp>
#include <aladin/rawdata.hpp>
#include <common/file.hpp>
DiveLog::DiveLog()
{
mExtraInfo=0;
mBottomTime=0;
mMaxDepthHi=0;
mMaxDepthLo=0;
mSurfaceTimeHi=0;
mSurfaceTimeLo=0;
mTotalAirConsumption=0;
mEntryTime1=0;
mEntryTime2=0;
mEntryTime3=0;
mEntryTime4=0;
mWaterTemperature=0;
}
DiveLog::~DiveLog()
{
}
bool DiveLog::operator<(const DiveLog &diveLog)const
{
return getEntryTime()<diveLog.getEntryTime();
}
bool DiveLog::operator>(const DiveLog &diveLog)const
{
return getEntryTime()>diveLog.getEntryTime();
}
bool DiveLog::operator==(const DiveLog &diveLog)const
{
SystemTime srcEntryTime(getEntryTime());
SystemTime dstEntryTime(diveLog.getEntryTime());
if(srcEntryTime.year()!=dstEntryTime.year())return false;
if(srcEntryTime.month()!=dstEntryTime.month())return false;
if(srcEntryTime.day()!=dstEntryTime.day())return false;
if(srcEntryTime.hour()!=dstEntryTime.hour())return false;
if(srcEntryTime.minute()!=dstEntryTime.minute())return false;
if(srcEntryTime.second()!=dstEntryTime.second())return false;
return true;
}
int DiveLog::getBottomTime(void)const
{
int bottomTime=(((mBottomTime>>4)*10))+(mBottomTime&0x0F);
if(mExtraInfo&0x04)bottomTime+=100;
return bottomTime;
}
int DiveLog::getMaxDepth(void)const
{
double maxDepth(((double)((mMaxDepthHi*256)+mMaxDepthLo)*10.00)/4096.00);
return int((maxDepth*3.281)+.5);
}
int DiveLog::getAltitude(void)const
{
return 0;
}
int DiveLog::getWaterTemperature(void)const
{
return mWaterTemperature/4;
}
SystemTime DiveLog::getEntryTime(void)const
{
return DiveTime(mEntryTime1,mEntryTime2,mEntryTime3,mEntryTime4).getTime();
}
Time DiveLog::getSurfaceTime(void)const
{
return Time(mSurfaceTimeHi,mSurfaceTimeLo);
}
String DiveLog::toString(void)const
{
String str;
str+=String("Depth:")+String().fromInt(getMaxDepth())+String(" ");
str+=String("Entry:")+getEntryTime().toString()+String(" ");
str+=String("Temp:")+String().fromInt(getWaterTemperature())+String(" ");
str+=String("Bottom")+String().fromInt(getBottomTime())+String(" ");
str+=String("Surface:")+getSurfaceTime().toString();
return str;
}
bool DiveLog::readFrom(RawData &array,int &index)
{
try
{
mExtraInfo=array[index++];
mBottomTime=array[index++];
mMaxDepthHi=array[index++];
mMaxDepthLo=array[index++];
mSurfaceTimeHi=array[index++];
mSurfaceTimeLo=array[index++];
mTotalAirConsumption=array[index++];
mEntryTime1=array[index++];
mEntryTime2=array[index++];
mEntryTime3=array[index++];
mEntryTime4=array[index++];
mWaterTemperature=array[index++];
}
catch(ArrayIndexOutOfBoundsException exception)
{
::OutputDebugString(exception.toString()+String("\n"));
return false;
}
return true;
}
bool DiveLog::readFrom(File &inFile)
{
if(!inFile.isOkay())return false;
if(!inFile.read(&mExtraInfo,sizeof(mExtraInfo)))return false;
if(!inFile.read(&mBottomTime,sizeof(mBottomTime)))return false;
if(!inFile.read(&mMaxDepthHi,sizeof(mMaxDepthHi)))return false;
if(!inFile.read(&mMaxDepthLo,sizeof(mMaxDepthLo)))return false;
if(!inFile.read(&mSurfaceTimeHi,sizeof(mSurfaceTimeHi)))return false;
if(!inFile.read(&mSurfaceTimeLo,sizeof(mSurfaceTimeLo)))return false;
if(!inFile.read(&mTotalAirConsumption,sizeof(mTotalAirConsumption)))return false;
if(!inFile.read(&mEntryTime1,sizeof(mEntryTime1)))return false;
if(!inFile.read(&mEntryTime2,sizeof(mEntryTime2)))return false;
if(!inFile.read(&mEntryTime3,sizeof(mEntryTime3)))return false;
if(!inFile.read(&mEntryTime4,sizeof(mEntryTime4)))return false;
if(!inFile.read(&mWaterTemperature,sizeof(mWaterTemperature)))return false;
return true;
}
bool DiveLog::writeTo(File &outFile)
{
if(!outFile.isOkay())return false;
if(!outFile.write(&mExtraInfo,sizeof(mExtraInfo)))return false;
if(!outFile.write(&mBottomTime,sizeof(mBottomTime)))return false;
if(!outFile.write(&mMaxDepthHi,sizeof(mMaxDepthHi)))return false;
if(!outFile.write(&mMaxDepthLo,sizeof(mMaxDepthLo)))return false;
if(!outFile.write(&mSurfaceTimeHi,sizeof(mSurfaceTimeHi)))return false;
if(!outFile.write(&mSurfaceTimeLo,sizeof(mSurfaceTimeLo)))return false;
if(!outFile.write(&mTotalAirConsumption,sizeof(mTotalAirConsumption)))return false;
if(!outFile.write(&mEntryTime1,sizeof(mEntryTime1)))return false;
if(!outFile.write(&mEntryTime2,sizeof(mEntryTime2)))return false;
if(!outFile.write(&mEntryTime3,sizeof(mEntryTime3)))return false;
if(!outFile.write(&mEntryTime4,sizeof(mEntryTime4)))return false;
if(!outFile.write(&mWaterTemperature,sizeof(mWaterTemperature)))return false;
return true;
}

62
aladin/divelog.hpp Normal file
View File

@@ -0,0 +1,62 @@
#ifndef _ALADIN_DIVELOG_HPP_
#define _ALADIN_DIVELOG_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_ARRAY_HPP_
#include <common/array.hpp>
#endif
#ifndef _COMMON_STDIO_HPP_
#include <common/stdio.hpp>
#endif
#ifndef _COMMON_MATH_HPP_
#include <common/math.hpp>
#endif
#ifndef _COMMON_SYSTEMTIME_HPP_
#include <common/systime.hpp>
#endif
#ifndef _ALADIN_STATUS_HPP_
#include <aladin/status.hpp>
#endif
#ifndef _ALADIN_TIME_HPP_
#include <aladin/time.hpp>
#endif
#ifndef _ALADIN_RAWDATA_HPP_
#include <aladin/rawdata.hpp>
#endif
class File;
class DiveLog
{
public:
DiveLog();
virtual ~DiveLog();
int getAltitude(void)const;
int getMaxDepth(void)const;
SystemTime getEntryTime(void)const;
int getWaterTemperature(void)const;
int getBottomTime(void)const;
Time getSurfaceTime(void)const;
bool operator<(const DiveLog &diveLog)const;
bool operator>(const DiveLog &diveLog)const;
bool operator==(const DiveLog &diveLog)const;
String toString(void)const;
bool writeTo(File &outFile);
bool readFrom(File &inFile);
bool readFrom(RawData &array,int &index);
private:
BYTE mExtraInfo;
BYTE mBottomTime;
BYTE mMaxDepthHi;
BYTE mMaxDepthLo;
BYTE mSurfaceTimeHi;
BYTE mSurfaceTimeLo;
BYTE mTotalAirConsumption;
BYTE mEntryTime1;
BYTE mEntryTime2;
BYTE mEntryTime3;
BYTE mEntryTime4;
BYTE mWaterTemperature;
};
#endif

95
aladin/diveprofile.cpp Normal file
View File

@@ -0,0 +1,95 @@
#include <aladin/diveprofile.hpp>
#include <common/file.hpp>
DiveProfile::DiveProfile(void)
{
}
DiveProfile::DiveProfile(const DiveProfile &diveProfile)
{
*this=diveProfile;
}
DiveProfile::~DiveProfile()
{
}
DiveProfile &DiveProfile::operator=(const DiveProfile &diveProfile)
{
remove();
for(int index=0;index<diveProfile.size();index++)
{
ProfileData &profileData=((Block<ProfileData>&)diveProfile)[index];
insert(&ProfileData(profileData.getDepth(),profileData.getStageTime(),profileData.getWarning()));
}
return *this;
}
bool DiveProfile::operator==(const DiveProfile &diveProfile)const
{
if(size()!=diveProfile.size())return false;
for(int index=0;index<diveProfile.size();index++)
{
ProfileData &profileDataSrc=((Block<ProfileData>&)diveProfile)[index];
ProfileData &profileDataDst=((Block<ProfileData>&)*this)[index];
if(!(profileDataSrc==profileDataDst))return false;
}
return true;
}
bool DiveProfile::readFrom(File &inFile)
{
int count;
if(!inFile.isOkay())return false;
if(!inFile.read(&count,sizeof(count)))return false;
for(int index=0;index<count;index++)
{
insert(&ProfileData());
ProfileData &profileData=operator[](size()-1);
if(!profileData.readFrom(inFile))return false;
}
return true;
}
bool DiveProfile::writeTo(File &outFile)
{
int count;
if(!outFile.isOkay())return false;
count=size();
if(!outFile.write(&count,sizeof(count)))return false;
for(int index=0;index<count;index++)
{
if(!operator[](index).writeTo(outFile))return false;
}
return true;
}
String ProfileData::getWarningString(void)const
{
String strWarning;
if(mWarning&TransmitErrorAirPressure)strWarning+="transmit error air pressure.";
if(mWarning&WorkTooHard){if(!strWarning.isNull())strWarning+=",";strWarning+="work too hard.";}
if(mWarning&CeilingViolationOfDeco){if(!strWarning.isNull())strWarning+=",";strWarning+="ceiling violation of deco.";}
if(mWarning&AscentTooFast){if(!strWarning.isNull())strWarning+=",";strWarning+="ascent too fast.";}
if(mWarning&RemainingBottomTimeTooShort){if(!strWarning.isNull())strWarning+=",";strWarning+="remaining bottom time too short.";}
if(mWarning&DecoStop){if(!strWarning.isNull())strWarning+=",";strWarning+="decompression stop.";}
if(!mWarning)strWarning+="no warnings";
return strWarning;
}
int DiveProfile::getMaxDepth(void)const
{
int maxDepth=0;
int count=size();
for(int index=0;index<count;index++)
{
if(((Block<ProfileData>&)*this).operator[](index).getDepth()>maxDepth)maxDepth=((Block<ProfileData>&)*this).operator[](index).getDepth();
}
return maxDepth;
}
int DiveProfile::getBottomTime(void)const
{
return ((Block<ProfileData>&)*this).operator[](size()-1).getStageTime()/60;
}

26
aladin/diveprofile.hpp Normal file
View File

@@ -0,0 +1,26 @@
#ifndef _ALADIN_DIVEPROFILE_HPP_
#define _ALADIN_DIVEPROFILE_HPP_
#ifndef _COMMON_BLOCK_HPP_
#include <common/block.hpp>
#endif
#ifndef _ALADIN_PROFILEDATA_HPP_
#include <aladin/profiledata.hpp>
#endif
class File;
class DiveProfile : public Block<ProfileData>
{
public:
DiveProfile(void);
DiveProfile(const DiveProfile &diveProfile);
virtual ~DiveProfile();
DiveProfile &operator=(const DiveProfile &diveProfile);
bool operator==(const DiveProfile &diveProfile)const;
bool readFrom(File &inFile);
bool writeTo(File &outFile);
int getMaxDepth(void)const;
int getBottomTime(void)const;
private:
};
#endif

BIN
aladin/dives.123 Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

62
aladin/divetime.hpp Normal file
View File

@@ -0,0 +1,62 @@
#ifndef _ALADIN_DIVETIME_HPP_
#define _ALADIN_DIVETIME_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_SYSTEMTIME_HPP_
#include <common/systime.hpp>
#endif
#ifndef _COMMON_MATH_HPP_
#include <common/math.hpp>
#endif
#ifndef _COMMON_SDATE_HPP_
#include <common/sdate.hpp>
#endif
class DiveTime
{
public:
DiveTime();
DiveTime(BYTE b1,BYTE b2,BYTE b3,BYTE b4);
virtual ~DiveTime();
const SystemTime &setTime(BYTE b1,BYTE b2,BYTE b3,BYTE b4);
const SystemTime &getTime(void)const;
private:
SystemTime mDiveTime;
};
inline
DiveTime::DiveTime()
{
}
inline
DiveTime::DiveTime(BYTE b1,BYTE b2,BYTE b3,BYTE b4)
{
setTime(b1,b2,b3,b4);
}
inline
DiveTime::~DiveTime()
{
}
inline
const SystemTime &DiveTime::setTime(BYTE b1,BYTE b2,BYTE b3,BYTE b4)
{
int entryTime=b1*Math::power(2,24)+b2*Math::power(2,16)+b3*Math::power(2,8)+b4;
int divisor=entryTime/172800;
int remainder=entryTime%172800;
int hours=remainder/7200;
int minutes=(remainder/120)%60;
SDate entryDate=SDate().daysAddActual(SDate(1,1,1994),divisor);
mDiveTime.makeTime(entryDate.year(),entryDate.month(),entryDate.day(),hours,minutes,0);
return mDiveTime;
}
inline
const SystemTime &DiveTime::getTime(void)const
{
return mDiveTime;
}
#endif

BIN
aladin/flag.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

199
aladin/graph.cpp Normal file
View File

@@ -0,0 +1,199 @@
#include <aladin/graph.hpp>
#include <aladin/profiledata.hpp>
#include <common/purehdc.hpp>
#include <common/resbmp.hpp>
#include <common/drawitem.hpp>
#include <jpgimg/dib24.hpp>
#include <jpgimg/jpgimg.hpp>
OwnerDrawGraph::OwnerDrawGraph(GUIWindow &parentWnd,HWND hControlWnd,UINT controlID)
: mParentWnd(parentWnd), Control(hControlWnd,controlID), mHasData(false)
{
PureDevice pureDevice(*this);
mBkGndBrush.createHatchBrush(Brush::HDiag,RGBColor(255,0,0));
mDIBitmap=new DIB24();
mDIBitmap.disposition(PointerDisposition::Delete);
mDIBitmap->create(width(),height(),pureDevice);
mDrawItemHandler.setCallback(this,&OwnerDrawGraph::drawItemHandler);
mControlColorHandler.setCallback(this,&OwnerDrawGraph::controlColorHandler);
mParentWnd.insertHandler(VectorHandler::DrawItemHandler,&mDrawItemHandler);
mParentWnd.insertHandler(VectorHandler::ControlColorHandler,&mControlColorHandler);
}
OwnerDrawGraph::~OwnerDrawGraph()
{
mParentWnd.removeHandler(VectorHandler::DrawItemHandler,&mDrawItemHandler);
mParentWnd.removeHandler(VectorHandler::ControlColorHandler,&mControlColorHandler);
}
CallbackData::ReturnType OwnerDrawGraph::drawItemHandler(CallbackData &someCallbackData)
{
DrawItem drawItem(*((LPDRAWITEMSTRUCT)someCallbackData.lParam()));
if(drawItem.controlID()!=controlID())return (CallbackData::ReturnType)TRUE;
return handleDraw(drawItem);
}
CallbackData::ReturnType OwnerDrawGraph::controlColorHandler(CallbackData &someCallbackData)
{
Control wndButton((HWND)someCallbackData.lParam(),::GetDlgCtrlID((HWND)someCallbackData.lParam()),FALSE);
if(!(*this==wndButton))return (CallbackData::ReturnType)FALSE;
PureDevice pureDevice((HDC)someCallbackData.wParam());
return handleControlColor(pureDevice,wndButton);
}
void OwnerDrawGraph::drawBitmap(const DrawItem &drawItem)
{
PureDevice displayDevice(drawItem.deviceContext());
mDIBitmap->bitBlt(displayDevice,Rect(0,0,width(),height()),Point(0,0));
}
// *************** virtuals
WORD OwnerDrawGraph::handleDraw(const DrawItem &drawItem)
{
WORD retCode(TRUE);
switch(drawItem.itemAction())
{
case ODA_DRAWENTIRE :
drawEntire(drawItem);
break;
case ODA_SELECT :
retCode=drawSelect(drawItem);
break;
case ODA_FOCUS :
drawFocus(drawItem);
break;
}
return retCode;
}
WORD OwnerDrawGraph::handleMeasureItem(MeasureItem &/*measureItem*/)
{
return TRUE;
}
LPARAM OwnerDrawGraph::handleControlColor(PureDevice &/*pureDevice*/,Control &/*wndButton*/)
{
return (CallbackData::ReturnType)mBkGndBrush.getBrush();
}
void OwnerDrawGraph::drawEntire(const DrawItem &drawItem)
{
if(drawItem.itemState()&ODS_SELECTED)drawBitmap(drawItem);
else if(drawItem.itemState()&ODS_FOCUS)drawBitmap(drawItem);
else if(drawItem.itemState()&ODS_DISABLED)drawBitmap(drawItem);
else drawBitmap(drawItem);
drawButtonText(drawItem);
drawButtonLines(drawItem);
return;
}
WORD OwnerDrawGraph::drawSelect(const DrawItem &drawItem)
{
WORD retCode(TRUE);
if(drawItem.itemState()&ODS_SELECTED)drawBitmap(drawItem);
else {drawBitmap(drawItem);retCode=FALSE;}
drawButtonText(drawItem);
drawButtonLines(drawItem);
return retCode;
}
void OwnerDrawGraph::drawFocus(const DrawItem &drawItem)
{
if(drawItem.itemState()&ODS_FOCUS)drawBitmap(drawItem);
else drawBitmap(drawItem);
drawButtonText(drawItem);
drawButtonLines(drawItem);
return;
}
void OwnerDrawGraph::drawButtonText(const DrawItem &drawItem)
{
/* TEXTMETRIC textMetric;
Rect drawRect;
String strText;
PureDevice controlDevice(drawItem.deviceContext());
windowText(strText);
if(strText.isNull())return;
controlDevice.setBkMode(PureDevice::Transparent);
controlDevice.select((GDIObj)mTextFont,TRUE);
controlDevice.setTextColor(textColor());
::GetTextMetrics(drawItem.deviceContext(),&textMetric);
drawRect=drawItem.rectItem();
controlDevice.textOut(0,(drawRect.bottom()+drawRect.top()-textMetric.tmHeight)/2,strText);
controlDevice.select((GDIObj)mTextFont,FALSE); */
}
void OwnerDrawGraph::drawButtonLines(const DrawItem &drawItem)
{
PureDevice controlDevice(drawItem.deviceContext());
controlDevice.line(Point(0,0),Point(width(),0),RGBColor(0,0,0));
controlDevice.line(Point(0,0),Point(0,height()),RGBColor(0,0,0));
controlDevice.line(Point(0,height()-1),Point(width(),height()-1),RGBColor(255,255,255));
controlDevice.line(Point(width(),height()-1),Point(width()-1,0),RGBColor(255,255,255));
}
void OwnerDrawGraph::clearData(void)
{
mDIBitmap->setBits(0);
mHasData=false;
}
void OwnerDrawGraph::setData(DiveProfile &diveProfile)
{
Block<ProfileData> &profileData=(Block<ProfileData> &)diveProfile;
int maxDepth(getMaxDepth(profileData));
double wRatio=(double)width()/(double)profileData.size();
double hRatio=((double)height()/maxDepth)-.05;
double x=wRatio;
mDIBitmap->setBits(0);
for(int index=0;index<profileData.size()-1;index++)
{
ProfileData &pData=profileData[index];
ProfileData &pNextData=profileData[index+1];
mDIBitmap->line(Point(x,height()-(int)(double)pData.getDepth()*(double)hRatio),Point(x+wRatio,height()-(int)(double)pNextData.getDepth()*(double)hRatio),RGB888(0,255,0));
x+=wRatio;
}
mHasData=true;
}
int OwnerDrawGraph::getMaxDepth(Block<ProfileData> &profileData)
{
int maxDepth(0);
for(int index=0;index<profileData.size();index++)
{
ProfileData &pData=profileData[index];
if(pData.getDepth()>maxDepth)maxDepth=pData.getDepth();
}
return maxDepth;
}
bool OwnerDrawGraph::saveBitmap(const String &strPathFileName)
{
JPGImage jpgImage;
RGB888 rgb888;
BitmapInfo &bmInfo=jpgImage.getBitmapInfo();
bmInfo.bitCount(BitmapInfo::Bit24);
bmInfo.width(mDIBitmap->width());
bmInfo.height(mDIBitmap->height());
bmInfo.colorUsed(0);
bmInfo.colorImportant(0);
jpgImage.getRGBArray().size(mDIBitmap->extent());
for(int row=0;row<mDIBitmap->height();row++)
{
for(int col=0;col<mDIBitmap->width();col++)
{
mDIBitmap->getAt(row,col,rgb888);
jpgImage.setAt(row,col,rgb888);
}
}
jpgImage.saveBitmap(strPathFileName);
return true;
}

62
aladin/graph.hpp Normal file
View File

@@ -0,0 +1,62 @@
#ifndef _ALADIN_OWNERDRAWGRAPH_HPP_
#define _ALADIN_OWNERDRAWGRAPH_HPP_
#ifndef _COMMON_CONTROL_HPP_
#include <common/control.hpp>
#endif
#ifndef _COMMON_BRUSH_HPP_
#include <common/brush.hpp>
#endif
#ifndef _COMMON_ARRAY_HPP_
#include <common/array.hpp>
#endif
#ifndef _ALADIN_DIVEPROFILE_HPP_
#include <aladin/diveprofile.hpp>
#endif
class DrawItem;
class MeasureItem;
class PureDevice;
class DIB24;
class FloatPairs;
class OwnerDrawGraph : public Control
{
public:
OwnerDrawGraph(GUIWindow &parentWnd,HWND hControlWnd,UINT controlID);
virtual ~OwnerDrawGraph();
void setData(DiveProfile &diveProfile);
void clearData(void);
bool hasData(void)const;
bool saveBitmap(const String &strPathFileName);
protected:
virtual WORD handleDraw(const DrawItem &drawItem);
virtual WORD handleMeasureItem(MeasureItem &measureItem);
virtual LPARAM handleControlColor(PureDevice &pureDevice,Control &wndButton);
virtual void drawEntire(const DrawItem &drawItem);
virtual WORD drawSelect(const DrawItem &drawItem);
virtual void drawFocus(const DrawItem &drawItem);
virtual void drawButtonText(const DrawItem &drawItem);
virtual void drawButtonLines(const DrawItem &drawItem);
private:
OwnerDrawGraph &operator=(const OwnerDrawGraph &someOwnerDrawGraph);
void drawBitmap(const DrawItem &drawItem);
CallbackData::ReturnType drawItemHandler(CallbackData &someCallbackData);
CallbackData::ReturnType controlColorHandler(CallbackData &someCallbackData);
int getMaxDepth(Block<ProfileData> &profileData);
Callback<OwnerDrawGraph> mDrawItemHandler;
Callback<OwnerDrawGraph> mMeasureItemHandler;
Callback<OwnerDrawGraph> mControlColorHandler;
SmartPointer<DiveProfile> mDiveProfile;
SmartPointer<DIB24> mDIBitmap;
Brush mBkGndBrush;
GUIWindow &mParentWnd;
bool mHasData;
};
inline
bool OwnerDrawGraph::hasData(void)const
{
return mHasData;
}
#endif

15
aladin/hold/Main.cpp Normal file
View File

@@ -0,0 +1,15 @@
#include <common/windows.hpp>
#include <common/string.hpp>
#include <aladin/mainwnd.hpp>
#include <aladin/divedlg.hpp>
#include <aladin/splash.hpp>
#include <aladin/resource.hpp>
int PASCAL WinMain(HINSTANCE /*hInstance*/,HINSTANCE /*hPrevInstance*/,LPSTR lpszCmdLine,int /*nCmdShow*/)
{
SplashScreen splashScreen("SPLASH",String(STRING_SPLASHURL),String(STRING_APPNAME));
splashScreen.perform();
DiveDlg diveDlg;
diveDlg.perform();
return false;
}

259
aladin/hold/aladin.cpp Normal file
View File

@@ -0,0 +1,259 @@
#include <aladin/aladin.hpp>
#include <aladin/appreg.hpp>
#include <aladin/bitmanip.hpp>
#include <worksht/worksht.hpp>
#include <common/file.hpp>
#include <common/array.hpp>
#include <common/console.hpp>
#include <commctrl/commctrl.hpp>
#include <commctrl/fmtlines.hpp>
#include <common/guiwnd.hpp>
#include <common/progress.hpp>
Aladin::Aladin()
: mIsOkay(false)
{
mRawData.size(2046);
}
Aladin::~Aladin()
{
}
bool Aladin::openFile(const String &strPathFileName)
{
BYTE header[4];
mIsOkay=false;
File inFile;
if(!inFile.open(strPathFileName,"rb"))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::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<mLogBook.size();index++)
{
const DiveLog &diveLog=((LogBook&)mLogBook)[index];
SystemTime systemTime=diveLog.getEntryTime();
String strLine;
::sprintf(strLine,"%02d-%02d-%4d ",systemTime.month(),systemTime.day(),systemTime.year());
strLine+=String().fromInt(diveLog.getMaxDepth())+String(" ");
strLine+=String().fromInt(diveLog.getBottomTime())+String(" ");
strLine+=diveLog.getSurfaceTime().toString()+String(" ");
strLine+=String().fromInt(diveLog.getWaterTemperature());
outFile.writeLine(strLine);
}
for(int pIndex=0;pIndex<mProfiles.size();pIndex++)
{
DiveProfile &diveProfile=((Block<DiveProfile>&)mProfiles)[pIndex];
outFile.writeLine(" ");
outFile.writeLine(" ");
outFile.writeLine(String("Profile_")+String().fromInt(pIndex+1));
outFile.writeLine("Time Depth");
for(int diveIndex=0;diveIndex<diveProfile.size();diveIndex++)
{
ProfileData &profileData=diveProfile[diveIndex];
outFile.writeLine(String().fromInt(profileData.getStageTime())+String(" ")+String().fromInt(profileData.getDepth()));
}
}
return true;
}
bool Aladin::saveWorksheet(const String &strPathFileName)
{
Worksheet worksheet;
worksheet.setDimensions(100,100);
addDiveLog(worksheet,getLogBook(),0,1);
addProfile(worksheet,getProfile(),0,7);
return worksheet.save(strPathFileName);
}
bool Aladin::openDevice(const String &port,GUIWindow &parent)
{
DeviceControlBlock dcb;
CommControl control;
String strCommState;
AppReg appReg;
Block<String> 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;
}
const CurrentStatus &Aladin::getStatus(void)const
{
return mStatus;
}
const Information &Aladin::getInformation(void)const
{
return mInformation;
}
const Profiles &Aladin::getProfile(void)const
{
return mProfiles;
}
const LogBook &Aladin::getLogBook(void)const
{
return mLogBook;
}
bool Aladin::getControlData(CommControl &control,Progress &progress)
{
char rcvChar;
char syncBuff[]={'U','U','U','\0'};
int index=0;
int skipped=0;
int waitTime=0;
while(!control.hasData()&&waitTime<500)
{
progress.yieldTask();
::Sleep(100);
waitTime+=100;
}
if(!control.hasData())return false;
::memset(&mRawData[0],0,mRawData.size());
while((sizeof(syncBuff)!=index)&&(skipped<mRawData.size()+4))
{
progress.yieldTask();
if(!progress.isOkay())return false;
control.read(&rcvChar,sizeof(rcvChar));
if(0==rcvChar&&!index){continue;}
if(rcvChar==syncBuff[index])index++;
else {index=0;skipped++;}
}
progress.setCaption("Acquire..., (Press ESC to cancel)");
progress.setText("Acquiring data...");
progress++;
if(sizeof(syncBuff)!=index)return false;
control.readFully((unsigned char*)&mRawData[0],mRawData.size());
for(index=0;index<mRawData.size();index++)mRawData[index]=BitManip::reverse(mRawData[index]);
progress.setCaption("Success");
progress.setText("Data acquisition complete.");
progress++;
return true;
}
bool Aladin::readRaw(Array<BYTE> &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<logBook.size();index++)
{
const DiveLog &diveLog=((LogBook&)logBook)[index];
startRow++;
worksheet.setAt(startRow,startCol,diveLog.getEntryTime().toString());
worksheet.setAt(startRow,startCol+1,diveLog.getMaxDepth());
worksheet.setAt(startRow,startCol+2,diveLog.getBottomTime());
worksheet.setAt(startRow,startCol+3,diveLog.getSurfaceTime().toString());
worksheet.setAt(startRow,startCol+4,diveLog.getWaterTemperature());
}
}
void Aladin::addProfile(Worksheet &worksheet,const Profiles &profiles,int startRow,int startCol)
{
int sRow(startRow);
for(int pIndex=0;pIndex<profiles.size();pIndex++)
{
DiveProfile &diveProfile=((Block<DiveProfile>&)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<diveProfile.size();diveIndex++)
{
ProfileData &profileData=diveProfile[diveIndex];
worksheet.setAt(sRow,startCol,profileData.getStageTime());
worksheet.setAt(sRow++,startCol+1,profileData.getDepth());
}
startCol+=2;
}
}

82
aladin/hold/aladin.hpp Normal file
View File

@@ -0,0 +1,82 @@
#ifndef _ALADIN_ALADIN_HPP_
#define _ALADIN_ALADIN_HPP_
#ifndef _PROTO_STATUS_HPP_
#include <aladin/status.hpp>
#endif
#ifndef _ALADIN_INFORMATION_HPP_
#include <aladin/information.hpp>
#endif
#ifndef _ALADIN_PROFILES_HPP_
#include <aladin/profiles.hpp>
#endif
#ifndef _ALADIN_PROFILEDATA_HPP_
#include <aladin/profiledata.hpp>
#endif
#ifndef _ALADIN_LOGBOOK_HPP_
#include <aladin/logbook.hpp>
#endif
class CommControl;
class GUIWindow;
class Progress;
class Worksheet;
class Aladin
{
public:
Aladin();
virtual ~Aladin();
bool openFile(const String &strPathFileName);
bool openDevice(const String &port,GUIWindow &parent);
bool saveRaw(const String &strPathFileName);
bool saveWorksheet(const String &strPathFileName);
bool saveText(const String &strPathFileName);
const CurrentStatus &getStatus(void)const;
const Information &getInformation(void)const;
const Profiles &getProfile(void)const;
const LogBook &getLogBook(void)const;
bool isMerged(void)const;
void isMerged(bool bMerged);
void clear(void);
bool isOkay(void)const;
private:
bool readRaw(Array<BYTE> &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;
Array<BYTE> mRawData;
bool mIsMerged;
bool mIsOkay;
};
inline
bool Aladin::isOkay(void)const
{
return mIsOkay;
}
inline
bool Aladin::isMerged(void)const
{
return mIsMerged;
}
inline
void Aladin::isMerged(bool bMerged)
{
mIsMerged=bMerged;
}
inline
void Aladin::clear(void)
{
mIsMerged=false;
mProfiles.remove();
mLogBook.remove();
}
#endif

6
aladin/hold/aladinrc.hpp Normal file
View File

@@ -0,0 +1,6 @@
#ifndef _ALADIN_ALADINRC_HPP_
#define _ALADIN_ALADINRC_HPP_
#ifndef _ALADIN_ALADIN_H_
#include <aladin/aladin.h>
#endif
#endif

142
aladin/hold/appreg.cpp Normal file
View File

@@ -0,0 +1,142 @@
#include <aladin/appreg.hpp>
#include <commctrl/commctrl.hpp>
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),
mRegKeySerial(RegKey::CurrentUser)
{
guarantee();
}
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::setBaud(const String &strBaud)
{
return mRegKeySerial.setValue(mSerialBaud,strBaud);
}
String AppReg::getBaud(void)
{
String strBaud;
mRegKeySerial.queryValue(mSerialBaud,strBaud);
return strBaud;
}
bool AppReg::setParity(const String &strParity)
{
return mRegKeySerial.setValue(mSerialParity,strParity);
}
String AppReg::getParity(void)
{
String strParity;
mRegKeySerial.queryValue(mSerialParity,strParity);
return strParity;
}
bool AppReg::setDataBits(const String &strDataBits)
{
return mRegKeySerial.setValue(mSerialData,strDataBits);
}
String AppReg::getDataBits(void)
{
String strData;
mRegKeySerial.queryValue(mSerialData,strData);
return strData;
}
bool AppReg::setStopBits(const String &stopBits)
{
return mRegKeySerial.setValue(mSerialStop,stopBits);
}
String AppReg::getStopBits(void)
{
String strStop;
mRegKeySerial.queryValue(mSerialStop,strStop);
return strStop;
}
bool AppReg::setPort(const String &strPort)
{
return mRegKeySerial.setValue(mSerialPort,strPort);
}
String AppReg::getPort(void)
{
String strPort;
mRegKeySerial.queryValue(mSerialPort,strPort);
return strPort;
}
String AppReg::getSerialSettings(void)
{
String serialSettings;
serialSettings+="baud=";
serialSettings+=getBaud();
serialSettings+=" ";
serialSettings+="parity=";
serialSettings+=getParity();
serialSettings+=" ";
serialSettings+="data=";
serialSettings+=getDataBits();
serialSettings+=" ";
serialSettings+="stop=";
serialSettings+=getStopBits();
return serialSettings;
}
void AppReg::guarantee(void)
{
if(!mRegKeySerial.openKey(mSerialKeyName))
{
CommControl commControl;
Block<String> deviceList;
commControl.enumerateDevices(deviceList);
mRegKeySerial.createKey(mSerialKeyName,"");
mRegKeySerial.openKey(mSerialKeyName);
setBaud("19200");
setParity("N");
setDataBits("8");
setStopBits("1");
setPort(deviceList.size()?deviceList[0]:"COM1");
}
}
BOOL AppReg::isOkay(void)const
{
return mRegKeySerial.isOkay();
}

45
aladin/hold/appreg.hpp Normal file
View File

@@ -0,0 +1,45 @@
#ifndef _ALADIN_APPREG_HPP_
#define _ALADIN_APPREG_HPP_
#ifndef _COMMON_REGKEY_HPP_
#include <common/regkey.hpp>
#endif
#ifndef _COMMON_STRING_HPP_
#include <common/string.hpp>
#endif
#ifndef _ALADIN_ALADINRC_HPP_
#include <aladin/aladinrc.hpp>
#endif
class AppReg
{
public:
AppReg(void);
AppReg(const AppReg &someAppReg);
virtual ~AppReg();
AppReg &operator=(const AppReg &someAppReg);
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:
void guarantee(void);
String mSerialKeyName;
String mSettingsEMAIL;
String mAladinKeyName;
String mSerialPort;
String mSerialBaud;
String mSerialData;
String mSerialParity;
String mSerialStop;
RegKey mRegKeySerial;
};
#endif

39
aladin/hold/bitmanip.hpp Normal file
View File

@@ -0,0 +1,39 @@
#ifndef _ALADIN_BITMANIP_HPP_
#define _ALADIN_BITMANIP_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#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

351
aladin/hold/divedlg.cpp Normal file
View File

@@ -0,0 +1,351 @@
#include <aladin/divedlg.hpp>
#include <aladin/aladinrc.hpp>
#include <aladin/aladin.hpp>
#include <aladin/serdlg.hpp>
#include <aladin/graph.hpp>
#include <aladin/appreg.hpp>
#include <aladin/splash.hpp>
#include <common/odlstalt.hpp>
#include <common/block.hpp>
#include <common/puredwrd.hpp>
#include <common/opendlg.hpp>
#include <common/puremenu.hpp>
#include <common/regkey.hpp>
#include <common/process.hpp>
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;
::GetClassName(*this,strClass,String::MaxString);
::SetClassLong(*this,GCL_HICON,(LONG)::LoadIcon(processInstance(),"APPICON"));
PureMenu windowMenu(::GetMenu(*this));
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));
mOwnerDrawGraph=new OwnerDrawGraph(*this,getItem(DB_GRAPH),DB_GRAPH);
mOwnerDrawGraph.disposition(PointerDisposition::Delete);
setCaption(String(STRING_APPNAME)+String(" ")+String(STRING_VERSION));
Block<PureDWORD> logStopArray;
Block<PureDWORD> 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);
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_OPEN :
handleFileOpen();
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_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 DB_PROFILES :
if(CBN_SELCHANGE==someCallbackData.wmCommandCommand())
handleProfileChange();
break;
}
return (CallbackData::ReturnType)FALSE;
}
void DiveDlg::handleCancel()
{
endDialog(false);
}
void DiveDlg::handleOk()
{
endDialog(true);
}
void DiveDlg::handleSerialSettings()
{
SerialDlg serialDlg;
serialDlg.perform(*this);
}
void DiveDlg::handleFileOpen()
{
PureMenu windowMenu(::GetMenu(*this));
AppReg appReg;
if(!mDiveProfile.openDevice(appReg.getPort(),*this))return;
// if(mDiveProfile.isOkay())
// {
// ::MessageBox(*this,"Merge into currently loaded log?","Confirm",MB_YESNOCANCEL);
// }
windowMenu.getSubMenu(0,windowMenu);
windowMenu.enableMenuItem(APPMENU_FILE_SAVEWORKSHEET,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
windowMenu.enableMenuItem(APPMENU_FILE_SAVERAW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
windowMenu.enableMenuItem(APPMENU_FILE_SAVETEXT,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
setCaption(String(STRING_APPNAME)+String(" ")+String(STRING_VERSION)+String(" (Device:")+appReg.getPort()+String(")"));
setData(mDiveProfile);
}
void DiveDlg::handleImport()
{
PureMenu windowMenu(::GetMenu(*this));
OpenDialog openDialog;
String strPathFileName;
LRESULT result;
if(!openDialog.getOpenFileName(*this,"*.dat","Open File","*.dat",strPathFileName))return;
if(mDiveProfile.isOkay())
{
result=::MessageBox(*this,"Merge into currently loaded log?","Confirm",MB_YESNOCANCEL);
}
if(!mDiveProfile.openFile(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(")"));
windowMenu.getSubMenu(0,windowMenu);
windowMenu.enableMenuItem(APPMENU_FILE_SAVEWORKSHEET,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
windowMenu.enableMenuItem(APPMENU_FILE_SAVERAW,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
windowMenu.enableMenuItem(APPMENU_FILE_SAVETEXT,PureMenu::ByCommand,PureMenu::InsertFlags(PureMenu::ItemEnabled));
setData(mDiveProfile);
}
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);
for(index=0;index<logBook.size();index++)
{
const DiveLog &diveLog=((LogBook&)logBook)[index];
String str=diveLog.getEntryTime().toString()+String("\t");
str+=String().fromInt(diveLog.getMaxDepth())+String("\t");
str+=String().fromInt(diveLog.getBottomTime())+String("\t");
str+=diveLog.getSurfaceTime().toString()+String("\t");
str+=String().fromInt(diveLog.getWaterTemperature());
mLogList->addString(str);
}
for(index=0;index<profiles.size();index++)
{
String str=String("Profile_")+String().fromInt(index+1);
sendMessage(DB_PROFILES,CB_INSERTSTRING,-1,(LPARAM)str.str());
}
sendMessage(DB_PROFILES,CB_SETCURSEL,0,0L);
handleProfileChange();
}
void DiveDlg::handleProfileChange()
{
const Profiles &profiles=mDiveProfile.getProfile();
int index=sendMessage(DB_PROFILES,CB_GETCURSEL,0,0L);
mProfileList->resetContent();
DiveProfile &diveProfile=((Block<DiveProfile>&)profiles)[index];
for(index=0;index<diveProfile.size();index++)
{
ProfileData &profileData=diveProfile[index];
String str=String("\t")+String().fromInt(profileData.getStageTime())+String("\t")+String().fromInt(profileData.getDepth());
mProfileList->addString(str);
}
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::handleHelpAbout()
{
SplashScreen splashScreen("SPLASH",String(STRING_SPLASHURL),String(STRING_APPNAME));
splashScreen.perform();
}
void DiveDlg::handleHelpHelp()
{
RegKey regKey(RegKey::LocalMachine);
String strCommand;
Process process;
if(!regKey.openKey(String(STRING_BROWSERKEY)))return;
if(!regKey.enumValue(0,String(STRING_BROWSERCOMMAND),strCommand)||strCommand.isNull())
{
::MessageBox(*this,"Cannot locate default browser","Help->Home",MB_OK);
return;
}
strCommand.removeTokens("'\"");
process.createProcess(strCommand,String(" ")+String(STRING_HOST)+String(STRING_HELPPAGE),false);
}
void DiveDlg::handleHelpRegister()
{
RegKey regKey(RegKey::LocalMachine);
String strCommand;
Process process;
if(!regKey.openKey(String(STRING_BROWSERKEY)))return;
if(!regKey.enumValue(0,String(STRING_BROWSERCOMMAND),strCommand)||strCommand.isNull())
{
::MessageBox(*this,"Cannot locate default browser","Help->Home",MB_OK);
return;
}
strCommand.removeTokens("'\"");
process.createProcess(strCommand,String(" ")+String(STRING_HOST)+String(STRING_REGISTERPAGE),false);
}
void DiveDlg::handleHelpHome()
{
RegKey regKey(RegKey::LocalMachine);
String strCommand;
Process process;
if(!regKey.openKey(String(STRING_BROWSERKEY)))return;
if(!regKey.enumValue(0,String(STRING_BROWSERCOMMAND),strCommand)||strCommand.isNull())
{
::MessageBox(*this,"Cannot locate default browser","Help->Home",MB_OK);
return;
}
strCommand.removeTokens("'\"");
process.createProcess(strCommand,String(" ")+String(STRING_HOST)+String(STRING_HOMEPAGE),false);
}

67
aladin/hold/divedlg.hpp Normal file
View File

@@ -0,0 +1,67 @@
#ifndef _ALADIN_DIVEDLG_HPP_
#define _ALADIN_DIVEDLG_HPP_
#ifndef _COMMON_DWINDOW_HPP_
#include <common/dwindow.hpp>
#endif
#ifndef _COMMON_SMARTPOINTER_HPP_
#include <common/pointer.hpp>
#endif
#ifndef _COMMON_GLOBALDATA_HPP_
#include <common/gdata.hpp>
#endif
#ifndef _COMMON_CONTROL_HPP_
#include <common/control.hpp>
#endif
#ifndef _ALADIN_ALADIN_HPP_
#include <aladin/aladin.hpp>
#endif
class OwnerDrawListAltColor;
class OwnerDrawGraph;
class Worksheet;
class Profile;
class LogBook;
class DiveDlg : public DWindow
{
public:
DiveDlg(void);
virtual ~DiveDlg();
bool perform(void);
private:
enum{StatusBarID=101};
DiveDlg(const DiveDlg &someDiveDlg);
DiveDlg &operator=(const DiveDlg &someDiveDlg);
CallbackData::ReturnType initHandler(CallbackData &someCallbackData);
CallbackData::ReturnType createHandler(CallbackData &someCallbackData);
CallbackData::ReturnType closeHandler(CallbackData &someCallbackData);
CallbackData::ReturnType destroyHandler(CallbackData &someCallbackData);
CallbackData::ReturnType commandHandler(CallbackData &someCallbackData);
void handleCancel(void);
void handleOk(void);
void setData(Aladin &diveInfo);
void handleImport(void);
void handleFileOpen();
void handleProfileChange(void);
void handleSaveAsWorksheet(void);
void handleSaveAsRaw(void);
void handleSaveAsText(void);
void handleSerialSettings(void);
void handleHelpAbout(void);
void handleHelpRegister(void);
void handleHelpHome(void);
void handleHelpHelp(void);
void addDiveLog(Worksheet &worksheet,const LogBook &logBook,int startRow,int startCol);
void addProfile(Worksheet &worksheet,const Profile &profile,int startRow,int startCol);
Callback<DiveDlg> mInitHandler;
Callback<DiveDlg> mCreateHandler;
Callback<DiveDlg> mCloseHandler;
Callback<DiveDlg> mDestroyHandler;
Callback<DiveDlg> mCommandHandler;
SmartPointer<OwnerDrawListAltColor> mLogList;
SmartPointer<OwnerDrawListAltColor> mProfileList;
SmartPointer<OwnerDrawGraph> mOwnerDrawGraph;
Aladin mDiveProfile;
};
#endif

95
aladin/hold/divelog.cpp Normal file
View File

@@ -0,0 +1,95 @@
#include <aladin/divelog.hpp>
#include <aladin/divetime.hpp>
DiveLog::DiveLog()
{
mExtraInfo=0;
mBottomTime=0;
mMaxDepthHi=0;
mMaxDepthLo=0;
mSurfaceTimeHi=0;
mSurfaceTimeLo=0;
mTotalAirConsumption=0;
mEntryTime1=0;
mEntryTime2=0;
mEntryTime3=0;
mEntryTime4=0;
mWaterTemperature=0;
}
DiveLog::~DiveLog()
{
}
bool DiveLog::operator<(const DiveLog &diveLog)const
{
return getEntryTime()<diveLog.getEntryTime();
}
bool DiveLog::operator==(const DiveLog &diveLog)const
{
return getEntryTime()==diveLog.getEntryTime();
}
bool DiveLog::operator>(const DiveLog &diveLog)const
{
return getEntryTime()>diveLog.getEntryTime();
}
int DiveLog::getBottomTime(void)const
{
int bottomTime=(((mBottomTime>>4)*10))+(mBottomTime&0x0F);
if(mExtraInfo&0x04)bottomTime+=100;
return bottomTime;
}
int DiveLog::getMaxDepth(void)const
{
double maxDepth(((double)((mMaxDepthHi*256)+mMaxDepthLo)*10.00)/4096.00);
return int((maxDepth*3.281)+.5);
}
int DiveLog::getAltitude(void)const
{
return 0;
}
int DiveLog::getWaterTemperature(void)const
{
return mWaterTemperature/4;
}
SystemTime DiveLog::getEntryTime(void)const
{
return DiveTime(mEntryTime1,mEntryTime2,mEntryTime3,mEntryTime4).getTime();
}
Time DiveLog::getSurfaceTime(void)const
{
return Time(mSurfaceTimeHi,mSurfaceTimeLo);
}
bool DiveLog::readFrom(Array<BYTE> &array,int &index)
{
try
{
mExtraInfo=array[index++];
mBottomTime=array[index++];
mMaxDepthHi=array[index++];
mMaxDepthLo=array[index++];
mSurfaceTimeHi=array[index++];
mSurfaceTimeLo=array[index++];
mTotalAirConsumption=array[index++];
mEntryTime1=array[index++];
mEntryTime2=array[index++];
mEntryTime3=array[index++];
mEntryTime4=array[index++];
mWaterTemperature=array[index++];
}
catch(ArrayIndexOutOfBoundsException exception)
{
::OutputDebugString(exception.toString()+String("\n"));
return false;
}
return true;
}

54
aladin/hold/divelog.hpp Normal file
View File

@@ -0,0 +1,54 @@
#ifndef _ALADIN_DIVELOG_HPP_
#define _ALADIN_DIVELOG_HPP_
#ifndef _COMMON_WINDOWS_HPP_
#include <common/windows.hpp>
#endif
#ifndef _COMMON_ARRAY_HPP_
#include <common/array.hpp>
#endif
#ifndef _COMMON_STDIO_HPP_
#include <common/stdio.hpp>
#endif
#ifndef _COMMON_MATH_HPP_
#include <common/math.hpp>
#endif
#ifndef _COMMON_SYSTEMTIME_HPP_
#include <common/systime.hpp>
#endif
#ifndef _ALADIN_STATUS_HPP_
#include <aladin/status.hpp>
#endif
#ifndef _ALADIN_TIME_HPP_
#include <aladin/time.hpp>
#endif
class DiveLog
{
public:
DiveLog();
virtual ~DiveLog();
bool readFrom(Array<BYTE> &array,int &index);
int getAltitude(void)const;
int getMaxDepth(void)const;
SystemTime getEntryTime(void)const;
int getWaterTemperature(void)const;
int getBottomTime(void)const;
Time getSurfaceTime(void)const;
bool operator<(const DiveLog &diveLog)const;
bool operator>(const DiveLog &diveLog)const;
bool operator==(const DiveLog &diveLog)const;
private:
BYTE mExtraInfo;
BYTE mBottomTime;
BYTE mMaxDepthHi;
BYTE mMaxDepthLo;
BYTE mSurfaceTimeHi;
BYTE mSurfaceTimeLo;
BYTE mTotalAirConsumption;
BYTE mEntryTime1;
BYTE mEntryTime2;
BYTE mEntryTime3;
BYTE mEntryTime4;
BYTE mWaterTemperature;
};
#endif

View File

@@ -0,0 +1,10 @@
#include <aladin/diveprofile.hpp>
DiveProfile::DiveProfile()
{
}
DiveProfile::~DiveProfile()
{
}

Some files were not shown because too many files have changed in this diff Show More