From: <sr...@ce...> - 2016-01-13 16:08:37
|
From: Sergio Rubio Manrique <sr...@ce...> --- lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py index 9901ec3..6f4f59c 100644 --- a/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py +++ b/lib/taurus/qt/qtgui/table/taurusdevicepropertytable.py @@ -31,8 +31,7 @@ __all__ = ["TaurusPropTable"] from taurus.external.qt import Qt, QtCore, QtGui from taurus.qt.qtgui.base import TaurusBaseWidget -import taurus.core -import PyTango +import taurus,taurus.core class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget): ''' @@ -67,7 +66,7 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget): return QtGui.QTableWidget.minimumSizeHint(self) def getModelClass(self): - return taurus.core.taurusdatabase.TaurusDatabase + return taurus.core.TaurusDevice @classmethod def getQtDesignerPluginInfo(cls): @@ -94,6 +93,10 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget): # My methods #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~- + def setModel(self,model): + TaurusBaseWidget.setModel(self,model) + self.setTable(model) + @QtCore.pyqtSignature("setTable(QString)") def setTable(self,dev_name): ''' @@ -101,7 +104,7 @@ class TaurusPropTable(QtGui.QTableWidget, TaurusBaseWidget): This method fill the table with the names of properties and values for the device selected in the TaurusClassTable ''' QtCore.QObject.disconnect(self,QtCore.SIGNAL("cellChanged(int,int)"),self.valueChanged) - self.db = PyTango.Database() + self.db = taurus.Database() dev_name = str(dev_name) self.list_prop = list(self.db.get_device_property_list(dev_name,'*')) self.setRowCount(len(self.list_prop)) @@ -377,7 +380,7 @@ if __name__ == '__main__': widget = TaurusPropTable() args = sys.argv[1:] if not args: args = ['tango/admin/%s'%(os.environ['TANGO_HOST'].split(':')[0])] - widget.setTable(sys.args) + widget.setTable(args) widget.show() app.exec_() -- 2.4.6 |