Changeset 9912
- Timestamp:
- 02/22/10 20:27:35 (3 years ago)
- Location:
- ossiedev/trunk/tools/WaveDev
- Files:
-
- 1 added
- 5 modified
-
wavedev.cfg (modified) (2 diffs)
-
wavedev/Makefile.am (modified) (1 diff)
-
wavedev/cfg.py (modified) (1 diff)
-
wavedev/datatypemap.py (added)
-
wavedev/generate/templates/basic_ports/genStructure.py (modified) (6 diffs)
-
wavedev/generate/templates/basic_ports/sampleMain.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ossiedev/trunk/tools/WaveDev/wavedev.cfg
r9661 r9912 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <owdconfiguration> 3 <version> Beta Version 0.7.2</version>3 <version>Version 0.8.1</version> 4 4 <relativepath></relativepath> 5 5 <installpath>/sdr/</installpath> … … 8 8 <ossieincludepath>/usr/local/include/ossie/</ossieincludepath> 9 9 <homedir>/home/</homedir> 10 <sourcepreamble> </sourcepreamble>10 <sourcepreamble>/generate/generic_preamble</sourcepreamble> 11 11 <licensefile></licensefile> 12 12 <developer>OSSIE</developer> -
ossiedev/trunk/tools/WaveDev/wavedev/Makefile.am
r9764 r9912 20 20 uuidgen.py \ 21 21 wd.py \ 22 chmod.py \ 22 chmod.py \ 23 datatypemap.py \ 23 24 __init__.py 24 25 -
ossiedev/trunk/tools/WaveDev/wavedev/cfg.py
r9799 r9912 210 210 if frame_obj.sourcepreamble == None or not os.path.exists(frame_obj.sourcepreamble): 211 211 #search for generate/generic_preamble in Wavedev/wavedev 212 frame_obj.sourcepreamble = __getPath('/ generate/generic_preamble')212 frame_obj.sourcepreamble = __getPath('/WaveDev/wavedev/generate/generic_preamble') 213 213 214 214 # generate license file -
ossiedev/trunk/tools/WaveDev/wavedev/generate/templates/basic_ports/genStructure.py
r9911 r9912 20 20 21 21 import sys, os, shutil 22 from WaveDev.wavedev.datatypemap import * 22 23 from WaveDev.wavedev.cfg import LoadConfiguration 23 24 from datetime import date 25 24 26 try: 25 27 from WaveDev.wavedev.errorMsg import * … … 753 755 simpleCount = 0; 754 756 for x in c.properties: 755 tmp_type = str(x.type)757 tmp_type = getDatatype(str(x.type)) 756 758 757 759 if x.elementType == "Simple": 758 ts = " "*8 + "CORBA::" + tmp_type .capitalize()+ " simple_" + str(simpleCount) + "_value;\n";760 ts = " "*8 + "CORBA::" + tmp_type + " simple_" + str(simpleCount) + "_value;\n"; 759 761 output.write(ts) 760 762 simpleCount += 1; … … 772 774 simplesequenceCount = 0; 773 775 for x in c.properties: 774 tmp_type = str(x.type)776 tmp_type = getDatatype(str(x.type)) 775 777 776 778 if x.elementType == "SimpleSequence": 777 ts = " "*8 + "CORBA::" + tmp_type .capitalize()+ "Seq *simplesequence_" + str(simplesequenceCount) + ";\n"779 ts = " "*8 + "CORBA::" + tmp_type + "Seq *simplesequence_" + str(simplesequenceCount) + ";\n" 778 780 output.write(ts) 779 781 simplesequenceCount = simplesequenceCount + 1 … … 1000 1002 ts = " "*4 + 'std::cout << "props length : " << props.length() << std::endl;\n\n' 1001 1003 ts = ts + " "*4 + "for ( int i = 0; i <props.length(); i++)\n" 1002 ts = ts + " "*4 + "{\n"; output.write(ts) 1004 ts = ts + " "*4 + "{\n"; 1005 output.write(ts) 1003 1006 ts = " "*8 + 'std::cout << "Property id : " << props[i].id << std::endl;\n\n' 1004 1007 output.write(ts) … … 1006 1009 for p in c.properties: 1007 1010 1008 ts = " "*8 + 'if (strcmp(props[i].id, "' + p.id + '") == 0)\n' + " "*8 + "{\n";output.write(ts) 1011 ts = " "*8 + 'if (strcmp(props[i].id, "' + p.id + '") == 0)\n' + " "*8 + "{\n"; 1012 output.write(ts) 1009 1013 1010 1014 if p.elementType == "Simple": 1011 tmp_type = "unsupported_type"; 1012 if p.type == "short": 1013 tmp_type = "Short"; 1014 elif p.type == "ushort": 1015 tmp_type = "UShort"; 1016 elif p.type == "float": 1017 tmp_type = "Float"; 1018 elif p.type == "double": 1019 tmp_type = "Double"; 1020 elif p.type == "long": 1021 tmp_type = "Long"; 1022 else: 1023 print "ERROR: " + p.type + " is not supported in basic_ports/genStructure" 1024 return 1015 tmp_type = getDatatype(p.type) 1016 if tmp_type == "": 1017 print "ERROR: " + p.type + " is not supported in basic_ports/genStructure\n" 1025 1018 1026 1019 ts = " "*12 + "CORBA::" + str(tmp_type) + " simple_temp;\n"; … … 1039 1032 1040 1033 elif p.elementType == "SimpleSequence": 1041 tmp_type = "unsupported_type"; 1042 if p.type == "short": 1043 tmp_type = "Short"; 1044 elif p.type == "ushort": 1045 tmp_type = "UShort"; 1046 elif p.type == "float": 1047 tmp_type = "Float"; 1048 elif p.type == "double": 1049 tmp_type = "Double"; 1050 else: 1051 print "ERROR: " + p.type + " is not supported in basic_ports/genStructure" 1052 return 1034 tmp_type = getDatatype(p.type) 1035 if tmp_type == "": 1036 print "ERROR: " + p.type + " is not supported in basic_ports/genStructure\n" 1053 1037 1054 1038 ts = " "*12 + "props[i].value >>= simplesequence_" + str(simplesequenceCount) + ";\n"; -
ossiedev/trunk/tools/WaveDev/wavedev/generate/templates/basic_ports/sampleMain.cpp
r5732 r9912 1 1 #include <iostream> 2 2 #include "ossie/ossieSupport.h" 3 #include "ossie/debug.h" 3 4 4 5 #include "__IncludeFile__.h" 5 6 7 using namespace std; 8 using namespace standardInterfaces; // For standard OSSIE interface classes 6 9 7 10 int main(int argc, char* argv[]) 11 { 12 ossieDebugLevel = 0; 8 13 9 { 10 ossieSupport::ORB *orb = new ossieSupport::ORB; 14 if ( argc < 7 ) { 15 cout << argv[0] << " NAMING_CONTEXT_IOR <string> NAME_BINDING <string> COMPONENT_IDENTIFIER <string> " << endl; 16 exit(EXIT_FAILURE); 17 } 18 19 int i = 0; 20 char *uuid = NULL; 21 char *label = NULL; 22 char *ior = NULL; 23 24 while ( i < argc ) { 25 if ( strcmp("NAMING_CONTEXT_IOR", argv[i]) == 0 ) ior = argv[i+1]; 26 if ( strcmp("NAME_BINDING", argv[i]) == 0 ) label = argv[i+1]; 27 if ( strcmp("COMPONENT_IDENTIFIER", argv[i]) == 0 ) uuid = argv[i+1]; 28 ++i; 29 } 30 31 if ( uuid == NULL ) { 32 cout << "ERROR: " << argv[0] << " missing COMPONENT_IDENTIFIER argument" << endl; 33 exit(EXIT_FAILURE); 34 } 35 36 if ( label == NULL ) { 37 cout << "ERROR: " << argv[0] << " missing NAME_BINDING argument" << endl; 38 exit(EXIT_FAILURE); 39 } 40 41 if ( ior == NULL ) { 42 cout << "ERROR: " << argv[0] << " missing NAMING_CONTEXT_IOR argument" << endl; 43 exit(EXIT_FAILURE); 44 } 45 46 cout << argv[0] << " NAMING_CONTEXT_IOR " << ior << " NAME_BINDING " << label << " COMPONENT_IDENTIFIER " << uuid << endl; 47 48 ossieSupport::ORB::orb = CORBA::ORB_init( argc, argv ); 49 50 try { 51 CORBA::Object_ptr _ncobj = ossieSupport::ORB::orb->string_to_object(ior); 52 ossieSupport::ORB::inc = CosNaming::NamingContext::_narrow(_ncobj); 53 CORBA::release(_ncobj); 54 } catch ( ... ) { 55 cout << "ERROR: " << argv[0] << " Failed to narrow NamingContext from IOR" << endl; 56 exit(EXIT_FAILURE); 57 } 58 59 try { 60 CORBA::Object_ptr _poaobj = ossieSupport::ORB::orb->resolve_initial_references("RootPOA"); 61 ossieSupport::ORB::poa = PortableServer::POA::_narrow(_poaobj); 62 ossieSupport::ORB::pman = ossieSupport::ORB::poa->the_POAManager(); 63 ossieSupport::ORB::pman->activate(); 64 } catch ( ... ) { 65 cout << "ERROR: " << argv[0] << " Failed to initialize POA" << endl; 66 exit(EXIT_FAILURE); 67 } 68 11 69 omni_mutex component_running_mutex; 12 70 omni_condition *component_running = new omni_condition(&component_running_mutex); 13 14 if (argc != 3) {15 std::cout << argv[0] << " <id> <usage name> " << std::endl;16 exit (-1);17 }18 19 char *uuid = argv[1];20 char *label = argv[2];21 22 std::cout << "Identifier - " << uuid << " Label - " << label << std::endl;23 71 24 72 __Class_name__* __CLASS_VAR___servant; … … 31 79 __CLASS_VAR_ACE___servant->activate(); 32 80 33 orb->bind_object_to_name((CORBA::Object_ptr) __CLASS_VAR___var, label); 81 CosNaming::Name_var _bindingname = omni::omniURI::stringToName(label); 82 try { 83 ossieSupport::ORB::inc->rebind(_bindingname, (CORBA::Object_ptr) txdemo_var); 84 } catch ( ... ) { 85 cout << "ERROR: " << argv[0] << " Failed to rebind reference to NameService" << endl; 86 exit(EXIT_FAILURE); 87 } 34 88 35 89 // This bit is ORB specific … … 39 93 40 94 component_running->wait(); 41 o rb->unbind_name(label);42 o rb->orb->shutdown(0);95 ossieSupport::ORB::inc->unbind(_bindingname); 96 ossieSupport::ORB::orb->destroy(); 43 97 98 return 0; 44 99 } 100