Commit ca010006 authored by Guerric Chupin's avatar Guerric Chupin

GUI is coherent and automaton runs fine.

parent ab7c9b25
......@@ -219,9 +219,11 @@ createNotebook addLayerRV rmLayerRV layerMCBMVar guiCellMCBMVar = do
boardMapRV :: ReactiveFieldRead IO (M.IntMap Board)
boardMapRV = ReactiveFieldRead getter notifier
where notifier = reactiveValueOnCanRead chanMapRV
where notifier io = do
chanMap <- reactiveValueRead chanMapRV
mapM_ ((\val -> reactiveValueOnCanRead val io) . \(b,_,_) -> b) chanMap
getter = do
chanMap <- reactiveValueRead chanMapRV
sequence (M.map (reactiveValueRead . \(b,_,_) -> b) chanMap)
mapM (reactiveValueRead . \(b,_,_) -> b) chanMap
return (n, boardMapRV, layerMapRV, phMapRV)
......@@ -79,9 +79,11 @@ main = do
boardMapRV layerMapRV tempoRV' boardRunRV
initSF <- reactiveValueRead inRV
(inBoard, outBoard) <- yampaReactiveDual initSF (boardRun initSF)
--reactiveValueOnCanRead inRV (reactiveValueRead inRV >>= print . M.keys)
inRV =:> inBoard
reactiveValueOnCanRead outBoard $ do
out <- reactiveValueRead outBoard
--print out
phRVMap <- reactiveValueRead phRVMapRV
let eventsMap = M.filter isEvent out
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment