Ejemplo n.º 1
0
	def openDataFile(self, Locomotif):
		""" Load a Data File for Further Processing """
		dataFilename = self.tools.selectDataFile()
		if dataFilename == "":
			self.tools.showInfo( "Info", "NO FILE SELECTED" )
			return 0
		
		# deactivate all tabs 
		g_rundata.setWorkingState(1)
		self.work.workCleanTabs( g_tabwidgets, g_rundata )
		g_tabwidgets.t1Data.setCurrentIndex(0)
		
		# store name in global data	
		g_rundata.setDataFileName( dataFilename )
		# set data into current tab
		g_tabwidgets.t1LoadedDataFilename.setText(dataFilename)
		
		# load and display initial data
		self.work.readDataFileIntoTable( g_tabwidgets, g_rundata, dataFilename )
		self.work.markDataOnGoogleMap( g_tabwidgets, g_rundata )
		print "data marked on google map type " + g_rundata.getGoogle1Maptype()
		
		# initial names for maps
		mapv1Filename = configData.getMapPath() + "/" + ntpath.basename(str(dataFilename)) + "_bio_v.png"
		mapv2Filename = configData.getMapPath() + "/" + ntpath.basename(str(dataFilename)) + "_div_v.png"
		print mapv1Filename
		print mapv2Filename
		g_rundata.setV1Mapname( mapv1Filename )
		g_rundata.setV2Mapname( mapv2Filename )
		mapd1Filename = configData.getMapPath() + "/" + ntpath.basename(str(dataFilename)) + "_bio_d.png"
		mapd2Filename = configData.getMapPath() + "/" + ntpath.basename(str(dataFilename)) + "_div_d.png"
		g_rundata.setD1Mapname( mapd1Filename )
		g_rundata.setD2Mapname( mapd2Filename )
		
		return 1
Ejemplo n.º 2
0
	def selectCustomTabPage(self, selectedIndex ):
		print "switch to custom tab page " + str(selectedIndex)
		# save the global rundata into the current tab element
		# before switching to another one
		if self.selectedRundata != None:
			self.selectedRundata.get_g_rundata()
		# now switch to another tab
		print "Select tab " + str(selectedIndex)
		self.selectedIndex = selectedIndex
		self.selectedCustomTab = self.tabList[selectedIndex]
		self.selectedInternalnum = self.selectedCustomTab.getInternalnum()
		self.selectedRundata = self.selectedCustomTab.getRundataBuffer()
		# set this widgets as the global widgets to work on it now
		self.selectedCustomTab.getWidgetBuffer().set_g_tabwidgets()
		# set this rundata as the global rundata to work on it now
		self.selectedRundata.set_g_rundata()
		
		# insert some start values into the widgets
		mapWidth = g_rundata.getGoogleMapWidth()
		g_tabwidgets.t1GMMapWidth.setText(str(mapWidth))
		g_tabwidgets.t1GM2MapWidth.setText(str(mapWidth))
		mapHeight = g_rundata.getGoogleMapHeight()
		g_tabwidgets.t1GMMapHeight.setText(str(mapHeight))
		g_tabwidgets.t1GM2MapHeight.setText(str(mapHeight))
		maptype = g_rundata.getGoogle1Maptype()
		print "google map type 1 = " + maptype
		if maptype == "hybrid":
			g_tabwidgets.t1GMmaptype.setChecked(True)
			print "set button hybrid"
		if maptype == "satellite":
			g_tabwidgets.t1GMmaptype_2.setChecked(True)
			print "set button satellite"
		if maptype == "roadmap":
			g_tabwidgets.t1GMmaptype_3.setChecked(True)
			print "set button roadmap"
		if maptype == "terrain":
			g_tabwidgets.t1GMmaptype_4.setChecked(True)
			print "set button terrain"
		maptype = g_rundata.getGoogle2Maptype()
		print "google map type 2 = " + maptype
		if maptype == "hybrid":
			g_tabwidgets.t1GM2maptype.setChecked(True)
			print "set button hybrid"
		if maptype == "satellite":
			g_tabwidgets.t1GM2maptype_2.setChecked(True)
			print "set button satellite"
		if maptype == "roadmap":
			g_tabwidgets.t1GM2maptype_3.setChecked(True)
			print "set button roadmap"
		if maptype == "terrain":
			g_tabwidgets.t1GM2maptype_4.setChecked(True)
			print "set button terrain"