Minor changes:

- flowchart emits state change signal when chart is loaded
 - metaarray workaround for lack of h5py debugging symbols
This commit is contained in:
Luke Campagnola 2012-08-17 16:13:10 -04:00
parent 45312120b1
commit 03d618e1b8
3 changed files with 35 additions and 3 deletions

View File

@ -236,6 +236,7 @@ class ConsoleWidget(QtGui.QWidget):
if catch:
self.ui.catchNextExceptionBtn.setChecked(False)
exceptionHandling.register(self.allExceptionsHandler)
self.ui.exceptionBtn.setChecked(True)
else:
exceptionHandling.unregister(self.allExceptionsHandler)
@ -248,6 +249,7 @@ class ConsoleWidget(QtGui.QWidget):
if catch:
self.ui.catchAllExceptionsBtn.setChecked(False)
exceptionHandling.register(self.nextExceptionHandler)
self.ui.exceptionBtn.setChecked(True)
else:
exceptionHandling.unregister(self.nextExceptionHandler)

View File

@ -515,6 +515,7 @@ class Flowchart(Node):
self.sigChartLoaded.emit()
self.outputChanged()
self.sigStateChanged.emit()
#self.sigOutputChanged.emit()
def loadFile(self, fileName=None, startDir=None):

View File

@ -855,12 +855,18 @@ class MetaArray(object):
if 'close' in kargs and readAllData is None: ## for backward compatibility
readAllData = kargs['close']
if not HAVE_HDF5:
raise Exception("The file '%s' is HDF5-formatted, but the HDF5 library (h5py) was not found." % fileName)
if readAllData is True and writable is True:
raise Exception("Incompatible arguments: readAllData=True and writable=True")
if not HAVE_HDF5:
try:
assert writable==False
assert readAllData != False
self._readHDF5Remote(fileName)
return
except:
raise Exception("The file '%s' is HDF5-formatted, but the HDF5 library (h5py) was not found." % fileName)
## by default, readAllData=True for files < 500MB
if readAllData is None:
size = os.stat(fileName).st_size
@ -884,6 +890,29 @@ class MetaArray(object):
else:
self._data = f['data'][:]
f.close()
def _readHDF5Remote(self, fileName):
## Used to read HDF5 files via remote process.
## This is needed in the case that HDF5 is not importable due to the use of python-dbg.
proc = getattr(MetaArray, '_hdf5Process', None)
if proc == False:
raise Exception('remote read failed')
if proc == None:
import pyqtgraph.multiprocess as mp
#print "new process"
proc = mp.Process(executable='/usr/bin/python')
proc.setProxyOptions(deferGetattr=True)
MetaArray._hdf5Process = proc
MetaArray._h5py_metaarray = proc._import('pyqtgraph.metaarray')
ma = MetaArray._h5py_metaarray.MetaArray(file=fileName)
self._data = ma.asarray()._getValue()
self._info = ma._info._getValue()
#print MetaArray._hdf5Process
#import inspect
#print MetaArray, id(MetaArray), inspect.getmodule(MetaArray)
@staticmethod
def mapHDF5Array(data, writable=False):