From a0f738ba15264b69d9d51755569408bdd8e383b5 Mon Sep 17 00:00:00 2001
From: nilshah98
Date: Fri, 7 Jun 2019 18:54:35 +0530
Subject: pep8 fixes and list models bug fixed

---
 src/kicadtoNgspice/Analysis.py | 65 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 64 insertions(+), 1 deletion(-)

(limited to 'src/kicadtoNgspice/Analysis.py')

diff --git a/src/kicadtoNgspice/Analysis.py b/src/kicadtoNgspice/Analysis.py
index cde39f8f..a60a2286 100644
--- a/src/kicadtoNgspice/Analysis.py
+++ b/src/kicadtoNgspice/Analysis.py
@@ -8,7 +8,17 @@ import json
 
 class Analysis(QtGui.QWidget):
     """
-    This class create Analysis Tab in KicadtoNgspice Window.
+    - 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
     """
 
     def __init__(self, clarg1):
@@ -40,7 +50,9 @@ class Analysis(QtGui.QWidget):
 
             analysisfile = open(os.path.join(projpath, 'analysis'))
             content = analysisfile.readline()
+            print("=========================================================")
             print("Content of Analysis file :", content)
+            print("=========================================================")
             contentlist = content.split()
 
             if contentlist[0] == '.ac':
@@ -88,6 +100,12 @@ class Analysis(QtGui.QWidget):
         self.setLayout(self.grid)
         self.show()
 
+    '''
+    - Create the checkboxes for analysis type, under analysis tab
+    - checkbox > checkgrid > checkgroupbtn > checkAC | checkDC | checkTRAN
+    - Trigger enableBox on clicking
+    '''
+
     def createCheckBox(self):
         self.checkbox = QtGui.QGroupBox()
         self.checkbox.setTitle("Select Analysis Type")
@@ -111,6 +129,11 @@ class Analysis(QtGui.QWidget):
 
         return self.checkbox
 
+    '''
+    - Activate deactive analysis areas according to type
+    - Add analysis data to track_obj from TrackWidget
+    '''
+
     def enableBox(self):
         if self.checkAC.isChecked():
             self.acbox.setDisabled(False)
@@ -130,6 +153,14 @@ class Analysis(QtGui.QWidget):
             self.dcbox.setDisabled(True)
             self.track_obj.set_CheckBox["ITEMS"] = "TRAN"
 
+    '''
+    - Designing of AC group in analysis tab
+    - 3 radio buttons - Lin | Dec | Oct
+    - 3 input boxes, with top 2 combos\
+    - If previous values exist then fill default values from
+      previous value json file
+    '''
+
     def createACgroup(self):
         kicadFile = self.clarg1
         (projpath, filename) = os.path.split(kicadFile)
@@ -202,12 +233,14 @@ class Analysis(QtGui.QWidget):
         self.acgrid.addWidget(self.start_fre_combo, 2, 2)
         self.ac_parameter[0] = "Hz"
 
+        # Try setting to default value from anaylsis file
         try:
             self.ac_parameter[self.parameter_cnt] = str(
                 json_data["analysis"]["ac"]["Start Fre Combo"])
         except BaseException:
             self.ac_parameter[self.parameter_cnt] = "Hz"
 
+        # Event listener for combo action
         self.start_fre_combo.activated[str].connect(self.start_combovalue)
 
         self.parameter_cnt = self.parameter_cnt + 1
@@ -274,12 +307,23 @@ class Analysis(QtGui.QWidget):
 
         return self.acbox
 
+    '''
+    - Below 2 functions handle combo value event listeners for
+    - - start frequency for ac
+    - - stop frequency for ac
+    - And accordingly set the ac_parameters
+    '''
+
     def start_combovalue(self, text):
         self.ac_parameter[0] = str(text)
 
     def stop_combovalue(self, text):
         self.ac_parameter[1] = str(text)
 
+    '''
+    - Set track object for AC, according to the type of radio box selected
+    '''
+
     def set_ac_type(self):
         self.parameter_cnt = 0
 
@@ -292,6 +336,10 @@ class Analysis(QtGui.QWidget):
         else:
             pass
 
+    '''
+    - Create DC area under analysis tab
+    '''
+
     def createDCgroup(self):
         kicadFile = self.clarg1
         (projpath, filename) = os.path.split(kicadFile)
@@ -564,6 +612,10 @@ class Analysis(QtGui.QWidget):
 
         return self.dcbox
 
+    '''
+    - Below 6 functions to handle combo boxes for the DC group
+    '''
+
     def start_changecombo(self, text):
         self.dc_parameter[0] = str(text)
 
@@ -582,12 +634,20 @@ class Analysis(QtGui.QWidget):
     def stop_changecombo2(self, text):
         self.dc_parameter[5] = str(text)
 
+    '''
+    - Handles the Operating point analysis checkbox
+    '''
+
     def setflag(self):
         if self.check.isChecked():
             self.track_obj.op_check.append(1)
         else:
             self.track_obj.op_check.append(0)
 
+    '''
+    - Creating transient group under analysis and creating it's components
+    '''
+
     def createTRANgroup(self):
         kicadFile = self.clarg1
         (projpath, filename) = os.path.split(kicadFile)
@@ -717,6 +777,9 @@ class Analysis(QtGui.QWidget):
                 print("Transient Analysis JSON Parse Error")
 
         return self.trbox
+    '''
+    - Below 3 functions handle event for the combo box in transient group
+    '''
 
     def start_combo_change(self, text):
         self.tran_parameter[0] = str(text)
-- 
cgit