| |
| #ifndef LOCALPRINTER_HH |
| #define LOCALPRINTER_HH |
| |
| #include "USBDeviceClasses.hh" |
| #include "USBProtocol.hh" |
| #include "umlrtcapsule.hh" |
| #include "umlrtcapsuleclass.hh" |
| #include "umlrtlogprotocol.hh" |
| #include "umlrtmessage.hh" |
| struct UMLRTCommsPort; |
| struct UMLRTSlot; |
| |
| #include <iostream> |
| #include <iomanip> |
| #include <ctime> |
| |
| class Capsule_LocalPrinter : public UMLRTCapsule |
| { |
| public: |
| Capsule_LocalPrinter( const UMLRTCapsuleClass * cd, UMLRTSlot * st, const UMLRTCommsPort * * border, const UMLRTCommsPort * * internal, bool isStat ); |
| enum PortId |
| { |
| port_log, |
| port_usbPort |
| }; |
| virtual void inject( const UMLRTMessage & message ); |
| virtual void initialize( const UMLRTMessage & message ); |
| const char * getCurrentStateString() const; |
| private: |
| enum State |
| { |
| top__Disconnected, |
| top__Connected, |
| SPECIAL_INTERNAL_STATE_UNVISITED |
| }; |
| const char * stateNames[3]; |
| State currentState; |
| void entryaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__Disconnected__Disconnected( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__MessageSent__DeviceClassSent( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__MsgSendFail__PrinterConnectionFailed( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__initialize__Connect_Printer( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onConnect__connectingPrinter( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onData__PrintData( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onEOD__PrintingEnd( const UMLRTMessage * msg ); |
| void transitionaction_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onEject__EjectPrinter( const UMLRTMessage * msg ); |
| bool guard_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__MessageSent__ifConnected( const UMLRTMessage * msg ); |
| bool guard_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__MsgSendFail__ifNotConnected( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__MessageSent( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__MsgSendFail( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__initialize( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onConnect( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onData( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onEOD( const UMLRTMessage * msg ); |
| void actionchain_____action_____ComputerSystem__Hardware__ExternalDevices__LocalPrinter__LocalPrinter_SM__Region1__onEject( const UMLRTMessage * msg ); |
| State choice_____top__ChoicePoint2( const UMLRTMessage * msg ); |
| State state_____top__Connected( const UMLRTMessage * msg ); |
| State state_____top__Disconnected( const UMLRTMessage * msg ); |
| protected: |
| UMLRTLogProtocol_baserole log; |
| USBProtocol::Base usbPort; |
| public: |
| enum BorderPortId |
| { |
| borderport_usbPort, |
| borderport_log |
| }; |
| enum PartId |
| { |
| }; |
| virtual void bindPort( bool isBorder, int portId, int index ); |
| virtual void unbindPort( bool isBorder, int portId, int index ); |
| protected: |
| USBDeviceClasses usbClass; |
| bool connectionStatus; |
| bool printingData; |
| }; |
| extern const UMLRTCapsuleClass LocalPrinter; |
| |
| #endif |
| |