/* CIF PackageDiagram */
/* CIF Page 1  (3190,3190) */
/* CIF Frame (95,95),(1595,1595) */
/* CIF TextPosition (119,190)  */
/* CIF TextPosition (1555,119) PageName  */
/* CIF Specific CSDL Version 1.1 */
/* CIF Specific SDT OriginalFileName 'accessp1signals.sun' */
/* CIF Specific SDT Page 1 Scale 90 Grid (50,50) AutoNumbered */
PACKAGE AccessP1Signals ;
/* CIF CurrentPage 1  */
/* CIF Text (285,333),(596,333) */
/* CIF TextPosition (285,333)  */
signal outOfService,
OK,ERR;
signal unlock,unlocked;
signal 
newCode(Integer),
code(Integer);
signal step,stepDoor;

/* CIF End Text */
/* CIF End PackageDiagram */
ENDPACKAGE;
/* CIF BlockDiagram */
/* CIF Page 1  (3190,3190) */
/* CIF Frame (95,95),(1595,1595) */
/* CIF TextPosition (119,190)  */
/* CIF TextPosition (1555,119) PageName  */
/* CIF PackageReference (571,119),(452,142) */
/* CIF TextPosition (571,119)  */
/* CIF Specific CSDL Version 1.1 */
/* CIF Specific SDT OriginalFileName 'accessp1.sbl' */
/* CIF Specific SDT Page 1 Scale 90 Grid (50,50) AutoNumbered */
 use AccessP1Signals; BLOCK accessP1 ;
/* CIF CurrentPage 1  */
/* CIF SignalRoute (1333,809),(1333,1214) */
/* CIF TextPosition (1238,1137)  */
/* CIF TextPosition (1357,1071) Signallist1  */
/* CIF TextPosition (1357,833) Signallist2  */
  SIGNALROUTE accessp1Ename83__i
         FROM Controller TO Door WITH unlock,
stepDoor          ;
         FROM Door TO Controller WITH step ;
/* CIF SignalRoute (1166,1262),(95,1262) */
/* CIF TextPosition (619,1190)  */
/* CIF TextPosition (166,1166) Signallist1  */
  SIGNALROUTE chDoorEnv
         FROM Door TO ENV WITH unlocked ;
/* CIF SignalRoute (95,762),(1190,762) */
/* CIF TextPosition (571,714)  */
/* CIF TextPosition (904,785) Signallist1  */
  SIGNALROUTE chNewCode
         FROM ENV TO Controller WITH newCode ;
/* CIF SignalRoute (1190,476),(95,476) */
/* CIF TextPosition (595,404)  */
/* CIF TextPosition (190,333) Signallist1  */
  SIGNALROUTE chCntrEnv
         FROM Controller TO ENV WITH outOfService,
OK,ERR          ;
/* CIF SignalRoute (95,619),(1190,619) */
/* CIF TextPosition (595,571)  */
/* CIF TextPosition (928,642) Signallist1  */
  SIGNALROUTE chEnvCntr
         FROM ENV TO Controller WITH code ;
/* CIF Process (1166,1214),(334,95) */
/* CIF TextPosition (1166,1214)  */
  PROCESS Door REFERENCED;
/* CIF Process (1190,428),(286,381) */
/* CIF TextPosition (1190,428)  */
  PROCESS Controller REFERENCED;
/* CIF End BlockDiagram */
ENDBLOCK;
/* CIF ProcessDiagram */
/* CIF Page 1  (3190,3190) */
/* CIF Frame (95,95),(1595,1595) */
/* CIF TextPosition (119,190)  */
/* CIF TextPosition (1555,119) PageName  */
/* CIF Specific CSDL Version 1.1 */
/* CIF Specific SDT OriginalFileName 'door.spr' */
/* CIF Specific SDT Page 1 Scale 90 Grid (50,50) AutoNumbered */
PROCESS<<BLOCK accessP1>> Door ;
/* CIF CurrentPage 1  */
/* CIF Start (1071,190),(191,95) */
/* CIF TextPosition (1071,190)  */
  START;
/* CIF Line (1166,285),(1166,333)  */
/* CIF NextState (1000,333),(333,95) */
/* CIF TextPosition (1000,333)  */
  NEXTSTATE  doorLocked ;
/* CIF State (1000,333),(333,95) */
/* CIF TextPosition (1000,333)  */
  STATE doorLocked ;
/* CIF Line (1166,428),(1166,476)  */
/* CIF Input (1023,476),(286,95) Right */
/* CIF TextPosition (1023,476)  */
    INPUT unlock ;
/* CIF Line (1166,571),(1166,619)  */
/* CIF Output (1000,619),(333,95) Right */
/* CIF TextPosition (1000,619)  */
    OUTPUT step ;
/* CIF Line (1166,714),(1166,762)  */
/* CIF Output (1000,762),(333,95) Right */
/* CIF TextPosition (1000,762)  */
    OUTPUT unlocked ;
/* CIF Line (1166,857),(1166,976)  */
/* CIF NextState (1000,976),(333,95) */
/* CIF TextPosition (1000,976)  */
    NEXTSTATE  doorUnlocked ;

/* CIF End State */
  ENDSTATE;
/* CIF State (1000,976),(333,95) */
/* CIF TextPosition (1000,976)  */
  STATE doorUnlocked ;
