pyGrav_main.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:pyGrav 作者: basileh 项目源码 文件源码
def openRawdata(self):
        """
        - Display a file opening window
        - Populate a Campaign object: read all raw data
        - Set a new window for survey selection options
        - link selection options to apropriate functions:
          3 options are currently available: an automatic selection, a
          a selection with a user input file containing start-end dates for
          each survey, and a single srvey selection with a single start-end
          date 
          Each option calls the appropriate function:
              automaticSurveySelection()
              load_start_end_dates()
              askUserSingleSurvey()              
        which then calls the generic self.baseStationSelection() function
        which eventually calls the data populating methods within the 
        data_objects module with the appropriate options.
        """
        # open file
        fname = QtGui.QFileDialog.getOpenFileName(self, 'Open file',self.data_path)                
        campaigndata=Campaign()
        #populate a Campaign object
        campaigndata.readRawDataFile(fname)
        self.campaigndata=campaigndata
        if fname:
            #create new window and set as central Widget:
            surveySelectionWin=QtGui.QWidget()
            self.setCentralWidget(surveySelectionWin)        
            self.statusBar().showMessage("Please choose survey selection method")
            # create buttons and actions
            surveySelectionWin.btn1 = QtGui.QPushButton('automatic survey selection', self)
            surveySelectionWin.btn1.clicked.connect(self.automaticSurveySelection)
            surveySelectionWin.btn2 = QtGui.QPushButton('Load survey dates file', self)
            surveySelectionWin.btn2.clicked.connect(self.load_start_end_dates)
            surveySelectionWin.btn3 = QtGui.QPushButton('Single survey selection', self)
            surveySelectionWin.btn3.clicked.connect(self.askUserSingleSurvey)                        
            #locations                
            grid = QtGui.QGridLayout()
            grid.addWidget(surveySelectionWin.btn1,0,0,1,1)
            grid.addWidget(surveySelectionWin.btn2,1,0,1,1)  
            grid.addWidget(surveySelectionWin.btn3,2,0,1,1)          
            surveySelectionWin.setLayout(grid)   
            surveySelectionWin.setWindowTitle('Survey selections')    
            surveySelectionWin.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号