/***************************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : LinkInterface.pkg */ /* Version : 23 Mai 2000 */ /* Link interface */ /* */ /***************************************************************************************/ /**************************************************************************************** return source module and associated event ****************************************************************************************/ fun LINK_GetCompleteSource (link) = [link.LINKsource link.LINKevent] ;; /**************************************************************************************** return link event ****************************************************************************************/ fun LINK_GetEvent (link) = link.LINKevent ;; /**************************************************************************************** return source module ****************************************************************************************/ fun LINK_GetSource (link) = link.LINKsource ;; /**************************************************************************************** set link event ****************************************************************************************/ fun LINK_SetEvent (link, event) = set link.LINKevent = event ;; /**************************************************************************************** return destination module and associated action ****************************************************************************************/ fun LINK_GetCompleteDestination (link) = [link.LINKdestination link.LINKaction] ;; /**************************************************************************************** utilities format functions ****************************************************************************************/ fun LINK_Print (link) = let LINK_GetCompleteSource link -> [modulesource event] in let LINK_GetCompleteDestination link -> [moduledestination action] in let MODULE_GetName modulesource -> namesource in let MODULE_GetName moduledestination -> namedestination in strcatn namesource::"."::event::" -> "::namedestination::"."::action::nil ;; fun LINK_ReportIn (link) = let LINK_GetCompleteSource link -> [modulesource event] in let MODULE_GetName modulesource -> namesource in strcatn link.LINKaction::" <- ["::namesource::"]."::event::nil ;; fun LINK_ReportOut (link) = let LINK_GetCompleteDestination link -> [moduledestination action] in let MODULE_GetName moduledestination -> namedestination in strcatn link.LINKevent::" -> ["::namedestination::"]."::action::nil ;; fun LINK_PrintList (linkList, printfunc) = if linkList == nil then nil else (exec printfunc with [hd linkList])::(LINK_PrintList tl linkList printfunc) ;; /**************************************************************************************** return link action ****************************************************************************************/ fun LINK_GetAction (link) = link.LINKaction ;; /**************************************************************************************** return destination module ****************************************************************************************/ fun LINK_GetDestination (link) = link.LINKdestination ;; /**************************************************************************************** set link action ****************************************************************************************/ fun LINK_SetAction (link, action) = set link.LINKaction = action ;; /**************************************************************************************** return link parameter ****************************************************************************************/ fun LINK_GetParameter (link) = link.LINKparameter ;; /**************************************************************************************** modify link parameter ****************************************************************************************/ proto LINK_SetParameter = fun [Link S] I;; fun LINK_SetParameter (link, parameter) = HISTORY_AddCurrentSite _locSCS "link-PARAMETER" (LINK_Print link)::parameter::nil mkfun1 mkfun2 @LINK_SetParameter link.LINKparameter link mkfun1 mkfun2 @LINK_SetParameter parameter link; set link.LINKparameter = parameter; REFLEX_LinkModified link::nil REFLEX_PARAMETER ;; /**************************************************************************************** return link condition ****************************************************************************************/ fun LINK_GetCondition (link) = link.LINKcondition ;; /**************************************************************************************** modify link condition ****************************************************************************************/ proto LINK_SetCondition = fun [Link S] I;; fun LINK_SetCondition (link, condition) = HISTORY_AddCurrentSite _locSCS "link-CONDITION" (LINK_Print link)::condition::nil mkfun1 mkfun2 @LINK_SetCondition link.LINKcondition link mkfun1 mkfun2 @LINK_SetCondition condition link; set link.LINKcondition = condition; REFLEX_LinkModified link::nil REFLEX_CONDITION ;;