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_State_Transition_Diagram
(State Transition Diagram)


Vytvořeno: 12-11-1995 13:06:07
Poslední změna: 12-10-2002 12:12:54

Checks the specified diagram for existence of an initial state, solitary states and states unintentionally left without a following state.

Modul

Module: State Transition Diagram

Zdrojový kód:

PROCEDURE Check_State_Transition_Diagram FOR STATEAREA
BEGIN
/*
  check state transition diagram:
  - unconnected states
  - missing creation state
  - missing transitions
*/
  PRINT {"ARIAL",12,BOLD} "Test stavového diagramu funkce ";
  FOR Function WHERE Name=Statearea.Function DO
    PRINT {"ARIAL",12,BOLD,ITALIC} CONV$(Boxname),NL(2);
    start$=Creationstate;
  END

  found%=0;
  anything%=0;
  FOREACH State WHERE Function=Statearea.Function DO
      anything%=1;
      BREAK;
  END

  // missing creation state
  combi%=0;
  FOR State WHERE Name=start$
              AND Function=Statearea.Function DO
      combi%=1;
  END
  IF combi%=0 THEN
    PRINT {BOLD,"ARIAL",10} "Není definován počáteční stav.",NL(2);
    found%=1;
  END

  // unconnected states
  first%=0;
  FOREACH State WHERE Function=Statearea.Function DO
    combi%=0;
    FOREACH Transition WHERE State.Name=Sourcestate
                          OR State.Name=Sourcestate DO
      combi%=1;
      BREAK;
    END
    IF combi%=0 THEN
      IF first%=0 THEN
        PRINT {BOLD,"ARIAL",10} "Nepřipojené stavy:",NL;
        first%=1;
        found%=1;
      END
      PRINT {"ARIAL",10} TAB(4),CONV$(State.Boxname),NL;
    END
  END

  IF first%=1 THEN
    PRINT NL;
  END

  // cul de sacs
  first%=0;
  FOREACH State WHERE Function=Statearea.Function
                AND IsFinal = 0 DO
    sources%=0;
    targets%=0;
    FOREACH Transition WHERE State.Name=Sourcestate DO
      sources%=1;
      BREAK;
    END
    FOREACH Transition WHERE State.Name=Targetstate DO
      targets%=1;
      BREAK;
    END
    IF sources%=0 AND targets%=1 THEN
      IF first%=0 THEN
        PRINT {BOLD,"ARIAL",10} "Stavy bez následníka:",NL;
        first%=1;
        found%=1;
      END
      PRINT {"ARIAL",10} TAB(4),CONV$(State.Boxname),NL;
    END
  END

  IF found%=0 THEN
    IF anything%=0 THEN
      PRINT {"ARIAL",10,BOLD} TAB(4),"Stavový diagram je prázdný.",NL;
    ELSE
      PRINT {"ARIAL",10} TAB(4),"Bez formálních chyb.",NL;
    END
  END
  PRINT NL;


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\25186.htm (C) microTOOL GmbH 2002