Show
Ignore:
Timestamp:
09/03/09 00:23:49 (15 years ago)
Author:
trnewman
Message:

Bug fixes for ossie demo

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vtcross/trunk/src/cognitive_engines/OSSIE_DEMO_CE/cbr.c

    r457 r458  
    129129            strcat(_cbr->command, ", "); 
    130130    } 
    131     strcat(_cbr->command, ", timestamp DATE, PRIMARY KEY(biterrorrate,tx_power));"); 
     131    strcat(_cbr->command, ", timestamp DATE, PRIMARY KEY(tx_power));"); 
    132132 
    133133    // execute create table command 
     
    190190    float *_vals, 
    191191    unsigned int _n, 
    192     float *_retvals) 
     192    float *_retvals, 
     193    int evf) 
    193194{    
    194195    int rc; 
     196    float lower_limit; 
     197    float upper_limit; 
    195198    // generate command 
    196199    strcpy(_cbr->command, "select "); 
     
    211214 
    212215        strcat(_cbr->command, _names[i]); 
    213         strcat(_cbr->command, ops_str[_ops[i]]); 
    214         sprintf(str_buffer, "%E", _vals[i]); 
    215         strcat(_cbr->command, str_buffer); 
     216        strcat(_cbr->command, " between "); 
     217         
     218        lower_limit = _vals[i]*(1-((float)evf/100)); 
     219        upper_limit = _vals[i]*(1+((float)evf/100)); 
     220 
     221        printf("%f %f %f\n", lower_limit, upper_limit, _vals[i]); 
     222 
     223        sprintf(_cbr->command, "%s%f", _cbr->command, lower_limit); 
     224        strcat(_cbr->command, " and "); 
     225        sprintf(_cbr->command, "%s%f", _cbr->command, upper_limit); 
    216226 
    217227