Informační tok Funkční structura Datová struktura ER model Modulová struktura Typová struktura Relační model Dokumentace


[Celkový datový model] [Funkce] [Externí rohraní] [Stavové diagramy] [Datové elementy] [Entity] [Relace]
[Databáze] [Události] [Materiály] [Generovací funkce] [Vyhodnocovací funkce] [Konfigurace] [Uživatelé] [Projekt] [Home]



Vyhodnocovací funkce
Check_Conditions
(Type Structure)


Vytvořeno: 12-11-1995 13:00:05
Poslední změna: 02-09-1998 09:40:09

Checks the specified type structure for formal correctness of the condition boxes in the diagram.

Modul

Module: Type Structure

Zdrojový kód:

PROCEDURE Check_Conditions FOR TYPESTRUCTURE
BEGIN
/*
  check conditions; print name of parent nodes under which unclear
  combinations of conditions are arranged
*/

  PRINT {"ARIAL",12,BOLD} "Condition Check for Type Structure ";
  PRINT {"ARIAL",12,BOLD,ITALIC} CONV$(Typestructure.Boxname),NL(2);

  found%=0;
  
  // inclusive condition
  first%=0;
  FOREACH Tcond AS C1 WHERE C1.Typestructure=Typestructure.Name AND
                           C1.Ppage<>0 AND
                           C1.Condition="in" ORDER BY Page,Boxname DO
    CALL TestTSDCond(C1.Typestructure,C1.Condition,C1.Ppage,
                     C1.Pfieldno,C1.Pcondno,C1.Tcondno,C1.X,erg%);
    IF erg%=1 THEN
      // missing condition
      found%=1;
      PRINT {BOLD,"ARIAL",10} "solitary inclusive condition:",NL;
      IF C1.Pfieldno<>0 THEN
        FOR Tfield WHERE Tfield.Fieldno=C1.Pfieldno AND
                         Tfield.Typestructure=C1.Typestructure AND
                         Tfield.Page=C1.Ppage DO
          PRINT {"ARIAL",10} TAB(4),"underneath field ";
          PRINT {"ARIAL",10,ITALIC} CONV$(Tfield.Boxname);
        END
      ELSIF C1.Pcondno<>0 THEN
        FOR Tcond WHERE Tcond.Tcondno=C1.Pcondno AND
                        Tcond.Typestructure=C1.Typestructure AND
                        Tcond.Page=C1.Ppage DO
          PRINT {"ARIAL",10} TAB(4),"underneath condition ";
          PRINT {"ARIAL",10,ITALIC} CONV$(Tcond.Boxname);
        END
      END
      PRINT {"ARIAL",10} ": ",CONV$(C1.Boxname),NL;
      First%=1;
    END
  END
  IF first%=1 THEN
    PRINT NL;
  END

  // exclusive condition
  first%=0;
  FOREACH Tcond AS C1 WHERE C1.Typestructure=Typestructure.Name AND
                           C1.Ppage<>0 AND
                           C1.Condition="ex" ORDER BY Page,Boxname DO
    CALL TestTSDCond(C1.Typestructure,C1.Condition,C1.Ppage,
                     C1.Pfieldno,C1.Pcondno,C1.Tcondno,C1.X,erg%);
    IF erg%=1 THEN
      // missing condition
      found%=1;
      PRINT {BOLD,"ARIAL",10} "solitary exclusive condition:",NL;
      IF C1.Pfieldno<>0 THEN
        FOR Tfield WHERE Tfield.Fieldno=C1.Pfieldno AND
                         Tfield.Typestructure=C1.Typestructure AND
                         Tfield.Page=C1.Ppage DO
          PRINT {"ARIAL",10} TAB(4),"underneath field ";
          PRINT {"ARIAL",10,ITALIC} CONV$(Tfield.Boxname);
        END
      ELSIF C1.Pcondno<>0 THEN
        FOR Tcond WHERE Tcond.Tcondno=C1.Pcondno AND
                        Tcond.Typestructure=C1.Typestructure AND
                        Tcond.Page=C1.Ppage DO
          PRINT {"ARIAL",10} TAB(4),"underneath condition ";
          PRINT {"ARIAL",10,ITALIC} CONV$(Tcond.Boxname);
        END
      END
      PRINT {"ARIAL",10} ": ",CONV$(C1.Boxname),NL;
      First%=1;
    END
  END
  IF first%=1 THEN
    PRINT NL;
  END

  // missing child elements underneath condition
  first%=0;
  FOREACH Tcond AS C1 WHERE C1.Typestructure=Typestructure.Name
                      AND C1.Condition <> "em" DO
    children%=0;
    FOREACH Relationpart WHERE Relationpart.Pcondno=C1.Tcondno DO
      children%=children%+COUNT();
      BREAK;
    END
    FOREACH Tpart WHERE Tpart.Pcondno=C1.Tcondno AND
                        Tpart.Typestructure=C1.Typestructure AND
                        Tpart.Ppage=C1.Page DO
      children%=children%+COUNT();
      BREAK;
    END
    FOREACH Tfield WHERE Tfield.Pcondno=C1.Tcondno AND
                        Tfield.Typestructure=C1.Typestructure AND
                        Tfield.Ppage=C1.Page DO
      children%=children%+COUNT();
      BREAK;
    END
    FOREACH Tcond WHERE Tcond.Pcondno=C1.Tcondno AND
                        Tcond.Typestructure=C1.Typestructure AND
                        Tcond.Ppage=C1.Page DO
      children%=children%+COUNT();
      BREAK;
    END
    
    IF children%=0 THEN
      IF first%=0 THEN
        PRINT {BOLD,"ARIAL",10} "Conditions without child elements:",NL;
        first%=1;
        found%=1;
      END
      PRINT {"ARIAL",10} TAB(4),CONV$(C1.Boxname),NL;
    END
  END
  
  IF first%=1 THEN
    PRINT NL;
  END

  // conditions without connection to parent element
  first%=0;
  FOREACH Tcond AS C1 WHERE C1.Typestructure=Typestructure.Name AND
                            C1.Ppage=0 DO
    IF first%=0 THEN
      PRINT {"ARIAL",10,BOLD} "Unconnected conditions:",NL;
      first%=1;
      found%=1;
    END
    PRINT {"ARIAL",10} TAB(4),CONV$(C1.Boxname),NL;
  END

  IF found%=0 THEN
    PRINT {"ARIAL",10} TAB(4),"No formal errors concerning conditions and connections detected.",NL;
  END
  PRINT NL(2);
 
END


Generováno: 16.10.2003 7:41 Systém: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\Projekt03.csf Generováno systémem case/4/0
Vygeneroval: Administrator Soubor: C:\Documents and Settings\hajsman\Dokumenty\Vyuka\Irs2\Projekt case40\html\22002.htm (C) microTOOL GmbH 2002