Changeset 6329
- Timestamp:
- 02/01/08 16:56:54 (5 years ago)
- Location:
- components/AutomaticGainControl/branches/AutomaticGainControl-0.6.2
- Files:
-
- 2 modified
-
configure.ac (modified) (1 diff)
-
src/main.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
components/AutomaticGainControl/branches/AutomaticGainControl-0.6.2/configure.ac
r4668 r6329 1 AC_INIT(AutomaticGainControl, 0.6. 0)1 AC_INIT(AutomaticGainControl, 0.6.2) 2 2 AM_INIT_AUTOMAKE 3 3 -
components/AutomaticGainControl/branches/AutomaticGainControl-0.6.2/src/main.cpp
r4668 r6329 1 1 /**************************************************************************** 2 2 3 Copyright 200 6 Virginia Polytechnic Institute and State University3 Copyright 2005,2006 Virginia Polytechnic Institute and State University 4 4 5 5 This file is part of the OSSIE AutomaticGainControl. … … 19 19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 20 21 21 22 ****************************************************************************/ 22 23 23 24 #include <iostream> 24 25 25 #include "ossie/ossieSupport.h" 26 #include "ossie/debug.h"27 26 28 27 #include "AutomaticGainControl.h" 29 28 29 using namespace std; 30 using namespace standardInterfaces; // For standard OSSIE interface classes 31 30 32 31 33 int main(int argc, char* argv[]) 32 33 34 { 34 ossieDebugLevel = 3; 35 35 ossieDebugLevel = 5; 36 36 ossieSupport::ORB *orb = new ossieSupport::ORB; 37 37 omni_mutex component_running_mutex; 38 38 omni_condition *component_running = new omni_condition(&component_running_mutex); 39 39 40 ossieSupport::ossieComponent automaticgaincontrol(orb, argc, argv); 40 if (argc != 3) { 41 cout << argv[0] << " <id> <usage name> " << endl; 42 exit (-1); 43 } 41 44 42 AutomaticGainControl_i* automaticgaincontrol_servant;43 CF::Resource_var automaticgaincontrol_var;45 char *uuid = argv[1]; 46 char *label = argv[2]; 44 47 45 // Create the automaticgaincontrol component servant and object reference 48 cout << "Identifier - " << uuid << " Label - " << label << endl; 46 49 47 automaticgaincontrol_servant = new AutomaticGainControl_i( 48 automaticgaincontrol.getUuid(), component_running); 49 automaticgaincontrol_var = automaticgaincontrol_servant->_this(); 50 AutomaticGainControl_i* agc_servant; 51 CF::Resource_var agc_var; 50 52 51 PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(automaticgaincontrol_var);53 // Create the agc servant and object reference 52 54 53 automaticgaincontrol.bind(automaticgaincontrol_var); 55 agc_servant = new AutomaticGainControl_i(uuid, component_running); 56 agc_var = agc_servant->_this(); 57 58 orb->bind_object_to_name((CORBA::Object_ptr) agc_var, label); 54 59 55 60 // This bit is ORB specific 56 61 // omniorb is threaded and the servants are running at this point 57 // so we block on the condition58 // The releaseObject method clear the conditionand the component exits62 // so we block on the semaphore 63 // The releaseObject method clear the semaphore and the component exits 59 64 60 65 component_running->wait(); 61 66 62 automaticgaincontrol.unbind();67 orb->unbind_name(label); 63 68 64 DEBUG(4, AutomaticGainControl, "Deactivate object.");65 orb->poa->deactivate_object(servantId);66 67 DEBUG(4, AutomaticGainControl, "Destroy POA.");68 orb->poa->destroy(false, false);69 70 DEBUG(4, AutomaticGainControl, "Shutdown orb.");71 69 orb->orb->shutdown(0); 72 73 70 }