summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--code/browser.rst9
-rw-r--r--code/browser/UserManual.rst6
-rw-r--r--code/browser/Welcome.rst5
-rw-r--r--code/frontEnd.rst12
-rw-r--r--code/frontEnd/Application.rst5
-rw-r--r--code/frontEnd/DockArea.rst5
-rw-r--r--code/frontEnd/ProjectExplorer.rst5
-rw-r--r--code/frontEnd/Workspace.rst5
-rw-r--r--code/kicadtoNgspice.rst17
-rw-r--r--code/kicadtoNgspice/Analysis.rst5
-rw-r--r--code/kicadtoNgspice/Convert.rst5
-rw-r--r--code/kicadtoNgspice/DeviceModel.rst5
-rw-r--r--code/kicadtoNgspice/KicadtoNgspice.rst5
-rw-r--r--code/kicadtoNgspice/Model.rst5
-rw-r--r--code/kicadtoNgspice/Processing.rst5
-rw-r--r--code/kicadtoNgspice/Source.rst5
-rw-r--r--code/kicadtoNgspice/SubcircuitTab.rst6
-rw-r--r--code/kicadtoNgspice/TrackWidget.rst5
-rw-r--r--code/modelEditor.rst8
-rw-r--r--code/modelEditor/modelEditor.rst6
-rw-r--r--code/ngspiceSimulation.rst10
-rw-r--r--code/ngspiceSimulation/NgspiceWidget.rst5
-rw-r--r--code/ngspiceSimulation/pythonPlotting.rst5
-rw-r--r--code/projectManagement.rst14
-rw-r--r--code/projectManagement/Kicad.rst6
-rw-r--r--code/projectManagement/Validation.rst6
-rw-r--r--code/projectManagement/Worker.rst6
-rw-r--r--code/projectManagement/newProject.rst6
-rw-r--r--code/projectManagement/openProject.rst6
-rw-r--r--code/subcircuit.rst9
-rw-r--r--code/subcircuit/Subcircuit.rst6
-rw-r--r--code/subcircuit/convertSub.rst5
-rw-r--r--code/subcircuit/newSub.rst5
-rw-r--r--code/subcircuit/openSub.rst6
-rw-r--r--conf.py177
-rw-r--r--index.rst46
-rw-r--r--setup.py19
-rw-r--r--src/kicadtoNgspice/Analysis.py47
-rw-r--r--src/kicadtoNgspice/Convert.py20
-rw-r--r--src/kicadtoNgspice/DeviceModel.py2
-rw-r--r--src/kicadtoNgspice/KicadtoNgspice.py1
-rw-r--r--src/kicadtoNgspice/Model.py4
-rw-r--r--src/kicadtoNgspice/Processing.py6
-rw-r--r--src/kicadtoNgspice/Source.py21
-rw-r--r--src/modelEditor/ModelEditor.py267
-rw-r--r--src/projManagement/Kicad.py47
-rw-r--r--src/projManagement/Validation.py118
-rw-r--r--src/projManagement/Worker.py72
-rw-r--r--src/projManagement/newProject.py35
-rw-r--r--src/projManagement/openProject.py25
50 files changed, 813 insertions, 318 deletions
diff --git a/code/browser.rst b/code/browser.rst
new file mode 100644
index 00000000..da2c0981
--- /dev/null
+++ b/code/browser.rst
@@ -0,0 +1,9 @@
+Browser Component
+=================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ browser/UserManual
+ browser/Welcome
diff --git a/code/browser/UserManual.rst b/code/browser/UserManual.rst
new file mode 100644
index 00000000..2595bfe6
--- /dev/null
+++ b/code/browser/UserManual.rst
@@ -0,0 +1,6 @@
+User Manual Component
+=====================
+
+.. automodule:: browser.UserManual
+ :members:
+
diff --git a/code/browser/Welcome.rst b/code/browser/Welcome.rst
new file mode 100644
index 00000000..e2af55d4
--- /dev/null
+++ b/code/browser/Welcome.rst
@@ -0,0 +1,5 @@
+Welcome Component
+=================
+
+.. automodule:: browser.Welcome
+ :members:
diff --git a/code/frontEnd.rst b/code/frontEnd.rst
new file mode 100644
index 00000000..69cfb06f
--- /dev/null
+++ b/code/frontEnd.rst
@@ -0,0 +1,12 @@
+Front-End Component
+===================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ frontEnd/Application
+ frontEnd/DockArea
+ frontEnd/ProjectExplorer
+ frontEnd/Workspace
+
diff --git a/code/frontEnd/Application.rst b/code/frontEnd/Application.rst
new file mode 100644
index 00000000..4eb41d17
--- /dev/null
+++ b/code/frontEnd/Application.rst
@@ -0,0 +1,5 @@
+Application Component
+=====================
+
+.. automodule:: frontEnd.Application
+ :members:
diff --git a/code/frontEnd/DockArea.rst b/code/frontEnd/DockArea.rst
new file mode 100644
index 00000000..31fdd742
--- /dev/null
+++ b/code/frontEnd/DockArea.rst
@@ -0,0 +1,5 @@
+Dock Area Component
+===================
+
+.. automodule:: frontEnd.DockArea
+ :members:
diff --git a/code/frontEnd/ProjectExplorer.rst b/code/frontEnd/ProjectExplorer.rst
new file mode 100644
index 00000000..33dec0c0
--- /dev/null
+++ b/code/frontEnd/ProjectExplorer.rst
@@ -0,0 +1,5 @@
+Project Explorer Component
+==========================
+
+.. automodule:: frontEnd.ProjectExplorer
+ :members:
diff --git a/code/frontEnd/Workspace.rst b/code/frontEnd/Workspace.rst
new file mode 100644
index 00000000..8722c745
--- /dev/null
+++ b/code/frontEnd/Workspace.rst
@@ -0,0 +1,5 @@
+Workspace Component
+===================
+
+.. automodule:: frontEnd.Workspace
+ :members:
diff --git a/code/kicadtoNgspice.rst b/code/kicadtoNgspice.rst
new file mode 100644
index 00000000..f5cdab7f
--- /dev/null
+++ b/code/kicadtoNgspice.rst
@@ -0,0 +1,17 @@
+kicadtoNgspice Component
+========================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ kicadtoNgspice/Analysis
+ kicadtoNgspice/Convert
+ kicadtoNgspice/DeviceModel
+ kicadtoNgspice/KicadtoNgspice
+ kicadtoNgspice/Model
+ kicadtoNgspice/Processing
+ kicadtoNgspice/Source
+ kicadtoNgspice/SubcircuitTab
+ kicadtoNgspice/TrackWidget
+
diff --git a/code/kicadtoNgspice/Analysis.rst b/code/kicadtoNgspice/Analysis.rst
new file mode 100644
index 00000000..4c41a8d9
--- /dev/null
+++ b/code/kicadtoNgspice/Analysis.rst
@@ -0,0 +1,5 @@
+Analysis Component
+==================
+
+.. automodule:: kicadtoNgspice.Analysis
+ :members:
diff --git a/code/kicadtoNgspice/Convert.rst b/code/kicadtoNgspice/Convert.rst
new file mode 100644
index 00000000..0ed795a6
--- /dev/null
+++ b/code/kicadtoNgspice/Convert.rst
@@ -0,0 +1,5 @@
+Convert Component
+=================
+
+.. automodule:: kicadtoNgspice.Convert
+ :members:
diff --git a/code/kicadtoNgspice/DeviceModel.rst b/code/kicadtoNgspice/DeviceModel.rst
new file mode 100644
index 00000000..b59c3ee2
--- /dev/null
+++ b/code/kicadtoNgspice/DeviceModel.rst
@@ -0,0 +1,5 @@
+Device Model Component
+======================
+
+.. automodule:: kicadtoNgspice.DeviceModel
+ :members:
diff --git a/code/kicadtoNgspice/KicadtoNgspice.rst b/code/kicadtoNgspice/KicadtoNgspice.rst
new file mode 100644
index 00000000..23115483
--- /dev/null
+++ b/code/kicadtoNgspice/KicadtoNgspice.rst
@@ -0,0 +1,5 @@
+KicadtoNgspice component
+========================
+
+.. automodule:: kicadtoNgspice.KicadtoNgspice
+ :members:
diff --git a/code/kicadtoNgspice/Model.rst b/code/kicadtoNgspice/Model.rst
new file mode 100644
index 00000000..122c7d21
--- /dev/null
+++ b/code/kicadtoNgspice/Model.rst
@@ -0,0 +1,5 @@
+Model Component
+===============
+
+.. automodule:: kicadtoNgspice.Model
+ :members:
diff --git a/code/kicadtoNgspice/Processing.rst b/code/kicadtoNgspice/Processing.rst
new file mode 100644
index 00000000..1c6fc092
--- /dev/null
+++ b/code/kicadtoNgspice/Processing.rst
@@ -0,0 +1,5 @@
+Processing Component
+====================
+
+.. automodule:: kicadtoNgspice.Processing
+ :members:
diff --git a/code/kicadtoNgspice/Source.rst b/code/kicadtoNgspice/Source.rst
new file mode 100644
index 00000000..875c5ff8
--- /dev/null
+++ b/code/kicadtoNgspice/Source.rst
@@ -0,0 +1,5 @@
+Source Component
+================
+
+.. automodule:: kicadtoNgspice.Source
+ :members:
diff --git a/code/kicadtoNgspice/SubcircuitTab.rst b/code/kicadtoNgspice/SubcircuitTab.rst
new file mode 100644
index 00000000..eb301dcb
--- /dev/null
+++ b/code/kicadtoNgspice/SubcircuitTab.rst
@@ -0,0 +1,6 @@
+Subcircuit Tab component
+========================
+
+
+.. automodule:: kicadtoNgspice.SubcircuitTab
+ :members:
diff --git a/code/kicadtoNgspice/TrackWidget.rst b/code/kicadtoNgspice/TrackWidget.rst
new file mode 100644
index 00000000..78f1a2c4
--- /dev/null
+++ b/code/kicadtoNgspice/TrackWidget.rst
@@ -0,0 +1,5 @@
+Track Widget Component
+======================
+
+.. automodule:: kicadtoNgspice.TrackWidget
+ :members:
diff --git a/code/modelEditor.rst b/code/modelEditor.rst
new file mode 100644
index 00000000..2f8fc77e
--- /dev/null
+++ b/code/modelEditor.rst
@@ -0,0 +1,8 @@
+Model Editor Component
+========================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ modelEditor/modelEditor
diff --git a/code/modelEditor/modelEditor.rst b/code/modelEditor/modelEditor.rst
new file mode 100644
index 00000000..61aa5300
--- /dev/null
+++ b/code/modelEditor/modelEditor.rst
@@ -0,0 +1,6 @@
+Model Editor Component
+========================
+
+.. automodule:: modelEditor.ModelEditor
+ :members:
+ \ No newline at end of file
diff --git a/code/ngspiceSimulation.rst b/code/ngspiceSimulation.rst
new file mode 100644
index 00000000..af1e4e75
--- /dev/null
+++ b/code/ngspiceSimulation.rst
@@ -0,0 +1,10 @@
+ngspiceSimulation component
+===========================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ ngspiceSimulation/NgspiceWidget
+ ngspiceSimulation/pythonPlotting
+
diff --git a/code/ngspiceSimulation/NgspiceWidget.rst b/code/ngspiceSimulation/NgspiceWidget.rst
new file mode 100644
index 00000000..753d3528
--- /dev/null
+++ b/code/ngspiceSimulation/NgspiceWidget.rst
@@ -0,0 +1,5 @@
+Ngspice Widget Component
+========================
+
+.. automodule:: ngspiceSimulation.NgspiceWidget
+ :members:
diff --git a/code/ngspiceSimulation/pythonPlotting.rst b/code/ngspiceSimulation/pythonPlotting.rst
new file mode 100644
index 00000000..bfb9a3b6
--- /dev/null
+++ b/code/ngspiceSimulation/pythonPlotting.rst
@@ -0,0 +1,5 @@
+Python Plotting component
+=========================
+
+.. automodule:: ngspiceSimulation.pythonPlotting
+ :members:
diff --git a/code/projectManagement.rst b/code/projectManagement.rst
new file mode 100644
index 00000000..1122fc91
--- /dev/null
+++ b/code/projectManagement.rst
@@ -0,0 +1,14 @@
+Project Management Component
+============================
+
+.. toctree::
+ :maxdepth: 2
+ :caption: Contents:
+
+ projectManagement/Kicad
+ projectManagement/Validation
+ projectManagement/Worker
+ projectManagement/openProject
+ projectManagement/newProject
+
+
diff --git a/code/projectManagement/Kicad.rst b/code/projectManagement/Kicad.rst
new file mode 100644
index 00000000..0b2dd07d
--- /dev/null
+++ b/code/projectManagement/Kicad.rst
@@ -0,0 +1,6 @@
+Open Kicad Schematic Button
+===========================
+
+.. automodule:: projManagement.Kicad
+ :members:
+
diff --git a/code/projectManagement/Validation.rst b/code/projectManagement/Validation.rst
new file mode 100644
index 00000000..24486fa9
--- /dev/null
+++ b/code/projectManagement/Validation.rst
@@ -0,0 +1,6 @@
+Validation Helper Function
+===========================
+
+.. automodule:: projManagement.Validation
+ :members:
+
diff --git a/code/projectManagement/Worker.rst b/code/projectManagement/Worker.rst
new file mode 100644
index 00000000..c3c5cc6b
--- /dev/null
+++ b/code/projectManagement/Worker.rst
@@ -0,0 +1,6 @@
+Helper Worker Function
+===========================
+
+.. automodule:: projManagement.Worker
+ :members:
+
diff --git a/code/projectManagement/newProject.rst b/code/projectManagement/newProject.rst
new file mode 100644
index 00000000..9d3e5632
--- /dev/null
+++ b/code/projectManagement/newProject.rst
@@ -0,0 +1,6 @@
+New Project Function
+===========================
+
+.. automodule:: projManagement.newProject
+ :members:
+
diff --git a/code/projectManagement/openProject.rst b/code/projectManagement/openProject.rst
new file mode 100644
index 00000000..2a11cd72
--- /dev/null
+++ b/code/projectManagement/openProject.rst
@@ -0,0 +1,6 @@
+Open Project Button
+===========================
+
+.. automodule:: projManagement.openProject
+ :members:
+
diff --git a/code/subcircuit.rst b/code/subcircuit.rst
new file mode 100644
index 00000000..ad792b42
--- /dev/null
+++ b/code/subcircuit.rst
@@ -0,0 +1,9 @@
+Subcircuit component
+====================
+
+.. toctree::
+ subcircuit/convertSub
+ subcircuit/newSub
+ subcircuit/openSub
+ subcircuit/Subcircuit
+
diff --git a/code/subcircuit/Subcircuit.rst b/code/subcircuit/Subcircuit.rst
new file mode 100644
index 00000000..ded745d9
--- /dev/null
+++ b/code/subcircuit/Subcircuit.rst
@@ -0,0 +1,6 @@
+Subcircuit component
+====================
+
+.. automodule:: subcircuit.Subcircuit
+ :members:
+
diff --git a/code/subcircuit/convertSub.rst b/code/subcircuit/convertSub.rst
new file mode 100644
index 00000000..0807ca70
--- /dev/null
+++ b/code/subcircuit/convertSub.rst
@@ -0,0 +1,5 @@
+Convert Subcircuit component
+============================
+
+.. automodule:: subcircuit.convertSub
+ :members:
diff --git a/code/subcircuit/newSub.rst b/code/subcircuit/newSub.rst
new file mode 100644
index 00000000..512d6887
--- /dev/null
+++ b/code/subcircuit/newSub.rst
@@ -0,0 +1,5 @@
+New subcircuit component
+========================
+
+.. automodule:: subcircuit.newSub
+ :members:
diff --git a/code/subcircuit/openSub.rst b/code/subcircuit/openSub.rst
new file mode 100644
index 00000000..ffb1722b
--- /dev/null
+++ b/code/subcircuit/openSub.rst
@@ -0,0 +1,6 @@
+Open subcircuit component
+=========================
+
+.. automodule:: subcircuit.openSub
+ :members:
+
diff --git a/conf.py b/conf.py
new file mode 100644
index 00000000..b137e472
--- /dev/null
+++ b/conf.py
@@ -0,0 +1,177 @@
+# -*- coding: utf-8 -*-
+#
+# Configuration file for the Sphinx documentation builder.
+#
+# This file does only contain a selection of the most common options. For a
+# full list see the documentation:
+# http://www.sphinx-doc.org/en/master/config
+
+# -- Path setup --------------------------------------------------------------
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+import os
+import sys
+sys.path.insert(0, os.path.abspath('./src'))
+
+# added so that do not need to install them at runtime
+autodoc_mock_imports = ["PyQt4","pathmagic","matplotlib","numpy"]
+# -- Project information -----------------------------------------------------
+
+project = u'eSim'
+copyright = u'2019, Fossee'
+author = u'Fossee'
+
+# The short X.Y version
+version = u''
+# The full version, including alpha/beta/rc tags
+release = u'1.1.2'
+
+
+# -- General configuration ---------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = [
+ 'sphinx.ext.autodoc',
+]
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This pattern also affects html_static_path and html_extra_path.
+exclude_patterns = [u'_build', 'Thumbs.db', '.DS_Store']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = None
+
+
+# -- Options for HTML output -------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+html_theme = "default"
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#
+# html_theme_options = {}
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+# Custom sidebar templates, must be a dictionary that maps document names
+# to template names.
+#
+# The default sidebars (for documents that don't match any pattern) are
+# defined by theme itself. Builtin themes are using these templates by
+# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
+# 'searchbox.html']``.
+#
+# html_sidebars = {}
+
+
+# -- Options for HTMLHelp output ---------------------------------------------
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'eSimdoc'
+
+
+# -- Options for LaTeX output ------------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ #
+ # 'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ #
+ # 'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ #
+ # 'preamble': '',
+
+ # Latex figure (float) alignment
+ #
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'eSim.tex', u'eSim Documentation',
+ u'Fossee', 'manual'),
+]
+
+
+# -- Options for manual page output ------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (master_doc, 'esim', u'eSim Documentation',
+ [author], 1)
+]
+
+
+# -- Options for Texinfo output ----------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'eSim', u'eSim Documentation',
+ author, 'eSim', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+
+# -- Options for Epub output -------------------------------------------------
+
+# Bibliographic Dublin Core info.
+epub_title = project
+
+# The unique identifier of the text. This can be a ISBN number
+# or the project homepage.
+#
+# epub_identifier = ''
+
+# A unique identification for the text.
+#
+# epub_uid = ''
+
+# A list of files that should not be packed into the epub file.
+epub_exclude_files = ['search.html']
+
+
+# -- Extension configuration -------------------------------------------------
diff --git a/index.rst b/index.rst
new file mode 100644
index 00000000..342d4aff
--- /dev/null
+++ b/index.rst
@@ -0,0 +1,46 @@
+.. eSim documentation master file, created by
+ sphinx-quickstart on Mon Jun 10 19:26:41 2019.
+ You can adapt this file completely to your liking, but it should at least
+ contain the root `toctree` directive.
+
+Welcome to eSim's documentation!
+================================
+
+.. image:: ./images/ki-ng.png
+ :width: 100px
+ :target: https://esim.readthedocs.io/en/latest/code/kicadtoNgspice.html
+
+.. image:: ./images/kicad.png
+ :width: 100px
+ :target: https://esim.readthedocs.io/en/latest/code/projectManagement/Kicad.html
+
+.. image:: ./images/model.png
+ :width: 100px
+ :target: https://esim.readthedocs.io/en/latest/code/modelEditor.html
+
+.. image:: ./images/ngspice.png
+ :width: 100px
+ :target: https://esim.readthedocs.io/en/latest/code/ngspiceSimulation.html
+
+.. image:: ./images/subckt.png
+ :width: 100px
+ :target: https://esim.readthedocs.io/en/latest/code/subcircuit.html
+
+.. toctree::
+ :maxdepth: 3
+ :caption: Contents:
+
+ code/browser
+ code/frontEnd
+ code/kicadtoNgspice
+ code/ngspiceSimulation
+ code/projectManagement
+ code/modelEditor
+ code/subcircuit
+
+Indices and tables
+==================
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/setup.py b/setup.py
new file mode 100644
index 00000000..7a504733
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,19 @@
+from setuptools import setup, find_namespace_packages, Command # Always prefer setuptools over distutils
+
+'''
+Created for packaging and distributing of python projects
+Makes it easier to get an overview of the project and dependencies
+Also needed for `Read the docs` iinstallation and creating autodocs
+Needed to define the module structure, look up `Modules` for python
+'''
+setup(
+ name='eSim',
+ version='1.1.3',
+ author='Fossee',
+ author_email='info@fossee.in',
+ package_dir={'': 'src'},
+ packages=find_namespace_packages(where='src'),
+ license='LICENSE',
+ description='Useful circuit simulation library',
+ long_description=open('README.md').read(),
+) \ No newline at end of file
diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py
index c5981f4d..eaa46390 100644
--- a/src/kicadtoNgspice/Analysis.py
+++ b/src/kicadtoNgspice/Analysis.py
@@ -8,17 +8,22 @@ import json
class Analysis(QtGui.QWidget):
"""
- - This class create Analysis Tab in KicadtoNgspice Window.
- - Set various track widget options here
- - AC_entry_var
- - AC_Parameter
- - DC_entry_var
- - DC_Parameter
- - TRAN_entry_var
- - TRAN_Parameter
- - set_Checkbox
- - AC_type
- - op_check
+ - This class create Analysis Tab in KicadtoNgspice Window. 4 sections -
+ - - Select Analysis Type
+ - - AC Analysis
+ - - DC Analysis
+ - - Transient Analysis
+ - Set various track widget options here, for tracking purposes across\
+ different functions and modules -
+ - - AC_entry_var
+ - - AC_Parameter
+ - - DC_entry_var
+ - - DC_Parameter
+ - - TRAN_entry_var
+ - - TRAN_Parameter
+ - - set_Checkbox
+ - - AC_type
+ - - op_check
"""
def __init__(self, clarg1):
@@ -39,10 +44,11 @@ class Analysis(QtGui.QWidget):
"""
- Create the main anaylsis widget overwiew
- - Checkbox for analysis type
- - - Respective analysis type group, AC, DC, TRAN...
+ - - Place, `AC`, `DC` and `TRANSIENT` analysis tab
+ - - `self.acbox`, `self.dcbox`,`self.trbox`...
- Check for `analysis` file, if any in projDir, extract data from it
- Else set the default checkbox to `TRAN`
- - Accordingly set state for track widget options
+ - Accordingly set state for track widget options, as `TRAN`, `AC` ...
"""
self.grid = QtGui.QGridLayout()
self.grid.addWidget(self.createCheckBox(), 0, 0)
@@ -138,7 +144,7 @@ class Analysis(QtGui.QWidget):
def enableBox(self):
"""
- - Activate deactive analysis areas according to type
+ - Activate analysis areas according to checkBox marked
- Add analysis data to track_obj from TrackWidget
"""
if self.checkAC.isChecked():
@@ -336,7 +342,7 @@ class Analysis(QtGui.QWidget):
self.ac_parameter[1] = str(text)
def set_ac_type(self):
- """S
+ """
- Set track object for AC, according to the type of radio box selected
"""
self.parameter_cnt = 0
@@ -634,21 +640,27 @@ class Analysis(QtGui.QWidget):
# Below 6 functions to handle combo boxes for the DC group
def start_changecombo(self, text):
+ """Handle start combo box, ie. units, as mV, V..."""
self.dc_parameter[0] = str(text)
def increment_changecombo(self, text):
+ """Handle increment combo box, ie. units, as mV, V..."""
self.dc_parameter[1] = str(text)
def stop_changecombo(self, text):
+ """Handle stop combo box, ie. units, as mV, V..."""
self.dc_parameter[2] = str(text)
def start_changecombo2(self, text):
+ """Handle second start combo box, ie. units, as mV, V..."""
self.dc_parameter[3] = str(text)
def increment_changecombo2(self, text):
+ """Handle second increment combo box, ie. units, as mV, V..."""
self.dc_parameter[4] = str(text)
def stop_changecombo2(self, text):
+ """Handle second stop combo box, ie. units, as mV, V..."""
self.dc_parameter[5] = str(text)
def setflag(self):
@@ -668,7 +680,7 @@ class Analysis(QtGui.QWidget):
- - Step time
- - Stop time
- Input boxes for values, combo boxes for unit
- - Accordingly also event handleres for combo boxes, creates 3 functions
+ - Accordingly also event handlers for combo boxes, creates 3 functions
"""
kicadFile = self.clarg1
(projpath, filename) = os.path.split(kicadFile)
@@ -803,10 +815,13 @@ class Analysis(QtGui.QWidget):
'''
def start_combo_change(self, text):
+ """Handle start combo box, ie. units, as second, ms"""
self.tran_parameter[0] = str(text)
def step_combo_change(self, text):
+ """Handle step combo box, ie. units, as second, ms..."""
self.tran_parameter[1] = str(text)
def stop_combo_change(self, text):
+ """Handle stop combo box, ie. units, as second, ms..."""
self.tran_parameter[2] = str(text)
diff --git a/src/kicadtoNgspice/Convert.py b/src/kicadtoNgspice/Convert.py
index 8280f9e7..883ba534 100644
--- a/src/kicadtoNgspice/Convert.py
+++ b/src/kicadtoNgspice/Convert.py
@@ -8,8 +8,16 @@ from xml.etree import ElementTree as ET
class Convert:
"""
- - This class has all the necessary function required to convert
+ - This class has all the necessary function required to convert \
kicad netlist to ngspice netlist.
+ - Method List
+ - - addDeviceLibrary
+ - - addModelParameter
+ - - addSourceParameter
+ - - addSubcircuit
+ - - analysisInsertor
+ - - converttosciform
+ - - defaultvalue
"""
def __init__(self, sourcelisttrack, source_entry_var,
@@ -22,7 +30,15 @@ class Convert:
def addSourceParameter(self):
"""
- - This function add the source details to schematicInfo
+ - This function extracts the source details to schematicInfo
+ - keywords recognised and parsed -
+ - - sine
+ - - pulse
+ - - pwl
+ - - ac
+ - - dc
+ - - exp
+ - Return updated schematic
"""
self.start = 0
diff --git a/src/kicadtoNgspice/DeviceModel.py b/src/kicadtoNgspice/DeviceModel.py
index e1367181..7f63a43b 100644
--- a/src/kicadtoNgspice/DeviceModel.py
+++ b/src/kicadtoNgspice/DeviceModel.py
@@ -7,7 +7,7 @@ from . import TrackWidget
class DeviceModel(QtGui.QWidget):
"""
- - This class creates Device Library Tab in KicadtoNgspice Window
+ - This class creates Device Library Tab in KicadtoNgspice Window
It dynamically creates the widget for device like diode,mosfet,
transistor and jfet.
- Same function as the subCircuit file, except for
diff --git a/src/kicadtoNgspice/KicadtoNgspice.py b/src/kicadtoNgspice/KicadtoNgspice.py
index ef9201cb..f760bce2 100644
--- a/src/kicadtoNgspice/KicadtoNgspice.py
+++ b/src/kicadtoNgspice/KicadtoNgspice.py
@@ -41,7 +41,6 @@ class MainWindow(QtGui.QWidget):
- clarg1 is the path to the .cir file
- clarg2 is either None or "sub" depending on the analysis type
"""
-
def __init__(self, clarg1, clarg2=None):
QtGui.QWidget.__init__(self)
print("==================================")
diff --git a/src/kicadtoNgspice/Model.py b/src/kicadtoNgspice/Model.py
index a182dd4e..6ebfcb52 100644
--- a/src/kicadtoNgspice/Model.py
+++ b/src/kicadtoNgspice/Model.py
@@ -115,8 +115,8 @@ class Model(QtGui.QWidget):
self.obj_trac.model_entry_var
[self.nextcount].setText(
str(list(json_data
- ["model"][mod]["values"]
- [i].values())[0]))
+ ["model"][mod]["values"]
+ [i].values())[0]))
)
i = i + 1
except BaseException:
diff --git a/src/kicadtoNgspice/Processing.py b/src/kicadtoNgspice/Processing.py
index 216383e6..ebbd3429 100644
--- a/src/kicadtoNgspice/Processing.py
+++ b/src/kicadtoNgspice/Processing.py
@@ -16,7 +16,6 @@ class PrcocessNetlist:
"""
- Read the circuit file and return splitted lines
"""
-
def readNetlist(self, filename):
f = open(filename)
data = f.read()
@@ -32,7 +31,6 @@ class PrcocessNetlist:
- Read Parameter information and store it into dictionary
- kicadNetlis is the .cir file content
"""
-
def readParamInfo(self, kicadNetlis):
param = {}
print("=========================KICADNETLIST========================")
@@ -57,7 +55,6 @@ class PrcocessNetlist:
- Preprocess netlist (replace parameters)
- Separate infoline (first line) from the rest of netlist
"""
-
def preprocessNetlist(self, kicadNetlis, param):
netlist = []
for eachline in kicadNetlis:
@@ -128,7 +125,6 @@ class PrcocessNetlist:
- Then check for type whether ac, dc, sine, etc...
- Handle starting with h and f as well
"""
-
def insertSpecialSourceParam(self, schematicInfo, sourcelist):
schematicInfo1 = []
print("=============================================================")
@@ -466,7 +462,7 @@ class PrcocessNetlist:
"a" + str(k) + " (" + words[1] + " " +
words[2] + ") (interNode_" +
str(interMediateNodeCount) + " " + words[3] + ") "
- )
+ )
modelLine += compName + "_primary"
schematicInfo.append(modelLine)
k = k + 1
diff --git a/src/kicadtoNgspice/Source.py b/src/kicadtoNgspice/Source.py
index c9d50a26..26555197 100644
--- a/src/kicadtoNgspice/Source.py
+++ b/src/kicadtoNgspice/Source.py
@@ -27,16 +27,21 @@ class Source(QtGui.QWidget):
def createSourceWidget(self, sourcelist, sourcelisttrack):
"""
- - This function dynamically create source widget in the
+ - This function dynamically create source widget in the \
Source tab of KicadtoNgSpice window
- - Depending on the type of source, ac, dc, sine, pwl, etc...
- source tab is created
- - All the entry fields, are kept into the entry_var
+ - Depending on the type of source, sourcetab is created
+ - - ac
+ - - dc
+ - - sine
+ - - pulse
+ - - pwl
+ - - exp
+ - All the entry fields, are kept into the entry_var \
tracked by self.count
- - Finally after each of the sourcelist is mapped to its input component
- we move to adding these to the track widget
- - Also check if any default values present from previous analysis & add
- them by default
+ - Finally after each of the sourcelist is mapped to its input \
+ component we move to adding these to the track widget
+ - Also check if any default values present from previous analysis \
+ & add them by default
- Each line in sourcelist corresponds to a source
- According to the source type modify the source and add it to the tab
"""
diff --git a/src/modelEditor/ModelEditor.py b/src/modelEditor/ModelEditor.py
index 1dce456e..3bfdcfac 100644
--- a/src/modelEditor/ModelEditor.py
+++ b/src/modelEditor/ModelEditor.py
@@ -109,13 +109,12 @@ class ModelEditorclass(QtGui.QWidget):
self.setLayout(self.grid)
self.show()
- '''
- - To create New Model file
- - Change state of other buttons accordingly, ex. enable diode, bjt, ...
- - Validate filename created, to check if one already exists
- '''
-
def opennew(self):
+ '''
+ - To create New Model file
+ - Change state of other buttons accordingly, ex. enable diode, bjt, ...
+ - Validate filename created, to check if one already exists
+ '''
self.addbtn.setHidden(True)
try:
self.removebtn.setHidden(True)
@@ -142,26 +141,25 @@ class ModelEditorclass(QtGui.QWidget):
# Show error accordingly
self.validation(text)
- '''
- - Call function, openfiletype, which opens the table view for Diode specs
- - Set states for other elements
- - Diode has no types, so hide that
- '''
-
def diode_click(self):
+ '''
+ - Call function, openfiletype, which opens the table view for Diode specs
+ - Set states for other elements
+ - Diode has no types, so hide that
+ '''
self.openfiletype('Diode')
self.types.setHidden(True)
- '''
- - Set states for other elements
- - Initialise types combo box elements
- - - NPN
- - - PNP
- - Open the default type in the table
- - Add an event listener for type-selection event
- '''
def bjt_click(self):
+ '''
+ - Set states for other elements
+ - Initialise types combo box elements
+ - - NPN
+ - - PNP
+ - Open the default type in the table
+ - Add an event listener for type-selection event
+ '''
self.types.setHidden(False)
self.types.clear()
self.types.addItem('NPN')
@@ -172,17 +170,17 @@ class ModelEditorclass(QtGui.QWidget):
# When element selected from combo box, call setfiletype
self.types.activated[str].connect(self.setfiletype)
- '''
- - Set states for other elements
- - Initialise types combo box elements
- - - NMOS(Level-1 5um)
- - - NMOS(Level-3 0.5um)
- - - ...
- - Open the default type in the table
- - Add an event listener for type-selection event
- '''
def mos_click(self):
+ '''
+ - Set states for other elements
+ - Initialise types combo box elements
+ - - NMOS(Level-1 5um)
+ - - NMOS(Level-3 0.5um)
+ - - ...
+ - Open the default type in the table
+ - Add an event listener for type-selection event
+ '''
self.types.setHidden(False)
self.types.clear()
self.types.addItem('NMOS(Level-1 5um)')
@@ -195,16 +193,16 @@ class ModelEditorclass(QtGui.QWidget):
self.openfiletype(filetype)
self.types.activated[str].connect(self.setfiletype)
- '''
- - Set states for other elements
- - Initialise types combo box elements
- - - N-JFET
- - - P-JFET
- - Open the default type in the table
- - Add an event listener for type-selection event
- '''
def jfet_click(self):
+ '''
+ - Set states for other elements
+ - Initialise types combo box elements
+ - - N-JFET
+ - - P-JFET
+ - Open the default type in the table
+ - Add an event listener for type-selection event
+ '''
self.types.setHidden(False)
self.types.clear()
self.types.addItem('N-JFET')
@@ -212,17 +210,17 @@ class ModelEditorclass(QtGui.QWidget):
filetype = str(self.types.currentText())
self.openfiletype(filetype)
self.types.activated[str].connect(self.setfiletype)
-
- '''
- - Set states for other elements
- - Initialise types combo box elements
- - - N-IGBT
- - - P-IGBT
- - Open the default type in the table
- - Add an event listener for type-selection event
- '''
+
def igbt_click(self):
+ '''
+ - Set states for other elements
+ - Initialise types combo box elements
+ - - N-IGBT
+ - - P-IGBT
+ - Open the default type in the table
+ - Add an event listener for type-selection event
+ '''
self.types.setHidden(False)
self.types.clear()
self.types.addItem('N-IGBT')
@@ -231,35 +229,32 @@ class ModelEditorclass(QtGui.QWidget):
self.openfiletype(filetype)
self.types.activated[str].connect(self.setfiletype)
- '''
- - Set states for other elements
- - Initialise types combo box elements
- - Open the default type in the table
- - Add an event listener for type-selection event
- - No types here, only one view
- '''
-
def magnetic_click(self):
+ '''
+ - Set states for other elements
+ - Initialise types combo box elements
+ - Open the default type in the table
+ - Add an event listener for type-selection event
+ - No types here, only one view
+ '''
self.openfiletype('Magnetic Core')
self.types.setHidden(True)
- '''
- - Triggered when each type selected
- - Get the type clicked, from text
- - Open appropriate table using openfiletype(filetype)
- '''
-
def setfiletype(self, text):
+ '''
+ - Triggered when each type selected
+ - Get the type clicked, from text
+ - Open appropriate table using openfiletype(filetype)
+ '''
self.filetype = str(text)
self.openfiletype(self.filetype)
- '''
- - Select path for the filetype passed
- - Accordingly call `createtable(path)` to draw tables usingg QTable
- - Check for the state of button before rendering
- '''
-
def openfiletype(self, filetype):
+ '''
+ - Select path for the filetype passed
+ - Accordingly call `createtable(path)` to draw tables usingg QTable
+ - Check for the state of button before rendering
+ '''
self.path = '../deviceModelLibrary/Templates'
if self.diode.isChecked():
if filetype == 'Diode':
@@ -312,16 +307,16 @@ class ModelEditorclass(QtGui.QWidget):
else:
pass
- '''
- - When `Edit` button clicked, this function called
- - Set states for other buttons accordingly
- - Open the file selector box with path as deviceModelLibrary
- and filetype set as .lib, save it in `self.editfile`
- - Create table for the selected .lib file using `self.createtable(path)`
- - Handle exception of no file selected
- '''
def openedit(self):
+ '''
+ - When `Edit` button clicked, this function called
+ - Set states for other buttons accordingly
+ - Open the file selector box with path as deviceModelLibrary
+ and filetype set as .lib, save it in `self.editfile`
+ - Create table for the selected .lib file using `self.createtable(path)`
+ - Handle exception of no file selected
+ '''
os.chdir(self.savepathtest)
self.newflag = 0
self.addbtn.setHidden(True)
@@ -344,19 +339,18 @@ class ModelEditorclass(QtGui.QWidget):
print("No File selected for edit")
pass
- '''
- - Set states for other components
- - Initialise QTable widget
- - Set options for QTable widget
- - Place QTable widget, using `self.grid.addWidget`
- - Select the `.xml` file from the modelfile passed as `.lib`
- - Use ET (xml.etree.ElementTree) to parse the xml file
- - Extract data from the XML and store it in `modeldict`
- - Show the extracted data in QTableWidget
- - Can edit QTable inplace, connect `edit_modeltable` function for editing
- '''
-
def createtable(self, modelfile):
+ '''
+ - Set states for other components
+ - Initialise QTable widget
+ - Set options for QTable widget
+ - Place QTable widget, using `self.grid.addWidget`
+ - Select the `.xml` file from the modelfile passed as `.lib`
+ - Use ET (xml.etree.ElementTree) to parse the xml file
+ - Extract data from the XML and store it in `modeldict`
+ - Show the extracted data in QTableWidget
+ - Can edit QTable inplace, connect `edit_modeltable` function for editing
+ '''
self.savebtn.setDisabled(False)
self.addbtn.setHidden(False)
self.removebtn.setHidden(False)
@@ -401,15 +395,15 @@ class ModelEditorclass(QtGui.QWidget):
self.modeltable.show()
self.modeltable.itemChanged.connect(self.edit_modeltable)
- '''
- - Called when editing model inplace in QTableWidget
- - Set states of other components
- - Get data from the modeltable of the selected row
- - Edit name and value as per needed
- - Add the val name pair in the modeldict
- '''
-
def edit_modeltable(self):
+ '''
+ - Called when editing model inplace in QTableWidget
+ - Set states of other components
+ - Get data from the modeltable of the selected row
+ - Edit name and value as per needed
+ - Add the val name pair in the modeldict
+ '''
+
self.savebtn.setDisabled(False)
try:
indexitem = self.modeltable.currentItem()
@@ -421,15 +415,14 @@ class ModelEditorclass(QtGui.QWidget):
except BaseException:
pass
- '''
- - Called when `Add` button clicked beside QTableWidget
- - Open up dialog box to enter parameter and value accordingly
- - Validate if parameter already in list of parameters
- - Accordingly add parameter and value in modeldict as well as table
- - text1 => parameter, text2 => value
- '''
-
def addparameters(self):
+ '''
+ - Called when `Add` button clicked beside QTableWidget
+ - Open up dialog box to enter parameter and value accordingly
+ - Validate if parameter already in list of parameters
+ - Accordingly add parameter and value in modeldict as well as table
+ - text1 => parameter, text2 => value
+ '''
text1, ok = QtGui.QInputDialog.getText(
self, 'Parameter', 'Enter Parameter')
if ok:
@@ -454,26 +447,25 @@ class ModelEditorclass(QtGui.QWidget):
else:
pass
- '''
- - Called when save functon clicked
- - If new file created, call `createXML` file
- - Else call `savethefile`
- '''
-
def savemodelfile(self):
+ '''
+ - Called when save functon clicked
+ - If new file created, call `createXML` file
+ - Else call `savethefile`
+ '''
if self.newflag == 1:
self.createXML(self.model_name)
else:
self.savethefile(self.editfile)
- '''
- - Create .xml and .lib file if new model is being created
- - Save it in the corresponding compoenent directory, example Diode, IGBT..
- - For each component, separate folder is there
- - Check the contents of .lib and .xml file to understand their structure
- '''
def createXML(self, model_name):
+ '''
+ - Create .xml and .lib file if new model is being created
+ - Save it in the corresponding compoenent directory, example Diode, IGBT..
+ - For each component, separate folder is there
+ - Check the contents of .lib and .xml file to understand their structure
+ '''
root = ET.Element("library")
ET.SubElement(root, "model_name").text = model_name
ET.SubElement(root, "ref_model").text = self.modelname
@@ -612,12 +604,12 @@ class ModelEditorclass(QtGui.QWidget):
txtfile.close()
os.chdir(defaultcwd)
- '''
- - This function checks if the file (xml type) with the name already exists
- - Accordingly show error message
- '''
def validation(self, text):
+ '''
+ - This function checks if the file (xml type) with the name already exists
+ - Accordingly show error message
+ '''
newfilename = text + '.xml'
all_dir = [x[0] for x in os.walk(self.savepathtest)]
@@ -629,13 +621,13 @@ class ModelEditorclass(QtGui.QWidget):
'The file with name ' + text + ' already exists.')
self.msg.setWindowTitle("Error Message")
- '''
- - This function save the editing in the model table
- - Create .lib and .xml file for the editfile path and replace them
- - Also print Updated Library with libpath in the command window
- '''
def savethefile(self, editfile):
+ '''
+ - This function save the editing in the model table
+ - Create .lib and .xml file for the editfile path and replace them
+ - Also print Updated Library with libpath in the command window
+ '''
xmlpath, file = os.path.split(editfile)
filename = os.path.splitext(file)[0]
libpath = os.path.join(xmlpath, filename + '.lib')
@@ -663,30 +655,29 @@ class ModelEditorclass(QtGui.QWidget):
self.obj_appconfig.print_info('Updated library ' + libpath)
- '''
- - Get the index of the current selected item
- - Remove the whole row from QTable Widget
- - Remove the param,value pair from modeldict
- '''
-
def removeparameter(self):
+ '''
+ - Get the index of the current selected item
+ - Remove the whole row from QTable Widget
+ - Remove the param,value pair from modeldict
+ '''
self.savebtn.setDisabled(False)
index = self.modeltable.currentIndex()
remove_item = self.modeltable.item(index.row(), 0).text()
self.modeltable.removeRow(index.row())
del self.modeldict[str(remove_item)]
- '''
- - Called when upload button clicked
- - Used to read file form a certain location for .lib extension
- - Accordingly parse it and extract modelname and modelref
- - Also extract param value pairs
- - Take input the name of the library you want to save it as
- - Save it in `User Libraries` with the given name,
- and input from uploaded file
- '''
def converttoxml(self):
+ '''
+ - Called when upload button clicked
+ - Used to read file form a certain location for .lib extension
+ - Accordingly parse it and extract modelname and modelref
+ - Also extract param value pairs
+ - Take input the name of the library you want to save it as
+ - Save it in `User Libraries` with the given name,
+ and input from uploaded file
+ '''
os.chdir(self.savepathtest)
self.addbtn.setHidden(True)
self.removebtn.setHidden(True)
diff --git a/src/projManagement/Kicad.py b/src/projManagement/Kicad.py
index 9aaac46d..b75c0cf6 100644
--- a/src/projManagement/Kicad.py
+++ b/src/projManagement/Kicad.py
@@ -22,22 +22,19 @@ from configuration.Appconfig import Appconfig
from . import Worker
from PyQt4 import QtGui
-"""
-This class called the Kicad Schematic,KicadtoNgspice Converter,Layout
-editor and Footprint Editor
-"""
-
class Kicad:
"""
- Initialise validation, appconfig and dockarea
+ This class called the Kicad Schematic,KicadtoNgspice Converter,Layout
+ editor and Footprint Editor
+ Initialise validation, appconfig and dockarea
- @params
- :dockarea => passed from DockArea in frontEnd folder, consists
- of all functions for dockarea
+ @params
+ :dockarea => passed from DockArea in frontEnd folder, consists
+ of all functions for dockarea
- @return
+ @return
"""
def __init__(self, dockarea):
@@ -45,16 +42,17 @@ class Kicad:
self.obj_appconfig = Appconfig()
self.obj_dockarea = dockarea
- """
- This function create command to open Kicad schematic after
- appropriate validation checks
- @params
-
- @return
- """
def openSchematic(self):
+ """
+ This function create command to open Kicad schematic after
+ appropriate validation checks
+
+ @params
+
+ @return
+ """
print("Function : Open Kicad Schematic")
self.projDir = self.obj_appconfig.current_project["ProjectName"]
try:
@@ -151,18 +149,15 @@ class Kicad:
self.msg.setWindowTitle("Error Message")
'''
- """
- This function create command to validate and then call
- KicadToNgSPice converter from DockArea file
-
- @params
-
- @return
- """
def openKicadToNgspice(self):
"""
- This function create command to call kicad to Ngspice converter.
+ This function create command to validate and then call
+ KicadToNgSPice converter from DockArea file
+
+ @params
+
+ @return
"""
print("Function: Open Kicad to Ngspice Converter")
diff --git a/src/projManagement/Validation.py b/src/projManagement/Validation.py
index 9fcac9a2..79e458d8 100644
--- a/src/projManagement/Validation.py
+++ b/src/projManagement/Validation.py
@@ -21,26 +21,14 @@ import os
import re
import distutils.spawn
-"""
-This is Validation class use for validating Project.
-e.g if .proj is present in project directory
-or if new project name is already exist in workspace etc
-"""
-class Validation:
+class Validation:
"""
- Takes as input the path of the project and checks if
- projName.proj file exists
- projName is same as the folder selected
-
- @params
- :projDir => contains the path of the project folder selected to open
-
- @return
- True => If the folder contains the projName.proj file
- False => If the folder doesn't contain projName.proj file
+ This is Validation class use for validating Project.
+ e.g if .proj is present in project directory
+ or if new project name is already exist in workspace etc
"""
def __init__(self):
@@ -48,8 +36,17 @@ class Validation:
def validateOpenproj(self, projDir):
"""
- This function validate Open Project Information.
- """
+ Takes as input the path of the project and checks if
+ projName.proj file exists
+ projName is same as the folder selected
+
+ @params
+ :projDir => contains the path of the project folder selected to open
+
+ @return
+ True => If the folder contains the projName.proj file
+ False => If the folder doesn't contain projName.proj file
+ """
print("Function: Validating Open Project Information")
projName = os.path.basename(str(projDir))
lookProj = os.path.join(str(projDir), projName + ".proj")
@@ -59,22 +56,20 @@ class Validation:
else:
return False
- """
- Validate new project created
-
- @params
- :projDir => Contains path of the new projDir created
- @return
- :"CHECKEXIST" => If smae project name folder exists
- :"CHECKNAME" => If space is there in name
- :"VALID" => If valid project name given
- """
def validateNewproj(self, projDir):
"""
- This Project Validate New Project Information
- """
+ Validate new project created
+
+ @params
+ :projDir => Contains path of the new projDir created
+
+ @return
+ :"CHECKEXIST" => If smae project name folder exists
+ :"CHECKNAME" => If space is there in name
+ :"VALID" => If valid project name given
+ """
print("Function: Validating New Project Information")
# Checking existence of project with same name
@@ -87,22 +82,20 @@ class Validation:
else:
return "VALID"
- """
- Validate if projDir is set appropriately in the function calling file
- and if Kicad components are present
- @params
- :projDir => the path of the project directory, passed from
- the calling function
-
- @return
- True
- False
- """
def validateKicad(self, projDir):
"""
- This function validate if Kicad components are present
+ Validate if projDir is set appropriately in the function calling file
+ and if Kicad components are present
+
+ @params
+ :projDir => the path of the project directory, passed from
+ the calling function
+
+ @return
+ True
+ False
"""
print("FUnction : Validating for Kicad components")
if projDir is None:
@@ -110,21 +103,19 @@ class Validation:
else:
return True
- """
- Validate if cir file present in the directory with the appropriate .cir
- file name, same as the project directory base
-
- @params
- :projDir => the path to the project diretory
- @return
- True
- False
- """
def validateCir(self, projDir):
"""
- This function checks if ".cir" file is present.
+ Validate if cir file present in the directory with the appropriate .cir
+ file name, same as the project directory base
+
+ @params
+ :projDir => the path to the project directory
+
+ @return
+ True
+ False
"""
projName = os.path.basename(str(projDir))
lookCir = os.path.join(str(projDir), projName + ".cir")
@@ -137,6 +128,16 @@ class Validation:
def validateSub(self, subDir, givenNum):
"""
This function checks if ".sub" file is present.
+ Also, if subckt file is present check for ports and check if equal
+
+ @params
+ :subDir => the path of the subcircuit directory
+ :giveNum => the number of port calculated and passed for validation
+
+ @return
+ True
+ PORT
+ DIREC
"""
subName = os.path.basename(str(subDir))
lookSub = os.path.join(str(subDir), subName + ".sub")
@@ -168,6 +169,14 @@ class Validation:
def validateCirOut(self, projDir):
"""
This function checks if ".cir.out" file is present.
+
+ @params
+ :projDir => the path of the project directory, passed from
+ the calling function
+
+ @return
+ True
+ False
"""
projName = os.path.basename(str(projDir))
lookCirOut = os.path.join(str(projDir), projName + ".cir.out")
@@ -179,6 +188,7 @@ class Validation:
def validateTool(self, toolName):
"""
- This function check if tool is present in the system
+ This function check if tool is present in the system,
+ Example, nghdl, eeschema...
"""
return distutils.spawn.find_executable(toolName) is not None
diff --git a/src/projManagement/Worker.py b/src/projManagement/Worker.py
index f40fd724..99d30ccc 100644
--- a/src/projManagement/Worker.py
+++ b/src/projManagement/Worker.py
@@ -19,16 +19,13 @@ from PyQt4 import QtCore
import subprocess
from configuration.Appconfig import Appconfig
-"""
-WorkerThread uses QThread to support threading operations for
-other PyQT windows
-This is a helper functions, used to create threads for various commands
-"""
-
-
class WorkerThread(QtCore.QThread):
"""
Initialise a QThread with the passed arguments
+ WorkerThread uses QThread to support threading operations for
+ other PyQT windows
+ This is a helper functions, used to create threads for various commands
+
@params
:args => takes a space separated string of comamnds to be execute
@@ -42,48 +39,49 @@ class WorkerThread(QtCore.QThread):
QtCore.QThread.__init__(self)
self.args = args
- """
- __del__ is a called whenever garbage collection is initialised
- Here, it waits (self.wait()) for the thread to finish executing
- before garbage collecting it
-
- @params
- @return
- None
- """
def __del__(self):
- self.wait()
+ """
+ __del__ is a called whenever garbage collection is initialised
+ Here, it waits (self.wait()) for the thread to finish executing
+ before garbage collecting it
- """
- run is the function that is called, when we start the thread as
- thisThread.start()
- Here, it makes system calls for all args passed (self.args)
+ @params
- @params
+ @return
+ None
+ """
+ self.wait()
- @return
- None
- """
def run(self):
- print("Worker Thread Calling Command :", self.args)
- self.call_system(self.args)
+ """
+ run is the function that is called, when we start the thread as
+ thisThread.start()
+ Here, it makes system calls for all args passed (self.args)
- """
- call_system is used to create childprocess for the passed arguments
- (self.args) and also pass the process created and its id to config file
- Apponfig() object contains procThread and proc_dist used to
- track processes called
+ @params
- @params
- :command => (self.args) takes space separated string of comamnds to
- be executed in different child processes
- (see subproces.Popen())
- """
+ @return
+ None
+ """
+ print("Worker Thread Calling Command :", self.args)
+ self.call_system(self.args)
def call_system(self, command):
+ """
+ call_system is used to create childprocess for the passed arguments
+ (self.args) and also pass the process created and its id to config file
+ Apponfig() object contains procThread and proc_dist used to
+ track processes called
+
+ @params
+ :command => (self.args) takes space separated string of comamnds to
+ be executed in different child processes
+ (see subproces.Popen())
+ """
+
procThread = Appconfig()
proc = subprocess.Popen(command.split())
procThread.procThread_list.append(proc)
diff --git a/src/projManagement/newProject.py b/src/projManagement/newProject.py
index c8cd4078..92e90742 100644
--- a/src/projManagement/newProject.py
+++ b/src/projManagement/newProject.py
@@ -22,33 +22,38 @@ from configuration.Appconfig import Appconfig
import os
import json
-"""
-This class is called when User create new Project.
-"""
class NewProjectInfo(QtGui.QWidget):
+ """
+ This class is called when User create new Project.
+ """
def __init__(self):
super(NewProjectInfo, self).__init__()
self.obj_validation = Validation()
self.obj_appconfig = Appconfig()
- """
- This function create Project related directories and files
+ def createProject(self, projName):
+ """
+ This function create Project related directories and files.
+ Before creating also validates using the `Validation` class
- @params
- :projName => name of the project created passed from
- frontEnd/Application new_project()
+ Validation codes
- @return
- :dirs => The directories inside the project folder
- :filelist => The files inside the project folder
- """
+ - VALID
+ - CHECKEXIST
+ - CHECKNAME
+ - NONE
+
+ @params
+ :projName => name of the project created passed from
+ frontEnd/Application new_project()
+
+ @return
+ :dirs => The directories inside the project folder
+ :filelist => The files inside the project folder
- def createProject(self, projName):
- """
- This function create Project related directories and files
"""
# print "Create Project Called"
self.projName = projName
diff --git a/src/projManagement/openProject.py b/src/projManagement/openProject.py
index 100cf12c..7c9e23d1 100644
--- a/src/projManagement/openProject.py
+++ b/src/projManagement/openProject.py
@@ -23,28 +23,27 @@ from configuration.Appconfig import Appconfig
import os
import json
-"""
-This class is called when User click on Open Project Button
-"""
-
class OpenProjectInfo(QtGui.QWidget):
+ """
+ This class is called when User click on Open Project Button
+ """
def __init__(self):
super(OpenProjectInfo, self).__init__()
self.obj_validation = Validation()
- """
- Open a project directory using Qt GUI and validate
- if .proj file present in it
- @params
+ def body(self):
+ """
+ Open a project directory using Qt GUI and validate
+ if .proj file present in it using `Validation` class
- @return
- :dirs => The directories inside the project folder
- :filelist => The files inside the project folder
- """
+ @params
- def body(self):
+ @return
+ :dirs => The directories inside the project folder
+ :filelist => The files inside the project folder
+ """
self.obj_Appconfig = Appconfig()
self.openDir = self.obj_Appconfig.default_workspace["workspace"]
self.projDir = QtGui.QFileDialog.getExistingDirectory(