Changeset 8028
- Timestamp:
- 07/10/08 16:11:09 (5 years ago)
- Location:
- ossiedev/trunk/components/AutomaticGainControl-metadata
- Files:
-
- 8 modified
-
Makefile.am (modified) (1 diff)
-
configure.ac (modified) (1 diff)
-
documentation.txt (modified) (2 diffs)
-
src/AutomaticGainControl_metadata.cpp (modified) (15 diffs)
-
src/AutomaticGainControl_metadata.h (modified) (5 diffs)
-
src/main.cpp (modified) (4 diffs)
-
xml/AutomaticGainControl_metadata.prf.xml (modified) (1 diff)
-
xml/AutomaticGainControl_metadata.spd.xml (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/trunk/components/AutomaticGainControl-metadata/Makefile.am
r4936 r8028 1 1 AM_CXXFLAGS = -Wall 2 2 3 bin_PROGRAMS = AutomaticGainControl 3 bin_PROGRAMS = AutomaticGainControl_metadata 4 4 5 AutomaticGainControl_ SOURCES = \6 src/AutomaticGainControl .cpp \7 src/AutomaticGainControl .h \5 AutomaticGainControl_metadata_SOURCES = \ 6 src/AutomaticGainControl_metadata.cpp \ 7 src/AutomaticGainControl_metadata.h \ 8 8 src/main.cpp 9 9 10 ossieName = AutomaticGainControl 10 ossieName = AutomaticGainControl_metadata 11 11 xmldir = $(prefix)/xml/$(ossieName) 12 12 bindir = $(prefix)/bin 13 13 14 14 dist_xml_DATA = \ 15 xml/AutomaticGainControl .prf.xml \16 xml/AutomaticGainControl .scd.xml \17 xml/AutomaticGainControl .spd.xml15 xml/AutomaticGainControl_metadata.prf.xml \ 16 xml/AutomaticGainControl_metadata.scd.xml \ 17 xml/AutomaticGainControl_metadata.spd.xml 18 18 19 19 # ---------- documentation --------- -
ossiedev/trunk/components/AutomaticGainControl-metadata/configure.ac
r4668 r8028 1 AC_INIT(AutomaticGainControl , 0.6.0)1 AC_INIT(AutomaticGainControl_metadata, 0.6.0) 2 2 AM_INIT_AUTOMAKE 3 3 -
ossiedev/trunk/components/AutomaticGainControl-metadata/documentation.txt
r4668 r8028 3 3 Copyright 2006 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE AutomaticGainControl .5 This file is part of the OSSIE AutomaticGainControl_metadata. 6 6 7 OSSIE AutomaticGainControl is free software; you can redistribute it and/or7 OSSIE AutomaticGainControl_metadata is free software; you can redistribute it and/or 8 8 modify it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE AutomaticGainControl is distributed in the hope that it will be useful,12 OSSIE AutomaticGainControl_metadata is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE AutomaticGainControl ; if not, write to the Free Software18 along with OSSIE AutomaticGainControl_metadata; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 -
ossiedev/trunk/components/AutomaticGainControl-metadata/src/AutomaticGainControl_metadata.cpp
r8007 r8028 3 3 Copyright 2006 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE AutomaticGainControl .6 7 OSSIE AutomaticGainControl is free software; you can redistribute it and/or modify5 This file is part of the OSSIE AutomaticGainControl_metadata. 6 7 OSSIE AutomaticGainControl_metadata is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE AutomaticGainControl is distributed in the hope that it will be useful,12 OSSIE AutomaticGainControl_metadata is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE AutomaticGainControl ; if not, write to the Free Software18 along with OSSIE AutomaticGainControl_metadata; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 … … 25 25 #include <iostream> 26 26 #include <math.h> 27 #include "AutomaticGainControl .h"28 29 AutomaticGainControl_ i::AutomaticGainControl_i(const char *uuid, omni_condition *condition)27 #include "AutomaticGainControl_metadata.h" 28 29 AutomaticGainControl_metadata_i::AutomaticGainControl_metadata_i(const char *uuid, omni_condition *condition) 30 30 : Resource_impl(uuid), component_running(condition) 31 31 { … … 51 51 } 52 52 53 AutomaticGainControl_ i::~AutomaticGainControl_i(void)53 AutomaticGainControl_metadata_i::~AutomaticGainControl_metadata_i(void) 54 54 { 55 55 delete dataOut_0; … … 57 57 } 58 58 59 void AutomaticGainControl_ i::run(void * data)60 { 61 ((AutomaticGainControl_ i*) data)->run_loop();62 } 63 64 CORBA::Object_ptr AutomaticGainControl_ i::getPort( const char* portName ) throw (CORBA::SystemException, CF::PortSupplier::UnknownPort)65 { 66 DEBUG(3, AutomaticGainControl , "getPort() invoked with : " << portName)59 void AutomaticGainControl_metadata_i::run(void * data) 60 { 61 ((AutomaticGainControl_metadata_i*) data)->run_loop(); 62 } 63 64 CORBA::Object_ptr AutomaticGainControl_metadata_i::getPort( const char* portName ) throw (CORBA::SystemException, CF::PortSupplier::UnknownPort) 65 { 66 DEBUG(3, AutomaticGainControl_metadata, "getPort() invoked with : " << portName) 67 67 68 68 CORBA::Object_var p; … … 82 82 } 83 83 84 void AutomaticGainControl_ i::start() throw (CORBA::SystemException, CF::Resource::StartError)85 { 86 DEBUG(3, AutomaticGainControl , "start invoked()")87 } 88 89 void AutomaticGainControl_ i::stop() throw (CORBA::SystemException, CF::Resource::StopError)84 void AutomaticGainControl_metadata_i::start() throw (CORBA::SystemException, CF::Resource::StartError) 85 { 86 DEBUG(3, AutomaticGainControl_metadata, "start invoked()") 87 } 88 89 void AutomaticGainControl_metadata_i::stop() throw (CORBA::SystemException, CF::Resource::StopError) 90 90 { 91 DEBUG(3, AutomaticGainControl , "stop invoked()")92 } 93 94 void AutomaticGainControl_ i::releaseObject() throw (CORBA::SystemException, CF::LifeCycle::ReleaseError)95 { 96 DEBUG(3, AutomaticGainControl , "releaseObject invoked()")91 DEBUG(3, AutomaticGainControl_metadata, "stop invoked()") 92 } 93 94 void AutomaticGainControl_metadata_i::releaseObject() throw (CORBA::SystemException, CF::LifeCycle::ReleaseError) 95 { 96 DEBUG(3, AutomaticGainControl_metadata, "releaseObject invoked()") 97 97 98 98 component_running->signal(); 99 99 } 100 100 101 void AutomaticGainControl_ i::initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException)102 { 103 DEBUG(3, AutomaticGainControl , "initialize invoked()")104 } 105 106 void AutomaticGainControl_ i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration)101 void AutomaticGainControl_metadata_i::initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException) 102 { 103 DEBUG(3, AutomaticGainControl_metadata, "initialize invoked()") 104 } 105 106 void AutomaticGainControl_metadata_i::configure(const CF::Properties& props) throw (CORBA::SystemException, CF::PropertySet::InvalidConfiguration, CF::PropertySet::PartialConfiguration) 107 107 { 108 108 CORBA::Float simple_temp; 109 109 110 DEBUG(3, AutomaticGainControl , "configure() invoked")111 112 DEBUG(3, AutomaticGainControl , "props length : " << props.length())110 DEBUG(3, AutomaticGainControl_metadata, "configure() invoked") 111 112 DEBUG(3, AutomaticGainControl_metadata, "props length : " << props.length()) 113 113 114 114 for (unsigned int i = 0; i <props.length(); i++) 115 115 { 116 DEBUG(3, AutomaticGainControl , "Property id : " << props[i].id)117 118 if (strcmp(props[i].id, "DCE: aaf97fa0-d184-4d88-9954-3a1334c73d6d") == 0) {116 DEBUG(3, AutomaticGainControl_metadata, "Property id : " << props[i].id) 117 118 if (strcmp(props[i].id, "DCE:baf97fa0-d184-4d88-9954-3a1334c73d6d") == 0) { 119 119 // energy_lo 120 120 props[i].value >>= simple_temp; … … 122 122 energy_lo = simple_temp; 123 123 124 DEBUG(3, AutomaticGainControl , "prop (energy_lo): " << simple_temp)125 126 } else if (strcmp(props[i].id, "DCE: 346e17c9-6678-483a-bffb-1909c64bddc0") == 0) {124 DEBUG(3, AutomaticGainControl_metadata, "prop (energy_lo): " << simple_temp) 125 126 } else if (strcmp(props[i].id, "DCE:446e17c9-6678-483a-bffb-1909c64bddc0") == 0) { 127 127 // energy_hi 128 128 props[i].value >>= simple_temp; … … 130 130 energy_hi = simple_temp; 131 131 132 DEBUG(3, AutomaticGainControl , "prop (energy_hi): " << simple_temp)133 134 } else if (strcmp(props[i].id, "DCE: 4608b943-4fe2-49df-91fb-afa287b609d4") == 0) {132 DEBUG(3, AutomaticGainControl_metadata, "prop (energy_hi): " << simple_temp) 133 134 } else if (strcmp(props[i].id, "DCE:5608b943-4fe2-49df-91fb-afa287b609d4") == 0) { 135 135 // k_attack 136 136 props[i].value >>= simple_temp; … … 138 138 k_attack = simple_temp; 139 139 140 DEBUG(3, AutomaticGainControl , "prop (k_attack): " << simple_temp)141 142 } else if (strcmp(props[i].id, "DCE: 491ec3de-ed45-48af-a6fc-ca2d6465e136") == 0) {140 DEBUG(3, AutomaticGainControl_metadata, "prop (k_attack): " << simple_temp) 141 142 } else if (strcmp(props[i].id, "DCE:591ec3de-ed45-48af-a6fc-ca2d6465e136") == 0) { 143 143 // k_release 144 144 props[i].value >>= simple_temp; … … 146 146 k_release = simple_temp; 147 147 148 DEBUG(3, AutomaticGainControl , "prop (k_release): " << simple_temp)149 150 } else if (strcmp(props[i].id, "DCE: 312f63fe-709a-4217-933b-c584c8d6a9bb") == 0) {148 DEBUG(3, AutomaticGainControl_metadata, "prop (k_release): " << simple_temp) 149 150 } else if (strcmp(props[i].id, "DCE:412f63fe-709a-4217-933b-c584c8d6a9bb") == 0) { 151 151 // g_min 152 152 props[i].value >>= simple_temp; … … 154 154 g_min = simple_temp; 155 155 156 DEBUG(3, AutomaticGainControl , "prop (g_min): " << simple_temp)157 158 } else if (strcmp(props[i].id, "DCE: 8357ee0d-2417-46d9-8475-2e5778d797e4") == 0) {156 DEBUG(3, AutomaticGainControl_metadata, "prop (g_min): " << simple_temp) 157 158 } else if (strcmp(props[i].id, "DCE:9357ee0d-2417-46d9-8475-2e5778d797e4") == 0) { 159 159 // g_max 160 160 props[i].value >>= simple_temp; … … 162 162 g_max = simple_temp; 163 163 164 DEBUG(3, AutomaticGainControl , "prop (g_max): " << simple_temp)165 166 } else if (strcmp(props[i].id, "DCE: b9b72ec8-d0bd-4060-b356-dcc6b0809e65") == 0) {164 DEBUG(3, AutomaticGainControl_metadata, "prop (g_max): " << simple_temp) 165 166 } else if (strcmp(props[i].id, "DCE:c9b72ec8-d0bd-4060-b356-dcc6b0809e65") == 0) { 167 167 // rssi_pass 168 168 props[i].value >>= simple_temp; … … 170 170 rssi_pass = simple_temp; 171 171 172 DEBUG(3, AutomaticGainControl , "prop (rssi_pass): " << simple_temp)172 DEBUG(3, AutomaticGainControl_metadata, "prop (rssi_pass): " << simple_temp) 173 173 std::cout << std::endl; 174 174 std::cout << std::endl; … … 187 187 188 188 189 void AutomaticGainControl_ i::run_loop()190 { 191 DEBUG(3, AutomaticGainControl , "run_loop() thread started")189 void AutomaticGainControl_metadata_i::run_loop() 190 { 191 DEBUG(3, AutomaticGainControl_metadata, "run_loop() thread started") 192 192 193 193 PortTypes::ShortSequence I_out, Q_out; … … 250 250 float gain(0.0f), energy(0.0f); 251 251 agc->GetStatus(gain, energy); 252 DEBUG(3, AutomaticGainControl , "gain: " << gain << ", energy: " << energy)252 DEBUG(3, AutomaticGainControl_metadata, "gain: " << gain << ", energy: " << energy) 253 253 metadata->signal_strength = 20.0f*log10f(energy/gain); 254 254 //printf("AGC: %f dB\n", metadata->signal_strength); -
ossiedev/trunk/components/AutomaticGainControl-metadata/src/AutomaticGainControl_metadata.h
r8007 r8028 3 3 Copyright 2006 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE AutomaticGainControl .5 This file is part of the OSSIE AutomaticGainControl_metadata. 6 6 7 OSSIE AutomaticGainControl is free software; you can redistribute it and/or modify7 OSSIE AutomaticGainControl_metadata is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE AutomaticGainControl is distributed in the hope that it will be useful,12 OSSIE AutomaticGainControl_metadata is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE AutomaticGainControl ; if not, write to the Free Software18 along with OSSIE AutomaticGainControl_metadata; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 … … 22 22 23 23 24 #ifndef AUTOMATICGAINCONTROL_ IMPL_H25 #define AUTOMATICGAINCONTROL_ IMPL_H24 #ifndef AUTOMATICGAINCONTROL_METADATA_IMPL_H 25 #define AUTOMATICGAINCONTROL_METADATA_IMPL_H 26 26 27 27 #include <stdlib.h> … … 38 38 /// \brief 39 39 /// 40 class AutomaticGainControl_ i : public virtual Resource_impl40 class AutomaticGainControl_metadata_i : public virtual Resource_impl 41 41 { 42 42 43 43 public: 44 44 /// initializing constructor 45 AutomaticGainControl_ i(const char *uuid, omni_condition *sem);45 AutomaticGainControl_metadata_i(const char *uuid, omni_condition *sem); 46 46 47 47 /// destructor 48 ~AutomaticGainControl_ i(void);48 ~AutomaticGainControl_metadata_i(void); 49 49 50 50 /// … … 72 72 private: 73 73 /// disallow default constructor 74 AutomaticGainControl_ i();74 AutomaticGainControl_metadata_i(); 75 75 76 76 /// disallow copy constructor 77 AutomaticGainControl_ i(AutomaticGainControl_i&);77 AutomaticGainControl_metadata_i(AutomaticGainControl_metadata_i&); 78 78 79 79 /// main signal processing method -
ossiedev/trunk/components/AutomaticGainControl-metadata/src/main.cpp
r5550 r8028 3 3 Copyright 2006 Virginia Polytechnic Institute and State University 4 4 5 This file is part of the OSSIE AutomaticGainControl .5 This file is part of the OSSIE AutomaticGainControl_metadata. 6 6 7 OSSIE AutomaticGainControl is free software; you can redistribute it and/or modify7 OSSIE AutomaticGainControl_metadata is free software; you can redistribute it and/or modify 8 8 it under the terms of the GNU General Public License as published by 9 9 the Free Software Foundation; either version 2 of the License, or 10 10 (at your option) any later version. 11 11 12 OSSIE AutomaticGainControl is distributed in the hope that it will be useful,12 OSSIE AutomaticGainControl_metadata is distributed in the hope that it will be useful, 13 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the … … 16 16 17 17 You should have received a copy of the GNU General Public License 18 along with OSSIE AutomaticGainControl ; if not, write to the Free Software18 along with OSSIE AutomaticGainControl_metadata; if not, write to the Free Software 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 … … 25 25 #include "ossie/debug.h" 26 26 27 #include "AutomaticGainControl .h"27 #include "AutomaticGainControl_metadata.h" 28 28 29 29 using namespace std; … … 48 48 cout << "Identifier - " << uuid << " Label - " << label << endl; 49 49 50 AutomaticGainControl_ i* agc_servant;50 AutomaticGainControl_metadata_i* agc_servant; 51 51 CF::Resource_var agc_var; 52 52 53 53 // Create the agc component servant and object reference 54 54 55 agc_servant = new AutomaticGainControl_ i(uuid, component_running);55 agc_servant = new AutomaticGainControl_metadata_i(uuid, component_running); 56 56 agc_var = agc_servant->_this(); 57 57 -
ossiedev/trunk/components/AutomaticGainControl-metadata/xml/AutomaticGainControl_metadata.prf.xml
r8007 r8028 4 4 <!--Powered by Python--> 5 5 <properties> 6 <simple type="float" id="DCE: aaf97fa0-d184-4d88-9954-3a1334c73d6d" name="energy_lo" mode="readwrite">6 <simple type="float" id="DCE:baf97fa0-d184-4d88-9954-3a1334c73d6d" name="energy_lo" mode="readwrite"> 7 7 <description>low energy threshold</description> 8 8 <value>4000</value> 9 9 <kind kindtype="configure"/> 10 10 </simple> 11 <simple type="float" id="DCE: 346e17c9-6678-483a-bffb-1909c64bddc0" name="energy_hi" mode="readwrite">11 <simple type="float" id="DCE:446e17c9-6678-483a-bffb-1909c64bddc0" name="energy_hi" mode="readwrite"> 12 12 <description>high energy threshold</description> 13 13 <value>4000</value> 14 14 <kind kindtype="configure"/> 15 15 </simple> 16 <simple type="float" id="DCE: 4608b943-4fe2-49df-91fb-afa287b609d4" name="k_attack" mode="readwrite">16 <simple type="float" id="DCE:5608b943-4fe2-49df-91fb-afa287b609d4" name="k_attack" mode="readwrite"> 17 17 <description>attack time constant</description> 18 18 <value>0.002</value> 19 19 <kind kindtype="configure"/> 20 20 </simple> 21 <simple type="float" id="DCE: 491ec3de-ed45-48af-a6fc-ca2d6465e136" name="k_release" mode="readwrite">21 <simple type="float" id="DCE:591ec3de-ed45-48af-a6fc-ca2d6465e136" name="k_release" mode="readwrite"> 22 22 <description>release time constant</description> 23 23 <value>0.0005</value> 24 24 <kind kindtype="configure"/> 25 25 </simple> 26 <simple type="float" id="DCE: 312f63fe-709a-4217-933b-c584c8d6a9bb" name="g_min" mode="readwrite">26 <simple type="float" id="DCE:412f63fe-709a-4217-933b-c584c8d6a9bb" name="g_min" mode="readwrite"> 27 27 <description>minimum gain value</description> 28 28 <value>1</value> 29 29 <kind kindtype="configure"/> 30 30 </simple> 31 <simple type="float" id="DCE: 8357ee0d-2417-46d9-8475-2e5778d797e4" name="g_max" mode="readwrite">31 <simple type="float" id="DCE:9357ee0d-2417-46d9-8475-2e5778d797e4" name="g_max" mode="readwrite"> 32 32 <description>maximum gain value</description> 33 33 <value>100.0</value> 34 34 <kind kindtype="configure"/> 35 35 </simple> 36 <simple type="float" id="DCE: b9b72ec8-d0bd-4060-b356-dcc6b0809e65" name="rssi_pass" mode="readwrite">36 <simple type="float" id="DCE:c9b72ec8-d0bd-4060-b356-dcc6b0809e65" name="rssi_pass" mode="readwrite"> 37 37 <description>Received signal strength level above which data will be passed</description> 38 38 <value>1000</value> -
ossiedev/trunk/components/AutomaticGainControl-metadata/xml/AutomaticGainControl_metadata.spd.xml
r8007 r8028 3 3 <!--Created with OSSIE WaveDev Beta Version 0.6.0b--> 4 4 <!--Powered by Python--> 5 <softpkg type="sca_compliant" name="AutomaticGainControl " id="DCE:a04dc9e4-8fec-11db-a862-00123f63025f">5 <softpkg type="sca_compliant" name="AutomaticGainControl_metadata" id="DCE:ed21fd52-af80-4c63-8303-6dd6c3c30dac"> 6 6 <title>Automatic gain control component</title> 7 7 <description>Automatically controls gain levels for RF and audio signals</description> … … 12 12 </author> 13 13 <propertyfile type="PRF"> 14 <localfile name="xml/AutomaticGainControl /AutomaticGainControl.prf.xml"/>14 <localfile name="xml/AutomaticGainControl_metadata/AutomaticGainControl_metadata.prf.xml"/> 15 15 </propertyfile> 16 16 <descriptor> 17 <localfile name="xml/AutomaticGainControl /AutomaticGainControl.scd.xml"/>17 <localfile name="xml/AutomaticGainControl_metadata/AutomaticGainControl_metadata.scd.xml"/> 18 18 </descriptor> 19 <implementation id="DCE: a04e9590-8fec-11db-b300-00123f63025f" aepcompliance="aep_compliant">19 <implementation id="DCE:8f7b6acd-7c77-4911-b117-af036cbb8941" aepcompliance="aep_compliant"> 20 20 <description>default implementation description</description> 21 21 <code type="Executable"> 22 <localfile name="bin/AutomaticGainControl "/>22 <localfile name="bin/AutomaticGainControl_metadata"/> 23 23 </code> 24 24 <processor name="x86"/>