/******************************************************************************/ /* */ /* SCS editor Version 2 */ /* File : ModuleInterface.pkg */ /* Version : 19 Mai 2000 */ /* module interface functions */ /* */ /******************************************************************************/ /****************************************************************************** give position *******************************************************************************/ fun MODULE_GetPosition (module) = module.MODposition ;; fun MODULE_GetNewModuleName (site, father, name) = if (!MODULE_CheckNameUnicity (MODULE_GetChildren site father) name nil) then MODULE_GetNewModuleName site father strcat "new " name else name ;; /****************************************************************************** return module class of module *******************************************************************************/ fun MODULE_GetClass (module) = module.MODclass ;; /****************************************************************************** return the list of all descendants of a module *******************************************************************************/ fun MODULE_GetAllDescendantsList (site, module) = let SITE_SearchModuleNode site module -> moduleNode in if moduleNode == nil then logScsError "MODULE_GetAllDescendantsList" nil "Module node not found" nil else (TREE_TreeToList TREE_FirstChild moduleNode TREE_IN_ORDER) ;; fun MODULE_ListGetAllDescendantsList (site, moduleList) = if moduleList == nil then nil else listcat ((hd moduleList)::(MODULE_GetAllDescendantsList site hd moduleList)) (MODULE_ListGetAllDescendantsList site tl moduleList) ;; /****************************************************************************** Create a module with all its attributes set Return value: Module (success) or nil (failure) NOTE: module is not added to it's father *******************************************************************************/ fun MODULE_Load (site, father, name, server, defs, position, class) = if !MODULE_CheckNameValidity name 0 then nil else if (!MODULE_CheckNameUnicity (MODULE_GetChildren site father) name nil) then { ERRORS_AddError 1 13 (_locSCS "errorlabel-13" nil) ; logScsError "MODULE_Load" nil "name already used, module not loaded" nil } else if !MODULE_CheckNumServer server then { ERRORS_AddError 1 14 (_locSCS "errorlabel-14" nil) ; logScsError "MODULE_Load" nil "invalid server number" nil } else if position == nil then logScsError "MODULE_Load" nil "position is nil" nil else mkModule [ name server defs position class nil ] ;; fun MODULE_PrepareRecuperation (module, site) = SITE_ParseAssociation site module (MODULE_GetDefBlock module MOD_BLOCK_ZONE) /* if dmi block is empty, run editor ? */ ;; /****************************************************************************** add module node to module node in param checking module name unicity *******************************************************************************/ fun MODULE_RealPaste (moduleNode, param) = let param -> [site fatherNode] in let TREE_Val moduleNode -> module in if (!MODULE_CheckNameUnicity (MODULE_GetChildren site TREE_Val fatherNode) module.MODname module) then ( set module.MODname = strcat module.MODname " copy"; MODULE_RealPaste moduleNode [site fatherNode] ) else ( TREE_AddNodeToChildTail fatherNode moduleNode; 1 ) ;; /****************************************************************************** return list of all updated module links into real links *******************************************************************************/ fun MODULE_GetRealLinks (site, module) = if MODULE_IsBlackBox module then nil /* blackbox have no real links !!!! */ else listList_to_list MODULE_ConvertLinksToRealLinks site module.MODlinks ;; fun MODULE_GetAllRealLinks (site, moduleList) = if moduleList == nil then nil else listcat (MODULE_GetRealLinks site hd moduleList) (MODULE_GetAllRealLinks site tl moduleList) ;; /****************************************************************************** prepare a module for deletion ; update module definition and remove corresponding association *******************************************************************************/ fun MODULE_PrepareDeletion (module, site) = MODULE_UpdateDefinition site module; ASSO_RemoveAssociatedModule site module ;; /****************************************************************************** bufferize module links *******************************************************************************/ fun MODULE_BufferizeLink (module, site) = SCSDATA_BufferizeLink MODULE_GetRealLinks site module ;; /****************************************************************************** destroy module links *******************************************************************************/ fun MODULE_JustDestroyLink (module, param) = MODULE_DestroyLinksFromModule module.MODlinks module ;; /****************************************************************************** detach module from tree *******************************************************************************/ fun MODULE_DestroyElt (module, site) = TREE_RemoveNode (SITE_SearchModuleNode site module); 1 ;; /****************************************************************************** detach module from tree and activate module suppression reflex *******************************************************************************/ fun MODULE_DestroySingleElt (module, site) = let MODULE_GetFather site module -> father in ( SELECT_RemoveModule module::nil father::nil REFLEX_PRIORITY_ONE; REFLEX_ModuleRemoved module::nil nil; ); MODULE_DestroyElt module site ;; /****************************************************************************** create a new module if father is nil the new module is added to the root of the modules tree *******************************************************************************/ proto MODULE_Create = fun [Site Module [I I] ModuleClass fun [Site Module] I] I;; fun MODULE_Create (site, father, position, class, postCreationReflex) = if ! strcmpi MODULECLASS_GetName class BLACKBOX_NAME /* black box ? */ then /* convert old blackbox module class to newer */ set class = SCSDATA_GetBlackBoxClass else nil; let MODULE_Load site father (MODULE_GetNewModuleName site father MODULECLASS_GetName class) MASTERNUMBER nil position class -> newModule in if newModule == nil then nil else ( /* c'est EditorsManager qui gère l'undo /redo de la création */ /* ici il n'y a que le lancement de 'éditeur */ exec postCreationReflex with [site newModule]; 1 ) ;; /****************************************************************************** destroy a list of modules *******************************************************************************/ fun MODULE_DestroyList (site, moduleList) = apply_on_list (MODULE_ListGetAllDescendantsList site moduleList) @MODULE_PrepareDeletion site; apply_on_list moduleList @MODULE_JustDestroyLink nil; let MODULE_GetFather site hd moduleList -> father in SELECT_RemoveModule moduleList father::nil REFLEX_PRIORITY_ONE; REFLEX_ModuleRemoved (MODULE_ListGetAllDescendantsList site moduleList) nil; apply_on_list moduleList @MODULE_DestroyElt site; 1 ;; fun MODULE_PasteList (site, moduleNodeList, fatherNode, linkList) = apply_on_list moduleNodeList @MODULE_RealPaste [site fatherNode]; let TREE_ListValOfList moduleNodeList -> moduleList in ( apply_on_list moduleList @MODULE_PrepareRecuperation site; REFLEX_ModuleAdded MODULE_ListGetAllDescendantsList site moduleList nil; SELECT_NewModule moduleList REFLEX_PRIORITY_ONE; REFLEX_LinkAdded MODULE_BuildRealLinks linkList site nil ); 1 ;; fun MODULE_BuildModulesNames( modules )= if modules == nil then nil else let modules -> [module next] in (MODULE_GetName module)::(if next == nil then "" else ", "):: MODULE_BuildModulesNames next ;; /****************************************************************************** destroy all modules from list *******************************************************************************/ fun MODULE_Destroy (site, moduleList) = SCSGUI_OpenLoadingDialogBox (_locSCS "module-DESTROYING" nil); if is_in_list moduleList SITE_GetModuleCurrentBlackBox site then ( ERRORS_AddError 0 30 (_locSCS "errorlabel-NOTALLOWED" nil) ; logScsError "MODULE_Destroy" nil "Cannot remove site current black box view module !" 0 ) else ( HISTORY_AddCurrentSite _locSCS (if (sizelist moduleList) > 1 then "undo-MODULESDESTROYED" else "undo-MODULEDESTROYED") MODULE_BuildModulesNames moduleList mkfun1 mkfun2 mkfun3 mkfun4 @MODULE_PasteList (MODULE_ListGetAllLinks moduleList) (SITE_SearchModuleNode site MODULE_GetFather site hd moduleList) (SITE_SearchModuleNodeList site moduleList) site mkfun1 mkfun2 @MODULE_DestroyList moduleList site; MODULE_DestroyList site moduleList ); SCSGUI_CloseLoadingDialogBox ;; /****************************************************************************** detach module from tree and bufferize it ******************************************************************************/ fun MODULE_CutElt (module, site) = let SITE_SearchModuleNode site module -> moduleNode in ( SCSDATA_BufferizeModuleNode moduleNode; TREE_RemoveNode moduleNode ); 1 ;; /****************************************************************************** cut a list of module ******************************************************************************/ fun MODULE_CutList (site, moduleList, runReflex) = SCSDATA_ClearModuleBuffer; SCSDATA_ClearLinkBuffer; let (MODULE_ListGetAllDescendantsList site moduleList) -> completeModuleList in ( apply_on_list completeModuleList @MODULE_PrepareDeletion site; apply_on_list completeModuleList @MODULE_BufferizeLink site; apply_on_list completeModuleList @MODULE_JustDestroyLink site; if runReflex then ( let MODULE_GetFather site hd moduleList -> father in SELECT_RemoveModule moduleList father::nil REFLEX_PRIORITY_ONE; REFLEX_ModuleRemoved completeModuleList nil ) else nil ); apply_on_list moduleList @MODULE_CutElt site; 1 ;; fun MODULE_Cut (site, moduleList) = SCSGUI_OpenLoadingDialogBox (_locSCS "module-CUTTING" nil); if is_in_list moduleList SITE_GetModuleCurrentBlackBox site then ( ERRORS_AddError 0 30 (_locSCS "errorlabel-NOTALLOWED" nil) ; logScsError "MODULE_Cut" nil "Cannot cut site current black box view !" 0 ) else ( HISTORY_AddCurrentSite _locSCS (if (sizelist moduleList) > 1 then "undo-MODULESCUT" else "undo-MODULECUT") MODULE_BuildModulesNames moduleList mkfun1 mkfun2 mkfun3 mkfun4 @MODULE_PasteList (MODULE_ListGetAllLinks moduleList) (SITE_SearchModuleNode site MODULE_GetFather site hd moduleList) (SITE_SearchModuleNodeList site moduleList) site mkfun1 mkfun2 mkfun3 @MODULE_CutList 1 moduleList site; MODULE_CutList site moduleList 1 ); SCSGUI_CloseLoadingDialogBox ;; /****************************************************************************** copy a module and his tree structure in module buffer *******************************************************************************/ fun MODULE_CopyElt (module, site, Channel) = let SITE_ParseModule site nil (SITE_ParseModuleDef site module) Channel -> newModuleNode in ( TREE_AddNodeToChildTail (SITE_SearchModuleNode site MODULE_GetFather site module) newModuleNode; TREE_Val newModuleNode ) ;; fun MODULE_CopyList (site, moduleList, Channel) = if moduleList == nil then [nil nil] else let moduleList -> [module next] in let MODULE_CopyElt module site Channel -> newModule in let MODULE_CopyList site next Channel -> [newList assoList] in [newModule::newList ([module newModule])::assoList] ;; fun MODULE_DuplicateIncomingLinks (modulesAsso, param) = let modulesAsso -> [old new] in apply_on_list (MODULE_GetIncomingLinks old) @MODULE_DuplicateLink [new old] ;; fun MODULE_Copy (site, moduleList, Channel) = let MODULE_CopyList site moduleList Channel -> [modulesCopyList modulesAssoList] in ( apply_on_list modulesAssoList @MODULE_DuplicateIncomingLinks nil; SITE_ParseSubLink site modulesCopyList; apply_on_list modulesCopyList @MODULE_ReplaceModuleInModuleLinks modulesAssoList; MODULE_CutList site modulesCopyList 0; ); 1 ;; /****************************************************************************** paste module buffer *******************************************************************************/ proto MODULE_Paste = fun [Site Module] I;; fun MODULE_Paste (site, father) = SCSGUI_OpenLoadingDialogBox (_locSCS "module-PASTING" nil); let SITE_SearchModuleNode site father -> fatherNode in if fatherNode == nil then logScsError "MODULE_Paste" nil "Father node not found" 0 else let SCSDATA_GetModuleBuffer -> moduleNodeList in if moduleNodeList == nil then nil else let TREE_ListValOfList moduleNodeList -> moduleList in ( HISTORY_AddCurrentSite _locSCS (if (sizelist moduleList) > 1 then "undo-MODULESPASTED" else "undo-MODULEPASTED") MODULE_BuildModulesNames moduleList mkfun1 mkfun2 mkfun3 @MODULE_CutList 1 moduleList site mkfun1 mkfun2 @MODULE_Paste father site; MODULE_PasteList site moduleNodeList fatherNode SCSDATA_GetLinkBuffer; SCSDATA_ClearModuleBuffer; SCSDATA_ClearLinkBuffer; 1 ); SCSGUI_CloseLoadingDialogBox ;; /****************************************************************************** move a module in tree structure *******************************************************************************/ fun MODULE_RealMove (site, moduleNode, fatherNode) = let TREE_Val moduleNode -> module in if (!MODULE_CheckNameUnicity (MODULE_GetChildren site TREE_Val fatherNode) module.MODname module) then ( set module.MODname = strcat module.MODname " move"; MODULE_RealMove site moduleNode fatherNode; nil ) else TREE_AddNodeToChildTail fatherNode moduleNode; 1 ;; fun MODULE_Move (site, newFather, module) = let MODULE_GetFather site module -> father in if father == newFather then 1 else if father == nil then ( ERRORS_AddError 0 31 (_locSCS "errorlabel-NOTALLOWED" nil) ; logScsError "MODULE_Move" nil "Cannot move site root module !" 0 ) else let SITE_SearchModuleNode site module -> moduleNode in if moduleNode == nil then logScsError "MODULE_Move" nil "Module node not found !" 0 else let SITE_SearchModuleNode site newFather -> newFatherNode in if newFatherNode == nil then logScsError "MODULE_Move" nil "Module father node not found !" 0 else ( MODULE_UpdateDefinition site module; MODULE_DestroyLinksFromModule module.MODlinks module; TREE_RemoveNode moduleNode; MODULE_RealMove site moduleNode newFatherNode ) ;; fun MODULE_MoveIntoBB (module, param) = let param -> [site bb] in MODULE_Move site bb module ;; fun MODULE_UnCreateBB (site, father, bbnode, modules, linkList) = let TREE_Val bbnode -> bb in ( SELECT_RemoveModule bb::modules father::nil REFLEX_PRIORITY_ONE; REFLEX_ModuleRemoved (MODULE_ListGetAllDescendantsList site bb::nil) nil; apply_on_list modules @MODULE_MoveIntoBB [site father]; MODULE_DestroyElt bb site; REFLEX_ModuleAdded (MODULE_ListGetAllDescendantsList site modules) nil; REFLEX_LinkAdded MODULE_BuildRealLinks linkList site nil; SELECT_NewModule modules REFLEX_PRIORITY_ONE; ); 1 ;; fun MODULE_RealCreateBB (site, father, bbnode, moduleList, linkList) = TREE_AddNodeToChildTail (SITE_SearchModuleNode site father) bbnode; let TREE_Val bbnode -> bb in ( REFLEX_ModuleAdded bb::nil nil; SELECT_RemoveModule moduleList father::nil REFLEX_PRIORITY_ONE; REFLEX_ModuleRemoved (MODULE_ListGetAllDescendantsList site moduleList) nil; apply_on_list moduleList @MODULE_MoveIntoBB [site bb]; REFLEX_ModuleAdded (MODULE_ListGetAllDescendantsList site moduleList) nil; REFLEX_LinkAdded MODULE_BuildRealLinks linkList site nil; SELECT_NewModule bb::nil REFLEX_PRIORITY_ONE ); 1 ;; fun MODULE_CreateBB (site, father, modules) = { /* time consuming process*/ SCSGUI_OpenLoadingDialogBox (_locSCS "module-CREATINGBLACKBOX" nil); let if (modules == nil) || ((hd modules) == (SITE_GetModuleRoot site)) then [1 1] /* MAC ICI changer ??? */ else MODULE_GetPosition hd modules -> position in let MODULE_Load site father (MODULE_GetNewModuleName site father BLACKBOX_NAME) MASTERNUMBER nil position SCSDATA_GetBlackBoxClass -> bb in ( MODULE_SetDefLine bb MOD_BLOCK_DMI MOD_DEF_NAME (bb.MODname)::nil; let remove_from_list modules (SITE_GetModuleCurrentBlackBox site) -> moduleList in let MODULE_GetAllRealLinks site (MODULE_ListGetAllDescendantsList site moduleList) -> linkList in let MODULE_MkNode bb -> bbnode in ( HISTORY_AddCurrentSite _locSCS "undo-CREATEBB" nil mkfun1 mkfun2 mkfun3 mkfun4 mkfun5 @MODULE_UnCreateBB linkList moduleList bbnode father site mkfun1 mkfun2 mkfun3 mkfun4 mkfun5 @MODULE_RealCreateBB linkList moduleList bbnode father site; MODULE_RealCreateBB site father bbnode moduleList linkList ) ) ; SCSGUI_CloseLoadingDialogBox; 1 };; /****************************************************************************** charge une black box *******************************************************************************/ fun MODULE_Import (site, father, filename, Channel) = /* time consuming process*/ SCSGUI_OpenLoadingDialogBox (_locSCS "module-IMPORTMODULE" nil); let SITE_SearchModuleNode site father -> fatherNode in ( _DEFinit filename; _DEFgetWithoutSave; let TREE_Val SITE_ParseModule site fatherNode siteDef Channel -> module in if module == nil then nil else ( REFLEX_ModuleAdded module::(MODULE_GetAllDescendantsList site module) nil; SITE_ParseLink site module (MODULE_GetDefBlock module MOD_BLOCK_LINK); SELECT_NewModule module::nil REFLEX_PRIORITY_ONE ); ); SCSGUI_CloseLoadingDialogBox; 1 ;; /****************************************************************************** sauvegarde une black box *******************************************************************************/ fun MODULE_Export (site, module, filename) = _DEFinit filename; /* MAC ICI : supprimer les liens externes au module racine */ set siteDef = hd (MODULE_ClearAssoDef (SITE_ParseModuleDef site module)::nil); if module == (SITE_GetModuleRoot site) then ( set siteDef.listDEF = removef_from_list siteDef.listDEF @defByName MOD_BLOCK_CLIENT; set siteDef.listDEF = removef_from_list siteDef.listDEF @defByName MOD_BLOCK_SERVER; set siteDef.listDEF = removef_from_list siteDef.listDEF @defByName MOD_BLOCK_DEF; ) else nil; set siteDef.listDEF = removef_from_list siteDef.listDEF @defByName MOD_BLOCK_LINK; if MODULE_IsBlackBox module then set siteDef.listDEF = [MOD_BLOCK_LINK (LINK_GetLinksDefinitions site (MODULE_LinkDestinationIsChild (MODULE_GetOutgoingLinks module) site module))]:: (siteDef.listDEF) else nil; _DEFsaveDME; 1 ;; /****************************************************************************** return module father black box nil if module is the root of the site *******************************************************************************/ fun MODULE_GetFather (site, module) = TREE_Val (TREE_Father (SITE_SearchModuleNode site module)) ;; /****************************************************************************** return the list of the child of module return nil if module is not a black box *******************************************************************************/ fun MODULE_GetChildren (site, module) = TREE_ListValOfAllChilds (SITE_SearchModuleNode site module) ;; /****************************************************************************** return the list of the brothers of a module (including the module itself) return value: [Module r1] (success) or nil (failure) *******************************************************************************/ fun MODULE_GetBrothers (site, module) = MODULE_GetChildren site MODULE_GetFather site module ;; /****************************************************************************** retourne le nom d'un module *******************************************************************************/ fun MODULE_GetName (module)= module.MODname ;; /****************************************************************************** modifie le nom d'un module *******************************************************************************/ fun MODULE_SetName (site, module, name, addHistory) = if !MODULE_CheckNameValidity name 1 then logScsError "MODULE_SetName" nil "Invalid name" 0 else if strcmp name module.MODname then /* different name */ if !MODULE_CheckNameUnicity (MODULE_GetBrothers site module) name module then ( ERRORS_AddError 0 20 strcatn (_locSCS "errorlabel-11" nil)::": "::name::nil; logScsError "MODULE_SetName" nil "Name already in use, module name left unchanged" 0 ) else ( if addHistory then HISTORY_AddCurrentSite _locSCS "undo-MODULENAME" (MODULE_GetName module)::name::nil mkfun1 mkfun2 mkfun3 mkfun4 @MODULE_SetName 1 module.MODname module site mkfun1 mkfun2 mkfun3 mkfun4 @MODULE_SetName 1 name module site else nil; set module.MODname = name; 1 ) else /* same name */ 0; REFLEX_ModuleModified module::nil REFLEX_NAME ;; fun MODULE_SetBitmap (module, fileName) = /* MAC ICI : à supprimer !!! */ REFLEX_ModuleModified module::nil REFLEX_BITMAP ;; /****************************************************************************** return module server number *******************************************************************************/ fun MODULE_GetServer (module) = module.MODserver ;; fun MODULE_GetCommonServerRec (moduleList, currNumber) = if moduleList == nil then currNumber else let MODULE_GetServer (hd moduleList) -> newNumber in if currNumber == newNumber then MODULE_GetCommonServerRec tl moduleList currNumber else nil ;; /****************************************************************************** return module List common server number (nil if not common) *******************************************************************************/ fun MODULE_GetCommonServer (moduleList) = if moduleList == nil then nil else MODULE_GetCommonServerRec (tl moduleList) MODULE_GetServer (hd moduleList) ;; /****************************************************************************** modify module server number *******************************************************************************/ fun MODULE_SetServer (module, server) = let MODULE_CheckNumServer server -> result in if !result then ( ERRORS_AddError 0 22 strcatn (_locSCS "errorlabel-35" nil)::": "::(itoa server)::nil; logScsError "MODULE_SetServer" "serverNum:"::(itoa server)::nil "Server number cannot be negative" 0 ) else ( HISTORY_AddCurrentSite _locSCS "undo-MODULESERVER" (MODULE_GetName module)::(itoa server)::nil mkfun1 mkfun2 @MODULE_SetServer module.MODserver module mkfun1 mkfun2 @MODULE_SetServer server module; set module.MODserver = server; 0 ); REFLEX_ModuleModified module::nil REFLEX_SERVER ;; /****************************************************************************** modify module list server number *******************************************************************************/ fun MODULE_RealSetServer (module, server) = set module.MODserver = server;; proto MODULE_SetMultipleServer = fun [[Module r1] I] I;; fun MODULE_SetMultipleServer (moduleList, server) = let MODULE_CheckNumServer server -> result in if !result then ( ERRORS_AddError 0 22 strcatn (_locSCS "errorlabel-35" nil)::": "::(itoa server)::nil; logScsError "MODULE_SetMultipleServer" "serverNum:"::(itoa server)::nil "Server number cannot be negative" 0 ) else ( apply_on_list moduleList @MODULE_RealSetServer server; 0 ); REFLEX_ModuleModified moduleList REFLEX_SERVER ;; /****************************************************************************** modify position *******************************************************************************/ fun MODULE_BuildPositionString( position )= let position -> [x y] in strcatn "("::(itoa x)::","::(itoa y)::")"::nil;; proto MODULE_SetPosition = fun [Module [I I]] I;; fun MODULE_SetPosition (module, position) = HISTORY_AddCurrentSite _locSCS "undo-MODULEPOSITION" (MODULE_GetName module)::(MODULE_BuildPositionString position)::nil mkfun1 mkfun2 @MODULE_SetPosition module.MODposition module mkfun1 mkfun2 @MODULE_SetPosition position module; set module.MODposition = position; REFLEX_ModuleModified module::nil REFLEX_POSITION; 1 ;; /****************************************************************************** return module tree bitmap *******************************************************************************/ fun MODULE_GetTreeBitmap (chan, module)= MODULECLASS_GetTreeBitmap chan module.MODclass ;; /****************************************************************************** return module bitmap *******************************************************************************/ fun MODULE_GetBitmap (chan, module)= let let MODULE_GetBitmapFilename module -> bitmapFile in if bitmapFile != nil then if (_checkpack bitmapFile) != nil then BITMAP_Get bitmapFile chan else MODULE_GetTreeBitmap chan module else MODULE_GetTreeBitmap chan module -> bitmap in if bitmap == nil then BITMAP_Get strcat SCS_PATH "bitmaps/defaulticon.bmp" chan else bitmap ;; /****************************************************************************** return the group of definitions associated with definitionName for the module *******************************************************************************/ fun MODULE_GetCustomDefinition (module, definitionName) = MODULE_GetDefBlock module definitionName ;; /****************************************************************************** module definition functions *******************************************************************************/ fun MODULE_GetNameDefinition (module, mod_def, mod_def_name) = let MODULE_GetDefBlock module mod_def -> list in search_all_in_list list @MODULE_SearchDefName mod_def_name ;; /****************************************************************************** modify a group of definition *******************************************************************************/ fun MODULE_SetCustomDefinition (site, module, definitionName, definitionContent)= MODULE_SetDefBlock module definitionName definitionContent; if (!strcmp definitionName MOD_BLOCK_REN) && MODULE_IsBlackBox module then MODULE_RenameAllActionEventInLink site module definitionContent else nil; if !strcmp definitionName MOD_BLOCK_DMI then MODULE_VerifyAllActionEventInLink site module else nil; REFLEX_ModuleModified module::nil REFLEX_DEFINITIONS; module ;; fun MODULE_SetCustomDefinitions (site, module, definitions) = if definitions == nil then 0 else let definitions -> [firstDef nextDefs] in let firstDef -> [defName defBlock] in ( MODULE_SetCustomDefinition site module defName defBlock; MODULE_SetCustomDefinitions site module nextDefs ) ;; /****************************************************************************** return events list for the module *******************************************************************************/ fun MODULE_GetEvents (site, module) = let if (SITE_GetModuleCurrentBlackBox site) == module then MOD_DEF_BB_IN::nil else if MODULE_IsBlackBox module then MOD_DEF_BB_OUT::nil else MOD_DEF_EVENT_S::MOD_DEF_EVENT_C::nil -> listDef in get_second_element_in_list MODULE_GetNameDefinition module MOD_BLOCK_DMI listDef ;; /****************************************************************************** return actions list for the module *******************************************************************************/ fun MODULE_GetActions (site, module) = let if (SITE_GetModuleCurrentBlackBox site) == module then MOD_DEF_BB_OUT::nil else if MODULE_IsBlackBox module then MOD_DEF_BB_IN::nil else MOD_DEF_ACTION_S::MOD_DEF_ACTION_C::nil -> listDef in get_second_element_in_list MODULE_GetNameDefinition module MOD_BLOCK_DMI listDef ;; /****************************************************************************** return module zones list *******************************************************************************/ fun MODULE_GetZones (module) = get_second_element_in_list MODULE_GetNameDefinition module MOD_BLOCK_DMI MOD_DEF_ZONE_S::MOD_DEF_ZONE_C::nil ;; /****************************************************************************** return events list for the module *******************************************************************************/ fun MODULE_GetEventsCS (site, module, type) = let if (SITE_GetModuleCurrentBlackBox site) == module then MOD_DEF_BB_IN::nil else if MODULE_IsBlackBox module then MOD_DEF_BB_OUT::nil else if type == SCS_CLIENT then MOD_DEF_EVENT_C::nil else MOD_DEF_EVENT_S::nil -> listDef in get_second_element_in_list MODULE_GetNameDefinition module MOD_BLOCK_DMI listDef ;; /****************************************************************************** return actions list for the module *******************************************************************************/ fun MODULE_GetActionsCS (site, module, type) = let if (SITE_GetModuleCurrentBlackBox site) == module then MOD_DEF_BB_OUT::nil else if MODULE_IsBlackBox module then MOD_DEF_BB_IN::nil else if type == SCS_CLIENT then MOD_DEF_ACTION_C::nil else MOD_DEF_ACTION_S::nil -> listDef in get_second_element_in_list MODULE_GetNameDefinition module MOD_BLOCK_DMI listDef ;; /****************************************************************************** return module zones list *******************************************************************************/ fun MODULE_GetZonesCS (module, type) = get_second_element_in_list if type == SCS_CLIENT then MODULE_GetNameDefinition module MOD_BLOCK_DMI MOD_DEF_ZONE_C::nil else MODULE_GetNameDefinition module MOD_BLOCK_DMI MOD_DEF_ZONE_S::nil ;; /****************************************************************************** *******************************************************************************/ fun MODULE_GetFirstSon( site, module )= /* search for the module in site */ let SITE_SearchModuleNode site module -> moduleNode in if moduleNode == nil then /* ERROR NOT SENT TO END-USER */ logScsError "MODULE_GetFirstSon" nil "Module node not found" nil else TREE_Val TREE_FirstChild moduleNode ;; /****************************************************************************** *******************************************************************************/ fun MODULE_GetNextBrother (site, module) = /* search for the module in site */ let SITE_SearchModuleNode site module -> moduleNode in if moduleNode == nil then logScsError "MODULE_GetNextBrother" nil "Module node not found" nil else TREE_Val TREE_NextBrother moduleNode ;; fun MODULE_ReportInFile (site, modList, filename) = SCSGUI_OpenLoadingDialogBox (_locSCS "site-REPORTING" nil); _storepack lineBuildSeparator "SCS 2 Report Modules File":: (strcatn "Generated on "::(ctime time)::nil):: (strcatn "Site Name : "::(site.SITEoptions.SITEname)::nil):: (strcatn "Site File Name : "::(site.SITEfilename)::nil):: (strcatn "Total Number of Modules : "::(itoa sizelist modList)::nil):: "":: "Module List : ":: (strcat " " lineBuildSeparator (MODULE_PrintList modList) "\n "):: (MODULE_ListReport site modList) "\n" filename; SCSGUI_CloseLoadingDialogBox; 0 ;;