summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFahim2016-04-04 17:37:40 +0530
committerFahim2016-04-04 17:37:40 +0530
commitcc11dd44bac3b598fc5f831de5d9fc62f72c63ad (patch)
tree0f42048a8fa22a882878d3fce5059c12b37769f1 /src
parent66770d5e2c94cc299424daa67b8bfafcb4d9b8c1 (diff)
parentea16f579ebdccacfceed1e39f772503eaedc6141 (diff)
downloadeSim-cc11dd44bac3b598fc5f831de5d9fc62f72c63ad.tar.gz
eSim-cc11dd44bac3b598fc5f831de5d9fc62f72c63ad.tar.bz2
eSim-cc11dd44bac3b598fc5f831de5d9fc62f72c63ad.zip
Merge pull request #54 from FOSSEE/release
Release --> Modification
Diffstat (limited to 'src')
-rw-r--r--src/ngspiceSimulation/pythonPlotting.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py
index 77171b0f..a3fd09fb 100644
--- a/src/ngspiceSimulation/pythonPlotting.py
+++ b/src/ngspiceSimulation/pythonPlotting.py
@@ -401,12 +401,17 @@ class plotWindow(QtGui.QMainWindow):
boxCheck = 0
loc_x = 300
loc_y = 300
+
for i,j in zip(self.chkbox,range(len(self.chkbox))):
if i.isChecked():
print "Check box",self.obj_dataext.NBList[j]
boxCheck += 1
+ if self.obj_dataext.NBList[j] in self.obj_dataext.NBIList:
+ voltFlag = False
+ else:
+ voltFlag = True
#Initializing Multimeter
- self.obj[j] = MultimeterWidgetClass(self.obj_dataext.NBList[j],self.getRMSValue(self.obj_dataext.y[j]),loc_x,loc_y)
+ self.obj[j] = MultimeterWidgetClass(self.obj_dataext.NBList[j],self.getRMSValue(self.obj_dataext.y[j]),loc_x,loc_y,voltFlag)
loc_x += 50
loc_y += 50
@@ -419,15 +424,20 @@ class plotWindow(QtGui.QMainWindow):
return np.sqrt(np.mean(np.square(dataPoints)))
class MultimeterWidgetClass(QtGui.QWidget):
- def __init__(self,node_branch,rmsValue,loc_x,loc_y):
+ def __init__(self,node_branch,rmsValue,loc_x,loc_y,voltFlag):
QtGui.QWidget.__init__(self)
self.multimeter = QtGui.QWidget(self)
- self.node_branchLabel = QtGui.QLabel("Node/Branch")
- self.rmsLabel = QtGui.QLabel("RMS Value (Volts/Amperes)")
-
+ if voltFlag:
+ self.node_branchLabel = QtGui.QLabel("Node")
+ self.rmsValue = QtGui.QLabel(str(rmsValue)+" Volts")
+ else:
+ self.node_branchLabel = QtGui.QLabel("Branch")
+ self.rmsValue = QtGui.QLabel(str(rmsValue)+" Amp")
+
+ self.rmsLabel = QtGui.QLabel("RMS Value")
self.nodeBranchValue = QtGui.QLabel(str(node_branch))
- self.rmsValue = QtGui.QLabel(str(rmsValue))
+
self.layout = QtGui.QGridLayout(self)
self.layout.addWidget(self.node_branchLabel,0,0)
@@ -436,6 +446,7 @@ class MultimeterWidgetClass(QtGui.QWidget):
self.layout.addWidget(self.rmsValue,1,1)
self.multimeter.setLayout(self.layout)
+ self.setGeometry(loc_x,loc_y,200,100)
self.setGeometry(loc_x,loc_y,300,100)
self.setWindowTitle("MultiMeter")
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)