From c0e70c79a6d651cf8b3b397f866ae38485fa5ca0 Mon Sep 17 00:00:00 2001 From: fahim Date: Wed, 11 Mar 2015 16:53:05 +0530 Subject: Subject: Added new module kicadtongspice Description: Develope skeleton body for kicadtongspice module --- src/projManagement/Kicad.py | 22 +++++++++++++++++++++- src/projManagement/Kicad.pyc | Bin 3142 -> 3853 bytes src/projManagement/Validation.py | 10 ++++++++++ src/projManagement/Validation.pyc | Bin 1613 -> 1988 bytes 4 files changed, 31 insertions(+), 1 deletion(-) (limited to 'src/projManagement') diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py index 71e66064..ec2932a0 100644 --- a/src/projManagement/Kicad.py +++ b/src/projManagement/Kicad.py @@ -90,4 +90,24 @@ 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.msg.setWindowTitle("Error Message") \ No newline at end of file + self.msg.setWindowTitle("Error Message") + + def openKicadToNgspice(self): + 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" + #Cheking if project has .cir file or not + if self.obj_validation.validateCir(self.projDir): + print "CIR file present" + else: + self.msg = QtGui.QErrorMessage(None) + self.msg.showMessage('Your project do 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.msg.setWindowTitle("Error Message") + \ No newline at end of file diff --git a/src/projManagement/Kicad.pyc b/src/projManagement/Kicad.pyc index 273ea5d7..5b498b30 100644 Binary files a/src/projManagement/Kicad.pyc and b/src/projManagement/Kicad.pyc differ diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py index 323b509c..33f0894f 100644 --- a/src/projManagement/Validation.py +++ b/src/projManagement/Validation.py @@ -58,6 +58,16 @@ class Validation: else: return True + def validateCir(self,projDir): + 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 + if os.path.exists(lookCir): + return True + else: + return False + diff --git a/src/projManagement/Validation.pyc b/src/projManagement/Validation.pyc index 690e016e..34e4aca0 100644 Binary files a/src/projManagement/Validation.pyc and b/src/projManagement/Validation.pyc differ -- cgit