Commit a759534d authored by Steffen Michels's avatar Steffen Michels

use 'SimpleSDSLens' synonym where applicable

parent 000d40a6
Pipeline #17925 passed with stage
in 4 minutes and 29 seconds
......@@ -18,7 +18,7 @@ import Incidone.OP.Concepts
:: ActionDefinition c
= { identity :: String
, meta :: ItemMeta
, task :: c (SDSLens () ActionStatus ActionStatus) -> Task ()
, task :: c (SimpleSDSLens ActionStatus) -> Task ()
}
//Wrapped action for storage in the action catalog
......@@ -36,7 +36,7 @@ import Incidone.OP.Concepts
:: ActionTasks
= E.c sds: ActionTasks
([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) //Configuration task
(c (SDSLens () ActionStatus ActionStatus) -> Task ()) & iTask c //An action item that needs to be configured before it can be deployed
(c (SimpleSDSLens ActionStatus) -> Task ()) & iTask c //An action item that needs to be configured before it can be deployed
:: ActionProgress
= ActionPlanned
......@@ -158,7 +158,7 @@ addDefaultStatus :: (Task c) -> ([ContactNo] [IncidentNo] -> Task (c,
//Shared catalog of predefined action items
actionCatalog :: SDSLens () [CatalogAction] ()
builtinActionCatalog :: SDSSource () [CatalogAction] ()
userActionCatalog :: SDSLens () [UserCatalogAction] [UserCatalogAction]
userActionCatalog :: SimpleSDSLens [UserCatalogAction]
//Shares providing filtered views on iTasks task instances.
//They select only those detached tasks that are tagged to be action items
......@@ -175,12 +175,12 @@ numActionsByContact :: SDSLens ContactNo Int ()
todoItemTask :: () (Shared sds ActionStatus) -> Task () | RWShared sds
blankTodoItem :: CatalogAction
predefinedTodoItem :: String ItemMeta -> CatalogAction
predefinedInstantItem :: String ItemMeta ActionProgress ((SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction
predefinedConfigurableItem :: String ItemMeta ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (c (SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a & iTask c
predefinedInstantItem :: String ItemMeta ActionProgress ((SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction
predefinedConfigurableItem :: String ItemMeta ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (c (SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction | iTask a & iTask c
//Contact or incident
predefinedIncidentItem :: String ItemMeta (IncidentNo (SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedContactItem :: String ItemMeta (Maybe String) (ContactNo (SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedIncidentItem :: String ItemMeta (IncidentNo (SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedContactItem :: String ItemMeta (Maybe String) (ContactNo (SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction | iTask a
//Action lists items
listItemTask :: (String,ActionPlan) (Shared sds ActionStatus) -> Task () | RWShared sds
......
......@@ -100,7 +100,7 @@ fromSelfActionStatus status (_,items) = case [i \\ i=:{TaskListItem|taskId,self}
[{TaskListItem|taskId,attributes}:_] = Ok (Just [(taskId,fromActionStatus status attributes)])
_ = Error (exception "Task id not found in self management share")
selfActionStatus :: (SharedTaskList a) -> SDSLens () ActionStatus ActionStatus | iTask a
selfActionStatus :: (SharedTaskList a) -> SimpleSDSLens ActionStatus | iTask a
selfActionStatus list = sdsFocus taskListFilter (mapReadWriteError (toSelfActionStatus,fromSelfActionStatus) Nothing list)
where
taskListFilter = {TaskListFilter|onlyIndex=Nothing,onlyTaskId=Nothing,onlySelf=False
......@@ -171,24 +171,24 @@ where
addDefaultStatus :: (Task c) -> ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) | iTask c
addDefaultStatus task = \initContacts initIncidents -> task @ \c -> (c,{ActionStatus|defaultValue & contacts = initContacts, incidents = initIncidents})
predefinedInstantItem :: String ItemMeta ActionProgress ((SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction
predefinedInstantItem :: String ItemMeta ActionProgress ((SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction
predefinedInstantItem identity meta=:{ItemMeta|title,description} progress task
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer itemtask}
where
configer initContacts initIncidents = return ((),{ActionStatus|title=title,description=description,progress=progress,contacts=initContacts,incidents=initIncidents})
itemtask _ status = task status @? const NoValue
predefinedConfigurableItem :: String ItemMeta ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (c (SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a & iTask c
predefinedConfigurableItem :: String ItemMeta ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (c (SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction | iTask a & iTask c
predefinedConfigurableItem identity meta configer task
= {CatalogAction|identity=identity,meta=meta,tasks=ActionTasks configer (\c s -> task c s @? const NoValue)}
predefinedIncidentItem :: String ItemMeta (IncidentNo (SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedIncidentItem :: String ItemMeta (IncidentNo (SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedIncidentItem identity meta incidentTask
= toIncidentAction {ActionDefinition|identity=identity,meta=meta,task=task}
where
task status incidentNo = incidentTask status incidentNo @? const NoValue
predefinedContactItem :: String ItemMeta (Maybe String) (ContactNo (SDSLens () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedContactItem :: String ItemMeta (Maybe String) (ContactNo (SimpleSDSLens ActionStatus) -> Task a) -> CatalogAction | iTask a
predefinedContactItem identity meta mbGroup contactTask
= toContactAction mbGroup {ActionDefinition|identity=identity,meta=meta,task=task}
where
......@@ -261,7 +261,7 @@ builtinActionCatalog = constShare
:crewListActions
]
userActionCatalog :: SDSLens () [UserCatalogAction] [UserCatalogAction]
userActionCatalog :: SimpleSDSLens [UserCatalogAction]
userActionCatalog = sharedStore "UserActionCatalog" []
//Todo items
......@@ -740,7 +740,7 @@ where
= configer initContacts initIncidents <<@ Title "Configure" /* <<@ AfterLayout (uiDefSetHeight FlexSize) */
>>? \(config,initStatus) -> addAction identity initStatus list (\l -> task config l)
addAction :: String ActionStatus (SharedTaskList a) ((SDSLens () ActionStatus ActionStatus) -> Task ()) -> Task TaskId | iTask a
addAction :: String ActionStatus (SharedTaskList a) ((SimpleSDSLens ActionStatus) -> Task ()) -> Task TaskId | iTask a
addAction identity initStatus list task
= logActionAdded initStatus
>>| appendTask (Detached attributes True) (\l -> (task (selfActionStatus l) @? const NoValue)) list
......
......@@ -34,15 +34,15 @@ from iTasks.Extensions.Web import :: URL
derive class iTask DBConfig, AISConfig, AsteriskConfig, SMTPConfig, WebLinksConfig, WebLink
//Master configuration shares
databaseConfig :: SDSLens () DBConfig DBConfig
aisLinkConfig :: SDSLens () AISConfig AISConfig
asteriskLinkConfig :: SDSLens () AsteriskConfig AsteriskConfig
smtpConfig :: SDSLens () SMTPConfig SMTPConfig
webLinksConfig :: SDSLens () WebLinksConfig WebLinksConfig
adminPassword :: SDSLens () Password Password
databaseConfig :: SimpleSDSLens DBConfig
aisLinkConfig :: SimpleSDSLens AISConfig
asteriskLinkConfig :: SimpleSDSLens AsteriskConfig
smtpConfig :: SimpleSDSLens SMTPConfig
webLinksConfig :: SimpleSDSLens WebLinksConfig
adminPassword :: SimpleSDSLens Password
//Derived configuration shares
databaseDef :: SDSLens () SQLDatabaseDef SQLDatabaseDef
databaseDef :: SimpleSDSLens SQLDatabaseDef
//Conversion functions
toDatabaseDef :: DBConfig -> SQLDatabaseDef
......
......@@ -4,26 +4,26 @@ import iTasks, iTasks.Extensions.SQLDatabase, iTasks.Extensions.Web
derive class iTask DBConfig, AISConfig, AsteriskConfig, SMTPConfig, WebLinksConfig, WebLink
//Shared stores
databaseConfig :: SDSLens () DBConfig DBConfig
databaseConfig :: SimpleSDSLens DBConfig
databaseConfig = sharedStore "databaseConfig" InternalSQLiteDB
aisLinkConfig :: SDSLens () AISConfig AISConfig
aisLinkConfig :: SimpleSDSLens AISConfig
aisLinkConfig = sharedStore "aisLinkConfig" {AISConfig|host="localhost",port=2000}
asteriskLinkConfig :: SDSLens () AsteriskConfig AsteriskConfig
asteriskLinkConfig :: SimpleSDSLens AsteriskConfig
asteriskLinkConfig = sharedStore "asteriskLinkConfig" {AsteriskConfig|host="localhost",port=5038,username="admin",password="secret"}
smtpConfig :: SDSLens () SMTPConfig SMTPConfig
smtpConfig :: SimpleSDSLens SMTPConfig
smtpConfig = sharedStore "smtpConfig" {SMTPConfig|host="localhost",port=25}
webLinksConfig :: SDSLens () WebLinksConfig WebLinksConfig
webLinksConfig :: SimpleSDSLens WebLinksConfig
webLinksConfig = sharedStore "webLinksConfig" {WebLinksConfig|weatherWidgets=Nothing,vesselLinks=[]}
adminPassword :: SDSLens () Password Password
adminPassword :: SimpleSDSLens Password
adminPassword = sharedStore "adminPassword" (Password "admin")
//Derived configuration shares
databaseDef :: SDSLens () SQLDatabaseDef SQLDatabaseDef
databaseDef :: SimpleSDSLens SQLDatabaseDef
databaseDef = mapReadWrite (toDatabaseDef,\_ r -> Nothing) Nothing (toReadOnly databaseConfig)
//Conversion functions
......
......@@ -74,8 +74,8 @@ fromLeafletPerspective :: LeafletPerspective -> ContactMapPerspective
selectionFromLeafletMap :: LeafletMap -> [LeafletObjectID]
//Standard layers available to use in all map views
standardPerspective :: SDSLens () ContactMapPerspective ContactMapPerspective
standardMapLayers :: SDSLens () [ContactMapLayer] [ContactMapLayer]
standardPerspective :: SimpleSDSLens ContactMapPerspective
standardMapLayers :: SimpleSDSLens [ContactMapLayer]
derive JSONEncode ContactPosition, ContactMapPerspective
derive JSONDecode ContactPosition, ContactMapPerspective
......
......@@ -225,9 +225,9 @@ fromLeafletLatLng {LeafletLatLng|lat,lng} = (lat,lng)
fromLeafletBounds :: !LeafletBounds -> (!(!Real,!Real),!(!Real,!Real))
fromLeafletBounds {LeafletBounds|southWest,northEast} = (fromLeafletLatLng southWest,fromLeafletLatLng northEast)
standardPerspective :: SDSLens () ContactMapPerspective ContactMapPerspective
standardPerspective :: SimpleSDSLens ContactMapPerspective
standardPerspective = sharedStore "standardPerspective" defaultValue
standardMapLayers :: SDSLens () [ContactMapLayer] [ContactMapLayer]
standardMapLayers :: SimpleSDSLens [ContactMapLayer]
standardMapLayers = sharedStore "standardMapLayers" [{ContactMapLayer|title="Local OSM tiles",def=CMTileLayer "/tiles/{z}/{x}/{y}.png"}]
......@@ -14,7 +14,7 @@ import Incidone.OP.Concepts
derive class iTask WallContent
//Current content of the video wall
wallContent :: SDSLens () WallContent WallContent
wallContent :: SimpleSDSLens WallContent
//View content that was selected for viewing on the video wall
viewVideoWallContent :: Task WallContent
......@@ -7,7 +7,7 @@ import Text, Text.HTML, Data.List, iTasks.Internal.HtmlUtil
derive class iTask WallContent
wallContent :: SDSLens () WallContent WallContent
wallContent :: SimpleSDSLens WallContent
wallContent = sharedStore "WallContent" (WallOverview defaultValue)
viewVideoWallContent :: Task WallContent
......
......@@ -44,7 +44,7 @@ where
fromOpenOption [{ContactShortWithIncidents|contactNo}] = contactNo
selIds :: (Shared sds (Maybe (Either ContactNo MMSI))) -> SDSLens () [Int] [Int] | RWShared sds
selIds :: (Shared sds (Maybe (Either ContactNo MMSI))) -> SimpleSDSLens [Int] | RWShared sds
selIds sel = mapReadWrite (toPrj,fromPrj) (Just \p w. Ok (toPrj w)) sel
where
toPrj Nothing = []
......
......@@ -11,8 +11,8 @@ import Incidone.OP.Concepts
}
derive class iTask ContactFilter
allContactPhotos :: SDSLens () (Map ContactNo [ContactPhoto]) (Map ContactNo [ContactPhoto])
lastAISImport :: SDSLens () (Maybe (DateTime,String,Int)) (Maybe (DateTime,String,Int))
allContactPhotos :: SimpleSDSLens (Map ContactNo [ContactPhoto])
lastAISImport :: SimpleSDSLens (Maybe (DateTime,String,Int))
allCommunications :: SDSLens () [CommunicationDetails] ()
allIncidents :: SDSLens () [Incident] ()
......
......@@ -21,10 +21,10 @@ dbLinkSDS notifyId table col1 col2 = databaseDef >++> sqlLinkSDS notifyId table
//ACCESS SDS
//TODO: Also store in database
allContactPhotos :: SDSLens () (Map ContactNo [ContactPhoto]) (Map ContactNo [ContactPhoto])
allContactPhotos :: SimpleSDSLens (Map ContactNo [ContactPhoto])
allContactPhotos = sharedStore "ContactPhotos" 'DM'.newMap
lastAISImport :: SDSLens () (Maybe (DateTime,String,Int)) (Maybe (DateTime,String,Int))
lastAISImport :: SimpleSDSLens (Maybe (DateTime,String,Int))
lastAISImport = sharedStore "lastAISImport" Nothing
allCommunications :: SDSLens () [CommunicationDetails] ()
......
......@@ -5,7 +5,7 @@ import Text, System.Time
import Incidone.Util.TaskPatterns
//Notifications are stored newest first
notifications :: SDSLens () [(DateTime,String)] [(DateTime,String)]
notifications :: SimpleSDSLens [(DateTime,String)]
notifications = sharedStore "notifications" []
//Only show notifications added in the last 5 seconds
......
......@@ -5,4 +5,4 @@ import C2.Framework.MapEnvironment
import C2.Apps.ShipAdventure.Types
shipEditorTabs :: Task ()
sharedMapAction :: SDSLens () (MapAction SectionStatus) (MapAction SectionStatus)
sharedMapAction :: SimpleSDSLens (MapAction SectionStatus)
......@@ -103,7 +103,7 @@ mapTitleFontSize =: 10.0
********************************************************************************************************************/
viewLayout = updateMapStatus EditMode @! ()
sharedMapAction :: SDSLens () (MapAction SectionStatus) (MapAction SectionStatus)
sharedMapAction :: SimpleSDSLens (MapAction SectionStatus)
sharedMapAction = sharedStore "sharedMapAction" (FocusOnMap 0) // start at the top-level (all maps)
sharedEditShip :: SDSParallel () (Maps2D,MapAction SectionStatus) (Maps2D,MapAction SectionStatus)
......@@ -172,7 +172,7 @@ derive class iTask EditDeviceType, EditDevice
manageCables :: Task ()
manageCables = intMapCrudWith "Cables" [ChooseFromGrid id] [] [] [] (\cable -> cable.Cable.cableId) myCables @! ()
intMapCrud :: !String !(r -> Int) !(SDSLens () (IntMap r) (IntMap r)) -> Task r | iTask r
intMapCrud :: !String !(r -> Int) !(SimpleSDSLens (IntMap r)) -> Task r | iTask r
intMapCrud descr mkId share = crud descr 'DIS'.elems (putItem mkId) (delItem mkId) share
where
putItem :: !(r -> Int) !r !(IntMap r) -> IntMap r
......@@ -180,7 +180,7 @@ intMapCrud descr mkId share = crud descr 'DIS'.elems (putItem mkId) (delItem mkI
delItem :: !(r -> Int) !r !(IntMap r) -> IntMap r
delItem mkId item allItems = 'DIS'.del (mkId item) allItems
intMapCrudWith :: !String ![ChoiceOption r] [EnterOption r] [ViewOption r] [UpdateOption r r] !(r -> Int) !(SDSLens () (IntMap r) (IntMap r)) -> Task r | iTask r
intMapCrudWith :: !String ![ChoiceOption r] [EnterOption r] [ViewOption r] [UpdateOption r r] !(r -> Int) !(SimpleSDSLens (IntMap r)) -> Task r | iTask r
intMapCrudWith descr cos eos vos uos mkId share = crudWith descr cos eos vos uos 'DIS'.elems (putItem mkId) (delItem mkId) share
where
putItem :: !(r -> Int) !r !(IntMap r) -> IntMap r
......
......@@ -25,9 +25,9 @@ import C2.Apps.ShipAdventure.Types
derive class iTask Target, Script, Condition
handleFireScript :: SDSLens () [Script] [Script]
handleFloodScript :: SDSLens () [Script] [Script]
handleSmokeScript :: SDSLens () [Script] [Script]
handleFireScript :: SimpleSDSLens [Script]
handleFloodScript :: SimpleSDSLens [Script]
handleSmokeScript :: SimpleSDSLens [Script]
changeFireScript :: Task ()
changeFloodScript :: Task ()
......
......@@ -12,13 +12,13 @@ import qualified Data.Map as DM
derive class iTask Target, Script, Condition
handleFireScript :: SDSLens () [Script] [Script]
handleFireScript :: SimpleSDSLens [Script]
handleFireScript = sharedStore "handleFireScript" []
handleFloodScript :: SDSLens () [Script] [Script]
handleFloodScript :: SimpleSDSLens [Script]
handleFloodScript = sharedStore "handleFloodScript" []
handleSmokeScript :: SDSLens () [Script] [Script]
handleSmokeScript :: SimpleSDSLens [Script]
handleSmokeScript = sharedStore "handleSmokeScript" []
changeFireScript :: Task ()
......
......@@ -149,14 +149,14 @@ instance toString Device
// shared stores:
myUserActorMap :: UserActorShare ObjectType ActorStatus
myStatusMap :: SDSLens () MySectionStatusMap MySectionStatusMap
myInventoryMap :: SDSLens () MySectionInventoryMap MySectionInventoryMap
myNetwork :: SDSLens () Network Network
myCables :: SDSLens () (IntMap Cable) (IntMap Cable)
myDevices :: SDSLens () (IntMap Device) (IntMap Device)
commandAims :: SDSLens () [CommandAim] [CommandAim]
capabilityMap :: SDSLens () CapabilityToDeviceKindMap CapabilityToDeviceKindMap
disabledSections :: SDSLens () (Set Coord3D) (Set Coord3D)
myStatusMap :: SimpleSDSLens MySectionStatusMap
myInventoryMap :: SimpleSDSLens MySectionInventoryMap
myNetwork :: SimpleSDSLens Network
myCables :: SimpleSDSLens (IntMap Cable)
myDevices :: SimpleSDSLens (IntMap Device)
commandAims :: SimpleSDSLens [CommandAim]
capabilityMap :: SimpleSDSLens CapabilityToDeviceKindMap
disabledSections :: SimpleSDSLens (Set Coord3D)
deviceKindsForCapability :: SDSLens Capability CapabilityExpr CapabilityExpr
statusInSectionShare :: SDSLens Coord3D SectionStatus SectionStatus
......
......@@ -92,7 +92,7 @@ instance == Capability where
myUserActorMap :: UserActorShare ObjectType ActorStatus
myUserActorMap = sharedStore "myUserActorMap" 'DM'.newMap
myStatusMap :: SDSLens () MySectionStatusMap MySectionStatusMap
myStatusMap :: SimpleSDSLens MySectionStatusMap
myStatusMap = sharedStore "myStatusMap" 'DM'.newMap
statusInSectionShare :: SDSLens Coord3D SectionStatus SectionStatus
......@@ -102,7 +102,7 @@ deviceKindsForCapability :: SDSLens Capability CapabilityExpr CapabilityExpr
deviceKindsForCapability
= mapLens "deviceKindsForCapability" capabilityMap Nothing
myInventoryMap :: SDSLens () MySectionInventoryMap MySectionInventoryMap
myInventoryMap :: SimpleSDSLens MySectionInventoryMap
myInventoryMap = sharedStore "myInventoryMap" 'DM'.newMap
viewDisabledDevices :: Task ()
......@@ -311,7 +311,7 @@ devicesInSectionShare
write2 :: Coord3D !(IntMap Device) ![Device] -> MaybeError TaskException (Maybe (IntMap Device))
write2 _ deviceMap devices = Ok (Just (foldr (\device deviceMap -> 'DIS'.put device.Device.deviceId device deviceMap) deviceMap devices))
myDevices :: SDSLens () (IntMap Device) (IntMap Device)
myDevices :: SimpleSDSLens (IntMap Device)
myDevices = sharedStore "myDevices" devices
where
devices = 'DIS'.fromList [ f dt
......@@ -320,10 +320,10 @@ myDevices = sharedStore "myDevices" devices
f :: !Device -> (!DeviceId, !Device)
f dev = (dev.Device.deviceId, dev)
commandAims :: SDSLens () [CommandAim] [CommandAim]
commandAims :: SimpleSDSLens [CommandAim]
commandAims = sharedStore "commandAims" []
capabilityMap :: SDSLens () CapabilityToDeviceKindMap CapabilityToDeviceKindMap
capabilityMap :: SimpleSDSLens CapabilityToDeviceKindMap
capabilityMap = sharedStore "capabilityMap" ('DM'.fromList defaultList)
where
defaultList
......@@ -343,7 +343,7 @@ instance * CapabilityExpr where
cap :: DeviceKind -> CapabilityExpr
cap k = DeviceExpr k
myNetwork :: SDSLens () Network Network
myNetwork :: SimpleSDSLens Network
myNetwork = sharedStore "myNetwork"
{ Network
| devices = 'DM'.newMap
......@@ -351,7 +351,7 @@ myNetwork = sharedStore "myNetwork"
, cableMapping = 'DIS'.newMap
}
myCables :: SDSLens () (IntMap Cable) (IntMap Cable)
myCables :: SimpleSDSLens (IntMap Cable)
myCables = sdsProject (SDSLensRead read) (SDSLensWrite write) Nothing myNetwork
where
read :: !Network -> MaybeError TaskException (IntMap Cable)
......@@ -440,7 +440,7 @@ where
, updModel = \((((((((((disSects, _), exitLocks), hopLocks), inventoryMap), statusMap), sectionUsersMap), userActorMap), network), allDevices), _) (ms2d`, cl`) -> ((((((((((disSects, ms2d`), exitLocks), hopLocks), inventoryMap), statusMap), sectionUsersMap), userActorMap), network), allDevices), cl`)
}
disabledSections :: SDSLens () (Set Coord3D) (Set Coord3D)
disabledSections :: SimpleSDSLens (Set Coord3D)
disabledSections = sharedStore "disabledSections" 'DS'.newSet
updateSectionStatus :: !Coord3D -> Task (MapAction SectionStatus)
......
......@@ -16,9 +16,9 @@ from C2.Framework.ContactPosition import :: ContactMapPerspective
derive class iTask MapState
mapState :: SDSLens () MapState MapState
mapState :: SimpleSDSLens MapState
entityMap :: SDSLens () EntityMap EntityMap
entityMap :: SimpleSDSLens EntityMap
registerEntity :: (Int -> Entity) -> Task Entity
......@@ -34,4 +34,4 @@ periodicallyUpdateEntity :: !Int -> Task ()
mapView :: (sds () r w) (r -> Bool) User [Entity] -> Task () | iTask r & iTask w & RWShared sds
userMapState :: User -> SDSLens () MapState MapState
userMapState :: User -> SimpleSDSLens MapState
......@@ -23,7 +23,7 @@ defSettings =
, selection = -1
}
mapState :: SDSLens () MapState MapState
mapState :: SimpleSDSLens MapState
mapState = sharedStore "mapState" defSettings
selectedContactShare :: SDSLens () (Maybe Entity) Entity
......@@ -38,10 +38,10 @@ selectedContactShare = sdsLens "selectedContactShare" (const ()) (SDSRead read)
notify :: () MapState Entity -> SDSNotifyPred ()
notify _ _ _ = \_ _ -> False
userMapState :: User -> SDSLens () MapState MapState
userMapState :: User -> SimpleSDSLens MapState
userMapState u = sharedStore ("userMapState" +++ toString u) defSettings
entityMap :: SDSLens () EntityMap EntityMap
entityMap :: SimpleSDSLens EntityMap
entityMap = sharedStore "entityMap" 'DIS'.newMap
registerEntity :: (Int -> Entity) -> Task Entity
......
......@@ -132,7 +132,7 @@ makeWorkspaceTab :: String (Workspace -> Task a) Workspace -> Task () | iTask a
makeWorkspaceTab title t ws = t ws <<@ (Title title) @! ()
//Notifications are stored newest first
notifications :: SDSLens () [(DateTime,String)] [(DateTime,String)]
notifications :: SimpleSDSLens [(DateTime,String)]
notifications = sharedStore "notifications" []
//Only show notifications added in the last 5 seconds
......
......@@ -12,7 +12,7 @@ derive class iTask Log
// shared store for logging events
myLog :: SDSLens () [Log] [Log]
myLog :: SimpleSDSLens [Log]
// tasks for logging:
......
......@@ -4,7 +4,7 @@ import iTasks
derive class iTask Log
myLog :: SDSLens () [Log] [Log] // logging events
myLog :: SimpleSDSLens [Log] // logging events
myLog = sharedStore "myLog" []
addLog :: !a !b !c -> Task () | toString a & toString b & toString c
......
......@@ -80,7 +80,7 @@ instance == Border
}
:: UserActorMap objType actorStatus :== Map User (Actor objType actorStatus)
:: UserActorShare objType actorStatus :== SDSLens () (UserActorMap objType actorStatus) (UserActorMap objType actorStatus)
:: UserActorShare objType actorStatus :== SimpleSDSLens (UserActorMap objType actorStatus)
:: FocusedUserActorShare objType actorStatus :== SDSLens User (Maybe (Actor objType actorStatus)) (Actor objType actorStatus)
:: SectionStatusMap roomStatus :== Map Coord3D roomStatus // [Coord3D |-> roomStatus]
......@@ -90,19 +90,19 @@ instance == Border
:: SectionHopLockMap :== Map Coord3D [Coord3D]
:: SectionStatusShare roomStatus :== SDSLens () (SectionStatusMap roomStatus) (SectionStatusMap roomStatus) // [Coord3D |-> roomStatus]
:: SectionInventoryShare objType :== SDSLens () (SectionInventoryMap objType) (SectionInventoryMap objType) // [Coord3D |-> [ObjId |-> Object]]
:: SectionUsersShare :== SDSLens () SectionUsersMap SectionUsersMap
:: SectionStatusShare roomStatus :== SimpleSDSLens (SectionStatusMap roomStatus) // [Coord3D |-> roomStatus]
:: SectionInventoryShare objType :== SimpleSDSLens (SectionInventoryMap objType) // [Coord3D |-> [ObjId |-> Object]]
:: SectionUsersShare :== SimpleSDSLens SectionUsersMap
:: FocusedSectionStatusShare roomStatus :== SDSLens Coord3D roomStatus roomStatus // [Coord3D |-> roomStatus]
:: FocusedSectionInventoryShare objType :== SDSLens Coord3D (IntMap (Object objType)) (IntMap (Object objType)) // [Coord3D |-> [ObjId |-> Object]]
:: FocusedSectionUsersShare :== SDSLens Coord3D [User] [User]
:: DrawMapForActor r o a :== User (SDSLens () (SectionStatusMap r) (SectionStatusMap r)) (UserActorShare o a) (SDSLens () (SectionInventoryMap o) (SectionInventoryMap o)) -> Task ()
:: DrawMapForActor r o a :== User (SimpleSDSLens (SectionStatusMap r)) (UserActorShare o a) (SimpleSDSLens (SectionInventoryMap o)) -> Task ()
instance == (Actor o a)
instance == (Object obj) | == obj
maps2DShare :: SDSLens () Maps2D Maps2D
maps2DShare :: SimpleSDSLens Maps2D
sharedGraph :: SDSLens () Graph ()
......@@ -112,11 +112,11 @@ sectionForUserShare :: User -> SDSLens () (Maybe Coord3D) SectionUsersMap
focusedSectionUsersShare :: FocusedSectionUsersShare
lockedExitsShare :: SDSLens () SectionExitLockMap SectionExitLockMap
lockedExitsShare :: SimpleSDSLens SectionExitLockMap
lockStatusForExit :: SDSLens Coord3D [Dir] [Dir]
lockedHopsShare :: SDSLens () SectionHopLockMap SectionHopLockMap
lockedHopsShare :: SimpleSDSLens SectionHopLockMap
lockStatusForHop :: SDSLens Coord3D [Coord3D] [Coord3D]
......
......@@ -70,7 +70,7 @@ instance == Border where
infinity =: 67108864
maps2DShare :: SDSLens () Maps2D Maps2D
maps2DShare :: SimpleSDSLens Maps2D
maps2DShare = sharedStore "maps2DShare" []
sharedGraph :: SDSLens () Graph ()
......@@ -100,13 +100,13 @@ inventoryForUserSection user inventoryForSectionShare = sdsSequence ("inventoryF
write1 p r1 w = Ok Nothing
write2 p r2 w = Ok (Just w)
lockedExitsShare :: SDSLens () SectionExitLockMap SectionExitLockMap
lockedExitsShare :: SimpleSDSLens SectionExitLockMap