diff options
author | fahim | 2015-06-08 18:07:36 +0530 |
---|---|---|
committer | fahim | 2015-06-08 18:07:36 +0530 |
commit | fc483566526a7022b1b2a61e4f3e001914e2b7c5 (patch) | |
tree | bda0e7a7c2117e29d2726114f63cc6a41060a9b3 /src | |
parent | a783d14e674082a49ab5d5b7943ec5fc1f4c98f2 (diff) | |
download | eSim-fc483566526a7022b1b2a61e4f3e001914e2b7c5.tar.gz eSim-fc483566526a7022b1b2a61e4f3e001914e2b7c5.tar.bz2 eSim-fc483566526a7022b1b2a61e4f3e001914e2b7c5.zip |
Subject: modelEditor changes for upload library
Description: modelEditor changes for upload library
Diffstat (limited to 'src')
-rwxr-xr-x | src/frontEnd/Application.py | 1 | ||||
-rw-r--r-- | src/modelEditor/ModelEditor.py | 23 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index b80f9b64..f570277c 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -31,6 +31,7 @@ import sys import time from PyQt4.Qt import QSize + class Application(QtGui.QMainWindow): """ Its our main window of application diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index 7e5e8434..99b69141 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -160,7 +160,7 @@ class ModelEditorclass(QtGui.QWidget): self.types.addItem('Magnetic Core') filetype = str(self.types.currentText()) self.types.activated[str].connect(self.setfiletype) - ''' + ''' def setfiletype(self,text): self.filetype = str(text) self.openfiletype(self.filetype) @@ -230,10 +230,10 @@ class ModelEditorclass(QtGui.QWidget): self.igbt.setDisabled(True) self.bjt.setDisabled(True) self.magnetic.setDisabled(True) - self.editfile=str(QtGui.QFileDialog.getOpenFileName(self)) + self.editfile=str(QtGui.QFileDialog.getOpenFileName(self,"Open Library Directory","../deviceModelLibrary","*.lib")) self.createtable(self.editfile) - '''Creates the model table by parsinf th .xml file ''' + '''Creates the model table by parsing th .xml file ''' def createtable(self, modelfile): self.savebtn.setDisabled(False) self.addbtn.setHidden(False) @@ -246,7 +246,14 @@ class ModelEditorclass(QtGui.QWidget): self.modeltable.resizeRowsToContents() self.modeltable.resize(200,200) self.grid.addWidget(self.modeltable, 3,2,8,2) - + filepath, filename = os.path.split(self.modelfile) + print"file selected is",filename + print filepath + base, ext= os.path.splitext(filename) + print base + print ext + self.modelfile = os.path.join(filepath, base+'.xml') + print"modelfile",self.modelfile self.tree = ET.parse(self.modelfile) self.root= self.tree.getroot() for elem in self.tree.iter(tag='ref_model'): @@ -433,7 +440,7 @@ class ModelEditorclass(QtGui.QWidget): self.modeltable.setHidden(True) model_dict = {} stringof = [] - self.libfile = str(QtGui.QFileDialog.getOpenFileName(self)) + self.libfile = str(QtGui.QFileDialog.getOpenFileName(self,"Open Library Directory","../deviceModelLibrary","*.lib")) libopen = open(self.libfile) filedata = libopen.read().split() modelcount=0 @@ -494,12 +501,6 @@ class ModelEditorclass(QtGui.QWidget): pass listoflist =[] listofname2 = [el.replace('\t', '').replace('\n', ' ').replace('+', '').replace(')', '').replace('=', '') for el in listofname] - ''' - listofname = [el.replace('\n', ' ') for el in listofname2] - listofname2 = [el.replace('+', '') for el in listofname] - listofname = [el.replace(')', '') for el in listofname2] - listofname2 = [el.replace('=', '') for el in listofname] - ''' listofname=[] for item in listofname2: listofname.append(item.rstrip().lstrip()) |