Changeset 5270

Show
Ignore:
Timestamp:
10/07/07 13:24:41 (6 years ago)
Author:
jgaeddert
Message:

fixing source files so that component builds; still needs functionality added

Location:
experimental/components/SubchannelSelector/trunk/SubchannelSelector/src
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • experimental/components/SubchannelSelector/trunk/SubchannelSelector/src/SubchannelSelector.cpp

    r5267 r5270  
    112112        std::cout << "Property id : " << props[i].id << std::endl; 
    113113 
    114         if (strcmp(props[i].id, "DCE:9032b00e-74f4-11dc-a5a4-00123f63025f") == 0) 
    115         { 
     114        if (strcmp(props[i].id, "DCE:9032b00e-74f4-11dc-a5a4-00123f63025f") == 0) { 
     115            // subchannel_frequency 
    116116            CORBA::Float simple_temp; 
    117117            props[i].value >>= simple_temp; 
    118118            simple_0_value = simple_temp; 
     119        } else if (strcmp(props[i].id, "DCE:b56e1f7a-74f4-11dc-b9ef-00123f63025f") == 0) { 
     120            // decimation rate 
     121            CORBA::ULong simple_temp; 
     122            props[i].value >>= simple_temp; 
     123            simple_0_value = simple_temp; 
     124        } else { 
     125            // unknown property 
     126            std::cerr << "ERROR: SubchannelSelector::configure() unknown property \"" 
     127               << props[i].id << "\"" << std::endl; 
     128            throw CF::PropertySet::InvalidConfiguration(); 
    119129        } 
    120  
    121         if (strcmp(props[i].id, "DCE:b56e1f7a-74f4-11dc-b9ef-00123f63025f") == 0) 
    122         { 
     130    } 
    123131} 
    124132 
  • experimental/components/SubchannelSelector/trunk/SubchannelSelector/src/SubchannelSelector.h

    r5267 r5270  
    8787    omni_condition *component_running;  ///< for component shutdown 
    8888    omni_thread *processing_thread;     ///< for component writer function 
    89          
    90         CORBA::Float simple_0_value; 
    91         CORBA::Ulong simple_1_value; 
    9289 
     90    CORBA::Float simple_0_value; 
     91    CORBA::ULong simple_1_value; 
    9392     
    9493    // list components provides and uses ports 
    95         standardInterfaces_i::complexShort_p *dataIn_0; 
    96         standardInterfaces_i::complexShort_u *dataOut_0; 
     94    standardInterfaces_i::complexShort_p *dataIn_0; 
     95    standardInterfaces_i::complexShort_u *dataOut_0; 
    9796     
    9897}; 
  • experimental/components/SubchannelSelector/trunk/SubchannelSelector/src/main.cpp

    r5267 r5270  
    11/**************************************************************************** 
    22 
    3 Copyright 2007 Virginia Polytechnic Institute and State University 
     3Copyright 2006 Virginia Polytechnic Institute and State University 
    44 
    55This file is part of the OSSIE SubchannelSelector. 
     
    2323#include <iostream> 
    2424#include "ossie/ossieSupport.h" 
     25#include "ossie/debug.h" 
    2526 
    2627#include "SubchannelSelector.h" 
    2728 
     29using namespace std; 
     30using namespace standardInterfaces;  // For standard OSSIE interface classes 
     31 
     32 
    2833int main(int argc, char* argv[]) 
    29  
    3034{ 
    31     ossieDebugLevel = 3; 
     35    ossieDebugLevel = 5; 
    3236 
    3337    ossieSupport::ORB *orb = new ossieSupport::ORB; 
     
    3539    omni_condition *component_running = new omni_condition(&component_running_mutex); 
    3640 
    37     ossieSupport::ossieComponent subchannelselector(orb, argc, argv); 
     41    if (argc != 3) { 
     42        cout << argv[0] << " <id> <usage name> " << endl; 
     43        exit (-1); 
     44    } 
     45 
     46    char *uuid = argv[1]; 
     47    char *label = argv[2]; 
     48 
     49    cout << "Identifier - " << uuid << "  Label - " << label << endl; 
    3850 
    3951    SubchannelSelector_i* subchannelselector_servant; 
     
    4254    // Create the subchannelselector component servant and object reference 
    4355 
    44     subchannelselector_servant = new SubchannelSelector_i(subchannelselector.getUuid(), component_running); 
     56    subchannelselector_servant = new SubchannelSelector_i(uuid, component_running); 
    4557    subchannelselector_var = subchannelselector_servant->_this(); 
    4658 
    47     PortableServer::ObjectId_var servantId = orb->poa->reference_to_id(subchannelselector_var); 
    48  
    49     subchannelselector.bind(subchannelselector_var); 
     59    orb->bind_object_to_name((CORBA::Object_ptr) subchannelselector_var, label); 
    5060 
    5161    // This bit is ORB specific 
     
    5565 
    5666    component_running->wait(); 
    57  
    58     subchannelselector.unbind(); 
    59  
    60     DEBUG(4, SubchannelSelector, "Deactivate object."); 
    61     orb->poa->deactivate_object(servantId); 
    62  
    63     DEBUG(4, SubchannelSelector, "Destroy POA."); 
    64     orb->poa->destroy(false, false); 
    65  
    66     DEBUG(4, SubchannelSelector, "Shutdown orb."); 
     67    orb->unbind_name(label); 
    6768    orb->orb->shutdown(0); 
    6869