summaryrefslogtreecommitdiff
path: root/src/kicadtoNgspice
diff options
context:
space:
mode:
authorrahulp132020-08-03 12:03:41 +0530
committerrahulp132020-08-03 12:03:41 +0530
commit2eb6697de529a643127599070771a0278e9817b3 (patch)
treea024da46ce7e9712291ba6f7b3572ba37479c01a /src/kicadtoNgspice
parentd7e14cecfe0abdd9aeea5e589ddaeb5c302f5877 (diff)
downloadeSim-2eb6697de529a643127599070771a0278e9817b3.tar.gz
eSim-2eb6697de529a643127599070771a0278e9817b3.tar.bz2
eSim-2eb6697de529a643127599070771a0278e9817b3.zip
ported GUI to PyQt5
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r--src/kicadtoNgspice/Analysis.py127
-rw-r--r--src/kicadtoNgspice/Convert.py4
-rw-r--r--src/kicadtoNgspice/DeviceModel.py58
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.py49
-rw-r--r--src/kicadtoNgspice/Model.py20
-rw-r--r--src/kicadtoNgspice/Source.py60
-rw-r--r--src/kicadtoNgspice/SubcircuitTab.py26
7 files changed, 170 insertions, 174 deletions
diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py
index da030153..32902a81 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 @@ class Analysis(QtGui.QWidget):
- 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 @@ class Analysis(QtGui.QWidget):
- 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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 @@ class Analysis(QtGui.QWidget):
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 7ab57427..24449a3b 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 @@ class Convert:
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 ceb89351..1c77cabc 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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 @@ class DeviceModel(QtGui.QWidget):
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 4ce7d49b..93cf6a4e 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 . import TrackWidget
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 @@ class MainWindow(QtGui.QWidget):
"""
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 @@ class MainWindow(QtGui.QWidget):
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 @@ class MainWindow(QtGui.QWidget):
- 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 @@ class MainWindow(QtGui.QWidget):
- 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 @@ class MainWindow(QtGui.QWidget):
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 a5757702..0c821190 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 @@ class Model(QtGui.QWidget):
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 @@ class Model(QtGui.QWidget):
# 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 @@ class Model(QtGui.QWidget):
# 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 @@ class Model(QtGui.QWidget):
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 e42899e3..3febdfeb 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 @@ class Source(QtGui.QWidget):
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 @@ class Source(QtGui.QWidget):
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 @@ class Source(QtGui.QWidget):
[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 @@ class Source(QtGui.QWidget):
[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 @@ class Source(QtGui.QWidget):
[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 @@ class Source(QtGui.QWidget):
[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 @@ class Source(QtGui.QWidget):
[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 f4b759c5..4c7179d3 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 @@ class SubcircuitTab(QtGui.QWidget):
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 @@ class SubcircuitTab(QtGui.QWidget):
self.numPorts = []
# Set Layout
- self.grid = QtGui.QGridLayout()
+ self.grid = QtWidgets.QGridLayout()
self.setLayout(self.grid)
for eachline in schematicInfo:
@@ -66,10 +66,10 @@ class SubcircuitTab(QtGui.QWidget):
# 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 @@ class SubcircuitTab(QtGui.QWidget):
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 @@ class SubcircuitTab(QtGui.QWidget):
init_path = ''
self.subfile = str(
- QtGui.QFileDialog.getExistingDirectory(
+ QtWidgets.QFileDialog.getExistingDirectory(
self, "Open Subcircuit",
init_path + "library/SubcircuitLibrary")
)
@@ -166,14 +166,14 @@ class SubcircuitTab(QtGui.QWidget):
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 @@ class SubcircuitTab(QtGui.QWidget):
# 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(