summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSunil Shetye2019-06-24 10:29:39 +0530
committerGitHub2019-06-24 10:29:39 +0530
commita5effc6fcfb55751cd60a08f9774391ed34ba711 (patch)
tree7e15a2db5094747bcce4daf88b357eec4f803b85 /src
parentfd265d087ff6dc7a09df400b165043e61bb7d0c0 (diff)
parent2b4de1b9b56d436d156ee6259db95bf29d9373ab (diff)
downloadeSim-a5effc6fcfb55751cd60a08f9774391ed34ba711.tar.gz
eSim-a5effc6fcfb55751cd60a08f9774391ed34ba711.tar.bz2
eSim-a5effc6fcfb55751cd60a08f9774391ed34ba711.zip
Merge pull request #88 from anjalijaiswal08/documentation
Documentation
Diffstat (limited to 'src')
-rw-r--r--src/browser/UserManual.py3
-rw-r--r--src/browser/Welcome.py3
-rw-r--r--src/configuration/Appconfig.py5
-rwxr-xr-xsrc/frontEnd/Application.py102
-rw-r--r--src/frontEnd/DockArea.py40
-rw-r--r--src/frontEnd/ProjectExplorer.py26
-rw-r--r--src/frontEnd/Workspace.py11
-rw-r--r--src/subcircuit/Subcircuit.py7
-rw-r--r--src/subcircuit/convertSub.py10
-rw-r--r--src/subcircuit/newSub.py11
-rw-r--r--src/subcircuit/openSub.py2
11 files changed, 128 insertions, 92 deletions
diff --git a/src/browser/UserManual.py b/src/browser/UserManual.py
index 3bcfbace..6f09190b 100644
--- a/src/browser/UserManual.py
+++ b/src/browser/UserManual.py
@@ -4,7 +4,8 @@ import webbrowser
class UserManual(QtGui.QWidget):
"""
- This class creates Welcome page of eSim.
+ This class opens User-Manual page in new tab of web browser
+ when help button is clicked.
"""
def __init__(self):
diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py
index 2ae8fce1..f9f273df 100644
--- a/src/browser/Welcome.py
+++ b/src/browser/Welcome.py
@@ -2,10 +2,9 @@ from PyQt4 import QtGui, QtCore
class Welcome(QtGui.QWidget):
- """This class creates Welcome page of eSim."""
+ """This class contains content of dock area part of initial esim Window."""
def __init__(self):
- """Sdf."""
QtGui.QWidget.__init__(self)
self.vlayout = QtGui.QVBoxLayout()
diff --git a/src/configuration/Appconfig.py b/src/configuration/Appconfig.py
index 0b34e3fc..38a55595 100644
--- a/src/configuration/Appconfig.py
+++ b/src/configuration/Appconfig.py
@@ -27,6 +27,11 @@ class Appconfig(QtGui.QWidget):
"""
All configuration goes here.
May change in future for code optimization.
+
+ This class also contains function for
+ - Printing error.
+ - Showing warnings.
+ - Dispalying information.
"""
# Home directory
diff --git a/src/frontEnd/Application.py b/src/frontEnd/Application.py
index c2790a80..66fc2b91 100755
--- a/src/frontEnd/Application.py
+++ b/src/frontEnd/Application.py
@@ -39,7 +39,6 @@ class Application(QtGui.QMainWindow):
def __init__(self, *args):
"""Initialize main Application window."""
-
# Calling __init__ of super class
QtGui.QMainWindow.__init__(self, *args)
@@ -69,12 +68,11 @@ class Application(QtGui.QMainWindow):
def initToolBar(self):
"""
In this function we are setting icons, short-cuts,and
- defining functonality for:.
- a)Top-tool-bar (New project, Open project, Close
- project, Help option )
- b)Left-tool-bar (Open Schematic, Convert KiCad to
- NgSpice, Simuation, Model Editor, Subcircuit, NGHDL,
- Modelica Converter, OM Optimisation )
+ defining functonality for:
+
+ - Top-tool-bar (New project, Open project, Close project, Help option )
+ - Left-tool-bar (Open Schematic, Convert KiCad to NgSpice, Simuation,
+ Model Editor, Subcircuit, NGHDL, Modelica Converter, OM Optimisation )
"""
# Top Tool bar
self.newproj = QtGui.QAction(
@@ -199,16 +197,17 @@ class Application(QtGui.QMainWindow):
When exit button is pressed a Message box pops out with
exit message and buttons 'Yes', 'No'.
- 1. If 'Yes' is pressed:.
- a)it checks that program(process) in procThread_list
- (list made in Appconfig.py):
- a.1) if available it terminates that program
- a.2) if the program(process) is not available,
- it checks for it in process_obj (list made in
- Appconfig.py) if found it closes the program.
+ 1. If 'Yes' is pressed:
+ - it checks that program(process) in procThread_list (list made in
+ Appconfig.py):
+
+ - if available it terminates that program
+ - if the program(process) is not available, it checks for it
+ in process_obj (list made in Appconfig.py) if found it
+ closes the program.
- 2. If 'No' is pressed:
- a)the program just continues as it was doing earlier.
+ 2. If 'No' is pressed:
+ - the program just continues as it was doing earlier.
'''
exit_msg = "Are you sure you want to exit the program\
? All unsaved data will be lost."
@@ -246,11 +245,13 @@ class Application(QtGui.QMainWindow):
def close_project(self):
"""
This function first checks whether project(file) is present in list.
- a)If present:
- :-it first kills that process-id.
- :-closes that file.
- :-Shows message "Current project <path of file> is closed"
- b)If not present:- pass
+
+ - If present:
+ - it first kills that process-id.
+ - closes that file.
+ - Shows message "Current project <path of file> is closed"
+
+ - If not present: pass
"""
print("Function : Close Project")
current_project = self.obj_appconfig.current_project['ProjectName']
@@ -308,10 +309,10 @@ class Application(QtGui.QMainWindow):
# This page opens usermanual in dockarea.
def help_project(self):
"""
- 1)It prints the message ""Function : Help""
- 2)Uses print_info() method of class Appconfig
- form Configuration/Appconfig.py file.
- 3)Call method usermanual() from ./DockArea.py.
+ - It prints the message ""Function : Help""
+ - Uses print_info() method of class Appconfig
+ from Configuration/Appconfig.py file.
+ - Call method usermanual() from ./DockArea.py.
"""
print("Function : Help")
self.obj_appconfig.print_info('Help is called')
@@ -348,9 +349,10 @@ class Application(QtGui.QMainWindow):
"""
When 'subcircuit' icon is clicked wich is present in
left-tool-bar of main page:
- a) Meassge shown on screen "Subcircuit editor is called".
- b) 'subcircuiteditor()'' function is called using object
- 'obj_dockarea' of class 'Mainview'.
+
+ - Meassge shown on screen "Subcircuit editor is called".
+ - 'subcircuiteditor()' function is called using object
+ 'obj_dockarea' of class 'Mainview'.
"""
print("Function : Subcircuit editor")
self.obj_appconfig.print_info('Subcircuit editor is called')
@@ -361,10 +363,11 @@ class Application(QtGui.QMainWindow):
"""
This function uses validateTool() method from
Validation.py:
- a) If 'nghdl' is present in executables list then
- it adds passes command 'nghdl -e' to WorkerThread class of
- Worker.py.
- b) If 'nghdl' not present then it shows error message.
+
+ - If 'nghdl' is present in executables list then
+ it adds passes command 'nghdl -e' to WorkerThread class of
+ Worker.py.
+ - If 'nghdl' not present then it shows error message.
"""
print("Function : Nghdl")
self.obj_appconfig.print_info('Nghdl is called')
@@ -385,11 +388,12 @@ class Application(QtGui.QMainWindow):
# This function opens model editor option in left-tool-bar.
def open_modelEditor(self):
"""
- When model editor icon is clicked wich is present in
+ When model editor icon is clicked which is present in
left-tool-bar of main page:
- a) Meassge shown on screen "Model editor is called".
- b) 'modeleditor()'' function is called using object
- 'obj_dockarea' of class 'Mainview'.
+
+ - Meassge shown on screen "Model editor is called".
+ - 'modeleditor()' function is called using object
+ 'obj_dockarea' of class 'Mainview'.
"""
print("Function : Model editor")
self.obj_appconfig.print_info('Model editor is called')
@@ -475,11 +479,12 @@ class Application(QtGui.QMainWindow):
"""
This function uses validateTool() method from
Validation.py:
- a) If 'OMOptim' is present in executables list then
- it adds passes command 'OMOptim' to WorkerThread class of
- Worker.py.
- b) If 'OMOptim' not present then it shows error message with
- link to download it on Linux and Windows.
+
+ - If 'OMOptim' is present in executables list then
+ it adds passes command 'OMOptim' to WorkerThread class of
+ Worker.py.
+ - If 'OMOptim' not present then it shows error message with
+ link to download it on Linux and Windows.
"""
print("Function : OM Optim")
self.obj_appconfig.print_info('OM Optim is called')
@@ -510,12 +515,15 @@ class Application(QtGui.QMainWindow):
class MainView(QtGui.QWidget):
"""
This class defines whole view and style of main page:
- a)Position of tool bars:
- :-Top tool bar.
- :-Left tool bar.
- b) Project explorer Area.
- c) Dock area.
- d)Console area.
+
+ - Position of tool bars:
+
+ - Top tool bar.
+ - Left tool bar.
+
+ - Project explorer Area.
+ - Dock area.
+ - Console area.
"""
diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py
index 8b8e975b..99270366 100644
--- a/src/frontEnd/DockArea.py
+++ b/src/frontEnd/DockArea.py
@@ -17,10 +17,21 @@ dock = {}
#
class DockArea(QtGui.QMainWindow):
- """Sdf."""
+ """
+ This class contains function for designing UI of all the editors
+ in dock area part:
+
+ - Test Editor.
+ - Model Editor.
+ - Python Plotting.
+ - NgSpice Editor.
+ - Kicad to NgSpice Editor.
+ - Subcircuit Editor.
+ - Modelica editor.
+ """
def __init__(self):
- """Sdf."""
+ """This act as constructor for class DockArea."""
QtGui.QMainWindow.__init__(self)
self.obj_appconfig = Appconfig()
@@ -43,9 +54,8 @@ class DockArea(QtGui.QMainWindow):
# self.tabifyDockWidget(dock['Notes'],dock['Blank'])
self.show()
- # This function create widget for Library Editor
def createTestEditor(self):
- """Sdf."""
+ """This function create widget for Library Editor."""
global count
self.testWidget = QtGui.QWidget()
self.testArea = QtGui.QTextEdit()
@@ -71,9 +81,8 @@ class DockArea(QtGui.QMainWindow):
dock['Tips-' + str(count)])
count = count + 1
- # This function create widget for interactive PythonPlotting
def plottingEditor(self):
- """Sdf."""
+ """This function create widget for interactive PythonPlotting"""
self.projDir = self.obj_appconfig.current_project["ProjectName"]
self.projName = os.path.basename(self.projDir)
# self.project = os.path.join(self.projDir,self.projName)
@@ -102,7 +111,6 @@ class DockArea(QtGui.QMainWindow):
dock['Plotting-' + str(count)])
count = count + 1
- # This function creates widget for NgSpice window.
def ngspiceEditor(self, projDir):
"""Sdf."""
self.projDir = projDir
@@ -142,9 +150,8 @@ class DockArea(QtGui.QMainWindow):
dock['NgSpice-' + str(count)])
count = count + 1
- # This function defines UI for model editor.
def modelEditor(self):
- """Sdf."""
+ """This function defines UI for model editor."""
print("in model editor")
global count
self.modelwidget = QtGui.QWidget()
@@ -178,9 +185,8 @@ class DockArea(QtGui.QMainWindow):
dock['Model Editor-' + str(count)])
count = count + 1
- # This function is creating Editor UI for Kicad to Ngspice conversion.
def kicadToNgspiceEditor(self, clarg1, clarg2=None):
- """Sdf."""
+ """This function is creating Editor UI for Kicad to Ngspice conversion."""
global count
self.kicadToNgspiceWidget = QtGui.QWidget()
self.kicadToNgspiceLayout = QtGui.QVBoxLayout()
@@ -211,9 +217,8 @@ class DockArea(QtGui.QMainWindow):
dock['kicadToNgspice-' + str(count)])
count = count + 1
- # This function creates a widget for different subcircuit options.
def subcircuiteditor(self):
- """Sdf."""
+ """This function creates a widget for different subcircuit options."""
global count
self.subcktWidget = QtGui.QWidget()
self.subcktLayout = QtGui.QVBoxLayout()
@@ -243,9 +248,7 @@ class DockArea(QtGui.QMainWindow):
dock['Subcircuit-' + str(count)])
count = count + 1
- # This function creates a widget for different subcircuit options.
def usermanual(self):
- """Sdf."""
global count
self.usermanualWidget = QtGui.QWidget()
self.usermanualLayout = QtGui.QVBoxLayout()
@@ -272,7 +275,6 @@ class DockArea(QtGui.QMainWindow):
count = count + 1
- # This function sets up the UI for ngspice to modelica conversion.
def modelicaEditor(self, projDir):
"""Dfg."""
global count
@@ -303,9 +305,11 @@ class DockArea(QtGui.QMainWindow):
count = count + 1
- # This function when called closes the opened file.
def closeDock(self):
- """Sdf."""
+ """
+ This function checks for the project in **dock_dict**
+ and closes it.
+ """
self.temp = self.obj_appconfig.current_project['ProjectName']
for dockwidget in self.obj_appconfig.dock_dict[self.temp]:
dockwidget.close()
diff --git a/src/frontEnd/ProjectExplorer.py b/src/frontEnd/ProjectExplorer.py
index 8d0ef4ec..e1e3ddad 100644
--- a/src/frontEnd/ProjectExplorer.py
+++ b/src/frontEnd/ProjectExplorer.py
@@ -8,19 +8,20 @@ from configuration.Appconfig import Appconfig
class ProjectExplorer(QtGui.QWidget):
"""
This class contains function:
- a)One work as a constructor(__init__).
- b)For saving data.
- c)for renaming project.
- d)for refreshing project.
- e)for removing project.
- f) for saving data.
+
+ - One work as a constructor(__init__).
+ - For saving data.
+ - for renaming project.
+ - for refreshing project.
+ - for removing project.
+ - for saving data.
"""
def __init__(self):
"""
This method is doing following tasks:
- a)Working as a constructor for class ProjectExplorer.
- b)view of project explorer area.
+ - Working as a constructor for class ProjectExplorer.
+ - view of project explorer area.
"""
QtGui.QWidget.__init__(self)
self.obj_appconfig = Appconfig()
@@ -55,7 +56,7 @@ class ProjectExplorer(QtGui.QWidget):
pathlist = parents.split(os.sep)
parentnode = QtGui.QTreeWidgetItem(
self.treewidget, [pathlist[-1], parents]
- )
+ )
for files in children:
QtGui.QTreeWidgetItem(
parentnode, [files, os.path.join(parents, files)])
@@ -172,7 +173,7 @@ class ProjectExplorer(QtGui.QWidget):
def save_data(self):
"""
This function first opens file in write-mode, when write
- operation is performed it closes that file and then window.
+ operation is performed it closes that file and then it closes window.
"""
self.fopen = open(self.filePath, 'w')
self.fopen.write(self.text.toPlainText())
@@ -225,8 +226,7 @@ class ProjectExplorer(QtGui.QWidget):
json.dump(self.obj_appconfig.project_explorer,
open(self.obj_appconfig.dictPath, 'w'))
- # """
- def renameProject(self):
+ '''def renameProject(self):
indexItem = self.treewidget.currentIndex()
baseFileName = str(indexItem.data())
newBaseFileName, ok = QtGui.QInputDialog.getText(
@@ -273,4 +273,4 @@ class ProjectExplorer(QtGui.QWidget):
self.obj_appconfig.project_explorer.items()
):
self.addTreeNode(parent, children)
- # """
+ '''
diff --git a/src/frontEnd/Workspace.py b/src/frontEnd/Workspace.py
index 30d0607b..55a8c95e 100644
--- a/src/frontEnd/Workspace.py
+++ b/src/frontEnd/Workspace.py
@@ -20,11 +20,18 @@ from configuration.Appconfig import Appconfig
import time
import os
-# This class creates Workspace GUI.
-
+# This class creates Workspace GUI.
class Workspace(QtGui.QWidget):
"""
+ This class creates UI for WorkSpace selection window.
+
+ This window contains text area to select location of your choice
+ or browse location for workspace area.
+
+ By default workspace is set in ~/eSim-Workspace.
+
+ This workspace area contains all the projects made by user.
"""
diff --git a/src/subcircuit/Subcircuit.py b/src/subcircuit/Subcircuit.py
index 39c0fe77..d2e7ec5a 100644
--- a/src/subcircuit/Subcircuit.py
+++ b/src/subcircuit/Subcircuit.py
@@ -10,7 +10,12 @@ from subcircuit.convertSub import convertSub
class Subcircuit(QtGui.QWidget):
"""
Creates buttons for New project, Edit existing project and
- Kicad Netlist to Ngspice Netlist converter.
+ Kicad Netlist to Ngspice Netlist converter and link them with the
+ methods defined for it in other files.
+
+ - New Project(NewSub method of newSub).
+ - Open Project(openSub method of openSub).
+ - Kicad to Ngspice convertor(convertSub of convertSub).
"""
def __init__(self, parent=None):
diff --git a/src/subcircuit/convertSub.py b/src/subcircuit/convertSub.py
index cce27476..49f5a54f 100644
--- a/src/subcircuit/convertSub.py
+++ b/src/subcircuit/convertSub.py
@@ -9,7 +9,7 @@ import os
class convertSub(QtGui.QWidget):
"""
Contains functions that checks project present for conversion and
- also function to convert Kicad to Ngspice.
+ also function to convert Kicad Netlist to Ngspice Netlist.
"""
def __init__(self, dockarea):
@@ -20,7 +20,13 @@ class convertSub(QtGui.QWidget):
def createSub(self):
"""
- This function create command to call kicad to Ngspice converter.
+ This function create command to call KiCad to Ngspice converter.
+ If the netlist is not generated for selected project it will show
+ error **The subcircuit does not contain any Kicad netlist file for
+ conversion.**
+ And if no project is selected for conversion, it again show error
+ message to select a file or create a file.
+
"""
print("Openinig Kicad-to-Ngspice converter from Subcircuit Module")
self.projDir = self.obj_appconfig.current_subcircuit["SubcircuitName"]
diff --git a/src/subcircuit/newSub.py b/src/subcircuit/newSub.py
index 6b221b4c..678b023d 100644
--- a/src/subcircuit/newSub.py
+++ b/src/subcircuit/newSub.py
@@ -8,10 +8,7 @@ import os
# This class is called when User create new Project.
class NewSub(QtGui.QWidget):
"""
- Contains funstions to check :
- - Name of project should not be blank.
- - Name should not contain space between them.
- - Name does not match with existing project.
+ Contains functions to create directory and validate file names.
"""
def __init__(self):
@@ -21,7 +18,11 @@ class NewSub(QtGui.QWidget):
def createSubcircuit(self, subName):
"""
- This function create Subcircuit related directories and files
+ - This function create workspace for subcircuit.
+ - It also validate file names for Subcircuits:
+ - File name should not contain space.
+ - Name can not be empty.
+ - File name already exists.
"""
self.create_schematic = subName
# Checking if Workspace already exist or not
diff --git a/src/subcircuit/openSub.py b/src/subcircuit/openSub.py
index 4c1394eb..bebd28a1 100644
--- a/src/subcircuit/openSub.py
+++ b/src/subcircuit/openSub.py
@@ -8,7 +8,7 @@ import os
class openSub(QtGui.QWidget):
"""
It opens the existing subcircuit projects that are present in
- Subcircuit Library.
+ Subcircuit directory.
"""
def __init__(self):