Commit 421ea9fb authored by Haye Böhm's avatar Haye Böhm

Fix compiling Incidone

parent ecbb3179
Pipeline #13844 failed with stage
in 2 minutes and 6 seconds
......@@ -15,11 +15,12 @@ import Incidone.OP.Concepts
// are limited by what can be constructed with the user catalog editor.
//Wrapped action for usage in action plans
:: ActionDefinition c sds
:: ActionDefinition c
= { identity :: String
, meta :: ItemMeta
, task :: c (sds () ActionStatus ActionStatus) -> Task ()
, task :: c (SDSLens () ActionStatus ActionStatus) -> Task ()
}
//Wrapped action for storage in the action catalog
:: CatalogAction =
{ identity :: String //Identifying string, such that you can track which actions have been done
......@@ -35,7 +36,7 @@ import Incidone.OP.Concepts
:: ActionTasks
= E.c sds: ActionTasks
([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) //Configuration task
(c (sds () ActionStatus ActionStatus) -> Task ()) & iTask c & RWShared sds //An action item that needs to be configured before it can be deployed
(c (SDSLens () ActionStatus ActionStatus) -> Task ()) & iTask c //An action item that needs to be configured before it can be deployed
:: ActionProgress
= ActionPlanned
......@@ -144,19 +145,19 @@ derive gDefault CatalogAction
derive gText CatalogAction
derive gEditor CatalogAction
toInstantAction :: c ActionProgress [ContactNo] [IncidentNo] (ActionDefinition c sds) -> CatalogAction | iTask c & RWShared sds
toConfigurableAction :: ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (ActionDefinition c sds) -> CatalogAction | iTask c & RWShared sds
toContactAction :: (Maybe String) (ActionDefinition ContactNo sds) -> CatalogAction | RWShared sds
toIncidentAction :: (ActionDefinition IncidentNo sds) -> CatalogAction | RWShared sds
toContactForIncidentAction :: (Maybe String) (ActionDefinition (ContactNo,IncidentNo) sds) -> CatalogAction | RWShared sds
toInstantAction :: c ActionProgress [ContactNo] [IncidentNo] (ActionDefinition c) -> CatalogAction | iTask c
toConfigurableAction :: ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (ActionDefinition c) -> CatalogAction | iTask c
toContactAction :: (Maybe String) (ActionDefinition ContactNo) -> CatalogAction
toIncidentAction :: (ActionDefinition IncidentNo) -> CatalogAction
toContactForIncidentAction :: (Maybe String) (ActionDefinition (ContactNo,IncidentNo)) -> CatalogAction
forIncident :: IncidentNo (ActionDefinition (ContactNo,IncidentNo) sds) -> ActionDefinition ContactNo sds | RWShared sds
forIncident :: IncidentNo (ActionDefinition (ContactNo,IncidentNo)) -> ActionDefinition ContactNo
addDefaultStatus :: (Task c) -> ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) | iTask c
//Shared catalog of predefined action items
actionCatalog :: SDSLens () [CatalogAction] ()
builtinActionCatalog :: SDSLens () [CatalogAction] ()
builtinActionCatalog :: SDSSource () [CatalogAction] ()
userActionCatalog :: SDSLens () [UserCatalogAction] [UserCatalogAction]
//Shares providing filtered views on iTasks task instances.
......@@ -174,12 +175,12 @@ numActionsByContact :: SDSLens ContactNo Int ()
todoItemTask :: () (sds () ActionStatus ActionStatus) -> Task () | RWShared sds
blankTodoItem :: CatalogAction
predefinedTodoItem :: String ItemMeta -> CatalogAction
predefinedInstantItem :: String ItemMeta ActionProgress ((sds () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a & RWShared sds
predefinedConfigurableItem :: String ItemMeta ([ContactNo] [IncidentNo] -> Task (c,ActionStatus)) (c (sds () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a & iTask c & RWShared sds
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
//Contact or incident
predefinedIncidentItem :: String ItemMeta (IncidentNo (sds () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a & RWShared sds
predefinedContactItem :: String ItemMeta (Maybe String) (ContactNo (sds () ActionStatus ActionStatus) -> Task a) -> CatalogAction | iTask a & RWShared sds
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
//Action lists items
listItemTask :: (String,ActionPlan) (sds () ActionStatus ActionStatus) -> Task () | RWShared sds
......
......@@ -13,7 +13,7 @@ where
header
= viewInformation () [] ("REMOTE CONTROL") //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |+| contactsProvidingHelpGeo)
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |*| contactsProvidingHelpGeo)
selectContent
= (switchContent >&> withSelection viewNoSelection configureContent) <<@ (ArrangeWithSideBar 0 LeftSide 300 False)
......@@ -27,10 +27,10 @@ where
where
title = "Configure Content"
configure "Overview"
= get (standardMapLayers |+| standardPerspective)
= get (standardMapLayers |*| standardPerspective)
>>- \(baseLayers,perspective) ->
withShared perspective
\p -> updateSharedInformation (Title title) [UpdateAs (toMap baseLayers) fromMap] (p >+| mapContacts) @ fst
\p -> updateSharedInformation (Title title) [UpdateAs (toMap baseLayers) fromMap] (p >*| mapContacts) @ fst
//<<@ AfterLayout (tweakUI fill) //FIXME
@ WallOverview
where
......
......@@ -15,7 +15,7 @@ viewVideoWallContent
= (header ||- content) <<@ (ArrangeWithSideBar 0 TopSide 30 False) //<<@ AfterLayout plainLayoutFinal //FIXME
where
header
= viewSharedInformation () [ViewAs view] (currentTime |+| currentUTCTime) //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
= viewSharedInformation () [ViewAs view] (currentTime |*| currentUTCTime) //<<@ (AfterLayout (uiDefSetHalign AlignRight o uiDefSetBaseCls "wall-header")) //FIXME
where
view (local,utc) = "LOCAL: " + lpad (toString local.Time.hour) 2 '0' + ":" + lpad (toString local.Time.min) 2 '0' + " "
+ "UTC: " + lpad (toString utc.Time.hour) 2 '0' + ":" + lpad (toString utc.Time.min) 2 '0'
......@@ -31,7 +31,7 @@ where
formatTime time = DivTag [StyleAttr "font-size: 80pt; text-align: center; padding-top: 200px;"] [Text (toString time)]
formatDateTime time = DivTag [StyleAttr "font-size: 80pt; text-align: center; padding-top: 200px;"] [Text (toString time)]
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |+| contactsProvidingHelpGeo)
mapContacts = mapRead (\(x,y) -> x++y) (contactsOfOpenIncidentsGeo |*| contactsProvidingHelpGeo)
viewWallOverview perspective
= ((viewSharedInformation (Title "Open Incidents") [ViewAs formatIncidents] openIncidentsDetails)
......
......@@ -5,7 +5,7 @@ import Incidone.OP.Concepts, Incidone.ActionManagementTasks
crewListActions :: [CatalogAction]
manageContactCrew :: ContactNo -> Task ()
manageContactCrewAction :: ActionDefinition ContactNo sds
manageContactCrewAction :: ActionDefinition ContactNo
manageCrewAliasList :: ContactNo -> Task ()
manageCrewAliasListAction :: ActionDefinition ContactNo sds
manageCrewAliasListAction :: ActionDefinition ContactNo
......@@ -10,10 +10,10 @@ import qualified Data.Map as DM
//This module provides an add-on that keeps track of the deployed crew of a rescue vessel
//Data storage
crewListsStore :: RWShared ContactNo [ContactNo] [ContactNo]
crewListsStore :: SDSLens ContactNo [ContactNo] [ContactNo]
crewListsStore = indexedStore "crewLists" []
crewAliasListsStore :: RWShared ContactNo [(Int,ContactNo)] [(Int,ContactNo)]
crewAliasListsStore :: SDSLens ContactNo [(Int,ContactNo)] [(Int,ContactNo)]
crewAliasListsStore = indexedStore "crewAliasLists" []
//Manage the crew information for a specific contact
......
......@@ -133,7 +133,7 @@ relateMessageToIncidents communicationNo
= manageSharedListWithDetails details add aboutIncidents
where
aboutIncidents = sdsFocus communicationNo communicationAboutIncidents
communicationAboutIncidents = mapReadWrite (toPrj,fromPrj) communicationByNo
communicationAboutIncidents = mapReadWrite (toPrj,fromPrj) Nothing communicationByNo
where
toPrj {Communication|aboutIncidents} = aboutIncidents
fromPrj aboutIncidents c = Just {Communication|c & aboutIncidents = aboutIncidents}
......@@ -195,27 +195,27 @@ updateMessageMeta communicationNo
) <<@ ArrangeSplit Horizontal False
@ \(_,(status,_)) -> status
phoneCallExternalNo = mapReadWrite (toExternalNo,fromExternalNo) phoneCallByNo
phoneCallExternalNo = mapReadWrite (toExternalNo,fromExternalNo) Nothing phoneCallByNo
where
toExternalNo {PhoneCall|externalNo} = externalNo
fromExternalNo nexternalNo c=:{PhoneCall|externalNo} = if (nexternalNo =!= externalNo) (Just {PhoneCall|c & externalNo = nexternalNo}) Nothing
radioCallChannel = mapReadWrite (toChannel,fromChannel) radioCallByNo
radioCallChannel = mapReadWrite (toChannel,fromChannel) Nothing radioCallByNo
where
toChannel {RadioCall|channel} = channel
fromChannel nchannel c=:{RadioCall|channel} = if (nchannel =!= channel) (Just {RadioCall|c & channel = nchannel}) Nothing
communicationTime = mapReadWrite (toTime,fromTime) communicationByNo
communicationTime = mapReadWrite (toTime,fromTime) Nothing communicationByNo
where
toTime {Communication|time} = time
fromTime ntime c=:{Communication|time} = if (ntime =!= time) (Just {Communication|c & time = ntime}) Nothing
communicationStatus = mapReadWrite (toStatus,fromStatus) communicationByNo
communicationStatus = mapReadWrite (toStatus,fromStatus) Nothing communicationByNo
where
toStatus {Communication|status} = status
fromStatus nstatus c=:{Communication|status} = if (nstatus =!= status) (Just {Communication|c & status = nstatus}) Nothing
communicationHandledBy = mapReadWrite (toHandledBy,fromHandledBy) communicationByNo
communicationHandledBy = mapReadWrite (toHandledBy,fromHandledBy) Nothing communicationByNo
where
toHandledBy {Communication|handledBy} = handledBy
fromHandledBy nhandledBy c=:{Communication|handledBy} = if (nhandledBy =!= handledBy) (Just {Communication|c & handledBy = nhandledBy}) Nothing
......@@ -296,12 +296,12 @@ where
= updateSharedInformation (Title "Notes") [] (callNotes type) //<<@ FillNotes //FIXME
@! ()
callNotes PhoneCall = sdsFocus communicationNo (mapReadWrite (toPrj,fromPrj) phoneCallByNo)
callNotes PhoneCall = sdsFocus communicationNo (mapReadWrite (toPrj,fromPrj) Nothing phoneCallByNo)
where
toPrj {PhoneCall|callNotes} = callNotes
fromPrj callNotes c = Just {PhoneCall|c & callNotes = callNotes}
callNotes RadioCall = sdsFocus communicationNo (mapReadWrite (toPrj,fromPrj) radioCallByNo)
callNotes RadioCall = sdsFocus communicationNo (mapReadWrite (toPrj,fromPrj) Nothing radioCallByNo)
where
toPrj {RadioCall|callNotes} = callNotes
fromPrj callNotes c = Just {RadioCall|c & callNotes = callNotes}
......@@ -327,7 +327,7 @@ createP2000Message direction = createCommunication P2000Message direction Nothin
createCommunication :: CommunicationType CommunicationDirection (Maybe ContactNo)-> Task CommunicationNo
createCommunication type direction mbWithContact
= get (currentDateTime |+| databaseDef)
= get (currentDateTime |*| databaseDef)
>>- \(datetime,db) ->
sqlExecute db ["allCommunications"] (execInsert "INSERT INTO Communication (time,type,direction,withContact) VALUES (?,?,?,?)" (flatten [toSQL datetime,toSQL type,toSQL direction,mbToSQL mbWithContact]))
>>- \communicationNo -> case type of
......
......@@ -238,7 +238,7 @@ configureWebLinks
where
exportConfig
= doOrClose (
get (webLinksConfig |+| currentDateTime)
get (webLinksConfig |*| currentDateTime)
>>- \(config,now) -> createJSONFile ("Incidone-weblinks-" +++ paddedDateTimeString now +++ ".json") config
>>- viewInformation "An export file has been created" []
@! ()
......
......@@ -5,11 +5,11 @@ import Text, System.Time
import Incidone.Util.TaskPatterns
//Notifications are stored newest first
notifications :: Shared [(DateTime,String)]
notifications :: SDSLens () [(DateTime,String)] [(DateTime,String)]
notifications = sharedStore "notifications" []
//Only show notifications added in the last 5 seconds
currentNotifications :: ReadOnlyShared [String]
currentNotifications :: SDSLens () [String] ()
currentNotifications = mapRead prj (currentDateTime |*| notifications)
where
prj (now,notifications) = [toString dt +++ msg \\ (dt,msg) <- notifications | limit now dt ]
......
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