summaryrefslogtreecommitdiff
path: root/src/frontEnd
diff options
context:
space:
mode:
authorfahim2015-06-02 14:55:09 +0530
committerfahim2015-06-02 14:55:09 +0530
commitcc2082a63d52bf7181902cfab70a5ff84560aa9b (patch)
tree078d9d4e833697cdf735128ee7e29d28b5e8f096 /src/frontEnd
parent622f2dee480c1e352b0c2821c63fe443d8419ab8 (diff)
downloadeSim-cc2082a63d52bf7181902cfab70a5ff84560aa9b.tar.gz
eSim-cc2082a63d52bf7181902cfab70a5ff84560aa9b.tar.bz2
eSim-cc2082a63d52bf7181902cfab70a5ff84560aa9b.zip
Subject: Added cd to project directory in xterm.
Description: This is done in order to avoid copying plot data file to project And also to make sure ngspice project get access its library used in netlist
Diffstat (limited to 'src/frontEnd')
-rwxr-xr-xsrc/frontEnd/Application.py23
-rw-r--r--src/frontEnd/DockArea.py2
-rw-r--r--src/frontEnd/ProjectExplorer.py8
3 files changed, 10 insertions, 23 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