Copyright | (c) 2016-19 Brian W Bush |
---|---|
License | MIT |
Maintainer | Brian W Bush <code@functionally.io> |
Stability | Production |
Portability | Portable |
Safe Haskell | None |
Language | Haskell2010 |
Interpret user-interfaces events on Kafka topics.
Synopsis
- 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.
TrackInterpretation | |
|
Instances
data AxisInterpretation a Source #
Instructions for interpreting an axis.
AxisInterpretation | |
|
Instances
type AnalogHandler a b Source #
How to handle raw analog events.
type ButtonHandler a b Source #
How to handle raw button events.
Event handling
:: (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.
Orphan instances
ToJSON a => ToJSON (Quaternion a) Source # | |
toJSON :: Quaternion a -> Value # toEncoding :: Quaternion a -> Encoding # toJSONList :: [Quaternion a] -> Value # toEncodingList :: [Quaternion a] -> Encoding # | |
ToJSON a => ToJSON (V3 a) Source # | |
FromJSON a => FromJSON (Quaternion a) Source # | |
parseJSON :: Value -> Parser (Quaternion a) # parseJSONList :: Value -> Parser [Quaternion a] # | |
FromJSON a => FromJSON (V3 a) Source # | |