Example #1
0
func handleOnGround(t time.Time, id string, cs string) {
	lastPosition := startlist_db.GetLastPosition(id, t)

	if lastPosition == "air" {
		//fmt.Printf("*** %s landed %s at %s\n", cs, t, id)
		startlist_db.InsertLanding(t, id, cs)
	} else {
		//fmt.Printf("    %s still on ground %s\n", cs, id)
	}
}
Example #2
0
func handleAirborne(t time.Time, id string, cs string) {
	lastPosition := startlist_db.GetLastPosition(id, t)

	if lastPosition == "gnd" {
		//fmt.Printf("*** %s started (%s) at %s\n", cs, t, id)
		startlist_db.InsertStart(t, id, cs)

		go func() {
			delay := 20 * time.Second
			delayed := t.Add(delay)
			time.Sleep(delay)
			detectLaunchType(id, t, delayed, cs)
		}() // TODO: sync
	} else {
		//fmt.Printf("    %s still airborne %s\n", cs, id)
	}
}