| Copyright | (c) 2016-19 Brian W Bush |
|---|---|
| License | MIT |
| Maintainer | Brian W Bush <[email protected]> |
| Stability | Production |
| Portability | Portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.UI.Kafka.Interpretation
Description
Interpret user-interfaces events on Kafka topics.
- data Interpretation a b = TrackInterpretation {
- kafka :: TopicConnection
- sensor :: Sensor
- device :: a
- xAxis :: AxisInterpretation b
- yAxis :: AxisInterpretation b
- zAxis :: AxisInterpretation b
- phiAxis :: AxisInterpretation b
- thetaAxis :: AxisInterpretation b
- psiAxis :: AxisInterpretation b
- location :: V3 b
- orientation :: V3 b
- flying :: Bool
- resetButton :: Maybe Int
- data AxisInterpretation a = AxisInterpretation {
- axisNumber :: Int
- threshold :: Maybe a
- increment :: a
- lowerBound :: Maybe a
- upperBound :: Maybe a
- type AnalogHandler a b = b -> Maybe (Int, a)
- type ButtonHandler a b = b -> Maybe (Int, Bool)
- interpretationLoop :: (Conjugate b, Epsilon b, Num b, Ord b, RealFloat b) => AnalogHandler b c -> ButtonHandler b c -> Interpretation a b -> IO c -> IO (ExitAction, LoopAction)
Types
data Interpretation a b Source #
Instructions for interpreting user-interface events from Kafka.
Constructors
| TrackInterpretation | |
Fields
| |
Instances
| (Eq b, Eq a) => Eq (Interpretation a b) Source # | |
| (Read b, Read a) => Read (Interpretation a b) Source # | |
| (Show b, Show a) => Show (Interpretation a b) Source # | |
| Generic (Interpretation a b) Source # | |
| (ToJSON a, ToJSON b) => ToJSON (Interpretation a b) Source # | |
| (FromJSON a, FromJSON b) => FromJSON (Interpretation a b) Source # | |
| type Rep (Interpretation a b) Source # | |
data AxisInterpretation a Source #
Instructions for interpreting an axis.
Constructors
| AxisInterpretation | |
Fields
| |
Instances
| Eq a => Eq (AxisInterpretation a) Source # | |
| Read a => Read (AxisInterpretation a) Source # | |
| Show a => Show (AxisInterpretation a) Source # | |
| Generic (AxisInterpretation a) Source # | |
| ToJSON a => ToJSON (AxisInterpretation a) Source # | |
| FromJSON a => FromJSON (AxisInterpretation a) Source # | |
| type Rep (AxisInterpretation a) Source # | |
type AnalogHandler a b Source #
How to handle raw analog events.
type ButtonHandler a b Source #
Arguments
| = b | The raw event. |
| -> Maybe (Int, Bool) | The button number and whether the button is depressed. |
How to handle raw button events.
Event handling
Arguments
| :: (Conjugate b, Epsilon b, Num b, Ord b, RealFloat b) | |
| => AnalogHandler b c | How to handle raw analog events. |
| -> ButtonHandler b c | How to handle raw button events. |
| -> Interpretation a b | The interpretation. |
| -> IO c | Action for getting the next raw event. |
| -> IO (ExitAction, LoopAction) | Action to create the exit and loop actions. |
Repeatedly interpret events.