diff options
-rw-r--r-- | src/frontEnd/DockArea.py | 12 | ||||
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 18 | ||||
-rw-r--r-- | src/frontEnd/Workspace.py | 2 | ||||
-rw-r--r-- | src/frontEnd/pathmagic.py | 2 | ||||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 3 | ||||
-rw-r--r-- | src/kicadtoNgspice/Model.py | 4 | ||||
-rw-r--r-- | src/kicadtoNgspice/Processing.py | 6 | ||||
-rw-r--r-- | src/kicadtoNgspice/SubcircuitTab.py | 2 | ||||
-rw-r--r-- | src/modelEditor/ModelEditor.py | 49 | ||||
-rw-r--r-- | src/ngspiceSimulation/NgspiceWidget.py | 2 | ||||
-rw-r--r-- | src/ngspiceSimulation/pythonPlotting.py | 76 |
11 files changed, 95 insertions, 81 deletions
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py index 60c98f36..8b8e975b 100644 --- a/src/frontEnd/DockArea.py +++ b/src/frontEnd/DockArea.py @@ -11,7 +11,7 @@ from ngspicetoModelica.ModelicaUI import OpenModelicaEditor import os dockList = ['Welcome'] -count = 1 +count = 1 dock = {} @@ -23,7 +23,7 @@ class DockArea(QtGui.QMainWindow): """Sdf.""" QtGui.QMainWindow.__init__(self) self.obj_appconfig = Appconfig() - + for dockName in dockList: dock[dockName] = QtGui.QDockWidget(dockName) self.welcomeWidget = QtGui.QWidget() @@ -80,7 +80,7 @@ class DockArea(QtGui.QMainWindow): global count self.plottingWidget = QtGui.QWidget() - + self.plottingLayout = QtGui.QVBoxLayout() self.plottingLayout.addWidget(plotWindow(self.projDir, self.projName)) @@ -112,7 +112,7 @@ class DockArea(QtGui.QMainWindow): global count self.ngspiceWidget = QtGui.QWidget() - + self.ngspiceLayout = QtGui.QVBoxLayout() self.ngspiceLayout.addWidget( NgspiceWidget( @@ -218,7 +218,7 @@ class DockArea(QtGui.QMainWindow): self.subcktWidget = QtGui.QWidget() self.subcktLayout = QtGui.QVBoxLayout() self.subcktLayout.addWidget(Subcircuit(self)) - + self.subcktWidget.setLayout(self.subcktLayout) dock['Subcircuit-' + str(count)] = QtGui.QDockWidget('Subcircuit-' + str(count)) @@ -250,7 +250,7 @@ class DockArea(QtGui.QMainWindow): self.usermanualWidget = QtGui.QWidget() self.usermanualLayout = QtGui.QVBoxLayout() self.usermanualLayout.addWidget(UserManual()) - + self.usermanualWidget.setLayout(self.usermanualLayout) dock['User Manual-' + str(count)] = QtGui.QDockWidget('User Manual-' + str(count)) diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 658ea12e..cac9f986 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -55,7 +55,7 @@ class ProjectExplorer(QtGui.QWidget): pathlist = parents.split(os.sep) parentnode = QtGui.QTreeWidgetItem( self.treewidget, [pathlist[-1], parents] - ) + ) for files in children: QtGui.QTreeWidgetItem( parentnode, [files, os.path.join(parents, files)]) @@ -225,22 +225,24 @@ class ProjectExplorer(QtGui.QWidget): json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath, 'w')) - #""" + # """ def renameProject(self): indexItem = self.treewidget.currentIndex() baseFileName = str(indexItem.data()) newBaseFileName, ok = QtGui.QInputDialog.getText(self, 'Rename Project', 'Project Name:', - QtGui.QLineEdit.Normal, baseFileName) + QtGui.QLineEdit.Normal, baseFileName) if ok and newBaseFileName: newBaseFileName = str(newBaseFileName) - projectPath, projectFiles = list(self.obj_appconfig.project_explorer.items())[indexItem.row()] + projectPath, projectFiles = list(self.obj_appconfig.project_explorer.items())[ + indexItem.row()] updatedProjectFiles = [] # rename files matching project name for projectFile in projectFiles: if baseFileName in projectFile: oldFilePath = os.path.join(projectPath, projectFile) - projectFile = projectFile.replace(baseFileName, newBaseFileName, 1) + projectFile = projectFile.replace( + baseFileName, newBaseFileName, 1) newFilePath = os.path.join(projectPath, projectFile) print ("Renaming " + oldFilePath + " to " + newFilePath) os.rename(oldFilePath, newFilePath) @@ -248,7 +250,8 @@ class ProjectExplorer(QtGui.QWidget): updatedProjectFiles.append(projectFile) # rename project folder - updatedProjectPath = newBaseFileName.join(projectPath.rsplit(baseFileName, 1)) + updatedProjectPath = newBaseFileName.join( + projectPath.rsplit(baseFileName, 1)) print ("Renaming " + projectPath + " to " + updatedProjectPath) os.rename(projectPath, updatedProjectPath) @@ -257,7 +260,8 @@ class ProjectExplorer(QtGui.QWidget): self.obj_appconfig.project_explorer[updatedProjectPath] = updatedProjectFiles # save project_explorer dictionary on disk - json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) + json.dump(self.obj_appconfig.project_explorer, + open(self.obj_appconfig.dictPath, 'w')) # recreate project explorer tree self.treewidget.clear() diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index 62833064..30d0607b 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -21,6 +21,8 @@ import time import os # This class creates Workspace GUI. + + class Workspace(QtGui.QWidget): """ diff --git a/src/frontEnd/pathmagic.py b/src/frontEnd/pathmagic.py index 92a5e6e2..49c4932d 100644 --- a/src/frontEnd/pathmagic.py +++ b/src/frontEnd/pathmagic.py @@ -3,4 +3,4 @@ import sys # Setting PYTHONPATH cwd = os.getcwd() (setPath, fronEnd) = os.path.split(cwd) -sys.path.append(setPath)
\ No newline at end of file +sys.path.append(setPath) diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 9624fc82..19f3ffe2 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -41,6 +41,7 @@ class MainWindow(QtGui.QWidget): - clarg1 is the path to the .cir file - clarg2 is either None or "sub" depending on the analysis type """ + def __init__(self, clarg1, clarg2=None): QtGui.QWidget.__init__(self) print("==================================") @@ -107,7 +108,7 @@ class MainWindow(QtGui.QWidget): unknownModelList, multipleModelList, plotText - ) = obj_proc.convertICintoBasicBlocks( + ) = obj_proc.convertICintoBasicBlocks( schematicInfo, outputOption, modelList, plotText ) print("=======================================") diff --git a/src/kicadtoNgspice/Model.py b/src/kicadtoNgspice/Model.py index eb1793f9..6647feb7 100644 --- a/src/kicadtoNgspice/Model.py +++ b/src/kicadtoNgspice/Model.py @@ -115,8 +115,8 @@ class Model(QtGui.QWidget): self.obj_trac.model_entry_var [self.nextcount].setText( str(list(json_data - ["model"][mod]["values"] - [i].values())[0])) + ["model"][mod]["values"] + [i].values())[0])) ) i = i + 1 except BaseException: diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py index ebbd3429..216383e6 100644 --- a/src/kicadtoNgspice/Processing.py +++ b/src/kicadtoNgspice/Processing.py @@ -16,6 +16,7 @@ class PrcocessNetlist: """ - Read the circuit file and return splitted lines """ + def readNetlist(self, filename): f = open(filename) data = f.read() @@ -31,6 +32,7 @@ class PrcocessNetlist: - Read Parameter information and store it into dictionary - kicadNetlis is the .cir file content """ + def readParamInfo(self, kicadNetlis): param = {} print("=========================KICADNETLIST========================") @@ -55,6 +57,7 @@ class PrcocessNetlist: - Preprocess netlist (replace parameters) - Separate infoline (first line) from the rest of netlist """ + def preprocessNetlist(self, kicadNetlis, param): netlist = [] for eachline in kicadNetlis: @@ -125,6 +128,7 @@ class PrcocessNetlist: - Then check for type whether ac, dc, sine, etc... - Handle starting with h and f as well """ + def insertSpecialSourceParam(self, schematicInfo, sourcelist): schematicInfo1 = [] print("=============================================================") @@ -462,7 +466,7 @@ class PrcocessNetlist: "a" + str(k) + " (" + words[1] + " " + words[2] + ") (interNode_" + str(interMediateNodeCount) + " " + words[3] + ") " - ) + ) modelLine += compName + "_primary" schematicInfo.append(modelLine) k = k + 1 diff --git a/src/kicadtoNgspice/SubcircuitTab.py b/src/kicadtoNgspice/SubcircuitTab.py index 7b8001b1..53a8eac9 100644 --- a/src/kicadtoNgspice/SubcircuitTab.py +++ b/src/kicadtoNgspice/SubcircuitTab.py @@ -203,4 +203,4 @@ class SubcircuitTab(QtGui.QWidget): "Please select a valid Subcircuit directory \ (Containing '.sub' file).") self.msg.setWindowTitle("Error Message") - self.msg.show()
\ No newline at end of file + self.msg.show() diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index 63e7e6a5..1dce456e 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -81,7 +81,7 @@ class ModelEditorclass(QtGui.QWidget): self.igbt.setDisabled(True) self.magnetic = QtGui.QRadioButton('Magnetic Core') self.magnetic.setDisabled(True) - + self.radiobtnbox.addButton(self.diode) self.diode.clicked.connect(self.diode_click) self.radiobtnbox.addButton(self.bjt) @@ -114,6 +114,7 @@ class ModelEditorclass(QtGui.QWidget): - Change state of other buttons accordingly, ex. enable diode, bjt, ... - Validate filename created, to check if one already exists ''' + def opennew(self): self.addbtn.setHidden(True) try: @@ -146,6 +147,7 @@ class ModelEditorclass(QtGui.QWidget): - Set states for other elements - Diode has no types, so hide that ''' + def diode_click(self): self.openfiletype('Diode') self.types.setHidden(True) @@ -158,6 +160,7 @@ class ModelEditorclass(QtGui.QWidget): - Open the default type in the table - Add an event listener for type-selection event ''' + def bjt_click(self): self.types.setHidden(False) self.types.clear() @@ -178,6 +181,7 @@ class ModelEditorclass(QtGui.QWidget): - Open the default type in the table - Add an event listener for type-selection event ''' + def mos_click(self): self.types.setHidden(False) self.types.clear() @@ -199,6 +203,7 @@ class ModelEditorclass(QtGui.QWidget): - Open the default type in the table - Add an event listener for type-selection event ''' + def jfet_click(self): self.types.setHidden(False) self.types.clear() @@ -207,7 +212,7 @@ class ModelEditorclass(QtGui.QWidget): filetype = str(self.types.currentText()) self.openfiletype(filetype) self.types.activated[str].connect(self.setfiletype) - + ''' - Set states for other elements - Initialise types combo box elements @@ -216,6 +221,7 @@ class ModelEditorclass(QtGui.QWidget): - Open the default type in the table - Add an event listener for type-selection event ''' + def igbt_click(self): self.types.setHidden(False) self.types.clear() @@ -232,6 +238,7 @@ class ModelEditorclass(QtGui.QWidget): - Add an event listener for type-selection event - No types here, only one view ''' + def magnetic_click(self): self.openfiletype('Magnetic Core') self.types.setHidden(True) @@ -241,6 +248,7 @@ class ModelEditorclass(QtGui.QWidget): - Get the type clicked, from text - Open appropriate table using openfiletype(filetype) ''' + def setfiletype(self, text): self.filetype = str(text) self.openfiletype(self.filetype) @@ -250,6 +258,7 @@ class ModelEditorclass(QtGui.QWidget): - Accordingly call `createtable(path)` to draw tables usingg QTable - Check for the state of button before rendering ''' + def openfiletype(self, filetype): self.path = '../deviceModelLibrary/Templates' if self.diode.isChecked(): @@ -311,6 +320,7 @@ class ModelEditorclass(QtGui.QWidget): - Create table for the selected .lib file using `self.createtable(path)` - Handle exception of no file selected ''' + def openedit(self): os.chdir(self.savepathtest) self.newflag = 0 @@ -345,6 +355,7 @@ class ModelEditorclass(QtGui.QWidget): - Show the extracted data in QTableWidget - Can edit QTable inplace, connect `edit_modeltable` function for editing ''' + def createtable(self, modelfile): self.savebtn.setDisabled(False) self.addbtn.setHidden(False) @@ -386,7 +397,7 @@ class ModelEditorclass(QtGui.QWidget): count = count + 1 self.modeltable.setHorizontalHeaderLabels( ("Parameters;Values").split(";") - ) + ) self.modeltable.show() self.modeltable.itemChanged.connect(self.edit_modeltable) @@ -397,6 +408,7 @@ class ModelEditorclass(QtGui.QWidget): - Edit name and value as per needed - Add the val name pair in the modeldict ''' + def edit_modeltable(self): self.savebtn.setDisabled(False) try: @@ -416,6 +428,7 @@ class ModelEditorclass(QtGui.QWidget): - Accordingly add parameter and value in modeldict as well as table - text1 => parameter, text2 => value ''' + def addparameters(self): text1, ok = QtGui.QInputDialog.getText( self, 'Parameter', 'Enter Parameter') @@ -446,6 +459,7 @@ class ModelEditorclass(QtGui.QWidget): - If new file created, call `createXML` file - Else call `savethefile` ''' + def savemodelfile(self): if self.newflag == 1: self.createXML(self.model_name) @@ -458,6 +472,7 @@ class ModelEditorclass(QtGui.QWidget): - For each component, separate folder is there - Check the contents of .lib and .xml file to understand their structure ''' + def createXML(self, model_name): root = ET.Element("library") ET.SubElement(root, "model_name").text = model_name @@ -469,7 +484,7 @@ class ModelEditorclass(QtGui.QWidget): defaultcwd = os.getcwd() self.savepath = '../deviceModelLibrary' if self.diode.isChecked(): - savepath = os.path.join(self.savepath, 'Diode') + savepath = os.path.join(self.savepath, 'Diode') os.chdir(savepath) txtfile = open(self.modelname + '.lib', 'w') txtfile.write( @@ -490,7 +505,7 @@ class ModelEditorclass(QtGui.QWidget): ' library created at ' + os.getcwd()) if self.mos.isChecked(): - savepath = os.path.join(self.savepath, 'MOS') + savepath = os.path.join(self.savepath, 'MOS') os.chdir(savepath) txtfile = open(self.modelname + '.lib', 'w') txtfile.write( @@ -511,7 +526,7 @@ class ModelEditorclass(QtGui.QWidget): ' library created at ' + os.getcwd()) if self.jfet.isChecked(): - savepath = os.path.join(self.savepath, 'JFET') + savepath = os.path.join(self.savepath, 'JFET') os.chdir(savepath) txtfile = open(self.modelname + '.lib', 'w') txtfile.write( @@ -532,7 +547,7 @@ class ModelEditorclass(QtGui.QWidget): ' library created at ' + os.getcwd()) if self.igbt.isChecked(): - savepath = os.path.join(self.savepath, 'IGBT') + savepath = os.path.join(self.savepath, 'IGBT') os.chdir(savepath) txtfile = open(self.modelname + '.lib', 'w') txtfile.write( @@ -553,7 +568,7 @@ class ModelEditorclass(QtGui.QWidget): ' library created at ' + os.getcwd()) if self.magnetic.isChecked(): - savepath = os.path.join(self.savepath, 'Misc') + savepath = os.path.join(self.savepath, 'Misc') os.chdir(savepath) txtfile = open(self.modelname + '.lib', 'w') txtfile.write( @@ -574,7 +589,7 @@ class ModelEditorclass(QtGui.QWidget): ' library created at ' + os.getcwd()) if self.bjt.isChecked(): - savepath = os.path.join(self.savepath, 'Transistor') + savepath = os.path.join(self.savepath, 'Transistor') os.chdir(savepath) txtfile = open(self.modelname + '.lib', 'w') txtfile.write( @@ -601,6 +616,7 @@ class ModelEditorclass(QtGui.QWidget): - This function checks if the file (xml type) with the name already exists - Accordingly show error message ''' + def validation(self, text): newfilename = text + '.xml' @@ -618,6 +634,7 @@ class ModelEditorclass(QtGui.QWidget): - Create .lib and .xml file for the editfile path and replace them - Also print Updated Library with libpath in the command window ''' + def savethefile(self, editfile): xmlpath, file = os.path.split(editfile) filename = os.path.splitext(file)[0] @@ -633,7 +650,7 @@ class ModelEditorclass(QtGui.QWidget): libfile.write('+ ' + tags + '=' + text + '\n') libfile.write(')') libfile.close() - + root = ET.Element("library") ET.SubElement(root, "model_name").text = self.model_name ET.SubElement(root, "ref_model").text = self.ref_model @@ -651,6 +668,7 @@ class ModelEditorclass(QtGui.QWidget): - Remove the whole row from QTable Widget - Remove the param,value pair from modeldict ''' + def removeparameter(self): self.savebtn.setDisabled(False) index = self.modeltable.currentIndex() @@ -667,6 +685,7 @@ class ModelEditorclass(QtGui.QWidget): - Save it in `User Libraries` with the given name, and input from uploaded file ''' + def converttoxml(self): os.chdir(self.savepathtest) self.addbtn.setHidden(True) @@ -701,14 +720,14 @@ class ModelEditorclass(QtGui.QWidget): model_name = ''.join(model_name[0:modelnamecnt - 1]) else: model_name = ''.join(model_name) - + libopen1 = open(self.libfile) while True: char = libopen1.read(1) if not char: break stringof.append(char) - + count = 0 for chars in stringof: count = count + 1 @@ -727,9 +746,9 @@ class ModelEditorclass(QtGui.QWidget): for chars in stringof: count = count + 1 if chars == '=': - stopcount.append(count) + stopcount.append(count) stopcount.append(count) - + i = 0 for no in stopcount: try: @@ -785,4 +804,4 @@ class ModelEditorclass(QtGui.QWidget): fileopen.close() os.chdir(defaultcwd) libopen.close() - libopen1.close()
\ No newline at end of file + libopen1.close() diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index ba56df2a..1d5c974f 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -6,7 +6,7 @@ import os # This Class creates NgSpice Window class NgspiceWidget(QtGui.QWidget): - + def __init__(self, command, projPath): """ 1)Creates constructor for NgspiceWidget class. diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py index 6cf99752..3bf8fe59 100644 --- a/src/ngspiceSimulation/pythonPlotting.py +++ b/src/ngspiceSimulation/pythonPlotting.py @@ -61,7 +61,7 @@ class plotWindow(QtGui.QMainWindow): # Get DataExtraction Details self.obj_dataext = DataExtraction() self.plotType = self.obj_dataext.openFile(self.fpath) - + self.obj_dataext.computeAxes() self.a = self.obj_dataext.numVals() @@ -127,7 +127,7 @@ class plotWindow(QtGui.QMainWindow): self.warnning = QtGui.QLabel() self.funcName = QtGui.QLabel() self.funcExample = QtGui.QLabel() - + self.plotbtn = QtGui.QPushButton("Plot") self.plotbtn.setToolTip('<b>Press</b> to Plot') self.multimeterbtn = QtGui.QPushButton("Multimeter") @@ -157,11 +157,11 @@ class plotWindow(QtGui.QMainWindow): self.right_grid.addWidget(self.funcName, 4, 0) self.right_grid.addWidget(self.funcExample, 4, 1) self.right_vbox.addLayout(self.right_grid) - + self.hbox = QtGui.QHBoxLayout() self.hbox.addLayout(self.left_vbox) self.hbox.addLayout(self.right_vbox) - + self.widget = QtGui.QWidget() self.widget.setLayout(self.hbox) # finalvbox self.scrollArea = QtGui.QScrollArea() @@ -176,7 +176,7 @@ class plotWindow(QtGui.QMainWindow): # Right side window frame showing list of nodes and branches. self.mainFrame.setLayout(self.finalhbox) self.showMaximized() - + self.listNode.setText("<font color='indigo'>List of Nodes:</font>") self.listBranch.setText( "<font color='indigo'>List of Branches:</font>") @@ -237,20 +237,20 @@ class plotWindow(QtGui.QMainWindow): self.axes.cla() self.canvas.draw() QtCore.SLOT('quit()') - + def pushedPlotFunc(self): self.parts = str(self.text.text()) self.parts = self.parts.split(" ") if self.parts[len(self.parts) - 1] == '': self.parts = self.parts[0:-1] - + self.values = self.parts self.comboAll = [] - self.axes.cla() - + self.axes.cla() + self.plotType2 = self.obj_dataext.openFile(self.fpath) - + if len(self.parts) <= 2: self.warnning.setText("Too few arguments!\nRefer syntax below!") QtGui.QMessageBox.about( @@ -283,7 +283,7 @@ class plotWindow(QtGui.QMainWindow): self.comboAll.append(self.obj_dataext.y[i]) for i in range(len(a)): - + if a[i] == len(self.obj_dataext.NBList): QtGui.QMessageBox.about( self, "Warning!!", "One of the operands doesn't belong\ @@ -300,9 +300,9 @@ class plotWindow(QtGui.QMainWindow): else: self.axes.cla() - + for i in range(len(self.obj_dataext.y[a[0]])): - self.combo.append(self.obj_dataext.y[a[0]][i]) + self.combo.append(self.obj_dataext.y[a[0]][i]) self.combo1.append(self.obj_dataext.y[a[1]][i]) self.axes.plot( @@ -316,7 +316,7 @@ class plotWindow(QtGui.QMainWindow): self.axes.set_xlabel('Voltage(V)-->') else: self.axes.set_ylabel('Current(I)-->') - self.axes.set_ylabel('Current(I)-->') + self.axes.set_ylabel('Current(I)-->') elif max(a) >= self.volts_length and min(a) < self.volts_length: QtGui.QMessageBox.about( @@ -350,7 +350,7 @@ class plotWindow(QtGui.QMainWindow): label=str(1)) self.axes.set_xlabel('freq-->') - + if max(a) < self.volts_length: self.axes.set_ylabel('Voltage(V)-->') else: @@ -368,7 +368,7 @@ class plotWindow(QtGui.QMainWindow): self.axes.set_ylabel('Voltage(V)-->') else: self.axes.set_ylabel('Current(I)-->') - + else: # self.setWindowTitle('DC Analysis') self.axes.plot( @@ -408,7 +408,7 @@ class plotWindow(QtGui.QMainWindow): self.axes.set_ylabel('Voltage(V)-->') else: self.axes.set_ylabel('Current(I)-->') - + self.axes.grid(True) if boxCheck == 0: QtGui.QMessageBox.about( @@ -437,7 +437,7 @@ class plotWindow(QtGui.QMainWindow): QtGui.QMessageBox.about( self, "Warning!!", "Please select at least one Node OR Branch") self.canvas.draw() - + def onPush_trans(self): self.axes.cla() boxCheck = 0 @@ -474,7 +474,7 @@ class plotWindow(QtGui.QMainWindow): label=str( j + 1)) self.axes.set_xlabel('Voltage Sweep(V)-->') - + if j < self.volts_length: self.axes.set_ylabel('Voltage(V)-->') else: @@ -495,7 +495,7 @@ class plotWindow(QtGui.QMainWindow): 'm': 'color:magenta', 'k': 'color:black' }[letter] - + def multiMeter(self): print("Function : MultiMeter") self.obj = {} @@ -537,7 +537,7 @@ class plotWindow(QtGui.QMainWindow): class MultimeterWidgetClass(QtGui.QWidget): def __init__(self, node_branch, rmsValue, loc_x, loc_y, voltFlag): QtGui.QWidget.__init__(self) - + self.multimeter = QtGui.QWidget(self) if voltFlag: self.node_branchLabel = QtGui.QLabel("Node") @@ -561,7 +561,7 @@ class MultimeterWidgetClass(QtGui.QWidget): self.setWindowTitle("MultiMeter") self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.show() - + class DataExtraction: def __init__(self): @@ -580,7 +580,7 @@ class DataExtraction: # Reading data file for voltage with open(os.path.join(fpath, "plot_data_v.txt")) as f2: self.voltData = f2.read() - + self.voltData = self.voltData.split("\n") # Initializing variable @@ -621,7 +621,7 @@ class DataExtraction: self.analysisType = 0 if "dec" in self.analysisInfo: self.dec = 1 - + for i in self.voltData[3:]: p += 1 # 'p' gives no. of lines of data for each node/branch if "Index" in i: @@ -630,7 +630,7 @@ class DataExtraction: # print "l:",l if "AC" in i: # DC for dc files and AC for ac ones break - + elif ".tran" in self.analysisInfo: self.analysisType = 1 for i in self.voltData[3:]: @@ -653,7 +653,6 @@ class DataExtraction: # print "l:",l if "DC" in i: # DC for dc files and AC for ac ones break - # print "VoltNumber",vnumber # print "CurrentNumber",inumber @@ -671,7 +670,7 @@ class DataExtraction: try: with open(os.path.join(fpath, "plot_data_i.txt")) as f2: alli = f2.read() - + alli = alli.split("\n") self.NBIList = [] @@ -684,7 +683,7 @@ class DataExtraction: self.msg = QtGui.QErrorMessage(None) self.msg.showMessage('Unable to open plot data files.') self.msg.setWindowTitle("Error Message:openFile") - + try: for l in alli[3].split(" "): if len(l) > 0: @@ -720,7 +719,7 @@ class DataExtraction: inum_i = len(alli[5].split("\t")) full_data = [] - + # Creating list of data: if d3 < 3: for i in range(1, d2): @@ -785,9 +784,9 @@ class DataExtraction: if self.NBList[len(self.NBList) - 1] == 'v-sweep': self.NBList.pop() j1.pop() - + j1.pop() - j = j + j1 + j = j + j1 j = j + full_data[m] # print j m += 1 @@ -827,18 +826,3 @@ class DataExtraction: for i in self.data: temp = i.split("\t") self.x.append(Decimal(temp[0])) - - - - - - - - - - - - - - - |