= withDevices device (\d->{d & deviceTask=Nothing, deviceError=Just e}) @! ()
manageDevices :: (MTaskDevice (Shared Channels) -> Task ()) -> Task ()
-manageDevices processFun = get deviceStoreNP >>= \ds->anyTask [
- addDevice processFun <<@ Title "Add new device" @! ()]//:
-// [viewDevice processFun d <<@ Title d.deviceName\\d<-ds]]
+manageDevices processFun = whileUnchanged deviceStoreNP $ \ds->anyTask [
+ addDevice processFun <<@ Title "Add new device" @! ():
+ [viewDevice processFun d <<@ Title d.deviceName\\d<-ds]]
<<@ ArrangeWithTabs
@! ()
viewDevice :: (MTaskDevice (Shared Channels) -> Task ()) MTaskDevice -> Task ()
viewDevice pf d = forever $ traceValue "viewDevice" >>| anyTask
[viewInformation "Device settings" [] d @! ()
- /*,viewSharedInformation "Channels" [ViewAs dropEmpty] (channels d) @! ()*/
+ ,viewSharedInformation "Channels" [ViewAs dropEmpty] (channels d) @! ()
,forever $
enterChoice "Delete task on device" [ChooseFromGrid id] d.deviceTasks
>>* [OnAction (Action "Delete") $ ifValue (\t->t.ident <> -1) (deviceTaskDelete d)]
derive class iTask MTaskShare
manageShares :: Task [MTaskDevice]
-manageShares = viewInformation "" [] []//whileUnchanged deviceStoreNP
-// $ \devs->case devs of
-// [] = viewInformation "No devices yet" [] []
-// _ = allTasks (map manageSharesOnDevice devs)
+manageShares = whileUnchanged deviceStoreNP
+ $ \devs->case devs of
+ [] = viewInformation "No devices yet" [] []
+ _ = allTasks (map manageSharesOnDevice devs)
manageSharesOnDevice :: MTaskDevice -> Task MTaskDevice
manageSharesOnDevice dev = (case dev.deviceShares of
notifyPred (Just (d1, i1)) (Just (d2, i2)) = d1 == d2 && i1 == i2
realDeviceStore :: Shared [MTaskDevice]
-realDeviceStore = memoryShare "mTaskDevices" []
-
-bcStateStore :: Shared BCState
-bcStateStore = memoryShare "mTaskBCState" zero
+realDeviceStore = sharedStore "mTaskDevices" []
+//realDeviceStore = memoryShare "mTaskDevices" []
mTaskTaskStore :: Shared [String]
mTaskTaskStore = memoryShare "mTaskTasks" $ 'DM'.keys allmTasks
uint16_t interval;
unsigned long lastrun;
uint8_t taskid;
- struct task *next;
uint8_t *bc;
char type;
int value;