summaryrefslogtreecommitdiff
path: root/src/frontEnd
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontEnd')
-rwxr-xr-xsrc/frontEnd/Application.py9
-rw-r--r--src/frontEnd/DockArea.py29
-rw-r--r--src/frontEnd/Workspace.py2
3 files changed, 35 insertions, 5 deletions
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index 01e445a9..9fce17b0 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -109,6 +109,9 @@ class Application(QtGui.QMainWindow):
self.model = QtGui.QAction(QtGui.QIcon('../../images/model.png'),'<b>Model Editor</b>',self)
self.model.triggered.connect(self.open_modelEditor)
+ self.subcircuit=QtGui.QAction(QtGui.QIcon('../../images/subckt.png'),'<b>Subcircuit</b>',self)
+ self.subcircuit.triggered.connect(self.open_subcircuit)
+
#Adding Action Widget to tool bar
self.lefttoolbar = QtGui.QToolBar('Left ToolBar')
self.addToolBar(QtCore.Qt.LeftToolBarArea, self.lefttoolbar)
@@ -118,6 +121,7 @@ class Application(QtGui.QMainWindow):
self.lefttoolbar.addAction(self.footprint)
self.lefttoolbar.addAction(self.pcb)
self.lefttoolbar.addAction(self.model)
+ self.lefttoolbar.addAction(self.subcircuit)
self.lefttoolbar.setOrientation(QtCore.Qt.Vertical)
self.lefttoolbar.setIconSize(QSize(40,40))
@@ -179,6 +183,11 @@ class Application(QtGui.QMainWindow):
self.msg = QtGui.QErrorMessage()
self.msg.showMessage('Please select the project first. You can either create new project or open existing project')
self.msg.setWindowTitle("Error Message")
+
+ def open_subcircuit(self):
+ print "Subcircuit editor is called"
+ self.obj_appconfig.print_info('Subcircuit editor is called')
+ self.obj_Mainview.obj_dockarea.subcircuiteditor()
def exit_project(self):
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index e700dbd6..e87fea99 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -3,6 +3,7 @@ from ngspiceSimulation.pythonPlotting import plotWindow
from ngspiceSimulation.NgspiceWidget import NgspiceWidget
from configuration.Appconfig import Appconfig
from modelEditor.ModelEditor import ModelEditorclass
+from subcircuit.Subcircuit import Subcircuit
import os
dockList = ['Welcome']
@@ -153,9 +154,29 @@ class DockArea(QtGui.QMainWindow):
count = count + 1
+ def subcircuiteditor(self):
+ """
+ This function creates a widget for different subcircuit options
+ """
+ global count
+ self.subcktWidget=QtGui.QWidget()
+ self.subcktLayout=QtGui.QVBoxLayout()
+ self.subcktLayout.addWidget(Subcircuit())
+
+ self.subcktWidget.setLayout(self.subcktLayout)
+ dock['Subcircuit-'+str(count)] = QtGui.QDockWidget('Subcircuit-'+str(count))
+ dock['Subcircuit-'+str(count)].setWidget(self.subcktWidget)
+ self.addDockWidget(QtCore.Qt.TopDockWidgetArea, dock['Subcircuit-'+str(count)])
+ self.tabifyDockWidget(dock['Welcome'],dock['Subcircuit-'+str(count)])
+ """
+ #CSS
+ dock['Plotting-'+str(count)].setStyleSheet(" \
+ QWidget { border-radius: 15px; border: 1px solid gray; padding: 5px; width: 200px; height: 150px; } \
+ ")
+ """
+ dock['Subcircuit-'+str(count)].setVisible(True)
+ dock['Subcircuit-'+str(count)].setFocus()
+ dock['Subcircuit-'+str(count)].raise_()
-
-
-
- \ No newline at end of file
+ count = count + 1 \ No newline at end of file
diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py
index 96d00a08..035a8688 100644
--- a/src/frontEnd/Workspace.py
+++ b/src/frontEnd/Workspace.py
@@ -69,7 +69,7 @@ class Workspace(QtGui.QWidget):
self.setWindowTitle("eSim")
self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
self.note.setReadOnly(True)
- self.setWindowIcon(QtGui.QIcon('../images/logo.png'))
+ self.setWindowIcon(QtGui.QIcon('../../images/logo.png'))
self.setLayout(self.grid)
self.show()