Browse Source

Update for loops input and saving in Akvo

tags/1.6.1
Trevor Irons 4 years ago
parent
commit
2a377b6c0d
1 changed files with 22 additions and 2 deletions
  1. 22
    2
      akvo/gui/akvoGUI.py

+ 22
- 2
akvo/gui/akvoGUI.py View File

@@ -401,12 +401,10 @@ class ApplicationWindow(QtWidgets.QMainWindow):
401 401
                 dialog.ui.loopTableWidget.resizeColumnsToContents()       
402 402
                 dialog.exec_()
403 403
                 dialog.show()
404
-
405 404
                 
406 405
                 if dialog.result():
407 406
                     self.loops[self.ui.loopLabel.text()] = FDEM1D.PolygonalWireAntenna()
408 407
                     self.loops[self.ui.loopLabel.text()].SetNumberOfTurns( dialog.ui.loopTurns.value() )
409
-
410 408
                
411 409
                     npts = 0 
412 410
                     for ir in range(0, dialog.ui.loopTableWidget.rowCount() ):
@@ -770,8 +768,18 @@ class ApplicationWindow(QtWidgets.QMainWindow):
770 768
         INFO["nDAQVersion"] = self.RAWDataProc.nDAQVersion
771 769
         INFO["log"] = yaml.dump( self.YamlNode )  
772 770
 
771
+        TXRX = []
772
+        for ir in range(0, self.ui.txRxTable.rowCount() ):
773
+            txrx = []
774
+            for ic in range(0, self.ui.txRxTable.columnCount() ):
775
+                txrx.append( self.ui.txRxTable.item(ir, ic).text() )
776
+            TXRX.append(txrx)
777
+        INFO["TXRX"] = TXRX       
778
+
773 779
         self.RAWDataProc.DATADICT["INFO"] = INFO 
774 780
 
781
+        print ("TXRX", TXRX)
782
+
775 783
         pickle.dump(self.RAWDataProc.DATADICT, save)
776 784
         save.close()
777 785
 
@@ -827,6 +835,7 @@ class ApplicationWindow(QtWidgets.QMainWindow):
827 835
         self.RAWDataProc.dt = 1./self.RAWDataProc.samp 
828 836
 
829 837
         self.dataChan = self.RAWDataProc.DATADICT[ self.RAWDataProc.DATADICT["PULSES"][0] ]["chan"]
838
+
830 839
         # Keep backwards compatibility with prior saved pickles???
831 840
         #self.ui.logTextBrowser.clear() 
832 841
             #self.ui.logTextBrowser.append( yaml.dump(self.YamlNode)) #, default_flow_style=False)  )
@@ -835,6 +844,17 @@ class ApplicationWindow(QtWidgets.QMainWindow):
835 844
             #self.ui.logTextBrowser
836 845
             #self.ui.logTextBrowser.clear()
837 846
             #print ( self.RAWDataProc.DATADICT["INFO"]["log"] )
847
+
848
+        if "TXRX" in self.RAWDataProc.DATADICT["INFO"].keys():
849
+            TXRX = self.RAWDataProc.DATADICT["INFO"]["TXRX"]
850
+            self.ui.txRxTable.setRowCount( len(TXRX)) 
851
+            for irow, row in enumerate(TXRX):        
852
+                for icol, val in enumerate(row):        
853
+                    pCell = QtWidgets.QTableWidgetItem()
854
+                    pCell.setText( val ) 
855
+                    pCell.setFlags( QtCore.Qt.ItemIsSelectable | QtCore.Qt.ItemIsEnabled )
856
+                    self.ui.txRxTable.setItem(irow, icol, pCell)
857
+
838 858
         
839 859
         self.logText = self.RAWDataProc.DATADICT["INFO"]["log"] # YAML 
840 860
 

Loading…
Cancel
Save