Cleanup the docs
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
||||
|
||||
/// A data structure that will be used to receive data from SimConnect.
|
||||
#[derive(Debug, Clone, SimConnectObject)]
|
||||
#[simconnect(period = "second")]
|
||||
#[allow(dead_code)]
|
||||
struct GpsData {
|
||||
#[simconnect(name = "PLANE LATITUDE", unit = "degrees")]
|
||||
lat: f64,
|
||||
@@ -15,7 +14,7 @@ struct GpsData {
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let client = SimConnect::new("Simple Program");
|
||||
let client = SimConnect::new("Receiving data example");
|
||||
|
||||
match client {
|
||||
Ok(mut client) => {
|
||||
|
@@ -1,10 +1,9 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
||||
|
||||
/// A data structure that will be used to receive data from SimConnect.
|
||||
#[derive(Debug, Clone, SimConnectObject)]
|
||||
#[simconnect(period = "second")]
|
||||
#[allow(dead_code)]
|
||||
struct GpsData {
|
||||
#[simconnect(name = "PLANE LATITUDE", unit = "degrees")]
|
||||
lat: f64,
|
||||
@@ -17,13 +16,14 @@ struct GpsData {
|
||||
/// A second data structure that will be used to receive data from SimConnect.
|
||||
#[derive(Debug, Clone, SimConnectObject)]
|
||||
#[simconnect(period = "second", condition = "changed")]
|
||||
#[allow(dead_code)]
|
||||
pub struct OnGround {
|
||||
#[simconnect(name = "SIM ON GROUND", unit = "bool")]
|
||||
sim_on_ground: bool,
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let client = SimConnect::new("Simple Program");
|
||||
let client = SimConnect::new("Receiving data example");
|
||||
|
||||
match client {
|
||||
Ok(mut client) => loop {
|
||||
|
@@ -1,5 +1,3 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use simconnect_sdk::{Notification, SimConnect, SimConnectObject};
|
||||
use tracing::{error, info};
|
||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||
@@ -7,6 +5,7 @@ use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||
/// A data structure that will be used to receive data from SimConnect.
|
||||
#[derive(Debug, Clone, SimConnectObject)]
|
||||
#[simconnect(period = "second")]
|
||||
#[allow(dead_code)]
|
||||
struct GpsData {
|
||||
#[simconnect(name = "PLANE LATITUDE", unit = "degrees")]
|
||||
lat: f64,
|
||||
@@ -19,7 +18,7 @@ struct GpsData {
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
setup_logging()?;
|
||||
|
||||
let client = SimConnect::new("Simple Program");
|
||||
let client = SimConnect::new("Receiving data example");
|
||||
|
||||
match client {
|
||||
Ok(mut client) => {
|
||||
|
@@ -1,5 +1,3 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use simconnect_sdk::{
|
||||
Condition, DataType, Notification, Object, Period, SimConnect, SimConnectError,
|
||||
SimConnectObjectExt,
|
||||
@@ -7,6 +5,7 @@ use simconnect_sdk::{
|
||||
|
||||
/// A data structure that will be used to receive data from SimConnect.
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(dead_code)]
|
||||
pub struct GpsData {
|
||||
lat: f64,
|
||||
lon: f64,
|
||||
@@ -34,7 +33,7 @@ impl TryFrom<&Object> for GpsData {
|
||||
}
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let client = SimConnect::new("Simple Program");
|
||||
let client = SimConnect::new("Receiving data example");
|
||||
|
||||
match client {
|
||||
Ok(mut client) => {
|
||||
|
@@ -1,7 +1,7 @@
|
||||
use simconnect_sdk::{FacilityType, Notification, SimConnect};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
let client = SimConnect::new("Simple Program");
|
||||
let client = SimConnect::new("Facilities example");
|
||||
|
||||
match client {
|
||||
Ok(mut client) => loop {
|
||||
|
Reference in New Issue
Block a user