Ejemplo n.º 1
0
    def on_actionLoadProject(self):
         
        strPath = os.getcwd()
        _file, strSavePath = helper.showFileSelectionDialog(self.ui,strPath, bDir = False,strHeader ="Select File to load Project...",\
                                                     strExt = u"*.pyp",\
                                                     dialogType = u"load")  
 
        if _file == None:
            return
         
        old_Controller = self.mainController
 
        self.mainController = PyLinXMainController.PyLinXMainController(mainWindow = self )
        _file_read = _file.read()
 
        self.mainController.execScript(_file_read)
         
        old_Controller.delete()
        newProject = self.mainController.getb(u"rootGraphics")
        self.ui.drawWidget.newProject(self.mainController)
         
        rootGraphics = self.mainController.getb(u"rootGraphics")
        rootGraphics.set(u"strSavePath", strSavePath)          
 
        self.ui.drawWidget.repaint()
Ejemplo n.º 2
0
 def loadSignalFile(self):
     strPath = helper.showFileSelectionDialog(self,strPath = None, bDir = False, \
                                    strExt = u"All files (*.*);;MDF3 (*.dat *.mdf);;MDF4 (*.mf4)", \
                                    strHeader = u"Load Singal File",\
                                    dialogType = u"load",\
                                    bFileObject = False )
     if not strPath:
         return
     command = u"@signals new signalFile " + strPath
     self.mainController.execCommand(command)
Ejemplo n.º 3
0
    def on_actionLoadProject(self):

        strPath = os.getcwd()
        _file, strSavePath = PyLinXHelper.showFileSelectionDialog(self.ui,strPath, bDir = False,strHeader ="Select File to load Project...",\
                                                     strExt = u"*.pyp",\
                                                     dialogType = u"load")

        self.__loadFile(_file)

        rootGraphics = self.mainController.getb(u"rootGraphics")
        rootGraphics.set(u"strSavePath", strSavePath)
Ejemplo n.º 4
0
    def on_actionLoadProject(self):
         
        strPath = os.getcwd()
        _file, strSavePath = PyLinXHelper.showFileSelectionDialog(self.ui,strPath, bDir = False,strHeader ="Select File to load Project...",\
                                                     strExt = u"*.pyp",\
                                                     dialogType = u"load")  
 
        self.__loadFile(_file)

        rootGraphics = self.mainController.getb(u"rootGraphics")
        rootGraphics.set(u"strSavePath", strSavePath)           
Ejemplo n.º 5
0
 def on_actionSave_As(self):
     if self.mainController.isAttr(u"strSavePath"):
         strSavePath_old = self.mainController.get(u"strSavePath")
         (strPath, strSavePath_old_file) = os.path.split(strSavePath_old)
     else:
         strPath = os.getcwd()
     strSavePath= PyLinXHelper.showFileSelectionDialog(self.ui,strPath, bDir = False, strExt = u"*.pyp", \
                                                 strHeader =u"Select File to save Project...",\
                                                 dialogType = u"save",\
                                                 bFileObject = False)
     (strSavePath_base, strSavePath_ext) = os.path.splitext(strSavePath)
     if not strSavePath_ext == u"pyp":
         strSavePath = strSavePath_base + u".pyp"
     self.__saveProject(strSavePath)
Ejemplo n.º 6
0
 def on_actionSave_As(self):
     if self.mainController.isAttr(u"strSavePath"):
         strSavePath_old = self.mainController.get(u"strSavePath")
         (strPath, strSavePath_old_file) = os.path.split(strSavePath_old)
     else:
         strPath = os.getcwd()
     strSavePath= helper.showFileSelectionDialog(self.ui,strPath, bDir = False, strExt = u"*.pyp", \
                                                 strHeader =u"Select File to save Project...",\
                                                 dialogType = u"save",\
                                                 bFileObject = False)
     (strSavePath_base,strSavePath_ext) = os.path.splitext(strSavePath)
     if not  strSavePath_ext == u"pyp":
         strSavePath = strSavePath_base + u".pyp"
     self.__saveProject(strSavePath)
Ejemplo n.º 7
0
 def loadSignalFile(self):
     
     strPath = helper.showFileSelectionDialog(self,strPath = None, bDir = False, \
                                    strExt = u"All files (*.*);;MDF3 (*.dat *.mdf);;MDF4 (*.mf4)", \
                                    strHeader = u"Load Singal File",\
                                    dialogType = u"load",\
                                    bFileObject = False )
     if not strPath:
         return
     command = u"new signalFile " + strPath 
     newSignalFile = self.mainController.execCommand(command)
     signals = newSignalFile.get(u"signals")
     masterSignals = newSignalFile.get(u"masterSignals")
     self.SignalFileName= newSignalFile.get(u"Name")
     
     self.model.loadSignals(signals, self.SignalFileName, masterSignals)
     self.myListWidget.setHeaderHidden(False)
     self.repaint()