Safe Haskell | None |
---|---|
Language | Haskell2010 |
PlotHo
Contents
- data Plotter a
- runPlotter :: Plotter () -> IO ()
- data XAxisType
- addHistoryChannel :: Lookup a => String -> XAxisType -> ((a -> Bool -> IO ()) -> IO ()) -> Plotter ()
- type Meta = [Tree ([String], Either String Int)]
- addHistoryChannel' :: String -> ((Double -> Vector Double -> Maybe Meta -> IO ()) -> IO ()) -> Plotter ()
- addChannel :: String -> (a -> a -> Bool) -> (a -> [Tree ([String], Either String (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
Constructors
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) |
Arguments
:: 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, or use the "addHistoryChannel'" function.
Arguments
:: String | channel name |
-> ((Double -> Vector Double -> Maybe Meta -> IO ()) -> IO ()) | worker which is passed a "new message" function, this will be forked with |
-> Plotter () |
Dynamic time-series channel which can change its signal tree without recompiling the plotter.
Arguments
:: 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], Either String (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.