From b55f693aae4b4874e89514b83d59f5566f8d3998 Mon Sep 17 00:00:00 2001
From: fahim
Date: Mon, 1 Jun 2015 17:56:05 +0530
Subject: Subject: Adding changes for Model Editor
Description: Adding Changes for Model Editor
---
src/frontEnd/Application.py | 13 ++++++++++++-
src/frontEnd/DockArea.py | 23 +++++++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
(limited to 'src/frontEnd')
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 7f00e7a7..ca9471c6 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -26,7 +26,6 @@ from projManagement.Kicad import Kicad
from frontEnd import ProjectExplorer
import Workspace
import DockArea
-
import os
import sys
import time
@@ -106,6 +105,9 @@ class Application(QtGui.QMainWindow):
self.pcb = QtGui.QAction(QtGui.QIcon('../images/pcb.png'),'PCB Layout',self)
self.pcb.triggered.connect(self.obj_kicad.openLayout)
+
+ self.model = QtGui.QAction(QtGui.QIcon('../images/model.png'),'Model Editor',self)
+ self.model.triggered.connect(self.open_modelEditor)
#Adding Action Widget to tool bar
self.lefttoolbar = QtGui.QToolBar('Left ToolBar')
@@ -115,6 +117,7 @@ class Application(QtGui.QMainWindow):
self.lefttoolbar.addAction(self.ngspice)
self.lefttoolbar.addAction(self.footprint)
self.lefttoolbar.addAction(self.pcb)
+ self.lefttoolbar.addAction(self.model)
self.lefttoolbar.setOrientation(QtCore.Qt.Vertical)
def new_project(self):
@@ -205,6 +208,14 @@ class Application(QtGui.QMainWindow):
print "Current Project : ",self.obj_appconfig.current_project
#self.obj_Mainview.obj_dockarea.plottingEditor()
+
+ def open_modelEditor(self):
+ print "model editor is called"
+ self.obj_Mainview.obj_dockarea.modelEditor()
+
+ def testing(self):
+ print "Success hit kicad button"
+
class MainView(QtGui.QWidget):
"""
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index 875b3b90..76216aa6 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -2,6 +2,7 @@ from PyQt4 import QtGui,QtCore
from ngspiceSimulation.pythonPlotting import plotWindow
from ngspiceSimulation.NgspiceWidget import NgspiceWidget
from configuration.Appconfig import Appconfig
+from modelEditor.ModelEditor import ModelEditorclass
import os
dockList = ['Welcome']
@@ -107,6 +108,28 @@ class DockArea(QtGui.QMainWindow):
dock['NgSpice-'+str(count)].raise_()
count = count + 1
+
+ def modelEditor(self):
+ print"in model editor"
+ global count
+ self.modelwidget = QtGui.QWidget()
+
+ self.modellayout = QtGui.QVBoxLayout()
+ self.modellayout.addWidget(ModelEditorclass())
+
+ #Adding to main Layout
+ self.modelwidget.setLayout(self.modellayout)
+
+ dock['Model Editor-'+str(count)] = QtGui.QDockWidget('Model Editor-'+str(count))
+ dock['Model Editor-'+str(count)].setWidget(self.modelwidget)
+ self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Model Editor-'+str(count)])
+ self.tabifyDockWidget(dock['Welcome'],dock['Model Editor-'+str(count)])
+
+ dock['Model Editor-'+str(count)].setVisible(True)
+ dock['Model Editor-'+str(count)].setFocus()
+ dock['Model Editor-'+str(count)].raise_()
+
+ count = count + 1
--
cgit