summaryrefslogtreecommitdiff
path: root/src/ngspiceSimulation/pythonPlotting.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ngspiceSimulation/pythonPlotting.py')
-rw-r--r--src/ngspiceSimulation/pythonPlotting.py42
1 files changed, 29 insertions, 13 deletions
diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py
index 9e9db8f6..9f8f8e88 100644
--- a/src/ngspiceSimulation/pythonPlotting.py
+++ b/src/ngspiceSimulation/pythonPlotting.py
@@ -11,7 +11,13 @@ from configuration.Appconfig import Appconfig
import numpy as np
+# This class creates Python Plotting window
class plotWindow(QtGui.QMainWindow):
+ '''
+ This class defines python plotting window, its features, buttons,
+ colors, AC and DC analysis, plotting etc.
+ '''
+
def __init__(self, fpath, projectName):
QtGui.QMainWindow.__init__(self)
self.fpath = fpath
@@ -114,6 +120,7 @@ class plotWindow(QtGui.QMainWindow):
'; font-weight = bold;')
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()
@@ -135,7 +142,7 @@ class plotWindow(QtGui.QMainWindow):
self.palette2.setColor(QtGui.QPalette.Foreground, QtCore.Qt.red)
self.funcName.setPalette(self.palette1)
self.funcExample.setPalette(self.palette2)
-
+ # Widgets for grid, plot button and multimeter button.
self.right_vbox.addLayout(self.top_grid)
self.right_vbox.addWidget(self.plotbtn)
self.right_vbox.addWidget(self.multimeterbtn)
@@ -158,10 +165,13 @@ class plotWindow(QtGui.QMainWindow):
self.scrollArea = QtGui.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.addWidget(self.scrollArea)
-
+ # Right side window frame showing list of nodes and branches.
self.mainFrame.setLayout(self.finalhbox)
self.showMaximized()
@@ -170,10 +180,10 @@ class plotWindow(QtGui.QMainWindow):
"<font color='indigo'>List of Branches:</font>")
self.funcLabel.setText("<font color='indigo'>Function:</font>")
self.funcName.setText(
- "<font color='indigo'>Standard functions</font>\
+ "<font color='indigo'>Standard functions</font>\
<br><br>Addition:<br>Subtraction:<br>\
Multiplication:<br>Division:<br>Comparison:"
- )
+ )
self.funcExample.setText(
"\n\nNode1 + Node2\nNode1 - Node2\nNode1 * Node2\nNode1 / Node2\
\nNode1 vs Node2")
@@ -188,7 +198,7 @@ class plotWindow(QtGui.QMainWindow):
self.multimeterbtn,
QtCore.SIGNAL('clicked()'),
self.multiMeter)
-
+ # for AC analysis
if self.plotType[0] == 0:
self.analysisType.setText("<b>AC Analysis</b>")
if self.plotType[1] == 1:
@@ -201,7 +211,7 @@ class plotWindow(QtGui.QMainWindow):
self.plotbtn,
QtCore.SIGNAL('clicked()'),
self.onPush_ac)
-
+ # for transient analysis
elif self.plotType[0] == 1:
self.analysisType.setText("<b>Transient Analysis</b>")
self.connect(
@@ -210,14 +220,16 @@ class plotWindow(QtGui.QMainWindow):
self.onPush_trans)
else:
+ # For DC analysis
self.analysisType.setText("<b>DC Analysis</b>")
self.connect(
self.plotbtn,
QtCore.SIGNAL('clicked()'),
self.onPush_dc)
- self.setCentralWidget(self.mainFrame)
-
+ self.setCentralWidget(self.mainFrame)
+
+ # definition of functions pushedClear, pushedPlotFunc.
def pushedClear(self):
self.text.clear()
self.axes.cla()
@@ -372,6 +384,9 @@ class plotWindow(QtGui.QMainWindow):
self.combo = []
self.combo1 = []
self.combo1_rev = []
+
+ # definition of functions onPush_decade, onPush_ac, onPush_trans,\
+ # onPush_dc, color and multimeter and getRMSValue.
def onPush_decade(self):
# print "Calling on push Decade"
boxCheck = 0
@@ -502,9 +517,10 @@ class plotWindow(QtGui.QMainWindow):
loc_y += 50
# Adding object of multimeter to dictionary
(
- self.obj_appconfig.dock_dict
- [self.obj_appconfig.current_project['ProjectName']].append(
- self.obj[j])
+ self.obj_appconfig.
+ dock_dict[
+ self.obj_appconfig.current_project['ProjectName']].
+ append(self.obj[j])
)
if boxCheck == 0:
@@ -554,7 +570,7 @@ class DataExtraction:
self.x = [] # stores x-axis data
def numberFinder(self, fpath):
- # Opening ANalysis file
+ # Opening Analysis file
with open(os.path.join(fpath, "analysis")) as f3:
self.analysisInfo = f3.read()
self.analysisInfo = self.analysisInfo.split(" ")