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()
评论列表
文章目录