⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 liftsystem.pr

📁 UML语言构建的电梯管理系统
💻 PR
📖 第 1 页 / 共 3 页
字号:
                decision ( length( requests) > 0);
                    ( true ):
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#ChuX6IuywfDLouvXKVNAv5aI")*/
                        task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#ChuX6IuywfDLouvXKVNAv5aI")*/
                        pendingRequest := true;
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#1Ck5zVfGtm5LSqLd*La0-RTV")*/
                        nextstate WaitNotification;
                    ( false ):
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#CK7DwIihsTILuwvZNIoJucNI")*/
                        task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#CK7DwIihsTILuwvZNIoJucNI")*/
                        pendingRequest := false;
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#dG2oNI4waAlLimL7nIMYC5IV")*/
                        nextstate WaitNotification;
                enddecision;
        state WaitNotification;
        state WaitNotification;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#nnolREoO*ClLFgHYUVv-jFPI")*/
            input notify( currentInfo);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#g13czV9NTMLLiG9gOIGtTKCE")*/
                decision ( currentInfo *>! doorStatus);
                    ( open ):
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#4epAbLdla3BL7VwfuI9fL5gV")*/
                        nextstate WaitNotification;
                    ( closed ):
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#d4RuFLJKhK0LhlpYrVJz*TzI")*/
                        nextstate HandlingRequest;
                enddecision;
        state WaitNotification;
        state HandlingRequest;
        state HandlingRequest;
        state *;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#qTRIZLg3K3BLUtnWcIdvFqeE")*/
            input gotoFloor( numFloor);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#n0TxrVTRfXvLij49pESfnhnV")*/
                output floorLight( numFloor);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#CI1dWE56F*ALGrrYgLi5R8yV")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#CI1dWE56F*ALGrrYgLi5R8yV")*/
                req := @NewRequest;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#LtqcLIoBGliLCXZYjELe9yQV")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#LtqcLIoBGliLCXZYjELe9yQV")*/
                req *>! targetFloor := numFloor;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#LdMgbIk-oJSLEFZ9hVfnli9V")*/
                call insertRequest( req);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#Fzpu8IbroSLL8a46qE28mdlV")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#Fzpu8IbroSLL8a46qE28mdlV")*/
                pendingRequest := true;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#cFhw6I1WSWILf9sggEQtxpWL")*/
                nextstate HandlingRequest;
        state *;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#pEGn-LowFJFLUaB6CIX7HGDI")*/
            input handleRequest( req1);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#8HMmULtrBRBLhxskVV2ncAEL")*/
                call insertRequest( req1);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#XhWi0Ldt6oCLrPNdLLYxtoMI")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#XhWi0Ldt6oCLrPNdLLYxtoMI")*/
                pendingRequest := true;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#WZuPcE7HdJCLkElcsV7NtFRV")*/
                nextstate HandlingRequest;
        state HandlingRequest;
        
    endprocess type;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#BPatUI6RQSLLpuegLEKiGZaL")*/
    process type Lift; fpar /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#U9aXLVoQ8r0LG0GgTI8W7BdV")*/
    ctrl Pid;
    signalset;
        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#02EcyLhLkNALBR0bgLPZr8lI")*/
        gate P1
            in with ( ILift);
            out with ( ILiftObserver);
        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#FboWpIyhJc5LFJnXMLaKly-I")*/
        dcl destination Integer;
        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#26LIHI1pguvLN1phiIvcfpfE")*/
        dcl liftInfo @ptr_LiftInfo;
        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#Qo1pQLItwmBLv-RXTVWV-zsI")*/
        timer floorTimer;
        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#TLh6mVUVb1ALxJ5fsEg3DX2E")*/
        timer doorTimer;
        
        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#7pO4jLcbCKeLXUE76V*-3OoE")*/
        start;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#y0mRsLDkccVLPridsLmJUPbE")*/
            task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#y0mRsLDkccVLPridsLmJUPbE")*/
            liftInfo := @NewLiftInfo;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#O9OXzIngoXSLl05XvVgIhjWE")*/
            output associate(self) to ctrl;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#KBgb-LFv7MILD9FbPIBRMkNE")*/
            nextstate Idle;
        state Idle;
        state Idle;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#PuFTtLle6vALxddhlEp07JzV")*/
            input moveToFloor( destination);
            provided liftInfo *>! doorStatus = closed;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#IZDw3LrK2bBLnFZgoLrihkII")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#IZDw3LrK2bBLnFZgoLrihkII")*/
                liftInfo *>! isMoving := true;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#uh40OILY-VeLzFRffLbXpdJE")*/
                task
                {
                    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#uh40OILY-VeLzFRffLbXpdJE")*/
                    if ( destination > liftInfo *>! currentFloor) {
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#McfAsVEmt7eLdCSf1LcqklVL")*/
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#DkU5IE12WTLLO5yhHIAEdpjV")*/
                        liftInfo *>! direction := up;
                    } else {
                        /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#jVeqYVszcmVLS0rcALMGBI7I")*/
                        liftInfo *>! direction := down;
                    }
                };
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#sqrlsVfLWEELFG-93L5iTuEV")*/
                set (now + 3, floorTimer);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#UUtciV9m9OeLnAzb0Ex6-bKI")*/
                nextstate Moving;
        state Moving;
        state Moving;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#JjPtCI2zCHELRT*bFVY-sBnI")*/
            input floorTimer;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#dFbjKEpW1NDLznXhfVV94GwI")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#dFbjKEpW1NDLznXhfVV94GwI")*/
                liftInfo *>! isMoving := false;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#cm*cLVXjOV0LVRRW*VeCgOsE")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#cm*cLVXjOV0LVRRW*VeCgOsE")*/
                liftInfo *>! currentFloor := destination;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#2Og9VL4IMvBLuVQb7I7S8B6V")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#2Og9VL4IMvBLuVQb7I7S8B6V")*/
                liftInfo *>! doorStatus := open;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#qEaLBEKIaSBL9TiffVLvlROI")*/
                set (now + 5, doorTimer);
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#SGEEaLJVyQeLVdqYILp2b-6L")*/
                output notify( liftInfo) to ctrl;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#BivpLLEm6lvLbKxdNVM2qrWI")*/
                nextstate Idle;
        state Idle;
        state Idle;
            /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#mvH6aLyH66eLpBuc4EyrJByE")*/
            input doorTimer;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#vGwsYI06Ue5LUbqaxIdyBYnL")*/
                task /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#vGwsYI06Ue5LUbqaxIdyBYnL")*/
                liftInfo *>! doorStatus := closed;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#3UHtCI8GGZFL2IpY7Lc*GaGI")*/
                output notify( liftInfo) to ctrl;
                /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#bP*F1LgmawVLYMV6ALwl3VAI")*/
                nextstate Idle;
        state Idle;
        
    endprocess type;
    
