diff options
-rw-r--r-- | .pydevproject | 2 | ||||
-rwxr-xr-x | install-linux.sh | 40 | ||||
-rw-r--r-- | src/browser/Welcome.py | 4 | ||||
-rw-r--r-- | src/frontEnd/DockArea.py | 43 | ||||
-rw-r--r-- | src/frontEnd/ProjectExplorer.py | 2 | ||||
-rw-r--r-- | src/ngspiceSimulation/NgspiceWidget.py | 11 | ||||
-rw-r--r-- | src/ngspiceSimulation/pythonPlotting.py | 4 |
7 files changed, 56 insertions, 50 deletions
diff --git a/.pydevproject b/.pydevproject index 0ebadbb2..ba45ec92 100644 --- a/.pydevproject +++ b/.pydevproject @@ -3,6 +3,6 @@ <pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH"> <path>/${PROJECT_DIR_NAME}/src</path> </pydev_pathproperty> -<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property> +<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 3.0.x</pydev_property> <pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property> </pydev_project> diff --git a/install-linux.sh b/install-linux.sh index 4af3e85b..a1ee97f7 100755 --- a/install-linux.sh +++ b/install-linux.sh @@ -1,5 +1,5 @@ -#!/bin/bash -#=============================================================================== +# !/bin/bash +# =============================================================================== # # FILE: install.sh # @@ -17,21 +17,21 @@ # ORGANIZATION: FOSSEE at IIT Bombay. # CREATED: Wednesday 15 July 2015 15:26 # REVISION: --- -#=============================================================================== +# =============================================================================== -#All variables goes here +# All variables goes here config_dir="$HOME/.esim" config_file="config.ini" eSim_Home=`pwd` ngspiceFlag=0 -##All Functions goes here +## All Functions goes here function createConfigFile { - #Creating config.ini file and adding configuration information - #Check if config file is present + # Creating config.ini file and adding configuration information + # Check if config file is present if [ -d $config_dir ];then rm $config_dir/$config_file && touch $config_dir/$config_file else @@ -73,7 +73,7 @@ if [ $getNghdl == "y" -o $getNghdl == "Y" ];then ngspiceFlag=1 cd .. fi - #Creating empty eSim_kicad.lib in home directory + # Creating empty eSim_kicad.lib in home directory if [ -f $HOME/eSim_kicad.lib ];then echo "eSim_kicad.lib is already available" else @@ -125,7 +125,7 @@ function installDependency function copyKicadLibrary { - #Copy Kicad library made for eSim + # Copy Kicad library made for eSim sudo cp -r kicadSchematicLibrary/*.lib /usr/share/kicad/library/ sudo cp -r kicadSchematicLibrary/*.dcm /usr/share/kicad/library/ @@ -147,17 +147,17 @@ function copyKicadLibrary function createDesktopStartScript { - #Generating new esim-start.sh + # Generating new esim-start.sh echo "#!/bin/bash" > esim-start.sh echo "cd $eSim_Home/src/frontEnd" >> esim-start.sh echo "python3 Application.py" >> esim-start.sh - #Make it executable + # Make it executable sudo chmod 755 esim-start.sh - #Copy esim start script + # Copy esim start script sudo cp -vp esim-start.sh /usr/bin/esim - #Generating esim.desktop file + # Generating esim.desktop file echo "[Desktop Entry]" > esim.desktop getVersion=`tail -1 VERSION` echo "Version=$getVersion" >> esim.desktop @@ -177,13 +177,13 @@ function createDesktopStartScript echo "Actions=NewWindow;NewPrivateWindow;" >> esim.desktop - #Make esim.desktop file executable + # Make esim.desktop file executable sudo chmod 755 esim.desktop - #Copy desktop icon file to Desktop + # Copy desktop icon file to Desktop cp -vp esim.desktop $HOME/Desktop/ - #Copying logo.png to .esim directory to access as icon + # Copying logo.png to .esim directory to access as icon cp -vp images/logo.png $config_dir } @@ -193,7 +193,7 @@ function createDesktopStartScript -###Checking if file is passsed as argument to script +### Checking if file is passsed as argument to script if [ "$#" -eq 1 ];then option=$1 @@ -203,7 +203,7 @@ else exit 1; fi -##Checking flags +## Checking flags if [ $option == "--install" ];then echo "Enter proxy details if you are connected to internet thorugh proxy" @@ -239,7 +239,7 @@ if [ $option == "--install" ];then export FTP_PROXY=http://$username:$passwd@$proxyHostname:$proxyPort echo "Install with proxy" - #Calling functions + # Calling functions createConfigFile installNghdl addKicadPPA @@ -250,7 +250,7 @@ if [ $option == "--install" ];then elif [ $getProxy == "n" -o $getProxy == "N" ];then echo "Install without proxy" - #Calling functions + # Calling functions createConfigFile installNghdl addKicadPPA diff --git a/src/browser/Welcome.py b/src/browser/Welcome.py index 52e7d5bd..2ae8fce1 100644 --- a/src/browser/Welcome.py +++ b/src/browser/Welcome.py @@ -2,9 +2,7 @@ from PyQt4 import QtGui, QtCore class Welcome(QtGui.QWidget): - """ - This class creates Welcome page of eSim. - """ + """This class creates Welcome page of eSim.""" def __init__(self): """Sdf.""" diff --git a/src/frontEnd/DockArea.py b/src/frontEnd/DockArea.py index 2c605272..60c98f36 100644 --- a/src/frontEnd/DockArea.py +++ b/src/frontEnd/DockArea.py @@ -14,10 +14,13 @@ dockList = ['Welcome'] count = 1 dock = {} + # class DockArea(QtGui.QMainWindow): - """ """ + """Sdf.""" + def __init__(self): + """Sdf.""" QtGui.QMainWindow.__init__(self) self.obj_appconfig = Appconfig() @@ -42,9 +45,8 @@ class DockArea(QtGui.QMainWindow): # This function create widget for Library Editor def createTestEditor(self): - """ """ + """Sdf.""" global count - self.testWidget = QtGui.QWidget() self.testArea = QtGui.QTextEdit() self.testLayout = QtGui.QVBoxLayout() @@ -71,7 +73,7 @@ class DockArea(QtGui.QMainWindow): # This function create widget for interactive PythonPlotting def plottingEditor(self): - """ """ + """Sdf.""" self.projDir = self.obj_appconfig.current_project["ProjectName"] self.projName = os.path.basename(self.projDir) # self.project = os.path.join(self.projDir,self.projName) @@ -100,9 +102,9 @@ class DockArea(QtGui.QMainWindow): dock['Plotting-' + str(count)]) count = count + 1 + # This function creates widget for NgSpice window. def ngspiceEditor(self, projDir): - """This function creates widget for NgSpice window.""" - + """Sdf.""" self.projDir = projDir self.projName = os.path.basename(self.projDir) self.ngspiceNetlist = os.path.join( @@ -140,7 +142,9 @@ class DockArea(QtGui.QMainWindow): dock['NgSpice-' + str(count)]) count = count + 1 + # This function defines UI for model editor. def modelEditor(self): + """Sdf.""" print("in model editor") global count self.modelwidget = QtGui.QWidget() @@ -174,7 +178,9 @@ 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.""" global count self.kicadToNgspiceWidget = QtGui.QWidget() self.kicadToNgspiceLayout = QtGui.QVBoxLayout() @@ -204,11 +210,10 @@ class DockArea(QtGui.QMainWindow): self.obj_appconfig.dock_dict[temp].append( dock['kicadToNgspice-' + str(count)]) count = count + 1 + + # This function creates a widget for different subcircuit options. def subcircuiteditor(self): - """ - This function creates a widget for different subcircuit options - """ - + """Sdf.""" global count self.subcktWidget = QtGui.QWidget() self.subcktLayout = QtGui.QVBoxLayout() @@ -237,12 +242,10 @@ class DockArea(QtGui.QMainWindow): self.obj_appconfig.dock_dict[temp].append( dock['Subcircuit-' + str(count)]) count = count + 1 - + + # This function creates a widget for different subcircuit options. def usermanual(self): - """ - This function creates a widget for different subcircuit options - """ - + """Sdf.""" global count self.usermanualWidget = QtGui.QWidget() self.usermanualLayout = QtGui.QVBoxLayout() @@ -269,9 +272,9 @@ class DockArea(QtGui.QMainWindow): count = count + 1 + # This function sets up the UI for ngspice to modelica conversion. def modelicaEditor(self, projDir): - """This function sets up the UI for ngspice to modelica conversion.""" - + """Dfg.""" global count self.modelicaWidget = QtGui.QWidget() self.modelicaLayout = QtGui.QVBoxLayout() @@ -300,7 +303,9 @@ class DockArea(QtGui.QMainWindow): count = count + 1 + # This function when called closes the opened file. def closeDock(self): - temp = self.obj_appconfig.current_project['ProjectName'] - for dockwidget in self.obj_appconfig.dock_dict[temp]: + """Sdf.""" + 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 d84f41e0..9128370e 100644 --- a/src/frontEnd/ProjectExplorer.py +++ b/src/frontEnd/ProjectExplorer.py @@ -11,7 +11,7 @@ class ProjectExplorer(QtGui.QWidget): def __init__(self): """ This method is doing following tasks: - a)initializing objects used in full program. + a)Working as a constructor for class ProjectExplorer. b)view of project explorer area. """ QtGui.QWidget.__init__(self) diff --git a/src/ngspiceSimulation/NgspiceWidget.py b/src/ngspiceSimulation/NgspiceWidget.py index def1d4e9..ba56df2a 100644 --- a/src/ngspiceSimulation/NgspiceWidget.py +++ b/src/ngspiceSimulation/NgspiceWidget.py @@ -6,12 +6,13 @@ import os # This Class creates NgSpice Window class NgspiceWidget(QtGui.QWidget): - """ - Includes functions that checks whether OS is linux or windows - and creates NgSpice window accordingly. - """ - + def __init__(self, command, projPath): + """ + 1)Creates constructor for NgspiceWidget class. + 2)Checks whether OS is linux or windows + and creates NgSpice window accordingly. + """ QtGui.QWidget.__init__(self) self.obj_appconfig = Appconfig() self.process = QtCore.QProcess(self) diff --git a/src/ngspiceSimulation/pythonPlotting.py b/src/ngspiceSimulation/pythonPlotting.py index 9f8f8e88..6cf99752 100644 --- a/src/ngspiceSimulation/pythonPlotting.py +++ b/src/ngspiceSimulation/pythonPlotting.py @@ -1,4 +1,5 @@ - # Used for decimal division eg 2/3=0.66 and not '0' 6/2=3.0 and 6//2=3 +from __future__ import division # Used for decimal division eg +# 2/3=0.66 and not '0' 6/2=3.0 and 6//2=3 import os from PyQt4 import QtGui, QtCore from decimal import Decimal, getcontext @@ -19,6 +20,7 @@ class plotWindow(QtGui.QMainWindow): ''' def __init__(self, fpath, projectName): + """This create constructor for plotWindow class.""" QtGui.QMainWindow.__init__(self) self.fpath = fpath self.projectName = projectName |