这篇教程C++ tsadd函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中tsadd函数的典型用法代码示例。如果您正苦于以下问题:C++ tsadd函数的具体用法?C++ tsadd怎么用?C++ tsadd使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了tsadd函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: bul_update_expirevoid bul_update_expire(struct bulentry *bule){ if (bule->type != BUL_ENTRY) bule->expires = bule->lastsent; else if (tsisset(bule->lifetime)) tsadd(bule->lastsent, bule->lifetime, bule->expires); else { /* Deregistration entry, expires after 420 seconds...*/ tsadd(DEREG_BU_LIFETIME_TS, bule->lastsent, bule->expires); }}
开发者ID:Alkhliws,项目名称:projfin-hmip,代码行数:12,
示例2: bul_add/* Adds bul entry to both hashes and adds a timer for expiry / resend. Caller must fill all non-private fields of bule */int bul_add(struct bulentry *bule){ int ret = 0; struct timespec timer_expire; struct home_addr_info *hai = bule->home; assert(bule && tsisset(bule->lifetime) && hai); if ((ret = hash_add(&bul_hash, bule, &bule->hoa, &bule->peer_addr)) < 0) return ret; if ((ret = hash_add(&hai->bul, bule, NULL, &bule->peer_addr)) < 0) goto bul_free; clock_gettime(CLOCK_REALTIME, &bule->lastsent); if (bule->type == BUL_ENTRY) { if ((ret = pre_bu_bul_update(bule)) < 0) goto home_bul_free; } else if (bule->type == NON_MIP_CN_ENTRY) { if (bule->flags & IP6_MH_BU_HOME) { if (xfrm_block_hoa(hai) < 0) goto home_bul_free; } } tsadd(bule->delay, bule->lastsent, timer_expire); dbg("Adding bule/n"); dbg_func(bule, dump_bule); add_task_abs(&timer_expire, &bule->tqe, bule->callback); return 0;home_bul_free: hash_delete(&hai->bul, &bule->hoa, &bule->peer_addr);bul_free: hash_delete(&bul_hash, &bule->hoa, &bule->peer_addr); return ret; }
开发者ID:Alkhliws,项目名称:projfin-hmip,代码行数:36,
示例3: bul_update_timer/* * need to be separated into two phase: * phase 1: before sending BU * add policy/state for BU * phase 2: after sending BU * add policy/state for RO */void bul_update_timer(struct bulentry *bule){ struct timespec timer_expire; tsadd(bule->delay, bule->lastsent, timer_expire); dbg("Updating timer/n"); dbg_func(bule, dump_bule); add_task_abs(&timer_expire, &bule->tqe, bule->callback);}
开发者ID:Alkhliws,项目名称:projfin-hmip,代码行数:15,
示例4: pmip_timer_retrans_pbu_handler//---------------------------------------------------------------------------------------------------------------------void pmip_timer_retrans_pbu_handler(struct tq_elem *tqe){ int mutex_return_code; mutex_return_code = pthread_rwlock_wrlock(&pmip_lock); if (mutex_return_code != 0) { dbg("pthread_rwlock_wrlock(&pmip_lock) %s/n", strerror(mutex_return_code)); } printf("-------------------------------------/n"); if (!task_interrupted()) { pmip_entry_t *e = tq_data(tqe, pmip_entry_t, tqe); mutex_return_code = pthread_rwlock_wrlock(&e->lock); if (mutex_return_code != 0) { dbg("pthread_rwlock_wrlock(&e->lock) %s/n", strerror(mutex_return_code)); } dbg("Retransmissions counter : %d/n", e->n_rets_counter); if (e->n_rets_counter == 0) { free_iov_data((struct iovec *) &e->mh_vec, e->iovlen); dbg("No PBA received from LMA..../n"); dbg("Abort Trasmitting the PBU..../n"); mutex_return_code = pthread_rwlock_unlock(&e->lock); if (mutex_return_code != 0) { dbg("pthread_rwlock_unlock(&e->lock) %s/n", strerror(mutex_return_code)); } pmip_bce_delete(e); } else { //Decrement the N trasnmissions counter. e->n_rets_counter--; struct in6_addr_bundle addrs; addrs.src = &conf.OurAddress; addrs.dst = &conf.LmaAddress; //sends a PBU dbg("Send PBU again..../n"); // INCREMENT SEQ NUMBER OF PBU e->seqno_out = get_new_pbu_sequence_number(); ((struct ip6_mh_binding_update *)(e->mh_vec[0].iov_base))->ip6mhbu_seqno = htons(e->seqno_out); pmip_mh_send(&addrs, e->mh_vec, e->iovlen, e->link); //add a new task for PBU retransmission. struct timespec expires; clock_gettime(CLOCK_REALTIME, &e->add_time); tsadd(e->add_time, conf.RetransmissionTimeOut, expires); add_task_abs(&expires, &e->tqe, pmip_timer_retrans_pbu_handler); dbg("PBU Retransmissions timer is triggered again..../n"); mutex_return_code = pthread_rwlock_unlock(&e->lock); if (mutex_return_code != 0) { dbg("pthread_rwlock_unlock(&e->lock) %s/n", strerror(mutex_return_code)); } } } mutex_return_code = pthread_rwlock_unlock(&pmip_lock); if (mutex_return_code != 0) { dbg("pthread_rwlock_unlock(&pmip_lock) %s/n", strerror(mutex_return_code)); }}
开发者ID:mspublic,项目名称:openair4G-mirror,代码行数:57,
示例5: pmip_cache_start//---------------------------------------------------------------------------------------------------------------------int pmip_cache_start(pmip_entry_t * bce){ dbg("PMIP cache start is initialized add task pmip_timer_bce_expired_handler in %d seconds/n", bce->lifetime.tv_sec); struct timespec expires; clock_gettime(CLOCK_REALTIME, &bce->add_time); tsadd(bce->add_time, bce->lifetime, expires); add_task_abs(&expires, &bce->tqe, pmip_timer_bce_expired_handler); return 0;}
开发者ID:hugo-ma-alves,项目名称:OAI-PMIPv6-FM,代码行数:11,
示例6: pmip_cache_start//---------------------------------------------------------------------------------------------------------------------int pmip_cache_start(pmip_entry_t * bce){ /* AnhKhuong _add */ // if (is_lma()) return 0; /* AnhKhuong _end */ //dbg("PMIP cache start is initialized.. /n"); struct timespec expires; clock_gettime(CLOCK_REALTIME, &bce->add_time); tsadd(bce->add_time, bce->lifetime, expires); add_task_abs(&expires, &bce->tqe, pmip_timer_bce_expired_handler); return 0;}
开发者ID:NetworkingGroupSKKU,项目名称:Buffering-Scheme-in-PMIPv6,代码行数:14,
示例7: __bcache_startstatic int __bcache_start(struct bcentry *bce){ struct timespec expires, tmp; tssub(bce->lifetime, CN_BRR_BEFORE_EXPIRY_TS, tmp); clock_gettime(CLOCK_REALTIME, &bce->add_time); tsadd(bce->add_time, bce->type == BCE_HOMEREG ? bce->lifetime : tmp, expires); add_task_abs(&expires, &bce->tqe, _expire); xfrm_add_bce(&bce->our_addr, &bce->peer_addr, &bce->coa, 0); return 0;}
开发者ID:Alkhliws,项目名称:projfin-hmip,代码行数:13,
示例8: bcache_update_expireint bcache_update_expire(struct bcentry *bce){ struct timespec expires; clock_gettime(CLOCK_REALTIME, &bce->add_time); if (bce->type == BCE_HOMEREG) expires = bce->lifetime; else { bce->type = BCE_CACHED; tssub(bce->lifetime, CN_BRR_BEFORE_EXPIRY_TS, expires); } tsadd(expires, bce->add_time, expires); add_task_abs(&expires, &bce->tqe, _expire); xfrm_add_bce(&bce->our_addr, &bce->peer_addr, &bce->coa, 1); return 0;}
开发者ID:Alkhliws,项目名称:projfin-hmip,代码行数:17,
示例9: pulsesequencepulsesequence() {// Define Variables and Objects and Get Parameter Values double pw1Xstmas = getval("pw1Xstmas"); double pw2Xstmas = getval("pw2Xstmas"); double tXzfselinit = getval("tXzfsel"); double tXzfsel = tXzfselinit - 3.0e-6; if (tXzfsel < 0.0) tXzfsel = 0.0; double d2init = getval("d2"); double d2 = d2init - pw1Xstmas/2.0 - pw2Xstmas/2.0; if (d2 < 0.0) d2 = 0.0; DSEQ dec = getdseq("H"); strncpy(dec.t.ch,"dec",3); putCmd("chHtppm='dec'/n"); strncpy(dec.s.ch,"dec",3); putCmd("chHspinal='dec'/n");// Set Constant-time Period for d2. if (d2_index == 0) d2_init = getval("d2"); double d2_ = (ni - 1)/sw1 + d2_init; putCmd("d2acqret = %f/n",roundoff(d2_,12.5e-9)); putCmd("d2dwret = %f/n",roundoff(1.0/sw1,12.5e-9));//--------------------------------------// Copy Current Parameters to Processed//------------------------------------- putCmd("groupcopy('current','processed','acquisition')");// Dutycycle Protection DUTY d = init_dutycycle(); d.dutyon = getval("pw1Xstmas") + getval("pw2Xstmas") + getval("pwXzfsel"); d.dutyoff = d1 + 4.0e-6; d.c1 = d.c1 + (!strcmp(dec.seq,"tppm")); d.c1 = d.c1 + ((!strcmp(dec.seq,"tppm")) && (dec.t.a > 0.0)); d.t1 = d2_ + tXzfsel + getval("rd") + getval("ad") + at; d.c2 = d.c2 + (!strcmp(dec.seq,"spinal")); d.c2 = d.c2 + ((!strcmp(dec.seq,"spinal")) && (dec.s.a > 0.0)); d.t2 = d2_ + tXzfsel + getval("rd") + getval("ad") + at; d = update_dutycycle(d); abort_dutycycle(d,10.0);// Set Phase Tables settable(ph1Xstmas,4,table1); settable(ph2Xstmas,4,table2); settable(phXzfsel,8,table3); settable(phRec,8,table4); if (phase1 == 2) { tsadd(ph1Xstmas,1,4); } setreceiver(phRec);// Begin Sequence txphase(ph1Xstmas); decphase(zero); obspower(getval("tpwr")); obspwrf(getval("aXstmas")); obsunblank(); decunblank(); _unblank34(); delay(d1); sp1on(); delay(2.0e-6); sp1off(); delay(2.0e-6);// H Decoupler on Before STMAS _dseqon(dec);// Two-Pulse STMAS rgpulse(getval("pw1Xstmas"),ph1Xstmas,0.0,0.0); txphase(ph2Xstmas); delay(d2); rgpulse(getval("pw2Xstmas"),ph2Xstmas,0.0,0.0);// Z-filter Pulse txphase(phXzfsel); obsblank(); obspower(getval("dbXzfsel")); obspwrf(getval("aXzfsel")); delay(3.0e-6); obsunblank(); delay(tXzfsel); rgpulse(getval("pwXzfsel"),phXzfsel,0.0,0.0);// Begin Acquisition obsblank(); _blank34(); delay(getval("rd")); startacq(getval("ad")); acquire(np, 1/sw); endacq(); _dseqoff(dec); obsunblank(); decunblank(); _unblank34();}
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:100,
示例10: pulsesequence//.........这里部分代码省略......... psg_abort(1); } if((dm3[A] == 'y' || dm3[C] == 'y')) { printf("incorrect dec3 decoupler flags! Should be 'nnn' or 'nyn' "); psg_abort(1); } if( dpwr > 52 ) { printf("don't fry the probe, DPWR too large! "); psg_abort(1); } if( pw > 50.0e-6 ) { printf("dont fry the probe, pw too high ! "); psg_abort(1); } if( pwN > 100.0e-6 ) { printf("dont fry the probe, pwN too high ! "); psg_abort(1); } /* PHASES AND INCREMENTED TIMES *//* Phase incrementation for hypercomplex 2D data, States-Haberkorn element */ icosel1 = -1; icosel2 = -1; if (phase1 == 2) { tsadd(t6,2,4); icosel1 = -1*icosel1; } if (phase2 == 2) { tsadd(t10,2,4); icosel2 = -1*icosel2; tsadd(t6,2,4); }/* 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; } tau1 = tau1/2.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(t11,2,4); } if( ix == 1) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 ); if(t2_counter % 2) { tsadd(t5,2,4); tsadd(t11,2,4); }
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:67,
示例11: pulsesequence//.........这里部分代码省略......... if ( 0.5*ni2*1/(sw2) > timeTN - WFG3_START_DELAY) { printf(" ni2 is too big. Make ni2 equal to %d or less./n", ((int)((timeTN - WFG3_START_DELAY)*2.0*sw2))); psg_abort(1);} if ( dm[A] == 'y' || dm[B] == 'y' || dm[C] == 'y' ) { printf("incorrect dec1 decoupler flags! Should be 'nnn' "); psg_abort(1);} if ( dm2[A] == 'y' || dm2[B] == 'y' ) { printf("incorrect dec2 decoupler flags! Should be 'nny' "); psg_abort(1);} if ( dm3[A] == 'y' || dm3[C] == 'y' ) { printf("incorrect dec3 decoupler flags! Should be 'nyn' or 'nnn' "); psg_abort(1);} if ( dpwr2 > 46 ) { printf("dpwr2 too large! recheck value "); psg_abort(1);} if ( pw > 20.0e-6 ) { printf(" pw too long ! recheck value "); psg_abort(1);} if ( pwN > 100.0e-6 ) { printf(" pwN too long! recheck value "); psg_abort(1);} if ( TROSY[A]=='y' && dm2[C] == 'y' ) { text_error("Choose either TROSY='n' or dm2='n' ! "); psg_abort(1);}/* PHASES AND INCREMENTED TIMES *//* Phase incrementation for hypercomplex 2D data, States-Haberkorn element */ if (TROSY[A]=='y') { if (phase2 == 2) icosel = +1; else {tsadd(t4,2,4); tsadd(t10,2,4); icosel = -1;} } else { if (SE_flg[0]=='y') { if (phase2 == 2) {tsadd(t10,2,4); icosel = +1;} else icosel = -1; } else { if (phase2 == 2) {tsadd(t8,1,4); } } }/* Set up f2180 */ tau2 = d3; /* run 2D exp for NH correlation, but must use tau2 instead of tau1 because bionmr.h is written for nh_evol* to do tau2 evolution*/ if((f2180[A] == 'y') && (ni2 > 1.0)) /* use f2180 to control tau2 */ { 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) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw1 + 0.5 ); if(t2_counter % 2) { tsadd(t8,2,4); tsadd(t12,2,4); tsadd(t13,2,4); }
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:65,
示例12: pulsesequencepulsesequence() {// Define Variables and Objects and Get Parameter Values double aXfam2 = getval("aXfam2"); double pw1Xfam2 = getval("pw1Xfam2"); double pw2Xfam2 = getval("pw2Xfam2"); double pw3Xfam2 = getval("pw3Xfam2"); double pw4Xfam2 = getval("pw4Xfam2"); double nXfam2 = getval("nXfam2"); initval(nXfam2,v4); putCmd("pw2Xmqmas=pwXfam1"); // Sequence uses pwXfam1 and sets pw2Xmqmas double d2init = getval("d2"); // Define the Split d2 in the Pulse Sequence double ival = getval("ival"); double d20 = 1.0; double d21 = 0.0; double d22 = 0.0; if (ival == 1.5) { d20 = 9.0*d2init/16.0; d21 = 7.0*d2init/16.0; d22 = 0.0; } else if (ival == 2.5) { d20 = 12.0*d2init/31.0; d21 = 0.0*d2init/31.0; d22 = 19.0*d2init/31.0; } else { d20 = 1.0*d2init; d21 = 0.0*d2init; d22 = 0.0*d2init; } double tXechselinit = getval("tXechsel"); // Adjust the selective echo delay for the double tXechsel = tXechselinit - 3.0e-6; // attenuator switch time. if (tXechsel < 0.0) tXechsel = 0.0; DSEQ dec = getdseq("H"); strncpy(dec.t.ch,"dec",3); putCmd("chHtppm='dec'/n"); strncpy(dec.s.ch,"dec",3); putCmd("chHspinal='dec'/n");// Set Constant-time Period for d2. if (d2_index == 0) d2_init = getval("d2"); double d2_ = (ni - 1)/sw1 + d2_init; putCmd("d2acqret = %f/n",roundoff(d2_,12.5e-9)); putCmd("d2dwret = %f/n",roundoff(1.0/sw1,12.5e-9));//--------------------------------------// Copy Current Parameters to Processed//------------------------------------- putCmd("groupcopy('current','processed','acquisition')");// Dutycycle Protection DUTY d = init_dutycycle(); d.dutyon = getval("pw1Xmqmas") + nXfam2*(pw1Xfam2 + pw2Xfam2 + pw3Xfam2 +pw4Xfam2) + getval("pwXechsel"); d.dutyoff = d1 + 4.0e-6; d.c1 = d.c1 + (!strcmp(dec.seq,"tppm")); d.c1 = d.c1 + ((!strcmp(dec.seq,"tppm")) && (dec.t.a > 0.0)); d.t1 = d2_ + tXechselinit + getval("rd") + getval("ad") + at; d.c2 = d.c2 + (!strcmp(dec.seq,"spinal")); d.c2 = d.c2 + ((!strcmp(dec.seq,"spinal")) && (dec.s.a > 0.0)); d.t2 = d2_ + tXechselinit + getval("rd") + getval("ad") + at; d = update_dutycycle(d); abort_dutycycle(d,10.0);// Set Phase Tables if (phase1 == 0) { settable(phf1Xmqmas,12,table1); settable(ph1Xfam2,6,table2); settable(ph2Xfam2,6,table3); settable(phfXechsel,96,table4); settable(phRec,48,table5); } else { settable(phf1Xmqmas,6,table6); settable(ph1Xfam2,6,table7); settable(ph2Xfam2,6,table8); settable(phfXechsel,48,table9); settable(phRec,24,table10); if (phase1 == 2) { tsadd(phf1Xmqmas,30,360); } } setreceiver(phRec); obsstepsize(1.0);// Begin Sequence xmtrphase(phf1Xmqmas); decphase(zero);//.........这里部分代码省略.........
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:101,
示例13: pulsesequence//.........这里部分代码省略......... } if( 2*TCb - taue > 0.1 ) { printf("dont fry the probe, too long TCb"); psg_abort(1); } if( at > 0.1 && (dm[C]=='y' || dm2[C]=='y')) { printf("dont fry the probe, too long at with decoupling"); psg_abort(1); } if( pwC > 30.0e-6) { printf("dont fry the probe, too long pwC"); psg_abort(1); } if( dly_pg1 > 10.0e-3) { printf("dont fry the probe, too long dly_pg1"); psg_abort(1); } /* Phase incrementation for hypercomplex 2D data */ if (phase == 2) tsadd(t2,1,4); /* 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); }/* Set up f1180 tau1 = t1 */ tau1 = d2; if(f1180[A] == 'y') { tau1 += ( 1.0 / (2.0*sw1) ); } tau1 = tau1/2.0;/* 90-90 pulse for selective 180 of Cb but not Ca */ gp11 = 1/(2*fab) - 4/PI*pwsel90; if (gp11 < 0.0) { printf("gap of 90-90 negative, check fab and pwsel90"); psg_abort(1); }/* BEGIN ACTUAL PULSE SEQUENCE *//* Receiver off time */status(A);
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例14: pulsesequence//.........这里部分代码省略......... if(dpwr3_D > 49) { printf("dpwr3_D is too high; < 50/n"); psg_abort(1); } if(d1 < 1) { printf("d1 must be > 1/n"); psg_abort(1); } if(dpwrsed > 48) { printf("dpwrsed must be less than 49/n"); psg_abort(1); } if( gt0 > 5.0e-3 || gt1 > 5.0e-3 || gt2 > 5.0e-3 || gt3 > 5.0e-3 || gt4 > 5.0e-3 ) { printf(" all values of gti must be < 5.0e-3/n"); psg_abort(1); } if(ix==1) { printf("make sure that BigTC1 is set properly for your application/n"); printf("7 ms, neglecting relaxation /n"); }/* Phase incrementation for hypercomplex 2D data */ if (phase == 2) { tsadd(t1,1,4); tsadd(t2,1,4); tsadd(t3,1,4); tsadd(t4,1,4); } if (phase2 == 2) tsadd(t8,1,4);/* Set up f1180 tau1 = t1 */ tau1 = d2; tau1 = tau1 - 2.0*pw - 4.0/PI*pwC - POWER_DELAY - 2.0e-6 - PRG_START_DELAY - PRG_STOP_DELAY - POWER_DELAY - 2.0e-6; if(f1180[A] == 'y') { tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.4e-6) tau1 = 4.0e-7; } tau1 = tau1/2.0;/* Set up f2180 tau2 = t2 */ tau2 = d3; if(f2180[A] == 'y') { tau2 += ( 1.0 / (2.0*sw2) ); if(tau2 < 0.4e-6) tau2 = 4.0e-7; } tau2 = tau2/2.0;/* Calculate modifications to phases for States-TPPI acquisition */ if( ix == 1) d2_init = d2 ;
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例15: pulsesequence//.........这里部分代码省略........./* LOAD VARIABLES */ if(ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5); tau1 = d2/2.0 - pw; if(tau1 < 0.0) tau1 = 0.0;/* LOAD PHASE TABLES */ settable(t6, 4, recT); if (TROSY[A] == 'y') { gsign = -1.0; pwNt = pwN; assign(zero,v7); assign(two,v8); settable(t1, 1, phT1); settable(t2, 4, phT2); settable(t3, 1, phT4); settable(t4, 1, phT4); settable(t5, 4, recT); } else { assign(one,v7); assign(three,v8); settable(t1, 4, phi1); settable(t2, 2, phi2); settable(t3, 8, phi3); settable(t4, 1, phi4); settable(t5, 8, rec); } if ( phase1 == 2 ) /* Hypercomplex in t1 */ { if (TROSY[A] == 'y') { tsadd(t3, 2, 4); tsadd(t5, 2, 4); } else tsadd(t2, 1, 4); } if(t1_counter %2) /* calculate modification to phases based on */ { tsadd(t2,2,4); tsadd(t5,2,4); tsadd(t6,2,4); } /* current t1 values */ if(wtg3919[0] != 'y') { add(one,v7,v7); add(one,v8,v8); } /* sequence starts!! */ status(A); obspower(tpwr); dec2power(pwNlvl); decpower(pwClvl); decpwrf(rfst); if(Hdecflg[0] != 'n') { delay(5.0e-5); rgpulse(pw,zero,rof1,0.0); rgpulse(pw,one,0.0,rof1); zgradpulse(1.5*gzlvl3, 0.5e-3); delay(5.0e-4); rgpulse(pw,zero,rof1,0.0); rgpulse(pw,one,0.0,rof1); zgradpulse(-gzlvl3, 0.5e-3); } delay(d1); rcvroff(); status(B);
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:66,
示例16: pulsesequence//.........这里部分代码省略......... psg_abort(1); } if( d_me1 > pwchirp1 ) { printf("impossible; d_me1 > pwchirp1 ! "); psg_abort(1); } if( d_me2 > pwchirp2 ) { printf("impossible; d_me2 > pwchirp2 ! "); psg_abort(1); } if( dchrpi > 60 ) { printf("dont fry the probe, dchrpi too large/n"); psg_abort(1); } if(pwchirpi > 10.0e-3) { printf("don't fry the probe, pwchirpi too large! "); psg_abort(1); } d_mei = diffi/ratei;/* Phase incrementation for hypercomplex 2D data */ if (phase == 2) tsadd(t1,1,4); if (phase2 == 2) tsadd(t2,1,4);/* Set up f1180 tau1 = t1 */ tau1 = d2; if(f1180[A] == 'y') { tau1 += ( 1.0 / (2.0*sw1) - 4.0/PI*pw - 2.0e-6 ); } else tau1 = tau1 - 4.0/PI*pw - 2.0e-6; if(tau1 < 0.2e-6) tau1 = 2.0e-7;/* Set up f2180 tau2 = t2 */ tau2 = d3; if(f2180[A] == 'y') { tau2 += ( 1.0 / (2.0*sw2) - (4.0/PI)*pwC - 2.0*pw - PRG_START_DELAY - PRG_STOP_DELAY - 2.0*POWER_DELAY - 4.0e-6); } else tau2 = tau2 - ((4.0/PI)*pwC + 2.0*pw + PRG_START_DELAY + PRG_STOP_DELAY + 2.0*POWER_DELAY + 4.0e-6); if(tau2 < 0.2e-6) tau2 = 4.0e-7; tau2 = tau2/2.0;/* Calculate modifications to phases for States-TPPI acquisition */
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例17: pulsesequence//.........这里部分代码省略......... { text_error("incorrect dec1 decoupler flags! Should be 'nny' "); psg_abort(1); } if( (((dm[C] == 'y') && (dm2[C] == 'y')) && (STUD[A] == 'y')) ) { text_error("incorrect dec2 decoupler flags! Should be 'nnn' if STUD='y'"); psg_abort(1); } if( dpwr > 50 ) { text_error("don't fry the probe, DPWR too large! "); psg_abort(1); } if( dpwr2 > 50 ) { text_error("don't fry the probe, DPWR2 too large! "); psg_abort(1); } if( (pw > 20.0e-6) && (tpwr > 56) ) { text_error("don't fry the probe, pw too high ! "); psg_abort(1); } if( (pwC > 40.0e-6) && (pwClvl > 56) ) { text_error("don't fry the probe, pwN too high ! "); psg_abort(1); } if( (pwN > 100.0e-6) && (pwNlvl > 56) ) { text_error("don't fry the probe, pwN too high ! "); psg_abort(1); } if ((dm3[B] == 'y' && dpwr3 > 44 )) { text_error ("Deuterium decoupling power too high ! "); psg_abort(1); } if ((ncyc > 1 ) && (ix == 1)) { text_error("mixing time is %f ms./n",(ncyc*97.8*4*p_d)); }/* PHASES AND INCREMENTED TIMES *//* Phase incrementation for hypercomplex 2D data, States-Haberkorn element */ icosel1 = -1; icosel2 = -1; if (phase1 == 2) { tsadd(t6,2,4); icosel1 = -1*icosel1; } if (phase2 == 2) { tsadd(t10,2,4); icosel2 = -1*icosel2; tsadd(t6,2,4); }/* 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; } tau1 = tau1/2.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(t11,2,4); } if( ix == 1) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 ); if(t2_counter % 2) { tsadd(t5,2,4); tsadd(t11,2,4); }
开发者ID:timburrow,项目名称:ovj3,代码行数:67,
示例18: pulsesequence//.........这里部分代码省略......... { printf("don't fry the probe, dpwr too large! "); psg_abort(1); } if( dpwr2 > 50 ) { printf("don't fry the probe, dpwr2 too large! "); psg_abort(1); } if(gt1 > 15.0e-3 || gt2 > 15.0e-3 || gt3 > 15.0e-3 || gt4 > 15.0e-3) { printf("gti must be less than 15 ms /n"); psg_abort(1); }/* LOAD VARIABLES */ settable(t1, 8, phi1); settable(t2, 4, phi2); settable(t3, 1, phi3); settable(t10, 8, phi10); settable(t14, 8, rec); /* Phase incrementation for hypercomplex data */ if ( phase1 == 2 ) /* Hypercomplex in t1 */ { ttadd(t14,t10,4); tsadd(t3,2,4); } /* calculate modification to phases based on current t1 values to achieve States-TPPI acquisition */ if(ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5); tau1=0.5*d2; if(t1_counter %2) { tsadd(t2,2,4); tsadd(t14,2,4); } /* BEGIN ACTUAL PULSE SEQUENCE */status(A); obspower(tpwr); /* Set power for pulses */ dec2power(pwNlvl); /* Set decoupler2 power to pwNlvl */ initval(ncyc+0.1,v10); /* for DIPSI-2 */ delay(d1);status(B); rcvroff();
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:66,
示例19: pulsesequence//.........这里部分代码省略......... } if((dm2[A] == 'y' || dm2[B] == 'y')) { text_error("incorrect dec2 decoupler flags! Should be 'nny' "); psg_abort(1); } if( dpwr2 > 50 ) { text_error("don't fry the probe, DPWR2 too large! "); psg_abort(1); } if( pw > 20.0e-6 ) { text_error("dont fry the probe, pw too high ! "); psg_abort(1); } if( pwN > 100.0e-6 ) { text_error("dont fry the probe, pwN too high ! "); psg_abort(1); } /* PHASES AND INCREMENTED TIMES */ /* Phase incrementation for hypercomplex 2D data, States-Haberkorn element */ if (phase1 == 2) tsadd(t1,1,4); if (phase2 == 1) { tsadd(t10,2,4); icosel = 1; } else icosel = -1; /* Set up f1180 */ PRexp = 0; if((pra > 0.0) && (pra < 90.0)) PRexp = 1; if(PRexp) /* set up Projection-Reconstruction experiment */ tau1 = d2*csa; else tau1 = d2; if((f1180[A] == 'y') && (ni > 1.0)) { tau1 += ( 1.0 / (2.0*sw1) ); if(tau1 < 0.2e-6) tau1 = 0.0; } tau1 = tau1/2.0; /* Set up f2180 */ if(PRexp) tau2 = d2*sna; else { tau2 = d3;
开发者ID:timburrow,项目名称:ovj3,代码行数:67,
示例20: pulsesequence//.........这里部分代码省略......... /* 90 degree pulse on CO, null at Ca 118ppm away */ pw90onco = sqrt(15.0)/(4.0*118.0*dfrq); rf90onco = (4095.0*pwC*compC)/pw90onco; rf90onco = (int) (rf90onco + 0.5); if(rf90onco > 4095.0) { if(first_FID) printf("insufficient power for pw90onco -> rf90onco (%.0f)/n", rf90onco); rf90onco = 4095.0; pw90onco = pwC; } /* 180 degree pulse on CO, null at Ca 118ppm away */ pw180onco = sqrt(3.0)/(2.0*118.0*dfrq); rf180onco = (4095.0*pwC*compC*2.0)/pw180onco; rf180onco = (int) (rf180onco + 0.5); if(rf180onco > 4095.0) { if(first_FID) printf("insufficient power for pw180onco -> rf180onco (%.0f)/n", rf180onco); rf180onco = 4095.0; pw180onco = pwC*2.0; } pw180offca = pw180onco; rf180offca = rf180onco;/* Phase incrementation for hypercomplex data */ if (phase1 == 2) /* Hypercomplex in t1 */ { tsadd(t4, 1, 4); } if (phase1 == 4) /* Hypercomplex in t1 */ { tsadd(t4, 1, 4); } kappa=(taunco - tauhn)/(0.5*ni2/sw2)-0.001; if (kappa > 1.0) { kappa=1.0-0.01; } if (phase2 == 1) /* Hypercomplex in t2 */ { icosel = -1; tsadd(t2, 2, 4); tsadd(t3, 2, 4); } else icosel = 1; if (ix == 1) printf("semi constant time factor %4.6f/n",kappa); /* calculate modification to phases based on current t1 values to achieve States-TPPI acquisition */ if (ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5);
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:66,
示例21: pulsesequencepulsesequence(){ int t1_counter; char CCLS[MAXSTR], /* C13 refocussing pulse in middle of t1 */ wtg3919[MAXSTR], f1180[MAXSTR]; /* Flag to start t1 @ halfdwell */ double timeCT=getval("timeCT"), tauxh, tau1, gzlvl3=getval("gzlvl3"), gzlvl4=getval("gzlvl4"), gt3=getval("gt3"), gt4=getval("gt4"), gstab=getval("gstab"), /* gradient recovery delay */ JNH = getval("JNH"), pwN = getval("pwN"), pwNlvl = getval("pwNlvl"), pwHs, tpwrs=0.0, compH=1.0, /* H1 90 degree pulse length at tpwrs */ sw1 = getval("sw1"), /* temporary Pbox parameters */ pwClvl = getval("pwClvl"), /* coarse power for C13 pulse */ pwC = getval("pwC"); /* C13 90 degree pulse length at pwClvl */ getstr("CCLS",CCLS); getstr("wtg3919",wtg3919); getstr("f1180",f1180); /* check validity of parameter range */ if((dm[A] == 'y' || dm[B] == 'y' || dm[C] == 'y' )) { text_error("incorrect Dec1 decoupler flags! "); psg_abort(1); } if((dm2[A] == 'y' || dm2[B] == 'y') ) { text_error("incorrect Dec2 decoupler flags! "); psg_abort(1); } if( dpwr2 > 50 ) { text_error("don't fry the probe, dpwr2 too large! "); psg_abort(1); }/* INITIALIZE VARIABLES */ if(wtg3919[0] != 'y') /* selective H20 one-lobe sinc pulse needs 1.69 */ { /* times more power than a square pulse */ pwHs = getval("pwHs"); compH = getval("compH"); } else pwHs = pw*2.385+7.0*rof1+d3*2.5; tauxh = ((JNH != 0.0) ? 1/(4*(JNH)) : 2.25e-3); setautocal(); /* activate auto-calibration flags */ if (autocal[0] == 'n') { if(wtg3919[0] != 'y') /* selective H20 one-lobe sinc pulse needs 1.69 */ { /* times more power than a square pulse */ if (pwHs > 1e-6) tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69)); else tpwrs = 0.0; tpwrs = (int) (tpwrs); } } else /* if autocal = 'y'(yes), 'q'(quiet), r(read), or 's'(semi) */ { if(FIRST_FID) /* call Pbox */ { if(wtg3919[0] != 'y') H2Osinc = pbox_Rsh("H2Osinc", "sinc90", pwHs, 0.0, compH*pw, tpwr); } if (wtg3919[0] != 'y') { pwHs = H2Osinc.pw; tpwrs = H2Osinc.pwr-1.0; } /* 1dB correction applied */ }/* LOAD VARIABLES */ if(ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5); /* 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; } tau1 = tau1/2.0;/* LOAD PHASE TABLES */ assign(one,v7); assign(three,v8); settable(t1, 4, phi1); settable(t2, 2, phi2); settable(t3, 8, phi3); settable(t4, 16, phi4); settable(t5, 8, rec); if ( phase1 == 2 ) tsadd(t2, 1, 4); if(t1_counter %2) /* calculate modification to phases based on */ { tsadd(t2,2,4); tsadd(t5,2,4); } /* current t1 values *///.........这里部分代码省略.........
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:101,
示例22: pulsesequence//.........这里部分代码省略......... { printf(" ni is too big. Make ni less than %d or less./n", ((int)(timeTC*2.0*sw1/csa - 4e-6 - SAPS_DELAY))); psg_abort(1);} } if ( tauC < (gt7+1.0e-4+0.5*10.933*pwC)) gt7=(tauC-1.0e-4-0.5*10.933*pwC); if ( dm[A] == 'y' || dm[B] == 'y' || dm[C] == 'y' ) { printf("incorrect dec1 decoupler flags! Should be 'nnn' "); psg_abort(1);} if ( dm2[A] == 'y' || dm2[B] == 'y' ) { printf("incorrect dec2 decoupler flags! Should be 'nny' "); psg_abort(1);} if ( dm3[A] == 'y' || dm3[C] == 'y' ) { printf("incorrect dec3 decoupler flags! Should be 'nyn' or 'nnn' "); psg_abort(1);} if ( dpwr2 > 50 ) { printf("dpwr2 too large! recheck value "); psg_abort(1);} if ( pw > 20.0e-6 ) { printf(" pw too long ! recheck value "); psg_abort(1);} if ( pwN > 100.0e-6 ) { printf(" pwN too long! recheck value "); psg_abort(1);} if ( TROSY[A]=='y' && dm2[C] == 'y') { text_error("Choose either TROSY='n' or dm2='n' ! "); psg_abort(1);}/* PHASES AND INCREMENTED TIMES *//* Phase incrementation for hypercomplex 2D data, States-Haberkorn element */ if (phase1 == 2) tsadd(t3,1,4); if (TROSY[A]=='y') { if (phase2 == 2) icosel = +1; else {tsadd(t4,2,4); tsadd(t10,2,4); icosel = -1;} } else { if (phase2 == 2) {tsadd(t10,2,4); icosel = +1;} else icosel = -1; }/* 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); }/* Set up CONSTANT/SEMI-CONSTANT time evolution in N15 */ halfT2 = 0.0; CTdelay = timeTN + pwC8 + WFG_START_DELAY - SAPS_DELAY; if(ni>1) { if(f1180[A] == 'y') /* Set up f1180 */ tau1 += 0.5*csa/sw1; /* if not PRexp then csa = 1.0 */ if(PRexp) { halfT2 = 0.5*(ni-1)/sw1; /* ni2 is not defined */
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例23: pulsesequence//.........这里部分代码省略......... } rf200 = stC200.pwrf; pw200 = stC200.pw; }/* selective H20 one-lobe sinc pulse */ tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69)); tpwrs = (int)(tpwrs+0.5);/* check validity of parameter range */ if((dm[A] == 'y' || dm[B] == 'y' || dm[C] == 'y')) { printf("incorrect Dec1 decoupler flags! "); psg_abort(1); } if((dm2[A] == 'y' || dm2[B] == 'y')) { printf("incorrect Dec2 decoupler flags! "); psg_abort(1); } if ((dpwr > 48) || (dpwr2 > 48)) { printf("don't fry the probe, dpwr too high! "); psg_abort(1); }/* set up angles for PR42 experiments */ /* sw1 is used as symbolic index */ if ( sw1 < 1000 ) { printf ("Please set sw1 to some value larger than 1000./n"); psg_abort(1); } if (angle_H < 0 || angle_C < 0 || angle_H > 90 || angle_C > 90 ) { printf("angles must be set between 0 and 90 degree./n"); psg_abort(1); } cos_H = cos (PI*angle_H/180); cos_C = cos (PI*angle_C/180); if ( (cos_H*cos_H + cos_C*cos_C) > 1.0) { printf ("Impossible angle combinations./n"); psg_abort(1); } else { cos_N = sqrt(1 - (cos_H*cos_H + cos_C*cos_C) ); angle_N = acos(cos_N)*180/PI; } if (ix == 1) d2_init = d2; t1_counter = (int)((d2-d2_init)*sw1 + 0.5); if(t1_counter % 2) { tsadd(t3,2,4); tsadd(t11,2,4); } swTilt = swH*cos_H + swC*cos_C + swN*cos_N; if (phase1 == 1) {;} /* CC */ else if (phase1 == 2) { tsadd(t1, 1, 4); } /* SC */ else if (phase1 == 3) { tsadd(t2, 1, 4); tsadd(t14,1,4); } /* CS */ else if (phase1 == 4) { tsadd(t1, 1, 4); tsadd(t2,1,4); tsadd(t14,1,4); } /* SS */ if ( phase2 == 1 ) { tsadd(t5,2,4); icosel = 1; } else icosel = -1; tau1 = 1.0 * t1_counter * cos_H / swTilt; tau2 = 1.0 * t1_counter * cos_C / swTilt; tau3 = 1.0 * t1_counter * cos_N / swTilt; tau1 = tau1/2.0; tau2 = tau2/2.0; tau3 =tau3/2.0; if (ix ==1 ) { printf ("Current Spectral Width:/t/t%5.2f/n", swTilt); printf ("Angle_H: %5.2f /n", angle_H); printf ("Angle_C: %5.2f /n", angle_C); printf ("Angle_N: %5.2f /n", angle_N); printf ("/n/n/n/n/n"); }/* BEGIN ACTUAL PULSE SEQUENCE */status(A);
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:67,
示例24: pulsesequence//.........这里部分代码省略......... settable(t3,1,phi3); settable(t4,4,phi4); settable(t5,1,phi5); settable(t14,4,phi14); settable(t24,4,phi24);/* INITIALIZE VARIABLES */ timeTN1= timeTN-tauC; Delta = timeTN-tauC-tauNCO; //shpw1 = pw*8.0; shlvl1=tpwr; pwS1 = c13pulsepw("ca", "co", "square", 90.0); pwS2 = c13pulsepw("ca", "co", "square", 180.0); pwS3 = c13pulsepw("co", "ca", "sinc", 180.0); pwS7 = c13pulsepw("co", "ca", "sinc", 90.0); pwS4 = h_shapedpw("eburp2",shbw,shofs,zero, 0.0, 0.0); pwS6 = h_shapedpw("reburp",shbw,shofs,zero, 0.0, 0.0); pwS5 = h_shapedpw("pc9f",shbw,shofs,zero, 2.0e-6, 0.0);if (CT_flg[0] == 'y'){ if ( ni*1/(sw1)/2.0 > (CTdelay*0.5-gt3-1.0e-4)) { printf(" ni is too big. Make ni equal to %d or less./n", ((int)((CTdelay*0.5-gt3-1.0e-4)*2.0*sw1))); psg_abort(1);}} if (phase == 1) ; if (phase == 2) {tsadd(t1,1,4);}if ( phase2 == 2 ) { tsadd ( t3,2,4 ); tsadd ( t5,2,4 ); icosel = +1; }else icosel = -1;/* 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; }/************************************************************/ if( ix == 1) d2_init = d2; t1_counter = (int) ( (d2-d2_init)*sw1 + 0.5 ); if(t1_counter % 2) { tsadd(t1,2,4); tsadd(t14,2,4); tsadd(t24,2,4); } if( ix == 1) d3_init = d3; t2_counter = (int) ( (d3-d3_init)*sw2 + 0.5 );
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:67,
示例25: pulsesequence//.........这里部分代码省略........./* some checks */ if((dm2[A] == 'y') || (dm2[B] == 'y') || (dm2[C] == 'y') || (dm2[D] == 'y')) { text_error("incorrect dec2 decoupler flags! Should be 'nnnn' "); psg_abort(1); } if ( dm3[A] == 'y' || dm3[C] == 'y' ) { printf("incorrect dec3 decoupler flags! Should be 'nyn' or 'nnn' "); psg_abort(1);} if ( dpwr3 > 56 ) { printf("dpwr3 too large! recheck value "); psg_abort(1);} if ( (dm3[B] == 'y' ) && (timeCN*2.0 > 60.0e-3) ) { printf("too lond time for 2H decoupling, SOL ");psg_abort(1);}/* INITIALIZE VARIABLES */ if(FIRST_FID) /* call Pbox */ { getstr("CA180_in_str",CA180_in_str); getstr("CA180n_in_str",CA180n_in_str); getstr("CA90_in_str",CA90_in_str); getstr("CO180offCA_in_str",CO180offCA_in_str); strcpy(RFpars, "-stepsize 0.5 -attn i"); CA180 = pbox("et_CA180_auto", CA180_in_str, RFpars, dfrq, compC*pwC, pwClvl); CA180n = pbox("et_CA180n_auto", CA180n_in_str, RFpars, dfrq, compC*pwC, pwClvl); CA90 = pbox("et_CA90_auto", CA90_in_str, RFpars, dfrq, compC*pwC, pwClvl); CO180offCA = pbox("et_CO180offCA_auto", CO180offCA_in_str, RFpars, dfrq, compC*pwC, pwClvl); }; /* Phase incrementation for hypercomplex 2D data, States-Haberkorn element */ /* t1 , N15 */ if (phase1 == 2) {tsadd(t2 ,1,4);} if(d2_index % 2) {tsadd(t2,2,4); tsadd(t31,2,4); } /* setting up semi-CT on t1 (ni) dimension */ tau1 = d2; t1max=(ni-1.0)/sw1; if((f1180[A] == 'y') && (ni > 0.0)) {tau1 += 0.5/sw1 ; t1max+= 0.5/sw1; } if( t1max < timeTN1*2.0) {t1max=2.0*timeTN1;}; /* if not enough ni increments, then just regular CT in t1/ni CN */ /* t2, CA */ if (phase2 == 2) { tsadd(t3,1,4); } if (d3_index % 2) { tsadd(t3,2,4); tsadd(t31,2,4); } /* setup constant time in t2 (ni2) */ tau2 = d3; t2max=2.0*(timeCN - CO180offCA.pw); if((f2180[A] == 'y') && (ni2 > 0.0)) {tau2 += 0.5/sw2 ; t2max += 0.5/sw2 ;} if(tau2 < 0.2e-6) {tau2 = 0.0;} if ( (ni2-1.0)/sw2 > t2max) { text_error("too many ni2 increments in t2 ! "); psg_abort(1); } if(FIRST_FID) {
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:67,
示例26: pulsesequence//.........这里部分代码省略......... { printf ("angle_CO must be between 0 and 90 degree./n"); psg_abort(1); } if ( (angle_Ca < 0) || (angle_Ca > 90) ) { printf ("angle_Ca must be between 0 and 90 degree./n"); psg_abort(1); } if ( 1.0 < (cos_CO*cos_CO + cos_Ca*cos_Ca) ) { printf ("Impossible angles./n"); psg_abort(1); } else { cos_N=sqrt(1.0- (cos_CO*cos_CO + cos_Ca*cos_Ca)); angle_N = 180.0*acos(cos_N)/PI; } swTilt=swCO*cos_CO + swCa*cos_Ca + swN*cos_N; if (ix ==1) { printf("/n/nn/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n/n"); printf ("Maximum Sweep Width: /t/t %f Hz/n", swTilt); printf ("Anlge_CO:/t%6.2f/n", angle_CO); printf ("Anlge_Ca:/t%6.2f/n", angle_Ca); printf ("Anlge_N :/t%6.2f/n", angle_N ); }/* Set up hyper complex */ /* sw1 is used as symbolic index */ if ( sw1 < 1000 ) { printf ("Please set sw1 to some value larger than 1000./n"); psg_abort(1); } 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 (phase1 == 1) { ;} /* CC */ else if (phase1 == 2) { tsadd(t5,1,4);} /* SC */ else if (phase1 == 3) { tsadd(t1,1,4); } /* CS */ else if (phase1 == 4) { tsadd(t5,1,4); tsadd(t1,1,4); } /* SS */ else { printf ("phase1 can only be 1,2,3,4. /n"); psg_abort(1); } if (phase2 == 2) { tsadd(t4,2,4); icosel = 1; } /* N */ else icosel = -1; tau1 = 1.0*t1_counter*cos_Ca/swTilt; tau2 = 1.0*t1_counter*cos_CO/swTilt; tau3 = 1.0*t1_counter*cos_N/swTilt; tau1 = tau1/2.0; tau2 = tau2/2.0; tau3 = tau3/2.0;/* CHECK VALIDITY OF PARAMETER RANGES */ if (bigTN - 0.5*ni*(cos_N/swTilt) + pwS4 < 0.2e-6) { printf(" ni is too big. Make ni equal to %d or less./n", ((int)((bigTN + pwS4)*2.0*swTilt/cos_N))); psg_abort(1);} if ((fCTCa[A]=='y') && (bigTCa - 0.5*ni*(cos_Ca/swTilt) - WFG_STOP_DELAY - POWER_DELAY - gt11 - 50.2e-6 < 0.2e-6)) { printf(" ni is too big for Ca. Make ni equal to %d or less./n", (int) ((bigTCa -WFG_STOP_DELAY - POWER_DELAY - gt11 - 50.2e-6)/(0.5*cos_Ca/swTilt)) ); psg_abort(1); }
开发者ID:OpenVnmrJ,项目名称:OpenVnmrJ,代码行数:66,
示例27: pulsesequence//.........这里部分代码省略......... psg_abort(1); }*/ if(ni2/sw2 > 2.0*(bigTN - pwCO180)) { printf("ni2 is too big, should be < %f/n",2.0*sw2*(bigTN-pwCO180)); psg_abort(1); } if((dm[A] == 'y' || dm[B] == 'y' )) { printf("incorrect dec1 decoupler flags! Should be 'nnn' "); psg_abort(1); } if((dm2[A] == 'y' || dm2[B] == 'y')) { printf("incorrect dec2 decoupler flags! Should be 'nny' "); psg_abort(1); } if( dpwr > 50 ) { printf("don't fry the probe, DPWR too large! "); psg_abort(1); }/* Phase incrementation for hypercomplex 2D data */ if (phase1 == 1) { tsadd(t1, 1, 4); } if (phase2 == 2) { tsadd(t5,2,4); icosel = 1; } else icosel = -1; /* Set up f1180 tau1 = t1 */ tau1 = d2; if ((f1180[A] == 'y') && (ni > 1)) { tau1 += (1.0/(2.0*sw1)); } if(tau1 < 0.2e-6) tau1 = 0.0; tau1 = tau1/4.0; ratio = 2.0*bigTCO*sw1/((double) ni); ratio = (double)((int)(ratio*100.0))/100.0; if (ratio > 1.0) ratio = 1.0; if((dps_flag) && (ni > 1)) printf("ratio = %f => %f/n",2.0*bigTCO*sw1/((double) ni), ratio);/* Set up f2180 tau2 = t2 */ tau2 = d3; if ((f2180[A] == 'y') && (ni2 > 1)) { tau2 += (1.0/(2.0*sw2)); } if(tau2 < 0.2e-6) tau2 = 0.0; tau2 = tau2/4.0;
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:65,
示例28: pulsesequence//.........这里部分代码省略......... { text_error("dont fry the probe, pwc180 too high ! "); psg_abort(1); } if( gt3 > 2.5e-3 ) { text_error("gt3 is too long/n"); psg_abort(1); } if( gt1 > 10.0e-3 || gt2 > 10.0e-3 || gt4 > 10.0e-3 || gt5 > 10.0e-3 || gt6 > 10.0e-3 || gt7 > 10.0e-3 || gt8 > 10.0e-3 || gt9 > 10.0e-3) { text_error("gt values are too long. Must be < 10.0e-3 or gt11=50us/n"); psg_abort(1); } if((fca180[A] == 'y') && (ni2 > 1)) { text_error("must set fca180='n' to allow Calfa evolution (ni2>1)/n"); psg_abort(1); } if((fco180[A] == 'y') && (ni > 1)) { text_error("must set fco180='n' to allow CO evolution (ni>1)/n"); psg_abort(1); } /* Phase incrementation for hypercomplex 2D data */ if (phase == 2) tsadd(t1,1,4); if (phase2 == 2) tsadd(t5,1,4); if (phase3 == 2) { tsadd(t4, 2, 4); icosel = 1; } else icosel = -1;/* Set up f1180 tau1 = t1 */ tau1 = d2; if((f1180[A] == 'y') && (ni > 1)) { if (pwc180off > 2.0*pwN) tau1 += (1.0/(2.0*sw1) - 4.0*pwc90/PI - pwc180off - WFG3_START_DELAY - WFG3_STOP_DELAY - 4.0e-6 - 2.0*POWER_DELAY - 4.0e-6); else tau1 += (1.0/(2.0*sw1) - 4.0*pwc90/PI - 2.0*pwN - WFG3_START_DELAY - WFG3_STOP_DELAY - 4.0e-6 - 2.0*POWER_DELAY - 4.0e-6); if(tau1 < 0.2e-6) { tau1 = 0.4e-6; text_error("tau1 could be negative"); } } else { if (pwc180off > 2.0*pwN) tau1 = tau1 - 4.0*pwc90/PI - pwc180off - WFG3_START_DELAY - WFG3_STOP_DELAY - 4.0e-6 - 2.0*POWER_DELAY - 4.0e-6; else tau1 = tau1 - 4.0*pwc90/PI - 2.0*pwN - WFG3_START_DELAY - WFG3_STOP_DELAY - 4.0e-6 - 2.0*POWER_DELAY - 4.0e-6;
开发者ID:timburrow,项目名称:OpenVnmrJ,代码行数:66,
示例29: pulsesequencevoid pulsesequence(){/* DECLARE AND LOAD VARIABLES */char ch90shape[MAXSTR], ch180shape[MAXSTR], exp_mode[MAXSTR], /* flag to run 3D, or 2D time-shared 15N TROSY /13C HSQC-SE*/ decCACO[MAXSTR], caco180shape[MAXSTR], f1180[MAXSTR], /* Flag to start t1 @ halfdwell */ f2180[MAXSTR], f3180[MAXSTR], f4180[MAXSTR]; /* do TROSY on N15 and H1 */ int icosel, max_pcyc; /* used to get n and p type */ double tpwrs, ni2=getval("ni2"), ni3=getval("ni3"), tau1, tau1p,tau2,tau3,tau3p, /*evolution times in indirect dimensions */ tauNH=getval("tauNH"), /* 1/(4Jhn)*/ tauCH=getval("tauCH"), /* 1/(4Jch) */ tauCH1= getval("tauCH1"), /* tauCH/2.0+tauNH/2.0,*/ /* 1/(8Jch) +1/(8Jnh) */ tauCH2= getval("tauCH2"), swC = getval("swC"), /* spectral widths in 13C methyls */ pwClvl = getval("pwClvl"), /* coarse power for C13 pulse */ pwC = getval("pwC"), /* C13 90 degree pulse length at pwClvl */ swN = getval("swN"), /* spectral widths in 15N */ pwNlvl = getval("pwNlvl"), /* power for N15 pulses */ pwN = getval("pwN"), /* N15 90 degree pulse length at pwNlvl */ ch90pwr=getval("ch90pwr"), ch90pw=getval("ch90pw"), ch90corr=getval("ch90corr"), ch90dres=getval("ch90dres"), ch90dmf=getval("ch90dmf"), ch180pw=getval("ch180pw"), ch180pwr=getval("ch180pwr"), caco180pw=getval("caco180pw"), caco180pwr=getval("caco180pwr"), mix=getval("mix"), tpwrsf_d = getval("tpwrsf_d"), /* fine power adustment for first soft pulse(down)*/ tpwrsf_u = getval("tpwrsf_u"), /* fine power adustment for second soft pulse(up) */ pwHs = getval("pwHs"), /* H1 90 degree pulse length at tpwrs */ compH =getval("compH"), gstab = getval("gstab"), gt0 = getval("gt0"), gt1 = getval("gt1"), gt2 = getval("gt2"), gt3 = getval("gt3"), gt4 = getval("gt4"), gt5 = getval("gt5"), gt6 = getval("gt6"), gt7 = getval("gt7"), gt8 = getval("gt8"), gt9 = getval("gt9"), gt10 = getval("gt10"), gzlvl0 = getval("gzlvl0"), gzlvl1 = getval("gzlvl1"), gzlvl2 = getval("gzlvl2"), gzlvl3 = getval("gzlvl3"), gzlvl4 = getval("gzlvl4"), gzlvl5 = getval("gzlvl5"), gzlvl6 = getval("gzlvl6"), gzlvl7 = getval("gzlvl7"), gzlvl8 = getval("gzlvl8"), gzlvl9 = getval("gzlvl9"), gzlvl10 = getval("gzlvl10"), gzlvl11 = getval("gzlvl11"); getstr("f1180",f1180); getstr("f2180",f2180); getstr("ch180shape",ch180shape); getstr("ch90shape",ch90shape); getstr("decCACO",decCACO); getstr("caco180shape",caco180shape); getstr("exp_mode",exp_mode); tpwrs = tpwr - 20.0*log10(pwHs/(compH*pw*1.69)); /*needs 1.69 times more*/ tpwrs = (int) (tpwrs); /*power than a square pulse */ if (tpwrsf_d<4095.0) tpwrs=tpwrs+6.0; /* add 6dB to let tpwrsf_d control fine power ~2048*/ if( (exp_mode[A]!='2') && (exp_mode[A]!='3') && (exp_mode[A]!='4') ) {text_error("invalid exp_mode, Should be either 2D or 3D or 4D/n "); psg_abort(1); }/* LOAD PHASE TABLE */ settable(t1,1,phi1); settable(t2,4,phi2); settable(t12,4,phi2); {tsadd(t12,2,4);} settable(t3,1,phi3); settable(t4,2,phi4); settable(t5,2,phi5);//.........这里部分代码省略.........
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:101,
示例30: pulsesequence//.........这里部分代码省略......... initval(ncyc,v7); /* v7 is the dipsi loop counter */ settable(t21,1,psi1); settable(t11,2,phi1); settable(t12,1,phi2); settable(t13,1,phi3); settable(t14,1,phi4); settable(t15,8,phi5); settable(t16,8,phi6); settable(t10,8,rec); /* Phase table: phi1 = t11 = 0 1 phi2 = t12 = 0 phi3 = t13 = 0 0 0 0 0 0 0 0 phi3'= t14 = 1 1 1 1 1 1 1 1 phi5 = t15 = 0 0 1 1 2 2 3 3 phi6 = t16 = 0 0 0 0 2 2 2 2 THESE TO BE SOFTWARE-MODIFIED BASED ON t1, t2 VALUES: rec = t10 = 0 2 2 0 0 2 2 0 psi1 = t21 = 0 psi2 = t22 = 0*/ if(phase1==2) tsadd(t21,1,4); if(phase2==2) tsadd(t12,1,4); if(d2_index%2) { tsadd(t21,2,4); tsadd(t10,2,4); } if(d3_index%2) { tsadd(t12,2,4); tsadd(t10,2,4); }/* BEGIN ACTUAL PULSE SEQUENCE */status(A); if (satmode[A] == 'y') { if(satmove) obsoffset(satfrq); obspower(satpwr); rgpulse(d1,zero,rof1,rof1); if(satmove) obsoffset(tof); } else { delay(d1); } rcvroff();
开发者ID:DanIverson,项目名称:OpenVnmrJ,代码行数:67,
注:本文中的tsadd函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ tsearch函数代码示例 C++ ts_resource函数代码示例 |