31 int current_dunit=CUNIT_UNKNOWN;
37 if(dft==NULL || dunit<0)
return(1);
41 if(current_dunit==CUNIT_UNKNOWN)
return(2);
43 if(current_dunit==dunit)
return(0);
46 switch(current_dunit) {
47 case CUNIT_BQ_PER_ML: f*=0.001; unit_type=1;
break;
48 case CUNIT_KBQ_PER_ML: f*=1.0; unit_type=1;
break;
49 case CUNIT_MBQ_PER_ML: f*=1000.0; unit_type=1;
break;
50 case CUNIT_NCI_PER_ML: f*=0.037; unit_type=1;
break;
51 case CUNIT_UCI_PER_ML: f*=37.0; unit_type=1;
break;
52 case CUNIT_BQ: f*=0.000001; unit_type=2;
break;
53 case CUNIT_KBQ: f*=0.001; unit_type=2;
break;
54 case CUNIT_MBQ: f*=1.0; unit_type=2;
break;
55 case CUNIT_GBQ: f*=1000.0; unit_type=2;
break;
56 case CUNIT_NCI: f*=0.000037; unit_type=2;
break;
57 case CUNIT_UCI: f*=0.037; unit_type=2;
break;
58 case CUNIT_MCI: f*=37.0; unit_type=2;
break;
63 if(unit_type==1)
switch(dunit) {
64 case CUNIT_BQ_PER_ML: f*=1000.0;
break;
65 case CUNIT_KBQ_PER_ML: f*=1.0;
break;
66 case CUNIT_MBQ_PER_ML: f*=0.001;
break;
67 case CUNIT_NCI_PER_ML: f/=0.037;
break;
68 case CUNIT_UCI_PER_ML: f/=37.0;
break;
70 }
else if(unit_type==2)
switch(dunit) {
71 case CUNIT_BQ: f*=1000000.0;
break;
72 case CUNIT_KBQ: f*=1000.0;
break;
73 case CUNIT_MBQ: f*=1.0;
break;
74 case CUNIT_GBQ: f*=0.001;
break;
75 case CUNIT_NCI: f/=0.000037;
break;
76 case CUNIT_UCI: f/=0.037;
break;
77 case CUNIT_MCI: f/=37.0;
break;
84 for(fi=0; fi<dft->
frameNr; fi++) {
85 for(ri=0; ri<dft->
voiNr; ri++) {
86 if(!isnan(dft->
voi[ri].
y[fi])) dft->
voi[ri].
y[fi]*=f;
87 if(!isnan(dft->
voi[ri].
y2[fi])) dft->
voi[ri].
y2[fi]*=f;
88 if(!isnan(dft->
voi[ri].
y3[fi])) dft->
voi[ri].
y3[fi]*=f;