Derive and for most enums
This commit is contained in:
@@ -6,6 +6,11 @@ file. This change log follows the conventions of
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
|
||||
- `#[derive(PartialEq)]` has been added to `Condition`, `DataType`, `FacilityType`, `NotificationGroup`, `Period`, `ViewType`, `ClientEvent`, `SystemEventRequest` and `SystemEvent`.
|
||||
- `#[derive(Eq)]` has been added to `Condition`, `DataType`, `FacilityType`, `NotificationGroup`, `Period`, `ViewType`, `ClientEvent` and `SystemEventRequest`.
|
||||
|
||||
### Changed
|
||||
|
||||
- The GitHub repository has been renamed from `mihai-dinculescu/simconnect-sdk` to `mihai-dinculescu/simconnect-sdk-rs`.
|
||||
|
@@ -1,7 +1,7 @@
|
||||
use crate::bindings;
|
||||
|
||||
/// Specifies under which conditions the data is to be sent by the server and received by the client.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Condition {
|
||||
/// The default, data will be sent strictly according to the defined period.
|
||||
None,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/// [`crate::SimConnectObject`] object property data type.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum DataType {
|
||||
Float64,
|
||||
Bool,
|
||||
|
@@ -3,7 +3,7 @@ use std::os::raw::c_char;
|
||||
use crate::{bindings, fixed_c_str_to_string, SimConnectError};
|
||||
|
||||
/// SimConnect System Event Request.
|
||||
#[derive(Debug, Copy, Clone, num_enum::TryFromPrimitive)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, num_enum::TryFromPrimitive)]
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
pub enum SystemEventRequest {
|
||||
@@ -84,7 +84,7 @@ impl SystemEventRequest {
|
||||
}
|
||||
|
||||
/// Cockpit view type.
|
||||
#[derive(Debug, Copy, Clone, num_enum::TryFromPrimitive)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, num_enum::TryFromPrimitive)]
|
||||
#[repr(u32)]
|
||||
pub enum ViewType {
|
||||
/// No cockpit view.
|
||||
@@ -98,7 +98,7 @@ pub enum ViewType {
|
||||
}
|
||||
|
||||
/// SimConnect System Event Notification.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[non_exhaustive]
|
||||
pub enum SystemEvent {
|
||||
/// A notification every second.
|
||||
@@ -274,7 +274,7 @@ pub(crate) const CLIENT_EVENT_START: u32 = 128;
|
||||
/// SimConnect Client Event.
|
||||
///
|
||||
/// WIP. As defined by <https://www.prepar3d.com/SDKv5/sdk/references/variables/event_ids.html>.
|
||||
#[derive(Debug, Copy, Clone, num_enum::TryFromPrimitive)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, num_enum::TryFromPrimitive)]
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
pub enum ClientEvent {
|
||||
|
@@ -2,7 +2,7 @@ use crate::bindings;
|
||||
|
||||
/// Facility Type. The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft.
|
||||
/// They can be requested using [`crate::SimConnect::subscribe_to_facilities`] or [`crate::SimConnect::request_facilities_list`].
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum FacilityType {
|
||||
Airport,
|
||||
Waypoint,
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/// SimConnect event notification group.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[repr(u32)]
|
||||
pub enum NotificationGroup {
|
||||
Group0,
|
||||
|
@@ -5,7 +5,7 @@ use crate::bindings;
|
||||
/// 1 - every other interval.
|
||||
/// 2 - every third interval.
|
||||
/// etc.
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub enum Period {
|
||||
/// Specifies that the data should be sent once only. Note that this is not an efficient way of receiving data frequently, use one of the other periods if there is a regular frequency to the data request.
|
||||
Once,
|
||||
|
Reference in New Issue
Block a user