diff options
Diffstat (limited to 'src/projManagement')
-rw-r--r-- | src/projManagement/Kicad.py | 29 | ||||
-rw-r--r-- | src/projManagement/newProject.py | 3 | ||||
-rw-r--r-- | src/projManagement/openProject.py | 10 |
3 files changed, 37 insertions, 5 deletions
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 |