diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/configuration/Appconfig.py | 2 | ||||
-rw-r--r-- | src/configuration/Appconfig.pyc | bin | 1288 -> 1307 bytes | |||
-rw-r--r-- | src/configuration/test.py | 61 | ||||
-rwxr-xr-x | src/frontEnd/Application.py | 17 | ||||
-rwxr-xr-x | src/frontEnd/ViewManagement.py | 15 | ||||
-rw-r--r-- | src/frontEnd/ViewManagement.pyc | bin | 2542 -> 3042 bytes | |||
-rw-r--r-- | src/projManagement/Validation.py | 6 |
7 files changed, 26 insertions, 75 deletions
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py index 811029ca..550670cf 100644 --- a/src/configuration/Appconfig.py +++ b/src/configuration/Appconfig.py @@ -27,7 +27,7 @@ class Appconfig(QtGui.QWidget): All configuration goes here """ #Home directory - home = os.path.expanduser("~")+"/ecSim-Workspace" + home = os.path.join(os.path.expanduser("~"),"ecSim-Workspace") default_workspace = {"workspace":home} #Current Project detail current_project = {"ProjectName":"None"} diff --git a/src/configuration/Appconfig.pyc b/src/configuration/Appconfig.pyc Binary files differindex 7d8c70a6..b68d43c9 100644 --- a/src/configuration/Appconfig.pyc +++ b/src/configuration/Appconfig.pyc diff --git a/src/configuration/test.py b/src/configuration/test.py deleted file mode 100644 index 4dd9f39d..00000000 --- a/src/configuration/test.py +++ /dev/null @@ -1,61 +0,0 @@ -''' -Created on 04-Feb-2015 - -@author: fahim -''' -import sys -from PyQt4 import QtGui, QtCore - - -class MainWindow(QtGui.QMainWindow): - - def __init__(self, *args): - apply(QtGui.QMainWindow.__init__, (self, ) + args) - self.setCaption("Adding and deleting widgets") - self.setName("main window") - self.mainWidget=QtGui.QWidget(self) - self.setCentralWidget(self.mainWidget) - self.mainLayout=QtGui.QVBoxLayout(self.mainWidget, 5, 5, "main") - self.buttonLayout=QtGui.QHBoxLayout(self.mainLayout, 5, "button") - self.widgetLayout=QtGui.QVBoxLayout(self.mainLayout, 5, "widget") - - self.bnAdd=QtGui.QPushButton("Add widget", self.mainWidget, "add") - self.connect(self.bnAdd, QtCore.SIGNAL("clicked()"), - self.slotAddWidget) - - self.bnRemove=QtGui.QPushButton("Remove widget", - self.mainWidget, "remove") - self.connect(self.bnRemove, QtCore.SIGNAL("clicked()"), - self.slotRemoveWidget) - - self.buttonLayout.addWidget(self.bnAdd) - self.buttonLayout.addWidget(self.bnRemove) - - self.buttons = [] - - def slotAddWidget(self): - widget=QtGui.QPushButton("test", self.mainWidget) - self.widgetLayout.addWidget(widget) - self.buttons.append(widget) - widget.show() - - def slotRemoveWidget(self): - self.widgetLayout.parent().removeChild(self.widgetLayout) - self.widgetLayout=QtGui.QVBoxLayout(self.mainLayout, 5, "widget") - self.buttons[-1].parent().removeChild(self.buttons[-1]) - del self.buttons[-1:] - - -def main(args): - app=QtGui.QApplication(args) - win=MainWindow() - win.show() - app.connect(app, QtCore.SIGNAL("lastWindowClosed()") - , app - ,QtCore.SLOT("quit()") - ) - app.exec_loop() - -if __name__=="__main__": - main(sys.argv) - diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py index a261d67c..e3e04b97 100755 --- a/src/frontEnd/Application.py +++ b/src/frontEnd/Application.py @@ -57,19 +57,19 @@ class Application(QtGui.QMainWindow): def initActions(self): - self.newproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'New Project',self) + self.newproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'<b>New Project</b>',self) self.newproj.setShortcut('Ctrl+N') self.newproj.triggered.connect(self.new_project) - self.openproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Open Project',self) + self.openproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'<b>Open Project</b>',self) self.openproj.setShortcut('Ctrl+O') self.openproj.triggered.connect(self.open_project) - self.exitproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Exit',self) + self.exitproj = QtGui.QAction(QtGui.QIcon('../images/default.png'),'<b>Exit</b>',self) self.exitproj.setShortcut('Ctrl+X') self.exitproj.triggered.connect(self.exit_project) - self.helpfile = QtGui.QAction(QtGui.QIcon('../images/default.png'),'Help',self) + self.helpfile = QtGui.QAction(QtGui.QIcon('../images/default.png'),'<b>Help</b>',self) self.helpfile.setShortcut('Ctrl+H') self.helpfile.triggered.connect(self.help_project) @@ -86,11 +86,7 @@ class Application(QtGui.QMainWindow): """ self.view = ViewManagement.ViewManagement() self.setCentralWidget(self.view) - - - def testfn(self): - print "Success hit :" - + def new_project(self): print "New Project called" @@ -107,6 +103,9 @@ class Application(QtGui.QMainWindow): def help_project(self): print "Help is called" + def testing(self): + print "Sucess hit kicad button" + diff --git a/src/frontEnd/ViewManagement.py b/src/frontEnd/ViewManagement.py index 7d6ca9cd..5b7dc262 100755 --- a/src/frontEnd/ViewManagement.py +++ b/src/frontEnd/ViewManagement.py @@ -21,6 +21,7 @@ from PyQt4 import QtCore from PyQt4 import QtGui +from projManagement.openKicad import Kicad class ViewManagement(QtGui.QSplitter): @@ -31,6 +32,10 @@ class ViewManagement(QtGui.QSplitter): # Creating dictionary which hold all the views self.views = {} + #Creating object of openKicad.py + + self.obj_kicad = Kicad() + # define the basic framework of view areas for the # application self.createView() @@ -56,27 +61,35 @@ class ViewManagement(QtGui.QSplitter): self.kicad_btn = QtGui.QPushButton() self.kicad_btn.setIcon(QtGui.QIcon('../images/default.png')) self.kicad_btn.setIconSize(QtCore.QSize(50,50)) + self.kicad_btn.setToolTip('<b>Open Schematic</b>') + self.kicad_btn.clicked.connect(self.obj_kicad.openSchematic) self.grid.addWidget(self.kicad_btn,0,0) self.conversion_btn = QtGui.QPushButton() self.conversion_btn.setIcon(QtGui.QIcon('../images/default.png')) self.conversion_btn.setIconSize(QtCore.QSize(50,50)) + self.conversion_btn.setToolTip('<b>Convert Kicad to Ngspice</b>') self.grid.addWidget(self.conversion_btn,0,1) self.ngspice_btn = QtGui.QPushButton() self.ngspice_btn.setIcon(QtGui.QIcon('../images/default.png')) self.ngspice_btn.setIconSize(QtCore.QSize(50,50)) + self.ngspice_btn.setToolTip('<b>Simulation</b>') self.grid.addWidget(self.ngspice_btn,0,2) self.footprint_btn = QtGui.QPushButton() self.footprint_btn.setIcon(QtGui.QIcon('../images/default.png')) self.footprint_btn.setIconSize(QtCore.QSize(50,50)) + self.footprint_btn.setToolTip('<b>Footprint Editor</b>') + self.footprint_btn.clicked.connect(self.obj_kicad.openFootprint) self.grid.addWidget(self.footprint_btn,1,0) self.pcb_btn = QtGui.QPushButton() self.pcb_btn.setIcon(QtGui.QIcon('../images/default.png')) self.pcb_btn.setIconSize(QtCore.QSize(50,50)) + self.pcb_btn.setToolTip('<b>PCB Layout</b>') + self.pcb_btn.clicked.connect(self.obj_kicad.openLayout) self.grid.addWidget(self.pcb_btn,1,1) @@ -104,7 +117,7 @@ class ViewManagement(QtGui.QSplitter): self.views[name] = settype() - + diff --git a/src/frontEnd/ViewManagement.pyc b/src/frontEnd/ViewManagement.pyc Binary files differindex 4f31cfc2..cec8f36d 100644 --- a/src/frontEnd/ViewManagement.pyc +++ b/src/frontEnd/ViewManagement.pyc diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py index b53dfe49..70b29ab5 100644 --- a/src/projManagement/Validation.py +++ b/src/projManagement/Validation.py @@ -25,9 +25,9 @@ class Validation: def validateOpenproj(self,proj_directory): print "Valid open Proj called" - tempStr = proj_directory.split('/') - projName = tempStr[len(tempStr)-1] - if os.path.exists(proj_directory+"/"+projName+".proj"): + projName = os.path.basename(str(proj_directory)) + lookProj = os.path.join(str(proj_directory),projName+".proj") + if os.path.exists(lookProj): return True else: return False |