Changeset 8886

Show
Ignore:
Timestamp:
03/06/09 20:25:21 (4 years ago)
Author:
deepanns
Message:

updated query and configure for components

Location:
ossiedev/branches/deepanns/components
Files:
26 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/deepanns/components/AutomaticGainControl/src/AutomaticGainControl.cpp

    r8110 r8886  
    8787} 
    8888 
     89void AutomaticGainControl_i::query(CF::Properties & configProperties) 
     90throw (CORBA::SystemException, CF::UnknownProperties) 
     91{ 
     92    if (configProperties.length () == 0) 
     93    {    
     94        configProperties.length (propertySet.length ()); 
     95        for (unsigned int i = 0; i < propertySet.length (); i++) 
     96        { 
     97            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     98            configProperties[i].value = propertySet[i].value; 
     99        } 
     100        return ; 
     101    }    
     102    else { 
     103        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     104            for (unsigned int j=0; j < propertySet.length(); j++) { 
     105                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     106                    configProperties[i].value = propertySet[i].value; 
     107                } 
     108            } 
     109        } 
     110    }    
     111} 
     112 
    89113void AutomaticGainControl_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    90114{ 
     115        static int init = 0; 
     116 
    91117    CORBA::Float simple_temp; 
    92118 
     
    94120     
    95121    DEBUG(3, AutomaticGainControl, "props length : " << props.length()) 
    96  
    97     for (unsigned int i = 0; i <props.length(); i++) 
    98     { 
    99         DEBUG(3, AutomaticGainControl, "Property id : " << props[i].id) 
    100  
    101         if (strcmp(props[i].id, "DCE:aaf97fa0-d184-4d88-9954-3a1334c73d6d") == 0) { 
    102             // energy_lo 
    103             props[i].value >>= simple_temp; 
    104             omni_mutex_lock oml(accessPrivateData); 
    105             energy_lo = simple_temp; 
    106  
    107             DEBUG(3, AutomaticGainControl, "prop (energy_lo): " << simple_temp) 
    108  
    109         } else if (strcmp(props[i].id, "DCE:346e17c9-6678-483a-bffb-1909c64bddc0") == 0) { 
    110             // energy_hi 
    111             props[i].value >>= simple_temp; 
    112             omni_mutex_lock oml(accessPrivateData); 
    113             energy_hi = simple_temp; 
    114  
    115             DEBUG(3, AutomaticGainControl, "prop (energy_hi): " << simple_temp) 
    116  
    117         } else if (strcmp(props[i].id, "DCE:4608b943-4fe2-49df-91fb-afa287b609d4") == 0) { 
    118             // k_attack 
    119             props[i].value >>= simple_temp; 
    120             omni_mutex_lock oml(accessPrivateData); 
    121             k_attack = simple_temp; 
    122  
    123             DEBUG(3, AutomaticGainControl, "prop (k_attack): " << simple_temp) 
    124  
    125         } else if (strcmp(props[i].id, "DCE:491ec3de-ed45-48af-a6fc-ca2d6465e136") == 0) { 
    126             // k_release 
    127             props[i].value >>= simple_temp; 
    128             omni_mutex_lock oml(accessPrivateData); 
    129             k_release = simple_temp; 
    130  
    131             DEBUG(3, AutomaticGainControl, "prop (k_release): " << simple_temp) 
    132  
    133         } else if (strcmp(props[i].id, "DCE:312f63fe-709a-4217-933b-c584c8d6a9bb") == 0) { 
    134             // g_min 
    135             props[i].value >>= simple_temp; 
    136             omni_mutex_lock oml(accessPrivateData); 
    137             g_min = simple_temp; 
    138  
    139             DEBUG(3, AutomaticGainControl, "prop (g_min): " << simple_temp) 
    140  
    141         } else if (strcmp(props[i].id, "DCE:8357ee0d-2417-46d9-8475-2e5778d797e4") == 0) { 
    142             // g_max 
    143             props[i].value >>= simple_temp; 
    144             omni_mutex_lock oml(accessPrivateData); 
    145             g_max = simple_temp; 
    146  
    147             DEBUG(3, AutomaticGainControl, "prop (g_max): " << simple_temp) 
    148  
    149         } else if (strcmp(props[i].id, "DCE:b9b72ec8-d0bd-4060-b356-dcc6b0809e65") == 0) { 
    150             // rssi_pass 
    151             props[i].value >>= simple_temp; 
    152             omni_mutex_lock oml(accessPrivateData); 
    153             rssi_pass = simple_temp; 
    154  
    155             DEBUG(3, AutomaticGainControl, "prop (rssi_pass): " << simple_temp) 
    156  
    157         } else { 
    158             // unknown property 
    159             std::cerr << "ERROR: SymbolSyncPoly::configure() unknown property \"" 
    160                << props[i].id << "\"" << std::endl; 
    161             throw CF::PropertySet::InvalidConfiguration(); 
    162         } 
    163  
     122         
     123        if (init == 0){ 
     124        std::cout << "AutomaticGainControl :initial configure call .." << std::endl; 
     125        propertySet.length(props.length()); 
     126        for (unsigned int i=0; i < props.length(); i++) { 
     127            std::cout << "Property Id : " << props[i].id << std::endl; 
     128            propertySet[i].id = CORBA::string_dup(props[i].id); 
     129            propertySet[i].value = props[i].value; 
     130        } 
     131        init = 1; 
     132        return; 
    164133    } 
     134    else { 
     135                for (unsigned int i = 0; i <props.length(); i++) 
     136                { 
     137                    DEBUG(3, AutomaticGainControl, "Property id : " << props[i].id) 
     138 
     139                    if (strcmp(props[i].id, "DCE:aaf97fa0-d184-4d88-9954-3a1334c73d6d") == 0) { 
     140                        // energy_lo 
     141                        props[i].value >>= simple_temp; 
     142                        omni_mutex_lock oml(accessPrivateData); 
     143                        energy_lo = simple_temp; 
     144                std::cout << "Property id : " << props[i].id << std::endl; 
     145                                // Update value of this property in propertySet also 
     146                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     147                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     148                        propertySet[i].value = props[i].value; 
     149                        break; 
     150                    } 
     151                } 
     152 
     153                        DEBUG(3, AutomaticGainControl, "prop (energy_lo): " << simple_temp) 
     154 
     155                    } else if (strcmp(props[i].id, "DCE:346e17c9-6678-483a-bffb-1909c64bddc0") == 0) { 
     156                        // energy_hi 
     157                        props[i].value >>= simple_temp; 
     158                        omni_mutex_lock oml(accessPrivateData); 
     159                        energy_hi = simple_temp; 
     160                std::cout << "Property id : " << props[i].id << std::endl; 
     161                                // Update value of this property in propertySet also 
     162                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     163                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     164                        propertySet[i].value = props[i].value; 
     165                        break; 
     166                    } 
     167                } 
     168 
     169                        DEBUG(3, AutomaticGainControl, "prop (energy_hi): " << simple_temp) 
     170 
     171                    } else if (strcmp(props[i].id, "DCE:4608b943-4fe2-49df-91fb-afa287b609d4") == 0) { 
     172                        // k_attack 
     173                        props[i].value >>= simple_temp; 
     174                        omni_mutex_lock oml(accessPrivateData); 
     175                        k_attack = simple_temp; 
     176 
     177                std::cout << "Property id : " << props[i].id << std::endl; 
     178                                // Update value of this property in propertySet also 
     179                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     180                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     181                        propertySet[i].value = props[i].value; 
     182                        break; 
     183                    } 
     184                } 
     185 
     186                        DEBUG(3, AutomaticGainControl, "prop (k_attack): " << simple_temp) 
     187 
     188                    } else if (strcmp(props[i].id, "DCE:491ec3de-ed45-48af-a6fc-ca2d6465e136") == 0) { 
     189                        // k_release 
     190                        props[i].value >>= simple_temp; 
     191                        omni_mutex_lock oml(accessPrivateData); 
     192                        k_release = simple_temp; 
     193 
     194                std::cout << "Property id : " << props[i].id << std::endl; 
     195                                // Update value of this property in propertySet also 
     196                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     197                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     198                        propertySet[i].value = props[i].value; 
     199                        break; 
     200                    } 
     201                } 
     202 
     203                        DEBUG(3, AutomaticGainControl, "prop (k_release): " << simple_temp) 
     204 
     205                    } else if (strcmp(props[i].id, "DCE:312f63fe-709a-4217-933b-c584c8d6a9bb") == 0) { 
     206                        // g_min 
     207                        props[i].value >>= simple_temp; 
     208                        omni_mutex_lock oml(accessPrivateData); 
     209                        g_min = simple_temp; 
     210 
     211                std::cout << "Property id : " << props[i].id << std::endl; 
     212                                // Update value of this property in propertySet also 
     213                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     214                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     215                        propertySet[i].value = props[i].value; 
     216                        break; 
     217                    } 
     218                } 
     219 
     220                        DEBUG(3, AutomaticGainControl, "prop (g_min): " << simple_temp) 
     221 
     222                    } else if (strcmp(props[i].id, "DCE:8357ee0d-2417-46d9-8475-2e5778d797e4") == 0) { 
     223                        // g_max 
     224                        props[i].value >>= simple_temp; 
     225                        omni_mutex_lock oml(accessPrivateData); 
     226                        g_max = simple_temp; 
     227 
     228                std::cout << "Property id : " << props[i].id << std::endl; 
     229                                // Update value of this property in propertySet also 
     230                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     231                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     232                        propertySet[i].value = props[i].value; 
     233                        break; 
     234                    } 
     235                } 
     236 
     237                        DEBUG(3, AutomaticGainControl, "prop (g_max): " << simple_temp) 
     238 
     239                    } else if (strcmp(props[i].id, "DCE:b9b72ec8-d0bd-4060-b356-dcc6b0809e65") == 0) { 
     240                        // rssi_pass 
     241                        props[i].value >>= simple_temp; 
     242                        omni_mutex_lock oml(accessPrivateData); 
     243                        rssi_pass = simple_temp; 
     244 
     245                std::cout << "Property id : " << props[i].id << std::endl; 
     246                                // Update value of this property in propertySet also 
     247                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     248                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     249                        propertySet[i].value = props[i].value; 
     250                        break; 
     251                    } 
     252                } 
     253 
     254                        DEBUG(3, AutomaticGainControl, "prop (rssi_pass): " << simple_temp) 
     255 
     256                    } else { 
     257                        // unknown property 
     258                        std::cerr << "ERROR: SymbolSyncPoly::configure() unknown property \"" 
     259                           << props[i].id << "\"" << std::endl; 
     260                        throw CF::PropertySet::InvalidConfiguration(); 
     261                    } 
     262 
     263                } 
     264        } 
    165265} 
    166266 
  • ossiedev/branches/deepanns/components/AutomaticGainControl/src/AutomaticGainControl.h

    r4668 r8886  
    6767        void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    6868 
     69        void query(CF::Properties &configProperties) throw (CF::UnknownProperties, CORBA::SystemException); 
     70 
    6971        /// 
    7072        void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
  • ossiedev/branches/deepanns/components/ChannelDemo/ChannelDemo.cpp

    r5803 r8886  
    149149} 
    150150 
     151void  
     152ChannelDemo_i::query (CF::Properties & configProperties) 
     153throw (CORBA::SystemException, CF::UnknownProperties) 
     154{ 
     155    // for queries of zero length, return all id/value pairs in propertySet 
     156    if (configProperties.length () == 0) 
     157    {    
     158        configProperties.length (propertySet.length ()); 
     159        for (unsigned int i = 0; i < propertySet.length (); i++) 
     160        { 
     161            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     162            configProperties[i].value = propertySet[i].value; 
     163        } 
     164 
     165        return ; 
     166    }    
     167    else { 
     168        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     169            for (unsigned int j=0; j < propertySet.length(); j++) { 
     170                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     171                    configProperties[i].value = propertySet[i].value; 
     172               } 
     173            } 
     174        } 
     175    }    
     176} 
     177 
    151178void ChannelDemo_i::configure(const CF::Properties& props) 
    152179throw (CORBA::SystemException, 
     
    154181    CF::PropertySet::PartialConfiguration) 
    155182{ 
     183    static int init = 0; 
     184 
    156185    DEBUG(3, ChannelDemo, "configure() invoked") 
    157      
    158     std::cout << "props length : " << props.length() << std::endl; 
    159  
    160     for (unsigned int i = 0; i <props.length(); i++) { 
    161         std::cout << "Property id : " << props[i].id << std::endl; 
    162  
    163         if (strcmp(props[i].id, "DCE:a337c5f0-8245-11dc-860f-00123f63025f") == 0) { 
    164             // noise_std_dev (standard deviation of noise) 
    165             CORBA::Short simple_temp; 
    166             props[i].value >>= simple_temp; 
    167             noise_std_dev = simple_temp; 
    168             DEBUG(1, ChannelDemo, "Setting noise standard deviation to " << noise_std_dev); 
    169         } else if (strcmp(props[i].id, "DCE:1c4a3eb9-9e3a-4c20-849a-90c6eaef9e5a") == 0) { 
    170             // phase offset (degrees) 
    171             CORBA::Float simple_temp; 
    172             props[i].value >>= simple_temp; 
    173             phase_offset = simple_temp; 
    174             DEBUG(1, ChannelDemo, "Setting phase offset to " << phase_offset << " degrees"); 
    175  
    176             // convert to radians 
    177             phase_offset *= M_PI/180.0f; 
    178         } else { 
    179             // unknown property 
    180             std::cerr << "ERROR: ChannelDemo_i::configure() unknown property \"" 
    181                << props[i].id << "\"" << std::endl; 
    182             throw CF::PropertySet::InvalidConfiguration(); 
     186 
     187    std::cout << "Component - CHANNEL DEMO" << std::endl; 
     188    if (init == 0){ 
     189        std::cout << " ChannelDemo - initial configure call .." << std::endl; 
     190        propertySet.length(props.length()); 
     191        for (unsigned int i=0; i < props.length(); i++) { 
     192            std::cout << "Property Id : " << props[i].id << std::endl; 
     193            propertySet[i].id = CORBA::string_dup(props[i].id); 
     194            propertySet[i].value = props[i].value; 
     195        } 
     196        init = 1; 
     197        return; 
     198    } 
     199    else { 
     200 
     201        std::cout << "props length : " << props.length() << std::endl; 
     202        //propertySet.length(props.length()); 
     203        std::cout << "ChannelDemo_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     204 
     205        for (unsigned int i = 0; i <props.length(); i++) { 
     206            if (strcmp(props[i].id, "DCE:a337c5f0-8245-11dc-860f-00123f63025f") == 0) { 
     207                // noise_std_dev (standard deviation of noise) 
     208                CORBA::Short simple_temp; 
     209                props[i].value >>= simple_temp; 
     210                // Test: setting propertySet[] to the given value.  
     211                noise_std_dev = simple_temp; 
     212 
     213                std::cout << "Property id : " << props[i].id << std::endl; 
     214                // Update value of this property in propertySet also 
     215                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     216                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     217                        propertySet[i].value = props[i].value; 
     218                        break; 
     219                    } 
     220                } 
     221                DEBUG(1, ChannelDemo, "Setting noise standard deviation to " << noise_std_dev); 
     222            } 
     223            else if (strcmp(props[i].id, "DCE:1c4a3eb9-9e3a-4c20-849a-90c6eaef9e5a") == 0) { 
     224                // phase offset (degrees) 
     225                CORBA::Float simple_temp; 
     226                props[i].value >>= simple_temp; 
     227                // Test: Setting propertySet[i] to the given value 
     228                propertySet[i].value = props[i].value; 
     229                phase_offset = simple_temp; 
     230                DEBUG(1, ChannelDemo, "Setting phase offset to " << phase_offset << " degrees"); 
     231                // convert to radians 
     232                phase_offset *= M_PI/180.0f; 
     233 
     234                std::cout << "Property id : " << props[i].id << std::endl; 
     235                // Update value of this property in propertySet also 
     236                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     237                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     238                        propertySet[i].value = props[i].value; 
     239                        break; 
     240                    } 
     241                } 
     242 
     243            }  
     244            else { 
     245                // unknown property 
     246                std::cerr << "ERROR: ChannelDemo_i::configure() unknown property \"" 
     247                << props[i].id << "\"" << std::endl; 
     248                throw CF::PropertySet::InvalidConfiguration(); 
     249            } 
    183250        } 
    184251    } 
  • ossiedev/branches/deepanns/components/ChannelDemo/ChannelDemo.h

    r5801 r8886  
    8181    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    8282 
     83    void query(CF::Properties &configProperties) 
     84        throw (CF::UnknownProperties, CORBA::SystemException); 
     85 
    8386    /// Configures properties read from .prf.xml 
    8487    void configure(const CF::Properties&) 
  • ossiedev/branches/deepanns/components/Decimator/Decimator.cpp

    r6327 r8886  
    104104} 
    105105 
     106void 
     107Decimator_i::query (CF::Properties & configProperties) 
     108throw (CORBA::SystemException, CF::UnknownProperties) 
     109{ 
     110     
     111// for queries of zero length, return all id/value pairs in propertySet 
     112    if (configProperties.length () == 0) 
     113    {    
     114        configProperties.length (propertySet.length ()); 
     115     
     116        for (unsigned int i = 0; i < propertySet.length (); i++) 
     117        { 
     118            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     119            configProperties[i].value = propertySet[i].value; 
     120        } 
     121 
     122        return ; 
     123    }    
     124    else { 
     125        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     126            for (unsigned int j=0; j < propertySet.length(); j++) { 
     127                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     128                    configProperties[i].value = propertySet[i].value; 
     129                } 
     130            } 
     131        } 
     132    }    
     133} 
     134 
     135 
    106136void Decimator_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    107137 
    108138{ 
    109     std::cout << "decimator Configure called" << std::endl; 
    110  
    111     std::cout << "Props length : " << props.length() << std::endl; 
    112  
    113     for (unsigned int i = 0; i < props.length(); i++) { 
    114         std::cout << "Property id : " << props[i].id << std::endl; 
     139        static int init = 0; 
     140 
     141 
     142    std::cout << "Component - DECIMATOR " << std::endl; 
     143    if (init == 0){  
     144        std::cout << "Decimator: initial configure call .." << std::endl; 
     145        propertySet.length(props.length()); 
     146        for (unsigned int i=0; i < props.length(); i++) { 
     147            std::cout << "Property Id : " << props[i].id << std::endl; 
     148            propertySet[i].id = CORBA::string_dup(props[i].id); 
     149            propertySet[i].value = props[i].value; 
     150        } 
     151        init++; 
     152        return; 
     153    }    
     154    else { 
     155        std::cout << "init count = " << init << std::endl; 
     156     
     157        std::cout << "props length : " << props.length() << std::endl; 
     158     
     159        std::cout << "Decimator propertySet.length " << propertySet.length() << std::endl; 
     160 
     161        for (unsigned int i = 0; i < props.length(); i++) { 
     162                std::cout << "Property id : " << props[i].id << std::endl; 
    115163         
    116         // DecimateBy property, sets the decimator factor 
    117         if (strcmp(props[i].id, "DCE:cea26b54-9d86-4b68-a761-14186efa9415") == 0) { 
    118             CORBA::UShort D; 
    119             props[i].value >>= D; 
    120             M = D; 
    121             std::cout << "Decimation factor set to " << M << std::endl; 
    122  
    123             if (calculateFilterCoefficients) { 
    124                 // calculate filter coefficients dynamically 
    125                 unsigned int m(2);      // filter delay (symbols) 
    126                 float beta(0.5f);       // excess bandwidth factor 
    127                 len_h = 2*2*D*m+1;      // filter length (samples) 
    128                 delete [] h; 
    129                 h = new float[len_h]; 
    130                 SigProc::DesignRRCFilter(2*D, m, beta, h); 
    131  
    132                 // delete old filters 
    133                 delete i_filter; 
    134                 delete q_filter; 
    135  
    136                 // print coefficients 
    137                 for (unsigned int k=0; k<len_h; k++) 
    138                     DEBUG(2, Decimator, " h[" << k << "] = " << h[k]); 
    139  
    140                 i_filter = new SigProc::fir_filter(h, len_h); 
    141                 q_filter = new SigProc::fir_filter(h, len_h); 
    142             } 
    143         } else if (strcmp(props[i].id, "DCE:134e5dd8-c773-47af-a557-2837076358c4") == 0) { 
    144             // filter property, Filter coefficients 
    145             CORBA::FloatSeq *coeff_ptr; 
    146             props[i].value >>= coeff_ptr; 
    147  
    148             len_h = coeff_ptr->length(); 
    149              
    150             if (len_h < 2) { 
    151                 calculateFilterCoefficients = true; 
    152             } else { 
    153                 calculateFilterCoefficients = false; 
    154  
    155                 delete []h; 
    156                 delete i_filter; 
    157                 delete q_filter; 
    158  
    159                 h = new float[len_h]; 
    160                 std::cout << "Decimator filter length = " << len_h << std::endl; 
    161                 for (unsigned int k = 0; k < len_h; k++) { 
    162                     h[k] = (*coeff_ptr)[k]; 
    163                     DEBUG(3, Decimator, "Coeff[" << k << "] = " << h[k]) 
    164                 } 
    165                 i_filter = new SigProc::fir_filter(h, len_h); 
    166                 q_filter = new SigProc::fir_filter(h, len_h); 
    167             } 
    168  
    169         } else { 
    170             std::cerr << "ERROR: Decimator::configure(): Unknown property " 
    171                       << props[i].id << std::endl; 
    172             throw CF::PropertySet::InvalidConfiguration(); 
    173         } 
     164                // DecimateBy property, sets the decimator factor 
     165                if (strcmp(props[i].id, "DCE:cea26b54-9d86-4b68-a761-14186efa9415") == 0) { 
     166                    CORBA::UShort D; 
     167                    props[i].value >>= D; 
     168                    M = D; 
     169                    std::cout << "Decimation factor set to " << M << std::endl; 
     170         
     171                    if (calculateFilterCoefficients) { 
     172                        // calculate filter coefficients dynamically 
     173                        unsigned int m(2);      // filter delay (symbols) 
     174                        float beta(0.5f);       // excess bandwidth factor 
     175                        len_h = 2*2*D*m+1;      // filter length (samples) 
     176                        delete [] h; 
     177                        h = new float[len_h]; 
     178                        SigProc::DesignRRCFilter(2*D, m, beta, h); 
     179         
     180                        // delete old filters 
     181                        delete i_filter; 
     182                        delete q_filter; 
     183         
     184                        // print coefficients 
     185                        for (unsigned int k=0; k<len_h; k++) 
     186                            DEBUG(2, Decimator, " h[" << k << "] = " << h[k]); 
     187         
     188                        i_filter = new SigProc::fir_filter(h, len_h); 
     189                        q_filter = new SigProc::fir_filter(h, len_h); 
     190                    } 
     191                    std::cout << "Property id : " << props[i].id << std::endl; 
     192                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     193                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     194                            propertySet[i].value = props[i].value; 
     195                            break; 
     196                        } 
     197                    } 
     198                                 
     199                                 
     200                } else if (strcmp(props[i].id, "DCE:134e5dd8-c773-47af-a557-2837076358c4") == 0) { 
     201                    // filter property, Filter coefficients 
     202                    CORBA::FloatSeq *coeff_ptr; 
     203                    props[i].value >>= coeff_ptr; 
     204         
     205                    len_h = coeff_ptr->length(); 
     206                     
     207                    if (len_h < 2) { 
     208                                calculateFilterCoefficients = true; 
     209                        } else { 
     210                        calculateFilterCoefficients = false; 
     211                 
     212                        delete []h; 
     213                        delete i_filter; 
     214                        delete q_filter; 
     215 
     216                        h = new float[len_h]; 
     217                        std::cout << "Decimator filter length = " << len_h << std::endl; 
     218                        for (unsigned int k = 0; k < len_h; k++) { 
     219                            h[k] = (*coeff_ptr)[k]; 
     220                            DEBUG(3, Decimator, "Coeff[" << k << "] = " << h[k]) 
     221                        } 
     222                        i_filter = new SigProc::fir_filter(h, len_h); 
     223                        q_filter = new SigProc::fir_filter(h, len_h); 
     224                    } 
     225                    std::cout << "Property id : " << props[i].id << std::endl; 
     226                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     227                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     228                            propertySet[i].value = props[i].value; 
     229                            break; 
     230                        } 
     231                    } 
     232 
     233         
     234                } else { 
     235                    std::cerr << "ERROR: Decimator::configure(): Unknown property " 
     236                              << props[i].id << std::endl; 
     237                    throw CF::PropertySet::InvalidConfiguration(); 
     238                } 
    174239         
    175     } 
     240        } 
     241         
     242        } 
    176243} 
    177244 
  • ossiedev/branches/deepanns/components/Decimator/Decimator.h

    r6326 r8886  
    5353    CORBA::Object_ptr getPort(const char* portName) throw(CF::PortSupplier::UnknownPort, CORBA::SystemException); 
    5454    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     55     void query (CF::Properties & configProperties) 
     56         throw (CF::UnknownProperties, CORBA::SystemException); 
    5557    void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
    5658    void releaseObject() throw (CF::LifeCycle::ReleaseError, CORBA::SystemException); 
  • ossiedev/branches/deepanns/components/Decimator/Decimator.prf.xml

    r4395 r8886  
    66--> 
    77<properties> 
    8     <description /> 
    98    <simple id="DCE:cea26b54-9d86-4b68-a761-14186efa9415" type="ushort" name="DecimateBy" mode="readwrite"> 
    109        <value>1</value> 
  • ossiedev/branches/deepanns/components/Interpolator/Interpolator.cpp

    r8587 r8886  
    116116} 
    117117 
     118void  
     119Interpolator_i::query (CF::Properties & configProperties) 
     120throw (CORBA::SystemException, CF::UnknownProperties) 
     121{ 
     122    // for queries of zero length, return all id/value pairs in propertySet 
     123    if (configProperties.length () == 0) 
     124    {    
     125        configProperties.length (propertySet.length ()); 
     126        for (unsigned int i = 0; i < propertySet.length (); i++) 
     127        { 
     128            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     129            configProperties[i].value = propertySet[i].value; 
     130        } 
     131 
     132        return ; 
     133    }    
     134    else { 
     135        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     136            for (unsigned int j=0; j < propertySet.length(); j++) { 
     137                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     138                    configProperties[i].value = propertySet[i].value; 
     139               } 
     140            } 
     141        } 
     142    }    
     143} 
     144 
     145 
    118146void Interpolator_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    119147{ 
     148        static int init = 0; 
     149 
    120150    DEBUG(3, Interpolator, "Interpolator configure() called") 
    121151         
    122152    DEBUG(3, Interpolator, "Props length : " << props.length()) 
    123  
    124     for (unsigned int i = 0; i < props.length(); i++) { 
    125         DEBUG(3, Interpolator, "Property id : " << props[i].id) 
    126  
    127         if (strcmp(props[i].id, "DCE:e5c1d4aa-4b7f-48b7-b3bf-ed90b7653bec") == 0) { 
    128             // InterpFactor property, sets the interpolation factor 
    129             CORBA::UShort D; 
    130             props[i].value >>= D; 
    131  
    132             omni_mutex_lock l(accessPrivateData); 
    133  
    134             M = D; 
    135             DEBUG(3, Interpolator, "Interpolation factor set to " << M) 
    136             std::cout << std::endl << "INTERP: k = " << M << std::endl; 
    137             isConfigured_k = true; 
    138         } else if (strcmp(props[i].id, "DCE:9c39de73-54d4-43ad-ab9d-52f5fa526ddf") == 0) { 
    139             // filter property, Filter coefficients 
    140             CORBA::FloatSeq *coeff_ptr; 
    141             props[i].value >>= coeff_ptr; 
    142  
    143             omni_mutex_lock l(accessPrivateData); 
    144  
    145             len_h = coeff_ptr->length(); 
    146  
    147             if ( len_h > 1 ) { 
    148                 delete []h; 
    149                 delete i_filter; 
    150                 delete q_filter; 
    151  
    152                 h = new float[len_h]; 
    153                 DEBUG(3, Interpolator, "Interpolator filter length = " << len_h) 
    154                 for (unsigned int i = 0; i < len_h; i++) { 
    155                     h[i] = (*coeff_ptr)[i]; 
    156                     //DEBUG(4, Interpolator, "Coeff[" << i << "] = " << h[i]) 
    157                     printf("g(%d) = %f;\n", i+1, h[i]); 
     153         
     154    std::cout << "Component - Interpolator" << std::endl; 
     155    if (init == 0){ 
     156        std::cout << "INTERPOLATOR - initial configure call .." << std::endl; 
     157        propertySet.length(props.length()); 
     158        for (unsigned int i=0; i < props.length(); i++) { 
     159            std::cout << "Property Id : " << props[i].id << std::endl; 
     160            propertySet[i].id = CORBA::string_dup(props[i].id); 
     161            propertySet[i].value = props[i].value; 
     162        } 
     163        init = 1; 
     164        return; 
     165    } 
     166    else { 
     167                for (unsigned int i = 0; i < props.length(); i++) { 
     168                    DEBUG(3, Interpolator, "Property id : " << props[i].id) 
     169 
     170                    if (strcmp(props[i].id, "DCE:e5c1d4aa-4b7f-48b7-b3bf-ed90b7653bec") == 0) { 
     171                        // InterpFactor property, sets the interpolation factor 
     172                        CORBA::UShort D; 
     173                        props[i].value >>= D; 
     174 
     175                        omni_mutex_lock l(accessPrivateData); 
     176 
     177                        M = D; 
     178 
     179                std::cout << "Property id : " << props[i].id << std::endl; 
     180                // Update value of this property in propertySet also 
     181                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     182                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     183                        propertySet[i].value = props[i].value; 
     184                        break; 
     185                    } 
    158186                } 
    159                 i_filter = new SigProc::fir_filter(h, len_h); 
    160                 q_filter = new SigProc::fir_filter(h, len_h); 
    161  
    162             } else { 
    163                 // Design filter dynamically 
    164                 createDynamicFilter = true; 
    165             } 
    166  
    167         } else if (strcmp(props[i].id, "DCE:e65ba870-4c11-11dc-9470-00123f63025f") == 0) { 
    168             // pulse shape 
    169             const char * prop_str; 
    170             props[i].value >>= prop_str; 
    171  
    172             // Set appropriate pulse shape 
    173             if ( strcmp(prop_str, "rrcos") == 0 ) { 
    174                 pulseShape = "rrcos"; 
    175                 ///\todo: create function pointer for filter design 
    176             } else { 
    177                 // unknown pulse shape 
    178                 std::cerr << "ERROR: Interpolator::configure() unknown pulse shape " 
    179                           << prop_str << std::endl; 
    180                 throw CF::PropertySet::InvalidConfiguration(); 
    181             } 
    182             isConfigured_pulseShape = true; 
    183             std::cout << std::endl << "INTERP: pulse_shape = " << pulseShape << std::endl; 
    184  
    185         } else if (strcmp(props[i].id, "DCE:f6843fdc-4c11-11dc-b0be-00123f63025f") == 0) { 
    186             // m : symbol delay 
    187             CORBA::UShort simple_temp; 
    188             props[i].value >>= simple_temp; 
    189             m = simple_temp; 
    190             isConfigured_m = true; 
    191             std::cout << std::endl << "INTERP: m = " << m << std::endl; 
    192         } else if (strcmp(props[i].id, "DCE:fed01972-4c11-11dc-8d59-00123f63025f") == 0) { 
    193             // beta : excess bandwidth factor 
    194             CORBA::Float simple_temp; 
    195             props[i].value >>= simple_temp; 
    196             beta = simple_temp; 
    197             isConfigured_beta = true; 
    198             std::cout << std::endl << "INTERP: beta = " << beta << std::endl; 
    199         } else { 
    200             std::cerr << "Interpolator: Unknown property id " << props[i].id << std::endl; 
    201             throw CF::PropertySet::InvalidConfiguration(); 
    202         } 
    203  
    204     } 
     187 
     188 
     189                        DEBUG(3, Interpolator, "Interpolation factor set to " << M) 
     190                        std::cout << std::endl << "INTERP: k = " << M << std::endl; 
     191                        isConfigured_k = true; 
     192                    } else if (strcmp(props[i].id, "DCE:9c39de73-54d4-43ad-ab9d-52f5fa526ddf") == 0) { 
     193                        // filter property, Filter coefficients 
     194                        CORBA::FloatSeq *coeff_ptr; 
     195                        props[i].value >>= coeff_ptr; 
     196 
     197                        omni_mutex_lock l(accessPrivateData); 
     198 
     199                        len_h = coeff_ptr->length(); 
     200 
     201                        if ( len_h > 1 ) { 
     202                            delete []h; 
     203                            delete i_filter; 
     204                            delete q_filter; 
     205 
     206                            h = new float[len_h]; 
     207                            DEBUG(3, Interpolator, "Interpolator filter length = " << len_h) 
     208                            for (unsigned int i = 0; i < len_h; i++) { 
     209                                h[i] = (*coeff_ptr)[i]; 
     210                                //DEBUG(4, Interpolator, "Coeff[" << i << "] = " << h[i]) 
     211                                printf("g(%d) = %f;\n", i+1, h[i]); 
     212                            } 
     213                            i_filter = new SigProc::fir_filter(h, len_h); 
     214                            q_filter = new SigProc::fir_filter(h, len_h); 
     215 
     216                        std::cout << "Property id : " << props[i].id << std::endl; 
     217                        // Update value of this property in propertySet also 
     218                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     219                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     220                                propertySet[i].value = props[i].value; 
     221                                break; 
     222                            } 
     223                        } 
     224 
     225 
     226                        } else { 
     227                            // Design filter dynamically 
     228                            createDynamicFilter = true; 
     229                        } 
     230 
     231                    } else if (strcmp(props[i].id, "DCE:e65ba870-4c11-11dc-9470-00123f63025f") == 0) { 
     232                        // pulse shape 
     233                        const char * prop_str; 
     234                        props[i].value >>= prop_str; 
     235 
     236                        // Set appropriate pulse shape 
     237                        if ( strcmp(prop_str, "rrcos") == 0 ) { 
     238                            pulseShape = "rrcos"; 
     239                            ///\todo: create function pointer for filter design 
     240                        } else { 
     241                            // unknown pulse shape 
     242                            std::cerr << "ERROR: Interpolator::configure() unknown pulse shape " 
     243                                      << prop_str << std::endl; 
     244                            throw CF::PropertySet::InvalidConfiguration(); 
     245                        } 
     246                        isConfigured_pulseShape = true; 
     247 
     248                std::cout << "Property id : " << props[i].id << std::endl; 
     249                // Update value of this property in propertySet also 
     250                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     251                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     252                        propertySet[i].value = props[i].value; 
     253                        break; 
     254                    } 
     255                } 
     256 
     257                        std::cout << std::endl << "INTERP: pulse_shape = " << pulseShape << std::endl; 
     258 
     259                    } else if (strcmp(props[i].id, "DCE:f6843fdc-4c11-11dc-b0be-00123f63025f") == 0) { 
     260                        // m : symbol delay 
     261                        CORBA::UShort simple_temp; 
     262                        props[i].value >>= simple_temp; 
     263                        m = simple_temp; 
     264                        isConfigured_m = true; 
     265 
     266                std::cout << "Property id : " << props[i].id << std::endl; 
     267                // Update value of this property in propertySet also 
     268                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     269                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     270                        propertySet[i].value = props[i].value; 
     271                        break; 
     272                    } 
     273                } 
     274 
     275                        std::cout << std::endl << "INTERP: m = " << m << std::endl; 
     276                    } else if (strcmp(props[i].id, "DCE:fed01972-4c11-11dc-8d59-00123f63025f") == 0) { 
     277                        // beta : excess bandwidth factor 
     278                        CORBA::Float simple_temp; 
     279                        props[i].value >>= simple_temp; 
     280                        beta = simple_temp; 
     281                        isConfigured_beta = true; 
     282 
     283                std::cout << "Property id : " << props[i].id << std::endl; 
     284                // Update value of this property in propertySet also 
     285                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     286                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     287                        propertySet[i].value = props[i].value; 
     288                        break; 
     289                    } 
     290                } 
     291 
     292                        std::cout << std::endl << "INTERP: beta = " << beta << std::endl; 
     293                    } else { 
     294                        std::cerr << "Interpolator: Unknown property id " << props[i].id << std::endl; 
     295                        throw CF::PropertySet::InvalidConfiguration(); 
     296                    } 
     297 
     298                } 
     299        } 
    205300 
    206301    if ( createDynamicFilter        && 
  • ossiedev/branches/deepanns/components/Interpolator/Interpolator.h

    r8587 r8886  
    5757 
    5858    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     59         
     60        void query(CF::Properties &configProperties) 
     61        throw (CF::UnknownProperties, CORBA::SystemException); 
     62 
    5963 
    6064    void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
  • ossiedev/branches/deepanns/components/Interpolator/Interpolator.prf.xml

    r8587 r8886  
    44<!--Powered by Python--> 
    55<properties> 
    6 <description /> 
    76    <simple id="DCE:e5c1d4aa-4b7f-48b7-b3bf-ed90b7653bec" type="ushort" name="InterpFactor (k)" mode="readwrite"> 
    87        <value>1</value> 
  • ossiedev/branches/deepanns/components/JPEG_VideoViewer/JPEG_VideoViewer.cpp

    r2915 r8886  
    158158} 
    159159 
     160void  
     161JPEG_VideoViewer_i::query (CF::Properties & configProperties) 
     162throw (CORBA::SystemException, CF::UnknownProperties) 
     163{ 
     164    // for queries of zero length, return all id/value pairs in propertySet 
     165    if (configProperties.length () == 0) 
     166    {    
     167        configProperties.length (propertySet.length ()); 
     168        for (unsigned int i = 0; i < propertySet.length (); i++) 
     169        { 
     170            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     171            configProperties[i].value = propertySet[i].value; 
     172        } 
     173 
     174        return ; 
     175    }    
     176    else { 
     177        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     178            for (unsigned int j=0; j < propertySet.length(); j++) { 
     179                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     180                    configProperties[i].value = propertySet[i].value; 
     181               } 
     182            } 
     183        } 
     184    }    
     185} 
     186 
     187 
     188 
     189 
    160190void JPEG_VideoViewer_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    161191{ 
     192         
    162193    DEBUG(3, JPEG_VideoViewer, "configure invoked") 
    163194     
  • ossiedev/branches/deepanns/components/JPEG_VideoViewer/JPEG_VideoViewer.h

    r2915 r8886  
    7373 
    7474        void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     75        void query(CF::Properties &configProperties) 
     76            throw (CF::UnknownProperties, CORBA::SystemException); 
     77 
    7578        void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
    7679 
  • ossiedev/branches/deepanns/components/RxDemo/RxDemo.cpp

    r5800 r8886  
    9191    DEBUG(3, RxDemo, "initialize() invoked") 
    9292} 
     93 
     94void 
     95RxDemo_i::query (CF::Properties & configProperties) 
     96throw (CORBA::SystemException, CF::UnknownProperties) 
     97{ 
     98    // for queries of zero length, return all id/value pairs in propertySet 
     99    if (configProperties.length () == 0) 
     100    { 
     101        configProperties.length (propertySet.length ()); 
     102        for (unsigned int i = 0; i < propertySet.length (); i++) 
     103        { 
     104            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     105            configProperties[i].value = propertySet[i].value; 
     106        } 
     107 
     108        return ; 
     109    } 
     110    else { 
     111        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     112            for (unsigned int j=0; j < propertySet.length(); j++) { 
     113                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     114                    configProperties[i].value = propertySet[i].value; 
     115               } 
     116            } 
     117        } 
     118    } 
     119} 
     120 
     121 
    93122 
    94123void RxDemo_i::configure(const CF::Properties& props) 
  • ossiedev/branches/deepanns/components/RxDemo/RxDemo.h

    r5496 r8886  
    6868    /// 
    6969    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     70         
     71    void query(CF::Properties &configProperties) 
     72        throw (CF::UnknownProperties, CORBA::SystemException); 
     73 
    7074 
    7175    /// Configures properties read from .prf.xml 
  • ossiedev/branches/deepanns/components/TxDemo/TxDemo.cpp

    r8629 r8886  
    9898} 
    9999 
     100void 
     101TxDemo_i::query (CF::Properties & configProperties) 
     102throw (CORBA::SystemException, CF::UnknownProperties) 
     103{ 
     104    // for queries of zero length, return all id/value pairs in propertySet 
     105    if (configProperties.length () == 0) 
     106    { 
     107        configProperties.length (propertySet.length ()); 
     108        for (unsigned int i = 0; i < propertySet.length (); i++) 
     109        { 
     110            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     111            configProperties[i].value = propertySet[i].value; 
     112        } 
     113 
     114        return ; 
     115    } 
     116    else { 
     117        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     118            for (unsigned int j=0; j < propertySet.length(); j++) { 
     119                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     120                    configProperties[i].value = propertySet[i].value; 
     121               } 
     122            } 
     123        } 
     124    } 
     125} 
     126 
     127 
    100128void TxDemo_i::configure(const CF::Properties& props) 
    101129throw (CORBA::SystemException, 
     
    103131    CF::PropertySet::PartialConfiguration) 
    104132{ 
     133        static int init = 0; 
    105134    DEBUG(3, TxDemo, "configure() invoked") 
    106135     
    107     std::cout << "props length : " << props.length() << std::endl; 
    108  
    109     for (unsigned int i = 0; i <props.length(); i++) { 
    110         std::cout << "Property id : " << props[i].id << std::endl; 
    111  
    112         if (strcmp(props[i].id, "DCE:1b9ca208-8242-11dc-9ba3-00123f63025f") == 0) { 
    113             // packet_delay_ms 
    114             CORBA::Short simple_temp; 
    115             props[i].value >>= simple_temp; 
    116             packet_delay = simple_temp; 
     136 
     137    std::cout << "Component - CHANNEL DEMO" << std::endl; 
     138    if (init == 0){ 
     139        std::cout << " ChannelDemo - initial configure call .." << std::endl; 
     140        propertySet.length(props.length()); 
     141        for (unsigned int i=0; i < props.length(); i++) { 
     142            std::cout << "Property Id : " << props[i].id << std::endl; 
     143            propertySet[i].id = CORBA::string_dup(props[i].id); 
     144            propertySet[i].value = props[i].value; 
    117145        } 
    118  
    119     } 
     146        init = 1; 
     147        return; 
     148    } 
     149    else { 
     150                for (unsigned int i = 0; i <props.length(); i++) { 
     151                    if (strcmp(props[i].id, "DCE:1b9ca208-8242-11dc-9ba3-00123f63025f") == 0) { 
     152                        // packet_delay_ms 
     153                        CORBA::Short simple_temp; 
     154                        props[i].value >>= simple_temp; 
     155                        packet_delay = simple_temp; 
     156                        std::cout << "Property id : " << props[i].id << std::endl; 
     157                        // Update value of this property in propertySet also 
     158                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     159                                if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     160                                propertySet[i].value = props[i].value; 
     161                                break; 
     162                            } 
     163                        } 
     164 
     165                    } 
     166 
     167                } 
     168        } 
    120169} 
    121170 
  • ossiedev/branches/deepanns/components/TxDemo/TxDemo.h

    r8629 r8886  
    6969    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    7070 
     71    void query(CF::Properties &configProperties) 
     72        throw (CF::UnknownProperties, CORBA::SystemException); 
     73 
     74 
    7175    /// Configures properties read from .prf.xml 
    7276    void configure(const CF::Properties&) 
  • ossiedev/branches/deepanns/components/USRP_Commander/src/USRP_Commander.cpp

    r4730 r8886  
    188188 
    189189 
     190void 
     191USRP_Commander_i::query (CF::Properties & configProperties) 
     192throw (CORBA::SystemException, CF::UnknownProperties) 
     193{ 
     194    std::cout << "USRP_Commander_i::query called with Property length " << configProperties.length() << std::endl; 
     195    std::cout << "USRP_Commander_i::query using proertySet.length " << propertySet.length() << std::endl; 
     196// for queries of zero length, return all id/value pairs in propertySet 
     197    if (configProperties.length () == 0) 
     198    {    
     199        configProperties.length (propertySet.length ()); 
     200        std::cout << "USRP_Commander_i::query set configProperties.length " << configProperties.length() << std::endl; 
     201 
     202        for (unsigned int i = 0; i < propertySet.length (); i++) 
     203        { 
     204            std::cout << "USRP_Commander_i::query setting property index " << i << std::endl; 
     205            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     206            configProperties[i].value = propertySet[i].value; 
     207            std::cout << "configPropertoes[" << i << "].id = " << configProperties[i].id << std::endl; 
     208            //std::cout << "configProperties[" << i << "].value = " << configProperties[i].value << std::endl; 
     209        } 
     210 
     211        return ; 
     212    }    
     213    else { 
     214        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     215            for (unsigned int j=0; j < propertySet.length(); j++) { 
     216                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     217                    configProperties[i].value = propertySet[i].value; 
     218                } 
     219            } 
     220        } 
     221    }    
     222} 
     223 
     224 
    190225 
    191226void USRP_Commander_i::configure(const CF::Properties& props) 
     
    194229           CF::PropertySet::PartialConfiguration) 
    195230{ 
     231        static int init = 0; 
    196232    DEBUG(3, USRP_Commander, "configure called on USRP_Commander") 
    197233     
     
    200236    RXControl->set_number_of_channels(1); 
    201237 
    202     for (unsigned int i = 0; i < props.length(); i++) { 
    203         DEBUG(3, USRP_Commander, "Property id : " << props[i].id) 
    204  
    205         if (strcmp(props[i].id, "DCE:3efc3930-2739-40b4-8c02-ecfb1b0da9ee") == 0) { 
    206             // RX Frequency 
    207             CORBA::Float F; 
    208             props[i].value >>= F; 
    209             DEBUG(3, USRP_Commander, "RX Frequency property= " << F) 
    210             rx_freq = F; 
    211             RXControl->set_frequency(DEFAULT_USRP_RX_CHANNEL, rx_freq); 
    212         } else if (strcmp(props[i].id, "DCE:6a2d6952-ca11-4787-afce-87a89b882b7b") == 0) { 
    213             // TX Frequency 
    214             CORBA::Float F; 
    215             props[i].value >>= F; 
    216             DEBUG(3, USRP_Commander, "TX Frequency property= " << F) 
    217             tx_freq = F; 
    218             TXControl->set_frequency(DEFAULT_USRP_TX_CHANNEL, tx_freq); 
    219         } else if (strcmp(props[i].id, "DCE:9ca12c0e-ba65-40cf-9ef3-6e7ac671ab5d") == 0) { 
    220             // Transmitter Interpolation Factor 
    221             CORBA::Short M; 
    222             props[i].value >>= M; 
    223             DEBUG(3, USRP_Commander, "TX Interpolation Factor property= " << M) 
    224             tx_interp = M; 
    225             TXControl->set_interpolation_rate(DEFAULT_USRP_TX_CHANNEL, tx_interp); 
    226         } else if (strcmp(props[i].id, "DCE:92ec2b80-8040-47c7-a1d8-4c9caa4a4ed2") == 0) { 
    227             // RX Decimation factor 
    228             CORBA::Short D; 
    229             props[i].value >>= D; 
    230             DEBUG(3, USRP_Commander, "RX Decimation Factor property= " << D) 
    231             rx_decim = D; 
    232             RXControl->set_decimation_rate(DEFAULT_USRP_RX_CHANNEL, rx_decim); 
    233         } else if (strcmp(props[i].id, "DCE:93324adf-14f6-4406-ba92-a3650089857f") == 0) { 
    234             // RX Data Packet size 
    235             CORBA::ULong L; 
    236             props[i].value >>= L; 
    237             DEBUG(3, USRP_Commander, "RX Data Packet size property= " << L) 
    238             rx_size = L; 
    239             RXControl->set_data_packet_size(DEFAULT_USRP_RX_CHANNEL, rx_size); 
    240         } else if (strcmp(props[i].id, "DCE:99d586b6-7764-4dc7-83fa-72270d0f1e1b") == 0) { 
    241             //Rx Gain 
    242             CORBA::Float G; 
    243             props[i].value >>= G; 
    244             DEBUG(3, USRP_Commander, "RX Gain property= " << G) 
    245             rx_gain = G; 
    246             RXControl->set_gain(DEFAULT_USRP_RX_CHANNEL, rx_gain); 
    247         } else if (strcmp(props[i].id, "DCE:2d9c5ee4-a6f3-4ab9-834b-2b5c95818e53") == 0) { 
    248             //Rx Gain Max 
    249             ///\todo check gain values, perhaps get rid of this property 
    250             CORBA::Short v; 
    251             props[i].value >>= v; 
    252             DEBUG(3, USRP_Commander, "RX Gain Max property= " << v) 
    253             DEBUG(3, USRP_Commander, "  ::::  WARNING: RX Gain Max property ignored!  ::::") 
    254             rx_gain_max = v; 
    255         } else if (strcmp(props[i].id, "DCE:fd42344f-4d87-465b-9e6f-e1d7ae48afd6") == 0) { 
     238    std::cout << "Component - USRP_Commander" << std::endl; 
     239    if (init == 0){  
     240        std::cout << "USRP_Commander: initial configure call .." << std::endl; 
     241        propertySet.length(props.length()); 
     242        for (unsigned int i=0; i < props.length(); i++) { 
     243            std::cout << "Property Id : " << props[i].id << std::endl; 
     244            propertySet[i].id = CORBA::string_dup(props[i].id); 
     245            propertySet[i].value = props[i].value; 
     246        } 
     247        init++; 
     248        return; 
     249    }    
     250    else { 
     251         
     252 
     253        for (unsigned int i = 0; i < props.length(); i++) { 
     254                DEBUG(3, USRP_Commander, "Property id : " << props[i].id) 
     255 
     256                if (strcmp(props[i].id, "DCE:3efc3930-2739-40b4-8c02-ecfb1b0da9ee") == 0) { 
     257                    // RX Frequency 
     258                    CORBA::Float F; 
     259                    props[i].value >>= F; 
     260                    DEBUG(3, USRP_Commander, "RX Frequency property= " << F) 
     261                    rx_freq = F; 
     262                    RXControl->set_frequency(DEFAULT_USRP_RX_CHANNEL, rx_freq); 
     263                std::cout << "Property id : " << props[i].id << std::endl; 
     264                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     265                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     266                        propertySet[i].value = props[i].value; 
     267                        break; 
     268                    } 
     269                } 
     270 
     271                } else if (strcmp(props[i].id, "DCE:6a2d6952-ca11-4787-afce-87a89b882b7b") == 0) { 
     272                // TX Frequency 
     273                CORBA::Float F; 
     274                props[i].value >>= F; 
     275                DEBUG(3, USRP_Commander, "TX Frequency property= " << F) 
     276                tx_freq = F; 
     277                TXControl->set_frequency(DEFAULT_USRP_TX_CHANNEL, tx_freq); 
     278                                std::cout << "Property id : " << props[i].id << std::endl; 
     279                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     280                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     281                        propertySet[i].value = props[i].value; 
     282                        break; 
     283                    } 
     284                } 
     285 
     286                } else if (strcmp(props[i].id, "DCE:9ca12c0e-ba65-40cf-9ef3-6e7ac671ab5d") == 0) { 
     287                // Transmitter Interpolation Factor 
     288                CORBA::Short M; 
     289                props[i].value >>= M; 
     290                DEBUG(3, USRP_Commander, "TX Interpolation Factor property= " << M) 
     291                tx_interp = M; 
     292                TXControl->set_interpolation_rate(DEFAULT_USRP_TX_CHANNEL, tx_interp); 
     293                                std::cout << "Property id : " << props[i].id << std::endl; 
     294                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     295                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     296                        propertySet[i].value = props[i].value; 
     297                        break; 
     298                    } 
     299                } 
     300 
     301                } else if (strcmp(props[i].id, "DCE:92ec2b80-8040-47c7-a1d8-4c9caa4a4ed2") == 0) { 
     302                // RX Decimation factor 
     303                CORBA::Short D; 
     304                props[i].value >>= D; 
     305                DEBUG(3, USRP_Commander, "RX Decimation Factor property= " << D) 
     306                rx_decim = D; 
     307                RXControl->set_decimation_rate(DEFAULT_USRP_RX_CHANNEL, rx_decim); 
     308                                std::cout << "Property id : " << props[i].id << std::endl; 
     309                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     310                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     311                        propertySet[i].value = props[i].value; 
     312                        break; 
     313                    } 
     314                } 
     315 
     316                } else if (strcmp(props[i].id, "DCE:93324adf-14f6-4406-ba92-a3650089857f") == 0) { 
     317                // RX Data Packet size 
     318                CORBA::ULong L; 
     319                props[i].value >>= L; 
     320                DEBUG(3, USRP_Commander, "RX Data Packet size property= " << L) 
     321                rx_size = L; 
     322                RXControl->set_data_packet_size(DEFAULT_USRP_RX_CHANNEL, rx_size); 
     323                                std::cout << "Property id : " << props[i].id << std::endl; 
     324                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     325                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     326                        propertySet[i].value = props[i].value; 
     327                        break; 
     328                    } 
     329                } 
     330 
     331                } else if (strcmp(props[i].id, "DCE:99d586b6-7764-4dc7-83fa-72270d0f1e1b") == 0) { 
     332                //Rx Gain 
     333                CORBA::Float G; 
     334                props[i].value >>= G; 
     335                DEBUG(3, USRP_Commander, "RX Gain property= " << G) 
     336                rx_gain = G; 
     337                RXControl->set_gain(DEFAULT_USRP_RX_CHANNEL, rx_gain); 
     338                                std::cout << "Property id : " << props[i].id << std::endl; 
     339                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     340                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     341                        propertySet[i].value = props[i].value; 
     342                        break; 
     343                    } 
     344                } 
     345 
     346                } else if (strcmp(props[i].id, "DCE:2d9c5ee4-a6f3-4ab9-834b-2b5c95818e53") == 0) { 
     347                //Rx Gain Max 
     348                ///\todo check gain values, perhaps get rid of this property 
     349                CORBA::Short v; 
     350                props[i].value >>= v; 
     351                DEBUG(3, USRP_Commander, "RX Gain Max property= " << v) 
     352                DEBUG(3, USRP_Commander, "  ::::  WARNING: RX Gain Max property ignored!  ::::") 
     353                rx_gain_max = v; 
     354                                 
     355                                std::cout << "Property id : " << props[i].id << std::endl; 
     356                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     357                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     358                        propertySet[i].value = props[i].value; 
     359                        break; 
     360                    } 
     361                } 
     362                                 
     363 
     364                } else if (strcmp(props[i].id, "DCE:fd42344f-4d87-465b-9e6f-e1d7ae48afd6") == 0) { 
    256365            // rx_start 
    257             CORBA::Short v; 
    258             props[i].value >>= v; 
    259             rx_start = (v==0) ? false : true; 
    260             DEBUG(3, USRP_Commander, "RX start set  to " << rx_start) 
    261             //if (rx_start) 
    262             //    RXControl->start(DEFAULT_USRP_RX_CHANNEL); 
    263         } else if (strcmp(props[i].id, "DCE:0a9b8c8c-f130-4a8f-9ef8-bba023128a4b") == 0) { 
    264             // tx_start 
    265             CORBA::Short v; 
    266             props[i].value >>= v; 
    267             tx_start = (v==0) ? false : true; 
    268             DEBUG(3, USRP_Commander, "TX Start set to " << tx_start) 
    269             //if (tx_start) 
    270             //    TXControl->start(DEFAULT_USRP_TX_CHANNEL); 
    271         } else { 
    272             std::cerr << "ERROR: USRP Commander::configure(), unknown property: " << props[i].id << std::endl; 
    273             throw CF::PropertySet::InvalidConfiguration(); 
    274         } 
    275     } 
    276  
    277 } 
     366                CORBA::Short v; 
     367                props[i].value >>= v; 
     368                rx_start = (v==0) ? false : true; 
     369                DEBUG(3, USRP_Commander, "RX start set  to " << rx_start) 
     370 
     371                                std::cout << "Property id : " << props[i].id << std::endl; 
     372                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     373                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     374                        propertySet[i].value = props[i].value; 
     375                        break; 
     376                    } 
     377                } 
     378 
     379                //if (rx_start) 
     380                        //    RXControl->start(DEFAULT_USRP_RX_CHANNEL); 
     381                } else if (strcmp(props[i].id, "DCE:0a9b8c8c-f130-4a8f-9ef8-bba023128a4b") == 0) { 
     382                // tx_start 
     383                CORBA::Short v; 
     384                props[i].value >>= v; 
     385                tx_start = (v==0) ? false : true; 
     386                DEBUG(3, USRP_Commander, "TX Start set to " << tx_start) 
     387                                 
     388                                std::cout << "Property id : " << props[i].id << std::endl; 
     389                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     390                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     391                        propertySet[i].value = props[i].value; 
     392                        break; 
     393                    } 
     394                } 
     395 
     396                //if (tx_start) 
     397                //    TXControl->start(DEFAULT_USRP_TX_CHANNEL); 
     398 
     399                } else { 
     400                std::cerr << "ERROR: USRP Commander::configure(), unknown property: " << props[i].id << std::endl; 
     401                throw CF::PropertySet::InvalidConfiguration(); 
     402                } 
     403        } 
     404        } 
     405} 
  • ossiedev/branches/deepanns/components/USRP_Commander/src/USRP_Commander.h

    r4536 r8886  
    6363        throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    6464 
     65     // Query all the properties 
     66    void query (CF::Properties & configProperties) 
     67         throw (CORBA::SystemException, CF::UnknownProperties); 
     68     
     69 
    6570    /// Sets configurable properties     
    6671    void configure(const CF::Properties&) 
  • ossiedev/branches/deepanns/components/WFMDemod/WFMDemod.cpp

    r6579 r8886  
    9999} 
    100100 
     101void WFMDemod_i::query(CF::Properties & configProperties) 
     102throw (CORBA::SystemException, CF::UnknownProperties) { 
     103 
     104    // for queries of zero length, return all id/value pairs in propertySet 
     105    if (configProperties.length () == 0) 
     106    { 
     107        configProperties.length (propertySet.length ()); 
     108        for (unsigned int i = 0; i < propertySet.length (); i++) 
     109        { 
     110            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     111            configProperties[i].value = propertySet[i].value; 
     112        } 
     113 
     114        return ; 
     115    } 
     116    else { 
     117        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     118            for (unsigned int j=0; j < propertySet.length(); j++) { 
     119                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     120                    configProperties[i].value = propertySet[i].value; 
     121               } 
     122            } 
     123        } 
     124    } 
     125 
     126} 
     127 
    101128void WFMDemod_i::configure(const CF::Properties& props) 
    102129throw (CORBA::SystemException, 
  • ossiedev/branches/deepanns/components/WFMDemod/WFMDemod.h

    r6579 r8886  
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    6969 
     70    void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
     72 
     73 
    7074    /// Configures properties read from .prf.xml 
    7175    void configure(const CF::Properties&) 
  • ossiedev/branches/deepanns/components/WebCamCapture/WebCamCapture.cpp

    r2915 r8886  
    370370} 
    371371 
     372void 
     373WebCamCapture_i::query (CF::Properties & configProperties) 
     374throw (CORBA::SystemException, CF::UnknownProperties) 
     375{ 
     376    // for queries of zero length, return all id/value pairs in propertySet 
     377    if (configProperties.length () == 0) 
     378    { 
     379        configProperties.length (propertySet.length ()); 
     380        for (unsigned int i = 0; i < propertySet.length (); i++) 
     381        { 
     382            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     383            configProperties[i].value = propertySet[i].value; 
     384        } 
     385 
     386        return ; 
     387    } 
     388    else { 
     389        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     390            for (unsigned int j=0; j < propertySet.length(); j++) { 
     391                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     392                    configProperties[i].value = propertySet[i].value; 
     393               } 
     394            } 
     395        } 
     396    } 
     397} 
     398 
     399 
     400 
    372401void WebCamCapture_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    373402{ 
     403        static int init = 0; 
    374404    DEBUG(3, WebCamCapture, "configure invoked") 
    375405     
    376406    std::cout << "props length : " << props.length() << std::endl; 
    377407 
    378     for (unsigned int i = 0; i <props.length(); i++) 
    379     { 
    380         std::cout << "Property id : " << props[i].id << std::endl; 
    381  
    382         if (strcmp(props[i].id, "DCE:3dd2928a-c369-11db-8bd5-000129227a88") == 0) 
    383         { 
    384             CORBA::Short n; 
    385             props[i].value >>= n; 
    386             quality = n; 
    387             std::cout << "WebCam: Quality (1 - 5): " << quality << std::endl; 
    388             spcaSetQuality(fd, &videoparam, (unsigned char)quality); 
     408    std::cout << "Component - WEBCAM CAPTURE" << std::endl; 
     409    if (init == 0){ 
     410        std::cout << " WebcamCapture - initial configure call .." << std::endl; 
     411        propertySet.length(props.length()); 
     412        for (unsigned int i=0; i < props.length(); i++) { 
     413            std::cout << "Property Id : " << props[i].id << std::endl; 
     414            propertySet[i].id = CORBA::string_dup(props[i].id); 
     415            propertySet[i].value = props[i].value; 
    389416        } 
    390  
     417        init = 1; 
     418        return; 
    391419    } 
     420    else { 
     421 
     422 
     423                for (unsigned int i = 0; i <props.length(); i++) 
     424                { 
     425                    std::cout << "Property id : " << props[i].id << std::endl; 
     426 
     427                    if (strcmp(props[i].id, "DCE:3dd2928a-c369-11db-8bd5-000129227a88") == 0) 
     428                    { 
     429                        CORBA::Short n; 
     430                        props[i].value >>= n; 
     431                        quality = n; 
     432                        std::cout << "WebCam: Quality (1 - 5): " << quality << std::endl; 
     433                        spcaSetQuality(fd, &videoparam, (unsigned char)quality); 
     434                                 
     435                                 
     436                std::cout << "Property id : " << props[i].id << std::endl; 
     437                // Update value of this property in propertySet also 
     438                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     439                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     440                        propertySet[i].value = props[i].value; 
     441                        break; 
     442                    } 
     443                } 
     444 
     445                    } 
     446 
     447                } 
     448        } 
    392449} 
    393450 
  • ossiedev/branches/deepanns/components/WebCamCapture/WebCamCapture.h

    r2915 r8886  
    7373 
    7474        void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     75 
     76            void query(CF::Properties &configProperties) 
     77               throw (CF::UnknownProperties, CORBA::SystemException); 
     78 
    7579        void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
    7680 
  • ossiedev/branches/deepanns/components/am_demod/am_demod.cpp

    r1987 r8886  
    9292        std::cout << "initialize called on am_demod" << std::endl; 
    9393} 
     94 
     95void 
     96am_demod_i::query (CF::Properties & configProperties) 
     97throw (CORBA::SystemException, CF::UnknownProperties) 
     98{ 
     99    // for queries of zero length, return all id/value pairs in propertySet 
     100    if (configProperties.length () == 0) 
     101    { 
     102        configProperties.length (propertySet.length ()); 
     103        for (unsigned int i = 0; i < propertySet.length (); i++) 
     104        { 
     105            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     106            configProperties[i].value = propertySet[i].value; 
     107        } 
     108 
     109        return ; 
     110    } 
     111    else { 
     112        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     113            for (unsigned int j=0; j < propertySet.length(); j++) { 
     114                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     115                    configProperties[i].value = propertySet[i].value; 
     116               } 
     117            } 
     118        } 
     119    } 
     120} 
     121 
    94122 
    95123void am_demod_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
  • ossiedev/branches/deepanns/components/am_demod/am_demod.h

    r1896 r8886  
    5757        void releaseObject() throw (CF::LifeCycle::ReleaseError, CORBA::SystemException); 
    5858 
    59         void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     59                void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     60                 void query(CF::Properties &configProperties) throw (CF::UnknownProperties, CORBA::SystemException); 
     61 
    6062        void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
    6163 
  • ossiedev/branches/deepanns/components/amplifier/amplifier.cpp

    r2252 r8886  
    8585} 
    8686 
     87void 
     88amplifier_i::query (CF::Properties & configProperties) 
     89throw (CORBA::SystemException, CF::UnknownProperties) 
     90{ 
     91    // for queries of zero length, return all id/value pairs in propertySet 
     92    if (configProperties.length () == 0) 
     93    { 
     94        configProperties.length (propertySet.length ()); 
     95        for (unsigned int i = 0; i < propertySet.length (); i++) 
     96        { 
     97            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     98            configProperties[i].value = propertySet[i].value; 
     99        } 
     100 
     101        return ; 
     102    } 
     103    else { 
     104        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     105            for (unsigned int j=0; j < propertySet.length(); j++) { 
     106                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     107                    configProperties[i].value = propertySet[i].value; 
     108               } 
     109            } 
     110        } 
     111    } 
     112} 
     113 
    87114void amplifier_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    88115{ 
     116        static int init = 0; 
     117 
    89118    std::cout << "configure called on amplifier" << std::endl; 
    90119     
    91120    std::cout << "props length : " << props.length() << std::endl; 
    92121 
    93     for (unsigned int i = 0; i <props.length(); i++) 
    94     { 
    95         std::cout << "Property id : " << props[i].id << std::endl; 
    96  
    97         if (strcmp(props[i].id, "DCE:06b88d4f-dd38-44e6-bc49-82db0eba5bc6") == 0) 
    98         { 
    99             CORBA::Float simple_temp; 
    100             props[i].value >>= simple_temp; 
    101             simple_0_value = simple_temp; 
     122    std::cout << "Component -AMPLIFIER" << std::endl; 
     123    if (init == 0){ 
     124        std::cout << " amplifier - initial configure call .." << std::endl; 
     125        propertySet.length(props.length()); 
     126        for (unsigned int i=0; i < props.length(); i++) { 
     127            std::cout << "Property Id : " << props[i].id << std::endl; 
     128            propertySet[i].id = CORBA::string_dup(props[i].id); 
     129            propertySet[i].value = props[i].value; 
    102130        } 
    103  
    104         if (strcmp(props[i].id, "DCE:df91b1a8-9c83-44b4-bf2c-0dbeacb2b6f4") == 0) 
    105         { 
    106             CORBA::Float simple_temp; 
    107             props[i].value >>= simple_temp; 
    108             simple_1_value = simple_temp; 
    109         } 
    110  
    111     } 
     131        init = 1; 
     132        return; 
     133    } 
     134    else { 
     135 
     136                for (unsigned int i = 0; i <props.length(); i++) 
     137                { 
     138                    std::cout << "Property id : " << props[i].id << std::endl; 
     139 
     140                    if (strcmp(props[i].id, "DCE:06b88d4f-dd38-44e6-bc49-82db0eba5bc6") == 0) 
     141                    { 
     142                        CORBA::Float simple_temp; 
     143                        props[i].value >>= simple_temp; 
     144                        simple_0_value = simple_temp; 
     145 
     146                std::cout << "Property id : " << props[i].id << std::endl; 
     147                // Update value of this property in propertySet also 
     148                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     149                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     150                        propertySet[i].value = props[i].value; 
     151                        break; 
     152                    } 
     153                } 
     154                                 
     155                    } 
     156 
     157                    if (strcmp(props[i].id, "DCE:df91b1a8-9c83-44b4-bf2c-0dbeacb2b6f4") == 0) 
     158                    { 
     159                        CORBA::Float simple_temp; 
     160                        props[i].value >>= simple_temp; 
     161                        simple_1_value = simple_temp; 
     162 
     163                std::cout << "Property id : " << props[i].id << std::endl; 
     164                // Update value of this property in propertySet also 
     165                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     166                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     167                        propertySet[i].value = props[i].value; 
     168                        break; 
     169                    } 
     170                } 
     171 
     172                    } 
     173 
     174                } 
     175        } 
    112176} 
    113177 
  • ossiedev/branches/deepanns/components/amplifier/amplifier.h

    r2252 r8886  
    5656 
    5757        void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     58            void query(CF::Properties &configProperties) 
     59               throw (CF::UnknownProperties, CORBA::SystemException); 
    5860        void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
    5961