summaryrefslogtreecommitdiff
path: root/src/projManagement
diff options
context:
space:
mode:
authorfahim2015-04-22 17:52:04 +0530
committerfahim2015-04-22 17:52:04 +0530
commit342730ed59f75ebe1b5df0f886ae9e6bcd787ee6 (patch)
tree759bb8348608c67057aa58b4c654d9cb2339f62d /src/projManagement
parentaf98d04dd0a438b7dd63ff72c71f0ceb695fe704 (diff)
downloadeSim-342730ed59f75ebe1b5df0f886ae9e6bcd787ee6.tar.gz
eSim-342730ed59f75ebe1b5df0f886ae9e6bcd787ee6.tar.bz2
eSim-342730ed59f75ebe1b5df0f886ae9e6bcd787ee6.zip
Subject: Added Device Libarary Tab.Few Changes in Workspace class.
Description: Completed the Device Library auto creation of Widget. Added the information to schematicInfo.Hence to the final ".cir.out" file. Added sample device library. Deleted/Comment unwanted print statement. Added details of function in the comment.
Diffstat (limited to 'src/projManagement')
-rw-r--r--src/projManagement/Kicad.py29
-rw-r--r--src/projManagement/Kicad.pycbin4108 -> 4302 bytes
-rw-r--r--src/projManagement/Validation.py25
-rw-r--r--src/projManagement/Validation.pycbin1988 -> 2397 bytes
-rw-r--r--src/projManagement/Worker.py7
-rw-r--r--src/projManagement/Worker.pycbin1441 -> 1501 bytes
-rw-r--r--src/projManagement/newProject.py22
-rw-r--r--src/projManagement/newProject.pycbin3816 -> 3743 bytes
-rw-r--r--src/projManagement/openProject.py7
-rw-r--r--src/projManagement/openProject.pycbin1835 -> 1767 bytes
10 files changed, 62 insertions, 28 deletions
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py
index a575af21..65f71266 100644
--- a/src/projManagement/Kicad.py
+++ b/src/projManagement/Kicad.py
@@ -21,10 +21,10 @@ import Validation
from configuration.Appconfig import Appconfig
import Worker
from PyQt4 import QtGui
-import time
+
class Kicad:
"""
- Class Kicad open Schematic,PCB and Layout
+ This class called the Kicad Schematic,KicadtoNgspice Converter,Layout editor and Footprint Editor
"""
def __init__(self):
self.obj_validation = Validation.Validation()
@@ -32,12 +32,15 @@ class Kicad:
def openSchematic(self):
+ """
+ This function create command to open Kicad schematic
+ """
print "Kicad Schematic is called"
self.projDir = self.obj_appconfig.current_project["ProjectName"]
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
- print "calling Kicad schematic ",self.projDir
+ #print "calling Kicad schematic ",self.projDir
self.projName = os.path.basename(self.projDir)
self.project = os.path.join(self.projDir,self.projName)
@@ -54,12 +57,15 @@ class Kicad:
def openFootprint(self):
+ """
+ This function create command to open Footprint editor
+ """
print "Kicad Foot print Editor called"
self.projDir = self.obj_appconfig.current_project["ProjectName"]
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
- print "calling Kicad FootPrint Editor ",self.projDir
+ #print "calling Kicad FootPrint Editor ",self.projDir
self.projName = os.path.basename(self.projDir)
self.project = os.path.join(self.projDir,self.projName)
@@ -74,6 +80,9 @@ class Kicad:
self.msg.setWindowTitle("Error Message")
def openLayout(self):
+ """
+ This function create command to open Layout editor
+ """
print "Kicad Layout is called"
self.projDir = self.obj_appconfig.current_project["ProjectName"]
#Validating if current project is available or not
@@ -88,24 +97,26 @@ class Kicad:
self.obj_workThread.start()
else:
- self.msg = QtGui.QErrorMessage(None)
+ self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
def openKicadToNgspice(self):
+ """
+ This function create command to call kicad to Ngspice converter.
+ """
print "Open Kicad to Ngspice Conversion"
self.projDir = self.obj_appconfig.current_project["ProjectName"]
#Validating if current project is available or not
if self.obj_validation.validateKicad(self.projDir):
- print "Project is present"
+ #print "Project is present"
#Cheking if project has .cir file or not
if self.obj_validation.validateCir(self.projDir):
- print "CIR file present"
+ #print "CIR file present"
self.projName = os.path.basename(self.projDir)
self.project = os.path.join(self.projDir,self.projName)
#Creating a command to run
- #self.cmd = "python /home/fahim/Workspace/eSim/src/kicadtoNgspice/KicadtoNgspice.py "+self.project+".cir "
self.cmd = "python ../kicadtoNgspice/KicadtoNgspice.py "+self.project+".cir "
self.obj_workThread = Worker.WorkerThread(self.cmd)
self.obj_workThread.start()
@@ -120,4 +131,4 @@ class Kicad:
self.msg = QtGui.QErrorMessage(None)
self.msg.showMessage('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
+ \ No newline at end of file
diff --git a/src/projManagement/Kicad.pyc b/src/projManagement/Kicad.pyc
index 4011f875..2c78004a 100644
--- a/src/projManagement/Kicad.pyc
+++ b/src/projManagement/Kicad.pyc
Binary files differ
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py
index 33f0894f..a3d84979 100644
--- a/src/projManagement/Validation.py
+++ b/src/projManagement/Validation.py
@@ -21,11 +21,19 @@ import re
class Validation:
+ """
+ This is Validation class use for validating Project.
+ e.g if .proj is present in project directory
+ or if new project name is already exist in workspace etc
+ """
def __init__(self):
pass
def validateOpenproj(self,projDir):
- print "Validate openProj called"
+ """
+ This function validate Open Project Information.
+ """
+ print "Validating Open Project Information"
projName = os.path.basename(str(projDir))
lookProj = os.path.join(str(projDir),projName+".proj")
#Check existence of project
@@ -33,13 +41,14 @@ class Validation:
return True
else:
return False
-
def validateNewproj(self,projDir):
- print "Validate newProj called"
- print "Project Directory : ",projDir
+ """This Project Validate New Project Information
+ """
+ print "Validating New Project Information"
+ #print "Project Directory : ",projDir
#Checking existence of project with same name
if os.path.exists(projDir):
@@ -52,6 +61,9 @@ class Validation:
return "VALID"
def validateKicad(self,projDir):
+ """
+ This function validate if Kicad components are present
+ """
print "Validation for Kicad components"
if projDir == None:
return False
@@ -59,7 +71,10 @@ class Validation:
return True
def validateCir(self,projDir):
- print "Checking if .cir file is present or not"
+ """
+ This function checks if ".cir" file is present.
+ """
+ #print "Checking if .cir file is present or not"
projName = os.path.basename(str(projDir))
lookCir = os.path.join(str(projDir),projName+".cir")
#Check existence of project
diff --git a/src/projManagement/Validation.pyc b/src/projManagement/Validation.pyc
index 34e4aca0..145c59e4 100644
--- a/src/projManagement/Validation.pyc
+++ b/src/projManagement/Validation.pyc
Binary files differ
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py
index 641d6ee8..084b8048 100644
--- a/src/projManagement/Worker.py
+++ b/src/projManagement/Worker.py
@@ -21,6 +21,9 @@ from configuration.Appconfig import Appconfig
class WorkerThread(QtCore.QThread):
+ """
+ This is Thread class use to run the command
+ """
def __init__(self,args):
QtCore.QThread.__init__(self)
self.args = args
@@ -30,13 +33,13 @@ class WorkerThread(QtCore.QThread):
def run(self):
- print "Calling :",self.args
+ print "Calling Command:",self.args
self.call_system(self.args)
def call_system(self,command):
- print "System called"
procThread = Appconfig()
proc = subprocess.Popen(command.split())
procThread.procThread_list.append(proc)
+
\ No newline at end of file
diff --git a/src/projManagement/Worker.pyc b/src/projManagement/Worker.pyc
index 1144e9ed..dd276d50 100644
--- a/src/projManagement/Worker.pyc
+++ b/src/projManagement/Worker.pyc
Binary files differ
diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py
index 10251d1b..d6045fd3 100644
--- a/src/projManagement/newProject.py
+++ b/src/projManagement/newProject.py
@@ -23,7 +23,7 @@ import os
class NewProjectInfo(QtGui.QWidget):
"""
- Class ProjectInfo accept model information from user
+ This class is called when User create new Project.
"""
def __init__(self):
@@ -33,7 +33,10 @@ class NewProjectInfo(QtGui.QWidget):
def body(self):
- print "Calling NewProjectInfo"
+ """
+ This function create gui for New Project Info
+ """
+ #print "Calling NewProjectInfo"
self.projLabel = QtGui.QLabel("Enter Project Name :")
self.projEdit = QtGui.QLineEdit()
@@ -59,14 +62,17 @@ class NewProjectInfo(QtGui.QWidget):
def createProject(self):
- print "Create Project Called"
+ """
+ This function create Project related directories and files
+ """
+ #print "Create Project Called"
self.workspace = self.obj_appconfig.default_workspace['workspace']
self.projName = self.projEdit.text()
self.projName = str(self.projName).rstrip().lstrip() #Remove leading and trailing space
self.projDir = os.path.join(self.workspace,str(self.projName))
- print "Project Name:",self.projName
+
#Validation for newProject
if self.projName == "":
self.reply = "NONE"
@@ -83,7 +89,7 @@ class NewProjectInfo(QtGui.QWidget):
self.projFile = os.path.join(self.projDir,self.projName+".proj")
f = open(self.projFile,"w")
except:
- print "Some Thing Wrong"
+ #print "Some Thing Went Wrong"
self.msg = QtGui.QErrorMessage(self)
self.msg.showMessage('Unable to create project. Please make sure you have write permission on '+self.workspace)
self.msg.setWindowTitle("Error Message")
@@ -94,20 +100,20 @@ class NewProjectInfo(QtGui.QWidget):
self.obj_appconfig.current_project['ProjectName'] = self.projDir
elif self.reply == "CHECKEXIST":
- print "Project already exist"
+ #print "Project already exist"
self.msg = QtGui.QErrorMessage(self)
self.msg.showMessage('The project "'+self.projName+'" already exist.Please select the different name or delete existing project')
self.msg.setWindowTitle("Error Message")
elif self.reply == "CHECKNAME":
- print "Name is not proper"
+ #print "Name is not proper"
self.msg = QtGui.QErrorMessage(self)
self.msg.showMessage('The project name should not contain space between them')
self.msg.setWindowTitle("Error Message")
elif self.reply == "NONE":
- print "Empyt Project Name"
+ #print "Empty Project Name"
self.msg = QtGui.QErrorMessage(self)
self.msg.showMessage('The project name cannot be empty')
self.msg.setWindowTitle("Error Message")
diff --git a/src/projManagement/newProject.pyc b/src/projManagement/newProject.pyc
index 2754be24..383d796c 100644
--- a/src/projManagement/newProject.pyc
+++ b/src/projManagement/newProject.pyc
Binary files differ
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index 97e851e8..4112810c 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -25,8 +25,7 @@ from configuration.Appconfig import Appconfig
class OpenProjectInfo(QtGui.QWidget):
"""
- Class ProjectInfo accept model information from user
-
+ This class is called when User click on Open Project Button
"""
def __init__(self):
super(OpenProjectInfo, self).__init__()
@@ -38,13 +37,13 @@ class OpenProjectInfo(QtGui.QWidget):
#print "default workspace is now 1", self.openDir
self.projDir=QtGui.QFileDialog.getExistingDirectory(self,"open",self.openDir)
if self.obj_validation.validateOpenproj(self.projDir) == True:
- print "Pass open project test"
+ #print "Pass open project test"
self.obj_Appconfig = Appconfig()
self.obj_Appconfig.current_project['ProjectName'] = str(self.projDir)
else:
- print "Failed open project test"
+ #print "Failed open project test"
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:
diff --git a/src/projManagement/openProject.pyc b/src/projManagement/openProject.pyc
index 441e488f..9c53d6f2 100644
--- a/src/projManagement/openProject.pyc
+++ b/src/projManagement/openProject.pyc
Binary files differ