diff options
author | rahulp13 | 2022-09-17 20:03:38 +0530 |
---|---|---|
committer | rahulp13 | 2022-09-17 20:03:38 +0530 |
commit | 4c8ff5f9241e72007bdbd931d77240e7943f21ef (patch) | |
tree | ad9c14cd2a045730d8816228dc8bda2ca37a93e6 /src/kicadtoNgspice/DeviceModel.py | |
parent | 1b8addf7a0daa681014d2cef4371622b431b84e3 (diff) | |
download | eSim-4c8ff5f9241e72007bdbd931d77240e7943f21ef.tar.gz eSim-4c8ff5f9241e72007bdbd931d77240e7943f21ef.tar.bz2 eSim-4c8ff5f9241e72007bdbd931d77240e7943f21ef.zip |
fix sky130 library path issue
Diffstat (limited to 'src/kicadtoNgspice/DeviceModel.py')
-rwxr-xr-x | src/kicadtoNgspice/DeviceModel.py | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py index 630ec41f..0967333c 100755 --- a/src/kicadtoNgspice/DeviceModel.py +++ b/src/kicadtoNgspice/DeviceModel.py @@ -77,7 +77,6 @@ class DeviceModel(QtWidgets.QWidget): self.count = self.count+1 self.row = self.row + 1 self.devicemodel_dict_beg["scmode1"] = self.count - i = self.count beg = self.count self.deviceDetail[self.count] = "scmode1" sky130box.setTitle("Add parameters of SKY130 library ") @@ -88,9 +87,7 @@ class DeviceModel(QtWidgets.QWidget): self.row = self.row + 1 sky130grid.addWidget(self.parameterLabel[self.count], self.row, 0) self.entry_var[self.count] = QtWidgets.QLineEdit() - init_path = '../../' - if os.name == 'nt': - init_path = '' + self.entry_var[self.count].setReadOnly(True) for child in self.root: if child.tag == "scmode1": @@ -100,9 +97,16 @@ class DeviceModel(QtWidgets.QWidget): .setText(child[0].text) path_name = child[0].text else: - path_name = os.path.abspath( - init_path + "library/deviceModelLibrary/\ -sky130_fd_pr/models/sky130.lib.spice") + if os.name == 'nt': + path_name = os.path.abspath( + "library/" + + "sky130_fd_pr/models/sky130.lib.spice" + ) + else: + path_name = os.path.abspath( + "/usr/share/local/" + + "sky130_fd_pr/models/sky130.lib.spice" + ) self.entry_var[self.count].setText(path_name) # self.trackLibraryWithoutButton(self.count, path_name) @@ -186,7 +190,6 @@ sky130_fd_pr/models/sky130.lib.spice") self.deviceDetail[self.count] = words[0] sky130box = QtWidgets.QGroupBox() sky130grid = QtWidgets.QGridLayout() - i = self.count beg = self.count sky130box.setTitle( "Add parameters for " + @@ -533,14 +536,18 @@ sky130_fd_pr/models/sky130.lib.spice") self.show() def trackDefaultLib(self): - init_path = '../../' - if os.name == 'nt': - init_path = '' sending_btn = self.sender() self.widgetObjCount = int(sending_btn.objectName()) - path_name = os.path.abspath( - init_path + "library/deviceModelLibrary/sky130_fd_pr\ -/models/sky130.lib.spice") + if os.name == 'nt': + path_name = os.path.abspath( + "library/" + + "sky130_fd_pr/models/sky130.lib.spice" + ) + else: + path_name = os.path.abspath( + "/usr/share/local/" + + "sky130_fd_pr/models/sky130.lib.spice" + ) self.entry_var[self.widgetObjCount].setText(path_name) self.trackLibraryWithoutButton(self.widgetObjCount, path_name) @@ -802,4 +809,3 @@ Converter developed at FOSSEE, IIT Bombay\n") self.msg.showMessage(self.content) self.msg.exec_() return - |