Changeset 4561

Show
Ignore:
Timestamp:
08/08/07 15:50:47 (6 years ago)
Author:
DrewCormier
Message:

usrp commander seems much cooler than USRP_Ctrl

Location:
experimental/components/USRP_Ctrl_GUI/branches/0.6.2/USRP_Ctrl_GUI
Files:
2 added
5 removed
1 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/USRP_Ctrl_GUI/branches/0.6.2/USRP_Ctrl_GUI/main.cpp

    r4559 r4561  
    11/**************************************************************************** 
    22 
    3 Copyright 2006 Virginia Polytechnic Institute and State University 
     3Copyright 2007 Virginia Polytechnic Institute and State University 
    44 
    5 This file is part of the OSSIE USRP_Ctrl. 
     5This file is part of the OSSIE USRP_Commander. 
    66 
    7 OSSIE USRP_Ctrl is free software; you can redistribute it and/or modify 
     7OSSIE USRP_Commander is free software; you can redistribute it and/or modify 
    88it under the terms of the GNU General Public License as published by 
    99the Free Software Foundation; either version 2 of the License, or 
    1010(at your option) any later version. 
    1111 
    12 OSSIE USRP_Ctrl is distributed in the hope that it will be useful, 
     12OSSIE USRP_Commander is distributed in the hope that it will be useful, 
    1313but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1414MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
     
    1616 
    1717You should have received a copy of the GNU General Public License 
    18 along with OSSIE USRP_Ctrl; if not, write to the Free Software 
     18along with OSSIE USRP_Commander; if not, write to the Free Software 
    1919Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
    2020 
     
    2626#include "ossie/debug.h" 
    2727 
    28 #include "USRP_Ctrl.h" 
     28#include "USRP_Commander.h" 
    2929 
    3030 
     
    3232 
    3333{ 
     34    ossieDebugLevel = 3; 
     35 
    3436    ossieSupport::ORB *orb = new ossieSupport::ORB; 
    3537    omni_mutex component_running_mutex; 
    3638    omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3739 
    38     if (argc != 3) { 
    39         std::cout << argv[0] << " <id> <usage name> " << std::endl; 
    40         exit (-1); 
    41     } 
     40    ossieSupport::ossieComponent usrp_commander(orb, argc, argv); 
    4241 
    43     char *uuid = argv[1]; 
    44     char *label = argv[2]; 
     42    USRP_Commander_i* usrp_commander_servant; 
     43    CF::Resource_var usrp_commander_var; 
    4544 
    46     DEBUG(3, USRP_Ctrl, "Identifier - " << uuid << "  Label - " << label) 
     45    // Create the usrp_commander component servant and object reference 
    4746 
    48     USRP_Ctrl_i* usrp_ctrl_servant; 
    49     CF::Resource_var usrp_ctrl_var; 
     47    usrp_commander_servant = new USRP_Commander_i(usrp_commander.getUuid(), component_running); 
     48    usrp_commander_var = usrp_commander_servant->_this(); 
    5049 
    51     // Create the usrp_ctrl component servant and object reference 
     50    PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(usrp_commander_var); 
    5251 
    53     usrp_ctrl_servant = new USRP_Ctrl_i(uuid, component_running); 
    54     usrp_ctrl_var = usrp_ctrl_servant->_this(); 
    55  
    56     orb->bind_object_to_name((CORBA::Object_ptr) usrp_ctrl_var, label); 
     52    usrp_commander.bind(usrp_commander_var); 
    5753 
    5854    // This bit is ORB specific 
     
    6258 
    6359    component_running->wait(); 
    64     orb->unbind_name(label); 
     60 
     61    usrp_commander.unbind(); 
     62 
     63    DEBUG(4, USRP_Commander, "Deactivate object."); 
     64    orb->poa->deactivate_object(servantId); 
     65 
     66    DEBUG(4, USRP_Commander, "Destroy POA."); 
     67    orb->poa->destroy(false, false); 
     68 
     69    DEBUG(4, USRP_Commander, "Shutdown orb."); 
    6570    orb->orb->shutdown(0); 
    6671