kafka-device-1.0.0.0: UI device events via a Kafka message broker

Copyright(c) 2016-19 Brian W Bush
LicenseMIT
MaintainerBrian W Bush <code@functionally.io>
StabilityProduction
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Network.UI.Kafka.Interpretation

Contents

Description

Interpret user-interfaces events on Kafka topics.

Synopsis

Types

data Interpretation a b Source #

Instructions for interpreting user-interface events from Kafka.

Constructors

TrackInterpretation 

Fields

Instances
(Eq a, Eq b) => Eq (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

(Read a, Read b) => Read (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

(Show a, Show b) => Show (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

Generic (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

Associated Types

type Rep (Interpretation a b) :: Type -> Type #

Methods

from :: Interpretation a b -> Rep (Interpretation a b) x #

to :: Rep (Interpretation a b) x -> Interpretation a b #

(ToJSON a, ToJSON b) => ToJSON (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

(FromJSON a, FromJSON b) => FromJSON (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

type Rep (Interpretation a b) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

type Rep (Interpretation a b) = D1 (MetaData "Interpretation" "Network.UI.Kafka.Interpretation" "kafka-device-1.0.0.0-EqsHhyPPoUkHjkzPUXhYxI" False) (C1 (MetaCons "TrackInterpretation" PrefixI True) (((S1 (MetaSel (Just "kafka") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 TopicConnection) :*: (S1 (MetaSel (Just "sensor") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Sensor) :*: S1 (MetaSel (Just "device") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) :*: (S1 (MetaSel (Just "xAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b)) :*: (S1 (MetaSel (Just "yAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b)) :*: S1 (MetaSel (Just "zAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b))))) :*: ((S1 (MetaSel (Just "phiAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b)) :*: (S1 (MetaSel (Just "thetaAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b)) :*: S1 (MetaSel (Just "psiAxis") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (AxisInterpretation b)))) :*: ((S1 (MetaSel (Just "location") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (V3 b)) :*: S1 (MetaSel (Just "orientation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (V3 b))) :*: (S1 (MetaSel (Just "flying") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool) :*: S1 (MetaSel (Just "resetButton") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe Int)))))))

data AxisInterpretation a Source #

Instructions for interpreting an axis.

Constructors

AxisInterpretation 

Fields

Instances
Eq a => Eq (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

Read a => Read (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

Show a => Show (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

Generic (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

Associated Types

type Rep (AxisInterpretation a) :: Type -> Type #

ToJSON a => ToJSON (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

FromJSON a => FromJSON (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

type Rep (AxisInterpretation a) Source # 
Instance details

Defined in Network.UI.Kafka.Interpretation

type Rep (AxisInterpretation a) = D1 (MetaData "AxisInterpretation" "Network.UI.Kafka.Interpretation" "kafka-device-1.0.0.0-EqsHhyPPoUkHjkzPUXhYxI" False) (C1 (MetaCons "AxisInterpretation" PrefixI True) ((S1 (MetaSel (Just "axisNumber") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: S1 (MetaSel (Just "threshold") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a))) :*: (S1 (MetaSel (Just "increment") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a) :*: (S1 (MetaSel (Just "lowerBound") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a)) :*: S1 (MetaSel (Just "upperBound") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Maybe a))))))

type AnalogHandler a b Source #

Arguments

 = b

The raw event.

-> Maybe (Int, a)

The axis number and value.

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

interpretationLoop Source #

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.

Orphan instances

ToJSON a => ToJSON (Quaternion a) Source # 
Instance details

ToJSON a => ToJSON (V3 a) Source # 
Instance details

Methods

toJSON :: V3 a -> Value #

toEncoding :: V3 a -> Encoding #

toJSONList :: [V3 a] -> Value #

toEncodingList :: [V3 a] -> Encoding #

FromJSON a => FromJSON (Quaternion a) Source # 
Instance details

FromJSON a => FromJSON (V3 a) Source # 
Instance details

Methods

parseJSON :: Value -> Parser (V3 a) #

parseJSONList :: Value -> Parser [V3 a] #