| |
| #ifndef COMPUTER_HH |
| #define COMPUTER_HH |
| |
| #include "AppControl.hh" |
| #include "Resource.hh" |
| #include "USBProtocol.hh" |
| #include "umlrtcapsule.hh" |
| #include "umlrtcapsuleclass.hh" |
| #include "umlrtcapsuleid.hh" |
| #include "umlrtframeprotocol.hh" |
| #include "umlrtmessage.hh" |
| #include "umlrttimerid.hh" |
| #include "umlrttimerprotocol.hh" |
| struct UMLRTCapsulePart; |
| struct UMLRTCommsPort; |
| struct UMLRTSlot; |
| |
| #include "ResourceType.hh" |
| |
| #include <iostream>
|
| #include <iomanip>
|
| #include <ctime>
|
| #include "ResourceType.hh" |
| |
| class Capsule_Computer : public UMLRTCapsule |
| { |
| public: |
| Capsule_Computer( const UMLRTCapsuleClass * cd, UMLRTSlot * st, const UMLRTCommsPort * * border, const UMLRTCommsPort * * internal, bool isStat ); |
| protected: |
| UMLRTFrameProtocol_baserole frame; |
| public: |
| enum InternalPortId |
| { |
| internalport_frame, |
| internalport_resMgr, |
| internalport_timer |
| }; |
| protected: |
| Resource::Conj resMgr; |
| UMLRTTimerProtocol_baserole timer; |
| USBProtocol::Conj usbPort; |
| public: |
| enum BorderPortId |
| { |
| borderport_usbPort, |
| borderport_userPort |
| }; |
| protected: |
| AppControl::Base userPort; |
| public: |
| enum PartId |
| { |
| part_application, |
| part_driverManager, |
| part_usbBus |
| }; |
| protected: |
| const UMLRTCapsulePart * const application; |
| const UMLRTCapsulePart * const driverManager; |
| const UMLRTCapsulePart * const usbBus; |
| public: |
| enum PortId |
| { |
| port_frame, |
| port_resMgr, |
| port_timer, |
| port_usbPort, |
| port_userPort |
| }; |
| virtual void bindPort( bool isBorder, int portId, int index ); |
| virtual void unbindPort( bool isBorder, int portId, int index ); |
| protected: |
| UMLRTTimerId timerId; |
| UMLRTCapsuleId printerID; |
| UMLRTCapsuleId storageID; |
| int numSec; |
| public: |
| int dummy; |
| virtual void inject( const UMLRTMessage & message ); |
| virtual void initialize( const UMLRTMessage & message ); |
| const char * getCurrentStateString() const; |
| private: |
| enum State |
| { |
| top__InitUSBBus, |
| top__Running, |
| top__WaitForResourceManager, |
| top__InitUSBBus__WaitForPrinter, |
| top__InitUSBBus__WaitForStorage, |
| top__InitUSBBus__boundary, |
| SPECIAL_INTERNAL_STATE_UNVISITED |
| }; |
| const char * stateNames[7]; |
| State currentState; |
| State history[1]; |
| void save_history( State compositeState, State subState ); |
| bool check_history( State compositeState, State subState ); |
| void entryaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__WaitForPrinter__setTimer( const UMLRTMessage * msg ); |
| void entryaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__WaitForStorage__requestStorageDriver( const UMLRTMessage * msg ); |
| void entryaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__initUSBBus( const UMLRTMessage * msg ); |
| void entryaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__Running__running( const UMLRTMessage * msg ); |
| void entryaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__WaitForResourceManager__waitForResMgr( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onPrintDriverTimeout__Timeout_NoResponse( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onPrintResourceID__importPrinterDriver_requestStorageDriver( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onStorageResourceID__importStorageDriver( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onStorageTimeout__onStorageTimeout( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__Initialise__initializing( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Computer__Computer__Computer_SM__Region1__onResMgrRunning__resMgrRunning( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__EX_InitUSB_Continuation( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__EN_initUSB_Continuation( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onPrintDriverTimeout( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onPrintResourceID( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onStorageResourceID( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__InitUSBBus__Region1__onStorageTimeout( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__Initialise( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Computer__Computer__Computer_SM__Region1__onResMgrRunning( const UMLRTMessage * msg ); |
| void actionchain_____top__InitUSBBus__new_transition_1( const UMLRTMessage * msg ); |
| void actionchain_____top__InitUSBBus__new_transition_2( const UMLRTMessage * msg ); |
| void actionchain_____top__InitUSBBus__new_transition_3_to_boundary( const UMLRTMessage * msg ); |
| State junction_____top__InitUSBBus__EN_initUSB( const UMLRTMessage * msg ); |
| State junction_____top__InitUSBBus__EX_initUSB( const UMLRTMessage * msg ); |
| State choice_____top__InitUSBBus__deephistory( const UMLRTMessage * msg ); |
| State state_____top__InitUSBBus__WaitForPrinter( const UMLRTMessage * msg ); |
| State state_____top__InitUSBBus__WaitForStorage( const UMLRTMessage * msg ); |
| State state_____top__InitUSBBus__boundary( const UMLRTMessage * msg ); |
| State state_____top__Running( const UMLRTMessage * msg ); |
| State state_____top__WaitForResourceManager( const UMLRTMessage * msg ); |
| }; |
| extern const UMLRTCapsuleClass Computer; |
| |
| #endif |
| |