Updated SDK
Some checks failed
CI / Rust checks (push) Failing after 6s

This commit is contained in:
2024-10-20 12:01:48 +02:00
parent 856656e23b
commit bee3553d9e
9 changed files with 499 additions and 338 deletions

View File

@@ -24,41 +24,41 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Some(Notification::AirportList(data)) => {
for record in data {
// The returned list is quite large, so we look for a particular record
if record.icao == "EGSC" {
println!("{record:?}");
// there's no need to unsubscribe
// because this is a one-off request, not a subscription
}
// if record.icao == "EGSC" {
// println!("{record:?}");
// // there's no need to unsubscribe
// // because this is a one-off request, not a subscription
// }
}
}
Some(Notification::WaypointList(data)) => {
for record in data {
// The returned list is quite large, so we look for a particular record
if record.icao == "BRAIN" {
println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::Waypoint)?;
}
// if record.icao == "BRAIN" {
// println!("{record:?}");
// // we've got the entry we're interesting in - we can unsubscribe now
// client.unsubscribe_to_facilities(FacilityType::Waypoint)?;
// }
}
}
Some(Notification::NdbList(data)) => {
for record in data {
// The returned list is quite large, so we look for a particular record
if record.icao == "CAM" {
println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::NDB)?;
}
// if record.icao == "CAM" {
// println!("{record:?}");
// // we've got the entry we're interesting in - we can unsubscribe now
// client.unsubscribe_to_facilities(FacilityType::NDB)?;
// }
}
}
Some(Notification::VorList(data)) => {
for record in data {
// The returned list is quite large, so we look for a particular record
if record.icao == "LON" {
println!("{record:?}");
// we've got the entry we're interesting in - we can unsubscribe now
client.unsubscribe_to_facilities(FacilityType::VOR)?;
}
// if record.icao == "LON" {
// println!("{record:?}");
// // we've got the entry we're interesting in - we can unsubscribe now
// client.unsubscribe_to_facilities(FacilityType::VOR)?;
// }
}
}
_ => (),

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -1 +1 @@
0.20.5.0
0.24.3.0

View File

@@ -44,8 +44,10 @@ impl FacilityType {
/// Information on a single airport in the facilities cache.
#[derive(Debug, Clone)]
pub struct Airport {
/// ICAO of the facility.
pub icao: String,
/// Ident of the facility.
pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility.
pub lat: f64,
/// Longitude of the airport in facility.
@@ -57,8 +59,10 @@ pub struct Airport {
/// Information on a single waypoint in the facilities cache.
#[derive(Debug, Clone)]
pub struct Waypoint {
/// ICAO of the facility.
pub icao: String,
/// Ident of the facility.
pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility.
pub lat: f64,
/// Longitude of the airport in facility.
@@ -72,8 +76,10 @@ pub struct Waypoint {
/// Information on a single NDB station in the facilities cache.
#[derive(Debug, Clone)]
pub struct NDB {
/// ICAO of the facility.
pub icao: String,
/// Ident of the facility.
pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility.
pub lat: f64,
/// Longitude of the airport in facility.
@@ -89,8 +95,10 @@ pub struct NDB {
/// Information on a single VOR station in the facilities cache.
#[derive(Debug, Clone)]
pub struct VOR {
/// ICAO of the facility.
pub icao: String,
/// Ident of the facility.
pub ident: String,
/// Region of the facility.
pub region: String,
/// Latitude of the airport in facility.
pub lat: f64,
/// Longitude of the airport in facility.

View File

@@ -242,7 +242,8 @@ impl SimConnect {
let record = unsafe { event.rgData.get_unchecked(i) };
Airport {
icao: fixed_c_str_to_string(&record.Icao),
ident: fixed_c_str_to_string(&record.Ident),
region: fixed_c_str_to_string(&record.Region),
lat: record.Latitude,
lon: record.Longitude,
alt: record.Altitude,
@@ -270,7 +271,8 @@ impl SimConnect {
let record = unsafe { event.rgData.get_unchecked(i) };
Waypoint {
icao: fixed_c_str_to_string(&record._base.Icao),
ident: fixed_c_str_to_string(&record._base.Ident),
region: fixed_c_str_to_string(&record._base.Region),
lat: record._base.Latitude,
lon: record._base.Longitude,
alt: record._base.Altitude,
@@ -299,7 +301,8 @@ impl SimConnect {
let record = unsafe { event.rgData.get_unchecked(i) };
NDB {
icao: fixed_c_str_to_string(&record._base._base.Icao),
ident: fixed_c_str_to_string(&record._base._base.Ident),
region: fixed_c_str_to_string(&record._base._base.Region),
lat: record._base._base.Latitude,
lon: record._base._base.Longitude,
alt: record._base._base.Altitude,
@@ -342,7 +345,8 @@ impl SimConnect {
== bindings::SIMCONNECT_RECV_ID_VOR_LIST_HAS_DME;
VOR {
icao: fixed_c_str_to_string(&record._base._base._base.Icao),
ident: fixed_c_str_to_string(&record._base._base._base.Ident),
region: fixed_c_str_to_string(&record._base._base._base.Region),
lat: record._base._base._base.Latitude,
lon: record._base._base._base.Longitude,
alt: record._base._base._base.Altitude,