diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/browser/Welcome.py | 3 | ||||
-rw-r--r-- | src/browser/pages/welcome.html | 14 | ||||
-rw-r--r-- | src/configuration/Appconfig.py | 4 | ||||
-rwxr-xr-x | src/frontEnd/Application.py | 6 | ||||
-rw-r--r-- | src/frontEnd/DockArea.py | 23 | ||||
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 7 | ||||
-rw-r--r-- | src/modelEditor/ModelEditor.py | 4 | ||||
-rw-r--r-- | src/ngspiceSimulation/NgspiceWidget.py | 1 | ||||
-rw-r--r-- | src/ngspiceSimulation/pythonPlotting.py | 31 | ||||
-rw-r--r-- | src/projManagement/Worker.py | 3 | ||||
-rw-r--r-- | src/subcircuit/Subcircuit.py | 3 |
11 files changed, 71 insertions, 28 deletions
diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py index f9e3bbd7..0f50e153 100644 --- a/src/browser/Welcome.py +++ b/src/browser/Welcome.py @@ -12,7 +12,8 @@ class Welcome(QtGui.QWidget): self.browser = QtGui.QTextBrowser() self.browser.setSource(QtCore.QUrl("../browser/pages/welcome.html")) self.browser.setOpenExternalLinks(True) + self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) self.vlayout.addWidget(self.browser) self.setLayout(self.vlayout) - self.show()
\ No newline at end of file + self.show() diff --git a/src/browser/pages/welcome.html b/src/browser/pages/welcome.html index 9343b8b0..3c48a85a 100644 --- a/src/browser/pages/welcome.html +++ b/src/browser/pages/welcome.html @@ -35,21 +35,19 @@ pre{ <head> <body> - <h1>About eSim</h1> +<center><img src="../../../images/logo.png" alt="eSim logo" height="100" width="100"></center> +<br/> <p> -<b>eSim</b> is an open source EDA tool for circuit design, simulation, analysis and PCB design. It is an integrated tool built using open source software such as KiCad (<a href=http://www.kicad-pcb.org>http://www.kicad-pcb.org</a>) and Ngspice(<a href=http://ngspice.sourceforge.net>http://ngspice.sourceforge.net</a>). -<br/> -eSim source is released under <b>GNU General Public License V3.</b> +<b>eSim</b> is an open source EDA tool for circuit design, simulation, analysis and PCB design. It is an integrated tool built using open source software such as KiCad (<a href=http://www.kicad-pcb.org>http://www.kicad-pcb.org</a>) and Ngspice(<a href=http://ngspice.sourceforge.net>http://ngspice.sourceforge.net</a>). eSim source is released under <b>GNU General Public License.</b> </p> <br/> <p> -eSim is developed by the <b>FOSSEE team at IIT Bombay</b>. To know more about eSim, please visit: <a href=http://esim.fossee.in>http://esim.fossee.in</a>. +This tool is developed by the <b>FOSSEE team at IIT Bombay</b>. To know more about eSim, please visit: <a href=http://esim.fossee.in>http://esim.fossee.in</a>. </p> -<br /> +<br/> <p> -To discuss more about eSim please visits at <a href=http://esim.fossee.in>http://esim.fossee.in</a> - +To discuss more about eSim please visits at <a href=http://forums.fossee.in>http://forums.fossee.in</a> </p> <br /> </body> diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 72510174..3e4afad6 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -38,6 +38,8 @@ class Appconfig(QtGui.QWidget): #Workspace detail workspace_text = '''eSim stores your project in a folder called a eSim-Workspace. You can choose a different workspace folder to use for this session.''' procThread_list = [] + proc_dict={} #holds the pids of all external windows corresponds to the current project + dock_dict={} #holds all dockwidgets dictPath = os.path.join(os.path.expanduser("~"), ".projectExplorer.txt") noteArea = {} try: @@ -75,4 +77,4 @@ class Appconfig(QtGui.QWidget): -
\ No newline at end of file + diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 24e541c3..1008c7b5 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -187,6 +187,12 @@ class Application(QtGui.QMainWindow): if current_project==None: pass else: + for pid in self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']]: + try: + os.kill(pid, 9) + except: + pass + self.obj_Mainview.obj_dockarea.closeDock() self.obj_appconfig.current_project['ProjectName'] = None self.systemTrayIcon.showMessage('Close', 'Current project '+os.path.basename(current_project)+' is Closed.') diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py index 65296525..dcb48704 100644 --- a/src/frontEnd/DockArea.py +++ b/src/frontEnd/DockArea.py @@ -90,7 +90,8 @@ class DockArea(QtGui.QMainWindow): ") """ dock['Tips-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Tips-'+str(count)]) count = count + 1 def plottingEditor(self): @@ -124,7 +125,8 @@ class DockArea(QtGui.QMainWindow): dock['Plotting-'+str(count)].setVisible(True) dock['Plotting-'+str(count)].setFocus() dock['Plotting-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Plotting-'+str(count)]) count = count + 1 def ngspiceEditor(self,projDir): @@ -160,7 +162,7 @@ class DockArea(QtGui.QMainWindow): dock['NgSpice-'+str(count)].setVisible(True) dock['NgSpice-'+str(count)].setFocus() dock['NgSpice-'+str(count)].raise_() - + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['NgSpice-'+str(count)]) count = count + 1 def modelEditor(self): @@ -187,7 +189,8 @@ class DockArea(QtGui.QMainWindow): dock['Model Editor-'+str(count)].setVisible(True) dock['Model Editor-'+str(count)].setFocus() dock['Model Editor-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Model Editor-'+str(count)]) count = count + 1 def kicadToNgspiceEditor(self,clarg1,clarg2=None): @@ -210,7 +213,8 @@ class DockArea(QtGui.QMainWindow): dock['kicadToNgspice-'+str(count)].setVisible(True) dock['kicadToNgspice-'+str(count)].setFocus() dock['kicadToNgspice-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['kicadToNgspice-'+str(count)]) count = count + 1 @@ -238,7 +242,8 @@ class DockArea(QtGui.QMainWindow): dock['Subcircuit-'+str(count)].setVisible(True) dock['Subcircuit-'+str(count)].setFocus() dock['Subcircuit-'+str(count)].raise_() - + + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(dock['Subcircuit-'+str(count)]) count = count + 1 def usermanual(self): @@ -266,4 +271,8 @@ class DockArea(QtGui.QMainWindow): dock['User Manual-'+str(count)].setFocus() dock['User Manual-'+str(count)].raise_() - count = count + 1
\ No newline at end of file + count = count + 1 + + def closeDock (self): + for dockwidget in self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']]: + dockwidget.close() diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index 6c96227a..146b6d0f 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -47,6 +47,8 @@ class ProjectExplorer(QtGui.QWidget): parentnode = QtGui.QTreeWidgetItem(self.treewidget, [pathlist[-1], parents]) for files in children: childnode = QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(parents,files)]) + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] + self.oj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']] = [] def openMenu(self, position): @@ -102,6 +104,9 @@ class ProjectExplorer(QtGui.QWidget): self.textwindow.show() else: self.obj_appconfig.current_project["ProjectName"]= str(self.filePath) + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']] = [] + if self.obj_appconfig.current_project['ProjectName'] not in self.obj_appconfig.dock_dict: + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']] = [] def enable_save(self): self.save.setEnabled(True) @@ -139,4 +144,4 @@ class ProjectExplorer(QtGui.QWidget): childnode= QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(self.filePath,files)]) self.obj_appconfig.project_explorer[self.filePath]= filelistnew - json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w'))
\ No newline at end of file + json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index 76c3e10f..9ad7c662 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -19,10 +19,13 @@ class ModelEditorclass(QtGui.QWidget): self.modeltable = QtGui.QTableWidget() self.newbtn = QtGui.QPushButton('New') + self.newbtn.setToolTip('<b>Creating new Model Library</b>') self.newbtn.clicked.connect(self.opennew) self.editbtn = QtGui.QPushButton('Edit') + self.editbtn.setToolTip('<b>Editing current Model Library</b>') self.editbtn.clicked.connect(self.openedit) self.savebtn = QtGui.QPushButton('Save') + self.savebtn.setToolTip('<b>Saves the Model Library</b>') self.savebtn.setDisabled(True) self.savebtn.clicked.connect(self.savemodelfile) self.removebtn = QtGui.QPushButton('Remove') @@ -32,6 +35,7 @@ class ModelEditorclass(QtGui.QWidget): self.addbtn.setHidden(True) self.addbtn.clicked.connect(self.addparameters) self.uploadbtn = QtGui.QPushButton('Upload') + self.uploadbtn.setToolTip('<b>Uploading external .lib file to eSim</b>') self.uploadbtn.clicked.connect(self.converttoxml) self.grid.addWidget(self.newbtn, 1,2) self.grid.addWidget(self.editbtn, 1,3) diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index ee4dafe7..310cbe3c 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -24,6 +24,7 @@ class NgspiceWidget(QtGui.QWidget): self.args = ['-hold','-e', self.command] self.process.start('xterm', self.args) self.obj_appconfig.process_obj.append(self.process) + self.obj_appconfig.proc_dict[self.obj_appconfig.current_project['ProjectName']].append(self.process.pid()) elif platform.system() == 'Windows': tempdir= os.getcwd() diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py index dd0ca532..295c0a1d 100644 --- a/src/ngspiceSimulation/pythonPlotting.py +++ b/src/ngspiceSimulation/pythonPlotting.py @@ -110,7 +110,7 @@ class plotWindow(QtGui.QMainWindow): self.plotbtn = QtGui.QPushButton("Plot") self.plotbtn.setToolTip('<b>Press</b> to Plot' ) self.multimeterbtn = QtGui.QPushButton("Multimeter") - self.multimeterbtn.setToolTip('<b>Press</b> to get Multimeter' ) + self.multimeterbtn.setToolTip('<b>RMS</b> value of the current and voltage is displayed' ) self.text = QtGui.QLineEdit() self.funcLabel = QtGui.QLabel() self.palette1 = QtGui.QPalette() @@ -155,9 +155,9 @@ class plotWindow(QtGui.QMainWindow): self.listNode.setText("<font color='indigo'>List of Nodes:</font>") self.listBranch.setText("<font color='indigo'>List of Branches:</font>") self.funcLabel.setText("<font color='indigo'>Function:</font>") - self.funcName.setText("<font color='indigo'>Examples:</font>\ + self.funcName.setText("<font color='indigo'>Standard functions</font>\ <br><br>Addition:<br>Subtraction:<br>Multiplication:<br>Division:<br>Comparison:") - self.funcExample.setText("\n\nV(1) + V(2)\nV(1) - V(2)\nV(1) * V(2)\nV(1) / V(2)\nV(1) vs V(2)") + self.funcExample.setText("\n\nNode1 + Node2\nNode1 - Node2\nNode1 * Node2\nNode1 / Node2\nNode1 vs Node2") #Connecting to plot and clear function self.connect(self.clear,QtCore.SIGNAL('clicked()'),self.pushedClear) @@ -401,14 +401,21 @@ class plotWindow(QtGui.QMainWindow): boxCheck = 0 loc_x = 300 loc_y = 300 + for i,j in zip(self.chkbox,range(len(self.chkbox))): if i.isChecked(): print "Check box",self.obj_dataext.NBList[j] boxCheck += 1 + if self.obj_dataext.NBList[j] in self.obj_dataext.NBIList: + voltFlag = False + else: + voltFlag = True #Initializing Multimeter - self.obj[j] = MultimeterWidgetClass(self.obj_dataext.NBList[j],self.getRMSValue(self.obj_dataext.y[j]),loc_x,loc_y) + self.obj[j] = MultimeterWidgetClass(self.obj_dataext.NBList[j],self.getRMSValue(self.obj_dataext.y[j]),loc_x,loc_y,voltFlag) loc_x += 50 loc_y += 50 + ## Adding object of multimeter to dictionary + self.obj_appconfig.dock_dict[self.obj_appconfig.current_project['ProjectName']].append(self.obj[j]) if boxCheck == 0: QtGui.QMessageBox.about(self, "Warning!!","Please select at least one Node OR Branch") @@ -419,15 +426,20 @@ class plotWindow(QtGui.QMainWindow): return np.sqrt(np.mean(np.square(dataPoints))) class MultimeterWidgetClass(QtGui.QWidget): - def __init__(self,node_branch,rmsValue,loc_x,loc_y): + def __init__(self,node_branch,rmsValue,loc_x,loc_y,voltFlag): QtGui.QWidget.__init__(self) self.multimeter = QtGui.QWidget(self) - self.node_branchLabel = QtGui.QLabel("Node/Branch") + if voltFlag: + self.node_branchLabel = QtGui.QLabel("Node") + self.rmsValue = QtGui.QLabel(str(rmsValue)+" Volts") + else: + self.node_branchLabel = QtGui.QLabel("Branch") + self.rmsValue = QtGui.QLabel(str(rmsValue)+" Amp") + self.rmsLabel = QtGui.QLabel("RMS Value") - self.nodeBranchValue = QtGui.QLabel(str(node_branch)) - self.rmsValue = QtGui.QLabel(str(rmsValue)) + self.layout = QtGui.QGridLayout(self) self.layout.addWidget(self.node_branchLabel,0,0) @@ -436,7 +448,8 @@ class MultimeterWidgetClass(QtGui.QWidget): self.layout.addWidget(self.rmsValue,1,1) self.multimeter.setLayout(self.layout) - self.setGeometry(loc_x,loc_y,180,100) + self.setGeometry(loc_x,loc_y,200,100) + self.setGeometry(loc_x,loc_y,300,100) self.setWindowTitle("MultiMeter") self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.show() diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 9721f4a7..6befca65 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -39,7 +39,8 @@ class WorkerThread(QtCore.QThread): procThread = Appconfig() proc = subprocess.Popen(command.split()) procThread.procThread_list.append(proc) + procThread.proc_dict[procThread.current_project['ProjectName']].append(proc.pid) -
\ No newline at end of file + diff --git a/src/subcircuit/Subcircuit.py b/src/subcircuit/Subcircuit.py index 76587f26..f53acc6a 100644 --- a/src/subcircuit/Subcircuit.py +++ b/src/subcircuit/Subcircuit.py @@ -20,12 +20,15 @@ class Subcircuit(QtGui.QWidget): self.splitter.setOrientation(QtCore.Qt.Vertical) self.newbtn = QtGui.QPushButton('New Subcircuit Schematic') + self.newbtn.setToolTip('<b>To create new Subcircuit Schematic</b>') self.newbtn.setFixedSize(200,40) self.newbtn.clicked.connect(self.newsch) self.editbtn = QtGui.QPushButton('Edit Subcircuit Schematic') + self.editbtn.setToolTip('<b>To edit existing Subcircuit Schematic</b>') self.editbtn.setFixedSize(200,40) self.editbtn.clicked.connect(self.editsch) self.convertbtn = QtGui.QPushButton('Convert Kicad to Ngspice') + self.convertbtn.setToolTip('<b>To convert Subcircuit Kicad Netlist to Ngspice Netlist</b>') self.convertbtn.setFixedSize(200,40) self.convertbtn.clicked.connect(self.convertsch) |