Changeset 9211

Show
Ignore:
Timestamp:
04/08/09 19:24:10 (4 years ago)
Author:
mcarrick
Message:

merging deepan's branch: adding wavedash tool, updating query / configure methods for components

Location:
ossiedev/branches/0.7.x
Files:
48 modified
18 copied

Legend:

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

    r8110 r9211  
    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 
     
    95121    DEBUG(3, AutomaticGainControl, "props length : " << props.length()) 
    96122 
    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  
     123    std::cout << "COMPONENT - AUTOMATIC GAIN CONTROL " << std::endl; 
     124    std::cout << " Props length = " << props.length() << std::endl; 
     125 
     126        if (init == 0){ 
     127        if ( props.length() <= 0 ){ 
     128            std::cout << "AutomaticGainControl: configure called with invalid \ 
     129            props.length() - " << props.length() << std::endl; 
     130            return; 
     131        } 
     132        std::cout << "AutomaticGainControl :initial configure call .." << std::endl; 
     133        propertySet.length(props.length()); 
     134        for (unsigned int i=0; i < props.length(); i++) { 
     135            std::cout << "Property Id : " << props[i].id << std::endl; 
     136            propertySet[i].id = CORBA::string_dup(props[i].id); 
     137            propertySet[i].value = props[i].value; 
     138        } 
     139        init = 1; 
     140        return; 
    164141    } 
     142    else { 
     143        std::cout << "Normal configure call .." << std::endl; 
     144                for (unsigned int i = 0; i <props.length(); i++) 
     145                { 
     146                    DEBUG(3, AutomaticGainControl, "Property id : " << props[i].id) 
     147 
     148                    if (strcmp(props[i].id, "DCE:aaf97fa0-d184-4d88-9954-3a1334c73d6d") == 0) { 
     149                        // energy_lo 
     150                        props[i].value >>= simple_temp; 
     151                        omni_mutex_lock oml(accessPrivateData); 
     152                        energy_lo = simple_temp; 
     153                std::cout << "Property id : " << props[i].id << std::endl; 
     154                                // Update value of this property in propertySet also 
     155                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     156                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     157                        propertySet[i].value = props[i].value; 
     158                        break; 
     159                    } 
     160                } 
     161 
     162                        DEBUG(3, AutomaticGainControl, "prop (energy_lo): " << simple_temp) 
     163 
     164                    } else if (strcmp(props[i].id, "DCE:346e17c9-6678-483a-bffb-1909c64bddc0") == 0) { 
     165                        // energy_hi 
     166                        props[i].value >>= simple_temp; 
     167                        omni_mutex_lock oml(accessPrivateData); 
     168                        energy_hi = simple_temp; 
     169                std::cout << "Property id : " << props[i].id << std::endl; 
     170                                // Update value of this property in propertySet also 
     171                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     172                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     173                        propertySet[i].value = props[i].value; 
     174                        break; 
     175                    } 
     176                } 
     177 
     178                        DEBUG(3, AutomaticGainControl, "prop (energy_hi): " << simple_temp) 
     179 
     180                    } else if (strcmp(props[i].id, "DCE:4608b943-4fe2-49df-91fb-afa287b609d4") == 0) { 
     181                        // k_attack 
     182                        props[i].value >>= simple_temp; 
     183                        omni_mutex_lock oml(accessPrivateData); 
     184                        k_attack = simple_temp; 
     185 
     186                std::cout << "Property id : " << props[i].id << std::endl; 
     187                                // Update value of this property in propertySet also 
     188                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     189                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     190                        propertySet[i].value = props[i].value; 
     191                        break; 
     192                    } 
     193                } 
     194 
     195                        DEBUG(3, AutomaticGainControl, "prop (k_attack): " << simple_temp) 
     196 
     197                    } else if (strcmp(props[i].id, "DCE:491ec3de-ed45-48af-a6fc-ca2d6465e136") == 0) { 
     198                        // k_release 
     199                        props[i].value >>= simple_temp; 
     200                        omni_mutex_lock oml(accessPrivateData); 
     201                        k_release = simple_temp; 
     202 
     203                std::cout << "Property id : " << props[i].id << std::endl; 
     204                                // Update value of this property in propertySet also 
     205                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     206                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     207                        propertySet[i].value = props[i].value; 
     208                        break; 
     209                    } 
     210                } 
     211 
     212                        DEBUG(3, AutomaticGainControl, "prop (k_release): " << simple_temp) 
     213 
     214                    } else if (strcmp(props[i].id, "DCE:312f63fe-709a-4217-933b-c584c8d6a9bb") == 0) { 
     215                        // g_min 
     216                        props[i].value >>= simple_temp; 
     217                        omni_mutex_lock oml(accessPrivateData); 
     218                        g_min = simple_temp; 
     219 
     220                std::cout << "Property id : " << props[i].id << std::endl; 
     221                                // Update value of this property in propertySet also 
     222                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     223                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     224                        propertySet[i].value = props[i].value; 
     225                        break; 
     226                    } 
     227                } 
     228 
     229                        DEBUG(3, AutomaticGainControl, "prop (g_min): " << simple_temp) 
     230 
     231                    } else if (strcmp(props[i].id, "DCE:8357ee0d-2417-46d9-8475-2e5778d797e4") == 0) { 
     232                        // g_max 
     233                        props[i].value >>= simple_temp; 
     234                        omni_mutex_lock oml(accessPrivateData); 
     235                        g_max = simple_temp; 
     236 
     237                std::cout << "Property id : " << props[i].id << std::endl; 
     238                                // Update value of this property in propertySet also 
     239                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     240                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     241                        propertySet[i].value = props[i].value; 
     242                        break; 
     243                    } 
     244                } 
     245 
     246                        DEBUG(3, AutomaticGainControl, "prop (g_max): " << simple_temp) 
     247 
     248                    } else if (strcmp(props[i].id, "DCE:b9b72ec8-d0bd-4060-b356-dcc6b0809e65") == 0) { 
     249                        // rssi_pass 
     250                        props[i].value >>= simple_temp; 
     251                        omni_mutex_lock oml(accessPrivateData); 
     252                        rssi_pass = simple_temp; 
     253 
     254                std::cout << "Property id : " << props[i].id << std::endl; 
     255                                // Update value of this property in propertySet also 
     256                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     257                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     258                        propertySet[i].value = props[i].value; 
     259                        break; 
     260                    } 
     261                } 
     262 
     263                        DEBUG(3, AutomaticGainControl, "prop (rssi_pass): " << simple_temp) 
     264 
     265                    } else { 
     266                        // unknown property 
     267                        std::cerr << "ERROR: SymbolSyncPoly::configure() unknown property \"" 
     268                           << props[i].id << "\"" << std::endl; 
     269                        throw CF::PropertySet::InvalidConfiguration(); 
     270                    } 
     271 
     272                } 
     273        } 
    165274} 
    166275 
  • ossiedev/branches/0.7.x/components/AutomaticGainControl/src/AutomaticGainControl.h

    r4668 r9211  
    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/0.7.x/components/Channel/Channel.cpp

    r8381 r9211  
    107107} 
    108108 
     109void  
     110Channel_i::query (CF::Properties & configProperties) 
     111throw (CORBA::SystemException, CF::UnknownProperties) 
     112{ 
     113    if (configProperties.length () == 0) 
     114    { 
     115        configProperties.length (propertySet.length ()); 
     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 
    109136void Channel_i::configure(const CF::Properties& props) 
    110137throw (CORBA::SystemException, 
     
    112139    CF::PropertySet::PartialConfiguration) 
    113140{ 
     141        static int init = 0; 
    114142    DEBUG(3, Channel, "configure() invoked") 
    115143     
     144        std::cout << "Component - CHANNEL DEMO" << std::endl; 
    116145    std::cout << "props length : " << props.length() << std::endl; 
    117  
    118     for (unsigned int i = 0; i <props.length(); i++) 
    119     { 
    120         std::cout << "Property id : " << props[i].id << std::endl; 
    121  
    122         if (strcmp(props[i].id, "DCE:eddc66ce-8a82-11dd-ae05-0016769e497b") == 0) { 
    123             //The power of the AWGN noise 
    124             CORBA::Long simple_temp; 
    125             props[i].value >>= simple_temp; 
    126             noise_sigma = sqrt(simple_temp/2.0); 
    127         } else if (strcmp(props[i].id, "DCE:3bbc0656-8a83-11dd-bcd3-0016769e497b") == 0) { 
    128             //Specifies the fading type. Valid values are None and Ricean 
    129             const char * prop_str; 
    130             props[i].value >>= prop_str; 
    131             if ( strcmp(prop_str, "None") == 0 ) { 
    132             fading=false; 
    133             } else if ( strcmp(prop_str, "Ricean") == 0 ){ 
    134                fading=true; 
    135             } else { 
    136               std::cerr << "ERROR: Channel::configure() unknown fading type" << std::endl; 
    137                throw CF::PropertySet::InvalidConfiguration(); 
    138             }; 
    139  
    140         } else if (strcmp(props[i].id, "DCE:4ba6cb86-29fb-40c8-a90c-7e69b7e59d85") == 0) { 
    141            const char * prop_str; 
    142             props[i].value >>= prop_str; 
    143             if ( strcmp(prop_str, "True") == 0 ) { 
    144                envelope=true; 
    145             } else if ( strcmp(prop_str, "False") == 0 ){ 
    146                fading=false; 
    147             } else { 
    148               std::cerr << "ERROR: Channel::configure() unknown envelope type" << std::endl; 
    149                throw CF::PropertySet::InvalidConfiguration(); 
    150             }; 
    151  
    152         } else if (strcmp(props[i].id, "DCE:76abee66-8a83-11dd-b96d-0016769e497b") == 0) { 
    153             // K_factor 
    154             CORBA::Double simple_temp; 
    155             props[i].value >>= simple_temp; 
    156             K_factor=simple_temp; 
    157  
    158         } else if (strcmp(props[i].id, "DCE:9cc6196c-8a85-11dd-b572-0016769e497b") == 0) { 
    159             // The maximum doppler rate in terms of the sample rate 
    160             CORBA::Double simple_temp; 
    161             props[i].value >>= simple_temp; 
    162             MaxDopplerRate=simple_temp; 
    163  
    164         }  
     146         
     147        if (init == 0){ 
     148        if ( props.length() <= 0 ){ 
     149            std::cout << "Channel: configure called with invalid \ 
     150                          props.length() - " << props.length() << std::endl; 
     151            return; 
     152        } 
     153        std::cout << "initial configure call .." << std::endl; 
     154        propertySet.length(props.length()); 
     155        for (unsigned int i=0; i < props.length(); i++) { 
     156            std::cout << "Property Id : " << props[i].id << std::endl; 
     157            propertySet[i].id = CORBA::string_dup(props[i].id); 
     158            propertySet[i].value = props[i].value; 
     159        } 
     160        init++; 
     161        return; 
     162    } 
     163    else {       
     164        std::cout << "Normal Configure call .. " << std::endl; 
     165                std::cout << "ChannelDemo_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     166                for (unsigned int i = 0; i <props.length(); i++) 
     167                { 
     168                    std::cout << "Property id : " << props[i].id << std::endl; 
     169 
     170                    if (strcmp(props[i].id, "DCE:eddc66ce-8a82-11dd-ae05-0016769e497b") == 0) { 
     171                        //The power of the AWGN noise 
     172                        CORBA::Long simple_temp; 
     173                        props[i].value >>= simple_temp; 
     174                        noise_sigma = sqrt(simple_temp/2.0); 
     175                    std::cout << "Property id : " << props[i].id << std::endl; 
     176                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     177                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     178                            propertySet[i].value = props[i].value; 
     179                            break; 
     180                        } 
     181                } 
     182                    } else if (strcmp(props[i].id, "DCE:3bbc0656-8a83-11dd-bcd3-0016769e497b") == 0) { 
     183                        //Specifies the fading type. Valid values are None and Ricean 
     184                        const char * prop_str; 
     185                        props[i].value >>= prop_str; 
     186                        if ( strcmp(prop_str, "None") == 0 ) { 
     187                        fading=false; 
     188                        } else if ( strcmp(prop_str, "Ricean") == 0 ){ 
     189                           fading=true; 
     190                        } else { 
     191                          std::cerr << "ERROR: Channel::configure() unknown fading type" << std::endl; 
     192                           throw CF::PropertySet::InvalidConfiguration(); 
     193                        }; 
     194                                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     195                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     196                            propertySet[i].value = props[i].value; 
     197                            break; 
     198                        } 
     199                } 
     200 
     201                    } else if (strcmp(props[i].id, "DCE:4ba6cb86-29fb-40c8-a90c-7e69b7e59d85") == 0) { 
     202                       const char * prop_str; 
     203                        props[i].value >>= prop_str; 
     204                        if ( strcmp(prop_str, "True") == 0 ) { 
     205                           envelope=true; 
     206                        } else if ( strcmp(prop_str, "False") == 0 ){ 
     207                           fading=false; 
     208                        } else { 
     209                          std::cerr << "ERROR: Channel::configure() unknown envelope type" << std::endl; 
     210                           throw CF::PropertySet::InvalidConfiguration(); 
     211                        }; 
     212                                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     213                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     214                            propertySet[i].value = props[i].value; 
     215                            break; 
     216                        } 
     217                }                        
     218 
     219                    } else if (strcmp(props[i].id, "DCE:76abee66-8a83-11dd-b96d-0016769e497b") == 0) { 
     220                        // K_factor 
     221                        CORBA::Double simple_temp; 
     222                        props[i].value >>= simple_temp; 
     223                        K_factor=simple_temp; 
     224                                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     225                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     226                            propertySet[i].value = props[i].value; 
     227                            break; 
     228                        } 
     229                } 
     230 
     231                    } else if (strcmp(props[i].id, "DCE:9cc6196c-8a85-11dd-b572-0016769e497b") == 0) { 
     232                        // The maximum doppler rate in terms of the sample rate 
     233                        CORBA::Double simple_temp; 
     234                        props[i].value >>= simple_temp; 
     235                        MaxDopplerRate=simple_temp; 
     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                } 
    165245/** 
    166246       else { 
  • ossiedev/branches/0.7.x/components/Channel/Channel.h

    r8381 r9211  
    6767    /// 
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     69         
     70    void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
    6972 
    7073    /// Configures properties read from .prf.xml 
  • ossiedev/branches/0.7.x/components/ChannelDemo/ChannelDemo.cpp

    r5803 r9211  
    149149} 
    150150 
     151void  
     152ChannelDemo_i::query (CF::Properties & configProperties) 
     153throw (CORBA::SystemException, CF::UnknownProperties) 
     154{ 
     155    if (configProperties.length () == 0) 
     156    { 
     157        configProperties.length (propertySet.length ()); 
     158        for (unsigned int i = 0; i < propertySet.length (); i++) 
     159        { 
     160            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     161            configProperties[i].value = propertySet[i].value; 
     162        } 
     163 
     164        return ; 
     165    } 
     166    else { 
     167        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     168            for (unsigned int j=0; j < propertySet.length(); j++) { 
     169                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     170                    configProperties[i].value = propertySet[i].value; 
     171                }  
     172            } 
     173        } 
     174    } 
     175} 
     176 
    151177void ChannelDemo_i::configure(const CF::Properties& props) 
    152178throw (CORBA::SystemException, 
     
    154180    CF::PropertySet::PartialConfiguration) 
    155181{ 
     182    static int init = 0; 
     183 
    156184    DEBUG(3, ChannelDemo, "configure() invoked") 
    157185     
    158     std::cout << "props length : " << props.length() << std::endl; 
     186    std::cout << "Component - CHANNEL DEMO" << std::endl; 
     187    std::cout << "Props length = " << props.length() << std::endl; 
     188 
     189    if (init == 0){ 
     190        if ( props.length() <= 0 ){ 
     191            std::cout << "ChannelDemo: configure called with invalid \ 
     192                          props.length() - " << props.length() << std::endl; 
     193            return; 
     194        } 
     195        std::cout << "initial configure call .." << std::endl; 
     196        propertySet.length(props.length()); 
     197        for (unsigned int i=0; i < props.length(); i++) { 
     198            std::cout << "Property Id : " << props[i].id << std::endl; 
     199            propertySet[i].id = CORBA::string_dup(props[i].id); 
     200            propertySet[i].value = props[i].value; 
     201        } 
     202        init++; 
     203        return; 
     204    } 
     205    else { 
     206    std::cout << "Normal Configure call .. " << std::endl; 
     207    std::cout << "ChannelDemo_i::configure set propertySet.length " << propertySet.length() << std::endl; 
    159208 
    160209    for (unsigned int i = 0; i <props.length(); i++) { 
    161         std::cout << "Property id : " << props[i].id << std::endl; 
    162210 
    163211        if (strcmp(props[i].id, "DCE:a337c5f0-8245-11dc-860f-00123f63025f") == 0) { 
     
    165213            CORBA::Short simple_temp; 
    166214            props[i].value >>= simple_temp; 
     215            // Test: setting propertySet[] to the given value.  
    167216            noise_std_dev = simple_temp; 
     217            std::cout << "Property id : " << props[i].id << std::endl; 
     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            } 
    168224            DEBUG(1, ChannelDemo, "Setting noise standard deviation to " << noise_std_dev); 
    169225        } else if (strcmp(props[i].id, "DCE:1c4a3eb9-9e3a-4c20-849a-90c6eaef9e5a") == 0) { 
     
    171227            CORBA::Float simple_temp; 
    172228            props[i].value >>= simple_temp; 
     229            // Test: Setting propertySet[i] to the given value 
     230            propertySet[i].value = props[i].value; 
    173231            phase_offset = simple_temp; 
    174232            DEBUG(1, ChannelDemo, "Setting phase offset to " << phase_offset << " degrees"); 
    175  
    176233            // convert to radians 
    177234            phase_offset *= M_PI/180.0f; 
     235            std::cout << "Property id : " << props[i].id << std::endl; 
     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 
    178243        } else { 
    179244            // unknown property 
     
    182247            throw CF::PropertySet::InvalidConfiguration(); 
    183248        } 
     249    } 
    184250    } 
    185251} 
  • ossiedev/branches/0.7.x/components/ChannelDemo/ChannelDemo.h

    r5801 r9211  
    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/0.7.x/components/Conv_Dec/Conv_Dec.cpp

    r9005 r9211  
    109109} 
    110110 
     111void  
     112Conv_Dec_i::query (CF::Properties & configProperties) 
     113throw (CORBA::SystemException, CF::UnknownProperties) 
     114{ 
     115    if (configProperties.length () == 0) 
     116    { 
     117        configProperties.length (propertySet.length ()); 
     118        for (unsigned int i = 0; i < propertySet.length (); i++) 
     119        { 
     120            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     121            configProperties[i].value = propertySet[i].value; 
     122        } 
     123 
     124        return ; 
     125    } 
     126    else { 
     127        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     128            for (unsigned int j=0; j < propertySet.length(); j++) { 
     129                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     130                    configProperties[i].value = propertySet[i].value; 
     131                }  
     132            } 
     133        } 
     134    } 
     135} 
     136 
     137 
    111138void Conv_Dec_i::configure(const CF::Properties& props) 
    112139throw (CORBA::SystemException, 
     
    114141    CF::PropertySet::PartialConfiguration) 
    115142{ 
     143    static int init = 0; 
    116144    DEBUG(3, Conv_Dec, "configure() invoked") 
    117145     
    118     std::cout << "props length : " << props.length() << std::endl; 
    119  
    120     for (unsigned int i = 0; i <props.length(); i++) 
    121     { 
    122         std::cout << "Property id : " << props[i].id << std::endl; 
    123  
    124         if (strcmp(props[i].id, "DCE:0e756459-63b7-4f5e-8b15-e5fbe3bf200f") == 0) 
    125         { 
    126             CORBA::Short simple_temp; 
    127             props[i].value >>= simple_temp; 
    128             rate_index = simple_temp; 
    129         } 
    130  
    131         if (strcmp(props[i].id, "DCE:8fd6f6e3-41d0-40b4-a26a-5ebdd6514931") == 0) 
    132         { 
    133             CORBA::Short simple_temp; 
    134             props[i].value >>= simple_temp; 
    135             mode = simple_temp; 
    136         } 
    137  
    138         if (strcmp(props[i].id, "DCE:c8638626-7377-4b2e-a2a4-85de280eac05") == 0) 
    139         { 
    140             CORBA::Short simple_temp; 
    141             props[i].value >>= simple_temp; 
    142             k = simple_temp; 
    143         } 
    144  
    145         if (strcmp(props[i].id, "DCE:91b1454d-f5b7-4049-a60c-cf5d587f3149") == 0) 
    146         { 
    147             CORBA::Short simple_temp; 
    148             props[i].value >>= simple_temp; 
    149             K = simple_temp; 
    150         } 
    151  
    152         if (strcmp(props[i].id, "DCE:6fa08774-471e-4761-aa7b-a37ba2166cf9") == 0) 
    153         { 
    154             CORBA::Short simple_temp; 
    155             props[i].value >>= simple_temp; 
    156             n = simple_temp; 
    157         } 
    158  
    159         if (strcmp(props[i].id, "DCE:7a4234e2-fe15-44e0-bedb-cffc9e2ec78d") == 0) 
    160         { 
    161           CORBA::ShortSeq *simplesequence; 
    162             props[i].value >>= simplesequence; 
    163             inputGeneratorPolynomialsLength = simplesequence->length(); 
    164             std::cout << "inputGeneratorPolynomials (decoder) has length : " << 
    165              inputGeneratorPolynomialsLength << std::endl; 
    166              
    167             delete []inputGeneratorPolynomials; 
    168  
    169              DEBUG(4, Conv_Dec, "does delete fails?")             
    170             inputGeneratorPolynomials = new unsigned int [inputGeneratorPolynomialsLength]; 
    171             
    172              DEBUG(4, Conv_Dec, "the new?") 
    173  
    174             for (unsigned int j = 0; j < inputGeneratorPolynomialsLength; j++) 
    175             { 
    176               DEBUG(3, Conv_Dec, "get the input from the simplesequence") 
    177                 inputGeneratorPolynomials[j] = (*simplesequence)[j]; 
    178             } 
    179  
    180  
    181          } 
     146    std::cout << "Component - Conv_Dec" << std::endl; 
     147    std::cout << "Props length = " << props.length() << std::endl; 
     148 
     149    if (init == 0){ 
     150        if ( props.length() <= 0 ){ 
     151            std::cout << "Conv_Dec: configure called with invalid \ 
     152                          props.length() - " << props.length() << std::endl; 
     153            return; 
     154        } 
     155        std::cout << "initial configure call .." << std::endl; 
     156        propertySet.length(props.length()); 
     157        for (unsigned int i=0; i < props.length(); i++) { 
     158            std::cout << "Property Id : " << props[i].id << std::endl; 
     159            propertySet[i].id = CORBA::string_dup(props[i].id); 
     160            propertySet[i].value = props[i].value; 
     161        } 
     162        init++; 
     163        return; 
    182164    } 
    183  
     165    else { 
     166        std::cout << "Normal Configure call .. " << std::endl; 
     167        std::cout << "Conv_Dec_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     168 
     169                for (unsigned int i = 0; i <props.length(); i++) 
     170                { 
     171                    std::cout << "Property id : " << props[i].id << std::endl; 
     172 
     173                    if (strcmp(props[i].id, "DCE:0e756459-63b7-4f5e-8b15-e5fbe3bf200f") == 0) 
     174                    { 
     175                        CORBA::Short simple_temp; 
     176                        props[i].value >>= simple_temp; 
     177                        rate_index = simple_temp; 
     178                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     179                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     180                                propertySet[i].value = props[i].value; 
     181                                break; 
     182                            } 
     183                        } 
     184                    } 
     185 
     186                    if (strcmp(props[i].id, "DCE:8fd6f6e3-41d0-40b4-a26a-5ebdd6514931") == 0) 
     187                    { 
     188                        CORBA::Short simple_temp; 
     189                        props[i].value >>= simple_temp; 
     190                        mode = simple_temp; 
     191                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     192                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     193                                propertySet[i].value = props[i].value; 
     194                                break; 
     195                            } 
     196                        } 
     197                    } 
     198 
     199                    if (strcmp(props[i].id, "DCE:c8638626-7377-4b2e-a2a4-85de280eac05") == 0) 
     200                    { 
     201                        CORBA::Short simple_temp; 
     202                        props[i].value >>= simple_temp; 
     203                        k = simple_temp; 
     204                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     205                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     206                                propertySet[i].value = props[i].value; 
     207                                break; 
     208                            } 
     209                        } 
     210                    } 
     211 
     212                    if (strcmp(props[i].id, "DCE:91b1454d-f5b7-4049-a60c-cf5d587f3149") == 0) 
     213                    { 
     214                        CORBA::Short simple_temp; 
     215                        props[i].value >>= simple_temp; 
     216                        K = simple_temp; 
     217                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     218                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     219                                propertySet[i].value = props[i].value; 
     220                                break; 
     221                            } 
     222                        } 
     223                    } 
     224 
     225                    if (strcmp(props[i].id, "DCE:6fa08774-471e-4761-aa7b-a37ba2166cf9") == 0) 
     226                    { 
     227                        CORBA::Short simple_temp; 
     228                        props[i].value >>= simple_temp; 
     229                        n = simple_temp; 
     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 
     238                    if (strcmp(props[i].id, "DCE:7a4234e2-fe15-44e0-bedb-cffc9e2ec78d") == 0) 
     239                    { 
     240                      CORBA::ShortSeq *simplesequence; 
     241                        props[i].value >>= simplesequence; 
     242                        inputGeneratorPolynomialsLength = simplesequence->length(); 
     243                        std::cout << "inputGeneratorPolynomials (decoder) has length : " << 
     244                         inputGeneratorPolynomialsLength << std::endl; 
     245                         
     246                        delete []inputGeneratorPolynomials; 
     247 
     248                         DEBUG(4, Conv_Dec, "does delete fails?")             
     249                        inputGeneratorPolynomials = new unsigned int [inputGeneratorPolynomialsLength]; 
     250                        
     251                         DEBUG(4, Conv_Dec, "the new?") 
     252 
     253                        for (unsigned int j = 0; j < inputGeneratorPolynomialsLength; j++) 
     254                        { 
     255                          DEBUG(3, Conv_Dec, "get the input from the simplesequence") 
     256                            inputGeneratorPolynomials[j] = (*simplesequence)[j]; 
     257                        } 
     258                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     259                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     260                                propertySet[i].value = props[i].value; 
     261                                break; 
     262                            } 
     263                        } 
     264 
     265                     } 
     266                } 
     267        } 
    184268         DEBUG(3, Conv_Dec, "Configure is done, generate the trellis etc") 
    185269  
  • ossiedev/branches/0.7.x/components/Conv_Dec/Conv_Dec.h

    r4178 r9211  
    6969    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    7070 
     71        void query(CF::Properties &configProperties) 
     72        throw (CF::UnknownProperties, CORBA::SystemException); 
     73 
    7174    /// Configures properties read from .prf.xml 
    7275    void configure(const CF::Properties&) 
  • ossiedev/branches/0.7.x/components/Conv_Enc/Conv_Enc.cpp

    r9005 r9211  
    107107} 
    108108 
     109void  
     110Conv_Enc_i::query (CF::Properties & configProperties) 
     111throw (CORBA::SystemException, CF::UnknownProperties) 
     112{ 
     113    if (configProperties.length () == 0) 
     114    { 
     115        configProperties.length (propertySet.length ()); 
     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 
    109135void Conv_Enc_i::configure(const CF::Properties& props) 
    110136throw (CORBA::SystemException, 
     
    112138    CF::PropertySet::PartialConfiguration) 
    113139{ 
     140        static int init = 0; 
    114141    DEBUG(3, Conv_Enc, "configure() invoked") 
    115142     
    116     std::cout << "props length : " << props.length() << std::endl; 
    117  
    118     for (unsigned int i = 0; i <props.length(); i++) 
    119     { 
    120         std::cout << "Property id : " << props[i].id << std::endl; 
    121  
    122  
    123         if (strcmp(props[i].id, "DCE:345df262-1611-11dc-a219-0016769e497b") == 0) 
    124         { 
    125             CORBA::Short simple_temp; 
    126             props[i].value >>= simple_temp; 
    127             rate_index = simple_temp; 
     143    std::cout << "Component - Conv_Enc" << std::endl; 
     144    std::cout << "Props length = " << props.length() << std::endl; 
     145 
     146    if (init == 0){ 
     147        if ( props.length() <= 0 ){ 
     148            std::cout << "Conv_Enc: configure called with invalid \ 
     149                          props.length() - " << props.length() << std::endl; 
     150            return; 
    128151        } 
    129  
    130         if (strcmp(props[i].id, "DCE:7be7e584-1611-11dc-b945-0016769e497b") == 0) 
    131         { 
    132             CORBA::Short simple_temp; 
    133             props[i].value >>= simple_temp; 
    134             mode = simple_temp; 
     152        std::cout << "initial configure call .." << std::endl; 
     153        propertySet.length(props.length()); 
     154        for (unsigned int i=0; i < props.length(); i++) { 
     155            std::cout << "Property Id : " << props[i].id << std::endl; 
     156            propertySet[i].id = CORBA::string_dup(props[i].id); 
     157            propertySet[i].value = props[i].value; 
    135158        } 
    136  
    137         if (strcmp(props[i].id, "DCE:d2ee004a-18ee-11dc-8925-0016769e497b") == 0) 
    138         { 
    139             CORBA::Short simple_temp; 
    140             props[i].value >>= simple_temp; 
    141             k = simple_temp; 
    142         } 
    143  
    144         if (strcmp(props[i].id, "DCE:04aaa5ac-18ef-11dc-83ea-0016769e497b") == 0) 
    145         { 
    146             CORBA::Short simple_temp; 
    147             props[i].value >>= simple_temp; 
    148             K = simple_temp; 
    149         } 
    150  
    151         if (strcmp(props[i].id, "DCE:2d17e716-18ef-11dc-bf5c-0016769e497b") == 0) 
    152         { 
    153             CORBA::Short simple_temp; 
    154             props[i].value >>= simple_temp; 
    155             n = simple_temp; 
    156         } 
    157  
    158         if (strcmp(props[i].id, "DCE:4ef1b3b0-18f1-11dc-99b1-0016769e497b") == 0) 
    159         { 
    160             CORBA::ShortSeq *simplesequence; 
    161             props[i].value >>= simplesequence; 
    162             inputGeneratorPolynomialsLength = simplesequence->length(); 
    163             std::cout << "inputGeneratorPolynomials has length : " << 
    164              inputGeneratorPolynomialsLength << std::endl; 
    165              
    166             delete []inputGeneratorPolynomials; 
    167  
    168              DEBUG(4, Conv_Enc, "does delete fails?")             
    169             inputGeneratorPolynomials = new unsigned int [inputGeneratorPolynomialsLength]; 
    170             
    171              DEBUG(4, Conv_Enc, "the new?") 
    172  
    173             for (unsigned int j = 0; j < inputGeneratorPolynomialsLength; j++) 
    174             { 
    175               DEBUG(3, Conv_Enc, "get the input from the simplesequence") 
    176                 inputGeneratorPolynomials[j] = (*simplesequence)[j]; 
    177             } 
    178  
    179  
    180          } 
     159        init++; 
     160        return; 
    181161    } 
     162    else { 
     163        std::cout << "Normal Configure call .. " << std::endl; 
     164        std::cout << "Conv_Enc_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     165 
     166                for (unsigned int i = 0; i <props.length(); i++) 
     167                { 
     168                    std::cout << "Property id : " << props[i].id << std::endl; 
     169 
     170 
     171                    if (strcmp(props[i].id, "DCE:345df262-1611-11dc-a219-0016769e497b") == 0) 
     172                    { 
     173                        CORBA::Short simple_temp; 
     174                        props[i].value >>= simple_temp; 
     175                        rate_index = simple_temp; 
     176                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     177                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     178                                propertySet[i].value = props[i].value; 
     179                                break; 
     180                            } 
     181                        } 
     182                    } 
     183 
     184                    if (strcmp(props[i].id, "DCE:7be7e584-1611-11dc-b945-0016769e497b") == 0) 
     185                    { 
     186                        CORBA::Short simple_temp; 
     187                        props[i].value >>= simple_temp; 
     188                        mode = simple_temp; 
     189                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     190                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     191                                propertySet[i].value = props[i].value; 
     192                                break; 
     193                            } 
     194                        } 
     195                    } 
     196 
     197                    if (strcmp(props[i].id, "DCE:d2ee004a-18ee-11dc-8925-0016769e497b") == 0) 
     198                    { 
     199                        CORBA::Short simple_temp; 
     200                        props[i].value >>= simple_temp; 
     201                        k = simple_temp; 
     202                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     203                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     204                                propertySet[i].value = props[i].value; 
     205                                break; 
     206                            } 
     207                        } 
     208                    } 
     209 
     210                    if (strcmp(props[i].id, "DCE:04aaa5ac-18ef-11dc-83ea-0016769e497b") == 0) 
     211                    { 
     212                        CORBA::Short simple_temp; 
     213                        props[i].value >>= simple_temp; 
     214                        K = simple_temp; 
     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                    } 
     222 
     223                    if (strcmp(props[i].id, "DCE:2d17e716-18ef-11dc-bf5c-0016769e497b") == 0) 
     224                    { 
     225                        CORBA::Short simple_temp; 
     226                        props[i].value >>= simple_temp; 
     227                        n = simple_temp; 
     228                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     229                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     230                                propertySet[i].value = props[i].value; 
     231                                break; 
     232                            } 
     233                        } 
     234                    } 
     235 
     236                    if (strcmp(props[i].id, "DCE:4ef1b3b0-18f1-11dc-99b1-0016769e497b") == 0) 
     237                    { 
     238                        CORBA::ShortSeq *simplesequence; 
     239                        props[i].value >>= simplesequence; 
     240                        inputGeneratorPolynomialsLength = simplesequence->length(); 
     241                        std::cout << "inputGeneratorPolynomials has length : " << 
     242                         inputGeneratorPolynomialsLength << std::endl; 
     243                         
     244                        delete []inputGeneratorPolynomials; 
     245 
     246                         DEBUG(4, Conv_Enc, "does delete fails?")             
     247                        inputGeneratorPolynomials = new unsigned int [inputGeneratorPolynomialsLength]; 
     248                        
     249                         DEBUG(4, Conv_Enc, "the new?") 
     250 
     251                        for (unsigned int j = 0; j < inputGeneratorPolynomialsLength; j++) 
     252                        { 
     253                          DEBUG(3, Conv_Enc, "get the input from the simplesequence") 
     254                            inputGeneratorPolynomials[j] = (*simplesequence)[j]; 
     255                        } 
     256 
     257                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     258                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     259                                propertySet[i].value = props[i].value; 
     260                                break; 
     261                            } 
     262                        } 
     263                     } 
     264                } 
     265        } 
    182266 
    183267         DEBUG(3, Conv_Enc, "Configure is done, generate the trellis etc") 
  • ossiedev/branches/0.7.x/components/Conv_Enc/Conv_Enc.h

    r4179 r9211  
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    6969 
     70        void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
     72 
    7073    /// Configures properties read from .prf.xml 
    7174    void configure(const CF::Properties&) 
  • ossiedev/branches/0.7.x/components/Decimator/Decimator.cpp

    r9016 r9211  
    3838    M(1), 
    3939    sample_count(0), 
    40     previous_length(0){ 
    41      
    42      
     40    previous_length(0) 
     41{ 
    4342    // Create the port for output data 
    4443    dataOut = new standardInterfaces_i::complexShort_u("outData"); 
     
    5150    processing_thread->start(); 
    5251 
    53     filter_type=FIR; 
     52 
    5453    // Filter length is L 
    5554    len_h = 1; 
     
    5857    h[0] = 1.0; 
    5958 
    60     fir_i_filter = new SigProc::fir_filter(h, len_h); 
    61     fir_q_filter = new SigProc::fir_filter(h, len_h); 
    62     iir_i_filter = NULL; 
    63     iir_q_filter = NULL; 
    64  
    65     //outFile = new std::ofstream("decimator_out.dat"); 
     59    i_filter = new SigProc::fir_filter(h, len_h); 
     60    q_filter = new SigProc::fir_filter(h, len_h); 
     61 
     62    outFile = new std::ofstream("decimator_out.dat"); 
    6663} 
    6764 
     
    107104} 
    108105 
     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 
    109136void Decimator_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 
    110137 
    111138{ 
    112     std::cout << "decimator Configure called" << std::endl; 
    113  
    114     std::cout << "Props length : " << props.length() << std::endl; 
    115  
    116     for (unsigned int i = 0; i < props.length(); i++) { 
    117         std::cout << "Property id : " << props[i].id << std::endl; 
     139        static int init = 0; 
     140 
     141 
     142    std::cout << "Component - DECIMATOR " << std::endl; 
     143    std::cout << " Props length = " << props.length() << std::endl; 
     144    if (init == 0){  
     145        if ( props.length() <= 0 ){ 
     146            std::cout << "Decimator: configure called with invalid \ 
     147            props.length() - " << props.length() << std::endl; 
     148            return; 
     149        } 
     150        std::cout << "Decimator: initial configure call .." << std::endl; 
     151 
     152        propertySet.length(props.length()); 
     153        for (unsigned int i=0; i < props.length(); i++) { 
     154            std::cout << "Property Id : " << props[i].id << std::endl; 
     155            propertySet[i].id = CORBA::string_dup(props[i].id); 
     156            propertySet[i].value = props[i].value; 
     157        } 
     158        init++; 
     159        return; 
     160    }    
     161    else { 
     162        std::cout << "Normal configure call..."  << std::endl; 
     163 
     164        for (unsigned int i = 0; i < props.length(); i++) { 
     165                std::cout << "Property id : " << props[i].id << std::endl; 
    118166         
    119         // DecimateBy property, sets the decimator factor 
    120         if (strcmp(props[i].id, "DCE:cea26b54-9d86-4b68-a761-14186efa9415") == 0) { 
    121             CORBA::UShort D; 
    122             props[i].value >>= D; 
    123             M = D; 
    124             std::cout << "Decimation factor set to " << M << std::endl; 
    125  
    126         } else if (strcmp(props[i].id, "DCE:134e5dd8-c773-47af-a557-2837076358c4") == 0) { 
    127             // filter property, Filter coefficients 
    128             CORBA::FloatSeq *coeff_ptr; 
    129             props[i].value >>= coeff_ptr; 
    130  
    131             len_h = coeff_ptr->length(); 
    132              
    133             if (len_h < 2) { 
    134                 calculateFilterCoefficients = true; 
    135             } else { 
    136                 calculateFilterCoefficients = false; 
    137  
    138                 delete []h; 
    139                 delete_filter_variables(); 
    140  
    141                 h = new float[len_h]; 
    142                 std::cout << "Decimator filter length = " << len_h << std::endl; 
    143                 for (unsigned int k = 0; k < len_h; k++) { 
    144                     h[k] = (*coeff_ptr)[k]; 
    145                     DEBUG(3, Decimator, "Coeff[" << k << "] = " << h[k]) 
    146                 } 
    147                 fir_i_filter = new SigProc::fir_filter(h, len_h); 
    148                 fir_q_filter = new SigProc::fir_filter(h, len_h); 
    149             } 
    150         } else if (strcmp(props[i].id, "DCE:537a42d9-2dd7-45b8-8dfb-f0999115ba71") == 0) { 
    151            const char * prop_str; 
    152             props[i].value >>= prop_str; 
    153             if ( strcmp(prop_str, "FIR") == 0 ) { 
    154                filter_type=FIR; 
    155                DEBUG(3, Decimator, "Filtertype set to FIR") 
    156             } else if ( strcmp(prop_str, "IIR") == 0 ){ 
    157                filter_type=IIR; 
    158                DEBUG(3, Decimator, "Filtertype set to IIR") 
    159             } else { 
    160               std::cerr << "ERROR: Decimator::configure() unknown filter type" << std::endl; 
    161                throw CF::PropertySet::InvalidConfiguration(); 
    162             }; 
    163         } else { 
    164             std::cerr << "ERROR: Decimator::configure(): Unknown property " 
    165                       << props[i].id << std::endl; 
    166             throw CF::PropertySet::InvalidConfiguration(); 
    167         } 
     167                // DecimateBy property, sets the decimator factor 
     168                if (strcmp(props[i].id, "DCE:cea26b54-9d86-4b68-a761-14186efa9415") == 0) { 
     169                    CORBA::UShort D; 
     170                    props[i].value >>= D; 
     171                    M = D; 
     172                    std::cout << "Decimation factor set to " << M << std::endl; 
     173         
     174                    if (calculateFilterCoefficients) { 
     175                        // calculate filter coefficients dynamically 
     176                        unsigned int m(2);      // filter delay (symbols) 
     177                        float beta(0.5f);       // excess bandwidth factor 
     178                        len_h = 2*2*D*m+1;      // filter length (samples) 
     179                        delete [] h; 
     180                        h = new float[len_h]; 
     181                        SigProc::DesignRRCFilter(2*D, m, beta, h); 
     182         
     183                        // delete old filters 
     184                        delete i_filter; 
     185                        delete q_filter; 
     186         
     187                        // print coefficients 
     188                        for (unsigned int k=0; k<len_h; k++) 
     189                            DEBUG(2, Decimator, " h[" << k << "] = " << h[k]); 
     190         
     191                        i_filter = new SigProc::fir_filter(h, len_h); 
     192                        q_filter = new SigProc::fir_filter(h, len_h); 
     193                    } 
     194                    std::cout << "Property id : " << props[i].id << std::endl; 
     195                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     196                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     197                            propertySet[i].value = props[i].value; 
     198                            break; 
     199                        } 
     200                    } 
     201                                 
     202                                 
     203                } else if (strcmp(props[i].id, "DCE:134e5dd8-c773-47af-a557-2837076358c4") == 0) { 
     204                    // filter property, Filter coefficients 
     205                    CORBA::FloatSeq *coeff_ptr; 
     206                    props[i].value >>= coeff_ptr; 
     207         
     208                    len_h = coeff_ptr->length(); 
     209                     
     210                    if (len_h < 2) { 
     211                                calculateFilterCoefficients = true; 
     212                        } else { 
     213                        calculateFilterCoefficients = false; 
     214                 
     215                        delete []h; 
     216                        delete i_filter; 
     217                        delete q_filter; 
     218 
     219                        h = new float[len_h]; 
     220                        std::cout << "Decimator filter length = " << len_h << std::endl; 
     221                        for (unsigned int k = 0; k < len_h; k++) { 
     222                            h[k] = (*coeff_ptr)[k]; 
     223                            DEBUG(3, Decimator, "Coeff[" << k << "] = " << h[k]) 
     224                        } 
     225                        i_filter = new SigProc::fir_filter(h, len_h); 
     226                        q_filter = new SigProc::fir_filter(h, len_h); 
     227                    } 
     228                    std::cout << "Property id : " << props[i].id << std::endl; 
     229                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     230                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     231                            propertySet[i].value = props[i].value; 
     232                            break; 
     233                        } 
     234                    } 
     235 
     236         
     237                } else { 
     238                    std::cerr << "ERROR: Decimator::configure(): Unknown property " 
     239                              << props[i].id << std::endl; 
     240                    throw CF::PropertySet::InvalidConfiguration(); 
     241                } 
    168242         
    169     } 
    170      
    171           
    172          if (filter_type==FIR) { 
    173           
    174                         if (calculateFilterCoefficients) { 
    175                         // calculate filter coefficients dynamically 
    176                         unsigned int m(2);      // filter delay (symbols) 
    177                         float beta(0.5f);       // excess bandwidth factor 
    178                         len_h = 2*2*M*m+1;      // filter length (samples) 
    179                         delete [] h; 
    180                         h = new float[len_h]; 
    181                         SigProc::DesignRRCFilter(2*M, m, beta, h); 
    182  
    183                         // delete old filters 
    184                         delete_filter_variables(); 
    185  
    186                         // print coefficients 
    187                         for (unsigned int k=0; k<len_h; k++) 
    188                             DEBUG(2, Decimator, " h[" << k << "] = " << h[k]); 
    189  
    190                         fir_i_filter = new SigProc::fir_filter(h, len_h); 
    191                         fir_q_filter = new SigProc::fir_filter(h, len_h); 
    192                         } 
    193                  
    194          } else { 
    195           
    196           
    197                          
    198                         float *b_f;                ///< feedforward filter coefficients 
    199                         float *a_f;                ///< feedback filter coefficients 
    200                         unsigned int f_order;      ///< filter order 
    201                         // 10th-order Butterworth IIR filter, wc = (1/M)*pi rad, 
    202                         f_order = 10; 
    203                         b_f = new float[f_order+1]; 
    204                         a_f = new float[f_order+1]; 
    205                         // Delete old filters 
    206                         delete_filter_variables(); 
    207                         SigProc::design_butter_lowpass_filter(f_order, 1.0/M, b_f, a_f); 
    208                         iir_i_filter = new SigProc::iir_filter(a_f, f_order+1, b_f, f_order+1); 
    209                         iir_q_filter = new SigProc::iir_filter(a_f, f_order+1, b_f, f_order+1); 
    210                         DEBUG(3, Decimator, "IIR Filter generated") 
    211                         delete b_f; 
    212                         delete a_f; 
    213           
    214          } 
    215  
    216 } 
     243        } 
     244         
     245        } 
     246} 
     247 
    217248void Decimator_i::releaseObject() throw (CF::LifeCycle::ReleaseError, CORBA::SystemException) 
    218249 
     
    231262    std::cout << "run_decimation thread started" << std::endl; 
    232263 
    233 /** 
    234264#ifdef LOG_DATA 
    235265    dump_data pre_decim("pre.dat", 1000, 1000); 
    236266    dump_data post_decim("post.dat", 1000, 1000); 
    237267#endif 
    238 **/ 
    239      
    240     unsigned int len=1024; 
    241     unsigned int len_out=1024; 
     268 
    242269    PortTypes::ShortSequence I_out, Q_out; 
    243     short * I_buf = new short[len]; 
    244     short * Q_buf = new short[len]; 
    245     bool output_sample(false); 
    246270 
    247271    while (1) { 
     
    251275        dataIn->getData(I_in, Q_in); 
    252276 
    253          len=I_in->length(); 
    254          
    255         DEBUG(5, Decimator, "Received "<<len<<" samples") 
     277        unsigned int len = I_in->length(); 
    256278 
    257279        if (len != previous_length) { 
    258             len_out=(unsigned int)(1.0*len/M); 
    259             I_out.length(len_out); 
    260             Q_out.length(len_out); 
    261             delete [] I_buf; 
    262             delete [] Q_buf; 
    263             I_buf = new short[len]; 
    264             Q_buf = new short[len]; 
    265             previous_length=len; 
    266         } 
    267  
    268 //        I_out.length(len_out); 
    269 //        Q_out.length(len_out); 
    270  
    271 /** 
     280            I_out.length(len/M + 2); 
     281            Q_out.length(len/M + 2); 
     282        } 
     283 
     284        unsigned int out_idx(0); 
     285 
    272286#ifdef PRINT_ENERGY 
    273287        float E_in = 0, E_out = 0; 
    274288#endif 
    275 **/ 
    276  
    277 if (filter_type==FIR) {  
     289 
    278290        for (unsigned int i = 0; i < len; ++i) { 
    279  
    280             
    281  
    282            
    283              
    284                 sample_count = (++sample_count) % M; 
    285                 if (sample_count == 0) output_sample = true; 
    286                 fir_i_filter->do_work(output_sample, (*I_in)[i], I_buf[i]); 
    287                 fir_q_filter->do_work(output_sample, (*Q_in)[i], Q_buf[i] ); 
    288  
    289 /** 
     291            short i_out, q_out; 
     292 
     293            sample_count = (++sample_count) % M; 
     294 
     295            bool output_sample(false); 
     296            if (sample_count == 0) 
     297                output_sample = true; 
     298 
     299            i_filter->do_work(output_sample, (*I_in)[i], i_out); 
     300            q_filter->do_work(output_sample, (*Q_in)[i], q_out); 
     301 
    290302#ifdef LOG_DATA 
    291303            pre_decim.write_data((float)(*I_in)[i], (float)(*Q_in)[i]); 
     
    296308            E_out += i_out * i_out + q_out * q_out; 
    297309#endif 
    298 **/ 
    299         } 
    300         } else { 
    301                 for (unsigned int i = 0; i < len; ++i) { 
    302              iir_i_filter->do_work( (*I_in)[i], I_buf[i]); 
    303              iir_q_filter->do_work( (*Q_in)[i], Q_buf[i]); 
    304              } 
    305              
    306         } 
    307          
    308         for (unsigned int i=0; i<len_out; i++) { 
    309             I_out[i] = I_buf[M*i]; 
    310             Q_out[i] = Q_buf[M*i]; 
    311             /** 
    312             #ifdef LOG_DATA 
    313                  post_decim.write_data((float)I_buf[M*i], (float)q_buf[M*i]); 
    314             #endif 
    315             **/ 
    316         } 
    317  
    318         DEBUG(5, Decimator, "Out "<<len_out<<" samples") 
     310 
     311            if (output_sample) { 
     312#ifdef LOG_DATA 
     313                       post_decim.write_data((float)i_out, (float)q_out); 
     314#endif 
     315                I_out[out_idx] = i_out; 
     316                Q_out[out_idx] = q_out; 
     317                ++out_idx; 
     318            } 
     319 
     320        } 
     321 
     322 
    319323        dataIn->bufferEmptied(); 
     324 
     325#ifdef PRINT_ENERGY 
     326        std::cout << "Energy in = " << 10 * log10(E_in/decimator->I_in.length() + 0.01) << "  Energy out = " << 10 * log10(E_out/out_idx + 0.01) << std::endl; 
     327#endif 
     328 
     329        // Set length of output sequences to actual number of samples 
     330        I_out.length(out_idx); 
     331        Q_out.length(out_idx); 
     332 
    320333        dataOut->pushPacket(I_out, Q_out); 
    321 /** 
    322 #ifdef PRINT_ENERGY 
    323         std::cout << "Energy in = " << 10 * log10(E_in/decimator->I_in.length() + 0.01) << "  Energy out = " << 10 * log10(E_out/len_out + 0.01) << std::endl; 
    324 #endif 
    325 **/      
    326334    } 
    327335 
     
    340348    return ret; 
    341349} 
    342  
    343 void Decimator_i::delete_filter_variables() 
    344 { 
    345 DEBUG(5, Decimator, "Enter delete_filter_variables") 
    346         if (fir_i_filter!=NULL){ 
    347                delete fir_i_filter; 
    348                fir_i_filter=NULL; 
    349         }; 
    350          
    351         if (fir_q_filter!=NULL){ 
    352                delete fir_q_filter; 
    353                fir_q_filter=NULL; 
    354         }; 
    355  
    356         if (iir_i_filter!=NULL){ 
    357                delete iir_i_filter; 
    358                iir_i_filter=NULL; 
    359         }; 
    360          
    361         if (iir_q_filter!=NULL){ 
    362                delete iir_q_filter; 
    363                iir_q_filter=NULL; 
    364         };        
    365  
    366 DEBUG(5, Decimator, "Exit delete_filter_variables") 
    367 } 
  • ossiedev/branches/0.7.x/components/Decimator/Decimator.h

    r9015 r9211  
    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); 
     
    7981    unsigned int previous_length; // Length of previous input sequence 
    8082 
    81     SigProc::fir_filter *fir_i_filter, * fir_q_filter; // Signal processing object pointers 
    82     SigProc::iir_filter *iir_i_filter, * iir_q_filter; // Signal processing object pointers 
    83  
    84     enum Filter_type { FIR, IIR }; 
    85     Filter_type filter_type; 
    86      
    87     void delete_filter_variables(); //Deletes any non-null filter variables. 
    88  
     83    SigProc::fir_filter *i_filter, * q_filter; // Signal processing object pointers 
    8984 
    9085    short f2s(float r); // convert float to short with clipping 
  • ossiedev/branches/0.7.x/components/Decimator/Decimator.prf.xml

    r9015 r9211  
    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/0.7.x/components/DigitalModem/src/DigitalDemodulator.cpp

    r8833 r9211  
    9898} 
    9999 
     100void  
     101DigitalDemodulator_i::query (CF::Properties & configProperties) 
     102throw (CORBA::SystemException, CF::UnknownProperties) 
     103{ 
     104    if (configProperties.length () == 0) 
     105    { 
     106        configProperties.length (propertySet.length ()); 
     107        for (unsigned int i = 0; i < propertySet.length (); i++) 
     108        { 
     109            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     110            configProperties[i].value = propertySet[i].value; 
     111        } 
     112 
     113        return ; 
     114    } 
     115    else { 
     116        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     117            for (unsigned int j=0; j < propertySet.length(); j++) { 
     118                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     119                    configProperties[i].value = propertySet[i].value; 
     120                }  
     121            } 
     122        } 
     123    } 
     124} 
     125 
    100126void DigitalDemodulator_i::configure(const CF::Properties& props) 
    101127throw (CORBA::SystemException, 
     
    103129    CF::PropertySet::PartialConfiguration) 
    104130{ 
     131        static int init = 0; 
    105132    DEBUG(3, DigitalDemodulator, "configure() invoked") 
    106133     
    107134    DEBUG(3, DigitalDemodulator, "props length : " << props.length()); 
    108  
    109     for (unsigned int i = 0; i <props.length(); i++) { 
    110         DEBUG(3, DigitalDemodulator, "Property id : " << props[i].id); 
    111  
    112         if (strcmp(props[i].id, "DCE:de4641d3-5c25-47d4-8d0b-89a069ac0248") == 0) { 
    113             // Demodulation scheme 
    114             const char * prop_str; 
    115             props[i].value >>= prop_str; 
    116  
    117             // Set appropriate modulation function 
    118             if ( strcmp(prop_str, "BPSK") == 0 ) { 
    119                 SetModulationScheme( SigProc::BPSK ); 
    120             } else if ( strcmp(prop_str, "QPSK") == 0 ) { 
    121                 SetModulationScheme( SigProc::QPSK ); 
    122             } else if ( strcmp(prop_str, "8PSK") == 0 ) { 
    123                 SetModulationScheme( SigProc::PSK8 ); 
    124             } else if ( strcmp(prop_str, "16QAM") == 0 ) { 
    125                 SetModulationScheme( SigProc::QAM16 ); 
    126             } else if ( strcmp(prop_str, "4PAM") == 0 ) { 
    127                 SetModulationScheme( SigProc::PAM4 ); 
    128             } else { 
    129                 // unknown property 
    130                 std::cerr << "ERROR: DigitalDemodulator::configure() unknown mod. scheme " 
    131                           << prop_str << std::endl; 
    132                 throw CF::PropertySet::InvalidConfiguration(); 
    133             } 
    134             ///\todo catch exception thrown by DigitalDemodulatorDSP::ConfigureModulationScheme() 
    135  
    136         } else { 
    137             // unknown property 
    138             std::cerr << "ERROR: DigitalDemodulator::configure() unknown property" << std::endl; 
    139             throw CF::PropertySet::InvalidConfiguration(); 
    140         } 
    141     } 
    142  
     135    std::cout << "Component - DIGITAL DEMODULATOR" << std::endl; 
     136    std::cout << "Props length = " << props.length() << std::endl; 
     137 
     138    if (init == 0){ 
     139        if ( props.length() <= 0 ){ 
     140            std::cout << "DigitalDemodulator: configure called with invalid \ 
     141                          props.length() - " << props.length() << std::endl; 
     142            return; 
     143        } 
     144        std::cout << "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 << "Normal Configure call .. " << std::endl; 
     156        std::cout << "DigitalDemodulator_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     157 
     158                for (unsigned int i = 0; i <props.length(); i++) { 
     159                    DEBUG(3, DigitalDemodulator, "Property id : " << props[i].id); 
     160 
     161                    if (strcmp(props[i].id, "DCE:de4641d3-5c25-47d4-8d0b-89a069ac0248") == 0) { 
     162                        // Demodulation scheme 
     163                        const char * prop_str; 
     164                        props[i].value >>= prop_str; 
     165 
     166                        // Set appropriate modulation function 
     167                        if ( strcmp(prop_str, "BPSK") == 0 ) { 
     168                            SetModulationScheme( SigProc::BPSK ); 
     169                        } else if ( strcmp(prop_str, "QPSK") == 0 ) { 
     170                            SetModulationScheme( SigProc::QPSK ); 
     171                        } else if ( strcmp(prop_str, "8PSK") == 0 ) { 
     172                            SetModulationScheme( SigProc::PSK8 ); 
     173                        } else if ( strcmp(prop_str, "16QAM") == 0 ) { 
     174                            SetModulationScheme( SigProc::QAM16 ); 
     175                        } else if ( strcmp(prop_str, "4PAM") == 0 ) { 
     176                            SetModulationScheme( SigProc::PAM4 ); 
     177                        } else { 
     178                            // unknown property 
     179                            std::cerr << "ERROR: DigitalDemodulator::configure() unknown mod. scheme " 
     180                                      << prop_str << std::endl; 
     181                            throw CF::PropertySet::InvalidConfiguration(); 
     182                        } 
     183                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     184                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     185                                propertySet[i].value = props[i].value; 
     186                                break; 
     187                            } 
     188                        } 
     189                        ///\todo catch exception thrown by DigitalDemodulatorDSP::ConfigureModulationScheme() 
     190 
     191                    } else { 
     192                        // unknown property 
     193                        std::cerr << "ERROR: DigitalDemodulator::configure() unknown property" << std::endl; 
     194                        throw CF::PropertySet::InvalidConfiguration(); 
     195                    } 
     196                } 
     197        } 
    143198} 
    144199 
  • ossiedev/branches/0.7.x/components/DigitalModem/src/DigitalDemodulator.h

    r8833 r9211  
    6767    /// 
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     69    void query(CF::Properties &configProperties) 
     70        throw (CF::UnknownProperties, CORBA::SystemException); 
    6971 
    7072    /// Configures properties read from .prf.xml 
  • ossiedev/branches/0.7.x/components/DigitalModem/src/DigitalModulator.cpp

    r8833 r9211  
    9898} 
    9999 
     100void  
     101DigitalModulator_i::query (CF::Properties & configProperties) 
     102throw (CORBA::SystemException, CF::UnknownProperties) 
     103{ 
     104    if (configProperties.length () == 0) 
     105    { 
     106        configProperties.length (propertySet.length ()); 
     107        for (unsigned int i = 0; i < propertySet.length (); i++) 
     108        { 
     109            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     110            configProperties[i].value = propertySet[i].value; 
     111        } 
     112 
     113        return ; 
     114    } 
     115    else { 
     116        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     117            for (unsigned int j=0; j < propertySet.length(); j++) { 
     118                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     119                    configProperties[i].value = propertySet[i].value; 
     120                }  
     121            } 
     122        } 
     123    } 
     124} 
     125 
     126 
    100127void DigitalModulator_i::configure(const CF::Properties& props) 
    101128throw (CORBA::SystemException, 
     
    103130    CF::PropertySet::PartialConfiguration) 
    104131{ 
     132        static int init=0; 
    105133    DEBUG(3, DigitalModulator, "configure() invoked") 
    106134     
    107135    DEBUG(3, DigitalModulator, "props length : " << props.length()); 
    108  
    109     for (unsigned int i = 0; i <props.length(); i++) { 
    110         DEBUG(3, DigitalModulator, "Property id : " << props[i].id); 
    111  
    112         if (strcmp(props[i].id, "DCE:cc5a494c-4c04-11dc-92c1-00123f63025f") == 0) { 
    113             // Modulation scheme 
    114             const char * prop_str; 
    115             props[i].value >>= prop_str; 
    116  
    117             // Set appropriate modulation function 
    118             if ( strcmp(prop_str, "BPSK") == 0 ) { 
    119                 SetModulationScheme( SigProc::BPSK ); 
    120             } else if ( strcmp(prop_str, "QPSK") == 0 ) { 
    121                 SetModulationScheme( SigProc::QPSK ); 
    122             } else if ( strcmp(prop_str, "8PSK") == 0 ) { 
    123                 SetModulationScheme( SigProc::PSK8 ); 
    124             } else if ( strcmp(prop_str, "16QAM") == 0 ) { 
    125                 SetModulationScheme( SigProc::QAM16 ); 
    126             } else if ( strcmp(prop_str, "4PAM") == 0 ) { 
    127                 SetModulationScheme( SigProc::PAM4 ); 
    128             } else { 
    129                 // unknown property 
    130                 std::cerr << "ERROR: DigitalModulator::configure() unknown mod. scheme " 
    131                           << prop_str << std::endl; 
    132                 throw CF::PropertySet::InvalidConfiguration(); 
    133             } 
    134             ///\todo catch exception thrown by DigitalModulatorDSP::ConfigureModulationScheme() 
    135  
    136         } else { 
    137             // unknown property 
    138             std::cerr << "ERROR: DigitalModulator::configure() unknown property" << std::endl; 
    139             throw CF::PropertySet::InvalidConfiguration(); 
    140         } 
    141     } 
    142  
     136         
     137        std::cout << "Component - DIGITAL MODEM" << std::endl; 
     138    std::cout << "Props length = " << props.length() << std::endl; 
     139 
     140    if (init == 0){ 
     141        if ( props.length() <= 0 ){ 
     142            std::cout << "ChannelDemo: configure called with invalid \ 
     143                          props.length() - " << props.length() << std::endl; 
     144            return; 
     145        } 
     146        std::cout << "initial configure call .." << std::endl; 
     147        propertySet.length(props.length()); 
     148        for (unsigned int i=0; i < props.length(); i++) { 
     149            std::cout << "Property Id : " << props[i].id << std::endl; 
     150            propertySet[i].id = CORBA::string_dup(props[i].id); 
     151            propertySet[i].value = props[i].value; 
     152        } 
     153        init++; 
     154        return; 
     155    } 
     156    else { 
     157        std::cout << "Normal Configure call .. " << std::endl; 
     158        std::cout << "DigitalModulator_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     159         
     160                for (unsigned int i = 0; i <props.length(); i++) { 
     161                    DEBUG(3, DigitalModulator, "Property id : " << props[i].id); 
     162 
     163                    if (strcmp(props[i].id, "DCE:cc5a494c-4c04-11dc-92c1-00123f63025f") == 0) { 
     164                        // Modulation scheme 
     165                        const char * prop_str; 
     166                        props[i].value >>= prop_str; 
     167 
     168                        // Set appropriate modulation function 
     169                        if ( strcmp(prop_str, "BPSK") == 0 ) { 
     170                            SetModulationScheme( SigProc::BPSK ); 
     171                        } else if ( strcmp(prop_str, "QPSK") == 0 ) { 
     172                            SetModulationScheme( SigProc::QPSK ); 
     173                        } else if ( strcmp(prop_str, "8PSK") == 0 ) { 
     174                            SetModulationScheme( SigProc::PSK8 ); 
     175                        } else if ( strcmp(prop_str, "16QAM") == 0 ) { 
     176                            SetModulationScheme( SigProc::QAM16 ); 
     177                        } else if ( strcmp(prop_str, "4PAM") == 0 ) { 
     178                            SetModulationScheme( SigProc::PAM4 ); 
     179                        } else { 
     180                            // unknown property 
     181                            std::cerr << "ERROR: DigitalModulator::configure() unknown mod. scheme " 
     182                                      << prop_str << std::endl; 
     183                            throw CF::PropertySet::InvalidConfiguration(); 
     184                        } 
     185                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     186                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     187                                propertySet[i].value = props[i].value; 
     188                                break; 
     189                            } 
     190                        } 
     191                        ///\todo catch exception thrown by DigitalModulatorDSP::ConfigureModulationScheme() 
     192 
     193                    } else { 
     194                        // unknown property 
     195                        std::cerr << "ERROR: DigitalModulator::configure() unknown property" << std::endl; 
     196                        throw CF::PropertySet::InvalidConfiguration(); 
     197                    } 
     198                } 
     199        } 
    143200} 
    144201 
  • ossiedev/branches/0.7.x/components/DigitalModem/src/DigitalModulator.h

    r8833 r9211  
    6767    /// 
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     69         
     70    void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
    6972 
    7073    /// Configures properties read from .prf.xml 
  • ossiedev/branches/0.7.x/components/FrameAssembler/src/FrameAssembler.cpp

    r8876 r9211  
    100100} 
    101101 
     102void  
     103FrameAssembler_i::query (CF::Properties & configProperties) 
     104throw (CORBA::SystemException, CF::UnknownProperties) 
     105{ 
     106    if (configProperties.length () == 0) 
     107    { 
     108        configProperties.length (propertySet.length ()); 
     109        for (unsigned int i = 0; i < propertySet.length (); i++) 
     110        { 
     111            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     112            configProperties[i].value = propertySet[i].value; 
     113        } 
     114 
     115        return ; 
     116    } 
     117    else { 
     118        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     119            for (unsigned int j=0; j < propertySet.length(); j++) { 
     120                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     121                    configProperties[i].value = propertySet[i].value; 
     122                }  
     123            } 
     124        } 
     125    } 
     126} 
     127 
    102128void FrameAssembler_i::configure(const CF::Properties& props) 
    103129throw (CORBA::SystemException, 
     
    105131    CF::PropertySet::PartialConfiguration) 
    106132{ 
     133        static int init = 0; 
    107134    DEBUG(3, FrameAssembler, "configure() invoked") 
    108135     
    109     std::cout << "props length : " << props.length() << std::endl; 
    110  
    111     for (unsigned int i = 0; i <props.length(); i++) { 
    112         std::cout << "Property id : " << props[i].id << std::endl; 
    113  
    114         if (strcmp(props[i].id, "DCE:a15e70e4-96e4-4cc8-b1f0-06cb301f6c2e") == 0) { 
    115             // Modulation type 
    116             const char * prop_str; 
    117             props[i].value >>= prop_str; 
    118  
    119             // Set appropriate modulation function 
    120             if ( strcmp(prop_str, "BPSK") == 0 ) { 
    121                 ConfigureModulationScheme(SigProc::BPSK); 
    122             } else if ( strcmp(prop_str, "QPSK") == 0 ) { 
    123                 ConfigureModulationScheme(SigProc::QPSK); 
    124             } else if ( strcmp(prop_str, "8PSK") == 0 ) { 
    125                 ConfigureModulationScheme(SigProc::PSK8); 
    126             } else if ( strcmp(prop_str, "16QAM") == 0 ) { 
    127                 ConfigureModulationScheme(SigProc::QAM16); 
    128             } else if ( strcmp(prop_str, "4PAM") == 0 ) { 
    129                 ConfigureModulationScheme(SigProc::PAM4); 
    130             } else { 
    131                 // unknown property 
    132                 std::cerr << "ERROR: FrameAssembler::configure() unknown mod. scheme " 
    133                           << prop_str << std::endl; 
    134                 throw CF::PropertySet::InvalidConfiguration(); 
    135             } 
    136             ///\todo catch exception thrown by FrameAssemblerDSP::ConfigureModulationScheme() 
    137  
    138         } else if (strcmp(props[i].id, "DCE:96b798ba-5412-4bbe-bf0b-8ca665d25b83") == 0) { 
    139             // Frame size 
    140             CORBA::UShort simple_temp; 
    141             props[i].value >>= simple_temp; 
    142             frame_size_option=simple_temp; 
    143             ConfigureFrameSize(frame_size_option); 
    144             DEBUG(3, FrameAssembler, "Frame Size Option "<<frame_size_option<<" read and configured") 
    145         } else if (strcmp(props[i].id, "DCE:cdac2d50-214c-4c47-8a6d-d9ec453b3b3c") == 0) { 
    146             CORBA::UShort simple_temp; 
    147             props[i].value >>= simple_temp; 
    148             SetFrameSize(simple_temp,1);            
    149         } else if (strcmp(props[i].id, "DCE:a6caa288-08d2-4f0e-b0f0-f34fa513ce3d") == 0) { 
    150             CORBA::UShort simple_temp; 
    151             props[i].value >>= simple_temp; 
    152             SetFrameSize(simple_temp,2); 
    153         } else if (strcmp(props[i].id, "DCE:bcf3ff9b-9f9d-4498-b29a-78f813678271") == 0) { 
    154             CORBA::UShort simple_temp; 
    155             props[i].value >>= simple_temp; 
    156             SetFrameSize(simple_temp,3); 
    157         } else if (strcmp(props[i].id, "DCE:34311a06-2055-4490-a949-478786cad4d4") == 0) { 
    158             CORBA::UShort simple_temp; 
    159             props[i].value >>= simple_temp; 
    160             SetFrameSize(simple_temp,4); 
    161  
    162         } else { 
    163             // unknown property 
    164             std::cerr << "ERROR: FrameAssembler::configure() unknown property" << std::endl; 
    165             throw CF::PropertySet::InvalidConfiguration(); 
    166         } 
    167     } 
    168      
     136        std::cout << "Component - FRAME ASSEMBLER" << std::endl; 
     137    std::cout << "Props length = " << props.length() << std::endl; 
     138    if (init == 0){ 
     139        if ( props.length() <= 0 ){ 
     140            std::cout << "FrameAssembler: configure called with invalid \ 
     141                          props.length() - " << props.length() << std::endl; 
     142            return; 
     143        } 
     144        std::cout << "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 << "Normal Configure call .. " << std::endl; 
     156            std::cout << "FrameAssembler_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     157 
     158                for (unsigned int i = 0; i <props.length(); i++) { 
     159                    std::cout << "Property id : " << props[i].id << std::endl; 
     160 
     161                    if (strcmp(props[i].id, "DCE:a15e70e4-96e4-4cc8-b1f0-06cb301f6c2e") == 0) { 
     162                        // Modulation type 
     163                        const char * prop_str; 
     164                        props[i].value >>= prop_str; 
     165 
     166                std::cout << "Modulation scheme = " << prop_str << std::endl; 
     167 
     168                        // Set appropriate modulation function 
     169                        if ( strcmp(prop_str, "BPSK") == 0 ) { 
     170                            ConfigureModulationScheme(SigProc::BPSK); 
     171                        } else if ( strcmp(prop_str, "QPSK") == 0 ) { 
     172                            ConfigureModulationScheme(SigProc::QPSK); 
     173                        } else if ( strcmp(prop_str, "8PSK") == 0 ) { 
     174                            ConfigureModulationScheme(SigProc::PSK8); 
     175                        } else if ( strcmp(prop_str, "16QAM") == 0 ) { 
     176                            ConfigureModulationScheme(SigProc::QAM16); 
     177                        } else if ( strcmp(prop_str, "4PAM") == 0 ) { 
     178                            ConfigureModulationScheme(SigProc::PAM4); 
     179                        } else { 
     180                            // unknown property 
     181                            std::cerr << "ERROR: FrameAssembler::configure() unknown mod. scheme " 
     182                                      << prop_str << std::endl; 
     183                            throw CF::PropertySet::InvalidConfiguration(); 
     184                        } 
     185                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     186                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     187                                propertySet[i].value = props[i].value; 
     188                                break; 
     189                            } 
     190                        } 
     191                        ///\todo catch exception thrown by FrameAssemblerDSP::ConfigureModulationScheme() 
     192 
     193                    } else if (strcmp(props[i].id, "DCE:96b798ba-5412-4bbe-bf0b-8ca665d25b83") == 0) { 
     194                        // Frame size 
     195                        CORBA::UShort simple_temp; 
     196                        props[i].value >>= simple_temp; 
     197                        frame_size_option=simple_temp; 
     198                        ConfigureFrameSize(frame_size_option); 
     199                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     200                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     201                            propertySet[i].value = props[i].value; 
     202                            break; 
     203                        } 
     204                    } 
     205                        DEBUG(3, FrameAssembler, "Frame Size Option "<<frame_size_option<<" read and configured") 
     206                } else if (strcmp(props[i].id, "DCE:cdac2d50-214c-4c47-8a6d-d9ec453b3b3c") == 0) { 
     207                        CORBA::UShort simple_temp; 
     208                        props[i].value >>= simple_temp; 
     209                        SetFrameSize(simple_temp,1);            
     210                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     211                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     212                                propertySet[i].value = props[i].value; 
     213                                break; 
     214                            } 
     215                        } 
     216                    } else if (strcmp(props[i].id, "DCE:a6caa288-08d2-4f0e-b0f0-f34fa513ce3d") == 0) { 
     217                        CORBA::UShort simple_temp; 
     218                        props[i].value >>= simple_temp; 
     219                        SetFrameSize(simple_temp,2); 
     220                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     221                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     222                                propertySet[i].value = props[i].value; 
     223                                break; 
     224                            } 
     225                        } 
     226                    } else if (strcmp(props[i].id, "DCE:bcf3ff9b-9f9d-4498-b29a-78f813678271") == 0) { 
     227                        CORBA::UShort simple_temp; 
     228                        props[i].value >>= simple_temp; 
     229                        SetFrameSize(simple_temp,3); 
     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                    } else if (strcmp(props[i].id, "DCE:34311a06-2055-4490-a949-478786cad4d4") == 0) { 
     237                        CORBA::UShort simple_temp; 
     238                        props[i].value >>= simple_temp; 
     239                        SetFrameSize(simple_temp,4); 
     240                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     241                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     242                                propertySet[i].value = props[i].value; 
     243                                break; 
     244                            } 
     245                        } 
     246 
     247                    } else { 
     248                        // unknown property 
     249                        std::cerr << "ERROR: FrameAssembler::configure() unknown property" << std::endl; 
     250                        throw CF::PropertySet::InvalidConfiguration(); 
     251                    } 
     252                } 
     253        }                
    169254    //Update frame size 
    170255    ConfigureFrameSize(frame_size_option); 
  • ossiedev/branches/0.7.x/components/FrameAssembler/src/FrameAssembler.h

    r8831 r9211  
    6767    /// 
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     69         
     70    void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
    6972 
    7073    /// Configures properties read from .prf.xml 
  • ossiedev/branches/0.7.x/components/Interpolator/Interpolator.cpp

    r8587 r9211  
    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        if ( props.length() <= 0 ){ 
     158            std::cout << "Interpolator: configure called with invalid \ 
     159                          props.length() - " << props.length() << std::endl; 
     160            return; 
     161        } 
     162        propertySet.length(props.length()); 
     163        for (unsigned int i=0; i < props.length(); i++) { 
     164            std::cout << "Property Id : " << props[i].id << std::endl; 
     165            propertySet[i].id = CORBA::string_dup(props[i].id); 
     166            propertySet[i].value = props[i].value; 
     167        } 
     168        init = 1; 
     169        return; 
     170    } 
     171    else { 
     172                for (unsigned int i = 0; i < props.length(); i++) { 
     173                    DEBUG(3, Interpolator, "Property id : " << props[i].id) 
     174 
     175                    if (strcmp(props[i].id, "DCE:e5c1d4aa-4b7f-48b7-b3bf-ed90b7653bec") == 0) { 
     176                        // InterpFactor property, sets the interpolation factor 
     177                        CORBA::UShort D; 
     178                        props[i].value >>= D; 
     179 
     180                        omni_mutex_lock l(accessPrivateData); 
     181 
     182                        M = D; 
     183 
     184                std::cout << "Property id : " << props[i].id << std::endl; 
     185                // Update value of this property in propertySet also 
     186                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     187                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     188                        propertySet[i].value = props[i].value; 
     189                        break; 
     190                    } 
    158191                } 
    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     } 
     192 
     193 
     194                        DEBUG(3, Interpolator, "Interpolation factor set to " << M) 
     195                        std::cout << std::endl << "INTERP: k = " << M << std::endl; 
     196                        isConfigured_k = true; 
     197                    } else if (strcmp(props[i].id, "DCE:9c39de73-54d4-43ad-ab9d-52f5fa526ddf") == 0) { 
     198                        // filter property, Filter coefficients 
     199                        CORBA::FloatSeq *coeff_ptr; 
     200                        props[i].value >>= coeff_ptr; 
     201 
     202                        omni_mutex_lock l(accessPrivateData); 
     203 
     204                        len_h = coeff_ptr->length(); 
     205 
     206                        if ( len_h > 1 ) { 
     207                            delete []h; 
     208                            delete i_filter; 
     209                            delete q_filter; 
     210 
     211                            h = new float[len_h]; 
     212                            DEBUG(3, Interpolator, "Interpolator filter length = " << len_h) 
     213                            for (unsigned int i = 0; i < len_h; i++) { 
     214                                h[i] = (*coeff_ptr)[i]; 
     215                                //DEBUG(4, Interpolator, "Coeff[" << i << "] = " << h[i]) 
     216                                printf("g(%d) = %f;\n", i+1, h[i]); 
     217                            } 
     218                            i_filter = new SigProc::fir_filter(h, len_h); 
     219                            q_filter = new SigProc::fir_filter(h, len_h); 
     220 
     221                        std::cout << "Property id : " << props[i].id << std::endl; 
     222                        // Update value of this property in propertySet also 
     223                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     224                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     225                                propertySet[i].value = props[i].value; 
     226                                break; 
     227                            } 
     228                        } 
     229 
     230 
     231                        } else { 
     232                            // Design filter dynamically 
     233                            createDynamicFilter = true; 
     234                        } 
     235 
     236                    } else if (strcmp(props[i].id, "DCE:e65ba870-4c11-11dc-9470-00123f63025f") == 0) { 
     237                        // pulse shape 
     238                        const char * prop_str; 
     239                        props[i].value >>= prop_str; 
     240 
     241                        // Set appropriate pulse shape 
     242                        if ( strcmp(prop_str, "rrcos") == 0 ) { 
     243                            pulseShape = "rrcos"; 
     244                            ///\todo: create function pointer for filter design 
     245                        } else { 
     246                            // unknown pulse shape 
     247                            std::cerr << "ERROR: Interpolator::configure() unknown pulse shape " 
     248                                      << prop_str << std::endl; 
     249                            throw CF::PropertySet::InvalidConfiguration(); 
     250                        } 
     251                        isConfigured_pulseShape = true; 
     252 
     253                std::cout << "Property id : " << props[i].id << std::endl; 
     254                // Update value of this property in propertySet also 
     255                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     256                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     257                        propertySet[i].value = props[i].value; 
     258                        break; 
     259                    } 
     260                } 
     261 
     262                        std::cout << std::endl << "INTERP: pulse_shape = " << pulseShape << std::endl; 
     263 
     264                    } else if (strcmp(props[i].id, "DCE:f6843fdc-4c11-11dc-b0be-00123f63025f") == 0) { 
     265                        // m : symbol delay 
     266                        CORBA::UShort simple_temp; 
     267                        props[i].value >>= simple_temp; 
     268                        m = simple_temp; 
     269                        isConfigured_m = true; 
     270 
     271                std::cout << "Property id : " << props[i].id << std::endl; 
     272                // Update value of this property in propertySet also 
     273                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     274                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     275                        propertySet[i].value = props[i].value; 
     276                        break; 
     277                    } 
     278                } 
     279 
     280                        std::cout << std::endl << "INTERP: m = " << m << std::endl; 
     281                    } else if (strcmp(props[i].id, "DCE:fed01972-4c11-11dc-8d59-00123f63025f") == 0) { 
     282                        // beta : excess bandwidth factor 
     283                        CORBA::Float simple_temp; 
     284                        props[i].value >>= simple_temp; 
     285                        beta = simple_temp; 
     286                        isConfigured_beta = true; 
     287 
     288                std::cout << "Property id : " << props[i].id << std::endl; 
     289                // Update value of this property in propertySet also 
     290                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     291                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     292                        propertySet[i].value = props[i].value; 
     293                        break; 
     294                    } 
     295                } 
     296 
     297                        std::cout << std::endl << "INTERP: beta = " << beta << std::endl; 
     298                    } else { 
     299                        std::cerr << "Interpolator: Unknown property id " << props[i].id << std::endl; 
     300                        throw CF::PropertySet::InvalidConfiguration(); 
     301                    } 
     302 
     303                } 
     304        } 
    205305 
    206306    if ( createDynamicFilter        && 
  • ossiedev/branches/0.7.x/components/Interpolator/Interpolator.h

    r8587 r9211  
    5757 
    5858    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     59         
     60        void query(CF::Properties &configProperties) 
     61        throw (CF::UnknownProperties, CORBA::SystemException); 
    5962 
    60     void configure(const CF::Properties&) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
     63        void configure(const CF::Properties&)  
     64        throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration); 
    6165 
    6266 
  • ossiedev/branches/0.7.x/components/Interpolator/Interpolator.prf.xml

    r8587 r9211  
    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/0.7.x/components/JPEG_VideoViewer/JPEG_VideoViewer.cpp

    r2915 r9211  
    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/0.7.x/components/JPEG_VideoViewer/JPEG_VideoViewer.h

    r2915 r9211  
    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/0.7.x/components/PacketResizer/PacketResizer.cpp

    r8821 r9211  
    9898} 
    9999 
     100void  
     101PacketResizer_i::query (CF::Properties & configProperties) 
     102throw (CORBA::SystemException, CF::UnknownProperties) 
     103{ 
     104    if (configProperties.length () == 0) 
     105    { 
     106        configProperties.length (propertySet.length ()); 
     107        for (unsigned int i = 0; i < propertySet.length (); i++) 
     108        { 
     109            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     110            configProperties[i].value = propertySet[i].value; 
     111        } 
     112 
     113        return ; 
     114    } 
     115    else { 
     116        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     117            for (unsigned int j=0; j < propertySet.length(); j++) { 
     118                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     119                    configProperties[i].value = propertySet[i].value; 
     120                }  
     121            } 
     122        } 
     123    } 
     124} 
     125 
    100126void PacketResizer_i::configure(const CF::Properties& props) 
    101127throw (CORBA::SystemException, 
     
    103129    CF::PropertySet::PartialConfiguration) 
    104130{ 
     131        static int init=0; 
    105132    DEBUG(3, PacketResizer, "configure() invoked") 
    106      
     133 
     134    std::cout << "Component - PACKET RESIZER" << std::endl; 
    107135    std::cout << "props length : " << props.length() << std::endl; 
    108  
    109     for (unsigned int i = 0; i <props.length(); i++) 
    110     { 
    111         std::cout << "Property id : " << props[i].id << std::endl; 
    112  
    113         if (strcmp(props[i].id, "DCE:863201ca-0505-11de-b7e0-0000e80014f9") == 0) 
    114         { 
    115             //Packet_size    
    116             CORBA::ULong simple_temp; 
    117             props[i].value >>= simple_temp; 
    118             Packet_size=simple_temp; 
    119             std::cout <<"Packet_size="<< Packet_size<<std::endl; 
    120         } 
    121         /**else {  
    122             // unknown property 
    123             std::cerr << "ERROR: PacketResizer::configure() unknown property "<< props[i].id<< std::endl; 
    124             throw CF::PropertySet::InvalidConfiguration(); 
    125         };**/ 
    126     } 
     136    if (init == 0){ 
     137        if ( props.length() <= 0 ){ 
     138            std::cout << "PacketResizer: configure called with invalid \ 
     139                          props.length() - " << props.length() << std::endl; 
     140            return; 
     141        } 
     142        std::cout << "initial configure call .." << std::endl; 
     143        propertySet.length(props.length()); 
     144        for (unsigned int i=0; i < props.length(); i++) { 
     145            std::cout << "Property Id : " << props[i].id << std::endl; 
     146            propertySet[i].id = CORBA::string_dup(props[i].id); 
     147            propertySet[i].value = props[i].value; 
     148        } 
     149        init++; 
     150        return; 
     151    } 
     152    else { 
     153        std::cout << "Normal Configure call .. " << std::endl; 
     154        std::cout << "PacketResizer_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     155 
     156                for (unsigned int i = 0; i <props.length(); i++) 
     157                { 
     158                    std::cout << "Property id : " << props[i].id << std::endl; 
     159 
     160                    if (strcmp(props[i].id, "DCE:863201ca-0505-11de-b7e0-0000e80014f9") == 0) 
     161                    { 
     162                        //Packet_size    
     163                        CORBA::ULong simple_temp; 
     164                        props[i].value >>= simple_temp; 
     165                        Packet_size=simple_temp; 
     166                        std::cout <<"Packet_size="<< Packet_size<<std::endl; 
     167                                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     168                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     169                            propertySet[i].value = props[i].value; 
     170                            break; 
     171                        } 
     172                } 
     173                    } 
     174                    /**else {  
     175                        // unknown property 
     176                        std::cerr << "ERROR: PacketResizer::configure() unknown property "<< props[i].id<< std::endl; 
     177                        throw CF::PropertySet::InvalidConfiguration(); 
     178                    };**/ 
     179                } 
     180        } 
    127181             
    128182} 
  • ossiedev/branches/0.7.x/components/PacketResizer/PacketResizer.h

    r8821 r9211  
    6767    /// 
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
     69         
     70    void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
    6972 
    7073    /// Configures properties read from .prf.xml 
  • ossiedev/branches/0.7.x/components/RxDemo/RxDemo.cpp

    r5800 r9211  
    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/0.7.x/components/RxDemo/RxDemo.h

    r5496 r9211  
    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/0.7.x/components/SymbolSyncPoly/src/FrameSynchronizer.cpp

    r8826 r9211  
    107107} 
    108108 
     109void  
     110FrameSynchronizer_i::query (CF::Properties & configProperties) 
     111throw (CORBA::SystemException, CF::UnknownProperties) 
     112{ 
     113    if (configProperties.length () == 0) 
     114    { 
     115        configProperties.length (propertySet.length ()); 
     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 
    109135void FrameSynchronizer_i::configure(const CF::Properties& props) 
    110136throw (CORBA::SystemException, 
     
    112138    CF::PropertySet::PartialConfiguration) 
    113139{ 
     140        static int init = 0; 
    114141    DEBUG(3, FrameSynchronizer, "configure() invoked") 
    115142     
    116     std::cout << "props length : " << props.length() << std::endl; 
    117  
    118     for (unsigned int i = 0; i <props.length(); i++) { 
    119         std::cout << "Property id : " << props[i].id << std::endl; 
    120  
    121         if (strcmp(props[i].id, "DCE:18576cfb-849b-4856-8b53-b3ab215df53c") == 0) { 
    122             // pulse shape 
    123             const char * prop_str; 
    124             props[i].value >>= prop_str; 
    125  
    126             // Set appropriate pulse shape 
    127             if ( strcmp(prop_str, "rrcos") == 0 ) { 
    128                 _pulseShape = "rrcos"; 
    129             } else { 
    130                 // unknown pulse shape 
    131                 std::cerr << "ERROR: FrameSynchronizer::configure() unknown pulse shape " 
    132                           << prop_str << std::endl; 
    133                 throw CF::PropertySet::InvalidConfiguration(); 
    134             } 
    135             isConfigured_pulseShape = true; 
    136  
    137         } else if (strcmp(props[i].id, "DCE:1bc8ae91-fa37-4905-aeeb-dff58870b76e") == 0) { 
    138             // k : samples per symbol 
    139             CORBA::UShort simple_temp; 
    140             props[i].value >>= simple_temp; 
    141             _k = simple_temp; 
    142             isConfigured_k = true; 
    143         } else if (strcmp(props[i].id, "DCE:a70a36df-a580-4e1e-90d6-05a1b713edd4") == 0) { 
    144             // m : symbol delay 
    145             CORBA::UShort simple_temp; 
    146             props[i].value >>= simple_temp; 
    147             _m = simple_temp; 
    148             isConfigured_m = true; 
    149         } else if (strcmp(props[i].id, "DCE:a233bee5-9696-4b37-b01e-3a910f77afe6") == 0) { 
    150             // beta : excess bandwidth factor 
    151             CORBA::Float simple_temp; 
    152             props[i].value >>= simple_temp; 
    153             _beta = simple_temp; 
    154             isConfigured_beta = true; 
    155         } else if (strcmp(props[i].id, "DCE:8b80d4ae-b108-4e6c-8755-dc10d8f46f3b") == 0) { 
    156             // Npfb : number of filters in bank 
    157             CORBA::UShort simple_temp; 
    158             props[i].value >>= simple_temp; 
    159             _Npfb = simple_temp; 
    160             isConfigured_Npfb = true; 
    161         } else if (strcmp(props[i].id, "DCE:d11bdc8d-1069-4f3a-9541-ecfcb67a1875") == 0) { 
    162             CORBA::UShort simple_temp; 
    163             props[i].value >>= simple_temp; 
    164             SetFrameSize(simple_temp,1);            
    165         } else if (strcmp(props[i].id, "DCE:0af7e693-4387-46d1-9d04-fdb1e2b83675") == 0) { 
    166             CORBA::UShort simple_temp; 
    167             props[i].value >>= simple_temp; 
    168             SetFrameSize(simple_temp,2); 
    169         } else if (strcmp(props[i].id, "DCE:12b10d48-a8b2-4e96-bf5a-e7fa96000326") == 0) { 
    170             CORBA::UShort simple_temp; 
    171             props[i].value >>= simple_temp; 
    172             SetFrameSize(simple_temp,3); 
    173         } else if (strcmp(props[i].id, "DCE:d04d7b28-bfc9-4304-9a0c-9308ecc07812") == 0) { 
    174             CORBA::UShort simple_temp; 
    175             props[i].value >>= simple_temp; 
    176             SetFrameSize(simple_temp,4); 
    177         } else if (strcmp(props[i].id, "DCE:841e7c53-9e6a-4efa-9f99-090bf1d33dd5") == 0) { 
    178             CORBA::UShort simple_temp; 
    179             props[i].value >>= simple_temp; 
    180             buffer_size=simple_temp; 
    181         } else { 
    182             // unknown property 
    183             std::cerr << "ERROR: FrameSynchronizer::configure() unknown property \"" 
    184                << props[i].id << "\"" << std::endl; 
    185             throw CF::PropertySet::InvalidConfiguration(); 
    186         } 
     143    std::cout << "Component - FRAME SYNCHRONIZER" << std::endl; 
     144    std::cout << "Props length = " << props.length() << std::endl; 
     145 
     146    if (init == 0){ 
     147        if ( props.length() <= 0 ){ 
     148            std::cout << "FrameSynchronizer: configure called with invalid \ 
     149                          props.length() - " << props.length() << std::endl; 
     150            return; 
     151        } 
     152        std::cout << "initial configure call .." << std::endl; 
     153        propertySet.length(props.length()); 
     154        for (unsigned int i=0; i < props.length(); i++) { 
     155            std::cout << "Property Id : " << props[i].id << std::endl; 
     156            propertySet[i].id = CORBA::string_dup(props[i].id); 
     157            propertySet[i].value = props[i].value; 
     158        } 
     159        init++; 
     160        return; 
    187161    } 
    188  
     162    else { 
     163        std::cout << "Normal Configure call .. " << std::endl; 
     164        std::cout << "FrameSynchronizer_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     165 
     166                for (unsigned int i = 0; i <props.length(); i++) { 
     167                    std::cout << "Property id : " << props[i].id << std::endl; 
     168 
     169                    if (strcmp(props[i].id, "DCE:18576cfb-849b-4856-8b53-b3ab215df53c") == 0) { 
     170                        // pulse shape 
     171                        const char * prop_str; 
     172                        props[i].value >>= prop_str; 
     173 
     174                        // Set appropriate pulse shape 
     175                        if ( strcmp(prop_str, "rrcos") == 0 ) { 
     176                            _pulseShape = "rrcos"; 
     177                                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     178                                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     179                                            propertySet[i].value = props[i].value; 
     180                                            break; 
     181                                        } 
     182                                    } 
     183                        } else { 
     184                            // unknown pulse shape 
     185                            std::cerr << "ERROR: FrameSynchronizer::configure() unknown pulse shape " 
     186                                      << prop_str << std::endl; 
     187                            throw CF::PropertySet::InvalidConfiguration(); 
     188                        } 
     189                        isConfigured_pulseShape = true; 
     190 
     191                    } else if (strcmp(props[i].id, "DCE:1bc8ae91-fa37-4905-aeeb-dff58870b76e") == 0) { 
     192                        // k : samples per symbol 
     193                        CORBA::UShort simple_temp; 
     194                        props[i].value >>= simple_temp; 
     195                        _k = simple_temp; 
     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                        isConfigured_k = true; 
     203                    } else if (strcmp(props[i].id, "DCE:a70a36df-a580-4e1e-90d6-05a1b713edd4") == 0) { 
     204                        // m : symbol delay 
     205                        CORBA::UShort simple_temp; 
     206                        props[i].value >>= simple_temp; 
     207                        _m = simple_temp; 
     208                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     209                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     210                                propertySet[i].value = props[i].value; 
     211                                break; 
     212                            } 
     213                        } 
     214                        isConfigured_m = true; 
     215                    } else if (strcmp(props[i].id, "DCE:a233bee5-9696-4b37-b01e-3a910f77afe6") == 0) { 
     216                        // beta : excess bandwidth factor 
     217                        CORBA::Float simple_temp; 
     218                        props[i].value >>= simple_temp; 
     219                        _beta = simple_temp; 
     220                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     221                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     222                                propertySet[i].value = props[i].value; 
     223                                break; 
     224                            } 
     225                        } 
     226                        isConfigured_beta = true; 
     227                    } else if (strcmp(props[i].id, "DCE:8b80d4ae-b108-4e6c-8755-dc10d8f46f3b") == 0) { 
     228                        // Npfb : number of filters in bank 
     229                        CORBA::UShort simple_temp; 
     230                        props[i].value >>= simple_temp; 
     231                        _Npfb = simple_temp; 
     232                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     233                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     234                                propertySet[i].value = props[i].value; 
     235                                break; 
     236                            } 
     237                        } 
     238                        isConfigured_Npfb = true; 
     239                    } else if (strcmp(props[i].id, "DCE:d11bdc8d-1069-4f3a-9541-ecfcb67a1875") == 0) { 
     240                        CORBA::UShort simple_temp; 
     241                        props[i].value >>= simple_temp; 
     242                        SetFrameSize(simple_temp,1);            
     243                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     244                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     245                                propertySet[i].value = props[i].value; 
     246                                break; 
     247                            } 
     248                        } 
     249                    } else if (strcmp(props[i].id, "DCE:0af7e693-4387-46d1-9d04-fdb1e2b83675") == 0) { 
     250                        CORBA::UShort simple_temp; 
     251                        props[i].value >>= simple_temp; 
     252                        SetFrameSize(simple_temp,2); 
     253                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     254                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     255                                propertySet[i].value = props[i].value; 
     256                                break; 
     257                            } 
     258                        } 
     259                    } else if (strcmp(props[i].id, "DCE:12b10d48-a8b2-4e96-bf5a-e7fa96000326") == 0) { 
     260                        CORBA::UShort simple_temp; 
     261                        props[i].value >>= simple_temp; 
     262                        SetFrameSize(simple_temp,3); 
     263                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     264                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     265                                propertySet[i].value = props[i].value; 
     266                                break; 
     267                            } 
     268                        } 
     269                    } else if (strcmp(props[i].id, "DCE:d04d7b28-bfc9-4304-9a0c-9308ecc07812") == 0) { 
     270                        CORBA::UShort simple_temp; 
     271                        props[i].value >>= simple_temp; 
     272                        SetFrameSize(simple_temp,4); 
     273                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     274                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     275                                propertySet[i].value = props[i].value; 
     276                                break; 
     277                            } 
     278                        } 
     279                    } else if (strcmp(props[i].id, "DCE:841e7c53-9e6a-4efa-9f99-090bf1d33dd5") == 0) { 
     280                        CORBA::UShort simple_temp; 
     281                        props[i].value >>= simple_temp; 
     282                        buffer_size=simple_temp; 
     283                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     284                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     285                                propertySet[i].value = props[i].value; 
     286                                break; 
     287                            } 
     288                        } 
     289                    } else { 
     290                        // unknown property 
     291                        std::cerr << "ERROR: FrameSynchronizer::configure() unknown property \"" 
     292                           << props[i].id << "\"" << std::endl; 
     293                        throw CF::PropertySet::InvalidConfiguration(); 
     294                    } 
     295                } 
     296        } 
    189297    // Once all properties have been configured, create the filter bank 
    190298    if ( isConfigured_pulseShape    && 
  • ossiedev/branches/0.7.x/components/SymbolSyncPoly/src/FrameSynchronizer.h

    r8837 r9211  
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    6969 
     70        void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
     72 
    7073    /// Configures properties read from .prf.xml 
    7174    ///   - \ref prop_pulse_shape 
  • ossiedev/branches/0.7.x/components/SymbolSyncPoly/src/MultirateSynchronizer.cpp

    r8837 r9211  
    108108} 
    109109 
     110void  
     111MultirateSynchronizer_i::query (CF::Properties & configProperties) 
     112throw (CORBA::SystemException, CF::UnknownProperties) 
     113{ 
     114    if (configProperties.length () == 0) 
     115    { 
     116        configProperties.length (propertySet.length ()); 
     117        for (unsigned int i = 0; i < propertySet.length (); i++) 
     118        { 
     119            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     120            configProperties[i].value = propertySet[i].value; 
     121        } 
     122 
     123        return ; 
     124    } 
     125    else { 
     126        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     127            for (unsigned int j=0; j < propertySet.length(); j++) { 
     128                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     129                    configProperties[i].value = propertySet[i].value; 
     130                }  
     131            } 
     132        } 
     133    } 
     134} 
     135 
    110136void MultirateSynchronizer_i::configure(const CF::Properties& props) 
    111137throw (CORBA::SystemException, 
     
    113139    CF::PropertySet::PartialConfiguration) 
    114140{ 
     141        static int init=0; 
    115142    DEBUG(3, MultirateSynchronizer, "configure() invoked") 
    116143     
    117     std::cout << "props length : " << props.length() << std::endl; 
    118  
    119     for (unsigned int i = 0; i <props.length(); i++) { 
    120         std::cout << "Property id : " << props[i].id << std::endl; 
    121  
    122         if (strcmp(props[i].id, "DCE:c104305d-27ee-44d8-ab29-8672e5ccb205") == 0) { 
    123             // pulse shape 
    124             const char * prop_str; 
    125             props[i].value >>= prop_str; 
    126  
    127             // Set appropriate pulse shape 
    128             if ( strcmp(prop_str, "rrcos") == 0 ) { 
    129                 _pulseShape = "rrcos"; 
    130             } else { 
    131                 // unknown pulse shape 
    132                 std::cerr << "ERROR: MultirateSynchronizer::configure() unknown pulse shape " 
    133                           << prop_str << std::endl; 
    134                 throw CF::PropertySet::InvalidConfiguration(); 
    135             } 
    136             isConfigured_pulseShape = true; 
    137  
    138         } else if (strcmp(props[i].id, "DCE:ba19e325-46d0-48ec-9620-cedb38e3d822") == 0) { 
    139             // k : samples per symbol 
    140             CORBA::UShort simple_temp; 
    141             props[i].value >>= simple_temp; 
    142             _k = simple_temp; 
    143             isConfigured_k = true; 
    144         } else if (strcmp(props[i].id, "DCE:93c150e6-8bbd-4976-98a7-372254fd739f") == 0) { 
    145             // m : symbol delay 
    146             CORBA::UShort simple_temp; 
    147             props[i].value >>= simple_temp; 
    148             _m = simple_temp; 
    149             isConfigured_m = true; 
    150         } else if (strcmp(props[i].id, "DCE:73c150e6-8bbd-4976-98a7-372254fd739f") == 0) { 
    151             // beta : excess bandwidth factor 
    152             CORBA::Float simple_temp; 
    153             props[i].value >>= simple_temp; 
    154             _beta = simple_temp; 
    155             isConfigured_beta = true; 
    156         } else if (strcmp(props[i].id, "DCE:6dbe74a9-279d-4c70-9eed-47e27c98857f") == 0) { 
    157             // Npfb : number of filters in bank 
    158             CORBA::UShort simple_temp; 
    159             props[i].value >>= simple_temp; 
    160             _Npfb = simple_temp; 
    161             isConfigured_Npfb = true; 
    162         } else if (strcmp(props[i].id, "DCE:512cb885-789b-42cd-a5bb-c8ac53752269") == 0) { 
    163             // mod_scheme 
    164             const char * prop_str; 
    165             props[i].value >>= prop_str; 
    166  
    167             // Set appropriate modulation function 
    168             if ( strcmp(prop_str, "bpsk") == 0 ) { 
    169                 SetModulationScheme(SigProc::BPSK); 
    170             } else if ( strcmp(prop_str, "qpsk") == 0 ) { 
    171                 SetModulationScheme(SigProc::QPSK); 
    172             } else if ( strcmp(prop_str, "8psk") == 0 ) { 
    173                 SetModulationScheme(SigProc::PSK8); 
    174             } else if ( strcmp(prop_str, "16qam") == 0 ) { 
    175                 SetModulationScheme(SigProc::QAM16); 
    176             } else if ( strcmp(prop_str, "4pam") == 0 ) { 
    177                 SetModulationScheme(SigProc::PAM4); 
    178             } else { 
    179                 // unknown property 
    180                 std::cerr << "ERROR: MultirateSynchronizer::configure() unknown mod. scheme \"" 
    181                           << prop_str << "\"" << std::endl; 
    182                 throw CF::PropertySet::InvalidConfiguration(); 
    183             } 
    184  
    185             isConfigured_mod_scheme = true; 
    186         } else { 
    187             // unknown property 
    188             std::cerr << "ERROR: MultirateSynchronizer::configure() unknown property \"" 
    189                << props[i].id << "\"" << std::endl; 
    190             throw CF::PropertySet::InvalidConfiguration(); 
    191         } 
    192     } 
    193  
     144    std::cout << "Component - MULTIRATE SYNCHRONIZER" << std::endl; 
     145    std::cout << "Props length = " << props.length() << std::endl; 
     146 
     147    if (init == 0){ 
     148        if ( props.length() <= 0 ){ 
     149            std::cout << "Multirate Synchronizer: configure called with invalid \ 
     150                          props.length() - " << props.length() << std::endl; 
     151            return; 
     152        } 
     153        std::cout << "initial configure call .." << std::endl; 
     154        propertySet.length(props.length()); 
     155        for (unsigned int i=0; i < props.length(); i++) { 
     156            std::cout << "Property Id : " << props[i].id << std::endl; 
     157            propertySet[i].id = CORBA::string_dup(props[i].id); 
     158            propertySet[i].value = props[i].value; 
     159        } 
     160        init++; 
     161        return; 
     162    } 
     163    else { 
     164        std::cout << "Normal Configure call .. " << std::endl; 
     165        std::cout << "SymbolSyncPoly_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     166                for (unsigned int i = 0; i <props.length(); i++) { 
     167                    std::cout << "Property id : " << props[i].id << std::endl; 
     168 
     169                    if (strcmp(props[i].id, "DCE:c104305d-27ee-44d8-ab29-8672e5ccb205") == 0) { 
     170                        // pulse shape 
     171                        const char * prop_str; 
     172                        props[i].value >>= prop_str; 
     173 
     174                        // Set appropriate pulse shape 
     175                        if ( strcmp(prop_str, "rrcos") == 0 ) { 
     176                            _pulseShape = "rrcos"; 
     177                                    for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     178                                        if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     179                                            propertySet[i].value = props[i].value; 
     180                                            break; 
     181                                        } 
     182                                    } 
     183 
     184                        } else { 
     185                            // unknown pulse shape 
     186                            std::cerr << "ERROR: MultirateSynchronizer::configure() unknown pulse shape " 
     187                                      << prop_str << std::endl; 
     188                            throw CF::PropertySet::InvalidConfiguration(); 
     189                        } 
     190                        isConfigured_pulseShape = true; 
     191 
     192                    } else if (strcmp(props[i].id, "DCE:ba19e325-46d0-48ec-9620-cedb38e3d822") == 0) { 
     193                        // k : samples per symbol 
     194                        CORBA::UShort simple_temp; 
     195                        props[i].value >>= simple_temp; 
     196                        _k = simple_temp; 
     197                        isConfigured_k = true; 
     198                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     199                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     200                                propertySet[i].value = props[i].value; 
     201                                break; 
     202                            } 
     203                        } 
     204                    } else if (strcmp(props[i].id, "DCE:93c150e6-8bbd-4976-98a7-372254fd739f") == 0) { 
     205                        // m : symbol delay 
     206                        CORBA::UShort simple_temp; 
     207                        props[i].value >>= simple_temp; 
     208                        _m = simple_temp; 
     209                        isConfigured_m = true; 
     210                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     211                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     212                                propertySet[i].value = props[i].value; 
     213                                break; 
     214                            } 
     215                        } 
     216                    } else if (strcmp(props[i].id, "DCE:73c150e6-8bbd-4976-98a7-372254fd739f") == 0) { 
     217                        // beta : excess bandwidth factor 
     218                        CORBA::Float simple_temp; 
     219                        props[i].value >>= simple_temp; 
     220                        _beta = simple_temp; 
     221                        isConfigured_beta = true; 
     222                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     223                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     224                                propertySet[i].value = props[i].value; 
     225                                break; 
     226                            } 
     227                        } 
     228                    } else if (strcmp(props[i].id, "DCE:6dbe74a9-279d-4c70-9eed-47e27c98857f") == 0) { 
     229                        // Npfb : number of filters in bank 
     230                        CORBA::UShort simple_temp; 
     231                        props[i].value >>= simple_temp; 
     232                        _Npfb = simple_temp; 
     233                        isConfigured_Npfb = true; 
     234                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     235                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     236                                propertySet[i].value = props[i].value; 
     237                                break; 
     238                            } 
     239                        } 
     240                    } else if (strcmp(props[i].id, "DCE:512cb885-789b-42cd-a5bb-c8ac53752269") == 0) { 
     241                        // mod_scheme 
     242                        const char * prop_str; 
     243                        props[i].value >>= prop_str; 
     244 
     245                        // Set appropriate modulation function 
     246                        if ( strcmp(prop_str, "bpsk") == 0 ) { 
     247                            SetModulationScheme(SigProc::BPSK); 
     248                        } else if ( strcmp(prop_str, "qpsk") == 0 ) { 
     249                            SetModulationScheme(SigProc::QPSK); 
     250                        } else if ( strcmp(prop_str, "8psk") == 0 ) { 
     251                            SetModulationScheme(SigProc::PSK8); 
     252                        } else if ( strcmp(prop_str, "16qam") == 0 ) { 
     253                            SetModulationScheme(SigProc::QAM16); 
     254                        } else if ( strcmp(prop_str, "4pam") == 0 ) { 
     255                            SetModulationScheme(SigProc::PAM4); 
     256                        } else { 
     257                            // unknown property 
     258                            std::cerr << "ERROR: MultirateSynchronizer::configure() unknown mod. scheme \"" 
     259                                      << prop_str << "\"" << std::endl; 
     260                            throw CF::PropertySet::InvalidConfiguration(); 
     261                        } 
     262                        isConfigured_mod_scheme = true; 
     263                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     264                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     265                                propertySet[i].value = props[i].value; 
     266                                break; 
     267                            } 
     268                        } 
     269                    } else { 
     270                        // unknown property 
     271                        std::cerr << "ERROR: MultirateSynchronizer::configure() unknown property \"" 
     272                           << props[i].id << "\"" << std::endl; 
     273                        throw CF::PropertySet::InvalidConfiguration(); 
     274                    } 
     275                } 
     276        } 
    194277    // Once all properties have been configured, create the filter bank 
    195278    if ( isConfigured_pulseShape    && 
  • ossiedev/branches/0.7.x/components/SymbolSyncPoly/src/MultirateSynchronizer.h

    r8837 r9211  
    6868    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    6969 
     70        void query(CF::Properties &configProperties) 
     71        throw (CF::UnknownProperties, CORBA::SystemException); 
     72 
    7073    /// Configures properties read from .prf.xml 
    7174    ///   - \ref prop_pulse_shape 
  • ossiedev/branches/0.7.x/components/SymbolSyncPoly/src/SymbolSyncPoly.cpp

    r8837 r9211  
    109109} 
    110110 
     111void  
     112SymbolSyncPoly_i::query (CF::Properties & configProperties) 
     113throw (CORBA::SystemException, CF::UnknownProperties) 
     114{ 
     115    if (configProperties.length () == 0) 
     116    { 
     117        configProperties.length (propertySet.length ()); 
     118        for (unsigned int i = 0; i < propertySet.length (); i++) 
     119        { 
     120            configProperties[i].id = CORBA::string_dup (propertySet[i].id); 
     121            configProperties[i].value = propertySet[i].value; 
     122        } 
     123 
     124        return ; 
     125    } 
     126    else { 
     127        for (unsigned int i = 0; i < configProperties.length(); i++) { 
     128            for (unsigned int j=0; j < propertySet.length(); j++) { 
     129                if ( strcmp(configProperties[i].id, propertySet[i].id) == 0 ){ 
     130                    configProperties[i].value = propertySet[i].value; 
     131                }  
     132            } 
     133        } 
     134    } 
     135} 
     136 
    111137void SymbolSyncPoly_i::configure(const CF::Properties& props) 
    112138throw (CORBA::SystemException, 
     
    114140    CF::PropertySet::PartialConfiguration) 
    115141{ 
     142        static int init = 0; 
    116143    DEBUG(3, SymbolSyncPoly, "configure() invoked") 
    117144     
    118     std::cout << "props length : " << props.length() << std::endl; 
    119  
    120     for (unsigned int i = 0; i <props.length(); i++) { 
    121         std::cout << "Property id : " << props[i].id << std::endl; 
    122  
    123         if (strcmp(props[i].id, "DCE:0bb52b63-3a66-4aa6-afa9-d0417318c001") == 0) { 
    124             // pulse shape 
    125             const char * prop_str; 
    126             props[i].value >>= prop_str; 
    127  
    128             // Set appropriate pulse shape 
    129             if ( strcmp(prop_str, "rrcos") == 0 ) { 
    130                 _pulseShape = "rrcos"; 
    131             } else { 
    132                 // unknown pulse shape 
    133                 std::cerr << "ERROR: SymbolSyncPoly::configure() unknown pulse shape " 
    134                           << prop_str << std::endl; 
    135                 throw CF::PropertySet::InvalidConfiguration(); 
    136             } 
    137             isConfigured_pulseShape = true; 
    138              
    139         } else if (strcmp(props[i].id, "DCE:c6f2eba5-e69f-4397-a75d-ae0450a7699b") == 0) { 
    140             // k : samples per symbol 
    141             CORBA::UShort simple_temp; 
    142             props[i].value >>= simple_temp; 
    143             _k = simple_temp; 
    144             isConfigured_k = true; 
    145         } else if (strcmp(props[i].id, "DCE:08f16d2d-f69d-48eb-a558-3e93b2e481d1") == 0) { 
    146             // m : symbol delay 
    147             CORBA::UShort simple_temp; 
    148             props[i].value >>= simple_temp; 
    149             _m = simple_temp; 
    150             isConfigured_m = true; 
    151         } else if (strcmp(props[i].id, "DCE:abe26dd4-ca5d-40ff-8141-093b56ddce16") == 0) { 
    152             // beta : excess bandwidth factor 
    153             CORBA::Float simple_temp; 
    154             props[i].value >>= simple_temp; 
    155             _beta = simple_temp; 
    156             isConfigured_beta = true; 
    157         } else if (strcmp(props[i].id, "DCE:d8f0cbea-a3ba-416f-ada3-16e960938544") == 0) { 
    158             // Npfb : number of filters in bank 
    159             CORBA::UShort simple_temp; 
    160             props[i].value >>= simple_temp; 
    161             _Npfb = simple_temp; 
    162             isConfigured_Npfb = true; 
    163         } else { 
    164             // unknown property 
    165             std::cerr << "ERROR: SymbolSyncPoly::configure() unknown property \"" 
    166                << props[i].id << "\"" << std::endl; 
    167             throw CF::PropertySet::InvalidConfiguration(); 
    168         } 
    169     } 
    170  
     145    std::cout << "Component - SYMBOL SYNC POLY" << std::endl; 
     146    std::cout << "Props length = " << props.length() << std::endl; 
     147 
     148    if (init == 0){ 
     149        if ( props.length() <= 0 ){ 
     150            std::cout << "SymbolSyncPoly: configure called with invalid \ 
     151                          props.length() - " << props.length() << std::endl; 
     152            return; 
     153        } 
     154        std::cout << "initial configure call .." << std::endl; 
     155        propertySet.length(props.length()); 
     156        for (unsigned int i=0; i < props.length(); i++) { 
     157            std::cout << "Property Id : " << props[i].id << std::endl; 
     158            propertySet[i].id = CORBA::string_dup(props[i].id); 
     159            propertySet[i].value = props[i].value; 
     160        } 
     161        init++; 
     162        return; 
     163    } 
     164    else { 
     165        std::cout << "Normal Configure call .. " << std::endl; 
     166        std::cout << "SymbolSyncPoly_i::configure set propertySet.length " << propertySet.length() << std::endl; 
     167 
     168                for (unsigned int i = 0; i <props.length(); i++) { 
     169                    std::cout << "Property id : " << props[i].id << std::endl; 
     170 
     171                    if (strcmp(props[i].id, "DCE:0bb52b63-3a66-4aa6-afa9-d0417318c001") == 0) { 
     172                        // pulse shape 
     173                        const char * prop_str; 
     174                        props[i].value >>= prop_str; 
     175 
     176                        // Set appropriate pulse shape 
     177                        if ( strcmp(prop_str, "rrcos") == 0 ) { 
     178                            _pulseShape = "rrcos"; 
     179                        } else { 
     180                            // unknown pulse shape 
     181                            std::cerr << "ERROR: SymbolSyncPoly::configure() unknown pulse shape " 
     182                                      << prop_str << std::endl; 
     183                            throw CF::PropertySet::InvalidConfiguration(); 
     184                        } 
     185                        isConfigured_pulseShape = true; 
     186                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     187                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     188                                propertySet[i].value = props[i].value; 
     189                                break; 
     190                            } 
     191                        } 
     192                         
     193                    } else if (strcmp(props[i].id, "DCE:c6f2eba5-e69f-4397-a75d-ae0450a7699b") == 0) { 
     194                        // k : samples per symbol 
     195                        CORBA::UShort simple_temp; 
     196                        props[i].value >>= simple_temp; 
     197                        _k = simple_temp; 
     198                        isConfigured_k = true; 
     199                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     200                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     201                                propertySet[i].value = props[i].value; 
     202                                break; 
     203                            } 
     204                        } 
     205                    } else if (strcmp(props[i].id, "DCE:08f16d2d-f69d-48eb-a558-3e93b2e481d1") == 0) { 
     206                        // m : symbol delay 
     207                        CORBA::UShort simple_temp; 
     208                        props[i].value >>= simple_temp; 
     209                        _m = simple_temp; 
     210                        isConfigured_m = true; 
     211                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     212                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     213                                propertySet[i].value = props[i].value; 
     214                                break; 
     215                            } 
     216                        } 
     217                    } else if (strcmp(props[i].id, "DCE:abe26dd4-ca5d-40ff-8141-093b56ddce16") == 0) { 
     218                        // beta : excess bandwidth factor 
     219                        CORBA::Float simple_temp; 
     220                        props[i].value >>= simple_temp; 
     221                        _beta = simple_temp; 
     222                        isConfigured_beta = true; 
     223                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     224                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     225                                propertySet[i].value = props[i].value; 
     226                                break; 
     227                            } 
     228                        } 
     229                    } else if (strcmp(props[i].id, "DCE:d8f0cbea-a3ba-416f-ada3-16e960938544") == 0) { 
     230                        // Npfb : number of filters in bank 
     231                        CORBA::UShort simple_temp; 
     232                        props[i].value >>= simple_temp; 
     233                        _Npfb = simple_temp; 
     234                        isConfigured_Npfb = true; 
     235                        for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     236                            if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     237                                propertySet[i].value = props[i].value; 
     238                                break; 
     239                            } 
     240                        } 
     241                    } else { 
     242                        // unknown property 
     243                        std::cerr << "ERROR: SymbolSyncPoly::configure() unknown property \"" 
     244                           << props[i].id << "\"" << std::endl; 
     245                        throw CF::PropertySet::InvalidConfiguration(); 
     246                    } 
     247                } 
     248        } 
    171249    // Once all properties have been configured, create the filter bank 
    172250    if ( isConfigured_pulseShape    && 
  • ossiedev/branches/0.7.x/components/SymbolSyncPoly/src/SymbolSyncPoly.h

    r8837 r9211  
    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    ///   - \ref prop_pulse_shape 
  • ossiedev/branches/0.7.x/components/SymbolSyncPoly/src/SymbolSyncPolyDSP.cpp

    r9167 r9211  
    2424#include <iostream> 
    2525#include "SymbolSyncPolyDSP.h" 
    26 #include <string.h> 
     26#include <cstring> 
    2727#include <math.h> 
    2828 
  • ossiedev/branches/0.7.x/components/TxDemo/TxDemo.cpp

    r8629 r9211  
    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 - TX DEMO" << std::endl; 
     138    std::cout << " Props length = " << props.length() << std::endl; 
     139    if (init == 0){ 
     140        std::cout << " TxDemo - initial configure call .." << std::endl; 
     141        if ( props.length() <= 0 ){ 
     142            std::cout << "TxDemo: configure called with invalid \ 
     143                          props.length() - " << props.length() << std::endl; 
     144        return; 
     145                                            } 
     146        propertySet.length(props.length()); 
     147        for (unsigned int i=0; i < props.length(); i++) { 
     148            std::cout << "Property Id : " << props[i].id << std::endl; 
     149            propertySet[i].id = CORBA::string_dup(props[i].id); 
     150            propertySet[i].value = props[i].value; 
    117151        } 
    118  
    119     } 
     152        init = 1; 
     153        return; 
     154    } 
     155    else { 
     156        std::cout << "Normal configure call ... " << std::endl; 
     157                for (unsigned int i = 0; i <props.length(); i++) { 
     158                    if (strcmp(props[i].id, "DCE:1b9ca208-8242-11dc-9ba3-00123f63025f") == 0) { 
     159                        // packet_delay_ms 
     160                        CORBA::Short simple_temp; 
     161                        props[i].value >>= simple_temp; 
     162                        packet_delay = simple_temp; 
     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        } 
    120176} 
    121177 
  • ossiedev/branches/0.7.x/components/TxDemo/TxDemo.h

    r8629 r9211  
    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/0.7.x/components/USRP_Commander/src/USRP_Commander.cpp

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

    r4536 r9211  
    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/0.7.x/components/WFMDemod/WFMDemod.cpp

    r6579 r9211  
    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/0.7.x/components/WFMDemod/WFMDemod.h

    r6579 r9211  
    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/0.7.x/components/WebCamCapture/WebCamCapture.cpp

    r2915 r9211  
    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        if ( props.length() <= 0 ){ 
     412            std::cout << "WebcamCapture: configure called with invalid \ 
     413                         props.length() - " << props.length() << std::endl; 
     414            return; 
    389415        } 
    390  
     416        propertySet.length(props.length()); 
     417        for (unsigned int i=0; i < props.length(); i++) { 
     418            std::cout << "Property Id : " << props[i].id << std::endl; 
     419            propertySet[i].id = CORBA::string_dup(props[i].id); 
     420            propertySet[i].value = props[i].value; 
     421        } 
     422        init = 1; 
     423        return; 
    391424    } 
     425    else { 
     426 
     427 
     428                for (unsigned int i = 0; i <props.length(); i++) 
     429                { 
     430                    std::cout << "Property id : " << props[i].id << std::endl; 
     431 
     432                    if (strcmp(props[i].id, "DCE:3dd2928a-c369-11db-8bd5-000129227a88") == 0) 
     433                    { 
     434                        CORBA::Short n; 
     435                        props[i].value >>= n; 
     436                        quality = n; 
     437                        std::cout << "WebCam: Quality (1 - 5): " << quality << std::endl; 
     438                        spcaSetQuality(fd, &videoparam, (unsigned char)quality); 
     439                                 
     440                                 
     441                std::cout << "Property id : " << props[i].id << std::endl; 
     442                // Update value of this property in propertySet also 
     443                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     444                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     445                        propertySet[i].value = props[i].value; 
     446                        break; 
     447                    } 
     448                } 
     449 
     450                    } 
     451 
     452                } 
     453        } 
    392454} 
    393455 
  • ossiedev/branches/0.7.x/components/WebCamCapture/WebCamCapture.h

    r2915 r9211  
    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/0.7.x/components/am_demod/am_demod.cpp

    r1987 r9211  
    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/0.7.x/components/am_demod/am_demod.h

    r1896 r9211  
    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/0.7.x/components/amplifier/amplifier.cpp

    r2252 r9211  
    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{ 
    89     std::cout << "configure called on amplifier" << std::endl; 
    90      
    91     std::cout << "props length : " << props.length() << std::endl; 
    92  
    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; 
    102         } 
    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     } 
     116        static int init = 0; 
     117 
     118    std::cout << "Component -AMPLIFIER" << std::endl; 
     119    std::cout << " Props length = " << props.length() << std::endl; 
     120 
     121    if (init == 0){ 
     122        if ( props.length() <= 0 ){ 
     123           std::cout << "amplifier: configure called with invalid \ 
     124                       props.length() - " << props.length() << std::endl; 
     125           return; 
     126        } 
     127        std::cout << " amplifier - initial configure call .." << std::endl; 
     128        propertySet.length(props.length()); 
     129        for (unsigned int i=0; i < props.length(); i++) { 
     130            std::cout << "Property Id : " << props[i].id << std::endl; 
     131            propertySet[i].id = CORBA::string_dup(props[i].id); 
     132            propertySet[i].value = props[i].value; 
     133        } 
     134        init = 1; 
     135        return; 
     136    } 
     137    else { 
     138        std::cout<<"Normal configure call ...  " <<std::endl; 
     139 
     140                for (unsigned int i = 0; i <props.length(); i++) 
     141                { 
     142                    std::cout << "Property id : " << props[i].id << std::endl; 
     143 
     144                    if (strcmp(props[i].id, "DCE:06b88d4f-dd38-44e6-bc49-82db0eba5bc6") == 0) 
     145                    { 
     146                        CORBA::Float simple_temp; 
     147                        props[i].value >>= simple_temp; 
     148                        simple_0_value = simple_temp; 
     149 
     150                std::cout << "Property id : " << props[i].id << std::endl; 
     151                // Update value of this property in propertySet also 
     152                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     153                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     154                        propertySet[i].value = props[i].value; 
     155                        break; 
     156                    } 
     157                } 
     158                                 
     159                    } 
     160 
     161                    if (strcmp(props[i].id, "DCE:df91b1a8-9c83-44b4-bf2c-0dbeacb2b6f4") == 0) 
     162                    { 
     163                        CORBA::Float simple_temp; 
     164                        props[i].value >>= simple_temp; 
     165                        simple_1_value = simple_temp; 
     166 
     167                std::cout << "Property id : " << props[i].id << std::endl; 
     168                // Update value of this property in propertySet also 
     169                for (unsigned int j=0; j < propertySet.length(); j++ ) { 
     170                    if ( strcmp(propertySet[j].id, props[i].id) == 0 ) { 
     171                        propertySet[i].value = props[i].value; 
     172                        break; 
     173                    } 
     174                } 
     175 
     176                    } 
     177 
     178                } 
     179        } 
    112180} 
    113181 
  • ossiedev/branches/0.7.x/components/amplifier/amplifier.h

    r2252 r9211  
    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 
  • ossiedev/branches/0.7.x/tools/setup.py

    r8729 r9211  
    1111wavedev_packages=['WaveDev', 'WaveDev/wavedev', 'WaveDev/wavedev/XML_gen'] + generate 
    1212alf_plugins=['alf_plugins', 'alf_plugins/AWG', 'alf_plugins/plot', 'alf_plugins/speaker', 'alf_plugins/write_to_file'] 
     13wavdash_pkgs=['wavedash', 'wavedash/src'] 
    1314 
    1415# ALF Files 
     
    3031py_comp_files=['README'] 
    3132 
     33# WaveDash Files 
     34wavdash_files=['src/resources/*'] 
     35 
    3236setup( 
    3337      name='ossietools',  
    34       version='0.7.1', 
     38      version='0.7.0', 
    3539      description='ossietools', 
    36       packages=wavedev_packages + ['alf'] + alf_plugins, 
     40      packages=wavedev_packages + ['alf'] + alf_plugins + wavdash_pkgs, 
    3741      package_data={ 
    3842          'WaveDev' : WaveDev_files, \ 
     
    4751          'alf_plugins/speaker' : speaker_files, \ 
    4852          'alf_plugins/plot' : plot_files, \ 
    49           'alf_plugins/write_to_file' : write_to_file_files }, 
    50       scripts=['ALF', 'OWD', 'OWDC'], 
     53          'alf_plugins/write_to_file' : write_to_file_files, \ 
     54          'wavedash' : wavdash_files }, 
     55      scripts=['ALF', 'OWD', 'OWDC', 'WAVEDASH'], 
    5156     )