root/ossiedev/trunk/tools/wavedash/src/NodeBooterUtils.py @ 10448

Revision 10448, 2.2 KB (checked in by Snyder.Jason, 3 years ago)

changed config file property format

Line 
1## Copyright 2005, 2006, 2007, 2008, 2009 Virginia Polytechnic Institute and State University
2##
3## This file is part of the OSSIE ALF Waveform Application Visualization Environment
4##
5## ALF is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 2 of the License, or
8## (at your option) any later version.
9##
10## ALF is distributed in the hope that it will be useful, but WITHOUT ANY
11## WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13## GNU General Public License for more details.
14##
15## You should have received a copy of the GNU General Public License
16## along with OSSIE Waveform Developer; if not, write to the Free Software
17## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19import os
20import subprocess
21import shlex
22import time
23import ConfigParser
24
25DEFAULT_DOMAIN_MANAGER = 'dom/domain/DomainManager.dmd.xml'
26DEFAULT_DEVICE_MANAGER = 'dev/nodes/default_GPP_node/DeviceManager.dcd.xml'
27
28class NodeBooterUtils:
29    def __init__(self, controller):
30        self.controller = controller
31   
32    def nodeBooterIsRunning(self):
33        processes = os.popen('ps x | grep nodeBooter').read()
34        processes = processes.split()
35        return ('/usr/local/bin/nodeBooter' in processes or '/usr/bin/nodeBooter' in processes)
36
37    def startNodeBooter(self):
38        if self.controller.OSSIEPropertyFileExists():
39            domainManager = self.controller.getOSSIEProperty('ossie', 'default.domain.manager')
40            deviceManager = self.controller.getOSSIEProperty('ossie', 'default.device.manager')
41        if domainManager == None:
42            domainManager = DEFAULT_DOMAIN_MANAGER
43        if deviceManager == None:
44            deviceManager = DEFAULT_DEVICE_MANAGER
45       
46        command = '/usr/local/bin/nodeBooter -D ' + domainManager + ' -d ' + deviceManager
47        args = shlex.split(command)
48        print "NodeBooter not running. Starting now with command: " + command
49        nodeBooterProcess = subprocess.Popen(args, cwd='/sdr')
50        time.sleep(2)
51        return nodeBooterProcess
52           
Note: See TracBrowser for help on using the browser.