Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Plotter a
- runPlotter :: Plotter () -> IO ()
- data XAxisType
- addHistoryChannel :: Lookup a => String -> XAxisType -> ((a -> Bool -> IO ()) -> IO ()) -> Plotter ()
- addChannel :: String -> (a -> a -> Bool) -> (a -> [Tree (String, String, Maybe (a -> [[(Double, Double)]]))]) -> ((a -> IO ()) -> IO ()) -> Plotter ()
- class Lookup a
Documentation
add channels to this, then run it with runPlotter
runPlotter :: Plotter () -> IO () Source
fire up the the GUI
XAxisTime | time since the first message |
XAxisTime0 | time since the first message, normalized to 0 (to reduce plot jitter) |
XAxisCount | message index |
XAxisCount0 | message index, normalized to 0 (to reduce plot jitter) |
:: Lookup a | |
=> String | channel name |
-> XAxisType | what to use for the X axis |
-> ((a -> Bool -> IO ()) -> IO ()) | worker which is passed a "new message" function, this will be forked with |
-> Plotter () |
Simplified time-series channel which passes a "send message" function to a worker and forks it using forkIO
.
The plotter will plot a time series of messages sent by the worker.
The worker should pass True to reset the message history, so sending True the first message and False subsequent messages is a good starting place.
You will have to recompile the plotter if the types change.
If you don't want to do this, use the more generic "addChannel" interface
and use a type like a Tree to represent your data.
:: String | channel name |
-> (a -> a -> Bool) | Is the signal tree the same? This is used for instance if signals have changed and the plotter needs to rebuild the signal tree. This lets you keep the plotter running and change other programs which send messages to the plotter. |
-> (a -> [Tree (String, String, Maybe (a -> [[(Double, Double)]]))]) | how to build the signal tree |
-> ((a -> IO ()) -> IO ()) | worker which is passed a "new message" function, this will be forked with |
-> Plotter () |
This is the general interface to plot whatever you want.
Use this when you want to give the whole time series in one go, rather than one at a time
such as with addHistoryChannel
.
Using types or data, you must encode the signal tree with the message so that
the plotter can build you the nice message toggle tree.
re-exported for convenience
class Lookup a
Things which you can make a tree of labeled getters for. You should derive this using GHC.Generics.
Lookup Bool | |
Lookup Double | |
Lookup Float | |
Lookup Int | |
Lookup Int8 | |
Lookup Int16 | |
Lookup Int32 | |
Lookup Int64 | |
Lookup Word | |
Lookup Word8 | |
Lookup Word16 | |
Lookup Word32 | |
Lookup Word64 | |
Lookup String | |
Lookup () | |
Lookup CChar | |
Lookup CSChar | |
Lookup CUChar | |
Lookup CShort | |
Lookup CUShort | |
Lookup CInt | |
Lookup CUInt | |
Lookup CLong | |
Lookup CULong | |
Lookup CLLong | |
Lookup CULLong | |
Lookup CFloat | |
Lookup CDouble | |
Lookup CPtrdiff | |
Lookup CSize | |
Lookup CWchar | |
Lookup CSigAtomic | |
Lookup CClock | |
Lookup CTime | |
Lookup CUSeconds | |
Lookup CSUSeconds | |
Lookup CIntPtr | |
Lookup CUIntPtr | |
Lookup CIntMax | |
Lookup CUIntMax | |
Lookup a => Lookup (Quaternion a) | |
Lookup a => Lookup (V4 a) | |
Lookup a => Lookup (V3 a) | |
Lookup a => Lookup (V2 a) | |
Lookup a => Lookup (V1 a) | |
Lookup a => Lookup (V0 a) | |
Lookup a => Lookup (Euler a) | |
Lookup a => Lookup (V3T f a) | |
Lookup a => Lookup (Rot f1 f2 a) |