From f7f9536cf4cdc2165c3a371d8de758536fedeedb Mon Sep 17 00:00:00 2001 From: Bladen Martin Date: Thu, 16 Jul 2020 13:23:10 +0530 Subject: [PATCH 01/15] launch ngspice via mintty --- src/ngspiceSimulation/NgspiceWidget.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index a963c51fa..136510e1c 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,10 +1,12 @@ from PyQt4 import QtGui, QtCore from configuration.Appconfig import Appconfig +from configparser import SafeConfigParser import platform import os - # This Class creates NgSpice Window + + class NgspiceWidget(QtGui.QWidget): def __init__(self, command, projPath): @@ -20,6 +22,17 @@ def __init__(self, command, projPath): self.layout = QtGui.QVBoxLayout(self) self.layout.addWidget(self.terminal) + if os.name == 'nt': + home = os.path.expanduser("~") + + parser_nghdl = SafeConfigParser() + parser_nghdl.read(os.path.join( + home, os.path.join('.nghdl', 'config.ini'))) + try: + msys_bin = parser_nghdl.get('COMPILER', 'MSYS_HOME') + except BaseException: + pass + print("Argument to ngspice command : ", command) # For Linux OS if platform.system() == 'Linux': @@ -40,6 +53,7 @@ def __init__(self, command, projPath): tempdir = os.getcwd() projPath = self.obj_appconfig.current_project["ProjectName"] os.chdir(projPath) - self.command = "ngspice " + command + self.command = 'cmd /c '+'"start /min ' + \ + msys_bin + "/mintty.exe ngspice " + command + '"' self.process.start(self.command) os.chdir(tempdir) From c13e7b0f873e4857f1ce7924c0a72609df3ddca2 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:08:02 +0530 Subject: [PATCH 02/15] platform independent library and image paths, flake8 compliant --- src/browser/UserManual.py | 14 ++-- src/browser/Welcome.py | 9 ++- src/configuration/Appconfig.py | 9 ++- src/frontEnd/Application.py | 80 +++++++++++++--------- src/frontEnd/ProjectExplorer.py | 14 ++-- src/frontEnd/Workspace.py | 9 ++- src/kicadtoNgspice/DeviceModel.py | 9 ++- src/kicadtoNgspice/KicadtoNgspice.py | 18 ++--- src/kicadtoNgspice/Processing.py | 6 +- src/kicadtoNgspice/SubcircuitTab.py | 6 +- src/modelEditor/ModelEditor.py | 15 ++-- src/ngspicetoModelica/NgspicetoModelica.py | 11 ++- src/subcircuit/newSub.py | 7 +- src/subcircuit/openSub.py | 7 +- src/subcircuit/uploadSub.py | 6 +- 15 files changed, 143 insertions(+), 77 deletions(-) diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py index f31af29d4..886d88a57 100644 --- a/src/browser/UserManual.py +++ b/src/browser/UserManual.py @@ -1,6 +1,5 @@ from PyQt4 import QtGui import subprocess -import platform import os @@ -15,14 +14,15 @@ def __init__(self): self.vlayout = QtGui.QVBoxLayout() - file = os.path.realpath( - 'library/browser/User-Manual/eSim_Manual_2019_Dec_31.pdf' - ) + manual = 'library/browser/User-Manual/eSim_Manual_2.1.pdf' - if 'Win' in platform.system(): - os.startfile(file) + if os.name == 'nt': + os.startfile(os.path.realpath(manual)) else: - subprocess.Popen(['xpdf.real', file], shell=False) + manual_path = '../../' + manual + subprocess.Popen( + ['xdg-open', os.path.realpath(manual_path)], shell=False + ) self.setLayout(self.vlayout) self.show() diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py index 69584f108..aa7b612fd 100644 --- a/src/browser/Welcome.py +++ b/src/browser/Welcome.py @@ -1,4 +1,5 @@ from PyQt4 import QtGui, QtCore +import os class Welcome(QtGui.QWidget): @@ -10,10 +11,14 @@ class Welcome(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) self.vlayout = QtGui.QVBoxLayout() - self.browser = QtGui.QTextBrowser() + + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.browser.setSource(QtCore.QUrl( - "library/browser/welcome.html") + init_path + "library/browser/welcome.html") ) self.browser.setOpenExternalLinks(True) self.browser.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff) diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 6a10f3d72..a079d472c 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -13,7 +13,7 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Friday 24 July 2020 # ========================================================================= from PyQt4 import QtGui @@ -80,7 +80,12 @@ class Appconfig(QtGui.QWidget): # Open file and read KiCad config path try: - file = open('library/supportFiles/kicad_config_path.txt', 'r') + init_path = '../../' + if os.name == 'nt': + init_path = '' + + file = open(init_path + + 'library/supportFiles/kicad_config_path.txt', 'r') kicad_path = file.read().rstrip() file.close() except BaseException as e: diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 920134098..6eaf4c9c8 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -13,10 +13,18 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Friday 24 July 2020 # ========================================================================= -from frontEnd import pathmagic # noqa +import os + +if os.name == 'nt': # noqa + init_path = '' + from frontEnd import pathmagic # noqa:F401 +else: + import pathmagic # noqa:F401 + init_path = '../../' + from PyQt4 import QtGui, QtCore from configuration.Appconfig import Appconfig from projManagement.openProject import OpenProjectInfo @@ -27,11 +35,10 @@ from frontEnd import ProjectExplorer from frontEnd import Workspace from frontEnd import DockArea -import time from PyQt4.Qt import QSize -import sys -import os import shutil +import time +import sys # Its our main window of application. @@ -64,10 +71,10 @@ def __init__(self, *args): self.obj_appconfig._app_heigth) self.setWindowTitle(self.obj_appconfig._APPLICATION) self.showMaximized() - self.setWindowIcon(QtGui.QIcon('images/logo.png')) + self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon = QtGui.QSystemTrayIcon(self) - self.systemTrayIcon.setIcon(QtGui.QIcon('images/logo.png')) + self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True) def initToolBar(self): @@ -83,28 +90,28 @@ def initToolBar(self): """ # Top Tool bar self.newproj = QtGui.QAction( - QtGui.QIcon('images/newProject.png'), + QtGui.QIcon(init_path + 'images/newProject.png'), 'New Project', self ) self.newproj.setShortcut('Ctrl+N') self.newproj.triggered.connect(self.new_project) self.openproj = QtGui.QAction( - QtGui.QIcon('images/openProject.png'), + QtGui.QIcon(init_path + 'images/openProject.png'), 'Open Project', self ) self.openproj.setShortcut('Ctrl+O') self.openproj.triggered.connect(self.open_project) self.closeproj = QtGui.QAction( - QtGui.QIcon('images/closeProject.png'), + QtGui.QIcon(init_path + 'images/closeProject.png'), 'Close Project', self ) self.closeproj.setShortcut('Ctrl+X') self.closeproj.triggered.connect(self.close_project) self.wrkspce = QtGui.QAction( - QtGui.QIcon('images/workspace.ico'), + QtGui.QIcon(init_path + 'images/workspace.ico'), 'Change Workspace', self ) self.wrkspce.setShortcut('Ctrl+W') @@ -114,17 +121,17 @@ def initToolBar(self): self.validate_mode() if self.online_flag is True: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/online.png'), + init_path + 'images/online.png'), 'Go Offline', self ) elif self.online_flag is False: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/offline.png'), + init_path + 'images/offline.png'), 'Go Online', self ) elif self.online_flag is None: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/disable.png'), + init_path + 'images/disable.png'), 'Mode switching has been disabled. ' + 'Default mode set to offline', self ) @@ -133,7 +140,8 @@ def initToolBar(self): self.switchmode.triggered.connect(self.change_mode) self.helpfile = QtGui.QAction( - QtGui.QIcon('images/helpProject.png'), 'Help', self + QtGui.QIcon(init_path + 'images/helpProject.png'), + 'Help', self ) self.helpfile.setShortcut('Ctrl+H') self.helpfile.triggered.connect(self.help_project) @@ -156,7 +164,7 @@ def initToolBar(self): self.logo = QtGui.QLabel() self.logopic = QtGui.QPixmap( os.path.join( - os.path.abspath(''), 'images', 'fosseeLogo.png' + os.path.abspath(''), init_path + 'images', 'fosseeLogo.png' )) self.logopic = self.logopic.scaled( QSize(150, 150), QtCore.Qt.KeepAspectRatio) @@ -166,45 +174,49 @@ def initToolBar(self): # Left Tool bar Action Widget self.kicad = QtGui.QAction( - QtGui.QIcon('images/kicad.png'), + QtGui.QIcon(init_path + 'images/kicad.png'), 'Open Schematic', self ) self.kicad.triggered.connect(self.obj_kicad.openSchematic) self.conversion = QtGui.QAction( - QtGui.QIcon('images/ki-ng.png'), + QtGui.QIcon(init_path + 'images/ki-ng.png'), 'Convert Kicad to Ngspice', self ) self.conversion.triggered.connect(self.obj_kicad.openKicadToNgspice) self.ngspice = QtGui.QAction( - QtGui.QIcon('images/ngspice.png'), 'Simulation', self + QtGui.QIcon(init_path + 'images/ngspice.png'), + 'Simulation', self ) self.ngspice.triggered.connect(self.open_ngspice) self.model = QtGui.QAction( - QtGui.QIcon('images/model.png'), 'Model Editor', self + QtGui.QIcon(init_path + 'images/model.png'), + 'Model Editor', self ) self.model.triggered.connect(self.open_modelEditor) self.subcircuit = QtGui.QAction( - QtGui.QIcon('images/subckt.png'), 'Subcircuit', self + QtGui.QIcon(init_path + 'images/subckt.png'), + 'Subcircuit', self ) self.subcircuit.triggered.connect(self.open_subcircuit) self.nghdl = QtGui.QAction( - QtGui.QIcon('images/nghdl.png'), 'Nghdl', self + QtGui.QIcon(init_path + 'images/nghdl.png'), 'Nghdl', self ) self.nghdl.triggered.connect(self.open_nghdl) self.omedit = QtGui.QAction( - QtGui.QIcon('images/omedit.png'), + QtGui.QIcon(init_path + 'images/omedit.png'), 'Modelica Converter', self ) self.omedit.triggered.connect(self.open_OMedit) self.omoptim = QtGui.QAction( - QtGui.QIcon('images/omoptim.png'), 'OM Optimisation', self + QtGui.QIcon(init_path + 'images/omoptim.png'), + 'OM Optimisation', self ) self.omoptim.triggered.connect(self.open_OMoptim) @@ -398,10 +410,14 @@ def validate_mode(self): "/fp-lib-table-online") # Restore original files - shutil.copy('library/supportFiles/fp-lib-table-online', - self.obj_appconfig.kicad_path + "/") - shutil.copy('library/supportFiles/fp-lib-table', - self.obj_appconfig.kicad_path + "/") + shutil.copy( + init_path + 'library/supportFiles/fp-lib-table-online', + self.obj_appconfig.kicad_path + "/" + ) + shutil.copy( + init_path + 'library/supportFiles/fp-lib-table', + self.obj_appconfig.kicad_path + "/" + ) self.online_flag = False else: @@ -442,7 +458,7 @@ def change_mode(self): self.obj_appconfig.kicad_path + "/fp-lib-table" ) self.switchmode.setIcon( - QtGui.QIcon('images/offline.png') + QtGui.QIcon(init_path + 'images/offline.png') ) self.switchmode.setText('Go Online') self.switchmode.setEnabled(True) @@ -460,7 +476,7 @@ def change_mode(self): self.obj_appconfig.kicad_path + "/fp-lib-table" ) self.switchmode.setIcon( - QtGui.QIcon('images/online.png') + QtGui.QIcon(init_path + 'images/online.png') ) self.switchmode.setText('Go Offline') self.switchmode.setEnabled(True) @@ -468,7 +484,7 @@ def change_mode(self): elif self.online_flag is None: self.switchmode.setIcon( - QtGui.QIcon('images/disable.png') + QtGui.QIcon(init_path + 'images/disable.png') ) self.switchmode.setText( 'Mode switching has been ' + @@ -798,7 +814,7 @@ def main(args): print("Starting eSim......") app = QtGui.QApplication(args) - splash_pix = QtGui.QPixmap('images/splash_screen_esim.png') + splash_pix = QtGui.QPixmap(init_path + 'images/splash_screen_esim.png') splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) splash.show() diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index f0227164d..d327427c2 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -33,23 +33,27 @@ def __init__(self): self.treewidget.setColumnHidden(1, True) # CSS + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.treewidget.setStyleSheet(" \ QTreeView { border-radius: 15px; border: 1px \ solid gray; padding: 5px; width: 200px; height: 150px; }\ QTreeView::branch:has-siblings:!adjoins-item { \ - border-image: url(images/vline.png) 0;} \ + border-image: url(" + init_path + "images/vline.png) 0;} \ QTreeView::branch:has-siblings:adjoins-item { \ - border-image: url(images/branch-more.png) 0; } \ + border-image: url(" + init_path + "images/branch-more.png) 0; } \ QTreeView::branch:!has-children:!has-siblings:adjoins-item { \ - border-image: url(images/branch-end.png) 0; } \ + border-image: url(" + init_path + "images/branch-end.png) 0; } \ QTreeView::branch:has-children:!has-siblings:closed, \ QTreeView::branch:closed:has-children:has-siblings { \ border-image: none; \ - image: url(images/branch-closed.png); } \ + image: url(" + init_path + "images/branch-closed.png); } \ QTreeView::branch:open:has-children:!has-siblings, \ QTreeView::branch:open:has-children:has-siblings { \ border-image: none; \ - image: url(images/branch-open.png); } \ + image: url(" + init_path + "images/branch-open.png); } \ ") for parents, children in list( diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index 6940da593..ee3a49f31 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -13,7 +13,7 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim team at FOSSEE, IIT Bombay. # CREATED: Wednesday 05 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Friday 24 July 2020 # ========================================================================= from PyQt4 import QtCore, QtGui @@ -82,7 +82,12 @@ def initWorkspace(self): self.setWindowTitle("eSim") self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) self.note.setReadOnly(True) - self.setWindowIcon(QtGui.QIcon('images/logo.png')) + + init_path = '../../' + if os.name == 'nt': + init_path = '' + + self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.setLayout(self.grid) def defaultWorkspace(self): diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index 31ff74f73..ceb893516 100644 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -364,11 +364,16 @@ def trackLibrary(self): sending_btn = self.sender() self.widgetObjCount = int(sending_btn.objectName()) + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.libfile = str( QtGui.QFileDialog.getOpenFileName( self, "Open Library Directory", - "library/deviceModelLibrary", - "*.lib")) + init_path + "library/deviceModelLibrary", "*.lib" + ) + ) # Setting Library to Text Edit Line self.entry_var[self.widgetObjCount].setText(self.libfile) diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 6d654158b..b52a4de82 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -599,16 +599,16 @@ def callConvert(self): tree = ET.ElementTree(attr_parent) tree.write(fw) - # Create Convert object with the source details & the schematic details - print("=============================================================") - print("SOURCE LIST TRACK") - print(self.obj_track.sourcelisttrack["ITEMS"]) - print("SOURCE ENTRY VAR") - print(self.obj_track.source_entry_var["ITEMS"]) - print("SCHEMATIC INFO") - print(store_schematicInfo) - print("=============================================================") + # print("=============================================================") + # print("SOURCE LIST TRACK") + # print(self.obj_track.sourcelisttrack["ITEMS"]) + # print("SOURCE ENTRY VAR") + # print(self.obj_track.source_entry_var["ITEMS"]) + # print("SCHEMATIC INFO") + # print(store_schematicInfo) + # print("=============================================================") + # Create Convert object with the source details & the schematic details self.obj_convert = Convert.Convert( self.obj_track.sourcelisttrack["ITEMS"], self.obj_track.source_entry_var["ITEMS"], diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py index 67ffd3f55..494c49b46 100644 --- a/src/kicadtoNgspice/Processing.py +++ b/src/kicadtoNgspice/Processing.py @@ -8,7 +8,11 @@ class PrcocessNetlist: - This class include all the function required for pre-proccessing of netlist before converting to Ngspice Netlist. """ - modelxmlDIR = 'library/modelParamXML' + init_path = '../../' + if os.name == 'nt': + init_path = '' + + modelxmlDIR = init_path + 'library/modelParamXML' def __init__(self): pass diff --git a/src/kicadtoNgspice/SubcircuitTab.py b/src/kicadtoNgspice/SubcircuitTab.py index d68cb97e3..f4b759c5b 100644 --- a/src/kicadtoNgspice/SubcircuitTab.py +++ b/src/kicadtoNgspice/SubcircuitTab.py @@ -146,10 +146,14 @@ def trackSubcircuit(self): # print "Object Called is ",sending_btn.objectName() self.widgetObjCount = int(sending_btn.objectName()) + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.subfile = str( QtGui.QFileDialog.getExistingDirectory( self, "Open Subcircuit", - "library/SubcircuitLibrary") + init_path + "library/SubcircuitLibrary") ) self.reply = self.obj_validation.validateSub( self.subfile, self.numPorts[self.widgetObjCount - 1]) diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index 0b6990f38..e8fda4823 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -30,7 +30,12 @@ class ModelEditorclass(QtGui.QWidget): def __init__(self): QtGui.QWidget.__init__(self) - self.savepathtest = 'library/deviceModelLibrary' + + self.init_path = '../../' + if os.name == 'nt': + self.init_path = '' + + self.savepathtest = self.init_path + 'library/deviceModelLibrary' self.obj_appconfig = Appconfig() self.newflag = 0 self.layout = QtGui.QVBoxLayout() @@ -252,7 +257,7 @@ def openfiletype(self, filetype): - Accordingly call `createtable(path)` to draw tables usingg QTable - Check for the state of button before rendering ''' - self.path = 'library/deviceModelLibrary/Templates' + self.path = self.init_path + 'library/deviceModelLibrary/Templates' if self.diode.isChecked(): if filetype == 'Diode': path = os.path.join(self.path, 'D.xml') @@ -326,7 +331,7 @@ def openedit(self): QtGui.QFileDialog.getOpenFileName( self, "Open Library Directory", - "library/deviceModelLibrary", + self.init_path + "library/deviceModelLibrary", "*.lib")) self.createtable(self.editfile) except BaseException: @@ -471,7 +476,7 @@ def createXML(self, model_name): ET.SubElement(param, tags).text = text tree = ET.ElementTree(root) defaultcwd = os.getcwd() - self.savepath = 'library/deviceModelLibrary' + self.savepath = self.init_path + 'library/deviceModelLibrary' if self.diode.isChecked(): savepath = os.path.join(self.savepath, 'Diode') os.chdir(savepath) @@ -695,7 +700,7 @@ def converttoxml(self): QtGui.QFileDialog.getOpenFileName( self, "Open Library Directory", - "library/deviceModelLibrary", + self.init_path + "library/deviceModelLibrary", "*.lib")) libopen = open(self.libfile) filedata = libopen.read().split() diff --git a/src/ngspicetoModelica/NgspicetoModelica.py b/src/ngspicetoModelica/NgspicetoModelica.py index 09e289819..4df65c8db 100644 --- a/src/ngspicetoModelica/NgspicetoModelica.py +++ b/src/ngspicetoModelica/NgspicetoModelica.py @@ -472,12 +472,11 @@ def compInit(self, compInfo, node, modelInfo, subcktName, self.mappingData["Devices"][deviceName]["import"] ) + ".NPN" elif trans == 'pnp': - start = ( - self.mappingData - ["Devices"] - [deviceName] - ["import"] - ) + ".PNP" + start = (self.mappingData + ["Devices"] + [deviceName] + ["import"] + ) + ".PNP" else: raise NameError("Transistor " + str(trans) + " Not found") diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index 5e98d24a5..9c9ebbd85 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -27,11 +27,16 @@ def createSubcircuit(self, subName): - Name can not be empty. - File name already exists. """ + + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.create_schematic = subName # Checking if Workspace already exist or not self.schematic_path = ( os.path.join( - os.path.abspath('library'), + os.path.abspath(init_path + 'library'), 'SubcircuitLibrary', self.create_schematic)) diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index 6cb4fe3ed..0e0906c08 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -16,9 +16,14 @@ def __init__(self): self.obj_appconfig = Appconfig() def body(self): + + init_path = '../../' + if os.name == 'nt': + init_path = '' + self.editfile = str( QtGui.QFileDialog.getExistingDirectory( - None, "Open File", "library/SubcircuitLibrary")) + None, "Open File", init_path + "library/SubcircuitLibrary")) if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ diff --git a/src/subcircuit/uploadSub.py b/src/subcircuit/uploadSub.py index 25a6e7d42..c7b3951f5 100644 --- a/src/subcircuit/uploadSub.py +++ b/src/subcircuit/uploadSub.py @@ -63,8 +63,12 @@ def upload(self): print("Invalid file format") return + init_path = '../../' + if os.name == 'nt': + init_path = '' + subcircuit_path = os.path.join( - os.path.abspath('library'), + os.path.abspath(init_path + 'library'), 'SubcircuitLibrary', create_subcircuit ) From 8173e49d1a2d01d706dc8159aff507f7fc021964 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:54:43 +0530 Subject: [PATCH 03/15] update files and version info --- INSTALL | 45 +++++++++++++++------------- README.md | 39 +++++++++++++----------- VERSION | 2 +- src/kicadtoNgspice/KicadtoNgspice.py | 4 +-- 4 files changed, 48 insertions(+), 42 deletions(-) diff --git a/INSTALL b/INSTALL index 41d5a7447..e78d43213 100644 --- a/INSTALL +++ b/INSTALL @@ -4,49 +4,52 @@ eSim installation instructions Table of contents - 1. eSim installation in Ubuntu (LINUX) + 1. eSim installation in Ubuntu OS (LINUX) - 2. eSim installation in Windows + 2. eSim installation in Microsoft Windows OS -1. eSim installation in Ubuntu OS +1. eSim installation in Ubuntu OS - After downloading eSim, extract it using: + i. After downloading eSim, extract it using: - $ unzip eSim-2.0.zip + $ unzip eSim-2.1.zip - Now change directories in to the top-level eSim directory (where this INSTALL file can be found). + ii. Now change directories in to the top-level eSim directory (where this INSTALL file can be found). - To install eSim and other dependencies, run the following command : + iii. To install eSim and other dependencies, run the following command : - $ chmod +x install-eSim.sh - $ ./install-eSim.sh --install + $ chmod +x install-eSim.sh + $ ./install-eSim.sh --install - Above script will install eSim along with dependencies. + iv. To uninstall eSim and all of its components, run the following command : - To uninstall eSim and all of its components, run the following command : + $ ./install-eSim.sh --uninstall - $ ./install-eSim.sh --uninstall - - Please report any eSim installation related issue/error at forums.fossee.in How to Run eSim ================= - A. Through Terminal + A. Through Terminal - $ esim + $ esim + + B. Double click eSim desktop icon + - B. Double click eSim desktop icon +2. eSim installation in Windows OS + i. Download eSim for Windows OS from "https://esim.fossee.in/". Disable the antivirus (if any). -2. eSim installation in Windows OS + ii. Now double click on eSim installer and then follow the instruction to install eSim. - Download eSim for Windows OS from "https://esim.fossee.in/". Disable the antivirus (if any). + iii. To uninstall eSim and all of its components, run the uninstaller "uninst-eSim.exe" located at + top-level eSim directory (where this INSTALL file can be found). - Now double click on eSim installer and then follow the instruction to install eSim. - To uninstall eSim and all of its components, run the uninstaller "uninst-eSim.exe" located at top-level eSim directory (where this INSTALL file can be found). +Note +====== +Please report any eSim installation related issue/error at "https://forums.fossee.in/" \ No newline at end of file diff --git a/README.md b/README.md index d598610bb..8276a366a 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,36 @@ ## eSim -eSim is an open source EDA tool for circuit design, simulation, analysis and PCB design, developed by FOSSEE team at IIT Bombay. -It is an integrated tool build using open source software such as [KiCad](http://www.kicad-pcd.org), [Ngspice](http://ngspice.sourcefouge.net/), [GHDL](http://ghdl.free.fr/) -It is released under GNU GPL License. It runs on Ubuntu OS version 16.04, Windows 7 and above versions. +[eSim](https://esim.fossee.in/) is an open source EDA tool for circuit design, simulation, analysis and PCB design, developed by [FOSSEE Team](https://www.fossee.in/) at [IIT Bombay](http://www.iitb.ac.in/). +It is an integrated tool build using open source softwares such as KiCad, Ngspice, GHDL, etc. + +## Releases +* Ubuntu 16.04 OS and above LTS versions. +* Microsoft Windows 7, 8 and 10. ## Features -* An open-source tool. -* Perform circuit design. +* An open-source EDA tool. +* Perform Circuit Design. * Perform Simulation. -* Perform layout design. +* Perform Layout Design. * Model builder and Subcircuit builder. -* Support for Mixed Mode Simulation (Currently supported only on Ubuntu OS). +* Support for Mixed-Signal Simulations including Microcontrollers. * eSim has been successfully ported to low cost FOSSEE [laptop](http://laptop.fossee.in) -## Open-Source Software Used -* Python. -* KiCad. -* Ngspice. -* GHDL. +## Open-Source Softwares Used +* [Python](https://www.python.org/) +* [KiCad](http://www.kicad-pcd.org) +* [Ngspice](http://ngspice.sourcefouge.net/) +* [GHDL](http://ghdl.free.fr/) ## Pre-requisites -1. NGHDL -2. Ngspice-31 -3. KiCad 4.0.7 (latest version released on April-2019) -4. Xterm +1. Python v3.5+ +2. Ngspice v31+ +3. KiCad v4.0.7 (latest version released on April-2019) +4. [NGHDL](https://github.com/fossee/nghdl) ## eSim Installation: -To use eSim on your machine please refer to link [here](https://esim.fossee.in/downloads) for installation and other guidelines. +To use eSim on your machine please refer to link [here](https://esim.fossee.in/downloads) for installation and other guidelines. ## eSim Manual To know everything about eSim, how it works and it's feature please download manual [here](https://static.fossee.in/esim/installation-files/eSim_Manual_2.0.pdf) @@ -39,4 +42,4 @@ For any queries regarding eSim please write us on at this [address](mailto:conta Please refer [here](https://github.com/FOSSEE/eSim/tree/master/CONTRIBUTION.md) for further details. ## License -It is developed by FOSSEE team at IIT Bombay. It is released under GNU GPL License. +It is developed by FOSSEE Team at IIT Bombay. It is released under GNU GPL License. diff --git a/VERSION b/VERSION index 415b19fc3..879b416e6 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0 \ No newline at end of file +2.1 diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index b52a4de82..4ce7d49ba 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -11,9 +11,9 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay. # CREATED: Wednesday 04 March 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Friday 24 July 2020 # ========================================================================= import sys From cde494dc77c0d48cffa1e9aca77121fec0e94cf0 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Fri, 24 Jul 2020 01:57:19 +0530 Subject: [PATCH 04/15] fixed modality of workspace dialog with splash screen --- src/frontEnd/Application.py | 12 ++++++++---- src/frontEnd/Workspace.py | 13 +++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 6eaf4c9c8..cb7a75272 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -19,8 +19,8 @@ import os if os.name == 'nt': # noqa - init_path = '' from frontEnd import pathmagic # noqa:F401 + init_path = '' else: import pathmagic # noqa:F401 init_path = '../../' @@ -814,11 +814,15 @@ def main(args): print("Starting eSim......") app = QtGui.QApplication(args) + appView = Application() + appView.hide() + splash_pix = QtGui.QPixmap(init_path + 'images/splash_screen_esim.png') - splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint) + splash = QtGui.QSplashScreen(appView, splash_pix, QtCore.Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) + splash.setDisabled(True) splash.show() - appView = Application() + appView.splash = splash appView.obj_workspace.returnWhetherClickedOrNot(appView) @@ -830,10 +834,10 @@ def main(args): file.close() except IOError: work = 0 + if work != 0: appView.obj_workspace.defaultWorkspace() else: - appView.hide() appView.obj_workspace.show() sys.exit(app.exec_()) diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index ee3a49f31..85dafdf31 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -49,11 +49,12 @@ def initWorkspace(self): self.grid = QtGui.QGridLayout() self.note = QtGui.QTextEdit(self) - self.workspace_label = QtGui.QLabel(self) - self.workspace_loc = QtGui.QLineEdit(self) - self.note.append(self.obj_appconfig.workspace_text) + self.note.setReadOnly(True) + + self.workspace_label = QtGui.QLabel(self) self.workspace_label.setText("Workspace:") + self.workspace_loc = QtGui.QLineEdit(self) self.workspace_loc.setText(self.obj_appconfig.home) # Buttons @@ -81,7 +82,7 @@ def initWorkspace(self): self.setMaximumSize(4000, 200) self.setWindowTitle("eSim") self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) - self.note.setReadOnly(True) + self.setWindowModality(2) init_path = '../../' if os.name == 'nt': @@ -106,7 +107,7 @@ def defaultWorkspace(self): ) var_appView.show() - time.sleep(1) + time.sleep(1.5) var_appView.splash.close() def close(self, *args, **kwargs): @@ -166,7 +167,7 @@ def createWorkspace(self): ) var_appView.show() - time.sleep(1) + time.sleep(1.5) var_appView.splash.close() def browseLocation(self): From 400d0b5d31c22122dbb430b75122c9f86ca72342 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 11:27:14 +0530 Subject: [PATCH 05/15] renamed Mixed_Mode examples to Mixed_Signal --- .../Cmosinverter/Cmosinverter-cache.lib | 0 .../Cmosinverter/Cmosinverter.cir | 0 .../Cmosinverter/Cmosinverter.cir.out | 0 .../Cmosinverter/Cmosinverter.pro | 0 .../Cmosinverter/Cmosinverter.proj | 0 .../Cmosinverter/Cmosinverter.sch | 0 .../Cmosinverter/Cmosinverter_Previous_Values.xml | 0 .../Cmosinverter/INVCMOS-cache.lib | 0 .../Cmosinverter/INVCMOS.cir | 0 .../Cmosinverter/INVCMOS.cir.out | 0 .../Cmosinverter/INVCMOS.pro | 0 .../Cmosinverter/INVCMOS.sch | 0 .../Cmosinverter/INVCMOS.sub | 0 .../Cmosinverter/INVCMOS_Previous_Values.xml | 0 .../Cmosinverter/NMOS-180nm.lib | 0 .../Cmosinverter/PMOS-180nm.lib | 0 .../{Mixed_Mode => Mixed_Signal}/Cmosinverter/analysis | 0 .../PWM_Decremental/NPN.lib | 0 .../PWM_Decremental/PNP.lib | 0 .../PWM_Decremental/PWM_Decremental-cache.lib | 0 .../PWM_Decremental/PWM_Decremental.cir | 0 .../PWM_Decremental/PWM_Decremental.cir.out | 0 .../PWM_Decremental/PWM_Decremental.pro | 0 .../PWM_Decremental/PWM_Decremental.proj | 0 .../PWM_Decremental/PWM_Decremental.sch | 0 .../PWM_Decremental_Previous_Values.xml | 0 .../PWM_Decremental/analysis | 0 .../PWM_Decremental/lm_741-cache.lib | 0 .../PWM_Decremental/lm_741-rescue.lib | 0 .../PWM_Decremental/lm_741.cir | 0 .../PWM_Decremental/lm_741.cir.out | 0 .../PWM_Decremental/lm_741.pro | 0 .../PWM_Decremental/lm_741.sch | 0 .../PWM_Decremental/lm_741.sub | 0 .../PWM_Decremental/lm_741_Previous_Values.xml | 0 .../PWM_Decremental/npn_1.lib | 0 .../PWM_Decremental/pnp_1.lib | 0 .../PWM_Incremental/NPN.lib | 0 .../PWM_Incremental/PNP.lib | 0 .../PWM_Incremental/PWM_Incremental-cache.lib | 0 .../PWM_Incremental/PWM_Incremental.cir | 0 .../PWM_Incremental/PWM_Incremental.cir.out | 0 .../PWM_Incremental/PWM_Incremental.pro | 0 .../PWM_Incremental/PWM_Incremental.proj | 0 .../PWM_Incremental/PWM_Incremental.sch | 0 .../PWM_Incremental_Previous_Values.xml | 0 .../PWM_Incremental/analysis | 0 .../PWM_Incremental/lm_741-cache.lib | 0 .../PWM_Incremental/lm_741-rescue.lib | 0 .../PWM_Incremental/lm_741.cir | 0 .../PWM_Incremental/lm_741.cir.out | 0 .../PWM_Incremental/lm_741.pro | 0 .../PWM_Incremental/lm_741.sch | 0 .../PWM_Incremental/lm_741.sub | 0 .../PWM_Incremental/lm_741_Previous_Values.xml | 0 .../PWM_Incremental/npn_1.lib | 0 .../PWM_Incremental/pnp_1.lib | 0 Examples/{Mixed_Mode => Mixed_Signal}/README.md | 10 +++++----- .../custom_mixed_mode/NPN.lib | 0 .../custom_mixed_mode/NPN.txt | 0 .../custom_mixed_mode/PNP.lib | 0 .../custom_mixed_mode/PNP.txt | 0 .../custom_mixed_mode/analysis | 0 .../custom_mixed_mode/custom_mixed_mode-cache.lib | 0 .../custom_mixed_mode/custom_mixed_mode-cache.txt | 0 .../custom_mixed_mode/custom_mixed_mode.cir | 0 .../custom_mixed_mode/custom_mixed_mode.cir.out | 0 .../custom_mixed_mode/custom_mixed_mode.pro | 0 .../custom_mixed_mode/custom_mixed_mode.proj | 0 .../custom_mixed_mode/custom_mixed_mode.sch | 0 .../custom_mixed_mode_Previous_Values.xml | 0 .../custom_mixed_mode/customblock.vhdl | 0 .../custom_mixed_mode/lm_741-cache.lib | 0 .../custom_mixed_mode/lm_741-cache.txt | 0 .../custom_mixed_mode/lm_741-rescue.lib | 0 .../custom_mixed_mode/lm_741-rescue.txt | 0 .../custom_mixed_mode/lm_741.cir | 0 .../custom_mixed_mode/lm_741.cir.out | 0 .../custom_mixed_mode/lm_741.pro | 0 .../custom_mixed_mode/lm_741.sch | 0 .../custom_mixed_mode/lm_741.sub | 0 .../custom_mixed_mode/lm_741_Previous_Values.xml | 0 .../custom_mixed_mode/npn_1.lib | 0 .../custom_mixed_mode/npn_1.txt | 0 .../custom_mixed_mode/pnp_1.lib | 0 .../custom_mixed_mode/pnp_1.txt | 0 86 files changed, 5 insertions(+), 5 deletions(-) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter.proj (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/Cmosinverter_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS.sub (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/INVCMOS_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/NMOS-180nm.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/PMOS-180nm.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/Cmosinverter/analysis (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/NPN.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PNP.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental.proj (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/PWM_Decremental_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/analysis (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741-rescue.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741.sub (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/lm_741_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/npn_1.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Decremental/pnp_1.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/NPN.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PNP.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental.proj (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/PWM_Incremental_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/analysis (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741-rescue.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741.sub (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/lm_741_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/npn_1.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/PWM_Incremental/pnp_1.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/README.md (69%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/NPN.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/NPN.txt (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/PNP.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/PNP.txt (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/analysis (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode-cache.txt (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode.proj (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/customblock.vhdl (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741-cache.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741-cache.txt (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741-rescue.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741-rescue.txt (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741.cir (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741.cir.out (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741.pro (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741.sch (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741.sub (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/lm_741_Previous_Values.xml (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/npn_1.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/npn_1.txt (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/pnp_1.lib (100%) rename Examples/{Mixed_Mode => Mixed_Signal}/custom_mixed_mode/pnp_1.txt (100%) diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter-cache.lib b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter-cache.lib similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter-cache.lib rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter-cache.lib diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter.cir b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter.cir similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter.cir rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter.cir diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter.cir.out b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter.cir.out similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter.cir.out rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter.cir.out diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter.pro b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter.pro similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter.pro rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter.pro diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter.proj b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter.proj similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter.proj rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter.proj diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter.sch b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter.sch similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter.sch rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter.sch diff --git a/Examples/Mixed_Mode/Cmosinverter/Cmosinverter_Previous_Values.xml b/Examples/Mixed_Signal/Cmosinverter/Cmosinverter_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/Cmosinverter_Previous_Values.xml rename to Examples/Mixed_Signal/Cmosinverter/Cmosinverter_Previous_Values.xml diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS-cache.lib b/Examples/Mixed_Signal/Cmosinverter/INVCMOS-cache.lib similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS-cache.lib rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS-cache.lib diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS.cir b/Examples/Mixed_Signal/Cmosinverter/INVCMOS.cir similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS.cir rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS.cir diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS.cir.out b/Examples/Mixed_Signal/Cmosinverter/INVCMOS.cir.out similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS.cir.out rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS.cir.out diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS.pro b/Examples/Mixed_Signal/Cmosinverter/INVCMOS.pro similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS.pro rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS.pro diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS.sch b/Examples/Mixed_Signal/Cmosinverter/INVCMOS.sch similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS.sch rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS.sch diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS.sub b/Examples/Mixed_Signal/Cmosinverter/INVCMOS.sub similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS.sub rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS.sub diff --git a/Examples/Mixed_Mode/Cmosinverter/INVCMOS_Previous_Values.xml b/Examples/Mixed_Signal/Cmosinverter/INVCMOS_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/INVCMOS_Previous_Values.xml rename to Examples/Mixed_Signal/Cmosinverter/INVCMOS_Previous_Values.xml diff --git a/Examples/Mixed_Mode/Cmosinverter/NMOS-180nm.lib b/Examples/Mixed_Signal/Cmosinverter/NMOS-180nm.lib similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/NMOS-180nm.lib rename to Examples/Mixed_Signal/Cmosinverter/NMOS-180nm.lib diff --git a/Examples/Mixed_Mode/Cmosinverter/PMOS-180nm.lib b/Examples/Mixed_Signal/Cmosinverter/PMOS-180nm.lib similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/PMOS-180nm.lib rename to Examples/Mixed_Signal/Cmosinverter/PMOS-180nm.lib diff --git a/Examples/Mixed_Mode/Cmosinverter/analysis b/Examples/Mixed_Signal/Cmosinverter/analysis similarity index 100% rename from Examples/Mixed_Mode/Cmosinverter/analysis rename to Examples/Mixed_Signal/Cmosinverter/analysis diff --git a/Examples/Mixed_Mode/PWM_Decremental/NPN.lib b/Examples/Mixed_Signal/PWM_Decremental/NPN.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/NPN.lib rename to Examples/Mixed_Signal/PWM_Decremental/NPN.lib diff --git a/Examples/Mixed_Mode/PWM_Decremental/PNP.lib b/Examples/Mixed_Signal/PWM_Decremental/PNP.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PNP.lib rename to Examples/Mixed_Signal/PWM_Decremental/PNP.lib diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental-cache.lib b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental-cache.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental-cache.lib rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental-cache.lib diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.cir b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.cir similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.cir rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.cir diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.cir.out b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.cir.out similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.cir.out rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.cir.out diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.pro b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.pro similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.pro rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.pro diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.proj b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.proj similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.proj rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.proj diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.sch b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.sch similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental.sch rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental.sch diff --git a/Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental_Previous_Values.xml b/Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/PWM_Decremental_Previous_Values.xml rename to Examples/Mixed_Signal/PWM_Decremental/PWM_Decremental_Previous_Values.xml diff --git a/Examples/Mixed_Mode/PWM_Decremental/analysis b/Examples/Mixed_Signal/PWM_Decremental/analysis similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/analysis rename to Examples/Mixed_Signal/PWM_Decremental/analysis diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741-cache.lib b/Examples/Mixed_Signal/PWM_Decremental/lm_741-cache.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741-cache.lib rename to Examples/Mixed_Signal/PWM_Decremental/lm_741-cache.lib diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741-rescue.lib b/Examples/Mixed_Signal/PWM_Decremental/lm_741-rescue.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741-rescue.lib rename to Examples/Mixed_Signal/PWM_Decremental/lm_741-rescue.lib diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741.cir b/Examples/Mixed_Signal/PWM_Decremental/lm_741.cir similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741.cir rename to Examples/Mixed_Signal/PWM_Decremental/lm_741.cir diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741.cir.out b/Examples/Mixed_Signal/PWM_Decremental/lm_741.cir.out similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741.cir.out rename to Examples/Mixed_Signal/PWM_Decremental/lm_741.cir.out diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741.pro b/Examples/Mixed_Signal/PWM_Decremental/lm_741.pro similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741.pro rename to Examples/Mixed_Signal/PWM_Decremental/lm_741.pro diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741.sch b/Examples/Mixed_Signal/PWM_Decremental/lm_741.sch similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741.sch rename to Examples/Mixed_Signal/PWM_Decremental/lm_741.sch diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741.sub b/Examples/Mixed_Signal/PWM_Decremental/lm_741.sub similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741.sub rename to Examples/Mixed_Signal/PWM_Decremental/lm_741.sub diff --git a/Examples/Mixed_Mode/PWM_Decremental/lm_741_Previous_Values.xml b/Examples/Mixed_Signal/PWM_Decremental/lm_741_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/lm_741_Previous_Values.xml rename to Examples/Mixed_Signal/PWM_Decremental/lm_741_Previous_Values.xml diff --git a/Examples/Mixed_Mode/PWM_Decremental/npn_1.lib b/Examples/Mixed_Signal/PWM_Decremental/npn_1.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/npn_1.lib rename to Examples/Mixed_Signal/PWM_Decremental/npn_1.lib diff --git a/Examples/Mixed_Mode/PWM_Decremental/pnp_1.lib b/Examples/Mixed_Signal/PWM_Decremental/pnp_1.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Decremental/pnp_1.lib rename to Examples/Mixed_Signal/PWM_Decremental/pnp_1.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/NPN.lib b/Examples/Mixed_Signal/PWM_Incremental/NPN.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/NPN.lib rename to Examples/Mixed_Signal/PWM_Incremental/NPN.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/PNP.lib b/Examples/Mixed_Signal/PWM_Incremental/PNP.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PNP.lib rename to Examples/Mixed_Signal/PWM_Incremental/PNP.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental-cache.lib b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental-cache.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental-cache.lib rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental-cache.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.cir b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.cir similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.cir rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.cir diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.cir.out b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.cir.out similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.cir.out rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.cir.out diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.pro b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.pro similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.pro rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.pro diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.proj b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.proj similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.proj rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.proj diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.sch b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.sch similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental.sch rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental.sch diff --git a/Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental_Previous_Values.xml b/Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/PWM_Incremental_Previous_Values.xml rename to Examples/Mixed_Signal/PWM_Incremental/PWM_Incremental_Previous_Values.xml diff --git a/Examples/Mixed_Mode/PWM_Incremental/analysis b/Examples/Mixed_Signal/PWM_Incremental/analysis similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/analysis rename to Examples/Mixed_Signal/PWM_Incremental/analysis diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741-cache.lib b/Examples/Mixed_Signal/PWM_Incremental/lm_741-cache.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741-cache.lib rename to Examples/Mixed_Signal/PWM_Incremental/lm_741-cache.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741-rescue.lib b/Examples/Mixed_Signal/PWM_Incremental/lm_741-rescue.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741-rescue.lib rename to Examples/Mixed_Signal/PWM_Incremental/lm_741-rescue.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741.cir b/Examples/Mixed_Signal/PWM_Incremental/lm_741.cir similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741.cir rename to Examples/Mixed_Signal/PWM_Incremental/lm_741.cir diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741.cir.out b/Examples/Mixed_Signal/PWM_Incremental/lm_741.cir.out similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741.cir.out rename to Examples/Mixed_Signal/PWM_Incremental/lm_741.cir.out diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741.pro b/Examples/Mixed_Signal/PWM_Incremental/lm_741.pro similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741.pro rename to Examples/Mixed_Signal/PWM_Incremental/lm_741.pro diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741.sch b/Examples/Mixed_Signal/PWM_Incremental/lm_741.sch similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741.sch rename to Examples/Mixed_Signal/PWM_Incremental/lm_741.sch diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741.sub b/Examples/Mixed_Signal/PWM_Incremental/lm_741.sub similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741.sub rename to Examples/Mixed_Signal/PWM_Incremental/lm_741.sub diff --git a/Examples/Mixed_Mode/PWM_Incremental/lm_741_Previous_Values.xml b/Examples/Mixed_Signal/PWM_Incremental/lm_741_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/lm_741_Previous_Values.xml rename to Examples/Mixed_Signal/PWM_Incremental/lm_741_Previous_Values.xml diff --git a/Examples/Mixed_Mode/PWM_Incremental/npn_1.lib b/Examples/Mixed_Signal/PWM_Incremental/npn_1.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/npn_1.lib rename to Examples/Mixed_Signal/PWM_Incremental/npn_1.lib diff --git a/Examples/Mixed_Mode/PWM_Incremental/pnp_1.lib b/Examples/Mixed_Signal/PWM_Incremental/pnp_1.lib similarity index 100% rename from Examples/Mixed_Mode/PWM_Incremental/pnp_1.lib rename to Examples/Mixed_Signal/PWM_Incremental/pnp_1.lib diff --git a/Examples/Mixed_Mode/README.md b/Examples/Mixed_Signal/README.md similarity index 69% rename from Examples/Mixed_Mode/README.md rename to Examples/Mixed_Signal/README.md index cecc70bd7..e8f5aa265 100644 --- a/Examples/Mixed_Mode/README.md +++ b/Examples/Mixed_Signal/README.md @@ -1,15 +1,15 @@ Instructions on how to use the following examples provided in this directory: These examples are supported by the NGHDL feature. -In order to simulate the examples listed above, follow the below instructions. - (Note that NGHDL feature is only for Ubuntu Linux OS users) +In order to simulate the examples listed above, follow the below instructions. + 1. Go to eSim main window -> Click on NGHDL icon from the left toolbar, click on the 'browse' button, go to ../nghdl/Example/ and locate which example you wish to simulate. 2. After opening the directory of desired example, locate the vhdl file, click on the "Open" button at the bottom of "Open File" window. 3. Click on 'upload' button in the NGHDL pop-up window. File will be processed in the backend for few seconds. Now exit the NGHDL window. -4. Open the desired example under eSim/Examples/Mixed_Mode/ using the Open Project button, double click on the project when the project is loaded in the "Projects" window. -5. Click on the "Simulation" button on eSim Main window. +4. Open the desired example under eSim/Examples/Mixed_Signal/ using the Open Project button, double click on the project when the project is loaded in the "Projects" window. +5. Click on the "Simulation" button on eSim main window. More examples will be added by eSim team along the way. If you have a good command on VHDL and electronics, please feel free to contribute. -Note : The Examples in this directory are for demonstration purpose of eSim's Mixed-Mode simulation feature executing as expected. +Note : The Examples in this directory are for demonstration purpose of eSim's Mixed-Signal Simulation feature executing as expected. diff --git a/Examples/Mixed_Mode/custom_mixed_mode/NPN.lib b/Examples/Mixed_Signal/custom_mixed_mode/NPN.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/NPN.lib rename to Examples/Mixed_Signal/custom_mixed_mode/NPN.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/NPN.txt b/Examples/Mixed_Signal/custom_mixed_mode/NPN.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/NPN.txt rename to Examples/Mixed_Signal/custom_mixed_mode/NPN.txt diff --git a/Examples/Mixed_Mode/custom_mixed_mode/PNP.lib b/Examples/Mixed_Signal/custom_mixed_mode/PNP.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/PNP.lib rename to Examples/Mixed_Signal/custom_mixed_mode/PNP.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/PNP.txt b/Examples/Mixed_Signal/custom_mixed_mode/PNP.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/PNP.txt rename to Examples/Mixed_Signal/custom_mixed_mode/PNP.txt diff --git a/Examples/Mixed_Mode/custom_mixed_mode/analysis b/Examples/Mixed_Signal/custom_mixed_mode/analysis similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/analysis rename to Examples/Mixed_Signal/custom_mixed_mode/analysis diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode-cache.lib b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode-cache.lib rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode-cache.txt b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode-cache.txt rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.txt diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.cir b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.cir rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.cir.out b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir.out similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.cir.out rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir.out diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.pro b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.pro similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.pro rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.pro diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.proj b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.proj similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.proj rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.proj diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.sch b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.sch similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode.sch rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.sch diff --git a/Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml b/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml rename to Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml diff --git a/Examples/Mixed_Mode/custom_mixed_mode/customblock.vhdl b/Examples/Mixed_Signal/custom_mixed_mode/customblock.vhdl similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/customblock.vhdl rename to Examples/Mixed_Signal/custom_mixed_mode/customblock.vhdl diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741-cache.lib b/Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741-cache.lib rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741-cache.txt b/Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741-cache.txt rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.txt diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741-rescue.lib b/Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741-rescue.lib rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741-rescue.txt b/Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741-rescue.txt rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.txt diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741.cir b/Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741.cir rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741.cir.out b/Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir.out similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741.cir.out rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir.out diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741.pro b/Examples/Mixed_Signal/custom_mixed_mode/lm_741.pro similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741.pro rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741.pro diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741.sch b/Examples/Mixed_Signal/custom_mixed_mode/lm_741.sch similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741.sch rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741.sch diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741.sub b/Examples/Mixed_Signal/custom_mixed_mode/lm_741.sub similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741.sub rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741.sub diff --git a/Examples/Mixed_Mode/custom_mixed_mode/lm_741_Previous_Values.xml b/Examples/Mixed_Signal/custom_mixed_mode/lm_741_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/lm_741_Previous_Values.xml rename to Examples/Mixed_Signal/custom_mixed_mode/lm_741_Previous_Values.xml diff --git a/Examples/Mixed_Mode/custom_mixed_mode/npn_1.lib b/Examples/Mixed_Signal/custom_mixed_mode/npn_1.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/npn_1.lib rename to Examples/Mixed_Signal/custom_mixed_mode/npn_1.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/npn_1.txt b/Examples/Mixed_Signal/custom_mixed_mode/npn_1.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/npn_1.txt rename to Examples/Mixed_Signal/custom_mixed_mode/npn_1.txt diff --git a/Examples/Mixed_Mode/custom_mixed_mode/pnp_1.lib b/Examples/Mixed_Signal/custom_mixed_mode/pnp_1.lib similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/pnp_1.lib rename to Examples/Mixed_Signal/custom_mixed_mode/pnp_1.lib diff --git a/Examples/Mixed_Mode/custom_mixed_mode/pnp_1.txt b/Examples/Mixed_Signal/custom_mixed_mode/pnp_1.txt similarity index 100% rename from Examples/Mixed_Mode/custom_mixed_mode/pnp_1.txt rename to Examples/Mixed_Signal/custom_mixed_mode/pnp_1.txt From d86b1ce0c62f4acb6c287394049e824400de0a6f Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 11:30:42 +0530 Subject: [PATCH 06/15] removed kicad latest info --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8276a366a..0db7eac11 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## eSim [eSim](https://esim.fossee.in/) is an open source EDA tool for circuit design, simulation, analysis and PCB design, developed by [FOSSEE Team](https://www.fossee.in/) at [IIT Bombay](http://www.iitb.ac.in/). -It is an integrated tool build using open source softwares such as KiCad, Ngspice, GHDL, etc. +It is an integrated tool build using open source softwares such as KiCad, Ngspice and GHDL. ## Releases * Ubuntu 16.04 OS and above LTS versions. @@ -25,7 +25,7 @@ It is an integrated tool build using open source softwares such as KiCad, Ngspic ## Pre-requisites 1. Python v3.5+ 2. Ngspice v31+ -3. KiCad v4.0.7 (latest version released on April-2019) +3. KiCad v4.0.7 4. [NGHDL](https://github.com/fossee/nghdl) ## eSim Installation: From d7e14cecfe0abdd9aeea5e589ddaeb5c302f5877 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 11:31:46 +0530 Subject: [PATCH 07/15] updated info and visual indent --- library/browser/welcome.html | 95 ++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 48 deletions(-) diff --git a/library/browser/welcome.html b/library/browser/welcome.html index 2d0c0b852..f1300f49a 100644 --- a/library/browser/welcome.html +++ b/library/browser/welcome.html @@ -1,55 +1,54 @@ - - - - - -

