void CCellTowerDataSimulation::TimerExpired(TInt /*aExpiryId*/) { TPtr8 pCellBuffer(iCellBuffer->Des()); TInt aSearch = pCellBuffer.Locate(';'); TBuf<4> aCountryCode; TBuf<8> aNetworkIdentity; TUint aLocationAreaCode; TUint aCellId; TInt aTimeout; if(aSearch != KErrNotFound) { HBufC* aCellData = HBufC::NewLC(pCellBuffer.Length()); TPtr pCellData(aCellData->Des()); pCellData.Copy(pCellBuffer); pCellData.Delete(aSearch, pCellData.Length()); pCellBuffer.Delete(0, aSearch+1); // Mcc aSearch = pCellData.Locate(','); aCountryCode.Copy(pCellData.Ptr(), aSearch); pCellData.Delete(0, aSearch+1); // Mnc aSearch = pCellData.Locate(','); aNetworkIdentity.Copy(pCellData.Ptr(), aSearch); pCellData.Delete(0, aSearch+1); // Lac aSearch = pCellData.Locate(','); HBufC* aLac = HBufC::NewLC(aSearch); TPtr pLac(aLac->Des()); pLac.Copy(pCellData.Ptr(), aSearch); pCellData.Delete(0, aSearch+1); TLex aLacLex(pLac); aLacLex.Val(aLocationAreaCode); CleanupStack::PopAndDestroy(); // aLac // Cell aSearch = pCellData.Locate(','); HBufC* aCell = HBufC::NewLC(aSearch); TPtr pCell(aCell->Des()); pCell.Copy(pCellData.Ptr(), aSearch); pCellData.Delete(0, aSearch+1); TLex aCellLex(pCell); aCellLex.Val(aCellId); CleanupStack::PopAndDestroy(); // aCell iObserver->CellTowerData(aCountryCode, aNetworkIdentity, aLocationAreaCode, aCellId); // Timeout TLex aTimeoutLex(pCellData); aTimeoutLex.Val(aTimeout); if(aTimeout > 0) { iTimer->After(aTimeout * 1000000); } CleanupStack::PopAndDestroy(); // aCellData } }
/** Shift a particle from one position to its new*/ void DdLinkedList::MovePart(const int p,double *NewPos){ int cn = pCella(NewPos); int co = pCell(p); SetCoorNumb(NewPos,p); for(int d=0;d<3;d++)Pc[p].Pos[d] = NewPos[d]; if(cn == co) return; RemPart(p,co); AddPart(p,cn); }
void DdLinkedList::MovePart(const int p,double *NewPos){ int cd[3]; int cn = pCella(NewPos,cd); int co = pCell(p); SetCoorNumb(NewPos,p); if(cn == co) return; RemPart(p,co); AddPart(p,cd); }