diff options
author | unknown | 2019-06-03 14:56:53 +0530 |
---|---|---|
committer | nilshah98 | 2019-06-17 22:34:34 +0530 |
commit | 89249e5003eccb07917d21788f6ce37e1de6d572 (patch) | |
tree | 3cf30e5211f8f5cbfafe7400b7b92670de00929a /src/kicadtoNgspice | |
parent | 1d4ee6b6c1254657c497673838922e746f339eca (diff) | |
download | eSim-89249e5003eccb07917d21788f6ce37e1de6d572.tar.gz eSim-89249e5003eccb07917d21788f6ce37e1de6d572.tar.bz2 eSim-89249e5003eccb07917d21788f6ce37e1de6d572.zip |
sphinx documentation init
Diffstat (limited to 'src/kicadtoNgspice')
-rw-r--r-- | src/kicadtoNgspice/Analysis.py | 47 | ||||
-rw-r--r-- | src/kicadtoNgspice/Convert.py | 18 | ||||
-rw-r--r-- | src/kicadtoNgspice/DeviceModel.py | 2 | ||||
-rw-r--r-- | src/kicadtoNgspice/KicadtoNgspice.py | 1 | ||||
-rw-r--r-- | src/kicadtoNgspice/Model.py | 4 | ||||
-rw-r--r-- | src/kicadtoNgspice/Processing.py | 6 | ||||
-rw-r--r-- | src/kicadtoNgspice/Source.py | 9 |
7 files changed, 59 insertions, 28 deletions
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..d59708de 100644 --- a/src/kicadtoNgspice/Convert.py +++ b/src/kicadtoNgspice/Convert.py @@ -10,6 +10,14 @@ class 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..f4bd3f55 100644 --- a/src/kicadtoNgspice/Source.py +++ b/src/kicadtoNgspice/Source.py @@ -29,8 +29,13 @@ class Source(QtGui.QWidget): """ - 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 + - 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 |