Calibration
public class Calibration : ObservableObject
The calibration class provides Publisher
and functions to perform a calibration of Skyle.
-
A reference to the current client, which represents the gRPC connection. This is automatically updated by
ET
when a new connection is established.Declaration
Swift
internal var client: Skyle_SkyleNIOClient?
-
Internal empty constructor
Declaration
Swift
internal init()
-
Internal constructor passing a possible client
Declaration
Swift
internal init(_ client: Skyle_SkyleNIOClient?)
-
A simple struct containing the possible calibrations represented as array of ids.
See moreDeclaration
Swift
public struct Points
-
The
type
property exposes aPublisher
which indicates the type of calibration. Currently not actively used. Should be set to either value inET.Calibration.Points
Declaration
Swift
@Published private(set) public var type: [Int] { get set }
-
The
state
property exposes aPublisher
which indicates the state of the calibration.Declaration
Swift
@Published private(set) public var state: States { get set }
-
The
control
property exposes aPublisher
which holds the control messages fot the calibration. This can be used to send a control message to the calibration to abort the calibration for example. SeeCalibration.stop()
.Declaration
Swift
@Published private(set) public var control: Skyle_CalibControlMessages? { get set }
-
The
point
property exposes aPublisher
which indicates the calibration point as coordinates on the screen.Declaration
Swift
@Published private(set) public var point: Point { get set }
-
The
currentPoint
property exposes aPublisher
which indicates the calibration point count (0, 1, 2, 3, …).Declaration
Swift
@Published private(set) public var currentPoint: Int { get set }
-
The
quality
property exposes aPublisher
which indicates the overall quality of the calibration.Declaration
Swift
@Published private(set) public var quality: Double { get set }
-
The
qualities
property exposes aPublisher
which indicates the quality of each point of the calibration.Declaration
Swift
@Published private(set) public var qualities: [Double] { get set }
-
Simple cleanup by killing the calibration gRPC call.
Declaration
Swift
deinit
-
Starts a calibration asyncronously, updating the
state
,point
,currentPoint
,quality
andqualities
properties.- points: Amount of calibration points. Pass one of
ET.Calibration.Points
. - stopHID: Tells Skyle to stop HID (Mouse positioning updates) during the calibration. Resets after the calibration has finished.
- recalibrate: Tells the calibration to keep the connection open after the calibration has finished to perform a possible recalibration of certain points.
- width: Screen width in pixels.
- height: Screen height in pixels.
- stepped: Indicating if the user wants to manually step through the calibration points. Need to call next()
- points: Amount of calibration points. Pass one of
-
When stepByStep is true this will request the next calibration point
Declaration
Swift
public func next()
-
The width in pixels of the iPad Pro 12,9
Declaration
Swift
public static let width: Int32
-
The height in pixels of the iPad Pro 12,9
Declaration
Swift
public static let height: Int32
-
Calculates the x position in pixel of a calibration point by providing a value from
Points.<Value>
and the width of the screen in pixel.Declaration
Swift
public static func calcX(_ id: Int, _ width: Float) -> Float
-
Calculates the y position in pixel of a calibration point by providing a value from
Points.<Value>
and the width and height of the screen in pixel.Declaration
Swift
public static func calcY(_ id: Int, width: Float, height: Float) -> Float
-
Undocumented
Declaration
Swift
public func fakeCalibration(points: [Int] = Points.Nine)