本文整理汇总了Python中track.Track.setStart方法的典型用法代码示例。如果您正苦于以下问题:Python Track.setStart方法的具体用法?Python Track.setStart怎么用?Python Track.setStart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类track.Track
的用法示例。
在下文中一共展示了Track.setStart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: loadTrack
# 需要导入模块: from track import Track [as 别名]
# 或者: from track.Track import setStart [as 别名]
def loadTrack(self, trackfilename, track_id, flight_start):
#trackflilename does not include the path, it's only name and extesion
#track = open("./Flight1.txt", "r")
track = Track(track_id)
cont = 0
with open(self.scenariosfolder + "/" + self.scenarioName + "/" + trackfilename, "r") as trackfile:
for line in trackfile:
if (not (line.startswith('#') or line.startswith('/'))) and len(line)>30:
#if cont >= 4 and len(line)>30:
parts = line.split()
timestamp = parts[0]
lat = float(parts[1])
lon = float(parts[2])
altitude = float(parts[3])
heading = float(parts[6])
v_x = float(parts[8])
v_y = float(parts[10])
v_z = float(parts[9])
pitch = float(parts[4])
bank = float(parts[5])
onground = int(parts[7])
airspeed = float(parts[19])
track.addStep(timestamp, lat, lon, altitude, v_x, v_y, v_z, heading, pitch, bank, onground, airspeed)
#track.addStep(timestamp, lat, lon, altitude, v_x, v_y, v_z, heading, pitch, bank)
#cherrypy.log("%s,%s,%s,%s,%s,%s,%s,%s"%(timestamp, lat, lon, altitude, v_x, v_y, v_z, heading),context="EXPORT,")
cont += 1
track.setStart(flight_start)
return track