这篇教程C++ status函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中status函数的典型用法代码示例。如果您正苦于以下问题:C++ status函数的具体用法?C++ status怎么用?C++ status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了status函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: pulsesequence//.........这里部分代码省略......... tau2 = d3; if((f2180[A] == 'y') && (ni2 > 1.0)) { tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; } tau2 = tau2/2.0; /* Calculate modifications to phases for States-TPPI acquisition */ if( ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 ); if(t1_counter % 2) { tsadd(t3,2,4); tsadd(t12,2,4); } if( ix == 1) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 ); if(t2_counter % 2) { tsadd(t8,2,4); tsadd(t12,2,4); } /* BEGIN PULSE SEQUENCE */ status(A); if (dm3[B]=='y') lk_sample(); delay(d1); if ((ni/sw1-d2)>0) delay(ni/sw1-d2); /*decreases as t1 increases for const.heating*/ if ((ni2/sw2-d3)>0) delay(ni2/sw2-d3); /*decreases as t2 increases for const.heating*/ if ( dm3[B] == 'y' ) { lk_hold(); /*freezes z0 correction, stops lock pulsing*/ lk_sampling_off(); } rcvroff(); obspower(tpwr); decpower(pwClvl); dec2power(pwNlvl); decpwrf(rf0); obsoffset(tof); txphase(one); delay(1.0e-5); if (TROSY[A] == 'n') dec2rgpulse(pwN, zero, 0.0, 0.0); /*destroy X magnetization*/ decrgpulse(pwC, zero, 0.0, 0.0); zgradpulse(gzlvl0, 0.5e-3); delay(1.0e-4); if (TROSY[A] == 'n') dec2rgpulse(pwN, one, 0.0, 0.0); decrgpulse(pwC, zero, 0.0, 0.0); zgradpulse(0.7*gzlvl0, 0.5e-3); delay(5.0e-4);
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例2: statusvoid Smtp::connected() { emit status( tr( "Connected to %1" ).arg( socket->peerName() ) );}
开发者ID:jeez,项目名称:iqr,代码行数:3,
示例3: statusbool Response::ok() const{ // "The ok attribute's getter must return true // if response's status is in the range 200 to 299, and false otherwise." return 200 <= status() && status() <= 299;}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:6,
示例4: pulsesequencepulsesequence(){ double gtE = getval("gtE"), gzlvlE=getval("gzlvlE"), selpwrPS = getval("selpwrPS"), selpwPS = getval("selpwPS"), gzlvlPS = getval("gzlvlPS"), droppts=getval("droppts"), gstab = getval("gstab"); char selshapePS[MAXSTR];//synchronize gradients to srate for probetype='nano'// Preserve gradient "area" gtE = syncGradTime("gtE","gzlvlE",1.0); gzlvlE = syncGradLvl("gtE","gzlvlE",1.0); getstr("selshapePS",selshapePS); settable(t1,4,ph1); settable(t2,32,ph2); settable(t3,8,ph3); settable(t4,16,ph4); getelem(t1,ct,v1); getelem(t2,ct,v2); getelem(t3,ct,v3); getelem(t4,ct,v4); assign(v4,oph); assign(v1,v6);/* BEGIN THE ACTUAL PULSE SEQUENCE */ status(A); obspower(tpwr); delay(5.0e-5); if (getflag("sspul")) steadystate(); if (satmode[0] == 'y') { if ((d1-satdly) > 0.02) delay(d1-satdly); else delay(0.02); satpulse(satdly,v6,rof1,rof1); } else delay(d1); if (getflag("wet")) wet4(zero,one); status(B); obspower(tpwr); rgpulse(pw, v1, rof1, rof2); delay(d2/2.0); delay((0.25/sw1) - gtE - gstab - 2*pw/PI - rof2 - 2*GRADIENT_DELAY); zgradpulse(gzlvlE,gtE); delay(gstab); rgpulse(2*pw,v2,rof1,rof1); delay(0.25/sw1); delay(gstab); zgradpulse(-1.0*gzlvlE,gtE); delay(gstab); obspower(selpwrPS); rgradient('z',gzlvlPS); shaped_pulse(selshapePS,selpwPS,v3,rof1,rof1); rgradient('z',0.0); obspower(tpwr); delay(gstab); zgradpulse(-2.0*gzlvlE,gtE); delay(gstab - droppts/sw); delay(d2/2.0); status(C);}
开发者ID:timburrow,项目名称:ovj3,代码行数:83,
示例5: switchvoid AutoBoot::handleCommand(quint8 command, quint16 aux){ switch (command) { case 0x3F: // Speed poll { if (!sio->port()->writeCommandAck()) { return; } sio->port()->writeComplete(); QByteArray speed(1, 0); speed[0] = sio->port()->speedByte(); sio->port()->writeDataFrame(speed); qDebug() << "!n" << tr("[%1] Speed poll.").arg(deviceName()); break; } case 0x52: { /* Read sector */ if (loaded) { passToOldHandler(command, aux); return; } if (aux >= 1 && aux <= sectorCount) { if (!sio->port()->writeCommandAck()) { return; } if (!started) { emit booterStarted(); started = true; } QByteArray data; if (readSector(aux, data)) { sio->port()->writeComplete(); sio->port()->writeDataFrame(data); qDebug() << "!n" << tr("[%1] Read sector %2 (%3 bytes).") .arg(deviceName()) .arg(aux) .arg(data.size()); } else { sio->port()->writeError(); qCritical() << "!e" << tr("[%1] Read sector %2 failed.") .arg(deviceName()) .arg(aux); } } else { passToOldHandler(command, aux); } break; } case 0x53: { /* Get status */ if (loaded) { passToOldHandler(command, aux); return; } if (!sio->port()->writeCommandAck()) { return; } QByteArray status(4, 0); status[0] = 8; status[3] = 1; sio->port()->writeComplete(); sio->port()->writeDataFrame(status); qDebug() << "!n" << tr("[%1] Get status.") .arg(deviceName()); break; } case 0xFD: { if (!sio->port()->writeCommandAck()) { return; } qDebug() << "!n" << tr("[%1] Atari is jumping to %2.") .arg(deviceName()) .arg(aux); emit loaderDone(); sio->port()->writeComplete(); break; } case 0xFE: { /* Get chunk */ if(aux >= chunks.count()) { qDebug() << "!e" << tr("[%1] Invalid chunk in get chunk: aux = %2") .arg(deviceName()) .arg(aux); return; } if (!sio->port()->writeCommandAck()) { return; } qDebug() << "!n" << tr("[%1] Get chunk %2 (%3 bytes).") .arg(deviceName()) .arg(aux) .arg(chunks.at(aux).data.size()); sio->port()->writeComplete(); sio->port()->writeDataFrame(chunks.at(aux).data); emit blockRead(aux + 1, chunks.count()); break;//.........这里部分代码省略.........
开发者ID:TheMontezuma,项目名称:RespeQt,代码行数:101,
示例6: get_values//.........这里部分代码省略......... { // give up // remove any previous over-approximation a.over_assumptions.clear(); a.over_state=MAX_STATE; bvt r; float_utilst float_utils(prop); float_utils.spec=spec; float_utils.rounding_mode_bits.set(RM); bvt op0=a.op0_bv, op1=a.op1_bv, res=a.result_bv; if(a.expr.id()==ID_floatbv_plus) r=float_utils.add(op0, op1); else if(a.expr.id()==ID_floatbv_minus) r=float_utils.sub(op0, op1); else if(a.expr.id()==ID_floatbv_mult) r=float_utils.mul(op0, op1); else if(a.expr.id()==ID_floatbv_div) r=float_utils.div(op0, op1); else assert(0); assert(r.size()==res.size()); bv_utils.set_equal(r, res); } } else if(type.id()==ID_signedbv || type.id()==ID_unsignedbv) { // these are all binary assert(a.expr.operands().size()==2); // already full interpretation? if(a.over_state>0) return; bv_spect spec(type); bv_arithmetict o0(spec), o1(spec); o0.unpack(a.op0_value); o1.unpack(a.op1_value); // division by zero is never spurious if((a.expr.id()==ID_div || a.expr.id()==ID_mod) && o1==0) return; if(a.expr.id()==ID_mult) o0*=o1; else if(a.expr.id()==ID_div) o0/=o1; else if(a.expr.id()==ID_mod) o0%=o1; else assert(false); if(o0.pack()==a.result_value) // ok return; if(a.over_state==0) { // we give up right away and add the full interpretation bvt r; if(a.expr.id()==ID_mult) { r=bv_utils.multiplier( a.op0_bv, a.op1_bv, a.expr.type().id()==ID_signedbv?bv_utilst::SIGNED:bv_utilst::UNSIGNED); } else if(a.expr.id()==ID_div) { r=bv_utils.divider( a.op0_bv, a.op1_bv, a.expr.type().id()==ID_signedbv?bv_utilst::SIGNED:bv_utilst::UNSIGNED); } else if(a.expr.id()==ID_mod) { r=bv_utils.remainder( a.op0_bv, a.op1_bv, a.expr.type().id()==ID_signedbv?bv_utilst::SIGNED:bv_utilst::UNSIGNED); } else assert(0); bv_utils.set_equal(r, a.result_bv); } else assert(0); } else assert(0); status() << "Found spurious `" << a.as_string() << "' (state " << a.over_state << ")" << eom; progress=true; if(a.over_state<MAX_STATE) a.over_state++;}
开发者ID:rbavishi,项目名称:iCBMC,代码行数:101,
示例7: pulsesequence//.........这里部分代码省略.........}else{ if (phase2 == 2) {tsadd(t3,1,4);tsadd(t5,1,4); icosel=1;}} tau1 = d2; if((f1180[A] == 'y') ) { tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; } tau1 = tau1; tau2 = d3; if((f2180[A] == 'y') ) { tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; } tau2 = tau2; if( ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 ); if(t1_counter % 2) { tsadd(t1,2,4); tsadd(t12,2,4); tsadd(t13,2,4); } if( ix == 1) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 ); if(t2_counter % 2) { tsadd(t3,2,4); tsadd(t5,2,4);tsadd(t12,2,4); tsadd(t13,2,4); } status(A); rcvroff(); decpower(pwClvl); decoffset(dof); dec2power(pwNlvl); dec2offset(dof2); decpwrf(4095.0); obsoffset(tof); set_c13offset("co"); zgradpulse(gzlvl6, gt6); delay(1.0e-4); delay(d1-gt6);lk_hold(); h_shapedpulse("pc9f",4.0,3.5,zero, 2.0e-6, 0.0); delay(lambda-pwS5*0.5-pwS6*0.4); h_sim3shapedpulse("reburp",4.0,3.5,0.0,2.0*pwN, one, zero, zero, 0.0, 0.0); delay(lambda-pwS5*0.5-pwS6*0.4); h_shapedpulse("pc9f_",4.0,3.5,one, 0.0, 0.0); obspower(shlvl1);/**************************************************************************/ dec2rgpulse(pwN,zero,0.0,0.0);
开发者ID:timburrow,项目名称:ovj3,代码行数:66,
示例8: statusUINT64 vmsBtDownloadImpl::get_TotalDownloadedBytesCount (){ if (m_handle.is_valid () == false) return 0; return status ().total_done;}
开发者ID:ratever930,项目名称:freedownload,代码行数:6,
示例9: returnUINT vmsBtDownloadImpl::GetUploadSpeed (){ if (m_handle.is_valid () == false) return 0; return (UINT)status ().upload_payload_rate;}
开发者ID:ratever930,项目名称:freedownload,代码行数:6,
示例10: mainint main(int argc, char* argv[]){ status(); printf(">> int *a (int*)my_malloc(sizeof(int))/n"); int *a = (int*)my_malloc(sizeof(int)); printf(">> *a = %d/n/n",*a); *a = 5; status(); printf(">> char* b = (char*)my_malloc(256)/n"); char* b = (char*)my_malloc(16); printf(">> *b = '%s'/n/n",b); b[0] = 'c'; b[1] = 'o'; b[2] = 'o'; b[3] = 'l'; b[4] = '/0'; status(); printf(">> char* c = (char*)my_malloc(256)/n/n"); char* c = (char*)my_malloc(256); status(); printf(">> char* d = (char*)my_malloc(9728)/n"); char* d = (char*)my_malloc(9728); printf(">> d[9959] = '%c' /n/n", d[9727]); d[9727] = '/0'; status(); printf(">> my_free(b)/n/n"); my_free((void*)b); status(); printf(">> my_free(d)/n/n"); my_free((void*) d); status(); printf(">> char *e = (char*)my_malloc(80)/n/n"); char *e = (char*)my_malloc(80); status(); printf(">> my_free(c)/n/n"); my_free((void*)c); status(); printf(">> my_free(a)/n/n"); my_free((void*)a); status(); printf(">> my_free(e)/n/n"); my_free((void*)e); status(); char buffer[3]; printf("Press any key to continue..."); fgets(buffer, 2, stdin);}
开发者ID:MrLoh,项目名称:TI3-Uebungen,代码行数:55,
示例11: pulsesequence//.........这里部分代码省略......... sub(ssval, ssctr, v12); /* v12 = 0,...,ss-1 */ hlv(v12, v13); mod2(v12, v1); hlv(v12, v2); endif(ssctr);/* CALCULATE PHASES *//* A 2-step cycle is performed on the first pulse (90 degrees) to suppress axial peaks in the first instance. Second, the 2-step F2 quadrature image suppression subcycle is added to all pulse phases and receiver phase. Finally, a 2-step cycle is performed on the spin-lock pulses. */ mod2(v13, v13); dbl(v1, v1); incr(v1); hlv(v2, v2); mod2(v2, v2); dbl(v2, v2); incr(v2); add(v13, v2, v2); sub(v2, one, v3); add(two, v2, v4); add(two, v3, v5); add(v1, v13, v1); assign(v1, oph); if (iphase == 2) incr(v1); if (iphase == 3) add(v1, v14, v1); /*HYPERCOMPLEX MODE USES REDFIELD TRICK TO MOVE AXIAL PEAKS TO EDGE*/ initval(2.0*(double)(((int)(d2*getval("sw1")+0.5)%2)),v6); if ((iphase==1)||(iphase==2)) {add(v1,v6,v1); add(oph,v6,oph);} /* CALCULATE AND INITIALIZE LOOP COUNTER */ if (pw > 0.0) { cycles = (mix - trim) / (64.66*pw+32*window); cycles = 2.0*(double) (int) (cycles/2.0); } else { cycles = 0.0; } initval(cycles, v9); /* V9 is the MIX loop count *//* BEGIN ACTUAL PULSE SEQUENCE CODE */ status(A); rlpower(p1lvl, TODEV); if (sspul[0] == 'y') { rgpulse(1000*1e-6, zero, rof1, 0.0e-6); rgpulse(1000*1e-6, one, 0.0e-6, rof1); } hsdelay(d1);if (getflag("wet")) wet4(zero,one);rlpower(p1lvl, TODEV); if (satmode[A] == 'y') { rlpower(satpwr,TODEV); rgpulse(satdly,zero,rof1,rof2); rlpower(p1lvl,TODEV);} status(B); rgpulse(p1, v1, rof1, 1.0e-6); if (satmode[B] =='y') { if (d2 > 0.0) { rlpower(satpwr,TODEV); rgpulse(d2 - (2*POWER_DELAY) - 1.0e-6 - (2*p1/3.1416),zero,0.0,0.0); } } else { if (d2 > 0.0) delay(d2 - POWER_DELAY - 1.0e-6 - (2*p1/3.1416)); } rcvroff(); rlpower(tpwr,TODEV); txphase(v13); xmtron(); delay(trim); if (cycles > 1.0) { starthardloop(v9); mleva(window); mleva(window); mlevb(window); mlevb(window); mlevb(window); mleva(window); mleva(window); mlevb(window); mlevb(window); mlevb(window); mleva(window); mleva(window); mleva(window); mlevb(window); mlevb(window); mleva(window); rgpulse(.66*pw,v3,rof1,rof2); endhardloop(); } txphase(v13); xmtroff();/* detection */ delay(rof2); rcvron(); status(C);}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:101,
示例12: pulsesequencevoid pulsesequence(){ double mix; char sspul[MAXSTR];/* LOAD VARIABLES */ mix = getval("mix"); getstr("sspul", sspul); if (phase1 == 3) initval( (double)d2_index, v14); else assign(zero, v14);/* CHECK CONDITIONS */ if ((rof1 < 9.9e-6) && (ix == 1)) fprintf(stdout,"Warning: ROF1 is less than 10 us/n"); if (satpwr > 40) { printf("satpwr too large - acquisition aborted./n"); psg_abort(1); }/* STEADY-STATE PHASECYCLING *//* This section determines if the phase calculations trigger off of (SS - SSCTR) or off of CT */ ifzero(ssctr); mod2(ct, v2); hlv(ct, v3); elsenz(ssctr); sub(ssval, ssctr, v12); /* v12 = 0,...,ss-1 */ mod2(v12, v2); hlv(v12, v3); endif(ssctr);/* CALCULATE PHASECYCLE */ dbl(v2, v2); hlv(v3, v10); hlv(v10, v10); if (phase1 == 0) { assign(v10, v9); hlv(v10, v10); mod2(v9, v9); } else { assign(zero, v9); } assign(v10,v1); hlv(v10, v10); mod2(v1, v1); dbl(v1, v1); add(v9, v2, v2); mod2(v10, v10); add(v1, v2, oph); add(v3, oph, oph); add(v10, oph, oph); add(v10, v1, v1); add(v10, v2, v2); add(v10, v3, v3); add(v10,v14,v5); if (phase1 == 2) { incr(v2); incr(v5); } if (phase1 == 3) add(v2, v14, v2); /* TPPI phase increment *//*HYPERCOMPLEX MODE USES REDFIELD TRICK TO MOVE AXIAL PEAKS TO EDGE */ if ((phase1==1)||(phase1==2)) { initval(2.0*(double)(d2_index%2),v6); add(v2,v6,v2); add(oph,v6,oph); add(v5,v6,v5); } /* BEGIN THE ACTUAL PULSE SEQUENCE */ status(A); if (sspul[A] == 'y') { obspower(tpwr-12); rgpulse(200*pw, zero, rof1, 0.0e-6); rgpulse(200*pw, one, 0.0e-6, rof1); obspower(tpwr); } if (d1>hst) hsdelay(d1); if (satmode[A] == 'y') { obspower(satpwr); rgpulse(satdly,v5,rof1,rof1); obspower(tpwr); } status(B); rgpulse(pw, v2, rof1, 1.0e-6); if (satmode[B] =='y') { if (d2 > 0.0) //.........这里部分代码省略.........
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:101,
示例13: pulsesequencevoid pulsesequence(){ int i, relay;/* GET NEW PARAMETERS */ relay = (int) (getval("relay") + 0.5);/* CHECK CONDITIONS */ if (p1 == 0.0) p1 = pw;/* CALCULATE PHASES */ sub(ct, ssctr, v11); /* v11 = ct-ss */ initval(256.0, v12); add(v11, v12, v11); /* v11 = ct-ss+256 */ hlv(v11, v1); /* v1 = cyclops = 00112233 */ for (i = 0; i < relay + 1; i++) hlv(v1, v1); /* cyclops = 2**(relay+2) 0's, 1's, 2's, 3's */ mod4(v11, v2); /* v2 = 0123 0123... */ dbl(v2, oph); /* oph = 0202 0202 */ add(v2, v1, v2); /* v2 = 0123 0123 + cyclops */ add(oph, v1, oph); /* oph = 0202 0202 + cyclops */ hlv(v11, v3); /* v3 = 0011 2233 4455 ... *//* PULSE SEQUENCE */ status(A); if (rof1 == 0.0) { rof1 = 1.0e-6; /* phase switching time */ rcvroff(); } hsdelay(d1); /* preparation period */ status(B); rgpulse(pw, v1, rof1, rof1); delay(d2); /* evolution period */ status(A); if (relay == 0) delay(tau); /* for delayed cosy */ rgpulse(p1, v2, rof1, rof1); /* start of mixing period */ if (relay == 0) delay(tau); /* for delayed cosy */ for (i = 0; i < relay; i++) /* relay coherence */ { hlv(v3, v3); /* v3=2**(relay+1) 0's, 1's, 2's, 3's */ dbl(v3, v4); /* v4=2**(relay+1) 0's, 2's, 0's, 2's */ add(v2, v4, v5); /* v5=v4+v2 (including cyclops) */ delay(tau/2); rgpulse(2.0*pw, v2, rof1, rof1); delay(tau/2); rgpulse(pw, v5, rof1, rof1); } status(C); delay(rof2); rcvron();}
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:63,
示例14: getter_AddRefsnsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIRequest *request, nsIURI* aURL){ nsresult rv = NS_OK; // If we don't yet have a stream listener, we need to get // one from the plugin. // NOTE: this should only happen when a stream was NOT created // with GetURL or PostURL (i.e. it's the initial stream we // send to the plugin as determined by the SRC or DATA attribute) if (!mPStreamListener) { if (!mPluginInstance) { return NS_ERROR_FAILURE; } nsRefPtr<nsNPAPIPluginStreamListener> streamListener; rv = mPluginInstance->NewStreamListener(nullptr, nullptr, getter_AddRefs(streamListener)); if (NS_FAILED(rv) || !streamListener) { return NS_ERROR_FAILURE; } mPStreamListener = static_cast<nsNPAPIPluginStreamListener*>(streamListener.get()); } mPStreamListener->SetStreamListenerPeer(this); bool useLocalCache = false; // get httpChannel to retrieve some info we need for nsIPluginStreamInfo setup nsCOMPtr<nsIChannel> channel = do_QueryInterface(request); nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(channel); /* * Assumption * By the time nsPluginStreamListenerPeer::OnDataAvailable() gets * called, all the headers have been read. */ if (httpChannel) { // Reassemble the HTTP response status line and provide it to our // listener. Would be nice if we could get the raw status line, // but nsIHttpChannel doesn't currently provide that. // Status code: required; the status line isn't useful without it. uint32_t statusNum; if (NS_SUCCEEDED(httpChannel->GetResponseStatus(&statusNum)) && statusNum < 1000) { // HTTP version: provide if available. Defaults to empty string. nsCString ver; nsCOMPtr<nsIHttpChannelInternal> httpChannelInternal = do_QueryInterface(channel); if (httpChannelInternal) { uint32_t major, minor; if (NS_SUCCEEDED(httpChannelInternal->GetResponseVersion(&major, &minor))) { ver = nsPrintfCString("/%lu.%lu", major, minor); } } // Status text: provide if available. Defaults to "OK". nsCString statusText; if (NS_FAILED(httpChannel->GetResponseStatusText(statusText))) { statusText = "OK"; } // Assemble everything and pass to listener. nsPrintfCString status("HTTP%s %lu %s", ver.get(), statusNum, statusText.get()); static_cast<nsIHTTPHeaderListener*>(mPStreamListener)->StatusLine(status.get()); } // Also provide all HTTP response headers to our listener. httpChannel->VisitResponseHeaders(this); mSeekable = false; // first we look for a content-encoding header. If we find one, we tell the // plugin that stream is not seekable, because the plugin always sees // uncompressed data, so it can't make meaningful range requests on a // compressed entity. Also, we force the plugin to use // nsPluginStreamType_AsFile stream type and we have to save decompressed // file into local plugin cache, because necko cache contains original // compressed file. nsAutoCString contentEncoding; if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("Content-Encoding"), contentEncoding))) { useLocalCache = true; } else { // set seekability (seekable if the stream has a known length and if the // http server accepts byte ranges). uint32_t length; GetLength(&length); if (length) { nsAutoCString range; if (NS_SUCCEEDED(httpChannel->GetResponseHeader(NS_LITERAL_CSTRING("accept-ranges"), range)) && range.Equals(NS_LITERAL_CSTRING("bytes"), nsCaseInsensitiveCStringComparator())) { mSeekable = true; } } } // we require a content len//.........这里部分代码省略.........
开发者ID:ChicoTeam,项目名称:mozilla-central,代码行数:101,
示例15: loglnvoid RBBIAPITest::TestGetSetAdoptText(){ logln((UnicodeString)"Testing getText setText "); IcuTestErrorCode status(*this, "TestGetSetAdoptText"); UnicodeString str1="first string."; UnicodeString str2="Second string."; LocalPointer<RuleBasedBreakIterator> charIter1((RuleBasedBreakIterator*)RuleBasedBreakIterator::createCharacterInstance(Locale::getDefault(), status)); LocalPointer<RuleBasedBreakIterator> wordIter1((RuleBasedBreakIterator*)RuleBasedBreakIterator::createWordInstance(Locale::getDefault(), status)); if(status.isFailure()){ errcheckln(status, "Fail : in construction - %s", status.errorName()); return; } CharacterIterator* text1= new StringCharacterIterator(str1); CharacterIterator* text1Clone = text1->clone(); CharacterIterator* text2= new StringCharacterIterator(str2); CharacterIterator* text3= new StringCharacterIterator(str2, 3, 10, 3); // "ond str" wordIter1->setText(str1); CharacterIterator *tci = &wordIter1->getText(); UnicodeString tstr; tci->getText(tstr); TEST_ASSERT(tstr == str1); if(wordIter1->current() != 0) errln((UnicodeString)"ERROR:1 setText did not set the iteration position to the beginning of the text, it is" + wordIter1->current() + (UnicodeString)"/n"); wordIter1->next(2); wordIter1->setText(str2); if(wordIter1->current() != 0) errln((UnicodeString)"ERROR:2 setText did not reset the iteration position to the beginning of the text, it is" + wordIter1->current() + (UnicodeString)"/n"); charIter1->adoptText(text1Clone); TEST_ASSERT(wordIter1->getText() != charIter1->getText()); tci = &wordIter1->getText(); tci->getText(tstr); TEST_ASSERT(tstr == str2); tci = &charIter1->getText(); tci->getText(tstr); TEST_ASSERT(tstr == str1); LocalPointer<RuleBasedBreakIterator> rb((RuleBasedBreakIterator*)wordIter1->clone()); rb->adoptText(text1); if(rb->getText() != *text1) errln((UnicodeString)"ERROR:1 error in adoptText "); rb->adoptText(text2); if(rb->getText() != *text2) errln((UnicodeString)"ERROR:2 error in adoptText "); // Adopt where iterator range is less than the entire orignal source string. // (With the change of the break engine to working with UText internally, // CharacterIterators starting at positions other than zero are not supported) rb->adoptText(text3); TEST_ASSERT(rb->preceding(2) == 0); TEST_ASSERT(rb->following(11) == BreakIterator::DONE); //if(rb->preceding(2) != 3) { // errln((UnicodeString)"ERROR:3 error in adoptText "); //} //if(rb->following(11) != BreakIterator::DONE) { // errln((UnicodeString)"ERROR:4 error in adoptText "); //} // UText API // // Quick test to see if UText is working at all. // const char *s1 = "/x68/x65/x6C/x6C/x6F/x20/x77/x6F/x72/x6C/x64"; /* "hello world" in UTF-8 */ const char *s2 = "/x73/x65/x65/x20/x79/x61"; /* "see ya" in UTF-8 */ // 012345678901 status.reset(); LocalUTextPointer ut(utext_openUTF8(NULL, s1, -1, status)); wordIter1->setText(ut.getAlias(), status); TEST_ASSERT_SUCCESS(status); int32_t pos; pos = wordIter1->first(); TEST_ASSERT(pos==0); pos = wordIter1->next(); TEST_ASSERT(pos==5); pos = wordIter1->next(); TEST_ASSERT(pos==6); pos = wordIter1->next(); TEST_ASSERT(pos==11); pos = wordIter1->next(); TEST_ASSERT(pos==UBRK_DONE); status.reset(); LocalUTextPointer ut2(utext_openUTF8(NULL, s2, -1, status)); TEST_ASSERT_SUCCESS(status); wordIter1->setText(ut2.getAlias(), status); TEST_ASSERT_SUCCESS(status); pos = wordIter1->first(); TEST_ASSERT(pos==0); pos = wordIter1->next(); TEST_ASSERT(pos==3);//.........这里部分代码省略.........
开发者ID:0omega,项目名称:platform_external_icu4c,代码行数:101,
示例16: statusvoid bv_refinementt::check_UNSAT(approximationt &a){ // part of the conflict? if(!is_in_conflict(a)) return; status() << "Found assumption for `" << a.as_string() << "' in proof (state " << a.under_state << ")" << eom; assert(!a.under_assumptions.empty()); a.under_assumptions.clear(); if(a.expr.type().id()==ID_floatbv) { const floatbv_typet &floatbv_type=to_floatbv_type(a.expr.type()); ieee_float_spect spec=floatbv_type; a.under_assumptions.reserve(a.op0_bv.size()+a.op1_bv.size()); float_utilst float_utils(prop); float_utils.spec=spec; // the fraction without hidden bit const bvt fraction0=float_utils.get_fraction(a.op0_bv); const bvt fraction1=float_utils.get_fraction(a.op1_bv); if(a.under_state==0) { // we first set sign and exponent free, // but keep the fraction zero for(unsigned i=0; i<fraction0.size(); i++) a.add_under_assumption(prop.lnot(fraction0[i])); for(unsigned i=0; i<fraction1.size(); i++) a.add_under_assumption(prop.lnot(fraction1[i])); } else { // now fraction: make this grow quadratically unsigned x=a.under_state*a.under_state; if(x>=MAX_FLOAT_UNDERAPPROX && x>=a.result_bv.size()) { // make it free altogether, this guarantees progress } else { // set x bits of both exponent and mantissa free // need to start with most-significant bits #if 0 for(unsigned i=x; i<fraction0.size(); i++) a.add_under_assumption(prop.lnot( fraction0[fraction0.size()-i-1])); for(unsigned i=x; i<fraction1.size(); i++) a.add_under_assumption(prop.lnot( fraction1[fraction1.size()-i-1])); #endif } } } else { unsigned x=a.under_state+1; if(x>=MAX_INTEGER_UNDERAPPROX && x>=a.result_bv.size()) { // make it free altogether, this guarantees progress } else { // set x least-significant bits free a.under_assumptions.reserve(a.op0_bv.size()+a.op1_bv.size()); for(unsigned i=x; i<a.op0_bv.size(); i++) a.add_under_assumption(prop.lnot(a.op0_bv[i])); for(unsigned i=x; i<a.op1_bv.size(); i++) a.add_under_assumption(prop.lnot(a.op1_bv[i])); } } a.under_state++; progress=true;}
开发者ID:rbavishi,项目名称:iCBMC,代码行数:87,
示例17: inputStreamvoid CNcdServerReportManager::NodeSetAsInstalledRequestL( MCatalogsBaseMessage& aMessage ) { HBufC8* input = HBufC8::NewLC( aMessage.InputLength() ); TPtr8 inputPtr = input->Des(); aMessage.ReadInput( inputPtr ); RDesReadStream inputStream( *input ); CleanupClosePushL( inputStream ); TInt errorCode( inputStream.ReadInt32L() ); CNcdNodeIdentifier* identifier( CNcdNodeIdentifier::NewLC( inputStream ) ); CNcdReportManager& reportManager( ReportManagerL( aMessage ) ); CNcdNode& node( Provider().NodeManager().NodeL( *identifier ) ); CNcdNodeMetaData& metaData( node.NodeMetaDataL() ); TNcdReportStatusInfo info( ENcdReportCreate, errorCode ); // Use the node identifier to identify the content in install report. // Node id uniquely identifies the node that contains contents // that will be installed. One node may contains multiple contents but // they are all thought as one bundle, in one operation. Also, notice that // multiple nodes can contain same metadata and same content. TNcdReportId reportId = reportManager.RegisterInstallL( identifier->NodeId(), metaData.Identifier(), info, metaData.Identifier().ServerUri(), metaData.Identifier().NodeNameSpace() ); // Set access point for report. UpdateInstallReportAccessPointL( aMessage.Session().Context().FamilyId(), reportId, node, metaData, reportManager, HttpSessionL( aMessage.Session().Context() ) ); // Set the final success information directly into the report instead of // reporting other install statuses here. TNcdReportStatus status( ENcdReportSuccess ); if ( errorCode == KErrNone ) { status = ENcdReportSuccess; } else if ( errorCode == KErrCancel ) { status = ENcdReportCancel; } else { status = ENcdReportFail; } // Create the status info object with the given info. info.iStatus = status; info.iErrorCode = errorCode; reportManager.ReportInstallStatusL( reportId, info ); CleanupStack::PopAndDestroy( identifier ); CleanupStack::PopAndDestroy( &inputStream ); CleanupStack::PopAndDestroy( input ); aMessage.CompleteAndRelease( KErrNone ); }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:67,
示例18: mainint main(int argc, char *argv[]) { Teuchos::GlobalMPISession mpiSession(&argc, &argv); // This little trick lets us print to std::cout only if a (dummy) command-line argument is provided. int iprint = argc - 1; Teuchos::RCP<std::ostream> outStream; Teuchos::oblackholestream bhs; // outputs nothing if (iprint > 0) outStream = Teuchos::rcp(&std::cout, false); else outStream = Teuchos::rcp(&bhs, false); int errorFlag = 0; // *** Example body. try { int dim = 128; // Set problem dimension. ROL::ZOO::Objective_PoissonInversion<RealT> obj(dim, 1e-6); Teuchos::ParameterList parlist; // Basic algorithm. parlist.set("Trust-Region Subproblem Solver Type", "Truncated CG"); // Krylov parameters. parlist.set("Absolute Krylov Tolerance", 1.e-4); parlist.set("Relative Krylov Tolerance", 1.e-2); parlist.set("Maximum Number of Krylov Iterations", 50); // Define step. ROL::TrustRegionStep<RealT> step(parlist); // Define status test. RealT gtol = 1e-12; // norm of gradient tolerance RealT stol = 1e-14; // norm of step tolerance int maxit = 100; // maximum number of iterations ROL::StatusTest<RealT> status(gtol, stol, maxit); // Define algorithm. ROL::DefaultAlgorithm<RealT> algo(step,status,false); // Iteration vector. Teuchos::RCP<std::vector<RealT> > x_rcp = Teuchos::rcp( new std::vector<RealT> (dim, 0.0) ); // Set initial guess. for (int i=0; i<dim; i++) { (*x_rcp)[i] = 0.1; } ROL::StdVector<RealT> x(x_rcp); // Run algorithm. std::vector<std::string> output = algo.run(x, obj, false); for ( unsigned i = 0; i < output.size(); i++ ) { std::cout << output[i]; } // Compute dense Hessian matrix. Teuchos::SerialDenseMatrix<int, RealT> H(x.dimension(), x.dimension()); H = ROL::computeDenseHessian<RealT>(obj, x); //H.print(*outStream); // Compute and print eigenvalues. std::vector<std::vector<RealT> > eigenvals = ROL::computeEigenvalues<RealT>(H); *outStream << "/nEigenvalues:/n"; for (unsigned i=0; i<(eigenvals[0]).size(); i++) { if (i==0) { *outStream << std::right << std::setw(28) << "Real" << std::setw(28) << "Imag" << "/n"; } *outStream << std::scientific << std::setprecision(16) << std::right << std::setw(28) << (eigenvals[0])[i] << std::setw(28) << (eigenvals[1])[i] << "/n"; } // Compute and print generalized eigenvalues. Teuchos::SerialDenseMatrix<int, RealT> M = computeDotMatrix(x); //M.print(*outStream); std::vector<std::vector<RealT> > genEigenvals = ROL::computeGenEigenvalues<RealT>(H, M); *outStream << "/nGeneralized eigenvalues:/n"; for (unsigned i=0; i<(genEigenvals[0]).size(); i++) { if (i==0) { *outStream << std::right << std::setw(28) << "Real" << std::setw(28) << "Imag" << "/n"; } *outStream << std::scientific << std::setprecision(16) << std::right << std::setw(28) << (genEigenvals[0])[i] << std::setw(28) << (genEigenvals[1])[i] << "/n"; } // Sort and compare eigenvalues and generalized eigenvalues - should be close. std::sort((eigenvals[0]).begin(), (eigenvals[0]).end()); std::sort((eigenvals[1]).begin(), (eigenvals[1]).end()); std::sort((genEigenvals[0]).begin(), (genEigenvals[0]).end());//.........这里部分代码省略.........
开发者ID:rainiscold,项目名称:trilinos,代码行数:101,
示例19: pulsesequence//.........这里部分代码省略......... - pwca180dec - WFG_STOP_DELAY - 2.0*pwN - POWER_DELAY - 4.0e-6); if(tau1 < 0.2e-6) tau1 = 0.2e-6; tau1 = tau1/2.0; /* Set up f2180 tau2 = t2 */ tau2 = d3; if(f2180[A] == 'y') { tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.2e-6; } tau2 = tau2/2.0; /* Calculate modifications to phases for States-TPPI acquisition */ if( ix == 1) d2_init = d2 ; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 ); if(t1_counter % 2) { tsadd(t2,2,4); tsadd(t6,2,4); } if( ix == 1) d3_init = d3 ; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 ); if(t2_counter % 2) { tsadd(t3,2,4); tsadd(t6,2,4); } /* BEGIN ACTUAL PULSE SEQUENCE */ status(A); obspower(tsatpwr); /* Set transmitter power for 1H presaturation */ decpower(d_c180); /* Set Dec1 power to high power */ dec2power(pwNlvl); /* Set Dec2 power for 15N hard pulses */ decoffset(dof); /* Presaturation Period */ if (fsat[0] == 'y') { delay(2.0e-5); rgpulse(d1,zero,2.0e-6,2.0e-6); obspower(tpwr); /* Set transmitter power for hard 1H pulses */ delay(2.0e-5); if(fscuba[0] == 'y') { delay(2.2e-2); rgpulse(pw,zero,2.0e-6,0.0); rgpulse(2*pw,one,2.0e-6,0.0); rgpulse(pw,zero,2.0e-6,0.0); delay(2.2e-2); } } else { delay(d1); } obspower(tpwr); /* Set transmitter power for hard 1H pulses */ txphase(zero); dec2phase(zero); delay(1.0e-5);
开发者ID:timburrow,项目名称:ovj3,代码行数:66,
示例20: verify void Balancer::_doBalanceRound( DBClientBase& conn, vector<CandidateChunkPtr>* candidateChunks ) { verify( candidateChunks ); // // 1. Check whether there is any sharded collection to be balanced by querying // the ShardsNS::collections collection // auto_ptr<DBClientCursor> cursor = conn.query(ConfigNS::collection, BSONObj()); vector< string > collections; while ( cursor->more() ) { BSONObj col = cursor->nextSafe(); // sharded collections will have a shard "key". if ( ! col[CollectionFields::key()].eoo() && ! col[CollectionFields::noBalance()].trueValue() ){ collections.push_back( col[CollectionFields::name()].String() ); } else if( col[CollectionFields::noBalance()].trueValue() ){ LOG(1) << "not balancing collection " << col[CollectionFields::name()].String() << ", explicitly disabled" << endl; } } cursor.reset(); if ( collections.empty() ) { LOG(1) << "no collections to balance" << endl; return; } // // 2. Get a list of all the shards that are participating in this balance round // along with any maximum allowed quotas and current utilization. We get the // latter by issuing db.serverStatus() (mem.mapped) to all shards. // // TODO: skip unresponsive shards and mark information as stale. // vector<Shard> allShards; Shard::getAllShards( allShards ); if ( allShards.size() < 2) { LOG(1) << "can't balance without more active shards" << endl; return; } ShardInfoMap shardInfo; for ( vector<Shard>::const_iterator it = allShards.begin(); it != allShards.end(); ++it ) { const Shard& s = *it; ShardStatus status = s.getStatus(); shardInfo[ s.getName() ] = ShardInfo( s.getMaxSize(), status.mapped(), s.isDraining(), status.hasOpsQueued(), s.tags() ); } // // 3. For each collection, check if the balancing policy recommends moving anything around. // for (vector<string>::const_iterator it = collections.begin(); it != collections.end(); ++it ) { const string& ns = *it; map< string,vector<BSONObj> > shardToChunksMap; cursor = conn.query(ConfigNS::chunk, QUERY(ChunkFields::ns(ns)).sort(ChunkFields::min())); while ( cursor->more() ) { BSONObj chunk = cursor->nextSafe(); vector<BSONObj>& chunks = shardToChunksMap[chunk[ChunkFields::shard()].String()]; chunks.push_back( chunk.getOwned() ); } cursor.reset(); if (shardToChunksMap.empty()) { LOG(1) << "skipping empty collection (" << ns << ")"; continue; } for ( vector<Shard>::iterator i=allShards.begin(); i!=allShards.end(); ++i ) { // this just makes sure there is an entry in shardToChunksMap for every shard Shard s = *i; shardToChunksMap[s.getName()].size(); } DistributionStatus status( shardInfo, shardToChunksMap ); // load tags conn.ensureIndex(ConfigNS::tag, BSON(TagFields::ns() << 1 << TagFields::min() << 1), true); cursor = conn.query(ConfigNS::tag, QUERY(TagFields::ns(ns)).sort(TagFields::min())); while ( cursor->more() ) { BSONObj tag = cursor->nextSafe(); uassert(16356 , str::stream() << "tag ranges not valid for: " << ns ,//.........这里部分代码省略.........
开发者ID:IanWhalen,项目名称:mongo,代码行数:101,
示例21: pulsesequence//.........这里部分代码省略........./* Set up f1180 */ tau1 = d2; if((f1180[A] == 'y') && (ni > 1.0)) { tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; }/* Set up f2180 */ tau2 = d3; if((f2180[A] == 'y') && (ni2 > 1.0)) { tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.2e-6) tau2 = 0.0; } tau2 = tau2/2.0;/* Calculate modifications to phases for States-TPPI acquisition */ if( ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 ); if(t1_counter % 2) { tsadd(t3,2,4); tsadd(t12,2,4); } if( ix == 1) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 ); if(t2_counter % 2) { tsadd(t8,2,4); tsadd(t12,2,4); }/* BEGIN PULSE SEQUENCE */status(A); delay(d1); rcvroff(); obspower(tpwr); decpower(pwClvl); dec2power(pwNlvl); decpwrf(rf0); obsoffset(tof); txphase(zero); delay(1.0e-5); dec2rgpulse(pwN, zero, 0.0, 0.0); /*destroy N15 and C13 magnetization*/ decrgpulse(pwC, zero, 0.0, 0.0); zgradpulse(gzlvl0, 0.5e-3); delay(1.0e-4); dec2rgpulse(pwN, one, 0.0, 0.0); decrgpulse(pwC, zero, 0.0, 0.0); zgradpulse(0.7*gzlvl0, 0.5e-3); delay(5.0e-4); rgpulse(pw,zero,0.0,0.0); /* 1H pulse excitation */ dec2phase(zero); zgradpulse(gzlvl0, gt0); delay(lambda - gt0); sim3pulse(2.0*pw, 0.0, 2.0*pwN, zero, zero, zero, 0.0, 0.0); txphase(one); zgradpulse(gzlvl0, gt0); delay(lambda - gt0); rgpulse(pw, one, 0.0, 0.0);
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例22: mainint main(int argc, char* argv[]){ // initiation the acl library acl::acl_cpp_init(); acl::log::stdout_open(true); int ch; size_t replicas = 0; bool add_slave = false, just_display = false; acl::string addr, cmd, conf, new_addr, node_id, key, passwd; while ((ch = getopt(argc, argv, "hs:a:f:N:SI:r:dk:p:")) > 0) { switch (ch) { case 'h': usage(argv[0]); return 0; case 's': addr = optarg; break; case 'a': cmd = optarg; break; case 'f': conf = optarg; break; case 'N': new_addr = optarg; break; case 'S': add_slave = true; break; case 'I': node_id = optarg; break; case 'r': replicas = (size_t) atoi(optarg); break; case 'd': just_display = true; break; case 'k': key = optarg; break; case 'p': passwd = optarg; break; default: break; } } int conn_timeout = 10, rw_timeout = 120; if (cmd == "hash_slot") { if (key.empty()) printf("usage: %s -a hash_slot -k key/r/n", argv[0]); else { size_t max_slot = 16384; unsigned short n = acl_hash_crc16(key.c_str(), key.length()); unsigned short slot = n % max_slot; printf("key: %s, slot: %d/r/n", key.c_str(), (int) slot); } } else if (cmd == "nodes") { if (addr.empty()) printf("usage: %s -s ip:port -a nodes/r/n", argv[0]); else { acl::redis_client client(addr, conn_timeout, rw_timeout); client.set_password(passwd); acl::redis redis(&client); redis_status status(addr, conn_timeout, rw_timeout, passwd); status.show_nodes(redis); } } else if (cmd == "slots") { if (addr.empty()) printf("usage: %s -a ip:port -a slots/r/n", argv[0]); else { acl::redis_client client(addr, conn_timeout, rw_timeout); client.set_password(passwd); acl::redis redis(&client); redis_status status(addr, conn_timeout, rw_timeout, passwd); status.show_slots(redis); } } else if (cmd == "create") { if (conf.empty()) printf("usage: %s -a create -f cluster.xml/r/n", argv[0]); else { redis_builder builder(passwd); builder.build(conf.c_str(), replicas, just_display);//.........这里部分代码省略.........
开发者ID:leemayi,项目名称:acl,代码行数:101,
示例23: Mainint Main(int argc, char const * const argv[], char const * const envp[]) { _aprcall(apr_initialize()); apr_pool_t *pool; apr_pool_create(&pool, NULL); bool tty(isatty(STDIN_FILENO)); bool compile(false); CYOptions options; append_history$ = (int (*)(int, const char *)) (dlsym(RTLD_DEFAULT, "append_history"));#ifdef CY_ATTACH pid_t pid(_not(pid_t));#endif const char *host(NULL); const char *port(NULL); apr_getopt_t *state; _aprcall(apr_getopt_init(&state, pool, argc, argv)); for (;;) { char opt; const char *arg; apr_status_t status(apr_getopt(state, "cg:n:"#ifdef CY_ATTACH "p:"#endif "r:" "s" , &opt, &arg)); switch (status) { case APR_EOF: goto getopt; case APR_BADCH: case APR_BADARG: fprintf(stderr, "usage: cycript [-c]"#ifdef CY_ATTACH " [-p <pid|name>]"#endif " [-r <host:port>]" " [<script> [<arg>...]]/n" ); return 1; default: _aprcall(status); } switch (opt) { case 'c': compile = true; break; case 'g': if (false); else if (strcmp(arg, "rename") == 0) options.verbose_ = true;#if YYDEBUG else if (strcmp(arg, "bison") == 0) bison_ = true;#endif else { fprintf(stderr, "invalid name for -g/n"); return 1; } break; case 'n': if (false); else if (strcmp(arg, "minify") == 0) pretty_ = true; else { fprintf(stderr, "invalid name for -n/n"); return 1; } break;#ifdef CY_ATTACH case 'p': { size_t size(strlen(arg)); char *end; pid = strtoul(arg, &end, 0); if (arg + size != end) { // XXX: arg needs to be escaped in some horrendous way of doom const char *command(apr_pstrcat(pool, "ps axc|sed -e '/^ *[0-9]/{s/^ *//([0-9]*//)//( *[^ ]*//)//{3//} *-*//([^ ]*//)///3 //1/;/^", arg, " /{s/^[^ ]* //;q;};};d'", NULL)); if (FILE *pids = popen(command, "r")) { char value[32]; size = 0; for (;;) { size_t read(fread(value + size, 1, sizeof(value) - size, pids)); if (read == 0) break;//.........这里部分代码省略.........
开发者ID:liufeigit,项目名称:cycript-1,代码行数:101,
示例24: pulsesequencepulsesequence(){ char CT_flg[MAXSTR], /* Constant time flag */ f1180[MAXSTR], shname1[MAXSTR], /* First pulse: name or 'vap' for automatic VAP(Variable angle pulse) */ ab_flg[MAXSTR]; /* inversion of 15N for coupling*/ int t1_counter, phase; double d2_init=0.0, pwNa = 0.0, adjust = getval("adjust"), ref_pwr = getval("ref_pwr"), ref_pw90 = getval("ref_pw90"), fla = getval("fla"), /* flip-angle */ gzlvl1 = getval("gzlvl1"), gzlvl2 = getval("gzlvl2"), gt1 = getval("gt1"), gt2 = getval("gt2"), gstab = getval("gstab"), pwNlvl = getval("pwNlvl"), pwN = getval("pwN"), dpwr2 = getval("dpwr2"), d2 = getval("d2"), tau1 = getval("tau1"), taunh = 1/(2.0*getval("JNH")); void compo_pulse(), make_shapes(); getstr("CT_flg", CT_flg); getstr("f1180",f1180); getstr("shname1",shname1); getstr("ab_flg",ab_flg); if(ab_flg[A] == 'a' || ab_flg[A] == 'b') pwNa = pwN; phase = (int) (getval("phase") + 0.5); if(FIRST_FID) make_shapes(shname1, ref_pw90, ref_pwr, fla); tau1 = d2; if((f1180[A] == 'y') && (ni > 1.0)) { tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; } if (f1180[0] == 'y') tau1 = tau1-pwN*4.0/3.0; if(ix == 1) d2_init = d2; dbl(ct,v1); /* v1 = 0202 */ t1_counter = (int) ((d2-d2_init)*sw1 + 0.5); if(t1_counter % 2) add(two,v1,v1); assign(v1,oph); if (phase == 2) incr(v1); status(A); dec2power(pwNlvl); zgradpulse(gzlvl2, gt2); delay(gstab); delay(d1-gt2); pbox_pulse(&sh1,zero,2.0e-4,2.0e-6); zgradpulse(gzlvl1, gt1); delay(gstab); if (ni == 0) { delay(taunh-gt1-gstab-WFG_START_DELAY+pwN*4.0-adjust); pbox_pulse(&sh2,zero,2.0e-6,2.0e-6); dec2rgpulse(pwN,v1,0.0,0.0); dec2rgpulse(pwN*2.0,zero,0.0,0.0); dec2rgpulse(pwN,zero,0.0,0.0); } else { delay(taunh-gt1-gstab-adjust); obspower(sh2dec.pwr); compo_pulse(pwN,v1,tau1); } zgradpulse(gzlvl1, gt1); delay(taunh*0.5-gt1-pwNa); if(ab_flg[A] == 'a' || ab_flg[A] == 'b') { dec2rgpulse(pwNa,zero,0.0,0.0); if (ab_flg[0] == 'b') /*INVERSION OR FLIP BACK*/ dec2rgpulse(pwNa,two,0.0,0.0); else//.........这里部分代码省略.........
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:101,
示例25: pulsesequence//.........这里部分代码省略......... mod4(v13,v11); /* v11 = 0000 1111 2222 3333 */ dbl(v1,oph); add(v11,oph,oph); add(v11,oph,oph); /* oph = 2v1 + 2v11 *//* CYCLOPS */ hlv(v13,v13); hlv(v13,v14); add(v1,v14,v1); add(v11,v14,v11); add(oph,v14,oph); assign(v14,v21); add(one,v21,v21); add(two,v21,v12); if (phincr1 < 0.0) phincr1=360+phincr1; initval(phincr1,v5); mod2(ct,v2); /* 01 01 */ hlv(ct,v4); hlv(v4,v4); mod2(v4,v4); dbl(v4,v4); /* 0000 2222 */ add(v4,v2,v4); mod4(v4,v4); /* 0101 2323 first echo in Excitation Sculpting */ hlv(ct,v7); mod2(v7,v7); /* 0011 */ hlv(ct,v9); hlv(v9,v9); hlv(v9,v9); dbl(v9,v9); add(v9,v7,v9); mod4(v9,v9); /* 0011 0011 2233 2233 second echo in Excitation Sculpting */ dbl(v2,v2); /* 0202 */ dbl(v7,v7); /* 0022 */ add(v2,v7,v7); /* 0220 correct oph for Excitation Sculpting */ add(oph,v7,oph); mod4(oph,oph); if (alt_grd[0] == 'y') mod2(ct,v10); /* alternate gradient sign on every 2nd transient *//* BEGIN THE ACTUAL PULSE SEQUENCE */status(A); if (getflag("lkgate_flg")) lk_sample(); /* turn lock sampling on */ obspower(tpwr); delay(5.0e-5); if (getflag("sspul")) steadystate(); delay(d1); if (getflag("lkgate_flg")) lk_hold(); /* turn lock sampling off */ status(B); rgpulse(pw, v14, rof1, rof1); if (selfrq != tof) obsoffset(selfrq); ifzero(v10); zgradpulse(gzlvlA,gtA); elsenz(v10); zgradpulse(-gzlvlA,gtA); endif(v10); delay(gstab); obspower(selpwrA); shaped_pulse(selshapeA,selpwA,v1,rof1,rof1); obspower(tpwr); ifzero(v10); zgradpulse(gzlvlA,gtA); elsenz(v10); zgradpulse(-gzlvlA,gtA); endif(v10); delay(gstab); if (selfrq != tof) delay(2*OFFSET_DELAY);
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:66,
注:本文中的status函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ status_calc_homunculus函数代码示例 C++ stats_prefix_find函数代码示例 |