--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_PARAM --+ Purpose : To print MDI parameters --+ --+ Sub_system : PLM --+ Drawing No : 3137-ZA042-SCB Issue : A/00 --+ Project No : SH-MAR-SW-70224 --+ Origin : UK --+ Test Spec : N/A --+ Author : JP. Prat --+ --+------------------------------------------------------------------------+ --+ Principle : --+ --------- --+ --+ This Control File; --+ --+ - Sets up a text array in the correct format for passing to Control File --+ PLM_CHECK. The array comprises: --+ - a Title line. --+ - a list of up to 50 MDI database parameters to be checked. --+ - an "End" line. --+ --+ - calls PLM_CHECK, using the array as its first parameter and a maximum --+ retry value of -1 as its second parameter unless a different retry --+ value was supplied to this Control File. --+ --+ - repeats the above two steps as many times as necessary to pass all of --+ the parameters in the required group to PLM_CHECK. --+ --+ - writes a few blank lines to the log file before returning the system --+ variable !Rstat to the calling Control File, if any. --+ --+ Conditions: --+ None c0 --+ --+ Sub-Control Files: --+ MDI_PARAM_01 (handles those parameters) --+ MDI_PARAM_02 (handles those parameters) --+ --+ Passed parameters : --+ ----------------- --+ --+ !AcqMode = all | c0 | allcond (for compatibility only) --+ !MaxTime = (Max. No. of updates allowed using condition --+ - for compatibility only) --+ !StopPrint = Yes | No --+ --+ --+ Sub-Control Files : --+ ----------------- --+ PLM_CHECK --+ --+ --+ Prerequisites : --+ ------------- --+ None --+ --+ History : --+ ------- --+ issue SIC Note Time Date Name/Updates --+ +---+ +------+ +---+ +------+ +-------------------------------------+ --+ 1.0 381 11:22 29/04/94 JP. Prat First attempt. ---------------------------------------------------------------------------+ Common Var str(80) !GM_Param(52) -- Parameter array int !GM_ParIx = 0 -- Index to get Parameter from array int !GM_MaxItem = 52 -- Maximun number of array item int !GM_MaxRetry = -1 -- maximum number of retry allowed Bool !GZ_Window -- Open window flag (on CF start) Bool !GZ_Spool -- Automatic Spool (at End of CF exec) Bool !GZ_Test -- UNUSED End common Extern Cfile PLM_CHECK, MDI_PARAM_01, MDI_PARAM_02 Procedure Message, OpenWindow, ExitCf Procedure CheckArgstr, CheckArgInt Procedure Lower End Extern Program MDI_PARAM DefArg str(8) !AcqMode = "all" -- Acquisition mode (all, C0, allcond) -- (Since all parameters have no conditions, all -- variants of this parameter have the same -- significance, reatined for compatibility with -- other similar CFs) int !MaxTime = 0 -- Maximum number of updates allowed using condition -- (Since all parameters have no conditions, all -- variants of this parameter have the same -- significance, reatined for compatibility with -- other similar CFs) str(8) !StopPrint = "Yes" End Defarg Var int !NoRetry = -1 -- Maximum number of retries allowed (Dump) int !NbErr = 0 -- Number of errors str(8) !LAcqMode -- Tempo argument 1 str(8) !Print -- Tempo argument 3 str(80) !S = &-80s(" ") -- Tempo string Main -- --. After opening a window on the screen for the output to be displayed in, --. the maximum retry value is set up, then the first group of parameters is --. defined by passing them in turn to sub-procedure PutP, preceded by --. "Title" and followed by "End". Control File PLM_CHECK is then called by --. calling sub-procedure Check. Further groups of parameters are --. processed in the same way before four blank lines are inserted into the --. Log File. A halt instruction is included to enable the user to print the --. Log File before the window is closed (NB This will be unnecessary when --. the EXTRACT instruction has been made to work correctly). !Rstat is --. returned to any calling Control File. -- @OpenWindow() Cflog @Lower(!AcqMode, *!LAcqMode) @CheckArgStr(!LAcqMode, "Arg1 as acquisition mode", \ "in all allcond c0", \ *!NbErr) @CheckArgInt(!MaxTime, "Arg2 as max. no of update", \ ">= 0 And <=30", \ *!NbErr) @Lower(!StopPrint, *!Print) @CheckArgStr(!Print, "Arg3 as Flag to print", \ "in yes, no", \ *!NbErr) If (!NbErr <> 0) Then @ExitCf(!NbErr) Return !Rstat End If !GM_MaxRetry = !NoRetry -- ----------------------------------------------------------------------------------- -- --. All parameters are handled externally because the compiler seems unable to --. cope with the length of file if we do them here!!! --. Select !LAcqMode Case "all", "co", "allcond" @Message("DCL", "date", "MDI", " ", \ "-.Dump of all MDI parameters", *!S) Perform/No MDI_PARAM_01 @UpdateErr(*!NbErr) Perform/No MDI_PARAM_02 @UpdateErr(*!NbErr) Default End Select @ExitCF(!NbErr) @PrintCF("MDI", !Print) Cflog Return !Rstat End Program ------------------------------------------------------------------------------------- Procedure PrintCF( str(3) !ExpName, str(8) !Print) --. Print the control file log file if required by !Print ; --. - using the 'Spool' statement if the variable !GZ_Spool is TRUE, --. - using the dialog box window if the variable !GZ_Spool is FALSE. --. Var str(80) !S Main If !Print = "yes" Then If !GZ_Spool = TRUE Then Spool CF Else Cflog @Message( "DC", "date", !ExpName, " ", \ "++++Print the CFLog, then type CONT+++", *!S) Halt @Message( "DC", "date", !ExpName, " ", \ "+Operator continue.", *!S) End If End If Return End Procedure ----------------------------------------------------------------------- Procedure UpdateErr(Int *!NbErr) --. --. Update the !NbErr variable according to the returned !Rstat --. variable. --. Must be called after a PLM 'perform ControlFile' --. Example : --. Perform PLM_LOBT, ... --. @UpdateErr(*!NbErr) --. --. Main If (!Rstat <> "Ok") then !NbErr = !NbErr + Int(Val(SplitStr(!RStat, " ", 2))) End If Return End Procedure -----------------------------------------------------------------------