From: Mart Lubbers Date: Fri, 23 Jun 2017 18:24:17 +0000 (+0200) Subject: up X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=6badd886c4b09ac1805a005e525447a7e910ea56;p=mTask.git up --- diff --git a/Devices/mTaskDevice.icl b/Devices/mTaskDevice.icl index a91a0b3..36623bd 100644 --- a/Devices/mTaskDevice.icl +++ b/Devices/mTaskDevice.icl @@ -94,16 +94,16 @@ connectDevice procFun device = let ch = channels device = 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)] diff --git a/Shares/mTaskShare.icl b/Shares/mTaskShare.icl index e8ed9a2..d3dea6b 100644 --- a/Shares/mTaskShare.icl +++ b/Shares/mTaskShare.icl @@ -13,10 +13,10 @@ from StdFunc import flip 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 diff --git a/Utils/SDS.icl b/Utils/SDS.icl index f90c029..e23e767 100644 --- a/Utils/SDS.icl +++ b/Utils/SDS.icl @@ -63,10 +63,8 @@ where 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 diff --git a/client/task.h b/client/task.h index 253558e..41ff04a 100644 --- a/client/task.h +++ b/client/task.h @@ -12,7 +12,6 @@ struct task { uint16_t interval; unsigned long lastrun; uint8_t taskid; - struct task *next; uint8_t *bc; char type; int value;