示例#1
0
文件: MrPong.java 项目: hckkid/eTrice
 private void setState(int new_state) {
   DebuggingService.getInstance().addActorState(this, stateStrings[new_state]);
   if (stateStrings[new_state] != "Idle") {
     System.out.println(getInstancePath() + " -> " + stateStrings[new_state]);
   }
   this.state = new_state;
 }
示例#2
0
 public void msg5() {
   if (messageStrings[IN_msg5] != "timerTick") {
     DebuggingService.getInstance()
         .addMessageAsyncOut(getAddress(), getPeerAddress(), messageStrings[IN_msg5]);
   }
   if (getPeerAddress() != null)
     getPeerMsgReceiver().receive(new EventMessage(getPeerAddress(), IN_msg5));
 }
示例#3
0
 public TestProtocolPort(
     IEventReceiver actor,
     String name,
     int localId,
     int idx,
     Address addr,
     Address peerAddress) {
   super(actor, name, localId, idx, addr, peerAddress);
   DebuggingService.getInstance().addPortInstance(this);
 }
示例#4
0
 @Override
 public void receive(Message m) {
   if (!(m instanceof EventMessage)) return;
   EventMessage msg = (EventMessage) m;
   if (msg.getEvtId() <= 0 || msg.getEvtId() >= MSG_MAX) System.out.println("unknown");
   else {
     if (messageStrings[msg.getEvtId()] != "timerTick") {
       DebuggingService.getInstance()
           .addMessageAsyncIn(getPeerAddress(), getAddress(), messageStrings[msg.getEvtId()]);
     }
     if (msg instanceof EventWithDataMessage)
       getActor().receiveEvent(this, msg.getEvtId(), ((EventWithDataMessage) msg).getData());
     else getActor().receiveEvent(this, msg.getEvtId(), null);
   }
 }
示例#5
0
 private void setState(int new_state) {
   DebuggingService.getInstance().addActorState(this, stateStrings[new_state]);
   if (stateStrings[new_state] != "Idle") {}
   this.state = new_state;
 }
示例#6
0
 public void destroy() {
   DebuggingService.getInstance().addMessageActorDestroy(this);
   super.destroy();
 }