summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/frontEnd/Application.py23
-rw-r--r--src/frontEnd/DockArea.py2
-rw-r--r--src/frontEnd/ProjectExplorer.py8
-rw-r--r--src/ngspiceSimulation/NgspiceWidget.py5
4 files changed, 12 insertions, 26 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 10ee598f..e4bddac9 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -161,29 +161,16 @@ class Application(QtGui.QMainWindow):
if self.projDir != None:
self.obj_Mainview.obj_dockarea.ngspiceEditor(self.projDir)
time.sleep(2) #Need permanent solution
+ #Calling Python Plotting
+
try:
- #Moving plot_data_i.txt and plot_data_v.txt to project directory
- shutil.copy2("plot_data_i.txt", self.projDir)
- shutil.copy2("plot_data_v.txt", self.projDir)
- #Deleting this file from current directory
- os.remove("plot_data_i.txt")
- os.remove("plot_data_v.txt")
- #Calling Python Plotting
- try:
- self.obj_Mainview.obj_dockarea.plottingEditor()
- except Exception as e:
- self.msg = QtGui.QErrorMessage(None)
- self.msg.showMessage('Error while opening python plotting.')
- print "Exception:",str(e)
- self.msg.setWindowTitle("Error Message")
-
+ self.obj_Mainview.obj_dockarea.plottingEditor()
except Exception as e:
self.msg = QtGui.QErrorMessage(None)
- self.msg.showMessage('Unable to copy plot data file to project directory.')
+ self.msg.showMessage('Error while opening python plotting Editor.')
print "Exception:",str(e)
self.msg.setWindowTitle("Error Message")
-
-
+
else:
self.msg = QtGui.QErrorMessage()
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index 4e4f038c..e700dbd6 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -110,7 +110,7 @@ class DockArea(QtGui.QMainWindow):
self.ngspiceWidget = QtGui.QWidget()
self.ngspiceLayout = QtGui.QVBoxLayout()
- self.ngspiceLayout.addWidget(NgspiceWidget(self.ngspiceNetlist))
+ self.ngspiceLayout.addWidget(NgspiceWidget(self.ngspiceNetlist,self.projDir))
#Adding to main Layout
self.ngspiceWidget.setLayout(self.ngspiceLayout)
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index b9b5fc66..b518d863 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -2,7 +2,7 @@ from PyQt4 import QtGui,QtCore
import os
import json
from configuration.Appconfig import Appconfig
-from lxml.etree import tostring
+
class ProjectExplorer(QtGui.QWidget):
def __init__(self):
@@ -32,7 +32,7 @@ class ProjectExplorer(QtGui.QWidget):
pathlist= parents.split(os.sep)
parentnode = QtGui.QTreeWidgetItem(self.treewidget, [pathlist[-1],parents])
for files in children:
- childnode = QtGui.QTreeWidgetItem(parentnode, [files, parents+ '/'+ files])
+ childnode = QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(parents,files)])
self.window.addWidget(self.treewidget)
self.treewidget.doubleClicked.connect(self.openProject)
@@ -46,7 +46,7 @@ class ProjectExplorer(QtGui.QWidget):
pathlist= parents.split(os.sep)
parentnode = QtGui.QTreeWidgetItem(self.treewidget, [pathlist[-1], parents])
for files in children:
- childnode= QtGui.QTreeWidgetItem(parentnode, [files, parents+ '/'+ files])
+ childnode = QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(parents,files)])
def openMenu(self, position):
@@ -139,7 +139,7 @@ class ProjectExplorer(QtGui.QWidget):
for items in self.treewidget.selectedItems():
items.removeChild(items.child(0))
for files in filelistnew:
- childnode= QtGui.QTreeWidgetItem(parentnode, [files, self.filePath+ '/'+ files])
+ childnode= QtGui.QTreeWidgetItem(parentnode, [files, os.path.join(self.filePath,files)])
self.obj_appconfig.project_explorer[self.filePath]= filelistnew
json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w')) \ No newline at end of file
diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py
index de56359d..21b5164d 100644
--- a/src/ngspiceSimulation/NgspiceWidget.py
+++ b/src/ngspiceSimulation/NgspiceWidget.py
@@ -5,11 +5,10 @@ class NgspiceWidget(QtGui.QWidget):
"""
This Class creates NgSpice Window
"""
- def __init__(self,command):
+ def __init__(self,command,projPath):
QtGui.QWidget.__init__(self)
self.obj_appconfig = Appconfig()
- self.command = "ngspice "+command
-
+ self.command = "cd "+projPath+";ngspice "+command
self.process = QtCore.QProcess(self)
self.terminal = QtGui.QWidget(self)
self.layout = QtGui.QVBoxLayout(self)