def __init__(self, mainController, drawWidget=None): super(QtGui.QWidget, self).__init__() self.listItems = {} myBoxLayout = QtGui.QVBoxLayout() self.setLayout(myBoxLayout) self.toolbar = QtGui.QToolBar() self.mainController = mainController self.__objectHandler = mainController.getb(u"ObjectHandler") self.__projectController = mainController self.myListWidget = PX_Tab_SignalSelect_TreeView( self, self.listItems, mainDrawingWidget=drawWidget) self.myListWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.model = treeModel_Signals(self, self.myListWidget, self) self.myListWidget.setModel(self.model) # Signals ######### self.connect(self.myListWidget, QtCore.SIGNAL("guiAction__plotSignal"), self.plotSignal) self.connect(self.__projectController.mainWindow, QtCore.SIGNAL(u"dataChanged__signals"), self.updateSignalTab) self.connect(self.__projectController.mainWindow, QtCore.SIGNAL(u"dataChanged__mapping"), self.repaint) self.connect(self.__projectController.mainWindow, QtCore.SIGNAL(u"dataChanged__mapping"), self.myListWidget.mainDrawingWidget.repaint) myBoxLayout.addWidget(self.toolbar) myBoxLayout.addWidget(self.myListWidget) ## Tool-Bar self.toolbar.setIconSize(QtCore.QSize(16, 16)) # Add Action to Toolbar self.__actionLoad = helper.loadAction(widget=self, IconPath =u"./Recources/Icons/openSignal24.png", ToolTip=u"Load Signal File",\ ShortCut=u"Ctrl+L", Callback=self.loadSignalFile, ToolBar=self.toolbar) self.__actionMap = helper.loadAction(widget=self, IconPath =u"./Recources/Icons/SignalMapping16.png", ToolTip=u"Map Signals by Name",\ ShortCut=u"Ctrl+M", Callback=self.mapSignalsByName, ToolBar=self.toolbar) self.__actionDelMap = helper.loadAction(widget=self, IconPath =u"./Recources/Icons/deleteMap16.png", ToolTip=u"Delete Mapping",\ Callback=self.delMap, ToolBar=self.toolbar) self.toolbar.setStyleSheet(u".QToolBar {border: 0px;}") self.SignalFileName = None self.SignalName = None # Turns interacive mode of matplotlib.pyplot on pyplot.ion() self.repaint()
def __init__(self, mainController, drawWidget = None ): super(QtGui.QWidget,self).__init__() self.listItems={} myBoxLayout = QtGui.QVBoxLayout() self.setLayout(myBoxLayout) self.toolbar = QtGui.QToolBar() self.mainController = mainController self.__signalsFolder = mainController.getb(u"signalFiles") self.__objectHandler = mainController.getb(u"ObjectHandler") self.myListWidget = PX_Tab_SignalSelect_TreeView(self, self.listItems, mainDrawingWidget = drawWidget ) self.myListWidget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.model = treeModel_Signals(self, self.myListWidget, self) self.myListWidget.setModel(self.model) self.connect(self.myListWidget, QtCore.SIGNAL("plotSignal"), self.plotSignal) myBoxLayout.addWidget(self.toolbar) myBoxLayout.addWidget(self.myListWidget) ## Tool-Bar self.toolbar.setIconSize (QtCore.QSize(16,16)) # Add Action to Toolbar self.__actionLoad = helper.loadAction(widget=self, IconPath =u"./Recources/Icons/openSignal24.png", ToolTip=u"Load Signal File",\ ShortCut=u"Ctrl+L", Callback=self.loadSignalFile, ToolBar=self.toolbar) self.__actionMap = helper.loadAction(widget=self, IconPath =u"./Recources/Icons/SignalMapping16.png", ToolTip=u"Map Signals by Name",\ ShortCut=u"Ctrl+M", Callback=self.mapSignalsByName, ToolBar=self.toolbar) self.__actionDelMap= helper.loadAction(widget=self, IconPath =u"./Recources/Icons/deleteMap16.png", ToolTip=u"Delete Mapping",\ Callback=self.delMap, ToolBar=self.toolbar) self.toolbar.setStyleSheet(u".QToolBar {border: 0px;}") self.SignalFileName = None # Turns interacive mode of matplotlib.pyplot on pyplot.ion() self.repaint()
def __init__(self, mainController): super(QtGui.QWidget, self).__init__() self.listItems = {} myBoxLayout = QtGui.QVBoxLayout() self.setLayout(myBoxLayout) self.toolbar = QtGui.QToolBar() self.mainController = mainController self.__objectHandler = mainController.getb(u"ObjectHandler") objects = self.__objectHandler.listObjects self.widget = PX_Tab_Recorder_TreeView(self, self.listItems) self.model = treeModel_Recorder(self, objects, self.widget, self) #self.model = treeModel_Recorder(self,objects, self ) self.__recorder_RecordState = PX_ObjectHandler.PX_ObjectHandler.recorderState.off self.__recorder_VariablesToRecord = self.__objectHandler.get( u"recorder_VariablesToRecord") self.__recorder_fileFormat = self.__objectHandler.get( u"recorder_fileFormat") self.listItems = {} # Initialize Model VariablesToRecord = self.__objectHandler.listObjects self.model.loadObjects(VariablesToRecord) self.widget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.widget.setModel(self.model) myBoxLayout.addWidget(self.toolbar) myBoxLayout.addWidget(self.widget) ## Tool-Bar self.toolbar.setIconSize(QtCore.QSize(16, 16)) # Add Action to Toolbar self.__actionRecordFull = helper.loadAction(widget=self,\ IconPath =u"./Recources/Icons/recordFull16.png",\ ToolTip=u"Record all Variables",\ ShortCut=u"Ctrl+L", \ Callback=self.recordAll, \ ToolBar=self.toolbar, \ checkable = True) self.__actionRecordPart = helper.loadAction(widget=self, \ IconPath =u"./Recources/Icons/recordPart16.png", \ ToolTip=u"Record selected Variables",\ ShortCut=u"Ctrl+M", \ Callback=self.recordPart, \ ToolBar=self.toolbar, \ checkable = True) emptyWidget = QtGui.QWidget() emptyWidget.setSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Preferred) self.toolbar.addWidget(emptyWidget) # Selector for output file format self.__comboBoxFileFormat = QtGui.QComboBox() self.__comboBoxFileFormat.addItem(u"mdf") self.__comboBoxFileFormat.addItem(u"csv") self.__comboBoxFileFormat.setToolTip(u"Select Output FIle Format") self.__comboBoxFileFormat.currentIndexChanged.connect( self.__onIndexComboFileForamtChangeed) self.toolbar.addWidget(self.__comboBoxFileFormat) self.toolbar.setStyleSheet(u".QToolBar {border: 0px;}") self.SignalFileName = None self.repaint()
def __init__(self, mainController): super(QtGui.QWidget,self).__init__() self.listItems={} myBoxLayout = QtGui.QVBoxLayout() self.setLayout(myBoxLayout) self.toolbar = QtGui.QToolBar() self.mainController = mainController self.__objectHandler = mainController.getb(u"ObjectHandler") objects = self.__objectHandler.get(u"listObjects") self.widget = PX_Tab_Recorder_TreeView(self, self.listItems) self.model = treeModel_Recorder(self,objects, self.widget ) self.__recorder_RecordState = PX_ObjectHandler.PX_ObjectHandler.recorderState.off self.__recorder_VariablesToRecord = self.__objectHandler.get(u"recorder_VariablesToRecord") self.__recorder_fileFormat = self.__objectHandler.get(u"recorder_fileFormat") self.listItems = {} # Initialize Model VariablesToRecord = self.__objectHandler.get(u"listObjects") self.model.loadObjects(VariablesToRecord) self.widget.setContextMenuPolicy(QtCore.Qt.CustomContextMenu) self.widget.setModel(self.model) myBoxLayout.addWidget(self.toolbar) myBoxLayout.addWidget(self.widget) ## Tool-Bar self.toolbar.setIconSize (QtCore.QSize(16,16)) # Add Action to Toolbar self.__actionRecordFull = helper.loadAction(widget=self,\ IconPath =u"./Recources/Icons/recordFull16.png",\ ToolTip=u"Record all Variables",\ ShortCut=u"Ctrl+L", \ Callback=self.recordAll, \ ToolBar=self.toolbar, \ checkable = True) self.__actionRecordPart = helper.loadAction(widget=self, \ IconPath =u"./Recources/Icons/recordPart16.png", \ ToolTip=u"Record selected Variables",\ ShortCut=u"Ctrl+M", \ Callback=self.recordPart, \ ToolBar=self.toolbar, \ checkable = True) emptyWidget = QtGui.QWidget() emptyWidget.setSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Preferred) self.toolbar.addWidget(emptyWidget) # Selector for output file format self.__comboBoxFileFormat = QtGui.QComboBox() self.__comboBoxFileFormat.addItem(u"mdf") self.__comboBoxFileFormat.addItem(u"csv") self.__comboBoxFileFormat.setToolTip(u"Select Output FIle Format") self.__comboBoxFileFormat.currentIndexChanged.connect(self.__onIndexComboFileForamtChangeed) self.toolbar.addWidget(self.__comboBoxFileFormat) self.toolbar.setStyleSheet(u".QToolBar {border: 0px;}") self.SignalFileName = None self.repaint()