private void buttonSendWaypoints_Click(object sender, EventArgs e) { if (MauleID != 0 && TruckID != 0) { SIMCONNECT_DATA_WAYPOINT[] wp = new SIMCONNECT_DATA_WAYPOINT[3]; SIMCONNECT_DATA_WAYPOINT[] ft = new SIMCONNECT_DATA_WAYPOINT[2]; simconnect.AddToDataDefinition(DEFINITIONS.MauleWaypoints, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED); simconnect.AddToDataDefinition(DEFINITIONS.FuelTruckWaypoints, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED); // Maule aircraft should fly in circles across the North end of the runway wp[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED; wp[0].Altitude = 800; wp[0].Latitude = 47 + (27.79 / 60); wp[0].Longitude = -122 - (18.46 / 60); wp[0].ktsSpeed = 100; wp[1].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED; wp[1].Altitude = 600; wp[1].Latitude = 47 + (27.79 / 60); wp[1].Longitude = -122 - (17.37 / 60); wp[1].ktsSpeed = 100; wp[2].Flags = (uint)(SIMCONNECT_WAYPOINT_FLAGS.WRAP_TO_FIRST | SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED); wp[2].Altitude = 800; wp[2].Latitude = 47 + (27.79 / 60); wp[2].Longitude = -122 - (19.92 / 60); wp[2].ktsSpeed = 100; // Create a polymorphic array Object[] objv1 = new Object[wp.Length]; wp.CopyTo(objv1, 0); // Send the three waypoints to the Maule simconnect.SetDataOnSimObject(DEFINITIONS.MauleWaypoints, MauleID, 0, objv1); // Truck goes down the runway ft[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED; ft[0].Altitude = 433; ft[0].Latitude = 47 + (25.93 / 60); ft[0].Longitude = -122 - (18.46 / 60); ft[0].ktsSpeed = 75; ft[1].Flags = (uint)(SIMCONNECT_WAYPOINT_FLAGS.WRAP_TO_FIRST | SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED); ft[1].Altitude = 433; ft[1].Latitude = 47 + (26.25 / 60); ft[1].Longitude = -122 - (18.46 / 60); ft[1].ktsSpeed = 55; // Create a polymorphic array Object[] objv2 = new Object[ft.Length]; ft.CopyTo(objv2, 0); // Send the waypoints to the fuel truck simconnect.SetDataOnSimObject(DEFINITIONS.FuelTruckWaypoints, TruckID, 0, objv2); displayText("Waypoint lists sent..."); setButtons(false, false, false, false, true); } else { displayText("Maul M7 or Truck IDs not set!"); } }
private void buttonSendWaypoints_Click(object sender, EventArgs e) { if (Extra300SID != 0 && TruckID != 0) { SIMCONNECT_DATA_WAYPOINT[] wp = new SIMCONNECT_DATA_WAYPOINT[3]; SIMCONNECT_DATA_WAYPOINT[] ft = new SIMCONNECT_DATA_WAYPOINT[2]; simconnect.AddToDataDefinition(DEFINITIONS.Extra300SWaypoints, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED); simconnect.AddToDataDefinition(DEFINITIONS.FuelTruckWaypoints, "AI WAYPOINT LIST", "number", SIMCONNECT_DATATYPE.WAYPOINT, 0.0f, SimConnect.SIMCONNECT_UNUSED); // Extra300S aircraft should fly in circles across the North end of the runway wp[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED; wp[0].Altitude = 800; wp[0].Latitude = 47 + (27.79 / 60); wp[0].Longitude = -122 - (18.46 / 60); wp[0].ktsSpeed = 100; wp[1].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED; wp[1].Altitude = 600; wp[1].Latitude = 47 + (27.79 / 60); wp[1].Longitude = -122 - (17.37 / 60); wp[1].ktsSpeed = 100; wp[2].Flags = (uint)(SIMCONNECT_WAYPOINT_FLAGS.WRAP_TO_FIRST | SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED); wp[2].Altitude = 800; wp[2].Latitude = 47 + (27.79 / 60); wp[2].Longitude = -122 - (19.92 / 60); wp[2].ktsSpeed = 100; // Create a polymorphic array Object[] objv1 = new Object[wp.Length]; wp.CopyTo(objv1, 0); // Send the three waypoints to the Extra300S simconnect.SetDataOnSimObject(DEFINITIONS.Extra300SWaypoints, Extra300SID, 0, objv1); // Truck goes down the runway ft[0].Flags = (uint)SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED; ft[0].Altitude = 433; ft[0].Latitude = 47 + (25.93 / 60); ft[0].Longitude = -122 - (18.46 / 60); ft[0].ktsSpeed = 75; ft[1].Flags = (uint)(SIMCONNECT_WAYPOINT_FLAGS.WRAP_TO_FIRST | SIMCONNECT_WAYPOINT_FLAGS.SPEED_REQUESTED); ft[1].Altitude = 433; ft[1].Latitude = 47 + (26.25 / 60); ft[1].Longitude = -122 - (18.46 / 60); ft[1].ktsSpeed = 55; // Create a polymorphic array Object[] objv2 = new Object[ft.Length]; ft.CopyTo(objv2, 0); // Send the waypoints to the fuel truck simconnect.SetDataOnSimObject(DEFINITIONS.FuelTruckWaypoints, TruckID, 0, objv2); displayText("Waypoint lists sent..."); setButtons(false, false, false, true, true); } else { displayText("Extra 300S or Truck IDs not set!"); } }