/* CIF Line (1166,1071),(1166,1166)  */
/* CIF Input (976,1166),(381,96) Right */
/* CIF TextPosition (976,1166)  */
    INPUT stepDoor
     ;
/* CIF Line (1166,1262),(1166,1357)  */
/* CIF NextState (1000,1357),(333,95) */
/* CIF TextPosition (1000,1357)  */
    NEXTSTATE  doorLocked ;

/* CIF End State */
  ENDSTATE;
/* CIF End ProcessDiagram */
ENDPROCESS;
/* CIF ProcessDiagram */
/* CIF Page 1  (3620,3190) */
/* CIF Frame (95,95),(1810,1595) */
/* CIF TextPosition (119,190)  */
/* CIF TextPosition (1770,119) PageName  */
/* CIF Specific CSDL Version 1.1 */
/* CIF Specific SDT OriginalFileName 'controller.spr' */
/* CIF Specific SDT Page 1 Scale 90 Grid (50,50) AutoNumbered */
PROCESS<<BLOCK accessP1>> Controller ;
/* CIF CurrentPage 1  */
/* CIF Text (119,190),(381,191) */
/* CIF TextPosition (119,190)  */
dcl 
codeDoor,y 
Integer :=0;

/* CIF End Text */
/* CIF Start (1000,190),(190,95) */
/* CIF TextPosition (1000,190)  */
  START;
/* CIF Line (1095,285),(1095,357)  */
/* CIF NextState (1000,357),(190,95) */
/* CIF TextPosition (1000,357)  */
  NEXTSTATE  init ;
/* CIF State (690,1381),(286,95) */
/* CIF TextPosition (690,1381)  */
  STATE stepDoor ;
/* CIF Line (833,1476),(833,1500),(1095,1500),(1095,1071),(1309,1071),(1309,1095)  */
/* CIF Input (1166,1095),(286,95) Right */
/* CIF TextPosition (1166,1095)  */
    INPUT step ;
/* CIF Line (1309,1190),(1309,1309)  */
/* CIF Output (1166,1309),(286,95) Right */
/* CIF TextPosition (1166,1309)  */
    OUTPUT stepDoor ;
/* CIF Line (1309,1404),(1309,1476)  */
/* CIF NextState (1214,1476),(190,95) */
/* CIF TextPosition (1214,1476)  */
    NEXTSTATE  init ;

/* CIF End State */
  ENDSTATE;
/* CIF State (1000,357),(190,95) */
/* CIF TextPosition (1000,357)  */
  STATE init ;
/* CIF Line (1095,452),(1095,476),(1595,476),(1595,523)  */
/* CIF Input (1428,523),(334,96) Right */
/* CIF TextPosition (1428,523)  */
    INPUT code(y) ;
/* CIF Line (1595,619),(1595,666)  */
/* CIF Decision (1381,666),(428,143) */
/* CIF TextPosition (1381,666)  */
    DECISION
codeDoor<=1000       ;
/* CIF Answer InvisibleBrackets */
/* CIF Line (1381,738),(833,738),(833,881)  */
/* CIF TextPosition (1190,666)  */
      ( false ):
/* CIF Decision (642,881),(381,142) */
/* CIF TextPosition (642,881)  */
                DECISION
y=codeDoor                   ;
/* CIF Answer InvisibleBrackets */
/* CIF Line (642,952),(381,952),(381,1119)  */
/* CIF TextPosition (428,976)  */
                  ( false ):
/* CIF Output (214,1119),(333,95) Right */
/* CIF TextPosition (214,1119)  */
                            OUTPUT ERR ;
/* CIF Line (381,1214),(381,1309)  */
/* CIF NextState (285,1309),(191,95) */
/* CIF TextPosition (285,1309)  */
                            NEXTSTATE  init ;
/* CIF Answer InvisibleBrackets */
/* CIF Line (833,1023),(833,1166)  */
/* CIF TextPosition (857,1071)  */
                  ( true ):
/* CIF Output (690,1166),(286,96) Right */
/* CIF TextPosition (690,1166)  */
                            OUTPUT OK,unlock ;
/* CIF Line (833,1262),(833,1381)  */
/* CIF NextState (690,1381),(286,95) */
/* CIF TextPosition (690,1381)  */
                            NEXTSTATE  stepDoor ;

/* CIF End Decision */
                ENDDECISION;
/* CIF Answer InvisibleBrackets */
/* CIF Line (1595,809),(1595,904)  */
/* CIF TextPosition (1619,833)  */
      ( true ):
/* CIF Output (1428,904),(334,96) Right */
/* CIF TextPosition (1428,904)  */
                OUTPUT outOfService ;
/* CIF Line (1595,1000),(1595,1047)  */
/* CIF NextState (1500,1047),(190,96) */
/* CIF TextPosition (1500,1047)  */
                NEXTSTATE  init ;

/* CIF End Decision */
    ENDDECISION;
/* CIF Line (1095,452),(1095,476),(619,476),(619,500)  */
/* CIF Input (357,500),(524,95) Right */
/* CIF TextPosition (357,500)  */
    INPUT newCode(codeDoor) ;
/* CIF Line (619,595),(619,714)  */
/* CIF NextState (523,714),(191,95) */
/* CIF TextPosition (523,714)  */
    NEXTSTATE  init ;

/* CIF End State */
  ENDSTATE;
/* CIF End ProcessDiagram */
ENDPROCESS;
