Browse Source

Update for loops input and saving in Akvo

tags/1.6.1
Trevor Irons 5 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
                 dialog.ui.loopTableWidget.resizeColumnsToContents()       
401
                 dialog.ui.loopTableWidget.resizeColumnsToContents()       
402
                 dialog.exec_()
402
                 dialog.exec_()
403
                 dialog.show()
403
                 dialog.show()
404
-
405
                 
404
                 
406
                 if dialog.result():
405
                 if dialog.result():
407
                     self.loops[self.ui.loopLabel.text()] = FDEM1D.PolygonalWireAntenna()
406
                     self.loops[self.ui.loopLabel.text()] = FDEM1D.PolygonalWireAntenna()
408
                     self.loops[self.ui.loopLabel.text()].SetNumberOfTurns( dialog.ui.loopTurns.value() )
407
                     self.loops[self.ui.loopLabel.text()].SetNumberOfTurns( dialog.ui.loopTurns.value() )
409
-
410
                
408
                
411
                     npts = 0 
409
                     npts = 0 
412
                     for ir in range(0, dialog.ui.loopTableWidget.rowCount() ):
410
                     for ir in range(0, dialog.ui.loopTableWidget.rowCount() ):
770
         INFO["nDAQVersion"] = self.RAWDataProc.nDAQVersion
768
         INFO["nDAQVersion"] = self.RAWDataProc.nDAQVersion
771
         INFO["log"] = yaml.dump( self.YamlNode )  
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
         self.RAWDataProc.DATADICT["INFO"] = INFO 
779
         self.RAWDataProc.DATADICT["INFO"] = INFO 
774
 
780
 
781
+        print ("TXRX", TXRX)
782
+
775
         pickle.dump(self.RAWDataProc.DATADICT, save)
783
         pickle.dump(self.RAWDataProc.DATADICT, save)
776
         save.close()
784
         save.close()
777
 
785
 
827
         self.RAWDataProc.dt = 1./self.RAWDataProc.samp 
835
         self.RAWDataProc.dt = 1./self.RAWDataProc.samp 
828
 
836
 
829
         self.dataChan = self.RAWDataProc.DATADICT[ self.RAWDataProc.DATADICT["PULSES"][0] ]["chan"]
837
         self.dataChan = self.RAWDataProc.DATADICT[ self.RAWDataProc.DATADICT["PULSES"][0] ]["chan"]
838
+
830
         # Keep backwards compatibility with prior saved pickles???
839
         # Keep backwards compatibility with prior saved pickles???
831
         #self.ui.logTextBrowser.clear() 
840
         #self.ui.logTextBrowser.clear() 
832
             #self.ui.logTextBrowser.append( yaml.dump(self.YamlNode)) #, default_flow_style=False)  )
841
             #self.ui.logTextBrowser.append( yaml.dump(self.YamlNode)) #, default_flow_style=False)  )
835
             #self.ui.logTextBrowser
844
             #self.ui.logTextBrowser
836
             #self.ui.logTextBrowser.clear()
845
             #self.ui.logTextBrowser.clear()
837
             #print ( self.RAWDataProc.DATADICT["INFO"]["log"] )
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
         self.logText = self.RAWDataProc.DATADICT["INFO"]["log"] # YAML 
859
         self.logText = self.RAWDataProc.DATADICT["INFO"]["log"] # YAML 
840
 
860
 

Loading…
Cancel
Save