Changeset 9605

Show
Ignore:
Timestamp:
10/01/09 12:20:29 (4 years ago)
Author:
deepanns
Message:

merging with changes from trunk

Location:
ossiedev
Files:
301 added
20 modified
5 copied

Legend:

Unmodified
Added
Removed
  • ossiedev/branches/deepanns/tools/OEF/.project

    r9573 r9605  
    11<?xml version="1.0" encoding="UTF-8"?> 
    22<projectDescription> 
    3         <name>OEF</name> 
     3        <name>OEF_Bkup</name> 
    44        <comment></comment> 
    55        <projects> 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev.cfg

    r8729 r9605  
    22<owdconfiguration> 
    33    <version>Beta Version 0.7.2</version> 
    4     <installpath>/sdr</installpath> 
    5     <stdidlpath></stdidlpath> 
    6     <ossieincludepath></ossieincludepath> 
     4    <installpath>/sdr/</installpath> 
     5    <stdidlpath>/usr/local/include/standardinterfaces/</stdidlpath> 
     6    <customidlpath>/usr/local/include/custominterfaces/</customidlpath> 
     7    <ossieincludepath>/usr/local/include/ossie/</ossieincludepath> 
    78    <homedir></homedir> 
    89    <sourcepreamble></sourcepreamble> 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/MainFrame.py

    r8729 r9605  
    14541454 
    14551455        # List possible resource directories (components and device) 
    1456         baseComponentPath = self.installPath + 'xml/' 
     1456# NOTE: use CF::FileManager to obtain file location 
     1457        baseComponentPath = self.installPath + 'dom/xml/' 
     1458        baseDevicePath = self.installPath + 'dev/xml/' 
     1459        if os.path.isdir(baseDevicePath): 
     1460            for d in os.listdir(baseDevicePath): 
     1461                if d != 'dtd': 
     1462                    resList.append( (baseDevicePath,d) ) 
     1463        else: 
     1464            errorMsg(self,"No devices could be found in the following directory: " + baseDevicePath) 
     1465            return 
     1466 
    14571467        if os.path.isdir(baseComponentPath): 
    14581468            for r in os.listdir(baseComponentPath): 
     
    14601470                    resList.append( (baseComponentPath,r) ) 
    14611471        else: 
    1462             errorMsg(self,"No component resources could be found in: " + self.installPath) 
     1472            errorMsg(self,"No component resources could be found in the following directory: " + baseComponentPath) 
    14631473            return 
    14641474 
     
    14811491 
    14821492        nodeList = [] 
    1483         if os.path.isdir(self.installPath + 'nodes'): 
    1484             nodeList = os.listdir(self.installPath + 'nodes') 
     1493# NOTE: the use of hard coded dirs is bad juju 
     1494# NOTE: use CF::FileManager to obtain file location 
     1495        if os.path.isdir(self.installPath + 'dev/nodes'): 
     1496            nodeList = os.listdir(self.installPath + 'dev/nodes') 
    14851497        else: 
    14861498            errorMsg(self, "No nodes could be found in: " + self.installPath) 
     
    14901502 
    14911503            # check for existence of DomainManager XML files 
    1492             nodes_root_path = self.installPath + os.path.sep + 'nodes' + os.path.sep + node_name + os.path.sep 
     1504            nodes_root_path = self.installPath + os.path.sep + 'dev/nodes' + os.path.sep + node_name + os.path.sep 
    14931505            if not os.path.exists(nodes_root_path + 'DeviceManager.dcd.xml'): 
    14941506                errorMsg(self, "Could not find DeviceManager.dcd.xml in: " + nodes_root_path) 
     
    15051517 
    15061518            nodeName = node_name 
    1507             nodePath = self.installPath + 'nodes/' + nodeName + '/' 
     1519            nodePath = self.installPath + 'dev/nodes/' + nodeName + '/' 
    15081520 
    15091521            tmpNode = importNode.getNode(nodePath,nodeName,self) 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/XML_gen/component_gen.py

    r8649 r9605  
    3030 
    3131 
    32 xmlpath = u'xml/' 
    33 binpath = u'bin/' 
     32xmlpath = u'/xml/' 
     33binpath = u'/bin/' 
    3434 
    3535 
     
    168168 
    169169    # set the implementation id 
     170    # NOTE: this supports only one implementation 
    170171    implementationNode = softpkgNode.getElementsByTagName("implementation")[0] 
    171172    implementationNode.setAttribute("id", u'DCE:' + unicode(uuidgen.uuidgen()) ) 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/XML_gen/templates/_spd.xml.tpl

    r8626 r9605  
    1919                        <localfile name="./default/default"/> 
    2020                </code> 
     21        <os name="Linux" version="2.6.26.3"/> 
    2122                <processor name="x86"/> 
    2223        </implementation> 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/cfg.py

    r8729 r9605  
    4747            frame_obj.installPath = frame_obj.installPath + '/' 
    4848    except: 
    49         frame_obj.installPath = "" 
     49        frame_obj.installPath = "/sdr/" 
    5050 
    5151    # standard IDL path 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/generate/reconf

    r3181 r9605  
    11#!/bin/sh 
    22 
     3libtoolize 
    34rm -f config.cache 
    45aclocal 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/generate/templates/basic_ports/genStructure.py

    r8729 r9605  
    124124        compPath = compPath + '/' 
    125125 
    126     Flags = ["-Wall"] 
     126    Flags = ["-Wall -I$(includedir)/ossie"] 
    127127 
    128128    output = open(compPath + 'Makefile.am','w') 
    129129    self.info2str(output,"AM_CXXFLAGS = ",Flags,1) 
     130 
     131    tstr = "LDADD = $(libdir)/libossiecf.la $(libdir)/libossieparser.la $(libdir)/libossieidl.la $(libdir)/libstandardInterfaces.la\n" 
     132    output.write(tstr) 
    130133 
    131134    tstr = "bin_PROGRAMS = " + comp.name + "\n\n" 
     
    137140    output.write(tstr) 
    138141 
    139     tstr = "xmldir = $(prefix)/xml/$(ossieName)\n" 
     142    tstr = "xmldir = $(prefix)/dom/xml/$(ossieName)\n" 
    140143    output.write(tstr) 
    141144 
    142     tstr = "bindir = $(prefix)/bin\n" 
     145    tstr = "bindir = $(prefix)/dom/bin\n" 
    143146    output.write(tstr) 
    144147 
     
    196199 
    197200     output = open(genPath + 'configure.ac','w') 
    198      tstr = "AC_INIT(" + name + ", 0.6.0)\nAM_INIT_AUTOMAKE\n\n" 
     201     tstr = "AC_INIT(" + name + ", 0.8.0)\nAM_INIT_AUTOMAKE\n\n" 
     202     output.write(tstr) 
     203     tstr = "AC_CONFIG_MACRO_DIR([m4])\nLT_INIT\n" 
    199204     output.write(tstr) 
    200205     #tstr = 'AC_PREFIX_DEFAULT("/sdr")\n\n' 
    201206     tstr = 'AC_PREFIX_DEFAULT("' + installPath + '")\n\n' 
    202207     output.write(tstr) 
    203      tstr = "AC_PROG_CXX\nAC_PROG_INSTALL\nAC_PROG_MAKE_SET\n\n" 
     208     tstr = "AC_PROG_CXX\nAC_PROG_INSTALL\nAC_PROG_LIBTOOL\nAC_PROG_MAKE_SET\n\n" 
    204209     output.write(tstr) 
    205210     tstr = "AC_HEADER_SYS_WAIT\n\nAC_FUNC_FORK\n\n" 
     
    220225     tstr = 'AC_CHECK_HEADERS([omniORB4/CORBA.h], [], [AC_MSG_ERROR([cannot find omniORB4 header files])])\n\n' 
    221226     output.write(tstr) 
    222      tstr = 'AC_CHECK_LIB([standardInterfaces], [main], [], [AC_MSG_ERROR([cannot find standardInterfaces])])\n' 
    223      output.write(tstr) 
    224      tstr = 'AC_CHECK_HEADERS([standardinterfaces/complexShort.h], [], [AC_MSG_ERROR([cannot find standardInterfaces header files])])\n\n' 
    225      output.write(tstr) 
    226  
    227      # TODO: Add support for sigproc 
    228      if False: 
    229          tstr = 'AC_CHECK_LIB([sigproc], [main], [], [AC_MSG_ERROR([cannot find sigproc library])])\n' 
    230          output.write(tstr) 
    231          tstr = 'AC_CHECK_HEADERS([sigproc/SigProc.h], [], [AC_MSG_ERROR([cannot find sigproc library header files])])\n\n' 
    232          output.write(tstr) 
     227     # tstr = 'AC_CHECK_LIB([standardInterfaces], [main], [], [AC_MSG_ERROR([cannot find standardInterfaces])])\n' 
     228     # output.write(tstr) 
     229     # tstr = 'AC_CHECK_HEADERS([standardinterfaces/complexShort.h], [], [AC_MSG_ERROR([cannot find standardInterfaces header files])])\n\n' 
     230     # output.write(tstr) 
     231 
     232     # if False: 
     233     #    tstr = 'AC_CHECK_LIB([sigproc], [main], [], [AC_MSG_ERROR([cannot find sigproc library])])\n' 
     234     #    output.write(tstr) 
     235     #    tstr = 'AC_CHECK_HEADERS([sigproc/SigProc.h], [], [AC_MSG_ERROR([cannot find sigproc library header files])])\n\n' 
     236     #    output.write(tstr) 
    233237 
    234238     tstr = 'AC_LANG_POP\n\n' 
     
    238242     tstr = 'export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig"\n' 
    239243     output.write(tstr) 
    240      tstr = "PKG_CHECK_MODULES(OSSIE, ossie >= 0.6.0,,exit)\n" 
    241      output.write(tstr) 
     244     # tstr = "PKG_CHECK_MODULES(OSSIE, ossie >= 0.6.0,,exit)\n" 
     245     # output.write(tstr) 
    242246     tstr = 'CXXFLAGS="$CXXFLAGS $OSSIE_CFLAGS"\n' 
    243247     output.write(tstr) 
    244      tstr = 'IDL_FLAGS="$OSSIE_CFLAGS"\nAC_SUBST(IDL_FLAGS)\n\n' 
    245      output.write(tstr) 
     248     # tstr = 'IDL_FLAGS="$OSSIE_CFLAGS"\nAC_SUBST(IDL_FLAGS)\n\n' 
     249     # output.write(tstr) 
    246250 
    247251     if aceFlag == True: 
     
    253257     output.write(tstr) 
    254258 
    255      tstr = 'AC_SUBST(SI_PATH)\n\n' 
    256      output.write(tstr) 
     259     # tstr = 'AC_SUBST(SI_PATH)\n\n' 
     260     # output.write(tstr) 
    257261 
    258262     tstr = "AC_CONFIG_FILES(Makefile" 
     
    954958    #make sure there are properties first 
    955959 
     960    ts = " "*4 + 'static int init = 0;\n' 
     961    output.write(ts) 
     962    ts = " "*4 + "if( init == 0 ) {\n" 
     963    ts = ts + " "*8 + "if( props.length() == 0 ) {\n" 
     964    ts = ts + " "*12 + 'std::cout << "configure called with invalid props.length - " << props.length() << std::endl;\n' 
     965    ts = ts + " "*12 + "return;\n" 
     966    ts = ts + " "*8 + "}\n" 
     967    output.write(ts) 
     968 
     969    ts = " "*8 + "propertySet.length(props.length());" 
     970    ts = " "*8 + "for( int j=0; j < props.length(); j++ ) {\n" 
     971    ts = " "*12 + "propertySet[j].id = CORBA::string_dup(props[j].id);" 
     972    ts = " "*12 + "propertySet[j].value = props[j].value;" 
     973    ts = " "*8 + "}\n" 
     974    ts = " "*8 + "init = 1;" 
     975    ts = " "*4 + "}\n\n" 
     976    output.write(ts) 
     977 
     978 
    956979    ts = " "*4 + 'std::cout << "props length : " << props.length() << std::endl;\n\n' 
    957     ts = ts + " "*4 + "for (unsigned int i = 0; i <props.length(); i++)\n" 
     980    ts = ts + " "*4 + "for ( int i = 0; i <props.length(); i++)\n" 
    958981    ts = ts + " "*4 + "{\n"; output.write(ts) 
    959982    ts = " "*8 + 'std::cout << "Property id : " << props[i].id << std::endl;\n\n' 
     
    9821005            ts = " "*12 + 'props[i].value >>= simple_temp;\n'; 
    9831006            ts = ts + " "*12 + 'simple_' + str(simpleCount) + '_value = simple_temp;\n'; 
     1007            ts = ts + " "*12 + "for( int k = 0; k < propertySet.length(); k++ ) {\n" 
     1008            ts = ts + " "*16 + "if( strcmp(propertySet[k].id, props[i].id) == 0 ) {\n" 
     1009            ts = ts + " "*20 + "propertySet[i].value = props[i].value;\n" 
     1010            ts = ts + " "*20 + "break;\n" 
     1011            ts = ts + " "*16 + "}\n" 
     1012            ts = ts + " "*12 + "}\n" 
    9841013            ts = ts + " "*8 + "}\n\n" 
    9851014            output.write(ts) 
     
    11821211    inCount = 0; 
    11831212    outCount = 0; 
    1184     ts = " "*4 + "while(1)\n" + " "*4 + "{\n"; 
     1213    ts = " "*4 + "while(continue_processing())\n" + " "*4 + "{\n"; 
    11851214    output.write(ts) 
    11861215 
     
    13311360            continue 
    13321361            #declare input values short, shortsequence, float, floatSequence, unsupported 
    1333     #close the infinate while loop 
     1362    #close while loop 
    13341363 
    13351364    ts = " "*4 + "}\n"; output.write(ts) 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/generate/templates/basic_ports/sampleComp.cpp

    r5961 r9605  
    1010 
    1111    //Create the thread for the writer's processing function  
    12     processing_thread = new omni_thread(Run, (void *) this); 
     12    //processing_thread = new omni_thread(Run, (void *) this); 
    1313 
    1414    //Start the thread containing the writer's processing function  
    15     processing_thread->start(); 
     15    //processing_thread->start(); 
    1616 
    1717} 
     
    4343{ 
    4444    DEBUG(3, __IncludeFile__, "start() invoked") 
     45        omni_mutex_lock  l(processing_mutex); 
     46        if( false == thread_started ) 
     47        { 
     48                thread_started = true; 
     49                // Create the thread for the writer's processing function 
     50                processing_thread = new omni_thread(Run, (void *) this); 
     51 
     52                // Start the thread containing the writer's processing function 
     53                processing_thread->start(); 
     54        } 
    4555} 
    4656 
     
    4858 
    4959    DEBUG(3, __IncludeFile__, "stop() invoked") 
     60        omni_mutex_lock l(processing_mutex); 
     61        thread_started = false; 
    5062} 
    5163 
     
    6274{ 
    6375    DEBUG(3, __IncludeFile__, "initialize() invoked") 
     76} 
     77 
     78void __Class_name__::query( CF::Properties & configProperties ) throw (CORBA::SystemException, CF::UnknownProperties) 
     79{ 
     80        if( configProperties.length() == 0 ) 
     81        { 
     82                configProperties.length( propertySet.length() ); 
     83                for( int i = 0; i < propertySet.length(); i++ ) 
     84                { 
     85                        configProperties[i].id = CORBA::string_dup( propertySet[i].id ); 
     86                        configProperties[i].value = propertySet[i].value; 
     87                } 
     88                return; 
     89        } else { 
     90                for( int i = 0; i < configProperties.length(); i++ ) { 
     91                        for( int j = 0; j < propertySet.length(); j++ ) { 
     92                                if( strcmp(configProperties[i].id, propertySet[i].id) == 0 ) { 
     93                                        configProperties[i].value = propertySet[i].value; 
     94                                } 
     95                        } 
     96                } 
     97        } // end if-else 
    6498} 
    6599 
     
    83117} 
    84118 
     119bool __Class_name__::continue_processing() 
     120{ 
     121        omni_mutex_lock l(processing_mutex); 
     122        return thread_started; 
     123} 
     124 
    85125__ACE_SVC_DEF__ 
    86126 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/generate/templates/basic_ports/sampleComp.h

    r3319 r9605  
    4747    void initialize() throw (CF::LifeCycle::InitializeError, CORBA::SystemException); 
    4848 
     49        /// Query properties from .prf.xml 
     50        void query(CF::Properties&) 
     51                throw (CORBA::SystemException, 
     52                                CF::UnknownProperties); 
     53 
    4954    /// Configures properties read from .prf.xml 
    5055    void configure(const CF::Properties&) 
     
    6469    /// Main signal processing method 
    6570    void ProcessData(); 
     71        bool continue_processing(); 
     72        volatile bool thread_started; 
     73        omni_mutex processing_mutex; 
    6674    
    6775    omni_condition *component_running;  ///< for component shutdown 
  • ossiedev/branches/deepanns/tools/WaveDev/wavedev/importNode.py

    r8046 r9605  
    9393                del localfileNodeList 
    9494                break 
    95         pathSPD = parent.installPath + local_SPD 
     95        pathSPD = parent.installPath + "dev/" + local_SPD 
    9696 
    9797        if not os.path.exists(pathSPD): 
     
    104104        #pathSCD = "/sdr/sca/xml/"+newComp.baseName+"/"+doc_spd.softpkg.descriptor.localfile.name 
    105105        localfileNode = softpkgNode.getElementsByTagName("localfile")[0] 
    106         pathSCD = parent.installPath + "/"  + localfileNode.getAttribute("name") 
     106        pathSCD = parent.installPath + "dev"  + localfileNode.getAttribute("name") 
    107107 
    108108        doc_scd = xml.dom.minidom.parse(pathSCD) 
     
    119119            tmpInt = getInterface( node.getAttribute("repid"), tmpName ) 
    120120            if tmpInt == None: 
     121                errorMsg(parent, "No repid found in ProvidesPort") 
    121122                return None 
    122123            portTypeNodeList = node.getElementsByTagName("porttype") 
     
    130131            tmpInt = getInterface( node.getAttribute("repid"), tmpName ) 
    131132            if tmpInt == None: 
     133                errorMsg(parent, "No repid fond in UsesPort") 
    132134                return None 
    133135            portTypeNodeList = node.getElementsByTagName("porttype") 
  • ossiedev/branches/deepanns/tools/alf/ALF.py

    r9541 r9605  
    5454 
    5555import connectTool 
     56from namingserviceDialog import NamingserviceDialog 
    5657import compform 
    5758import shutil 
     
    6364# events with a particular action 
    6465[wxID_TOOLBAR_TIMING_TOOL, wxID_TOOLBAR_REFRESH_TOOL, 
    65 wxID_TOOLBAR_TIMING_DISPLAY_TOOL, wxID_TOOLBAR_CONNECT_TOOL] = [ 
    66                                                  wx.NewId() for x in range(4)] 
     66wxID_TOOLBAR_TIMING_DISPLAY_TOOL, wxID_TOOLBAR_CONNECT_TOOL, 
     67wxID_TOOLBAR_NAMINGSERVICE_DIALOG] = [wx.NewId() for x in range(5)] 
    6768 
    6869[wxID_NSBOX_POPUP_DISPLAY, wxID_NSBOX_POPUP_START,  
     
    140141        self.timing_display = None 
    141142        self.tools = None 
     143        self.connect_frame = None 
    142144        self.waveform_displays = {} 
    143145 
     146        # WARNING: if alf is restarted and waveforms are left running 
     147        # counters will overlap and cause a crash :/ 
    144148        self.compform_counter = 0 
    145149 
     
    148152        self.rootContext = None 
    149153        self.domMgr = None 
     154 
     155        self.namingservice = ['127.0.0.1', ''] 
    150156        self.init_CORBA() 
    151157         
     
    158164        self.availableWaveforms = {} 
    159165        self.availableComponents = {} 
     166        self.connections = {'127.0.0.1': []} 
    160167 
    161168        if self.rootContext != None: 
     
    167174        """Initialize an orb and try to connect to the DomainManager""" 
    168175 
    169         orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) 
    170         obj = orb.resolve_initial_references("NameService") 
    171176        try: 
    172             self.rootContext = obj._narrow(CosNaming.NamingContext) 
     177            sys.argv.index('-ORBInitRef') 
     178        except ValueError: 
     179            sys.argv.append('-ORBInitRef') 
     180            sys.argv.append('NameService=corbaname::'+self.namingservice[0]) 
     181 
     182        try: 
     183            self.orb.destroy() 
    173184        except: 
    174             ts = "Failed to narrow the root naming context.\n" 
    175             ts += "Are the Naming Service and nodeBooter running?" 
    176             errorMsg(self, ts) 
    177             self.rootContext = None 
    178             self.domMgr = None 
     185            pass 
     186 
     187        self.orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) 
     188        self.obj = self.orb.resolve_initial_references("NameService") 
     189        try: 
     190            self.rootContext = self.obj._narrow(CosNaming.NamingContext) 
     191        except: 
     192            newNS = False 
     193            while not newNS: 
     194                ts = "Failed to narrow the root naming context.\n" 
     195                ts += "Are the Naming Service and nodeBooter running on "+self.namingservice[0]+"?" 
     196                errorMsg(self, ts) 
     197                self.namingservice_dialog = NamingserviceDialog(self) 
     198                if self.namingservice_dialog.GetReturnCode() == 1: 
     199                    newNS = True 
    179200            return 
    180201         
     
    188209             
    189210        try: 
    190             obj = self.rootContext.resolve(name) 
     211            self.obj = self.rootContext.resolve(name) 
    191212        except: 
    192213            errorMsg(self,"DomainManger name not found") 
     
    194215            return 
    195216 
    196         self.domMgr = obj._narrow(CF.DomainManager) 
     217        self.domMgr = self.obj._narrow(CF.DomainManager) 
    197218  
    198219    #--------------------------------------------------------------- 
     
    334355        toolbar.AddSimpleTool(wxID_TOOLBAR_CONNECT_TOOL,connect_bmp,shortHelpString="Connect Tool") 
    335356 
    336  
     357        toolbar.AddSeparator() 
     358 
     359        net_img = wx.Image(root + '/images/network.png',type=wx.BITMAP_TYPE_PNG) 
     360        net_img.Rescale(24,24) 
     361        net_bmp = wx.BitmapFromImage(net_img) 
     362        toolbar.AddSimpleTool(wxID_TOOLBAR_NAMINGSERVICE_DIALOG,net_bmp,shortHelpString="Select Naming Service") 
    337363 
    338364        toolbar.Bind(wx.EVT_TOOL, self.OnToolBarClick) 
     
    369395 
    370396        elif event.GetId() == wxID_TOOLBAR_CONNECT_TOOL: 
    371             self.connect_frame = connectTool.create(self)    
     397            if self.connect_frame: 
     398                self.connect_frame.Raise() 
     399            else: 
     400                self.connect_frame = connectTool.create(self) 
     401 
     402        elif event.GetId() == wxID_TOOLBAR_NAMINGSERVICE_DIALOG: 
     403            self.namingservice_dialog = NamingserviceDialog(self) 
    372404 
    373405        # Refresh the display: Naming Service, Waveform List, and Canvas 
     
    484516            return 
    485517 
     518# NOTE: use CF::FileManager list to find SAD file 
    486519        sadfile = app._get_profile() 
    487520        sadfile = sadfile.replace('//','') 
    488521        wav_name = sadfile.replace('.sad.xml','') 
    489         sadpath = '/sdr/' + sadfile 
     522# NOTE: this is not a good idea 
     523        sadpath = '/sdr/dom/' + sadfile 
    490524 
    491525        self.active_wave = importWaveform.getWaveform(sadpath, self, self.Available_Ints) 
     
    510544            return 
    511545 
    512         appSeq =  self.domMgr._get_applications() 
     546        try: 
     547            appSeq =  self.domMgr._get_applications() 
     548        except: 
     549            newNS = False 
     550            while not newNS: 
     551                ts = 'Could not got a list of applications from the domain manager. Is nodeBooter running on this system?' 
     552                errorMsg(self, ts) 
     553                self.namingservice_dialog = NamingserviceDialog(self) 
     554                if self.namingservice_dialog.GetReturnCode() == 1: 
     555                    newNS = True 
     556            return 
     557 
     558 
    513559        members = dom_context.list(1000)  
    514560        for m in members[0]: 
     
    697743                available_dev_seq.append(curr_dev._get_identifier()) 
    698744                #print curr_dev._get_identifier() 
    699  
    700         clean_SAD = absolute_name_SAD.split("/sdr") 
     745# NOTE: use CF::FileManager to obtain file location 
     746        clean_SAD = absolute_name_SAD.split("/sdr/dom") 
    701747        name_SAD = clean_SAD[1] 
    702748        self.domMgr.installApplication(name_SAD) 
     
    760806#        self.refreshDisplay() 
    761807        self.DisplayInstalledWaveforms() 
     808        if self.connect_frame: 
     809            self.connect_frame.refreshDisplay() 
    762810 
    763811        return app 
     
    778826        self.compform_counter = self.compform_counter + 1 
    779827 
    780         tmp_dir_name = "/sdr/_tmp_alf_waveforms/"  # this is where I put my temporary 
     828        tmp_dir_name = "/sdr/dom/_tmp_alf_waveforms/"  # this is where I put my temporary 
    781829                                              # xml files 
    782830        tmp_wave_name = "_" + compName + str(self.compform_counter) 
     
    788836                os.mkdir(tmp_dir_name)    
    789837            except: 
    790                 errorMsg(self,"Cannot create temporary directory in the waveform directory.\n" + 
    791                         "You may need to change the temporary directory to one that you have write permissions to") 
    792  
    793         #Ticket#272: loop into /sdr/_tmp_alf_waveforms/ directory and see if tmp waveforms exists already 
    794         #with the same name. If found, increment the counter and form a new name for the temp 
    795         #waveform. Repeat this until you find a new name. 
    796         while (os.path.exists(tmp_dir_name + tmp_wave_name) == True ): 
    797             print tmp_wave_name + " exists already...Regenerating new name " 
    798             self.compform_counter = self.compform_counter + 1 
    799             tmp_wave_name = "_" + compName + str(self.compform_counter) 
    800  
     838                errorMsg(self,"Cannot create temporary directory in the waveform directory.  You may need to change the temporary directory to one that you have write permissions to") 
    801839 
    802840        if os.path.exists(tmp_dir_name + tmp_wave_name) == False:    
     
    804842                os.mkdir(tmp_dir_name + tmp_wave_name) 
    805843            except: 
    806                 errorMsg(self,"Cannot create temporary directory in the waveform directory.\n"  
    807                         "You may need to change the temporary directory to one that you have write permissions to") 
     844                errorMsg(self,"Cannot create temporary directory in the waveform directory.  You may need to change the temporary directory to one that you have write permissions to") 
    808845                return 
    809846  
     
    818855 
    819856        tmp_dir_name = tmp_dir_name +  tmp_wave_name + "/" 
     857        self.DisplayAvailableWaveforms() 
    820858        self.InstallWaveform(tmp_wave_name + ".sad.xml",  
    821859                             tmp_dir_name + tmp_wave_name + ".sad.xml", 
     
    852890        app_ref = self.nsBox.GetPyData(selection) 
    853891#        self.domMgr.uninstallApplication(app_ref._get_identifier()) # not sure if we need this or not 
     892 
     893        # Remove any connections we made with the connect tool to/from this waveform 
     894        for connection in reversed(self.connections[self.namingservice[0]]): 
     895            if waveform_name in connection['appNames']: 
     896                try: 
     897                    resourceRef = self.rootContext.resolve(connection['name']) 
     898                    resourceHandle = resourceRef._narrow(CF.Resource) 
     899                    portReference = resourceHandle.getPort(connection['port']) 
     900                    portHandle = portReference._narrow(CF.Port) 
     901                    portHandle.disconnectPort(connection['id']) 
     902                    self.connections[self.namingservice[0]].remove(connection) 
     903                except e: 
     904                    print e 
     905                    dial = wx.MessageDialog(self, 'Disconnect failed.', 'Failed', wx.OK) 
     906                    dial.ShowModal() 
     907 
     908 
    854909        app_ref.releaseObject() 
    855910#        self.refreshDisplay() 
    856911        self.DisplayInstalledWaveforms() 
    857                                          
     912 
     913        if self.connect_frame: 
     914            self.connect_frame.refreshDisplay() 
     915 
    858916 
    859917    def BuildDevSeq(self, dasXML): 
     
    938996        ogl.ShapeCanvas.__init__(self, parent) 
    939997 
    940         maxWidth  = 2100 
    941         maxHeight = 1000 
     998        maxWidth  = 3000 
     999        maxHeight = 1500 
    9421000        self.SetScrollbars(20, 20, maxWidth/20, maxHeight/20) 
    9431001 
     
    9671025                shape.SetCanvas(None) 
    9681026                shape.Destroy() 
    969         self.diagram.Destroy() 
    970  
    971  
     1027        self.diagram.Destroyparent 
    9721028#---------------------------------------------------------------------- 
    9731029 
  • ossiedev/branches/deepanns/tools/alf/compform.py

    r8264 r9605  
    2121'''generates a waveform out of a single component 
    2222command line inputs:  
    23 1. component name (in /sdr/xml) 
     231. component name (in /sdr/dom/xml) 
    24242. directory to put the waveform source code 
    25253. waveform name (optional).  if you do not specify waveform name,  
     
    116116        os.mkdir(genPath+'/'+waveName) 
    117117 
    118     comp_in = "/sdr/xml/" + comp_in 
     118# NOTE: use CF::FileManager to obtain file location 
     119    comp_in = "/sdr/dom/xml/" + comp_in 
    119120 
    120121    my_compform = compform(comp_in, genPath, waveName) 
  • ossiedev/branches/deepanns/tools/alf/config/alf.cfg

    r8158 r9605  
    22<alfconfiguration> 
    33    <version>Version 0.5.0</version> 
    4     <installpath>/sdr</installpath> 
     4    <installpath>/sdr/dom</installpath> 
    55    <stdidlpath></stdidlpath> 
    66    <ossieincludepath></ossieincludepath> 
  • ossiedev/branches/deepanns/tools/alf/connectTool.py

    r8264 r9605  
    1919import wx 
    2020 
    21 from omniORB import CORBA      # use this for the CORBA orb stuff  
    22                                # (pushing packets) 
     21import re 
    2322import sys       # for system commands (e.g., argv and argc stuff) 
    2423import CosNaming   # narrowing naming context stuff 
     24import random   # for generating random connection id 
    2525 
    2626try:   #mac / older OSSIE versions 
     
    3535 
    3636import loadAutomationFile 
     37import importWaveform 
    3738 
    3839def create(parent): 
    3940    ''' returns a wx frame representing the connect tool''' 
    40     return MainFrame(parent, -1) 
     41    win = MainFrame(parent, -1) 
     42    win.CenterOnParent() 
     43    return win 
    4144 
    4245 
     
    5962        self.alfFrameRef = parent 
    6063 
    61         self._init_CORBA()     # will get me an orb and a reference to the Domain Manager    
    62          
    6364        self._init_ctrls(self.alfFrameRef)   # initialize the wx stuff 
    6465        
     
    6667                                        # as a standalone without OSSIE to do  
    6768                                        # design work 
    68          self.getAvailableConnections()     
    69          self.setAvailableApplications() 
    70  
    71         self.uPortNameEditor.write('(uses port name)') 
    72         self.pPortNameEditor.write('(provides port name)') 
     69         self.refreshDisplay() 
    7370 
    7471        # This argument sets a default value for the automations file 
     
    9996        self.Show(True) 
    10097         
    101  
    102     def _init_CORBA(self): 
    103         """Initialize an orb and try to connect to the DomainManager""" 
    104  
    105         self.orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) 
    106         self.obj = self.orb.resolve_initial_references("NameService") 
    107         try: 
    108             self.rootContext = self.obj._narrow(CosNaming.NamingContext) 
    109         except: 
    110             ts = "Failed to narrow the root naming context.\n" 
    111             ts += "Are the Naming Service and nodeBooter running?" 
    112             print ts 
    113             self.rootContext = None 
    114             self.domMgr = None 
    115             return 
    116          
    117         if self.rootContext is None: 
    118             print "Failed to narrow the root naming context" 
    119             self.domMgr = None 
    120             return 
    121  
    122         name = [CosNaming.NameComponent("DomainName1",""), 
    123             CosNaming.NameComponent("DomainManager","")] 
    124              
    125         try: 
    126             self.obj = self.rootContext.resolve(name) 
    127         except: 
    128             print "DomainManger name not found" 
    129             self.domMgr = None 
    130             return 
    131  
    132         self.domMgr = self.obj._narrow(CF.DomainManager) 
    133          
    134         self.domain = "DomainName1" 
    135  
    136  
    137  
    13898    def _init_ctrls(self, prnt): 
    13999        ''' Initialize the wx controls''' 
     
    152112        # -------------------------------------------------------------------- 
    153113        # create the top sizer 
    154         # Uses editors: 
    155         self.uPortNameEditor = wx.TextCtrl(id=-1, 
    156                                         name=u'uPortNameEditor',  
    157                                         size=wx.Size(250, 30),  
    158                                         parent=panel,  
    159                                         style=0, value=u'') 
    160         self.pPortNameEditor = wx.TextCtrl(id=-1, 
    161                                         name=u'pPortNameEditor',  
    162                                         parent=panel,  
    163                                         size=wx.Size(250, 30),  
    164                                         style=0, value=u'') 
    165114 
    166115 
     
    213162                                    parent=panel, 
    214163                                    size=wx.Size(250, 30), style=0) 
     164        self.uCompChoice.Bind(wx.EVT_CHOICE, self.OnUCompSelection, id =-1) 
    215165        self.pCompChoice = wx.Choice(choices=[' '], id=-1, 
    216166                                    name=u'pCompChoice',  
    217167                                    parent=panel, 
    218168                                    size=wx.Size(250, 30), style=0) 
    219  
    220  
    221         #  port choices 
    222         #self.uPortChoice = wx.Choice(choices=[' '], id=-1, 
    223         #                            name=u'uPortChoice',  
    224         #                            parent=panel, 
    225         #                            size=wx.Size(250, 30), style=0) 
    226         #self.pPortChoice = wx.Choice(choices=[' '], id=-1, 
    227         #                            name=u'pPortChoice',  
    228         #                            parent=panel, 
    229         #                            size=wx.Size(250, 30), style=0) 
    230  
     169        self.pCompChoice.Bind(wx.EVT_CHOICE, self.OnPCompSelection, id =-1) 
     170 
     171 
     172        # port choices 
     173        self.uPortChoice = wx.Choice(choices=[' '], id=-1, 
     174                                    name=u'uPortChoice',  
     175                                    parent=panel, 
     176                                    size=wx.Size(250, 30), style=0) 
     177        self.pPortChoice = wx.Choice(choices=[' '], id=-1, 
     178                                    name=u'pPortChoice',  
     179                                    parent=panel, 
     180                                    size=wx.Size(250, 30), style=0) 
    231181 
    232182        # connect button 
    233183        self.ConnectBtn = wx.Button(id = -1, label='Connect', 
    234                                     parent=panel,  
    235                                     size=wx.Size(145, 50)) 
     184                                    parent=panel) 
    236185        self.ConnectBtn.Bind(wx.EVT_BUTTON, self.OnConnectBtn, id=-1) 
    237186        blankLabel3 = wx.StaticText(label = '', parent = panel) 
     
    243192                  self.appLabel, self.uAppChoice, self.pAppChoice,  
    244193                  self.compLabel, self.uCompChoice, self.pCompChoice, 
    245                   # self.portLabel, self.uPortChoice, self.pPortChoice, 
    246                   self.portLabel, self.uPortNameEditor, self.pPortNameEditor, 
     194                  self.portLabel, self.uPortChoice, self.pPortChoice, 
    247195                  blankLabel3, self.ConnectBtn, blankLabel4]) 
    248196        # -------------------------------------------------------------------- 
     
    251199        # -------------------------------------------------------------------- 
    252200        # second sizer 
     201        vSizer1 = wx.BoxSizer(wx.VERTICAL) 
     202        self.connectionsLabel = wx.StaticText(parent = panel, 
     203                                            label = "Connections:") 
     204        self.connectionsListBox = wx.ListBox(parent=panel, 
     205                                            size=wx.Size(700,150), 
     206                                            style=wx.LB_MULTIPLE, 
     207                                            ) 
     208        self.DisconnectBtn = wx.Button(parent=panel, 
     209                                            label='Disconnect') 
     210        self.DisconnectBtn.Bind(wx.EVT_BUTTON, self.OnDisconnectBtn) 
     211        vSizer1.Add(self.connectionsLabel, 0, wx.ALL, 5) 
     212        vSizer1.Add(self.connectionsListBox, 0, wx.ALL, 5) 
     213        vSizer1.Add(self.DisconnectBtn, 0, wx.ALL, 5) 
     214        # -------------------------------------------------------------------- 
     215 
     216 
     217        # -------------------------------------------------------------------- 
     218        # third sizer 
    253219        hSizer1 = wx.BoxSizer(wx.HORIZONTAL) 
    254220        self.automationFileEditor = wx.TextCtrl(id=-1, 
    255221                                        name=u'automationFileEditor',  
    256222                                        parent=panel,  
    257                                         size=wx.Size(250, 30),  
     223                                        size=wx.Size(350, 30),  
    258224                                        style=0, value=u'') 
     225        self.browseAutomationBtn = wx.Button(id = -1,  
     226                                           label='Browse', 
     227                                    parent=panel,  
     228                                    size=wx.Size(80, 30)) 
     229        self.browseAutomationBtn.Bind(wx.EVT_BUTTON,  
     230                                    self.onBrowseAutomationButton, 
     231                                    id=-1) 
    259232        self.loadAutomationBtn = wx.Button(id = -1,  
    260233                                           label='Load Automation File', 
    261234                                    parent=panel,  
    262                                     size=wx.Size(210, 50)) 
     235                                    size=wx.Size(180, 30)) 
    263236        self.loadAutomationBtn.Bind(wx.EVT_BUTTON,  
    264237                                    self.onLoadAutomationFileButton, 
    265238                                    id=-1) 
    266239        hSizer1.Add(self.automationFileEditor, 0, wx.ALL, 5) 
     240        hSizer1.Add(self.browseAutomationBtn, 0, wx.ALL, 5) 
    267241        hSizer1.Add(self.loadAutomationBtn, 0, wx.ALL, 5) 
    268242        # -------------------------------------------------------------------- 
     
    281255 
    282256        mainSizer.Add(flexSizer1, 0 , wx.EXPAND|wx.ALL, 10) 
    283  
    284257        mainSizer.Add(wx.StaticLine(panel), 0 , wx.EXPAND|wx.TOP|wx.BOTTOM, 5) 
    285          
     258        mainSizer.Add(vSizer1, 0, wx.EXPAND|wx.ALL, 10) 
     259        mainSizer.Add(wx.StaticLine(panel), 0 , wx.EXPAND|wx.TOP|wx.BOTTOM, 5) 
    286260        mainSizer.Add(hSizer1, 0, wx.EXPAND|wx.ALL, 10) 
    287261 
     
    291265         
    292266 
     267    def refreshDisplay(self): 
     268        self.getAvailableConnections() 
     269        self.setAvailableApplications() 
     270        self.connectionsListBox.SetItems([x['display'] for x in self.alfFrameRef.connections[self.alfFrameRef.namingservice[0]]]) 
     271 
    293272 
    294273    def getAvailableConnections(self): 
    295274        ''' Get a list of objects I can potentially connect to''' 
    296275 
    297         # Set the application selection to an instruction: 
    298         #self.uAppChoice.Clear() 
    299         #self.uAppChoice.Append('(Select Uese Waveform)') 
    300         #self.pAppChoice.Clear() 
    301         #self.pAppChoice.Append('(Select Provides Waveform)') 
    302          
    303276        # Initialize my dictionary  
    304277        self.avail_connects = {} 
    305278 
    306279        dom_obj = self.alfFrameRef.rootContext.resolve( 
    307                             [CosNaming.NameComponent("DomainName1","")]) 
     280                           [CosNaming.NameComponent("DomainName1","")]) 
    308281        dom_context = dom_obj._narrow(CosNaming.NamingContext)  
    309282        if dom_context is None: 
     
    312285        # get a list of applications running in the domain 
    313286        appSeq =  self.alfFrameRef.domMgr._get_applications() 
    314         members = dom_context.list(1000)  
     287        apps = {} 
     288        for app in appSeq: 
     289            sadfile = app._get_profile() 
     290            sadfile = sadfile.replace('//','') 
     291# NOTE:  Use CF::FileManager to obtain location 
     292            sadpath = '/sdr/dom/' + sadfile 
     293 
     294            waveform = importWaveform.getWaveform(sadpath, self.alfFrameRef, self.alfFrameRef.Available_Ints) 
     295            for comp in waveform.components: 
     296                for port in comp.ports: 
     297                    if apps.has_key(waveform.name): 
     298                        if apps[waveform.name].has_key(comp.name): 
     299                            apps[waveform.name][comp.name][port.name] = port.type 
     300                        else: 
     301                            apps[waveform.name][comp.name] = {port.name: port.type} 
     302                    else: 
     303                        apps[waveform.name] = {comp.name: {port.name: port.type}} 
     304 
     305        p = re.compile("^(OSSIE::.+)_\d+$") 
     306        members = dom_context.list(1000) 
    315307        for m in members[0]: 
    316308            wav_name = str(m.binding_name[0].id) 
     309 
    317310            wav_obj = dom_context.resolve( 
    318311                                [CosNaming.NameComponent(wav_name,"")]) 
     
    321314                continue 
    322315 
    323             contextApp = None 
    324             foundApp = False 
    325             for app in appSeq: 
    326                 compNameCon = app._get_componentNamingContexts() 
    327                
    328  
    329                 for compElementType in  compNameCon: 
    330                     if wav_name in compElementType.elementId: 
    331                         comp_name = compElementType.elementId.split("/") 
    332                         comp_name = comp_name[2] 
    333   
    334                         if self.avail_connects.has_key(wav_name): 
    335                             self.avail_connects[wav_name].append(comp_name) 
    336                         else: 
    337                             self.avail_connects[wav_name] = [comp_name] 
    338                         waveformApp = app 
    339                         foundApp = True 
    340  
    341             if not foundApp: 
    342                 print "Could not find associated application for: " + wav_name 
    343                 continue 
    344  
     316            m = p.match(wav_name) 
     317            if m: 
     318                if apps[m.group(1)]: 
     319                    self.avail_connects[wav_name] = apps[m.group(1)] 
     320                else: 
     321                    print "Could not find associated application for: " + wav_name 
     322                    continue 
    345323 
    346324    def setAvailableApplications(self): 
     
    362340        self.pAppChoice.SetSelection(0)  
    363341 
     342        self.uCompChoice.Clear(); 
     343        self.pCompChoice.Clear(); 
     344        self.uPortChoice.Clear(); 
     345        self.pPortChoice.Clear(); 
     346          
     347 
    364348    def OnPAppSelection(self, event): 
    365349        ''' Should occur when the user has selected a provides application. 
     
    369353        choice = str(self.pAppChoice.GetStringSelection()) 
    370354        self.pCompChoice.Clear() 
    371         self.pCompChoice.Append('(Choose Component)') 
    372         for c in self.avail_connects[choice]: 
    373             self.pCompChoice.Append(c) 
    374         self.pCompChoice.SetSelection(0) 
     355        self.pPortChoice.Clear() 
     356        if choice != '(Choose Application)': 
     357            self.pCompChoice.Append('(Choose Component)') 
     358            for c in self.avail_connects[choice].keys(): 
     359                self.pCompChoice.Append(c) 
     360            self.pCompChoice.SetSelection(0) 
     361 
    375362        event.Skip() 
    376363     
     
    382369        choice = str(self.uAppChoice.GetStringSelection()) 
    383370        self.uCompChoice.Clear() 
    384         self.uCompChoice.Append('(Choose Component)') 
    385         for c in self.avail_connects[choice]: 
    386             self.uCompChoice.Append(c) 
    387         self.uCompChoice.SetSelection(0) 
     371        self.uPortChoice.Clear() 
     372        if choice != '(Choose Application)': 
     373            self.uCompChoice.Append('(Choose Component)') 
     374            for c in self.avail_connects[choice].keys(): 
     375                self.uCompChoice.Append(c) 
     376            self.uCompChoice.SetSelection(0) 
     377 
    388378        event.Skip() 
    389379 
    390  
     380    def OnPCompSelection(self, event): 
     381        ''' Should occur when the user has selected a provides component. 
     382            Adds a list of the available ports in the selected proviedes 
     383            component to the wx.choice for provides ports.''' 
     384 
     385        app_choice = str(self.pAppChoice.GetStringSelection()) 
     386        comp_choice = str(self.pCompChoice.GetStringSelection()) 
     387        self.pPortChoice.Clear() 
     388        if comp_choice != '(Choose Component)': 
     389            self.pPortChoice.Append('(Choose Port)') 
     390            for p,type in self.avail_connects[app_choice][comp_choice].iteritems(): 
     391                if type == "Provides": 
     392                    self.pPortChoice.Append(p) 
     393            self.pPortChoice.SetSelection(0) 
     394 
     395        event.Skip() 
     396 
     397    def OnUCompSelection(self, event): 
     398        ''' Should occur when the user has selected a uses component. 
     399            Adds a list of the usesavailable ports in the selected  
     400            component to the wx.choice for uses ports.''' 
     401 
     402        app_choice = str(self.uAppChoice.GetStringSelection()) 
     403        comp_choice = str(self.uCompChoice.GetStringSelection()) 
     404        self.uPortChoice.Clear() 
     405        if comp_choice != '(Choose Component)': 
     406            self.uPortChoice.Append('(Choose Port)') 
     407            for p,type in self.avail_connects[app_choice][comp_choice].iteritems(): 
     408                if type == "Uses": 
     409                    self.uPortChoice.Append(p) 
     410            self.uPortChoice.SetSelection(0) 
     411 
     412        event.Skip() 
    391413 
    392414    def OnConnectBtn(self,event): 
     
    395417            Then calls connect method.''' 
    396418 
    397         pPortName = str(self.pPortNameEditor.GetLineText(0)) 
    398         uPortName = str(self.uPortNameEditor.GetLineText(0)) 
    399  
     419        uPortName = str(self.uPortChoice.GetStringSelection()) 
     420        pPortName = str(self.pPortChoice.GetStringSelection()) 
    400421        uAppInstName = str(self.uAppChoice.GetStringSelection()) 
    401422        pAppInstName = str(self.pAppChoice.GetStringSelection()) 
     
    403424        pCompInstName = str(self.pCompChoice.GetStringSelection()) 
    404425 
    405         self.Connect( uAppInstName, uCompInstName, uPortName, 
    406                       pAppInstName, pCompInstName, pPortName) 
    407         
     426        if not uPortName or not pPortName: 
     427            dial = wx.MessageDialog(self, 'Please select both a uses port and provides port to make a connection.', 'Ports Not Selected', wx.OK) 
     428            dial.ShowModal() 
     429        else: 
     430           self.Connect( uAppInstName, uCompInstName, uPortName, 
     431                          pAppInstName, pCompInstName, pPortName) 
     432     
    408433        event.Skip() 
    409434 
     
    412437                      pAppInstName, pCompInstName, pPortName): 
    413438  
    414  
    415         if self.rootContext is None: 
     439        rootContext = self.GetParent().rootContext 
     440        if rootContext is None: 
    416441            print "Failed to narrow the root naming context" 
    417442            sys.exit(1) 
     
    419444        # get a reference to the provides port: 
    420445        # don't forget OSSIE:: in waveform name 
    421         pname = [CosNaming.NameComponent(self.domain,''), 
     446        pname = [CosNaming.NameComponent('DomainName1',''), 
    422447                 CosNaming.NameComponent(pAppInstName,''), 
    423448                 CosNaming.NameComponent(pCompInstName,'')] 
    424449         
    425450        try: 
    426             pResourceRef = self.rootContext.resolve(pname) 
     451            pResourceRef = rootContext.resolve(pname) 
    427452        except: 
    428453            print "provides resource not found" 
     
    435460        # get a reference to the uses port: 
    436461        # don't forget OSSIE:: in waveform name 
    437         uname = [CosNaming.NameComponent(self.domain,''), 
     462        uname = [CosNaming.NameComponent('DomainName1',''), 
    438463                 CosNaming.NameComponent(uAppInstName,''), 
    439464                 CosNaming.NameComponent(uCompInstName,'')] 
    440465        try: 
    441             uResourceRef = self.rootContext.resolve(uname) 
     466            uResourceRef = rootContext.resolve(uname) 
    442467      
    443468        except: 
     
    458483        # make up some arbitrary connectionid that will be used for  
    459484        # disconnectPort later 
    460         uPortHandle.connectPort(pPortReference, 
    461                                 "thisismyconnectionid_" + uPortName) 
    462  
    463         # It is important to the the user know that the connection is made 
    464         # otherwise it looks like the connect button is not responding 
    465         print "Connection made successfully." 
    466        
     485        try: 
     486            connection_id = str(random.randint(100000,999999)) + "_" + uPortName 
     487            uPortHandle.connectPort(pPortReference, connection_id) 
     488             
     489            connection_display = uAppInstName + ":" + uCompInstName + ":" + uPortName + "-->" + pAppInstName + ":" + pCompInstName + ":" + pPortName 
     490            connection = { 
     491                    'name': uname, 
     492                    'port': uPortName, 
     493                    'id': connection_id, 
     494                    'appNames': [uAppInstName, pAppInstName], 
     495                    'display': connection_display, 
     496                } 
     497            self.alfFrameRef.connections[self.alfFrameRef.namingservice[0]].append(connection) 
     498            self.connectionsListBox.Append(connection['display']) 
     499        except e: 
     500            print e 
     501            dial = wx.MessageDialog(self, 'Connection failed.', 'Failed', wx.OK) 
     502            dial.ShowModal() 
     503 
     504    def OnDisconnectBtn(self,event): 
     505        for x in reversed(self.connectionsListBox.GetSelections()): 
     506            connection = self.alfFrameRef.connections[self.alfFrameRef.namingservice[0]][x] 
     507            try: 
     508                rootContext = self.GetParent().rootContext 
     509                resourceRef = rootContext.resolve(connection['name']) 
     510                resourceHandle = resourceRef._narrow(CF.Resource) 
     511                portReference = resourceHandle.getPort(connection['port']) 
     512                if portReference is None: 
     513                    print "Failed to get port reference for disconnect." 
     514                    return 
     515                portHandle = portReference._narrow(CF.Port) 
     516                portHandle.disconnectPort(connection['id']) 
     517                del self.alfFrameRef.connections[self.alfFrameRef.namingservice[0]][x] 
     518                self.connectionsListBox.Delete(x) 
     519            except e: 
     520                print e 
     521                dial = wx.MessageDialog(self, 'Disconnect failed.', 'Failed', wx.OK) 
     522                dial.ShowModal() 
     523 
     524    def onBrowseAutomationButton(self,event): 
     525        ''' This is what happens when the Browse button is pressed. 
     526            Will load a file dialog and allow the user to browse for an 
     527            automation file.''' 
     528        dlg = wx.FileDialog(self, "Choose automation file", "", "", "XML Files (*.xml)|*.xml|All Files|*", wx.FD_OPEN) 
     529        if dlg.ShowModal() == wx.ID_OK: 
     530            filename = dlg.GetFilename() 
     531            directory = dlg.GetDirectory() 
     532            self.automationFileEditor.Clear() 
     533            self.automationFileEditor.write(directory + filename) 
     534        dlg.Destroy() 
    467535 
    468536    def onLoadAutomationFileButton(self,event): 
  • ossiedev/branches/deepanns/tools/alf/importWaveform.py

    r8264 r9605  
    7474        localfilename = componentfileNode.getElementsByTagName("localfile")[0].getAttribute("name") 
    7575        #tmps = cf.localfile.name.replace('../..', '/sdr') # get absolute path 
    76         tmps = "/sdr/" + localfilename 
     76        # NOTE: use CF::FileManager to list to find SPD file 
     77        tmps = "/sdr/dom" + localfilename 
    7778        base_name = getBaseName(tmps) 
    7879        # TODO: this next line is a dirty hack: use the python os module to strip name from path 
  • ossiedev/branches/deepanns/tools/alf/loadAutomationFile.py

    r8264 r9605  
    5151        self._init_ORB()    # gives me self.orb and self.rootContext 
    5252 
    53         self.waveform_XML_dir = '/sdr/waveforms/' 
    54         self.comp_XML_dir = '/sdr/xml/' 
     53# NOTE: use CF::FileManager to obtain file locations 
     54        self.waveform_XML_dir = '/sdr/dom/waveforms/' 
     55        self.comp_XML_dir = '/sdr/dom/xml/' 
    5556 
    5657        self.header_len = 1 
     
    213214        self.alfFrameRef.compform_counter = self.alfFrameRef.compform_counter + 1 
    214215 
    215         tmp_dir_name = "/sdr/_tmp_alf_waveforms/"  # this is where I put my temporary 
     216        tmp_dir_name = "/sdr/dom/_tmp_alf_waveforms/"  # this is where I put my temporary 
    216217                                              # xml files 
    217218        tmp_wave_name = "_" + compName + str(self.alfFrameRef.compform_counter) 
  • ossiedev/branches/deepanns/tools/wavedash/src/WavedashController.py

    r9570 r9605  
    3030import WavedashUtils as utils 
    3131 
    32 SDR_DIR = '/sdr/' 
     32SDR_DIR = '/sdr/dom/' 
    3333SDR_WAVEFORMS_DIR = SDR_DIR + 'waveforms/' 
    3434COMP_WAVEFORMS_DIR = SDR_DIR + '_tmp_alf_waveforms' 
  • ossiedev/branches/deepanns/tools/wavedash/src/WavedashUtils.py

    r9540 r9605  
    247247                #print curr_dev._get_identifier() 
    248248 
    249         clean_SAD = wformSAD.split("/sdr") 
     249        clean_SAD = wformSAD.split("/sdr/dom") 
    250250        rel_wformSAD = clean_SAD[1] 
    251251        self.domMgr.installApplication(rel_wformSAD) 
  • ossiedev/branches/deepanns/tools/wavedash/src/WavedashView.py

    r9572 r9605  
    7575         
    7676        self.SetSize(OSSIE_WAVEAPP_DIMENSION) 
    77         #self.SetMaxSize((800,800)) 
     77        self.Center() 
    7878         
    7979