About eSim

-
eSim logo
-
-

-eSim 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 (http://www.kicad-pcb.org), Ngspice (http://ngspice.sourceforge.net) and GHDL (http://ghdl.free.fr). eSim source is released under GNU General Public License. -

-
-

-This tool is developed by the FOSSEE team at IIT Bombay. To know more about eSim, please visit: http://esim.fossee.in. -

-
-

-To discuss more about eSim please visits at http://forums.fossee.in -

-
- + pre{ + margin: 0px 10px 0px 10px; + font-family: monospaced; + font-size: 10pt; + } + #license{ + font-size:8pt; + } + + + +

About eSim

+
eSim logo
+
+

+ eSim is an open source EDA tool for circuit design, simulation, analysis and PCB design. It is an integrated tool built using open source softwares such as KiCad (http://www.kicad-pcb.org), Ngspice (http://ngspice.sourceforge.net) and GHDL (http://ghdl.free.fr). eSim source is released under GNU General Public License. +

+
+

+ This tool is developed by the FOSSEE team at IIT Bombay. To know more about eSim, please visit: http://esim.fossee.in. +

+
+

+ To discuss more about eSim, please visit: http://forums.fossee.in +

+
+ + From 2eb6697de529a643127599070771a0278e9817b3 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:03:41 +0530 Subject: [PATCH 08/15] ported GUI to PyQt5 --- src/browser/UserManual.py | 8 +- src/browser/Welcome.py | 10 +- src/configuration/Appconfig.py | 10 +- src/frontEnd/Application.py | 108 ++++++++++--------- src/frontEnd/DockArea.py | 65 +++++------ src/frontEnd/ProjectExplorer.py | 59 +++++----- src/frontEnd/Workspace.py | 34 +++--- src/kicadtoNgspice/Analysis.py | 127 +++++++++++----------- src/kicadtoNgspice/Convert.py | 4 +- src/kicadtoNgspice/DeviceModel.py | 58 +++++----- src/kicadtoNgspice/KicadtoNgspice.py | 49 ++++----- src/kicadtoNgspice/Model.py | 20 ++-- src/kicadtoNgspice/Source.py | 60 +++++------ src/kicadtoNgspice/SubcircuitTab.py | 26 ++--- src/modelEditor/ModelEditor.py | 89 ++++++++------- src/ngspiceSimulation/NgspiceWidget.py | 50 ++++----- src/ngspiceSimulation/pythonPlotting.py | 137 ++++++++++-------------- src/ngspicetoModelica/ModelicaUI.py | 26 ++--- src/projManagement/Kicad.py | 16 +-- src/projManagement/Worker.py | 6 +- src/projManagement/newProject.py | 16 +-- src/projManagement/openProject.py | 18 ++-- src/subcircuit/Subcircuit.py | 24 ++--- src/subcircuit/convertSub.py | 8 +- src/subcircuit/newSub.py | 12 +-- src/subcircuit/openSub.py | 9 +- src/subcircuit/uploadSub.py | 17 +-- 27 files changed, 518 insertions(+), 548 deletions(-) diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py index 886d88a57..e723680a4 100644 --- a/src/browser/UserManual.py +++ b/src/browser/UserManual.py @@ -1,18 +1,18 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets import subprocess import os -class UserManual(QtGui.QWidget): +class UserManual(QtWidgets.QWidget): """ This class opens User-Manual page in new tab of web browser when help button is clicked. """ def __init__(self): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) - self.vlayout = QtGui.QVBoxLayout() + self.vlayout = QtWidgets.QVBoxLayout() manual = 'library/browser/User-Manual/eSim_Manual_2.1.pdf' diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py index aa7b612fd..f864a21f5 100644 --- a/src/browser/Welcome.py +++ b/src/browser/Welcome.py @@ -1,17 +1,17 @@ -from PyQt4 import QtGui, QtCore +from PyQt5 import QtCore, QtWidgets import os -class Welcome(QtGui.QWidget): +class Welcome(QtWidgets.QWidget): """ This class contains content of dock area part of initial esim Window. It creates Welcome page of eSim. """ def __init__(self): - QtGui.QWidget.__init__(self) - self.vlayout = QtGui.QVBoxLayout() - self.browser = QtGui.QTextBrowser() + QtWidgets.QWidget.__init__(self) + self.vlayout = QtWidgets.QVBoxLayout() + self.browser = QtWidgets.QTextBrowser() init_path = '../../' if os.name == 'nt': diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index a079d472c..94abb44cf 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -11,18 +11,18 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 24 July 2020 +# REVISION: Saturday 25 July 2020 # ========================================================================= -from PyQt4 import QtGui +from PyQt5 import QtWidgets import os import json from configparser import SafeConfigParser -class Appconfig(QtGui.QWidget): +class Appconfig(QtWidgets.QWidget): """ All configuration goes here. May change in future for code optimization. @@ -102,7 +102,7 @@ def __init__(self): super(Appconfig, self).__init__() # Application Details self._APPLICATION = 'eSim' - self._VERSION = 'v2.0.0' + self._VERSION = 'v2.1.0' self._AUTHOR = 'Fahim, Rahul' # Application geometry setting diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index cb7a75272..d373e6954 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -11,9 +11,9 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 24 July 2020 +# REVISION: Saturday 25 July 2020 # ========================================================================= import os @@ -25,7 +25,7 @@ import pathmagic # noqa:F401 init_path = '../../' -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore, QtWidgets from configuration.Appconfig import Appconfig from projManagement.openProject import OpenProjectInfo from projManagement.newProject import NewProjectInfo @@ -35,14 +35,14 @@ from frontEnd import ProjectExplorer from frontEnd import Workspace from frontEnd import DockArea -from PyQt4.Qt import QSize +from PyQt5.Qt import QSize import shutil import time import sys # Its our main window of application. -class Application(QtGui.QMainWindow): +class Application(QtWidgets.QMainWindow): """This class initializes all objects used in this file.""" global project_name @@ -50,7 +50,7 @@ def __init__(self, *args): """Initialize main Application window.""" # Calling __init__ of super class - QtGui.QMainWindow.__init__(self, *args) + QtWidgets.QMainWindow.__init__(self, *args) # Flag for mode of operation. Default is set to offline mode. self.online_flag = False @@ -73,7 +73,7 @@ def __init__(self, *args): self.showMaximized() self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) - self.systemTrayIcon = QtGui.QSystemTrayIcon(self) + self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.systemTrayIcon.setVisible(True) @@ -89,28 +89,28 @@ def initToolBar(self): Converter, OM Optimisation) """ # Top Tool bar - self.newproj = QtGui.QAction( + self.newproj = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/newProject.png'), 'New Project', self ) self.newproj.setShortcut('Ctrl+N') self.newproj.triggered.connect(self.new_project) - self.openproj = QtGui.QAction( + self.openproj = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/openProject.png'), 'Open Project', self ) self.openproj.setShortcut('Ctrl+O') self.openproj.triggered.connect(self.open_project) - self.closeproj = QtGui.QAction( + self.closeproj = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/closeProject.png'), 'Close Project', self ) self.closeproj.setShortcut('Ctrl+X') self.closeproj.triggered.connect(self.close_project) - self.wrkspce = QtGui.QAction( + self.wrkspce = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/workspace.ico'), 'Change Workspace', self ) @@ -120,17 +120,17 @@ def initToolBar(self): self.switchmode = None self.validate_mode() if self.online_flag is True: - self.switchmode = QtGui.QAction(QtGui.QIcon( + self.switchmode = QtWidgets.QAction(QtGui.QIcon( init_path + 'images/online.png'), 'Go Offline', self ) elif self.online_flag is False: - self.switchmode = QtGui.QAction(QtGui.QIcon( + self.switchmode = QtWidgets.QAction(QtGui.QIcon( init_path + 'images/offline.png'), 'Go Online', self ) elif self.online_flag is None: - self.switchmode = QtGui.QAction(QtGui.QIcon( + self.switchmode = QtWidgets.QAction(QtGui.QIcon( init_path + 'images/disable.png'), 'Mode switching has been disabled. ' + 'Default mode set to offline', self @@ -139,7 +139,7 @@ def initToolBar(self): self.switchmode.setShortcut('Ctrl+G') self.switchmode.triggered.connect(self.change_mode) - self.helpfile = QtGui.QAction( + self.helpfile = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/helpProject.png'), 'Help', self ) @@ -156,12 +156,12 @@ def initToolBar(self): # This part is setting fossee logo to the right # corner in the application window. - self.spacer = QtGui.QWidget() + self.spacer = QtWidgets.QWidget() self.spacer.setSizePolicy( - QtGui.QSizePolicy.Expanding, - QtGui.QSizePolicy.Expanding) + QtWidgets.QSizePolicy.Expanding, + QtWidgets.QSizePolicy.Expanding) self.topToolbar.addWidget(self.spacer) - self.logo = QtGui.QLabel() + self.logo = QtWidgets.QLabel() self.logopic = QtGui.QPixmap( os.path.join( os.path.abspath(''), init_path + 'images', 'fosseeLogo.png' @@ -173,55 +173,55 @@ def initToolBar(self): self.topToolbar.addWidget(self.logo) # Left Tool bar Action Widget - self.kicad = QtGui.QAction( + self.kicad = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/kicad.png'), 'Open Schematic', self ) self.kicad.triggered.connect(self.obj_kicad.openSchematic) - self.conversion = QtGui.QAction( + self.conversion = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/ki-ng.png'), 'Convert Kicad to Ngspice', self ) self.conversion.triggered.connect(self.obj_kicad.openKicadToNgspice) - self.ngspice = QtGui.QAction( + self.ngspice = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/ngspice.png'), 'Simulation', self ) self.ngspice.triggered.connect(self.open_ngspice) - self.model = QtGui.QAction( + self.model = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/model.png'), 'Model Editor', self ) self.model.triggered.connect(self.open_modelEditor) - self.subcircuit = QtGui.QAction( + self.subcircuit = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/subckt.png'), 'Subcircuit', self ) self.subcircuit.triggered.connect(self.open_subcircuit) - self.nghdl = QtGui.QAction( + self.nghdl = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/nghdl.png'), 'Nghdl', self ) self.nghdl.triggered.connect(self.open_nghdl) - self.omedit = QtGui.QAction( + self.omedit = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/omedit.png'), 'Modelica Converter', self ) self.omedit.triggered.connect(self.open_OMedit) - self.omoptim = QtGui.QAction( + self.omoptim = QtWidgets.QAction( QtGui.QIcon(init_path + 'images/omoptim.png'), 'OM Optimisation', self ) self.omoptim.triggered.connect(self.open_OMoptim) # Adding Action Widget to tool bar - self.lefttoolbar = QtGui.QToolBar('Left ToolBar') + self.lefttoolbar = QtWidgets.QToolBar('Left ToolBar') self.addToolBar(QtCore.Qt.LeftToolBarArea, self.lefttoolbar) self.lefttoolbar.addAction(self.kicad) self.lefttoolbar.addAction(self.conversion) @@ -254,12 +254,12 @@ def closeEvent(self, event): ''' exit_msg = "Are you sure you want to exit the program?" exit_msg += " All unsaved data will be lost." - reply = QtGui.QMessageBox.question( - self, 'Message', exit_msg, QtGui.QMessageBox.Yes, - QtGui.QMessageBox.No + reply = QtWidgets.QMessageBox.question( + self, 'Message', exit_msg, QtWidgets.QMessageBox.Yes, + QtWidgets.QMessageBox.No ) - if reply == QtGui.QMessageBox.Yes: + if reply == QtWidgets.QMessageBox.Yes: for proc in self.obj_appconfig.procThread_list: try: proc.terminate() @@ -283,12 +283,12 @@ def closeEvent(self, event): event.accept() self.systemTrayIcon.showMessage('Exit', 'eSim is Closed.') - elif reply == QtGui.QMessageBox.No: + elif reply == QtWidgets.QMessageBox.No: event.ignore() def new_project(self): """This function call New Project Info class.""" - text, ok = QtGui.QInputDialog.getText( + text, ok = QtWidgets.QInputDialog.getText( self, 'New Project Info', 'Enter Project Name:' ) if ok: @@ -492,7 +492,7 @@ def change_mode(self): ) self.switchmode.setEnabled(False) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setWindowTitle("Error Message") self.msg.setModal(True) self.msg.showMessage( @@ -544,7 +544,7 @@ def open_ngspice(self): try: self.obj_Mainview.obj_dockarea.plottingEditor() except Exception as e: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -556,7 +556,7 @@ def open_ngspice(self): self.obj_appconfig.print_error('Exception Message : ' + str(e)) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -597,7 +597,7 @@ def open_nghdl(self): self.obj_workThread = Worker.WorkerThread(self.cmd) self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle('NGHDL Error') self.msg.showMessage('Error while opening NGHDL. ' + @@ -651,7 +651,7 @@ def open_OMedit(self): self.obj_workThread2 = Worker.WorkerThread(self.cmd2) self.obj_workThread2.start() else: - self.msg = QtGui.QMessageBox() + self.msg = QtWidgets.QMessageBox() self.msgContent = "There was an error while opening OMEdit.
\ Please make sure OpenModelica is installed in your\ @@ -671,7 +671,7 @@ def open_OMedit(self): self.msg.exec_() except Exception as e: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle( "Ngspice to Modelica conversion error") @@ -685,7 +685,7 @@ def open_OMedit(self): self.obj_Mainview.obj_dockarea.modelicaEditor(self.projDir) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Missing Ngspice netlist") self.msg.showMessage( @@ -694,7 +694,7 @@ def open_OMedit(self): ) self.msg.exec_() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -721,7 +721,7 @@ def open_OMoptim(self): self.obj_workThread = Worker.WorkerThread(self.cmd) self.obj_workThread.start() else: - self.msg = QtGui.QMessageBox() + self.msg = QtWidgets.QMessageBox() self.msgContent = ( "There was an error while opening OMOptim.
" "Please make sure OpenModelica is installed in your" @@ -742,7 +742,7 @@ def open_OMoptim(self): # This class initialize the Main View of Application -class MainView(QtGui.QWidget): +class MainView(QtWidgets.QWidget): """ This class defines whole view and style of main page: @@ -756,20 +756,20 @@ class MainView(QtGui.QWidget): def __init__(self, *args): # call init method of superclass - QtGui.QWidget.__init__(self, *args) + QtWidgets.QWidget.__init__(self, *args) self.obj_appconfig = Appconfig() - self.leftSplit = QtGui.QSplitter() - self.middleSplit = QtGui.QSplitter() + self.leftSplit = QtWidgets.QSplitter() + self.middleSplit = QtWidgets.QSplitter() - self.mainLayout = QtGui.QVBoxLayout() + self.mainLayout = QtWidgets.QVBoxLayout() # Intermediate Widget - self.middleContainer = QtGui.QWidget() - self.middleContainerLayout = QtGui.QVBoxLayout() + self.middleContainer = QtWidgets.QWidget() + self.middleContainerLayout = QtWidgets.QVBoxLayout() # Area to be included in MainView - self.noteArea = QtGui.QTextEdit() + self.noteArea = QtWidgets.QTextEdit() self.noteArea.setReadOnly(True) self.obj_appconfig.noteArea['Note'] = self.noteArea self.obj_appconfig.noteArea['Note'].append( @@ -812,13 +812,15 @@ def main(args): by this function. """ print("Starting eSim......") - app = QtGui.QApplication(args) + app = QtWidgets.QApplication(args) appView = Application() appView.hide() splash_pix = QtGui.QPixmap(init_path + 'images/splash_screen_esim.png') - splash = QtGui.QSplashScreen(appView, splash_pix, QtCore.Qt.WindowStaysOnTopHint) + splash = QtWidgets.QSplashScreen( + appView, splash_pix, QtCore.Qt.WindowStaysOnTopHint + ) splash.setMask(splash_pix.mask()) splash.setDisabled(True) splash.show() diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py index b8ebfac44..b96c468a3 100644 --- a/src/frontEnd/DockArea.py +++ b/src/frontEnd/DockArea.py @@ -1,4 +1,4 @@ -from PyQt4 import QtGui, QtCore +from PyQt5 import QtCore, QtWidgets from ngspiceSimulation.pythonPlotting import plotWindow from ngspiceSimulation.NgspiceWidget import NgspiceWidget from configuration.Appconfig import Appconfig @@ -15,7 +15,7 @@ dock = {} -class DockArea(QtGui.QMainWindow): +class DockArea(QtWidgets.QMainWindow): """ This class contains function for designing UI of all the editors in dock area part: @@ -31,13 +31,13 @@ class DockArea(QtGui.QMainWindow): def __init__(self): """This act as constructor for class DockArea.""" - QtGui.QMainWindow.__init__(self) + QtWidgets.QMainWindow.__init__(self) self.obj_appconfig = Appconfig() for dockName in dockList: - dock[dockName] = QtGui.QDockWidget(dockName) - self.welcomeWidget = QtGui.QWidget() - self.welcomeLayout = QtGui.QVBoxLayout() + dock[dockName] = QtWidgets.QDockWidget(dockName) + self.welcomeWidget = QtWidgets.QWidget() + self.welcomeLayout = QtWidgets.QVBoxLayout() self.welcomeLayout.addWidget(Welcome()) # Call browser # Adding to main Layout @@ -57,14 +57,15 @@ def createTestEditor(self): """This function create widget for Library Editor""" global count - self.testWidget = QtGui.QWidget() - self.testArea = QtGui.QTextEdit() - self.testLayout = QtGui.QVBoxLayout() + self.testWidget = QtWidgets.QWidget() + self.testArea = QtWidgets.QTextEdit() + self.testLayout = QtWidgets.QVBoxLayout() self.testLayout.addWidget(self.testArea) # Adding to main Layout self.testWidget.setLayout(self.testLayout) - dock['Tips-' + str(count)] = QtGui.QDockWidget('Tips-' + str(count)) + dock['Tips-' + str(count)] = \ + QtWidgets.QDockWidget('Tips-' + str(count)) dock['Tips-' + str(count)].setWidget(self.testWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Tips-' + str(count)]) @@ -90,15 +91,15 @@ def plottingEditor(self): # self.project = os.path.join(self.projDir, self.projName) global count - self.plottingWidget = QtGui.QWidget() + self.plottingWidget = QtWidgets.QWidget() - self.plottingLayout = QtGui.QVBoxLayout() + self.plottingLayout = QtWidgets.QVBoxLayout() self.plottingLayout.addWidget(plotWindow(self.projDir, self.projName)) # Adding to main Layout self.plottingWidget.setLayout(self.plottingLayout) dock['Plotting-' + str(count) - ] = QtGui.QDockWidget('Plotting-' + str(count)) + ] = QtWidgets.QDockWidget('Plotting-' + str(count)) dock['Plotting-' + str(count)].setWidget(self.plottingWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Plotting-' + str(count)]) @@ -123,9 +124,9 @@ def ngspiceEditor(self, projDir): self.projDir, self.projName + ".cir.out") global count - self.ngspiceWidget = QtGui.QWidget() + self.ngspiceWidget = QtWidgets.QWidget() - self.ngspiceLayout = QtGui.QVBoxLayout() + self.ngspiceLayout = QtWidgets.QVBoxLayout() self.ngspiceLayout.addWidget( NgspiceWidget(self.ngspiceNetlist, self.projDir) ) @@ -133,7 +134,7 @@ def ngspiceEditor(self, projDir): # Adding to main Layout self.ngspiceWidget.setLayout(self.ngspiceLayout) dock['NgSpice-' + str(count) - ] = QtGui.QDockWidget('NgSpice-' + str(count)) + ] = QtWidgets.QDockWidget('NgSpice-' + str(count)) dock['NgSpice-' + str(count)].setWidget(self.ngspiceWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['NgSpice-' + str(count)]) @@ -160,16 +161,16 @@ def modelEditor(self): """This function defines UI for model editor.""" print("in model editor") global count - self.modelwidget = QtGui.QWidget() + self.modelwidget = QtWidgets.QWidget() - self.modellayout = QtGui.QVBoxLayout() + self.modellayout = QtWidgets.QVBoxLayout() self.modellayout.addWidget(ModelEditorclass()) # Adding to main Layout self.modelwidget.setLayout(self.modellayout) dock['Model Editor-' + - str(count)] = QtGui.QDockWidget('Model Editor-' + str(count)) + str(count)] = QtWidgets.QDockWidget('Model Editor-' + str(count)) dock['Model Editor-' + str(count)].setWidget(self.modelwidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Model Editor-' + str(count)]) @@ -193,13 +194,13 @@ def kicadToNgspiceEditor(self, clarg1, clarg2=None): This function is creating Editor UI for Kicad to Ngspice conversion. """ global count - self.kicadToNgspiceWidget = QtGui.QWidget() - self.kicadToNgspiceLayout = QtGui.QVBoxLayout() + self.kicadToNgspiceWidget = QtWidgets.QWidget() + self.kicadToNgspiceLayout = QtWidgets.QVBoxLayout() self.kicadToNgspiceLayout.addWidget(MainWindow(clarg1, clarg2)) self.kicadToNgspiceWidget.setLayout(self.kicadToNgspiceLayout) - dock['kicadToNgspice-' + - str(count)] = QtGui.QDockWidget('kicadToNgspice-' + str(count)) + dock['kicadToNgspice-' + str(count)] = \ + QtWidgets.QDockWidget('kicadToNgspice-' + str(count)) dock['kicadToNgspice-' + str(count)].setWidget(self.kicadToNgspiceWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, @@ -228,13 +229,13 @@ def kicadToNgspiceEditor(self, clarg1, clarg2=None): def subcircuiteditor(self): """This function creates a widget for different subcircuit options.""" global count - self.subcktWidget = QtGui.QWidget() - self.subcktLayout = QtGui.QVBoxLayout() + self.subcktWidget = QtWidgets.QWidget() + self.subcktLayout = QtWidgets.QVBoxLayout() self.subcktLayout.addWidget(Subcircuit(self)) self.subcktWidget.setLayout(self.subcktLayout) dock['Subcircuit-' + - str(count)] = QtGui.QDockWidget('Subcircuit-' + str(count)) + str(count)] = QtWidgets.QDockWidget('Subcircuit-' + str(count)) dock['Subcircuit-' + str(count)].setWidget(self.subcktWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Subcircuit-' + str(count)]) @@ -256,13 +257,13 @@ def subcircuiteditor(self): def usermanual(self): """This function creates a widget for user manual.""" global count - self.usermanualWidget = QtGui.QWidget() - self.usermanualLayout = QtGui.QVBoxLayout() + self.usermanualWidget = QtWidgets.QWidget() + self.usermanualLayout = QtWidgets.QVBoxLayout() self.usermanualLayout.addWidget(UserManual()) self.usermanualWidget.setLayout(self.usermanualLayout) dock['User Manual-' + - str(count)] = QtGui.QDockWidget('User Manual-' + str(count)) + str(count)] = QtWidgets.QDockWidget('User Manual-' + str(count)) dock['User Manual-' + str(count)].setWidget(self.usermanualWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['User Manual-' + str(count)]) @@ -284,13 +285,13 @@ def usermanual(self): def modelicaEditor(self, projDir): """This function sets up the UI for ngspice to modelica conversion.""" global count - self.modelicaWidget = QtGui.QWidget() - self.modelicaLayout = QtGui.QVBoxLayout() + self.modelicaWidget = QtWidgets.QWidget() + self.modelicaLayout = QtWidgets.QVBoxLayout() self.modelicaLayout.addWidget(OpenModelicaEditor(projDir)) self.modelicaWidget.setLayout(self.modelicaLayout) dock['Modelica-' + str(count) - ] = QtGui.QDockWidget('Modelica-' + str(count)) + ] = QtWidgets.QDockWidget('Modelica-' + str(count)) dock['Modelica-' + str(count)].setWidget(self.modelicaWidget) self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Modelica-' + str(count)]) diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index d327427c2..456276c85 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -1,4 +1,4 @@ -from PyQt4 import QtGui, QtCore +from PyQt5 import QtCore, QtWidgets import os import json from configuration.Appconfig import Appconfig @@ -6,7 +6,7 @@ # This is main class for Project Explorer Area. -class ProjectExplorer(QtGui.QWidget): +class ProjectExplorer(QtWidgets.QWidget): """ This class contains function: @@ -23,12 +23,12 @@ def __init__(self): - Working as a constructor for class ProjectExplorer. - view of project explorer area. """ - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.obj_validation = Validation() - self.treewidget = QtGui.QTreeWidget() - self.window = QtGui.QVBoxLayout() - header = QtGui.QTreeWidgetItem(["Projects", "path"]) + self.treewidget = QtWidgets.QTreeWidget() + self.window = QtWidgets.QVBoxLayout() + header = QtWidgets.QTreeWidgetItem(["Projects", "path"]) self.treewidget.setHeaderItem(header) self.treewidget.setColumnHidden(1, True) @@ -61,11 +61,11 @@ def __init__(self): os.path.join(parents) if os.path.exists(parents): pathlist = parents.split(os.sep) - parentnode = QtGui.QTreeWidgetItem( + parentnode = QtWidgets.QTreeWidgetItem( self.treewidget, [pathlist[-1], parents] ) for files in children: - QtGui.QTreeWidgetItem( + QtWidgets.QTreeWidgetItem( parentnode, [files, os.path.join(parents, files)] ) self.window.addWidget(self.treewidget) @@ -79,11 +79,11 @@ def __init__(self): def addTreeNode(self, parents, children): os.path.join(parents) pathlist = parents.split(os.sep) - parentnode = QtGui.QTreeWidgetItem( + parentnode = QtWidgets.QTreeWidgetItem( self.treewidget, [pathlist[-1], parents] ) for files in children: - QtGui.QTreeWidgetItem( + QtWidgets.QTreeWidgetItem( parentnode, [files, os.path.join(parents, files)] ) @@ -105,7 +105,7 @@ def openMenu(self, position): index = index.parent() level += 1 - menu = QtGui.QMenu() + menu = QtWidgets.QMenu() if level == 0: renameProject = menu.addAction(self.tr("Rename Project")) renameProject.triggered.connect(self.renameProject) @@ -128,30 +128,27 @@ def openProject(self): self.obj_appconfig.print_info( 'The current project is ' + self.filePath) - self.textwindow = QtGui.QWidget() + self.textwindow = QtWidgets.QWidget() self.textwindow.setMinimumSize(600, 500) self.textwindow.setGeometry(QtCore.QRect(400, 150, 400, 400)) self.textwindow.setWindowTitle(filename) - self.text = QtGui.QTextEdit() - self.save = QtGui.QPushButton('Save and Exit') + self.text = QtWidgets.QTextEdit() + self.save = QtWidgets.QPushButton('Save and Exit') self.save.setDisabled(True) - self.windowgrid = QtGui.QGridLayout() + self.windowgrid = QtWidgets.QGridLayout() if (os.path.isfile(str(self.filePath))): self.fopen = open(str(self.filePath), 'r') lines = self.fopen.read() self.text.setText(lines) - QtCore.QObject.connect( - self.text, QtCore.SIGNAL("textChanged()"), self.enable_save - ) + self.text.textChanged.connect(self.enable_save) - vbox_main = QtGui.QVBoxLayout(self.textwindow) + vbox_main = QtWidgets.QVBoxLayout(self.textwindow) vbox_main.addWidget(self.text) vbox_main.addWidget(self.save) self.save.clicked.connect(self.save_data) - # self.connect(exit,QtCore.SIGNAL('close()'), self.onQuit) self.textwindow.show() else: @@ -225,7 +222,7 @@ def refreshProject(self, filePath=None): for items in self.treewidget.selectedItems(): items.removeChild(items.child(0)) for files in filelistnew: - QtGui.QTreeWidgetItem( + QtWidgets.QTreeWidgetItem( parentnode, [files, os.path.join(filePath, files)] ) @@ -237,7 +234,7 @@ def refreshProject(self, filePath=None): else: print("Selected project not found") print("==================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage('Selected project does not exist.') @@ -262,9 +259,9 @@ def renameProject(self): self.indexItem.sibling(self.indexItem.row(), 1).data() ) - newBaseFileName, ok = QtGui.QInputDialog.getText( + newBaseFileName, ok = QtWidgets.QInputDialog.getText( self, 'Rename Project', 'Project Name:', - QtGui.QLineEdit.Normal, self.baseFileName + QtWidgets.QLineEdit.Normal, self.baseFileName ) if ok and newBaseFileName: @@ -273,7 +270,7 @@ def renameProject(self): if not newBaseFileName.strip(): print("Project name cannot be empty") print("==================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage('The project name cannot be empty') @@ -282,7 +279,7 @@ def renameProject(self): elif self.baseFileName == newBaseFileName: print("Project name has to be different") print("==================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage('The project name has to be different') @@ -312,7 +309,7 @@ def renameProject(self): print("Project Path :", projectPath) print("Project Files :", projectFiles) print("==================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage('Selected project does not exist.') @@ -331,7 +328,7 @@ def renameProject(self): try: os.rename(projectPath, updatedProjectPath) except BaseException as e: - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage(str(e)) @@ -370,7 +367,7 @@ def renameProject(self): # Revert project folder name os.rename(updatedProjectPath, projectPath) print("==================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage(str(e)) @@ -396,7 +393,7 @@ def renameProject(self): elif reply == "CHECKEXIST": print("Project name already exists.") print("==========================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage( @@ -409,7 +406,7 @@ def renameProject(self): elif reply == "CHECKNAME": print("Name can not contain space between them") print("===========================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage( diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py index 85dafdf31..58f56ce59 100644 --- a/src/frontEnd/Workspace.py +++ b/src/frontEnd/Workspace.py @@ -11,19 +11,19 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 05 February 2015 -# REVISION: Friday 24 July 2020 +# REVISION: Saturday 25 July 2020 # ========================================================================= -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtGui, QtWidgets from configuration.Appconfig import Appconfig import time import os import json -class Workspace(QtGui.QWidget): +class Workspace(QtWidgets.QWidget): """ This class creates UI for WorkSpace selection window. @@ -43,30 +43,30 @@ def __init__(self, parent=None): def initWorkspace(self): - self.mainwindow = QtGui.QVBoxLayout() - self.split = QtGui.QSplitter() + self.mainwindow = QtWidgets.QVBoxLayout() + self.split = QtWidgets.QSplitter() self.split.setOrientation(QtCore.Qt.Vertical) - self.grid = QtGui.QGridLayout() - self.note = QtGui.QTextEdit(self) + self.grid = QtWidgets.QGridLayout() + self.note = QtWidgets.QTextEdit(self) self.note.append(self.obj_appconfig.workspace_text) self.note.setReadOnly(True) - - self.workspace_label = QtGui.QLabel(self) + + self.workspace_label = QtWidgets.QLabel(self) self.workspace_label.setText("Workspace:") - self.workspace_loc = QtGui.QLineEdit(self) + self.workspace_loc = QtWidgets.QLineEdit(self) self.workspace_loc.setText(self.obj_appconfig.home) # Buttons - self.browsebtn = QtGui.QPushButton('Browse') + self.browsebtn = QtWidgets.QPushButton('Browse') self.browsebtn.clicked.connect(self.browseLocation) - self.okbtn = QtGui.QPushButton('OK') + self.okbtn = QtWidgets.QPushButton('OK') self.okbtn.clicked.connect(self.createWorkspace) - self.cancelbtn = QtGui.QPushButton('Cancel') + self.cancelbtn = QtWidgets.QPushButton('Cancel') self.cancelbtn.clicked.connect(self.defaultWorkspace) # Checkbox - self.chkbox = QtGui.QCheckBox('Set Default', self) + self.chkbox = QtWidgets.QCheckBox('Set Default', self) self.chkbox.setCheckState(int(self.obj_appconfig.workspace_check)) # Layout @@ -113,7 +113,7 @@ def defaultWorkspace(self): def close(self, *args, **kwargs): self.window_open_close = 1 self.close_var = 1 - return QtGui.QWidget.close(self, *args, **kwargs) + return QtWidgets.QWidget.close(self, *args, **kwargs) def returnWhetherClickedOrNot(self, appView): global var_appView @@ -172,7 +172,7 @@ def createWorkspace(self): def browseLocation(self): print("Function : Browse Location") - self.workspace_directory = QtGui.QFileDialog.getExistingDirectory( + self.workspace_directory = QtWidgets.QFileDialog.getExistingDirectory( self, "Browse Location", os.path.expanduser("~") ) self.workspace_loc.setText(self.workspace_directory) diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py index da0301535..32902a81c 100644 --- a/src/kicadtoNgspice/Analysis.py +++ b/src/kicadtoNgspice/Analysis.py @@ -1,10 +1,10 @@ -from PyQt4 import QtGui, QtCore +from PyQt5 import QtCore, QtWidgets from . import TrackWidget import os from xml.etree import ElementTree as ET -class Analysis(QtGui.QWidget): +class Analysis(QtWidgets.QWidget): """ - This class create Analysis Tab in KicadtoNgspice Window. 4 sections - - Select Analysis Type @@ -26,7 +26,7 @@ class Analysis(QtGui.QWidget): def __init__(self, clarg1): self.clarg1 = clarg1 - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.track_obj = TrackWidget.TrackWidget() self.count = 0 self.parameter_cnt = 0 @@ -48,7 +48,7 @@ def createAnalysisWidget(self): - Else set the default checkbox to `TRAN` - Accordingly set state for track widget options, as `TRAN`, `AC` ... """ - self.grid = QtGui.QGridLayout() + self.grid = QtWidgets.QGridLayout() self.setLayout(self.grid) self.grid.addWidget(self.createCheckBox(), 0, 0, QtCore.Qt.AlignTop) @@ -135,14 +135,14 @@ def createCheckBox(self): - checkbox > checkgrid > checkgroupbtn > checkAC | checkDC | checkTRAN - Trigger enableBox on clicking """ - self.checkbox = QtGui.QGroupBox() + self.checkbox = QtWidgets.QGroupBox() self.checkbox.setTitle("Select Analysis Type") - self.checkgrid = QtGui.QGridLayout() + self.checkgrid = QtWidgets.QGridLayout() - self.checkgroupbtn = QtGui.QButtonGroup() - self.checkAC = QtGui.QCheckBox("AC") - self.checkDC = QtGui.QCheckBox("DC") - self.checkTRAN = QtGui.QCheckBox("TRANSIENT") + self.checkgroupbtn = QtWidgets.QButtonGroup() + self.checkAC = QtWidgets.QCheckBox("AC") + self.checkDC = QtWidgets.QCheckBox("DC") + self.checkTRAN = QtWidgets.QCheckBox("TRANSIENT") self.checkgroupbtn.addButton(self.checkAC) self.checkgroupbtn.addButton(self.checkDC) @@ -221,15 +221,15 @@ def createACgroup(self): check = 0 print("AC Previous Values XML is Empty") - self.acbox = QtGui.QGroupBox() + self.acbox = QtWidgets.QGroupBox() self.acbox.setTitle("AC Analysis") self.acbox.setDisabled(True) self.acbox.setVisible(False) - self.acgrid = QtGui.QGridLayout() - self.radiobuttongroup = QtGui.QButtonGroup() - self.Lin = QtGui.QRadioButton("Lin") - self.Dec = QtGui.QRadioButton("Dec") - self.Oct = QtGui.QRadioButton("Oct") + self.acgrid = QtWidgets.QGridLayout() + self.radiobuttongroup = QtWidgets.QButtonGroup() + self.Lin = QtWidgets.QRadioButton("Lin") + self.Dec = QtWidgets.QRadioButton("Dec") + self.Oct = QtWidgets.QRadioButton("Oct") self.radiobuttongroup.addButton(self.Lin) self.radiobuttongroup.addButton(self.Dec) self.radiobuttongroup.addButton(self.Oct) @@ -242,30 +242,30 @@ def createACgroup(self): self.acgrid.addWidget(self.Oct, 1, 3) self.acbox.setLayout(self.acgrid) - self.scale = QtGui.QLabel("Scale") - self.start_fre_lable = QtGui.QLabel("Start Frequency") - self.stop_fre_lable = QtGui.QLabel("Stop Frequency") - self.no_of_points = QtGui.QLabel("No.of Points") + self.scale = QtWidgets.QLabel("Scale") + self.start_fre_lable = QtWidgets.QLabel("Start Frequency") + self.stop_fre_lable = QtWidgets.QLabel("Stop Frequency") + self.no_of_points = QtWidgets.QLabel("No.of Points") self.acgrid.addWidget(self.scale, 1, 0) self.acgrid.addWidget(self.start_fre_lable, 2, 0) self.acgrid.addWidget(self.stop_fre_lable, 3, 0) self.acgrid.addWidget(self.no_of_points, 4, 0) self.count = 0 - self.ac_entry_var[self.count] = QtGui.QLineEdit() # start + self.ac_entry_var[self.count] = QtWidgets.QLineEdit() # start self.acgrid.addWidget(self.ac_entry_var[self.count], 2, 1) self.ac_entry_var[self.count].setMaximumWidth(150) self.count = self.count + 1 - self.ac_entry_var[self.count] = QtGui.QLineEdit() # stop + self.ac_entry_var[self.count] = QtWidgets.QLineEdit() # stop self.acgrid.addWidget(self.ac_entry_var[self.count], 3, 1) self.ac_entry_var[self.count].setMaximumWidth(150) self.count = self.count + 1 - self.ac_entry_var[self.count] = QtGui.QLineEdit() # no of pts + self.ac_entry_var[self.count] = QtWidgets.QLineEdit() # no of pts self.acgrid.addWidget(self.ac_entry_var[self.count], 4, 1) self.ac_entry_var[self.count].setMaximumWidth(150) self.parameter_cnt = 0 - self.start_fre_combo = QtGui.QComboBox() + self.start_fre_combo = QtWidgets.QComboBox() self.start_fre_combo.addItem("Hz",) self.start_fre_combo.addItem("KHz") self.start_fre_combo.addItem("Meg") @@ -285,7 +285,7 @@ def createACgroup(self): self.start_fre_combo.activated[str].connect(self.start_combovalue) self.parameter_cnt = self.parameter_cnt + 1 - self.stop_fre_combo = QtGui.QComboBox() + self.stop_fre_combo = QtWidgets.QComboBox() self.stop_fre_combo.addItem("Hz") self.stop_fre_combo.addItem("KHz") self.stop_fre_combo.addItem("Meg") @@ -407,29 +407,29 @@ def createDCgroup(self): check = 0 print("DC Previous Values XML is empty") - self.dcbox = QtGui.QGroupBox() + self.dcbox = QtWidgets.QGroupBox() self.dcbox.setTitle("DC Analysis") self.dcbox.setDisabled(True) self.dcbox.setVisible(False) - self.dcgrid = QtGui.QGridLayout() + self.dcgrid = QtWidgets.QGridLayout() self.dcbox.setLayout(self.dcgrid) - self.source_name = QtGui.QLabel('Enter Source 1', self) + self.source_name = QtWidgets.QLabel('Enter Source 1', self) self.source_name.setMaximumWidth(150) - self.start = QtGui.QLabel('Start', self) + self.start = QtWidgets.QLabel('Start', self) self.start.setMaximumWidth(150) - self.increment = QtGui.QLabel('Increment', self) + self.increment = QtWidgets.QLabel('Increment', self) self.increment.setMaximumWidth(150) - self.stop = QtGui.QLabel('Stop', self) + self.stop = QtWidgets.QLabel('Stop', self) self.stop.setMaximumWidth(150) - self.source_name2 = QtGui.QLabel('Enter Source 2', self) + self.source_name2 = QtWidgets.QLabel('Enter Source 2', self) self.source_name2.setMaximumWidth(150) - self.start2 = QtGui.QLabel('Start', self) + self.start2 = QtWidgets.QLabel('Start', self) self.start2.setMaximumWidth(150) - self.increment2 = QtGui.QLabel('Increment', self) + self.increment2 = QtWidgets.QLabel('Increment', self) self.increment2.setMaximumWidth(150) - self.stop2 = QtGui.QLabel('Stop', self) + self.stop2 = QtWidgets.QLabel('Stop', self) self.stop2.setMaximumWidth(150) self.dcgrid.addWidget(self.source_name, 1, 0) @@ -444,47 +444,47 @@ def createDCgroup(self): self.count = 0 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # source + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # source self.dcgrid.addWidget(self.dc_entry_var[self.count], 1, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # start + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # start self.dcgrid.addWidget(self.dc_entry_var[self.count], 2, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # increment + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # increment self.dcgrid.addWidget(self.dc_entry_var[self.count], 3, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # stop + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # stop self.dcgrid.addWidget(self.dc_entry_var[self.count], 4, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # source + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # source self.dcgrid.addWidget(self.dc_entry_var[self.count], 5, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # start + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # start self.dcgrid.addWidget(self.dc_entry_var[self.count], 6, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # increment + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # increment self.dcgrid.addWidget(self.dc_entry_var[self.count], 7, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.dc_entry_var[self.count] = QtGui.QLineEdit() # stop + self.dc_entry_var[self.count] = QtWidgets.QLineEdit() # stop self.dcgrid.addWidget(self.dc_entry_var[self.count], 8, 1) self.dc_entry_var[self.count].setMaximumWidth(150) self.parameter_cnt = 0 - self.start_combo = QtGui.QComboBox(self) + self.start_combo = QtWidgets.QComboBox(self) self.start_combo.setMaximumWidth(150) self.start_combo.addItem('Volts or Amperes') self.start_combo.addItem('mV or mA') @@ -501,7 +501,7 @@ def createDCgroup(self): self.start_combo.activated[str].connect(self.start_changecombo) self.parameter_cnt += 1 - self.increment_combo = QtGui.QComboBox(self) + self.increment_combo = QtWidgets.QComboBox(self) self.increment_combo.setMaximumWidth(150) self.increment_combo.addItem("Volts or Amperes") self.increment_combo.addItem("mV or mA") @@ -518,7 +518,7 @@ def createDCgroup(self): self.increment_combo.activated[str].connect(self.increment_changecombo) self.parameter_cnt += 1 - self.stop_combo = QtGui.QComboBox(self) + self.stop_combo = QtWidgets.QComboBox(self) self.stop_combo.setMaximumWidth(150) self.stop_combo.addItem("Volts or Amperes") self.stop_combo.addItem("mV or mA") @@ -535,7 +535,7 @@ def createDCgroup(self): self.stop_combo.activated[str].connect(self.stop_changecombo) self.parameter_cnt += 1 - self.start_combo2 = QtGui.QComboBox(self) + self.start_combo2 = QtWidgets.QComboBox(self) self.start_combo2.setMaximumWidth(150) self.start_combo2.addItem('Volts or Amperes') self.start_combo2.addItem('mV or mA') @@ -552,7 +552,7 @@ def createDCgroup(self): self.start_combo2.activated[str].connect(self.start_changecombo2) self.parameter_cnt += 1 - self.increment_combo2 = QtGui.QComboBox(self) + self.increment_combo2 = QtWidgets.QComboBox(self) self.increment_combo2.setMaximumWidth(150) self.increment_combo2.addItem("Volts or Amperes") self.increment_combo2.addItem("mV or mA") @@ -570,7 +570,7 @@ def createDCgroup(self): self.increment_changecombo2) self.parameter_cnt += 1 - self.stop_combo2 = QtGui.QComboBox(self) + self.stop_combo2 = QtWidgets.QComboBox(self) self.stop_combo2.setMaximumWidth(150) self.stop_combo2.addItem("Volts or Amperes") self.stop_combo2.addItem("mV or mA") @@ -587,18 +587,15 @@ def createDCgroup(self): self.stop_combo2.activated[str].connect(self.stop_changecombo2) self.parameter_cnt += 1 - self.check = QtGui.QCheckBox('Operating Point Analysis', self) + self.check = QtWidgets.QCheckBox('Operating Point Analysis', self) try: self.track_obj.op_check.append( str(root[1][4].text())) except BaseException: self.track_obj.op_check.append('0') - # QtCore.QObject.connect(check, SIGNAL("stateChanged()"), check, - # SLOT("checkedSlot")) self.check.stateChanged.connect(self.setflag) - # self.flagcheck = 1 - # self.flagcheck= 2 + self.dcgrid.addWidget(self.check, 9, 1, 9, 2) self.track_obj.DC_entry_var["ITEMS"] = self.dc_entry_var self.track_obj.DC_Parameter["ITEMS"] = self.dc_parameter @@ -707,36 +704,36 @@ def createTRANgroup(self): check = 0 print("Transient Previous Values XML is Empty") - self.trbox = QtGui.QGroupBox() + self.trbox = QtWidgets.QGroupBox() self.trbox.setTitle("Transient Analysis") # self.trbox.setDisabled(True) # self.trbox.setVisible(False) - self.trgrid = QtGui.QGridLayout() + self.trgrid = QtWidgets.QGridLayout() self.trbox.setLayout(self.trgrid) - self.start = QtGui.QLabel("Start Time") - self.step = QtGui.QLabel("Step Time") - self.stop = QtGui.QLabel("Stop Time") + self.start = QtWidgets.QLabel("Start Time") + self.step = QtWidgets.QLabel("Step Time") + self.stop = QtWidgets.QLabel("Stop Time") self.trgrid.addWidget(self.start, 1, 0) self.trgrid.addWidget(self.step, 2, 0) self.trgrid.addWidget(self.stop, 3, 0) self.count = 0 - self.tran_entry_var[self.count] = QtGui.QLineEdit() + self.tran_entry_var[self.count] = QtWidgets.QLineEdit() self.trgrid.addWidget(self.tran_entry_var[self.count], 1, 1) self.tran_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.tran_entry_var[self.count] = QtGui.QLineEdit() + self.tran_entry_var[self.count] = QtWidgets.QLineEdit() self.trgrid.addWidget(self.tran_entry_var[self.count], 2, 1) self.tran_entry_var[self.count].setMaximumWidth(150) self.count += 1 - self.tran_entry_var[self.count] = QtGui.QLineEdit() + self.tran_entry_var[self.count] = QtWidgets.QLineEdit() self.trgrid.addWidget(self.tran_entry_var[self.count], 3, 1) self.tran_entry_var[self.count].setMaximumWidth(150) self.count += 1 self.parameter_cnt = 0 - self.start_combobox = QtGui.QComboBox() + self.start_combobox = QtWidgets.QComboBox() self.start_combobox.addItem("Sec") self.start_combobox.addItem("ms") self.start_combobox.addItem("us") @@ -752,7 +749,7 @@ def createTRANgroup(self): self.start_combobox.activated[str].connect(self.start_combo_change) self.parameter_cnt += 1 - self.step_combobox = QtGui.QComboBox() + self.step_combobox = QtWidgets.QComboBox() self.step_combobox.addItem("Sec") self.step_combobox.addItem("ms") self.step_combobox.addItem("us") @@ -767,7 +764,7 @@ def createTRANgroup(self): self.step_combobox.activated[str].connect(self.step_combo_change) self.parameter_cnt += 1 - self.stop_combobox = QtGui.QComboBox() + self.stop_combobox = QtWidgets.QComboBox() self.stop_combobox.addItem("Sec") self.stop_combobox.addItem("ms") self.stop_combobox.addItem("us") diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py index 7ab574270..24449a3bd 100644 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -1,4 +1,4 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets import os import shutil from . import TrackWidget @@ -584,7 +584,7 @@ def addSubcircuit(self, schematicInfo, kicadFile): if len(self.obj_track.subcircuitList) != len( self.obj_track.subcircuitTrack): - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index ceb893516..1c77cabc1 100644 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -1,10 +1,10 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets import os from xml.etree import ElementTree as ET from . import TrackWidget -class DeviceModel(QtGui.QWidget): +class DeviceModel(QtWidgets.QWidget): """ - This class creates Device Library Tab in KicadtoNgspice Window It dynamically creates the widget for device like diode,mosfet, @@ -42,7 +42,7 @@ def __init__(self, schematicInfo, clarg1): except BaseException: print("Device Model Previous XML is Empty") - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) # Creating track widget object self.obj_trac = TrackWidget.TrackWidget() @@ -62,7 +62,7 @@ def __init__(self, schematicInfo, clarg1): self.deviceDetail = {} # Set Layout - self.grid = QtGui.QGridLayout() + self.grid = QtWidgets.QGridLayout() self.setLayout(self.grid) # print("Reading Device model details from Schematic") @@ -73,14 +73,14 @@ def __init__(self, schematicInfo, clarg1): if eachline[0] == 'q': # print("Device Model Transistor: ", words[0]) self.devicemodel_dict_beg[words[0]] = self.count - transbox = QtGui.QGroupBox() - transgrid = QtGui.QGridLayout() + transbox = QtWidgets.QGroupBox() + transgrid = QtWidgets.QGridLayout() transbox.setTitle( "Add library for Transistor " + words[0] + " : " + words[4]) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") global path_name @@ -104,7 +104,7 @@ def __init__(self, schematicInfo, clarg1): pass transgrid.addWidget(self.entry_var[self.count], self.row, 1) - self.addbtn = QtGui.QPushButton("Add") + self.addbtn = QtWidgets.QPushButton("Add") self.addbtn.setObjectName("%d" % self.count) self.addbtn.clicked.connect(self.trackLibrary) self.deviceDetail[self.count] = words[0] @@ -137,14 +137,14 @@ def __init__(self, schematicInfo, clarg1): elif eachline[0] == 'd': # print("Device Model Diode:", words[0]) self.devicemodel_dict_beg[words[0]] = self.count - diodebox = QtGui.QGroupBox() - diodegrid = QtGui.QGridLayout() + diodebox = QtWidgets.QGroupBox() + diodegrid = QtWidgets.QGridLayout() diodebox.setTitle( "Add library for Diode " + words[0] + " : " + words[3]) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") # global path_name try: @@ -167,7 +167,7 @@ def __init__(self, schematicInfo, clarg1): pass diodegrid.addWidget(self.entry_var[self.count], self.row, 1) - self.addbtn = QtGui.QPushButton("Add") + self.addbtn = QtWidgets.QPushButton("Add") self.addbtn.setObjectName("%d" % self.count) self.addbtn.clicked.connect(self.trackLibrary) self.deviceDetail[self.count] = words[0] @@ -200,14 +200,14 @@ def __init__(self, schematicInfo, clarg1): elif eachline[0] == 'j': # print("Device Model JFET:", words[0]) self.devicemodel_dict_beg[words[0]] = self.count - jfetbox = QtGui.QGroupBox() - jfetgrid = QtGui.QGridLayout() + jfetbox = QtWidgets.QGroupBox() + jfetgrid = QtWidgets.QGridLayout() jfetbox.setTitle( "Add library for JFET " + words[0] + " : " + words[4]) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") # global path_name try: @@ -230,7 +230,7 @@ def __init__(self, schematicInfo, clarg1): pass jfetgrid.addWidget(self.entry_var[self.count], self.row, 1) - self.addbtn = QtGui.QPushButton("Add") + self.addbtn = QtWidgets.QPushButton("Add") self.addbtn.setObjectName("%d" % self.count) self.addbtn.clicked.connect(self.trackLibrary) self.deviceDetail[self.count] = words[0] @@ -262,8 +262,8 @@ def __init__(self, schematicInfo, clarg1): elif eachline[0] == 'm': self.devicemodel_dict_beg[words[0]] = self.count - mosfetbox = QtGui.QGroupBox() - mosfetgrid = QtGui.QGridLayout() + mosfetbox = QtWidgets.QGroupBox() + mosfetgrid = QtWidgets.QGridLayout() i = self.count beg = self.count mosfetbox.setTitle( @@ -271,10 +271,10 @@ def __init__(self, schematicInfo, clarg1): words[0] + " : " + words[5]) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") mosfetgrid.addWidget(self.entry_var[self.count], self.row, 1) - self.addbtn = QtGui.QPushButton("Add") + self.addbtn = QtWidgets.QPushButton("Add") self.addbtn.setObjectName("%d" % self.count) self.addbtn.clicked.connect(self.trackLibrary) mosfetgrid.addWidget(self.addbtn, self.row, 2) @@ -287,32 +287,32 @@ def __init__(self, schematicInfo, clarg1): self.count = self.count + 1 # Adding to get MOSFET dimension - self.widthLabel[self.count] = QtGui.QLabel( + self.widthLabel[self.count] = QtWidgets.QLabel( "Enter width of MOSFET " + words[0] + "(default=100u):") mosfetgrid.addWidget(self.widthLabel[self.count], self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") self.entry_var[self.count].setMaximumWidth(150) mosfetgrid.addWidget(self.entry_var[self.count], self.row, 1) self.row = self.row + 1 self.count = self.count + 1 - self.lengthLabel[self.count] = QtGui.QLabel( + self.lengthLabel[self.count] = QtWidgets.QLabel( "Enter length of MOSFET " + words[0] + "(default=100u):") mosfetgrid.addWidget(self.lengthLabel[self.count], self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") self.entry_var[self.count].setMaximumWidth(150) mosfetgrid.addWidget(self.entry_var[self.count], self.row, 1) self.row = self.row + 1 self.count = self.count + 1 - self.multifactorLable[self.count] = QtGui.QLabel( + self.multifactorLable[self.count] = QtWidgets.QLabel( "Enter multiplicative factor of MOSFET " + words[0] + "(default=1):") mosfetgrid.addWidget( self.multifactorLable[self.count], self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") end = self.count self.entry_var[self.count].setMaximumWidth(150) @@ -368,12 +368,10 @@ def trackLibrary(self): if os.name == 'nt': init_path = '' - self.libfile = str( - QtGui.QFileDialog.getOpenFileName( + self.libfile = QtWidgets.QFileDialog.getOpenFileName( self, "Open Library Directory", init_path + "library/deviceModelLibrary", "*.lib" - ) - ) + )[0] # Setting Library to Text Edit Line self.entry_var[self.widgetObjCount].setText(self.libfile) diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py index 4ce7d49ba..93cf6a4e9 100644 --- a/src/kicadtoNgspice/KicadtoNgspice.py +++ b/src/kicadtoNgspice/KicadtoNgspice.py @@ -11,14 +11,14 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 04 March 2015 -# REVISION: Friday 24 July 2020 +# REVISION: Saturday 25 July 2020 # ========================================================================= import sys import os -from PyQt4 import QtGui +from PyQt5 import QtWidgets from .Processing import PrcocessNetlist from . import Analysis from . import Source @@ -30,7 +30,7 @@ from xml.etree import ElementTree as ET -class MainWindow(QtGui.QWidget): +class MainWindow(QtWidgets.QWidget): """ - This class create KicadtoNgspice window. - And Call Convert function if convert button is pressed. @@ -42,7 +42,7 @@ class MainWindow(QtGui.QWidget): """ def __init__(self, clarg1, clarg2=None): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) print("==================================") print("Kicad to Ngspice netlist converter") print("==================================") @@ -120,7 +120,7 @@ def __init__(self, clarg1, clarg2=None): """ if unknownModelList: print("Unknown Model List is : ", unknownModelList) - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Unknown Models") self.content = "Your schematic contain unknown model " + \ @@ -129,7 +129,7 @@ def __init__(self, clarg1, clarg2=None): self.msg.exec_() elif multipleModelList: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Multiple Models") self.mcontent = "Look like you have duplicate model in \ @@ -148,10 +148,10 @@ def createMainWindow(self): - createcreateConvertWidget - Convert button => callConvert """ - self.vbox = QtGui.QVBoxLayout() - self.hbox = QtGui.QHBoxLayout() + self.vbox = QtWidgets.QVBoxLayout() + self.hbox = QtWidgets.QHBoxLayout() self.hbox.addStretch(1) - self.convertbtn = QtGui.QPushButton("Convert") + self.convertbtn = QtWidgets.QPushButton("Convert") self.convertbtn.clicked.connect(self.callConvert) self.hbox.addWidget(self.convertbtn) self.vbox.addWidget(self.createcreateConvertWidget()) @@ -183,44 +183,45 @@ def createcreateConvertWidget(self): - convertWindow > mainLayout > tabWidgets > AnalysisTab, SourceTab ... """ global obj_analysis - self.convertWindow = QtGui.QWidget() - self.analysisTab = QtGui.QScrollArea() + self.convertWindow = QtWidgets.QWidget() + self.analysisTab = QtWidgets.QScrollArea() obj_analysis = Analysis.Analysis(self.clarg1) self.analysisTab.setWidget(obj_analysis) - # self.analysisTabLayout = QtGui.QVBoxLayout(self.analysisTab.widget()) + # self.analysisTabLayout = \ + # QtWidgets.QVBoxLayout(self.analysisTab.widget()) self.analysisTab.setWidgetResizable(True) global obj_source - self.sourceTab = QtGui.QScrollArea() + self.sourceTab = QtWidgets.QScrollArea() obj_source = Source.Source(sourcelist, sourcelisttrack, self.clarg1) self.sourceTab.setWidget(obj_source) - # self.sourceTabLayout = QtGui.QVBoxLayout(self.sourceTab.widget()) + # self.sourceTabLayout = QtWidgets.QVBoxLayout(self.sourceTab.widget()) self.sourceTab.setWidgetResizable(True) global obj_model - self.modelTab = QtGui.QScrollArea() + self.modelTab = QtWidgets.QScrollArea() obj_model = Model.Model(schematicInfo, modelList, self.clarg1) self.modelTab.setWidget(obj_model) - # self.modelTabLayout = QtGui.QVBoxLayout(self.modelTab.widget()) + # self.modelTabLayout = QtWidgets.QVBoxLayout(self.modelTab.widget()) self.modelTab.setWidgetResizable(True) global obj_devicemodel - self.deviceModelTab = QtGui.QScrollArea() + self.deviceModelTab = QtWidgets.QScrollArea() obj_devicemodel = DeviceModel.DeviceModel(schematicInfo, self.clarg1) self.deviceModelTab.setWidget(obj_devicemodel) self.deviceModelTab.setWidgetResizable(True) global obj_subcircuitTab - self.subcircuitTab = QtGui.QScrollArea() + self.subcircuitTab = QtWidgets.QScrollArea() obj_subcircuitTab = SubcircuitTab.SubcircuitTab( schematicInfo, self.clarg1) self.subcircuitTab.setWidget(obj_subcircuitTab) self.subcircuitTab.setWidgetResizable(True) - self.tabWidget = QtGui.QTabWidget() - # self.tabWidget.TabShape(QtGui.QTabWidget.Rounded) + self.tabWidget = QtWidgets.QTabWidget() + # self.tabWidget.TabShape(QtWidgets.QTabWidget.Rounded) self.tabWidget.addTab(self.analysisTab, "Analysis") self.tabWidget.addTab(self.sourceTab, "Source Details") self.tabWidget.addTab(self.modelTab, "Ngspice Model") self.tabWidget.addTab(self.deviceModelTab, "Device Modeling") self.tabWidget.addTab(self.subcircuitTab, "Subcircuits") - self.mainLayout = QtGui.QVBoxLayout() + self.mainLayout = QtWidgets.QVBoxLayout() self.mainLayout.addWidget(self.tabWidget) # self.mainLayout.addStretch(1) self.convertWindow.setLayout(self.mainLayout) @@ -664,8 +665,8 @@ def callConvert(self): self.msg = "The Kicad to Ngspice Conversion completed " self.msg += "successfully!" - QtGui.QMessageBox.information( - self, "Information", self.msg, QtGui.QMessageBox.Ok + QtWidgets.QMessageBox.information( + self, "Information", self.msg, QtWidgets.QMessageBox.Ok ) except Exception as e: print("Exception Message: ", e) diff --git a/src/kicadtoNgspice/Model.py b/src/kicadtoNgspice/Model.py index a57577025..0c8211904 100644 --- a/src/kicadtoNgspice/Model.py +++ b/src/kicadtoNgspice/Model.py @@ -1,10 +1,10 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from . import TrackWidget from xml.etree import ElementTree as ET import os -class Model(QtGui.QWidget): +class Model(QtWidgets.QWidget): """ - This class creates Model Tab of KicadtoNgspice window. The widgets are created dynamically in the Model Tab. @@ -12,7 +12,7 @@ class Model(QtGui.QWidget): def __init__(self, schematicInfo, modelList, clarg1): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) # Processing for getting previous values kicadFile = clarg1 @@ -48,7 +48,7 @@ def __init__(self, schematicInfo, modelList, clarg1): self.end = 0 # Creating GUI dynamically for Model tab - self.grid = QtGui.QGridLayout() + self.grid = QtWidgets.QGridLayout() self.setLayout(self.grid) for line in modelList: @@ -56,8 +56,8 @@ def __init__(self, schematicInfo, modelList, clarg1): # Adding title label for model # Key: Tag name,Value:Entry widget number tag_dict = {} - modelbox = QtGui.QGroupBox() - modelgrid = QtGui.QGridLayout() + modelbox = QtWidgets.QGroupBox() + modelgrid = QtWidgets.QGridLayout() modelbox.setTitle(line[5]) self.start = self.nextcount # line[7] is parameter dictionary holding parameter tags. @@ -68,10 +68,10 @@ def __init__(self, schematicInfo, modelList, clarg1): # For tag having vector value temp_tag = [] for item in value: - paramLabel = QtGui.QLabel(item) + paramLabel = QtWidgets.QLabel(item) modelgrid.addWidget(paramLabel, self.nextrow, 0) self.obj_trac.model_entry_var[self.nextcount] = ( - QtGui.QLineEdit() + QtWidgets.QLineEdit() ) modelgrid.addWidget( self.obj_trac.model_entry_var @@ -93,10 +93,10 @@ def __init__(self, schematicInfo, modelList, clarg1): tag_dict[key] = temp_tag else: - paramLabel = QtGui.QLabel(value) + paramLabel = QtWidgets.QLabel(value) modelgrid.addWidget(paramLabel, self.nextrow, 0) self.obj_trac.model_entry_var[self.nextcount] = ( - QtGui.QLineEdit() + QtWidgets.QLineEdit() ) modelgrid.addWidget( self.obj_trac.model_entry_var[self.nextcount], diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py index e42899e3d..3febdfeb6 100644 --- a/src/kicadtoNgspice/Source.py +++ b/src/kicadtoNgspice/Source.py @@ -1,16 +1,16 @@ import os -from PyQt4 import QtGui +from PyQt5 import QtWidgets from . import TrackWidget from xml.etree import ElementTree as ET -class Source(QtGui.QWidget): +class Source(QtWidgets.QWidget): """ This class create Source Tab of KicadtoNgSpice Window. """ def __init__(self, sourcelist, sourcelisttrack, clarg1): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.obj_track = TrackWidget.TrackWidget() # Variables self.count = 1 @@ -67,7 +67,7 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): except BaseException: print("Source Previous Values XML is Empty") - self.grid = QtGui.QGridLayout() + self.grid = QtWidgets.QGridLayout() self.setLayout(self.grid) xml_num = 0 @@ -76,19 +76,19 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): print("SourceList line: ", line) track_id = line[0] if line[2] == 'ac': - acbox = QtGui.QGroupBox() + acbox = QtWidgets.QGroupBox() acbox.setTitle(line[3]) - acgrid = QtGui.QGridLayout() + acgrid = QtWidgets.QGridLayout() self.start = self.count - label1 = QtGui.QLabel(line[4]) - label2 = QtGui.QLabel(line[5]) + label1 = QtWidgets.QLabel(line[4]) + label2 = QtWidgets.QLabel(line[5]) acgrid.addWidget(label1, self.row, 0) acgrid.addWidget(label2, self.row + 1, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) acgrid.addWidget(self.entry_var[self.count], self.row, 1) - self.entry_var[self.count + 1] = QtGui.QLineEdit() + self.entry_var[self.count + 1] = QtWidgets.QLineEdit() self.entry_var[self.count + 1].setMaximumWidth(150) acgrid.addWidget( self.entry_var[self.count+1], self.row + 1, 1) @@ -127,15 +127,15 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): [track_id, 'ac', self.start, self.end]) elif line[2] == 'dc': - dcbox = QtGui.QGroupBox() + dcbox = QtWidgets.QGroupBox() dcbox.setTitle(line[3]) - dcgrid = QtGui.QGridLayout() + dcgrid = QtWidgets.QGridLayout() self.row = self.row + 1 self.start = self.count - label = QtGui.QLabel(line[4]) + label = QtWidgets.QLabel(line[4]) dcgrid.addWidget(label, self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) dcgrid.addWidget(self.entry_var[self.count], self.row, 1) self.entry_var[self.count].setText("") @@ -170,16 +170,16 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): [track_id, 'dc', self.start, self.end]) elif line[2] == 'sine': - sinebox = QtGui.QGroupBox() + sinebox = QtWidgets.QGroupBox() sinebox.setTitle(line[3]) - sinegrid = QtGui.QGridLayout() + sinegrid = QtWidgets.QGridLayout() self.row = self.row + 1 self.start = self.count for it in range(4, 9): - label = QtGui.QLabel(line[it]) + label = QtWidgets.QLabel(line[it]) sinegrid.addWidget(label, self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) sinegrid.addWidget( self.entry_var[self.count], self.row, 1) @@ -214,15 +214,15 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): [track_id, 'sine', self.start, self.end]) elif line[2] == 'pulse': - pulsebox = QtGui.QGroupBox() + pulsebox = QtWidgets.QGroupBox() pulsebox.setTitle(line[3]) - pulsegrid = QtGui.QGridLayout() + pulsegrid = QtWidgets.QGridLayout() self.start = self.count for it in range(4, 11): - label = QtGui.QLabel(line[it]) + label = QtWidgets.QLabel(line[it]) pulsegrid.addWidget(label, self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) pulsegrid.addWidget( self.entry_var[self.count], self.row, 1) @@ -257,13 +257,13 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): [track_id, 'pulse', self.start, self.end]) elif line[2] == 'pwl': - pwlbox = QtGui.QGroupBox() + pwlbox = QtWidgets.QGroupBox() pwlbox.setTitle(line[3]) self.start = self.count - pwlgrid = QtGui.QGridLayout() - label = QtGui.QLabel(line[4]) + pwlgrid = QtWidgets.QGridLayout() + label = QtWidgets.QLabel(line[4]) pwlgrid.addWidget(label, self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) pwlgrid.addWidget(self.entry_var[self.count], self.row, 1) self.entry_var[self.count].setText("") @@ -297,15 +297,15 @@ def createSourceWidget(self, sourcelist, sourcelisttrack): [track_id, 'pwl', self.start, self.end]) elif line[2] == 'exp': - expbox = QtGui.QGroupBox() + expbox = QtWidgets.QGroupBox() expbox.setTitle(line[3]) - expgrid = QtGui.QGridLayout() + expgrid = QtWidgets.QGridLayout() self.start = self.count for it in range(4, 10): - label = QtGui.QLabel(line[it]) + label = QtWidgets.QLabel(line[it]) expgrid.addWidget(label, self.row, 0) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setMaximumWidth(150) expgrid.addWidget( self.entry_var[self.count], self.row, 1) diff --git a/src/kicadtoNgspice/SubcircuitTab.py b/src/kicadtoNgspice/SubcircuitTab.py index f4b759c5b..4c7179d33 100644 --- a/src/kicadtoNgspice/SubcircuitTab.py +++ b/src/kicadtoNgspice/SubcircuitTab.py @@ -1,11 +1,11 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from . import TrackWidget from projManagement import Validation import os from xml.etree import ElementTree as ET -class SubcircuitTab(QtGui.QWidget): +class SubcircuitTab(QtWidgets.QWidget): """ - This class creates Subcircuit Tab in KicadtoNgspice Window - It dynamically creates the widget for subcircuits, @@ -37,7 +37,7 @@ def __init__(self, schematicInfo, clarg1): except BaseException: print("Subcircuit Previous values XML is Empty") - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) # Creating track widget object self.obj_trac = TrackWidget.TrackWidget() @@ -57,7 +57,7 @@ def __init__(self, schematicInfo, clarg1): self.numPorts = [] # Set Layout - self.grid = QtGui.QGridLayout() + self.grid = QtWidgets.QGridLayout() self.setLayout(self.grid) for eachline in schematicInfo: @@ -66,10 +66,10 @@ def __init__(self, schematicInfo, clarg1): # print("Subcircuit : Words", words[0]) self.obj_trac.subcircuitList[project_name + words[0]] = words self.subcircuit_dict_beg[words[0]] = self.count - subbox = QtGui.QGroupBox() - subgrid = QtGui.QGridLayout() + subbox = QtWidgets.QGroupBox() + subgrid = QtWidgets.QGridLayout() subbox.setTitle("Add subcircuit for " + words[len(words) - 1]) - self.entry_var[self.count] = QtGui.QLineEdit() + self.entry_var[self.count] = QtWidgets.QLineEdit() self.entry_var[self.count].setText("") global path_name @@ -94,7 +94,7 @@ def __init__(self, schematicInfo, clarg1): print("Error before subcircuit :", str(e)) subgrid.addWidget(self.entry_var[self.count], self.row, 1) - self.addbtn = QtGui.QPushButton("Add") + self.addbtn = QtWidgets.QPushButton("Add") self.addbtn.setObjectName("%d" % self.count) # Send the number of ports specified with the given\ # subcircuit for verification. @@ -151,7 +151,7 @@ def trackSubcircuit(self): init_path = '' self.subfile = str( - QtGui.QFileDialog.getExistingDirectory( + QtWidgets.QFileDialog.getExistingDirectory( self, "Open Subcircuit", init_path + "library/SubcircuitLibrary") ) @@ -166,14 +166,14 @@ def trackSubcircuit(self): self.obj_trac.subcircuitTrack[self.subName] = self.subfile elif self.reply == "PORT": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Please select a Subcircuit with correct number of ports.") self.msg.exec_() elif self.reply == "DIREC": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -201,14 +201,14 @@ def trackSubcircuitWithoutButton(self, iter_value, path_value): # Storing to track it during conversion self.obj_trac.subcircuitTrack[self.subName] = self.subfile elif self.reply == "PORT": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( "Please select a Subcircuit with correct number of ports.") self.msg.exec_() elif self.reply == "DIREC": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py index e8fda4823..bf5687a79 100644 --- a/src/modelEditor/ModelEditor.py +++ b/src/modelEditor/ModelEditor.py @@ -1,11 +1,11 @@ -from PyQt4 import QtGui, QtCore -from PyQt4.Qt import QTableWidgetItem +from PyQt5 import QtWidgets, QtCore +from PyQt5.Qt import QTableWidgetItem import xml.etree.ElementTree as ET from configuration.Appconfig import Appconfig import os -class ModelEditorclass(QtGui.QWidget): +class ModelEditorclass(QtWidgets.QWidget): ''' - Initialise the layout for dockarea - Use QVBoxLayout, QSplitter, QGridLayout to define the layout @@ -29,7 +29,7 @@ class ModelEditorclass(QtGui.QWidget): ''' def __init__(self): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.init_path = '../../' if os.name == 'nt': @@ -38,31 +38,31 @@ def __init__(self): self.savepathtest = self.init_path + 'library/deviceModelLibrary' self.obj_appconfig = Appconfig() self.newflag = 0 - self.layout = QtGui.QVBoxLayout() - self.splitter = QtGui.QSplitter() - self.grid = QtGui.QGridLayout() + self.layout = QtWidgets.QVBoxLayout() + self.splitter = QtWidgets.QSplitter() + self.grid = QtWidgets.QGridLayout() self.splitter.setOrientation(QtCore.Qt.Vertical) # Initialise the table view - self.modeltable = QtGui.QTableWidget() + self.modeltable = QtWidgets.QTableWidget() - self.newbtn = QtGui.QPushButton('New') + self.newbtn = QtWidgets.QPushButton('New') self.newbtn.setToolTip('Creating new Model Library') self.newbtn.clicked.connect(self.opennew) - self.editbtn = QtGui.QPushButton('Edit') + self.editbtn = QtWidgets.QPushButton('Edit') self.editbtn.setToolTip('Editing current Model Library') self.editbtn.clicked.connect(self.openedit) - self.savebtn = QtGui.QPushButton('Save') + self.savebtn = QtWidgets.QPushButton('Save') self.savebtn.setToolTip('Saves the Model Library') self.savebtn.setDisabled(True) self.savebtn.clicked.connect(self.savemodelfile) - self.removebtn = QtGui.QPushButton('Remove') + self.removebtn = QtWidgets.QPushButton('Remove') self.removebtn.setHidden(True) self.removebtn.clicked.connect(self.removeparameter) - self.addbtn = QtGui.QPushButton('Add') + self.addbtn = QtWidgets.QPushButton('Add') self.addbtn.setHidden(True) self.addbtn.clicked.connect(self.addparameters) - self.uploadbtn = QtGui.QPushButton('Upload') + self.uploadbtn = QtWidgets.QPushButton('Upload') self.uploadbtn.setToolTip( 'Uploading external .lib file to eSim') self.uploadbtn.clicked.connect(self.converttoxml) @@ -73,18 +73,18 @@ def __init__(self): self.grid.addWidget(self.removebtn, 8, 4) self.grid.addWidget(self.addbtn, 5, 4) - self.radiobtnbox = QtGui.QButtonGroup() - self.diode = QtGui.QRadioButton('Diode') + self.radiobtnbox = QtWidgets.QButtonGroup() + self.diode = QtWidgets.QRadioButton('Diode') self.diode.setDisabled(True) - self.bjt = QtGui.QRadioButton('BJT') + self.bjt = QtWidgets.QRadioButton('BJT') self.bjt.setDisabled(True) - self.mos = QtGui.QRadioButton('MOS') + self.mos = QtWidgets.QRadioButton('MOS') self.mos.setDisabled(True) - self.jfet = QtGui.QRadioButton('JFET') + self.jfet = QtWidgets.QRadioButton('JFET') self.jfet.setDisabled(True) - self.igbt = QtGui.QRadioButton('IGBT') + self.igbt = QtWidgets.QRadioButton('IGBT') self.igbt.setDisabled(True) - self.magnetic = QtGui.QRadioButton('Magnetic Core') + self.magnetic = QtWidgets.QRadioButton('Magnetic Core') self.magnetic.setDisabled(True) self.radiobtnbox.addButton(self.diode) @@ -101,7 +101,7 @@ def __init__(self): self.magnetic.clicked.connect(self.magnetic_click) # Dropdown for various types supported by that element, ex bjt -> npn - self.types = QtGui.QComboBox() + self.types = QtWidgets.QComboBox() self.types.setHidden(True) self.grid.addWidget(self.types, 2, 2, 2, 3) @@ -128,7 +128,7 @@ def opennew(self): pass # Opens new dialog box - text, ok = QtGui.QInputDialog.getText( + text, ok = QtWidgets.QInputDialog.getText( self, 'New Model', 'Enter Model Name:') if ok: self.newflag = 1 @@ -327,12 +327,11 @@ def openedit(self): self.bjt.setDisabled(True) self.magnetic.setDisabled(True) try: - self.editfile = str( - QtGui.QFileDialog.getOpenFileName( - self, - "Open Library Directory", - self.init_path + "library/deviceModelLibrary", - "*.lib")) + self.editfile = QtWidgets.QFileDialog.getOpenFileName( + self, "Open Library Directory", + self.init_path + "library/deviceModelLibrary", "*.lib" + )[0] + self.createtable(self.editfile) except BaseException: print("No File selected for edit") @@ -355,7 +354,7 @@ def createtable(self, modelfile): self.removebtn.setHidden(False) self.modelfile = modelfile self.modeldict = {} - self.modeltable = QtGui.QTableWidget() + self.modeltable = QtWidgets.QTableWidget() self.modeltable.resizeColumnsToContents() self.modeltable.setColumnCount(2) self.modeltable.resizeRowsToContents() @@ -422,18 +421,18 @@ def addparameters(self): - Accordingly add parameter and value in modeldict as well as table - text1 => parameter, text2 => value ''' - text1, ok = QtGui.QInputDialog.getText( + text1, ok = QtWidgets.QInputDialog.getText( self, 'Parameter', 'Enter Parameter') if ok: if text1 in list(self.modeldict.keys()): - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( "The paramaeter " + text1 + " is already in the list") self.msg.exec_() return - text2, ok = QtGui.QInputDialog.getText( + text2, ok = QtWidgets.QInputDialog.getText( self, 'Value', 'Enter Value') if ok: currentRowCount = self.modeltable.rowCount() @@ -606,8 +605,8 @@ def createXML(self, model_name): txtfile.close() msg = "Model saved successfully!" - QtGui.QMessageBox.information( - self, "Information", msg, QtGui.QMessageBox.Ok + QtWidgets.QMessageBox.information( + self, "Information", msg, QtWidgets.QMessageBox.Ok ) os.chdir(defaultcwd) @@ -624,7 +623,7 @@ def validation(self, text): for each_dir in all_dir: all_files = os.listdir(each_dir) if newfilename in all_files: - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -665,8 +664,8 @@ def savethefile(self, editfile): self.obj_appconfig.print_info('Updated library ' + libpath) msg = "Model saved successfully!" - QtGui.QMessageBox.information( - self, "Information", msg, QtGui.QMessageBox.Ok + QtWidgets.QMessageBox.information( + self, "Information", msg, QtWidgets.QMessageBox.Ok ) def removeparameter(self): @@ -696,12 +695,12 @@ def converttoxml(self): self.modeltable.setHidden(True) model_dict = {} stringof = [] - self.libfile = str( - QtGui.QFileDialog.getOpenFileName( - self, - "Open Library Directory", - self.init_path + "library/deviceModelLibrary", - "*.lib")) + + self.libfile = QtWidgets.QFileDialog.getOpenFileName( + self, "Open Library Directory", + self.init_path + "library/deviceModelLibrary", "*.lib" + )[0] + libopen = open(self.libfile) filedata = libopen.read().split() modelcount = 0 @@ -796,7 +795,7 @@ def converttoxml(self): defaultcwd = os.getcwd() savepath = os.path.join(self.savepathtest, 'User Libraries') os.chdir(savepath) - text, ok1 = QtGui.QInputDialog.getText( + text, ok1 = QtWidgets.QInputDialog.getText( self, 'Model Name', 'Enter Model Library Name') if ok1: tree.write(text + ".xml") diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 136510e1c..329918847 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,41 +1,45 @@ -from PyQt4 import QtGui, QtCore +from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from configparser import SafeConfigParser -import platform import os -# This Class creates NgSpice Window - -class NgspiceWidget(QtGui.QWidget): +# This Class creates NgSpice Window +class NgspiceWidget(QtWidgets.QWidget): def __init__(self, command, projPath): """ - Creates constructor for NgspiceWidget class. - - Checks whether OS is linux or windows - and creates NgSpice window accordingly. + - Checks whether OS is Linux or Windows and + creates Ngspice window accordingly. """ - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) - self.terminal = QtGui.QWidget(self) - self.layout = QtGui.QVBoxLayout(self) + self.terminal = QtWidgets.QWidget(self) + self.layout = QtWidgets.QVBoxLayout(self) self.layout.addWidget(self.terminal) - if os.name == 'nt': + print("Argument to ngspice command : ", command) + + if os.name == 'nt': # For Windows OS home = os.path.expanduser("~") parser_nghdl = SafeConfigParser() parser_nghdl.read(os.path.join( home, os.path.join('.nghdl', 'config.ini'))) - try: - msys_bin = parser_nghdl.get('COMPILER', 'MSYS_HOME') - except BaseException: - pass - print("Argument to ngspice command : ", command) - # For Linux OS - if platform.system() == 'Linux': + msys_bin = parser_nghdl.get('COMPILER', 'MSYS_HOME') + + tempdir = os.getcwd() + projPath = self.obj_appconfig.current_project["ProjectName"] + os.chdir(projPath) + self.command = 'cmd /c '+'"start /min ' + \ + msys_bin + "/mintty.exe ngspice " + command + '"' + self.process.start(self.command) + os.chdir(tempdir) + + else: # For Linux OS self.command = "cd " + projPath + ";ngspice " + command # Creating argument for process self.args = ['-hold', '-e', self.command] @@ -47,13 +51,3 @@ def __init__(self, command, projPath): [self.obj_appconfig.current_project['ProjectName']].append( self.process.pid()) ) - - # For Windows OS - elif platform.system() == 'Windows': - tempdir = os.getcwd() - projPath = self.obj_appconfig.current_project["ProjectName"] - os.chdir(projPath) - self.command = 'cmd /c '+'"start /min ' + \ - msys_bin + "/mintty.exe ngspice " + command + '"' - self.process.start(self.command) - os.chdir(tempdir) diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py index 032b1eebd..8df5c5087 100644 --- a/src/ngspiceSimulation/pythonPlotting.py +++ b/src/ngspiceSimulation/pythonPlotting.py @@ -1,7 +1,7 @@ from __future__ import division # Used for decimal division # eg: 2/3=0.66 and not '0' 6/2=3.0 and 6//2=3 import os -from PyQt4 import QtGui, QtCore +from PyQt5 import QtGui, QtCore, QtWidgets from decimal import Decimal, getcontext from matplotlib.backends.backend_qt4agg\ import FigureCanvasQTAgg as FigureCanvas @@ -13,7 +13,7 @@ # This class creates Python Plotting window -class plotWindow(QtGui.QMainWindow): +class plotWindow(QtWidgets.QMainWindow): """ This class defines python plotting window, its features, buttons, colors, AC and DC analysis, plotting etc. @@ -21,7 +21,7 @@ class plotWindow(QtGui.QMainWindow): def __init__(self, fpath, projectName): """This create constructor for plotWindow class.""" - QtGui.QMainWindow.__init__(self) + QtWidgets.QMainWindow.__init__(self) self.fpath = fpath self.projectName = projectName self.obj_appconfig = Appconfig() @@ -38,7 +38,7 @@ def __init__(self, fpath, projectName): self.createMainFrame() def createMainFrame(self): - self.mainFrame = QtGui.QWidget() + self.mainFrame = QtWidgets.QWidget() self.dpi = 100 self.fig = Figure((7.0, 7.0), dpi=self.dpi) # Creating Canvas which will figure @@ -48,15 +48,15 @@ def createMainFrame(self): self.navToolBar = NavigationToolbar(self.canvas, self.mainFrame) # LeftVbox hold navigation tool bar and canvas - self.left_vbox = QtGui.QVBoxLayout() + self.left_vbox = QtWidgets.QVBoxLayout() self.left_vbox.addWidget(self.navToolBar) self.left_vbox.addWidget(self.canvas) # right VBOX is main Layout which hold right grid(bottom part) and top # grid(top part) - self.right_vbox = QtGui.QVBoxLayout() - self.right_grid = QtGui.QGridLayout() - self.top_grid = QtGui.QGridLayout() + self.right_vbox = QtWidgets.QVBoxLayout() + self.right_grid = QtWidgets.QGridLayout() + self.top_grid = QtWidgets.QGridLayout() # Get DataExtraction Details self.obj_dataext = DataExtraction() @@ -91,18 +91,18 @@ def createMainFrame(self): # Total number of voltage source self.volts_length = self.a[1] - self.analysisType = QtGui.QLabel() + self.analysisType = QtWidgets.QLabel() self.top_grid.addWidget(self.analysisType, 0, 0) - self.listNode = QtGui.QLabel() + self.listNode = QtWidgets.QLabel() self.top_grid.addWidget(self.listNode, 1, 0) - self.listBranch = QtGui.QLabel() + self.listBranch = QtWidgets.QLabel() self.top_grid.addWidget(self.listBranch, self.a[1] + 2, 0) for i in range(0, self.a[1]): # a[0]-1 - self.chkbox.append(QtGui.QCheckBox(self.obj_dataext.NBList[i])) + self.chkbox.append(QtWidgets.QCheckBox(self.obj_dataext.NBList[i])) self.chkbox[i].setStyleSheet('color') self.chkbox[i].setToolTip('Check To Plot') self.top_grid.addWidget(self.chkbox[i], i + 2, 0) - self.colorLab = QtGui.QLabel() + self.colorLab = QtWidgets.QLabel() self.colorLab.setText('____') self.colorLab.setStyleSheet( self.colorName( @@ -111,10 +111,10 @@ def createMainFrame(self): self.top_grid.addWidget(self.colorLab, i + 2, 1) for i in range(self.a[1], self.a[0] - 1): # a[0]-1 - self.chkbox.append(QtGui.QCheckBox(self.obj_dataext.NBList[i])) + self.chkbox.append(QtWidgets.QCheckBox(self.obj_dataext.NBList[i])) self.chkbox[i].setToolTip('Check To Plot') self.top_grid.addWidget(self.chkbox[i], i + 3, 0) - self.colorLab = QtGui.QLabel() + self.colorLab = QtWidgets.QLabel() self.colorLab.setText('____') self.colorLab.setStyleSheet( self.colorName( @@ -123,21 +123,21 @@ def createMainFrame(self): self.top_grid.addWidget(self.colorLab, i + 3, 1) # Buttons for Plot, multimeter, plotting function. - self.clear = QtGui.QPushButton("Clear") - self.warnning = QtGui.QLabel() - self.funcName = QtGui.QLabel() - self.funcExample = QtGui.QLabel() + self.clear = QtWidgets.QPushButton("Clear") + self.warnning = QtWidgets.QLabel() + self.funcName = QtWidgets.QLabel() + self.funcExample = QtWidgets.QLabel() - self.plotbtn = QtGui.QPushButton("Plot") + self.plotbtn = QtWidgets.QPushButton("Plot") self.plotbtn.setToolTip('Press to Plot') - self.multimeterbtn = QtGui.QPushButton("Multimeter") + self.multimeterbtn = QtWidgets.QPushButton("Multimeter") self.multimeterbtn.setToolTip( 'RMS value of the current and voltage is displayed') - self.text = QtGui.QLineEdit() - self.funcLabel = QtGui.QLabel() + self.text = QtWidgets.QLineEdit() + self.funcLabel = QtWidgets.QLabel() self.palette1 = QtGui.QPalette() self.palette2 = QtGui.QPalette() - self.plotfuncbtn = QtGui.QPushButton("Plot Function") + self.plotfuncbtn = QtWidgets.QPushButton("Plot Function") self.plotfuncbtn.setToolTip('Press to Plot the function') self.palette1.setColor(QtGui.QPalette.Foreground, QtCore.Qt.blue) @@ -158,20 +158,20 @@ def createMainFrame(self): self.right_grid.addWidget(self.funcExample, 4, 1) self.right_vbox.addLayout(self.right_grid) - self.hbox = QtGui.QHBoxLayout() + self.hbox = QtWidgets.QHBoxLayout() self.hbox.addLayout(self.left_vbox) self.hbox.addLayout(self.right_vbox) - self.widget = QtGui.QWidget() + self.widget = QtWidgets.QWidget() self.widget.setLayout(self.hbox) # finalvbox - self.scrollArea = QtGui.QScrollArea() + self.scrollArea = QtWidgets.QScrollArea() self.scrollArea.setWidgetResizable(True) self.scrollArea.setWidget(self.widget) ''' Right side box containing checkbox for different inputs and options of plot, multimeter and plot function. ''' - self.finalhbox = QtGui.QHBoxLayout() + self.finalhbox = QtWidgets.QHBoxLayout() self.finalhbox.addWidget(self.scrollArea) # Right side window frame showing list of nodes and branches. self.mainFrame.setLayout(self.finalhbox) @@ -191,43 +191,25 @@ def createMainFrame(self): \nNode1 vs Node2") # Connecting to plot and clear function - self.connect(self.clear, QtCore.SIGNAL('clicked()'), self.pushedClear) - self.connect( - self.plotfuncbtn, - QtCore.SIGNAL('clicked()'), - self.pushedPlotFunc) - self.connect( - self.multimeterbtn, - QtCore.SIGNAL('clicked()'), - self.multiMeter) + self.clear.clicked.connect(self.pushedClear) + self.plotfuncbtn.clicked.connect(self.pushedPlotFunc) + self.multimeterbtn.clicked.connect(self.multiMeter) + # for AC analysis if self.plotType[0] == 0: self.analysisType.setText("AC Analysis") if self.plotType[1] == 1: - self.connect( - self.plotbtn, - QtCore.SIGNAL('clicked()'), - self.onPush_decade) + self.plotbtn.clicked.connect(self.onPush_decade) else: - self.connect( - self.plotbtn, - QtCore.SIGNAL('clicked()'), - self.onPush_ac) + self.plotbtn.clicked.connect(self.onPush_ac) # for transient analysis elif self.plotType[0] == 1: self.analysisType.setText("Transient Analysis") - self.connect( - self.plotbtn, - QtCore.SIGNAL('clicked()'), - self.onPush_trans) - + self.plotbtn.clicked.connect(self.onPush_trans) else: # For DC analysis self.analysisType.setText("DC Analysis") - self.connect( - self.plotbtn, - QtCore.SIGNAL('clicked()'), - self.onPush_dc) + self.plotbtn.clicked.connect(self.onPush_dc) self.setCentralWidget(self.mainFrame) @@ -236,7 +218,6 @@ def pushedClear(self): self.text.clear() self.axes.cla() self.canvas.draw() - QtCore.SLOT('quit()') def pushedPlotFunc(self): self.parts = str(self.text.text()) @@ -253,7 +234,7 @@ def pushedPlotFunc(self): if len(self.parts) <= 2: self.warnning.setText("Too few arguments!\nRefer syntax below!") - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Too Few Arguments/SYNTAX Error!\ \n Refer Examples") else: @@ -270,7 +251,7 @@ def pushedPlotFunc(self): a.append(j) if len(a) != len(self.parts) // 2 + 1: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "One of the operands doesn't belong to " @@ -282,7 +263,7 @@ def pushedPlotFunc(self): for i in range(len(a)): if a[i] == len(self.obj_dataext.NBList): - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "One of the operands doesn't belong " + "to the above list!!" ) @@ -294,7 +275,7 @@ def pushedPlotFunc(self): if self.parts[1] == 'vs': if len(self.parts) > 3: self.warnning.setText("Enter two operands only!!") - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Recheck the expression syntax!") else: @@ -318,7 +299,7 @@ def pushedPlotFunc(self): self.axes.set_ylabel('Current(I)-->') elif max(a) >= self.volts_length and min(a) < self.volts_length: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Do not combine Voltage and Current!!") else: @@ -330,7 +311,7 @@ def pushedPlotFunc(self): try: finalResult.append(eval(re)) except ArithmeticError: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Dividing by zero!!") if self.plotType2[0] == 0: @@ -410,7 +391,7 @@ def onPush_decade(self): self.axes.grid(True) if boxCheck == 0: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Please select at least one Node OR Branch") self.canvas.draw() @@ -433,7 +414,7 @@ def onPush_ac(self): self.axes.set_ylabel('Current(I)-->') self.axes.grid(True) if boxCheck == 0: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Please select at least one Node OR Branch") self.canvas.draw() @@ -456,7 +437,7 @@ def onPush_trans(self): self.axes.set_ylabel('Current(I)-->') self.axes.grid(True) if boxCheck == 0: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Please select at least one Node OR Branch") self.canvas.draw() @@ -480,7 +461,7 @@ def onPush_dc(self): self.axes.set_ylabel('Current(I)-->') self.axes.grid(True) if boxCheck == 0: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Please select atleast one Node OR Branch") self.canvas.draw() @@ -525,7 +506,7 @@ def multiMeter(self): ) if boxCheck == 0: - QtGui.QMessageBox.about( + QtWidgets.QMessageBox.about( self, "Warning!!", "Please select at least one Node OR Branch") def getRMSValue(self, dataPoints): @@ -533,22 +514,22 @@ def getRMSValue(self, dataPoints): return np.sqrt(np.mean(np.square(dataPoints))) -class MultimeterWidgetClass(QtGui.QWidget): +class MultimeterWidgetClass(QtWidgets.QWidget): def __init__(self, node_branch, rmsValue, loc_x, loc_y, voltFlag): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) - self.multimeter = QtGui.QWidget(self) + self.multimeter = QtWidgets.QWidget(self) if voltFlag: - self.node_branchLabel = QtGui.QLabel("Node") - self.rmsValue = QtGui.QLabel(str(rmsValue) + " Volts") + self.node_branchLabel = QtWidgets.QLabel("Node") + self.rmsValue = QtWidgets.QLabel(str(rmsValue) + " Volts") else: - self.node_branchLabel = QtGui.QLabel("Branch") - self.rmsValue = QtGui.QLabel(str(rmsValue) + " Amp") + self.node_branchLabel = QtWidgets.QLabel("Branch") + self.rmsValue = QtWidgets.QLabel(str(rmsValue) + " Amp") - self.rmsLabel = QtGui.QLabel("RMS Value") - self.nodeBranchValue = QtGui.QLabel(str(node_branch)) + self.rmsLabel = QtWidgets.QLabel("RMS Value") + self.nodeBranchValue = QtWidgets.QLabel(str(node_branch)) - self.layout = QtGui.QGridLayout(self) + self.layout = QtWidgets.QGridLayout(self) self.layout.addWidget(self.node_branchLabel, 0, 0) self.layout.addWidget(self.rmsLabel, 0, 1) self.layout.addWidget(self.nodeBranchValue, 1, 0) @@ -667,7 +648,7 @@ def openFile(self, fpath): except Exception as e: print("Exception Message : ", str(e)) self.obj_appconfig.print_error('Exception Message :' + str(e)) - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('Unable to open plot data files.') @@ -682,7 +663,7 @@ def openFile(self, fpath): except Exception as e: print("Exception Message : ", str(e)) self.obj_appconfig.print_error('Exception Message :' + str(e)) - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('Unable to read Analysis File.') diff --git a/src/ngspicetoModelica/ModelicaUI.py b/src/ngspicetoModelica/ModelicaUI.py index 428bcab68..8e2479c9f 100644 --- a/src/ngspicetoModelica/ModelicaUI.py +++ b/src/ngspicetoModelica/ModelicaUI.py @@ -1,7 +1,7 @@ import os import glob import traceback -from PyQt4 import QtGui, QtCore +from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig from projManagement import Worker from projManagement.Validation import Validation @@ -10,10 +10,10 @@ BROWSE_LOCATION = '/home' -class OpenModelicaEditor(QtGui.QWidget): +class OpenModelicaEditor(QtWidgets.QWidget): def __init__(self, dir=None): - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.obj_validation = Validation() self.obj_appconfig = Appconfig() self.projDir = dir @@ -23,20 +23,20 @@ def __init__(self, dir=None): self.modelicaNetlist = os.path.join(self.projDir, "*.mo") self.map_json = Appconfig.modelica_map_json - self.grid = QtGui.QGridLayout() - self.FileEdit = QtGui.QLineEdit() + self.grid = QtWidgets.QGridLayout() + self.FileEdit = QtWidgets.QLineEdit() self.FileEdit.setText(self.ngspiceNetlist) self.grid.addWidget(self.FileEdit, 0, 0) - self.browsebtn = QtGui.QPushButton("Browse") + self.browsebtn = QtWidgets.QPushButton("Browse") self.browsebtn.clicked.connect(self.browseFile) self.grid.addWidget(self.browsebtn, 0, 1) - self.convertbtn = QtGui.QPushButton("Convert") + self.convertbtn = QtWidgets.QPushButton("Convert") self.convertbtn.clicked.connect(self.callConverter) self.grid.addWidget(self.convertbtn, 2, 1) - self.loadOMbtn = QtGui.QPushButton("Load OMEdit") + self.loadOMbtn = QtWidgets.QPushButton("Load OMEdit") self.loadOMbtn.clicked.connect(self.callOMEdit) self.grid.addWidget(self.loadOMbtn, 3, 1) @@ -45,8 +45,8 @@ def __init__(self, dir=None): self.show() def browseFile(self): - self.ngspiceNetlist = QtGui.QFileDialog.getOpenFileName( - self, 'Open Ngspice Netlist', BROWSE_LOCATION) + self.ngspiceNetlist = QtWidgets.QFileDialog.getOpenFileName( + self, 'Open Ngspice Netlist', BROWSE_LOCATION)[0] self.FileEdit.setText(self.ngspiceNetlist) def callConverter(self): @@ -186,7 +186,7 @@ def callConverter(self): os.chdir(cwd) - self.msg = QtGui.QMessageBox() + self.msg = QtWidgets.QMessageBox() self.msg.setText( "Ngspice netlist successfully converted to OpenModelica " + "netlist" @@ -200,7 +200,7 @@ def callConverter(self): except BaseException as e: traceback.print_exc() print("================") - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Conversion Error") self.msg.showMessage( @@ -220,7 +220,7 @@ def callOMEdit(self): self.obj_appconfig.print_info("OMEdit called") else: - self.msg = QtGui.QMessageBox() + self.msg = QtWidgets.QMessageBox() self.msgContent = ( "There was an error while opening OMEdit.
" "Please make sure OpenModelica is installed in your" diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index b2fcb87a9..8f25b7328 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -11,16 +11,16 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 17 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= import os from . import Validation from configuration.Appconfig import Appconfig from . import Worker -from PyQt4 import QtGui +from PyQt5 import QtWidgets class Kicad: @@ -91,7 +91,7 @@ def openSchematic(self): self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -129,7 +129,7 @@ def openFootprint(self): self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('Please select the project first. You can' @@ -162,7 +162,7 @@ def openLayout(self): self.obj_workThread.start() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('Please select the project first. You can' @@ -209,7 +209,7 @@ def openKicadToNgspice(self): self.obj_dockarea.kicadToNgspiceEditor(var) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -221,7 +221,7 @@ def openKicadToNgspice(self): self.msg.exec_() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 8ce605f08..78e02bbfe 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -11,12 +11,12 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= -from PyQt4 import QtCore +from PyQt5 import QtCore import subprocess from configuration.Appconfig import Appconfig diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py index 8382883d1..ad29dc764 100644 --- a/src/projManagement/newProject.py +++ b/src/projManagement/newProject.py @@ -11,19 +11,19 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 12 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= -from PyQt4 import QtGui +from PyQt5 import QtWidgets from .Validation import Validation from configuration.Appconfig import Appconfig import os import json -class NewProjectInfo(QtGui.QWidget): +class NewProjectInfo(QtWidgets.QWidget): """ This class is called when User create new Project. """ @@ -85,7 +85,7 @@ def createProject(self, projName): f = open(self.projFile, "w") except BaseException: - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -115,7 +115,7 @@ def createProject(self, projName): return self.projDir, newprojlist elif self.reply == "CHECKEXIST": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -126,7 +126,7 @@ def createProject(self, projName): self.msg.exec_() elif self.reply == "CHECKNAME": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -134,7 +134,7 @@ def createProject(self, projName): self.msg.exec_() elif self.reply == "NONE": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('The project name cannot be empty') diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py index 507105ab6..04944d293 100644 --- a/src/projManagement/openProject.py +++ b/src/projManagement/openProject.py @@ -11,19 +11,19 @@ # NOTES: --- # AUTHOR: Fahim Khan, fahim.elex@gmail.com # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in -# ORGANIZATION: eSim team at FOSSEE, IIT Bombay. +# ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Wednesday 12 February 2015 -# REVISION: Friday 14 February 2020 +# REVISION: Sunday 26 July 2020 # ========================================================================= -from PyQt4 import QtGui +from PyQt5 import QtWidgets from .Validation import Validation from configuration.Appconfig import Appconfig import os import json -class OpenProjectInfo(QtGui.QWidget): +class OpenProjectInfo(QtWidgets.QWidget): """ This class is called when User click on Open Project Button """ @@ -45,7 +45,7 @@ def body(self): """ self.obj_Appconfig = Appconfig() self.openDir = self.obj_Appconfig.default_workspace["workspace"] - self.projDir = QtGui.QFileDialog.getExistingDirectory( + self.projDir = QtWidgets.QFileDialog.getExistingDirectory( self, "open", self.openDir) if self.obj_validation.validateOpenproj(self.projDir): @@ -74,18 +74,18 @@ def body(self): "proper directory else you won't be able to perform any " + "operation" ) - reply = QtGui.QMessageBox.critical( + reply = QtWidgets.QMessageBox.critical( None, "Error Message", "Error: The project doesn't contain .proj file.
" "Please select the proper project directory else you won't" " be able to perform any operation", - QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel + QtWidgets.QMessageBox.Ok | QtWidgets.QMessageBox.Cancel ) - if reply == QtGui.QMessageBox.Ok: + if reply == QtWidgets.QMessageBox.Ok: self.body() self.obj_Appconfig.print_info('Open Project called') self.obj_Appconfig.print_info( 'Current Project is ' + self.projDir) - elif reply == QtGui.QMessageBox.Cancel: + elif reply == QtWidgets.QMessageBox.Cancel: self.obj_Appconfig.print_info('No Project opened') diff --git a/src/subcircuit/Subcircuit.py b/src/subcircuit/Subcircuit.py index 8f55ea137..298ff96ed 100644 --- a/src/subcircuit/Subcircuit.py +++ b/src/subcircuit/Subcircuit.py @@ -1,4 +1,4 @@ -from PyQt4 import QtCore, QtGui +from PyQt5 import QtCore, QtWidgets from configuration.Appconfig import Appconfig from projManagement.Validation import Validation from subcircuit.newSub import NewSub @@ -8,7 +8,7 @@ # This class creates Subcircuit GUI. -class Subcircuit(QtGui.QWidget): +class Subcircuit(QtWidgets.QWidget): """ Creates buttons for New project, Edit existing project and Kicad Netlist to Ngspice Netlist converter and link them with the @@ -21,41 +21,41 @@ class Subcircuit(QtGui.QWidget): def __init__(self, parent=None): super(Subcircuit, self).__init__() - QtGui.QWidget.__init__(self) + QtWidgets.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.obj_validation = Validation() self.obj_dockarea = parent - self.layout = QtGui.QVBoxLayout() - self.splitter = QtGui.QSplitter() + self.layout = QtWidgets.QVBoxLayout() + self.splitter = QtWidgets.QSplitter() self.splitter.setOrientation(QtCore.Qt.Vertical) - self.newbtn = QtGui.QPushButton('New Subcircuit Schematic') + self.newbtn = QtWidgets.QPushButton('New Subcircuit Schematic') self.newbtn.setToolTip('To create new Subcircuit Schematic') self.newbtn.setFixedSize(200, 40) self.newbtn.clicked.connect(self.newsch) - self.editbtn = QtGui.QPushButton('Edit Subcircuit Schematic') + self.editbtn = QtWidgets.QPushButton('Edit Subcircuit Schematic') self.editbtn.setToolTip('To edit existing Subcircuit Schematic') self.editbtn.setFixedSize(200, 40) self.editbtn.clicked.connect(self.editsch) - self.convertbtn = QtGui.QPushButton('Convert Kicad to Ngspice') + self.convertbtn = QtWidgets.QPushButton('Convert Kicad to Ngspice') self.convertbtn.setToolTip( 'To convert Subcircuit Kicad Netlist to Ngspice Netlist') self.convertbtn.setFixedSize(200, 40) self.convertbtn.clicked.connect(self.convertsch) - self.uploadbtn = QtGui.QPushButton('Upload a Subcircuit') + self.uploadbtn = QtWidgets.QPushButton('Upload a Subcircuit') self.uploadbtn.setToolTip( 'To Upload a subcircuit') self.uploadbtn.setFixedSize(180, 38) self.uploadbtn.clicked.connect(self.uploadSub) - self.hbox = QtGui.QHBoxLayout() + self.hbox = QtWidgets.QHBoxLayout() self.hbox.addWidget(self.newbtn) self.hbox.addWidget(self.editbtn) self.hbox.addWidget(self.convertbtn) self.hbox.addWidget(self.uploadbtn) self.hbox.addStretch(1) - self.vbox = QtGui.QVBoxLayout() + self.vbox = QtWidgets.QVBoxLayout() self.vbox.addLayout(self.hbox) self.vbox.addStretch(1) @@ -63,7 +63,7 @@ def __init__(self, parent=None): self.show() def newsch(self): - text, ok = QtGui.QInputDialog.getText( + text, ok = QtWidgets.QInputDialog.getText( self, 'New Schematic', 'Enter Schematic Name:') if ok: self.schematic_name = (str(text)) diff --git a/src/subcircuit/convertSub.py b/src/subcircuit/convertSub.py index efad86031..36d07c14e 100644 --- a/src/subcircuit/convertSub.py +++ b/src/subcircuit/convertSub.py @@ -1,11 +1,11 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from projManagement.Validation import Validation from configuration.Appconfig import Appconfig import os # This class is called when user creates new Project -class convertSub(QtGui.QWidget): +class convertSub(QtWidgets.QWidget): """ Contains functions that checks project present for conversion and also function to convert Kicad Netlist to Ngspice Netlist. @@ -40,7 +40,7 @@ def createSub(self): var2 = "sub" self.obj_dockarea.kicadToNgspiceEditor(var1, var2) else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -49,7 +49,7 @@ def createSub(self): ) self.msg.exec_() else: - self.msg = QtGui.QErrorMessage() + self.msg = QtWidgets.QErrorMessage() self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py index 9c9ebbd85..92dc1d291 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -1,4 +1,4 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from projManagement.Validation import Validation from configuration.Appconfig import Appconfig from projManagement import Worker @@ -6,7 +6,7 @@ # This class is called when User creates new Project. -class NewSub(QtGui.QWidget): +class NewSub(QtWidgets.QWidget): """ Contains functions to check : - Name of project should not be blank. @@ -59,7 +59,7 @@ def createSubcircuit(self, subName): self.obj_workThread.start() self.close() except BaseException: - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -72,7 +72,7 @@ def createSubcircuit(self, subName): = self.schematic_path elif self.reply == "CHECKEXIST": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -83,7 +83,7 @@ def createSubcircuit(self, subName): self.msg.exec_() elif self.reply == "CHECKNAME": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -92,7 +92,7 @@ def createSubcircuit(self, subName): self.msg.exec_() elif self.reply == "NONE": - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage('The subcircuit name cannot be empty') diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py index 0e0906c08..635976611 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -1,11 +1,11 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from configuration.Appconfig import Appconfig from projManagement.Worker import WorkerThread import os # This class is called when User clicks on Edit Subcircuit Button. -class openSub(QtGui.QWidget): +class openSub(QtWidgets.QWidget): """ It opens the existing subcircuit projects that are present in Subcircuit directory. @@ -21,9 +21,8 @@ def body(self): if os.name == 'nt': init_path = '' - self.editfile = str( - QtGui.QFileDialog.getExistingDirectory( - None, "Open File", init_path + "library/SubcircuitLibrary")) + self.editfile = QtWidgets.QFileDialog.getExistingDirectory( + None, "Open File", init_path + "library/SubcircuitLibrary") if self.editfile: self.obj_Appconfig = Appconfig() self.obj_Appconfig.current_subcircuit['SubcircuitName'] \ diff --git a/src/subcircuit/uploadSub.py b/src/subcircuit/uploadSub.py index c7b3951f5..13924bf30 100644 --- a/src/subcircuit/uploadSub.py +++ b/src/subcircuit/uploadSub.py @@ -1,11 +1,11 @@ -from PyQt4 import QtGui +from PyQt5 import QtWidgets from configuration.Appconfig import Appconfig from projManagement.Validation import Validation import os import shutil -class UploadSub(QtGui.QWidget): +class UploadSub(QtWidgets.QWidget): """ This class contain function for uploading subcircuits in SubcircuitLibrary present in src folder. @@ -30,8 +30,9 @@ def upload(self): true if file has valid format or else it shows an error message. """ - editfile = QtGui.QFileDialog.getOpenFileName( - None, "Upload Subcircuit File", os.path.expanduser("~"), "*.sub") + editfile = QtWidgets.QFileDialog.getOpenFileName( + None, "Upload Subcircuit File", os.path.expanduser("~"), "*.sub" + )[0] if editfile == '': return @@ -40,7 +41,7 @@ def upload(self): create_subcircuit, ext = os.path.splitext(upload) if ext != '.sub': - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage("Please ensure that filename ends with .sub") @@ -50,7 +51,7 @@ def upload(self): valid = self.obj_validation.validateSubcir(editfile, create_subcircuit) if not valid: - self.msg = QtGui.QErrorMessage(self) + self.msg = QtWidgets.QErrorMessage(self) self.msg.setModal(True) self.msg.setWindowTitle("Error Message") self.msg.showMessage( @@ -89,7 +90,7 @@ def upload(self): elif reply == "CHECKEXIST": print("Project name already exists.") print("==========================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage( @@ -100,7 +101,7 @@ def upload(self): elif reply == "CHECKNAME": print("Name can not contain space between them") print("===========================") - msg = QtGui.QErrorMessage(self) + msg = QtWidgets.QErrorMessage(self) msg.setModal(True) msg.setWindowTitle("Error Message") msg.showMessage( From 816e3663300c26bc0591070496b154ff96393860 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:46:10 +0530 Subject: [PATCH 09/15] renamed custom_mixed_mode example to custom_mixed_signal --- .../{custom_mixed_mode => custom_mixed_signal}/NPN.lib | 0 .../{custom_mixed_mode => custom_mixed_signal}/NPN.txt | 0 .../{custom_mixed_mode => custom_mixed_signal}/PNP.lib | 0 .../{custom_mixed_mode => custom_mixed_signal}/PNP.txt | 0 .../{custom_mixed_mode => custom_mixed_signal}/analysis | 0 .../custom_mixed_signal-cache.lib} | 0 .../custom_mixed_signal-cache.txt} | 0 .../custom_mixed_signal.cir} | 0 .../custom_mixed_signal.cir.out} | 0 .../custom_mixed_signal.pro} | 0 .../custom_mixed_signal.proj} | 0 .../custom_mixed_signal.sch} | 0 .../custom_mixed_signal_Previous_Values.xml} | 0 .../{custom_mixed_mode => custom_mixed_signal}/customblock.vhdl | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741-cache.lib | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741-cache.txt | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741-rescue.lib | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741-rescue.txt | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741.cir | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741.cir.out | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741.pro | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741.sch | 0 .../{custom_mixed_mode => custom_mixed_signal}/lm_741.sub | 0 .../lm_741_Previous_Values.xml | 0 .../{custom_mixed_mode => custom_mixed_signal}/npn_1.lib | 0 .../{custom_mixed_mode => custom_mixed_signal}/npn_1.txt | 0 .../{custom_mixed_mode => custom_mixed_signal}/pnp_1.lib | 0 .../{custom_mixed_mode => custom_mixed_signal}/pnp_1.txt | 0 28 files changed, 0 insertions(+), 0 deletions(-) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/NPN.lib (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/NPN.txt (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/PNP.lib (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/PNP.txt (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/analysis (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode-cache.lib => custom_mixed_signal/custom_mixed_signal-cache.lib} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode-cache.txt => custom_mixed_signal/custom_mixed_signal-cache.txt} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode.cir => custom_mixed_signal/custom_mixed_signal.cir} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode.cir.out => custom_mixed_signal/custom_mixed_signal.cir.out} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode.pro => custom_mixed_signal/custom_mixed_signal.pro} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode.proj => custom_mixed_signal/custom_mixed_signal.proj} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode.sch => custom_mixed_signal/custom_mixed_signal.sch} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode/custom_mixed_mode_Previous_Values.xml => custom_mixed_signal/custom_mixed_signal_Previous_Values.xml} (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/customblock.vhdl (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741-cache.lib (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741-cache.txt (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741-rescue.lib (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741-rescue.txt (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741.cir (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741.cir.out (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741.pro (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741.sch (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741.sub (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/lm_741_Previous_Values.xml (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/npn_1.lib (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/npn_1.txt (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/pnp_1.lib (100%) rename Examples/Mixed_Signal/{custom_mixed_mode => custom_mixed_signal}/pnp_1.txt (100%) diff --git a/Examples/Mixed_Signal/custom_mixed_mode/NPN.lib b/Examples/Mixed_Signal/custom_mixed_signal/NPN.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/NPN.lib rename to Examples/Mixed_Signal/custom_mixed_signal/NPN.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/NPN.txt b/Examples/Mixed_Signal/custom_mixed_signal/NPN.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/NPN.txt rename to Examples/Mixed_Signal/custom_mixed_signal/NPN.txt diff --git a/Examples/Mixed_Signal/custom_mixed_mode/PNP.lib b/Examples/Mixed_Signal/custom_mixed_signal/PNP.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/PNP.lib rename to Examples/Mixed_Signal/custom_mixed_signal/PNP.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/PNP.txt b/Examples/Mixed_Signal/custom_mixed_signal/PNP.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/PNP.txt rename to Examples/Mixed_Signal/custom_mixed_signal/PNP.txt diff --git a/Examples/Mixed_Signal/custom_mixed_mode/analysis b/Examples/Mixed_Signal/custom_mixed_signal/analysis similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/analysis rename to Examples/Mixed_Signal/custom_mixed_signal/analysis diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.lib b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal-cache.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.lib rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal-cache.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.txt b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal-cache.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode-cache.txt rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal-cache.txt diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.cir similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.cir diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir.out b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.cir.out similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.cir.out rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.cir.out diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.pro b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.pro similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.pro rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.pro diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.proj b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.proj similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.proj rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.proj diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.sch b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.sch similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode.sch rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal.sch diff --git a/Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml b/Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/custom_mixed_mode_Previous_Values.xml rename to Examples/Mixed_Signal/custom_mixed_signal/custom_mixed_signal_Previous_Values.xml diff --git a/Examples/Mixed_Signal/custom_mixed_mode/customblock.vhdl b/Examples/Mixed_Signal/custom_mixed_signal/customblock.vhdl similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/customblock.vhdl rename to Examples/Mixed_Signal/custom_mixed_signal/customblock.vhdl diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.lib b/Examples/Mixed_Signal/custom_mixed_signal/lm_741-cache.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.lib rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741-cache.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.txt b/Examples/Mixed_Signal/custom_mixed_signal/lm_741-cache.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741-cache.txt rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741-cache.txt diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.lib b/Examples/Mixed_Signal/custom_mixed_signal/lm_741-rescue.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.lib rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741-rescue.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.txt b/Examples/Mixed_Signal/custom_mixed_signal/lm_741-rescue.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741-rescue.txt rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741-rescue.txt diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir b/Examples/Mixed_Signal/custom_mixed_signal/lm_741.cir similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741.cir diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir.out b/Examples/Mixed_Signal/custom_mixed_signal/lm_741.cir.out similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741.cir.out rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741.cir.out diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741.pro b/Examples/Mixed_Signal/custom_mixed_signal/lm_741.pro similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741.pro rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741.pro diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741.sch b/Examples/Mixed_Signal/custom_mixed_signal/lm_741.sch similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741.sch rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741.sch diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741.sub b/Examples/Mixed_Signal/custom_mixed_signal/lm_741.sub similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741.sub rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741.sub diff --git a/Examples/Mixed_Signal/custom_mixed_mode/lm_741_Previous_Values.xml b/Examples/Mixed_Signal/custom_mixed_signal/lm_741_Previous_Values.xml similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/lm_741_Previous_Values.xml rename to Examples/Mixed_Signal/custom_mixed_signal/lm_741_Previous_Values.xml diff --git a/Examples/Mixed_Signal/custom_mixed_mode/npn_1.lib b/Examples/Mixed_Signal/custom_mixed_signal/npn_1.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/npn_1.lib rename to Examples/Mixed_Signal/custom_mixed_signal/npn_1.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/npn_1.txt b/Examples/Mixed_Signal/custom_mixed_signal/npn_1.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/npn_1.txt rename to Examples/Mixed_Signal/custom_mixed_signal/npn_1.txt diff --git a/Examples/Mixed_Signal/custom_mixed_mode/pnp_1.lib b/Examples/Mixed_Signal/custom_mixed_signal/pnp_1.lib similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/pnp_1.lib rename to Examples/Mixed_Signal/custom_mixed_signal/pnp_1.lib diff --git a/Examples/Mixed_Signal/custom_mixed_mode/pnp_1.txt b/Examples/Mixed_Signal/custom_mixed_signal/pnp_1.txt similarity index 100% rename from Examples/Mixed_Signal/custom_mixed_mode/pnp_1.txt rename to Examples/Mixed_Signal/custom_mixed_signal/pnp_1.txt From a236dc440e2242cc9b0005befb56c84980a4ca47 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:48:56 +0530 Subject: [PATCH 10/15] replaced deprecated SafeConfigParser with ConfigParser --- src/configuration/Appconfig.py | 12 +++++++----- src/ngspiceSimulation/NgspiceWidget.py | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 94abb44cf..96514f85d 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -13,13 +13,13 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Saturday 25 July 2020 +# REVISION: Sunday 02 August 2020 # ========================================================================= from PyQt5 import QtWidgets import os import json -from configparser import SafeConfigParser +from configparser import ConfigParser class Appconfig(QtWidgets.QWidget): @@ -63,7 +63,7 @@ class Appconfig(QtWidgets.QWidget): noteArea = {"Note": []} - parser_esim = SafeConfigParser() + parser_esim = ConfigParser() parser_esim.read( os.path.join( os.path.expanduser("~"), @@ -100,10 +100,12 @@ class Appconfig(QtWidgets.QWidget): def __init__(self): super(Appconfig, self).__init__() + # Application Details self._APPLICATION = 'eSim' - self._VERSION = 'v2.1.0' - self._AUTHOR = 'Fahim, Rahul' + self._VERSION = '2.1' + self._AUTHOR = 'Fahim' + self._REVISION = 'Rahul' # Application geometry setting self._app_xpos = 100 diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index 329918847..ea64893be 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -1,6 +1,6 @@ from PyQt5 import QtWidgets, QtCore from configuration.Appconfig import Appconfig -from configparser import SafeConfigParser +from configparser import ConfigParser import os @@ -25,7 +25,7 @@ def __init__(self, command, projPath): if os.name == 'nt': # For Windows OS home = os.path.expanduser("~") - parser_nghdl = SafeConfigParser() + parser_nghdl = ConfigParser() parser_nghdl.read(os.path.join( home, os.path.join('.nghdl', 'config.ini'))) From 2881a8103f374a04b7744a1c846a9097a0b5e4e8 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:56:18 +0530 Subject: [PATCH 11/15] wait for threads (if greater than 1) to finish before objects are destroyed --- src/projManagement/Worker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py index 78e02bbfe..cdad41704 100644 --- a/src/projManagement/Worker.py +++ b/src/projManagement/Worker.py @@ -13,12 +13,13 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Sunday 26 July 2020 +# REVISION: Sunday 02 August 2020 # ========================================================================= from PyQt5 import QtCore import subprocess from configuration.Appconfig import Appconfig +import threading class WorkerThread(QtCore.QThread): @@ -52,7 +53,8 @@ def __del__(self): @return None """ - self.wait() + if threading.active_count() > 1: + self.wait() def get_proc_threads(self): """ From 8846bcac1b640aacf9d9fc7c6063dd9bf736098e Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 12:58:02 +0530 Subject: [PATCH 12/15] added app name and version info; removed system tray --- src/frontEnd/Application.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index d373e6954..43109f7d3 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -13,7 +13,7 @@ # MODIFIED: Rahul Paknikar, rahulp@iitb.ac.in # ORGANIZATION: eSim Team at FOSSEE, IIT Bombay # CREATED: Tuesday 24 February 2015 -# REVISION: Saturday 25 July 2020 +# REVISION: Saturday 01 August 2020 # ========================================================================= import os @@ -69,13 +69,15 @@ def __init__(self, *args): self.obj_appconfig._app_ypos, self.obj_appconfig._app_width, self.obj_appconfig._app_heigth) - self.setWindowTitle(self.obj_appconfig._APPLICATION) + self.setWindowTitle( + self.obj_appconfig._APPLICATION + "-" + self.obj_appconfig._VERSION + ) self.showMaximized() self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) - self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) - self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) - self.systemTrayIcon.setVisible(True) + # self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) + # self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) + # self.systemTrayIcon.setVisible(True) def initToolBar(self): """ @@ -800,8 +802,8 @@ def __init__(self, *args): # Adding to main Layout self.mainLayout.addWidget(self.leftSplit) - self.leftSplit.setSizes([self.width() / 4.5, self.height()]) - self.middleSplit.setSizes([self.width(), self.height() / 2]) + self.leftSplit.setSizes([self.width() // 4.5, self.height()]) + self.middleSplit.setSizes([self.width(), self.height() // 2]) self.setLayout(self.mainLayout) @@ -813,6 +815,7 @@ def main(args): """ print("Starting eSim......") app = QtWidgets.QApplication(args) + app.setApplicationName("eSim") appView = Application() appView.hide() From 311382e0d09deb3c58cb0025044a91581b172b8a Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Mon, 3 Aug 2020 17:50:41 +0530 Subject: [PATCH 13/15] updated version info --- conf.py | 10 +++++----- setup.py | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/conf.py b/conf.py index 912f62a2a..95faa92f6 100644 --- a/conf.py +++ b/conf.py @@ -17,17 +17,17 @@ sys.path.insert(0, os.path.abspath('./src')) # added so that do not need to install them at runtime -autodoc_mock_imports = ["PyQt4", "pathmagic", "matplotlib", "numpy"] +autodoc_mock_imports = ["PyQt5", "pathmagic", "matplotlib", "numpy"] # -- Project information ----------------------------------------------------- project = u'eSim' -copyright = u'2020, Fossee' -author = u'Fossee' +copyright = u'2020, FOSSEE' +author = u'FOSSEE, IIT Bombay' # The short X.Y version -version = u'' +version = u'2.1' # The full version, including alpha/beta/rc tags -release = u'2.0.0' +release = u'2.1.0' # -- General configuration --------------------------------------------------- diff --git a/setup.py b/setup.py index 4c8d3aa07..192f25b5c 100644 --- a/setup.py +++ b/setup.py @@ -9,9 +9,9 @@ ''' setup( name='eSim', - version='2.0.0', + version='2.1.0', author='FOSSEE', - author_email='info@fossee.in', + author_email='contact-esim@fossee.in', package_dir={'': 'src'}, packages=find_namespace_packages(where='src'), license='GNU GPL LICENSE', From d9f16630945c40c1814762529565bf787371b3b0 Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Thu, 6 Aug 2020 00:57:08 +0530 Subject: [PATCH 14/15] added installer note --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 0db7eac11..f30a65301 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ It is an integrated tool build using open source softwares such as KiCad, Ngspic * Ubuntu 16.04 OS and above LTS versions. * Microsoft Windows 7, 8 and 10. +> Note: Refer [`installers`](https://github.com/fossee/eSim/tree/installers) branch for documentation on packaging for above mentioned platforms. + ## Features * An open-source EDA tool. * Perform Circuit Design. From 7871e58975d75eb2b02928f7a48d29113bebeb2b Mon Sep 17 00:00:00 2001 From: rahulp13 Date: Sat, 8 Aug 2020 19:06:45 +0530 Subject: [PATCH 15/15] resolved pep8 issues --- src/configuration/Appconfig.py | 2 +- src/frontEnd/Application.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 96514f85d..d0b4fd183 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -100,7 +100,7 @@ class Appconfig(QtWidgets.QWidget): def __init__(self): super(Appconfig, self).__init__() - + # Application Details self._APPLICATION = 'eSim' self._VERSION = '2.1' diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index 43109f7d3..506f2fd87 100644 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -76,7 +76,9 @@ def __init__(self, *args): self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) # self.systemTrayIcon = QtWidgets.QSystemTrayIcon(self) - # self.systemTrayIcon.setIcon(QtGui.QIcon(init_path + 'images/logo.png')) + # self.systemTrayIcon.setIcon( + # QtGui.QIcon(init_path + 'images/logo.png') + # ) # self.systemTrayIcon.setVisible(True) def initToolBar(self):