summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/configuration/Appconfig.py13
-rwxr-xr-xsrc/frontEnd/Application.py19
-rw-r--r--src/frontEnd/ProjectExplorer.py1
-rw-r--r--src/frontEnd/Workspace.py4
-rw-r--r--src/modelEditor/ModelEditor.py9
-rw-r--r--src/ngspiceSimulation/pythonPlotting.py7
-rw-r--r--src/projManagement/Kicad.py29
-rw-r--r--src/projManagement/newProject.py3
-rw-r--r--src/projManagement/openProject.py10
9 files changed, 84 insertions, 11 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py
index 957634c2..bcc0fd95 100644
--- a/src/configuration/Appconfig.py
+++ b/src/configuration/Appconfig.py
@@ -37,6 +37,7 @@ class Appconfig(QtGui.QWidget):
workspace_text = '''eSim stores your project in a folder called a eSim-Workspace. You can choose a different workspace folder to use for this session.'''
procThread_list = []
dictPath = os.path.join(os.path.expanduser("~"), ".projectExplorer.txt")
+ noteArea = {}
try:
project_explorer = json.load(open(dictPath))
except:
@@ -56,11 +57,19 @@ class Appconfig(QtGui.QWidget):
self._app_heigth = 400
-
+ def print_info(self, str):
+
+ self.noteArea['Note'].append('[INFO]: ' + str)
+
+ def print_warning(self, str):
+
+ self.noteArea['Note'].append('[WARNING]: ' + str)
-
+ def print_error(self, str):
+
+ self.noteArea['Note'].append('[ERROR]: ' + str)
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index c08c1974..b80f9b64 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -135,8 +135,11 @@ class Application(QtGui.QMainWindow):
else:
print "No project created"
-
-
+ self.obj_appconfig.print_info('No new project created')
+ try:
+ self.obj_appconfig.print_info('Current project is : ' + self.obj_appconfig.current_project["ProjectName"])
+ except:
+ pass
def open_project(self):
"""
This project call Open Project Info class
@@ -168,6 +171,7 @@ class Application(QtGui.QMainWindow):
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Error while opening python plotting Editor.')
print "Exception:",str(e)
+ self.obj_appconfig.print_error('Exception generated : ' + str(e))
self.msg.setWindowTitle("Error Message")
else:
@@ -193,12 +197,15 @@ class Application(QtGui.QMainWindow):
def help_project(self):
print "Help is called"
- print "Current Project : ",self.obj_appconfig.current_project
+ self.obj_appconfig.print_info('Help is called')
+ print "Current Project : ",self.obj_appconfig.current_project
+ #self.obj_appconfig.print_info('Current Project : ' + self.obj_appconfig.current_project['ProjectName'])
#self.obj_Mainview.obj_dockarea.plottingEditor()
def open_modelEditor(self):
print "model editor is called"
+ self.obj_appconfig.print_info('model editor is called')
self.obj_Mainview.obj_dockarea.modelEditor()
def testing(self):
@@ -213,6 +220,8 @@ class MainView(QtGui.QWidget):
# call init method of superclass
QtGui.QWidget.__init__(self, *args)
+ self.obj_appconfig = Appconfig()
+
self.leftSplit = QtGui.QSplitter()
self.middleSplit = QtGui.QSplitter()
@@ -223,6 +232,10 @@ class MainView(QtGui.QWidget):
#Area to be included in MainView
self.noteArea = QtGui.QTextEdit()
+ self.obj_appconfig.noteArea['Note'] = self.noteArea
+ self.obj_appconfig.noteArea['Note'].append(' eSim Started......')
+ self.obj_appconfig.noteArea['Note'].append('Project Selected : None')
+ self.obj_appconfig.noteArea['Note'].append('\n')
#CSS
self.noteArea.setStyleSheet(" \
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index 906001d5..0b0ae31d 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -75,6 +75,7 @@ class ProjectExplorer(QtGui.QWidget):
self.indexItem =self.treewidget.currentIndex()
filename= self.indexItem.data().toString()
self.filePath= self.indexItem.sibling(self.indexItem.row(), 1).data().toString()
+ self.obj_appconfig.print_info('The current project is ' + self.filePath)
self.textwindow = QtGui.QWidget()
self.textwindow.setMinimumSize(600, 500)
diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py
index 9f1232cf..96d00a08 100644
--- a/src/frontEnd/Workspace.py
+++ b/src/frontEnd/Workspace.py
@@ -75,12 +75,14 @@ class Workspace(QtGui.QWidget):
def defaultWorkspace(self):
- print "Default location selected"
+ print "Default location selected"
+ self.obj_appconfig.print_info('Default workspace selected : ' + self.obj_appconfig.default_workspace["workspace"])
self.close()
def createWorkspace(self):
print "Create workspace is called"
self.create_workspace = str(self.workspace_loc.text())
+ self.obj_appconfig.print_info('Workspace : ' + self.create_workspace)
#Checking if Workspace already exist or not
if os.path.isdir(self.create_workspace):
print "Already present"
diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py
index 68f0735c..7e5e8434 100644
--- a/src/modelEditor/ModelEditor.py
+++ b/src/modelEditor/ModelEditor.py
@@ -1,6 +1,7 @@
from PyQt4 import QtGui, QtCore
from PyQt4.Qt import QTableWidgetItem
import xml.etree.ElementTree as ET
+from configuration.Appconfig import Appconfig
import os
@@ -8,6 +9,7 @@ class ModelEditorclass(QtGui.QWidget):
def __init__(self):
QtGui.QWidget.__init__(self)
self.savepathtest = '../deviceModelLibrary'
+ self.obj_appconfig = Appconfig()
self.newflag=0
self.layout = QtGui.QVBoxLayout()
self.splitter= QtGui.QSplitter()
@@ -330,6 +332,7 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.write('+ ' + tags + '=' + text +'\n')
txtfile.write(')')
tree.write(self.modelname +".xml")
+ self.obj_appconfig.print_info('New ' + self.modelname + ' ' + self.model_name + ' library created at ' + os.getcwd())
if self.mos.isChecked():
savepath = os.path.join(self.savepath, 'MOS')
os.chdir(savepath)
@@ -339,6 +342,7 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.write('+ ' + tags + '=' + text +'\n')
txtfile.write(')')
tree.write(self.modelname +".xml")
+ self.obj_appconfig.print_info('New ' + self.modelname + ' ' + self.model_name + ' library created at ' + os.getcwd())
if self.jfet.isChecked():
savepath = os.path.join(self.savepath, 'JFET')
os.chdir(savepath)
@@ -348,6 +352,7 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.write('+ ' + tags + '=' + text +'\n')
txtfile.write(')')
tree.write(self.modelname +".xml")
+ self.obj_appconfig.print_info('New ' + self.modelname + ' ' + self.model_name + ' library created at ' + os.getcwd())
if self.igbt.isChecked():
savepath = os.path.join(self.savepath, 'IGBT')
os.chdir(savepath)
@@ -357,6 +362,7 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.write('+ ' + tags + '=' + text +'\n')
txtfile.write(')')
tree.write(self.modelname +".xml")
+ self.obj_appconfig.print_info('New ' + self.modelname + ' ' + self.model_name + ' library created at ' + os.getcwd())
if self.magnetic.isChecked():
savepath = os.path.join(self.savepath, 'Misc')
os.chdir(savepath)
@@ -366,6 +372,7 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.write('+ ' + tags + '=' + text +'\n')
txtfile.write(')')
tree.write(self.modelname +".xml")
+ self.obj_appconfig.print_info('New ' + self.modelname + ' ' + self.model_name + ' library created at ' + os.getcwd())
if self.bjt.isChecked():
savepath = os.path.join(self.savepath, 'Transistor')
os.chdir(savepath)
@@ -375,6 +382,7 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.write('+ ' + tags + '=' + text +'\n')
txtfile.write(')')
tree.write(self.modelname +".xml")
+ self.obj_appconfig.print_info('New ' + self.modelname + ' ' + self.model_name + ' library created at ' + os.getcwd())
txtfile.close()
os.chdir(defaultcwd)
@@ -408,6 +416,7 @@ class ModelEditorclass(QtGui.QWidget):
for tags, text in self.modeldict.items():
ET.SubElement(param, tags).text = text
self.tree.write(editfile)
+ self.obj_appconfig.print_info('Updated library ' + libpath)
def removeparameter(self):
self.savebtn.setDisabled(False)
diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py
index 60665f96..00077e14 100644
--- a/src/ngspiceSimulation/pythonPlotting.py
+++ b/src/ngspiceSimulation/pythonPlotting.py
@@ -5,14 +5,18 @@ from decimal import Decimal
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar
from matplotlib.figure import Figure
+from configuration.Appconfig import Appconfig
class plotWindow(QtGui.QMainWindow):
def __init__(self,fpath,projectName):
QtGui.QMainWindow.__init__(self)
self.fpath = fpath#+".cir.out"
self.projectName = projectName
+ self.obj_appconfig = Appconfig()
print "Path : ",self.fpath
print "Project Name : ",self.projectName
+ self.obj_appconfig.print_info('Ngspice simulation is called : ' + self.fpath)
+ self.obj_appconfig.print_info('PythonPlotting is called : ' + self.fpath)
self.combo = []
self.combo1 = []
self.combo1_rev = []
@@ -377,6 +381,7 @@ class plotWindow(QtGui.QMainWindow):
class DataExtraction:
def __init__(self):
+ self.obj_appconfig = Appconfig()
print "Initialization"
self.data=[] #consists of all the columns of data belonging to nodes and branches
self.y=[] #stores y-axis data
@@ -495,6 +500,7 @@ class DataExtraction:
except Exception as e:
print "Exception Message : ",str(e)
+ self.obj_appconfig.print_error('Exception Message :' + str(e))
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Unable to open plot data files.')
self.msg.setWindowTitle("Error Message:openFile")
@@ -508,6 +514,7 @@ class DataExtraction:
#print "NBILIST : ",self.NBIList
except Exception as e:
print "Exception Message : ",str(e)
+ self.obj_appconfig.print_error('Exception Message :' + str(e))
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Error in Analysis File.')
self.msg.setWindowTitle("Error Message:openFile")
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py
index 1b5135b1..d7202b4f 100644
--- a/src/projManagement/Kicad.py
+++ b/src/projManagement/Kicad.py
@@ -36,7 +36,11 @@ class Kicad:
This function create command to open Kicad schematic
"""
print "Kicad Schematic is called"
- self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ try:
+ self.obj_appconfig.print_info('Kicad Schematic is called for project ' + self.projDir)
+ except:
+ pass
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
@@ -52,6 +56,7 @@ class Kicad:
else:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
+ self.obj_appconfig.print_warning('Please select the project first. You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
@@ -61,7 +66,11 @@ class Kicad:
This function create command to open Footprint editor
"""
print "Kicad Foot print Editor called"
- self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ try:
+ self.obj_appconfig.print_info('Kicad Footprint Editor is called for project : ' + self.projDir)
+ except:
+ pass
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
@@ -77,6 +86,7 @@ class Kicad:
else:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
+ self.obj_appconfig.print_warning('Please select the project first. You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
def openLayout(self):
@@ -84,7 +94,11 @@ class Kicad:
This function create command to open Layout editor
"""
print "Kicad Layout is called"
- self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ try:
+ self.obj_appconfig.print_info('PCB Layout is called for project : ' + self.projDir)
+ except:
+ pass
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
print "calling Kicad schematic ",self.projDir
@@ -99,6 +113,7 @@ class Kicad:
else:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
+ self.obj_appconfig.print_warning('Please select the project first. You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
def openKicadToNgspice(self):
@@ -106,7 +121,13 @@ class Kicad:
This function create command to call kicad to Ngspice converter.
"""
print "Open Kicad to Ngspice Conversion"
+
self.projDir = self.obj_appconfig.current_project["ProjectName"]
+ try:
+ self.obj_appconfig.print_info('Kicad to Ngspice Conversion is called')
+ self.obj_appconfig.print_info('Current Project is ' + self.projDir)
+ except:
+ pass
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
#print "Project is present"
@@ -125,11 +146,13 @@ class Kicad:
else:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('The project does not contain any Kicad netlist file for conversion.')
+ self.obj_appconfig.print_error('The project does not contain any Kicad netlist file for conversion.')
self.msg.setWindowTitle("Error Message")
else:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
+ self.obj_appconfig.print_warning('Please select the project first. You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
\ No newline at end of file
diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py
index 22f2c60c..8e3c8656 100644
--- a/src/projManagement/newProject.py
+++ b/src/projManagement/newProject.py
@@ -76,6 +76,9 @@ class NewProjectInfo(QtGui.QWidget):
newprojlist.append(self.projName+'.proj')
self.obj_appconfig.project_explorer[self.projDir] = newprojlist
+ self.obj_appconfig.print_info('New project created : ' + self.projName)
+ self.obj_appconfig.print_info('Current project is : ' + self.projDir)
+
json.dump(self.obj_appconfig.project_explorer, open(self.obj_appconfig.dictPath,'w'))
return self.projDir, newprojlist
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index 83fc1a41..c0733058 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -39,7 +39,7 @@ class OpenProjectInfo(QtGui.QWidget):
self.projDir=QtGui.QFileDialog.getExistingDirectory(self,"open",self.openDir)
if self.obj_validation.validateOpenproj(self.projDir) == True:
#print "Pass open project test"
- self.obj_Appconfig = Appconfig()
+ #self.obj_Appconfig = Appconfig()
self.obj_Appconfig.current_project['ProjectName'] = str(self.projDir)
if os.path.isdir(self.projDir):
print "true"
@@ -49,16 +49,22 @@ class OpenProjectInfo(QtGui.QWidget):
files = filelist
self.obj_Appconfig.project_explorer[dirs] = filelist
json.dump(self.obj_Appconfig.project_explorer, open(self.obj_Appconfig.dictPath,'w'))
+ self.obj_Appconfig.print_info('Open Project called')
+ self.obj_Appconfig.print_info('Current Project is ' + self.projDir)
return dirs, filelist
else:
#print "Failed open project test"
+ self.obj_Appconfig.print_error("The project doesn't contain .proj file. Please select the proper directory else you won't be able to perform any operation")
reply = QtGui.QMessageBox.critical(None, "Error Message",'''<b> Error: The project doesn't contain .proj file.</b><br/>
<b>Please select the proper project directory else you won't be able to perform any operation</b>''',QtGui.QMessageBox.Ok|QtGui.QMessageBox.Cancel)
+
if reply == QtGui.QMessageBox.Ok:
self.body()
+ self.obj_Appconfig.print_info('Open Project called')
+ self.obj_Appconfig.print_info('Current Project is ' + self.projDir)
elif reply == QtGui.QMessageBox.Cancel:
- pass
+ self.obj_Appconfig.print_info('No Project opened')
else:
pass