diff options
-rw-r--r-- | INSTALL | 45 | ||||
-rw-r--r-- | README.md | 39 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | src/browser/UserManual.py | 14 | ||||
-rw-r--r-- | src/browser/Welcome.py | 9 | ||||
-rw-r--r-- | src/configuration/Appconfig.py | 9 | ||||
-rw-r--r-- | src/frontEnd/Application.py | 90 | ||||
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 14 | ||||
-rw-r--r-- | src/frontEnd/Workspace.py | 22 | ||||
-rw-r--r-- | src/kicadtoNgspice/DeviceModel.py | 9 | ||||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 22 | ||||
-rw-r--r-- | src/kicadtoNgspice/Processing.py | 6 | ||||
-rw-r--r-- | src/kicadtoNgspice/SubcircuitTab.py | 6 | ||||
-rw-r--r-- | src/modelEditor/ModelEditor.py | 15 | ||||
-rw-r--r-- | src/ngspicetoModelica/NgspicetoModelica.py | 11 | ||||
-rw-r--r-- | src/subcircuit/newSub.py | 7 | ||||
-rw-r--r-- | src/subcircuit/openSub.py | 7 | ||||
-rw-r--r-- | src/subcircuit/uploadSub.py | 6 |
18 files changed, 205 insertions, 128 deletions
@@ -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 @@ -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. @@ -1 +1 @@ -2.0
\ No newline at end of file +2.1 diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py index f31af29d..886d88a5 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 @@ class UserManual(QtGui.QWidget): 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 69584f10..aa7b612f 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 6a10f3d7..a079d472 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 92013409..cb7a7527 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 + from frontEnd import pathmagic # noqa:F401 + init_path = '' +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 projManagement import Worker 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 @@ class Application(QtGui.QMainWindow): 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 @@ class Application(QtGui.QMainWindow): """ # Top Tool bar self.newproj = QtGui.QAction( - QtGui.QIcon('images/newProject.png'), + QtGui.QIcon(init_path + 'images/newProject.png'), '<b>New Project</b>', 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'), '<b>Open Project</b>', 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'), '<b>Close Project</b>', 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'), '<b>Change Workspace</b>', self ) self.wrkspce.setShortcut('Ctrl+W') @@ -114,17 +121,17 @@ class Application(QtGui.QMainWindow): self.validate_mode() if self.online_flag is True: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/online.png'), + init_path + 'images/online.png'), '<b>Go Offline</b>', self ) elif self.online_flag is False: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/offline.png'), + init_path + 'images/offline.png'), '<b>Go Online</b>', self ) elif self.online_flag is None: self.switchmode = QtGui.QAction(QtGui.QIcon( - 'images/disable.png'), + init_path + 'images/disable.png'), '<b>Mode switching has been disabled. ' + 'Default mode set to offline</b>', self ) @@ -133,7 +140,8 @@ class Application(QtGui.QMainWindow): self.switchmode.triggered.connect(self.change_mode) self.helpfile = QtGui.QAction( - QtGui.QIcon('images/helpProject.png'), '<b>Help</b>', self + QtGui.QIcon(init_path + 'images/helpProject.png'), + '<b>Help</b>', self ) self.helpfile.setShortcut('Ctrl+H') self.helpfile.triggered.connect(self.help_project) @@ -156,7 +164,7 @@ class Application(QtGui.QMainWindow): 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 @@ class Application(QtGui.QMainWindow): # Left Tool bar Action Widget self.kicad = QtGui.QAction( - QtGui.QIcon('images/kicad.png'), + QtGui.QIcon(init_path + 'images/kicad.png'), '<b>Open Schematic</b>', 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'), '<b>Convert Kicad to Ngspice</b>', self ) self.conversion.triggered.connect(self.obj_kicad.openKicadToNgspice) self.ngspice = QtGui.QAction( - QtGui.QIcon('images/ngspice.png'), '<b>Simulation</b>', self + QtGui.QIcon(init_path + 'images/ngspice.png'), + '<b>Simulation</b>', self ) self.ngspice.triggered.connect(self.open_ngspice) self.model = QtGui.QAction( - QtGui.QIcon('images/model.png'), '<b>Model Editor</b>', self + QtGui.QIcon(init_path + 'images/model.png'), + '<b>Model Editor</b>', self ) self.model.triggered.connect(self.open_modelEditor) self.subcircuit = QtGui.QAction( - QtGui.QIcon('images/subckt.png'), '<b>Subcircuit</b>', self + QtGui.QIcon(init_path + 'images/subckt.png'), + '<b>Subcircuit</b>', self ) self.subcircuit.triggered.connect(self.open_subcircuit) self.nghdl = QtGui.QAction( - QtGui.QIcon('images/nghdl.png'), '<b>Nghdl</b>', self + QtGui.QIcon(init_path + 'images/nghdl.png'), '<b>Nghdl</b>', self ) self.nghdl.triggered.connect(self.open_nghdl) self.omedit = QtGui.QAction( - QtGui.QIcon('images/omedit.png'), + QtGui.QIcon(init_path + 'images/omedit.png'), '<b>Modelica Converter</b>', self ) self.omedit.triggered.connect(self.open_OMedit) self.omoptim = QtGui.QAction( - QtGui.QIcon('images/omoptim.png'), '<b>OM Optimisation</b>', self + QtGui.QIcon(init_path + 'images/omoptim.png'), + '<b>OM Optimisation</b>', self ) self.omoptim.triggered.connect(self.open_OMoptim) @@ -398,10 +410,14 @@ class Application(QtGui.QMainWindow): "/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 @@ class Application(QtGui.QMainWindow): 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('<b>Go Online</b>') self.switchmode.setEnabled(True) @@ -460,7 +476,7 @@ class Application(QtGui.QMainWindow): 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('<b>Go Offline</b>') self.switchmode.setEnabled(True) @@ -468,7 +484,7 @@ class Application(QtGui.QMainWindow): elif self.online_flag is None: self.switchmode.setIcon( - QtGui.QIcon('images/disable.png') + QtGui.QIcon(init_path + 'images/disable.png') ) self.switchmode.setText( '<b>Mode switching has been ' + @@ -798,11 +814,15 @@ def main(args): print("Starting eSim......") app = QtGui.QApplication(args) - splash_pix = QtGui.QPixmap('images/splash_screen_esim.png') - splash = QtGui.QSplashScreen(splash_pix, QtCore.Qt.WindowStaysOnTopHint) + 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.setMask(splash_pix.mask()) + splash.setDisabled(True) splash.show() - appView = Application() + appView.splash = splash appView.obj_workspace.returnWhetherClickedOrNot(appView) @@ -814,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/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py index f0227164..d327427c 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -33,23 +33,27 @@ class ProjectExplorer(QtGui.QWidget): 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 6940da59..85dafdf3 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 @@ -49,11 +49,12 @@ class Workspace(QtGui.QWidget): 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,8 +82,13 @@ class Workspace(QtGui.QWidget): self.setMaximumSize(4000, 200) self.setWindowTitle("eSim") self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint) - self.note.setReadOnly(True) - self.setWindowIcon(QtGui.QIcon('images/logo.png')) + self.setWindowModality(2) + + init_path = '../../' + if os.name == 'nt': + init_path = '' + + self.setWindowIcon(QtGui.QIcon(init_path + 'images/logo.png')) self.setLayout(self.grid) def defaultWorkspace(self): @@ -101,7 +107,7 @@ class Workspace(QtGui.QWidget): ) var_appView.show() - time.sleep(1) + time.sleep(1.5) var_appView.splash.close() def close(self, *args, **kwargs): @@ -161,7 +167,7 @@ class Workspace(QtGui.QWidget): ) var_appView.show() - time.sleep(1) + time.sleep(1.5) var_appView.splash.close() def browseLocation(self): diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index 31ff74f7..ceb89351 100644 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -364,11 +364,16 @@ class DeviceModel(QtGui.QWidget): 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 6d654158..4ce7d49b 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 @@ -599,16 +599,16 @@ class MainWindow(QtGui.QWidget): 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 67ffd3f5..494c49b4 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 d68cb97e..f4b759c5 100644 --- a/src/kicadtoNgspice/SubcircuitTab.py +++ b/src/kicadtoNgspice/SubcircuitTab.py @@ -146,10 +146,14 @@ class SubcircuitTab(QtGui.QWidget): # 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 0b6990f3..e8fda482 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 @@ class ModelEditorclass(QtGui.QWidget): - 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 @@ class ModelEditorclass(QtGui.QWidget): 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 @@ class ModelEditorclass(QtGui.QWidget): 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 @@ class ModelEditorclass(QtGui.QWidget): 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 09e28981..4df65c8d 100644 --- a/src/ngspicetoModelica/NgspicetoModelica.py +++ b/src/ngspicetoModelica/NgspicetoModelica.py @@ -472,12 +472,11 @@ class NgMoConverter: 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 5e98d24a..9c9ebbd8 100644 --- a/src/subcircuit/newSub.py +++ b/src/subcircuit/newSub.py @@ -27,11 +27,16 @@ class NewSub(QtGui.QWidget): - 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 6cb4fe3e..0e0906c0 100644 --- a/src/subcircuit/openSub.py +++ b/src/subcircuit/openSub.py @@ -16,9 +16,14 @@ class openSub(QtGui.QWidget): 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 25a6e7d4..c7b3951f 100644 --- a/src/subcircuit/uploadSub.py +++ b/src/subcircuit/uploadSub.py @@ -63,8 +63,12 @@ class UploadSub(QtGui.QWidget): 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 ) |