endpackage;

use Interfaces;
use LiftComponents;
use U2ctypes;
use U2ExtraOps;
/*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#LakxRIUly0ALez7gVELAveDI")*/
package LiftManagement;
    
endpackage;

use LiftManagement;
use Interfaces;
use LiftComponents;
use U2ctypes;
use U2ExtraOps;
/*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#3OGR2LayaR5LT0VjLEaulILI")*/
system LiftSystem;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#xiyAsI5NsrILWcX61Eeu*FZE")*/
    process liftManager (1, 1) : LiftManager;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#JyoDrIgiulFLx*s6HVbn0JTE")*/
    process liftControllers (0, 10) : LiftController;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#6OFoNIVo0TLLI5sYXL-GKVqL")*/
    process lifts (0, 10) : Lift;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#ZOOZYL7AZeVLbZFW1EBbEopL")*/
    channel @lifts@P1@liftControllers@P2
        from lifts via P1 to liftControllers via P2 with ( ILiftObserver);
        from liftControllers via P2 to lifts via P1 with ( ILift);
    endchannel;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#JD9K*EP6xSFL0jqb9Ve5k5PE")*/
    channel @liftControllers@P3@liftManager@P3
        from liftControllers via P3 to liftManager via P3 with ( IResponse);
        from liftManager via P3 to liftControllers via P3 with ( IRequest);
    endchannel;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#KMfaILW1BZILy6Kk0LTFPaeV")*/
    channel @LiftSystem@envPort@liftManager@P1
        from env to liftManager via P1 with ( IFromFloorPanel);
        from liftManager via P1 to env with ( IToFloorPanel);
    endchannel;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#6FAVyVuOYplLKxmjlIGpn*RI")*/
    channel @LiftSystem@envPort@liftControllers@P1
        from env to liftControllers via P1 with ( IFromLiftPanel);
        from liftControllers via P1 to env with ( IToLiftPanel);
    endchannel;
    /*#SDTREF(U2,"u2:F:\UML\LiftManagement20\SystemDesign\LiftManagement.u2#kGe8uVUXo-ALTQ-aZVVWqMPL")*/
    channel @LiftSystem@envPort@liftManager@P2
        from env to liftManager via P2 with ( IFromServicePanel);
        from liftManager via P2 to env with ( IToServicePanel);
    endchannel;
    
endsystem;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -