Changeset 6329

Show
Ignore:
Timestamp:
02/01/08 16:56:54 (5 years ago)
Author:
jgaeddert
Message:

modifying AutomaticGainControl? to work with 0.6.2

Location:
components/AutomaticGainControl/branches/AutomaticGainControl-0.6.2
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • components/AutomaticGainControl/branches/AutomaticGainControl-0.6.2/configure.ac

    r4668 r6329  
    1 AC_INIT(AutomaticGainControl, 0.6.0) 
     1AC_INIT(AutomaticGainControl, 0.6.2) 
    22AM_INIT_AUTOMAKE 
    33 
  • components/AutomaticGainControl/branches/AutomaticGainControl-0.6.2/src/main.cpp

    r4668 r6329  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2005,2006 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE AutomaticGainControl. 
     
    1919Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    2020 
     21 
    2122****************************************************************************/ 
    2223 
    2324#include <iostream> 
    24  
    2525#include "ossie/ossieSupport.h" 
    26 #include "ossie/debug.h" 
    2726 
    2827#include "AutomaticGainControl.h" 
    2928 
     29using namespace std; 
     30using namespace standardInterfaces;  // For standard OSSIE interface classes 
     31 
    3032 
    3133int main(int argc, char* argv[]) 
    32  
    3334{ 
    34     ossieDebugLevel = 3; 
    35  
     35    ossieDebugLevel = 5; 
    3636    ossieSupport::ORB *orb = new ossieSupport::ORB; 
    3737    omni_mutex component_running_mutex; 
    3838    omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3939 
    40     ossieSupport::ossieComponent automaticgaincontrol(orb, argc, argv); 
     40    if (argc != 3) { 
     41        cout << argv[0] << " <id> <usage name> " << endl; 
     42        exit (-1); 
     43    } 
    4144 
    42     AutomaticGainControl_i* automaticgaincontrol_servant; 
    43     CF::Resource_var automaticgaincontrol_var; 
     45    char *uuid = argv[1]; 
     46    char *label = argv[2]; 
    4447 
    45     // Create the automaticgaincontrol component servant and object reference 
     48cout << "Identifier - " << uuid << "  Label - " << label << endl; 
    4649 
    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; 
    5052 
    51     PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(automaticgaincontrol_var); 
     53    // Create the agc servant and object reference 
    5254 
    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); 
    5459 
    5560    // This bit is ORB specific 
    5661    // omniorb is threaded and the servants are running at this point 
    57     // so we block on the condition 
    58     // The releaseObject method clear the condition and the component exits 
     62    // so we block on the semaphore 
     63    // The releaseObject method clear the semaphore and the component exits 
    5964 
    6065    component_running->wait(); 
    6166 
    62     automaticgaincontrol.unbind(); 
     67    orb->unbind_name(label); 
    6368 
    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."); 
    7169    orb->orb->shutdown(0); 
    72  
    7370}