void CWindowsSlabManager::KmemFree(void *p) { VIR_PAGE_HEAD *pPage = name_slab::OffsetPageHead(p); if (NULL==pPage) { LOGME("Err, name_slab::kmem_free,NULL==pPage. p address:%x \n", p); return; } CKmem *pKmem = pPage->m_pKmem; if(NULL==pKmem) { LOGME("Err, name_slab::kmem_free,NULL==pKmem, pPage address:%x\n", pPage); return ; } pKmem->Kfree(p); }
N2FCORE_API bool ControllerWebServices::Execute_N2F_SnapUpService_DeviceUploadPhoto( WebServiceN2FSnapUpServiceDeviceUploadMethodDataProvider *dataProvider ) { LOGME(); if ( NULL == dataProvider ) return false; #if OFFLINE_MODE return true; #endif //#if OFFLINE_MODE bool executionResult = false; TWebServiceType uploadService = ControllersHost::GetInstance()->SettingsController()->GetUploadServiceID(); if ( EWS_N2F_SnapUpService == uploadService ) { CString nick, password, filePath; SYSTEMTIME st; dataProvider->GetUsername( nick ); dataProvider->GetPassword( password ); dataProvider->GetFilePathToUpload( filePath ); dataProvider->GetTimeForUpload( st ); WebServiceN2FSnapUpService *wsSU = (WebServiceN2FSnapUpService *)this->GetWebService( uploadService ); if ( NULL != wsSU ) executionResult = wsSU->DeviceUploadPhoto( nick, password, filePath, st ); else ASSERT( false ); return executionResult; } LOGMSG("Unsupported web-service type: %d", uploadService ); ASSERT(false); return false; }
N2FCORE_API bool ControllerWebServices::Execute_N2F_MemberService_CheckUserExists( WebServiceN2FMemberServiceLoginMethodDataProvider *dataProvider, bool& userExists ) { LOGME(); userExists = false; if ( NULL == dataProvider ) return false; #if OFFLINE_MODE userExists = true; return true; #endif //#if OFFLINE_MODE bool executionResult = false; TWebServiceType loginService = ControllersHost::GetInstance()->SettingsController()->GetLoginServiceID(); if ( EWS_N2F_MemberService_v3 == loginService ) { CString nick, password; dataProvider->GetUsername( nick ); dataProvider->GetPassword( password ); WebServiceN2FMemberService_v3 *wsMS = (WebServiceN2FMemberService_v3 *)this->GetWebService( loginService ); if ( NULL != wsMS ) executionResult = wsMS->CheckUserExists( nick, password, userExists ); else ASSERT( false ); return executionResult; } LOGMSG("Unsupported web-service type: %d", loginService ); ASSERT(false); return false; }
void ZernikePolynomial::dumpString() { std::ostringstream logSS; // Piston. logSS << "Piston: " << getPiston(); LOGME( logSS.str() ); logSS.str(""); // Power logSS << "Power: " << getPower(); LOGME( logSS.str() ); logSS.str(""); // Astigmatism X logSS << "AstigX: " << getAstigmatismX(); LOGME( logSS.str() ); logSS.str(""); // Astigmatism Y logSS << "AstigY: " << getAstigmatismY(); LOGME( logSS.str() ); logSS.str(""); // Coma X logSS << "ComaX: " << getComaX(); LOGME( logSS.str() ); logSS.str(""); // Coma Y logSS << "ComaY: " << getComaY(); LOGME( logSS.str() ); logSS.str(""); // Spherical ab. logSS << "SphericalAb: " << getSphericalAberration(); LOGME( logSS.str() ); logSS.str(""); // Trefoil X logSS << "TrefoilX: " << getTrefoilX(); LOGME( logSS.str() ); logSS.str(""); // Trefoil Y logSS << "TrefoilY: " << getTrefoilY(); LOGME( logSS.str() ); logSS.str(""); // 2nd coma x logSS << "2nd ComaX: " << getSecondaryComaX(); LOGME( logSS.str() ); logSS.str(""); // 2nd coma y logSS << "2nd ComaY: " << getSecondaryComaY(); LOGME( logSS.str() ); logSS.str(""); // 2nd spherical ab. logSS << "2nd SpherAb: " << getSecondarySphericalAberration(); LOGME( logSS.str() ); logSS.str(""); // 2nd astigm. x logSS << "2nd AstigX: " << getSecondaryAstigmatismX(); LOGME( logSS.str() ); logSS.str(""); // 2nd astigm. y logSS << "2nd AstigY: " << getSecondaryAstigmatismY(); LOGME( logSS.str() ); logSS.str(""); // tilt x logSS << "Tilt X: " << getTiltX(); LOGME( logSS.str() ); logSS.str(""); // tilt y logSS << "Tilt Y: " << getTiltY(); LOGME( logSS.str() ); logSS.str(""); // Strehl estimate logSS << "Strehl estimate: " << StrehlEstimate(); LOGME( logSS.str() ); logSS.str(""); }
/** * Generate the buffer from the parameters. * * @param phaseData The output phase data image buffer. */ void ZernikePolynomial::generateImageBufferForSLM(unsigned char *phaseData) { double x, y, radius; double divX, divY, XSquPlusYSqu, divXSqu, divYSqu, XPYSquSqu; double terms[16]; double total; //std::ostringstream logSS; // char msgbuf[1024]; //int defocusbins, stigxbins, stigybins, comaxbins, comaybins, speribins; int ActSize, start, end; double *zern = new double[SLMSIZE*SLMSIZE]; memset(zern, 0, sizeof(double)*SLMSIZE*SLMSIZE); ActSize = SLMSIZE; /* GH: FIX. 5/07/2008. Should be 256, not 300. * radius = ActSize*300/512; */ /*XXX/NOTE:!!!!!!!!!!!!!! *Normally we would use: * radius = ActSize*256/512; *BUT DUE TO MIRROR OVERFILLING, WE USE: */ /** ** PREFERRED radius: 100 (200x200) */ //radius = ActSize*100/512; // COMPROMISE: TOO MUCH LOSS WITH 100. //radius = ActSize*150/512; radius = ActSize*256/512; start = (SLMSIZE - ActSize)/2; end = start + ActSize; y = ActSize/2; //START double Ad=(getPower()/2)*(2) + (getSphericalAberration()/2)*(-6); double As=(getSphericalAberration()/2)*(6); std::ostringstream logSS; logSS << "Ad is: " << Ad; LOGME( logSS.str() ); logSS.str(""); logSS << "As is: " << As; LOGME( logSS.str() ); logSS.str(""); logSS << "radius is: " << radius; LOGME( logSS.str() ); logSS.str(""); //EOF for (int row = start; row < end; row++) { // Reset x. x = -(ActSize/2); for (int col = start; col < end; col++) { // Build some terms that are repeated through the equations. divX = x/radius; divY = y/radius; XSquPlusYSqu = divX*divX + divY*divY; XPYSquSqu = XSquPlusYSqu*XSquPlusYSqu; divXSqu = divX*divX; divYSqu = divY*divY; if ((divXSqu + divYSqu) <= 1) { terms[0] = (getPiston()/2); // Constant term / Piston terms[1] = (getTiltX()/2)*divX; // Tilt X terms[2] = (getTiltY()/2)*divY; // Tilt Y terms[3] = (getPower()/2)*(2*XSquPlusYSqu - 1); // Defocus? // XXX/FIXME/VERIFY: AstigOne=AstigmatismX, and AstigTwo for Y? terms[4] = (getAstigmatismX()/2)*(divXSqu - divY*divY); terms[5] = (getAstigmatismY()/2)*(2*divX*divY); terms[6] = (getComaX()/2)*(3*divX*XSquPlusYSqu - 2*divX); terms[7] = (getComaY()/2)*(3*divY*XSquPlusYSqu - 2*divY); terms[8] = (getSphericalAberration()/2)*(1 - 6*XSquPlusYSqu + 6*XPYSquSqu); terms[9] = (getTrefoilX()/2)*(divXSqu*divX - 3*divX*divYSqu); terms[10] = (getTrefoilY()/2)*(3*divXSqu*divY - divYSqu*divY); terms[11] = (getSecondaryAstigmatismX()/2)*(3*divYSqu - 3*divXSqu + 4*divXSqu*XSquPlusYSqu - 4*divYSqu*XSquPlusYSqu); terms[12] = (getSecondaryAstigmatismY()/2)*(8*divX*divY*XSquPlusYSqu - 6*divX*divY); terms[13] = (getSecondaryComaX()/2)*(3*divX - 12*divX*XSquPlusYSqu + 10*divX*XPYSquSqu); terms[14] = (getSecondaryComaY()/2)*(3*divY - 12*divY*XSquPlusYSqu + 10*divY*XPYSquSqu); //terms[15] = (getSecondarySphericalAberration()/2)*(12*XSquPlusYSqu - 1 - 30*XPYSquSqu + 20*XSquPlusYSqu*XPYSquSqu); terms[15] = 0; // Add the terms together. total = 0; for (int i = 0; i < 16; i++) { total += terms[i]; } } else { total = 0; } zern[row*SLMSIZE+col] = total; total = 0; x++; } y--; } memset(phaseData, 0, sizeof(unsigned char)*SLMSIZE*SLMSIZE); DtoI(zern, SLMSIZE*SLMSIZE, phaseData); delete zern; return; }