-
Notifications
You must be signed in to change notification settings - Fork 2
OTPModuleParent
OTP Module Parent
public struct OTPModuleParent: OTPModule, Hashable
Implements an OTP Standard Module of the Parent type and handles creation and parsing.
This data structure contains the Address of the Parent of the Point and a flag which indicates whether other modules contained in this Point are relative to the Parent Point.
Example usage:
do {
let address = try OTPAddress(1,2,10)
let module = OTPModuleParent(address: address, relative: false)
// do something with module
} catch {
// handle error
}
Hashable
, OTPModule
Initializes this OTPModule
with default values.
public init()
Initializes an OTP Module Parent.
public init(address: OTPAddress, relative: Bool = false)
- address: The Address of the Parent Point.
- relative: Whether this Points other Modules contain values relative to the Parent Point.
Uniquely identifies the module using an OTPModuleIdentifier
.
let identifier: OTPModuleIdentifier
The size of the module's data in bytes.
let dataLength: OTPPDULength
The total size of the module in bytes, including identifiers and length.
let moduleLength: OTPPDULength
Whether the other OTPModule
s contained within the same OTPPoint
have values which are relative to the parent point.
var relative: Bool
The OTPSystemNumber
of the parent of the OTPPoint
containing this module.
var systemNumber: OTPSystemNumber
The OTPGroupNumber
of the parent of the OTPPoint
containing this module.
var groupNumber: OTPGroupNumber
The OTPPointNumber
of the parent of the OTPPoint
containing this module.
var pointNumber: OTPPointNumber
A human-readable log description of this module.
var logDescription: String
Creates a Module as Data.
public func createAsData() -> Data
The OTPModule
as a Data
object.
Attempts to create an OTPModuleParent
from the data.
public static func parse(fromData data: Data) throws -> (module: Self, length: OTPPDULength)
- data: The data to be parsed.
An error of type ModuleLayerValidationError
.
A valid OTPModuleParent
and the length of the PDU.
Merges an arrray of modules.
public static func merge(modules: [OTPModule]) -> (module: Self?, excludePoint: Bool)
Precondition: All modules must be of the same type.
- modules: The
OTPModule
s to be merged.
An optional OTPModule
of this type, and whether to exclude the OTPPoint
due to a mismatch.
Calculates whether this module is considered equal to another one.
public func isEqualToModule(_ module: OTPModule) -> Bool
Precondition: Both modules must be of the same type.
- module: The
OTPModule
to be compared against.
Whether these OTPModule
s are considered equal.
Generated at 2021-09-01T18:46:51+0000 using swift-doc 1.0.0-rc.1.
Types
- ComponentSocketError
- OTPAddress
- OTPComponentState
- OTPConsumer
- OTPConsumerStatus
- OTPIPMode
- OTPModuleIdentifier
- OTPModulePosition
- OTPModulePosition.Scaling
- OTPModulePositionVelAccel
- OTPModuleReferenceFrame
- OTPModuleRotation
- OTPModuleRotationVelAccel
- OTPModuleScale
- OTPPoint
- OTPPointValidationError
- OTPProducer
- OTPProducerStatus