def show_attrs(self, names): """ Callback to show a list of attributes. """ if self.dev: (val, err) = self.fetch_values(names) if len(err): QtGui.QMessageBox.critical( self._parent, _trUtf8("TANGO error"), _trUtf8("There was errors while reading attributes.\nErrors:\n%s") % ("\n".join(err), )) return try: # Remove scalar values for i in range(len(names) - 1, -1, -1): if type(val[i]) is np.ndarray: continue if type(val[i]) is tuple and type(val[i][0]) is np.ndarray and type(val[i][1]) is np.ndarray: continue self.logger.info("Ignoring dataset '%s' of type '%s'.", names[i], type(val[i])) del val[i] del names[i] if len(val) > 0: dlg = PlotDialog(names, val, self._parent) dlg.show() #dlg.names = names self._parent.dialogs.append(dlg) else: QtGui.QMessageBox.warning( self._parent, _trUtf8("Display error"), _trUtf8("The selected variable cannot be plotted.")) except Exception, e: self.logger.error("Got exception in show_attrs (Error: %s)", e, exc_info=True)
def view_dataset_multi(self, names): """ Save multiple dataset to an HDF5 file. """ try: # Remove scalar values names = [n for n in names if self._data[n].name() != "Scalar"] values = self.fetch_data(names) if len(values) > 0: dlg = PlotDialog(names, values, self._parent) dlg.show() self._parent.dialogs.append(dlg) else: QtGui.QMessageBox.warning( self._parent, _trUtf8("Display error"), _trUtf8("The selected variable cannot be plotted.") ) except Exception, e: self.logger.error("Got exception in show_attrs (Error: %s)", e, exc_info=True)