#include #include #include #include #include bool Profiles::readFrom(RawData &array,Information &info,CurrentStatus &status) { int index=0; int endIndex; int time; WORD headerLength; WORD depth; BYTE warnings; BYTE decoInfo; double conversion=3.281; try { while(true) { while(Marker!=array[index]&&indexarray.size()||index>=0x5FF)break; index++; if(info.isNitroxOnly())index+=23; else if(info.isO2())index+=24; else index+=22; time=20; DiveProfile diveProfile; endIndex=getNextMarkerPos(array,index); while(index>=6; depth=(int)((((double)depth*10.00/64.00)*conversion)+.5); index+=sizeof(WORD); if(index>=0x5FF)break; ProfileData profileData(depth,time,warnings); diveProfile.insert(&ProfileData(depth,time,warnings)); if(index>=endIndex) { index-=sizeof(WORD); break; } if(depth==0)break; if(!(time%60)) { decoInfo=array[index]; index++; } time+=20; } if(!haveProfile(diveProfile))insert(&diveProfile); } } catch(ArrayIndexOutOfBoundsException exception) { ::OutputDebugString(exception.toString()+String("\n")); return false; } return true; } bool Profiles::readFrom(File &inFile) { int count; if(!inFile.isOkay())return false; if(!inFile.read(&count,sizeof(count)))return false; for(int index=0;index &array,int currIndex) { while(currIndex=array.size())return array.size()-1; return currIndex; } bool Profiles::haveProfile(DiveProfile &diveProfile) { for(int index=0;index