Skip to content
This repository has been archived by the owner on Mar 3, 2019. It is now read-only.

Commit

Permalink
Funny action
Browse files Browse the repository at this point in the history
  • Loading branch information
PFGimenez committed Mar 29, 2017
1 parent 553ee22 commit d7902ce
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pc/src/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,12 @@ public void rearme() throws InterruptedException
public void traverseBascule() throws InterruptedException
{
bloque("traverseBascule");
}
}

public void funnyAction() throws InterruptedException
{
bloque("funnyAction");
}

/**
* Géré par le capteur de jauge
Expand Down
11 changes: 11 additions & 0 deletions pc/src/serie/BufferOutgoingOrder.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ public synchronized Ticket ouvreFilet()
return t;
}

/**
* Active la funny action
* @return
*/
public Ticket funnyAction() {
Ticket t = new Ticket();
bufferBassePriorite.add(new Order(OutOrder.FUNNY_ACTION, t));
notify();
return t;
}

/**
* Ferme le filet
*/
Expand Down
1 change: 1 addition & 0 deletions pc/src/serie/SerialProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public enum OutOrder
REARM_LEFT_SIDE(0x44, Type.LONG),
EJECT_RIGHT_SIDE(0x45, Type.LONG),
REARM_RIGHT_SIDE(0x46, Type.LONG),
FUNNY_ACTION(0x47, Type.LONG),

ASK_COLOR(0x59, Type.SHORT),
PING(0x5A, Type.SHORT),
Expand Down
1 change: 1 addition & 0 deletions pc/src/tests/lowlevel/JUnit_Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ public void test_actionneurs() throws Exception
robot.ouvreFilet();
robot.fermeFilet();
robot.traverseBascule();
robot.funnyAction();
}

/**
Expand Down
1 change: 1 addition & 0 deletions pc/src/tests/lowlevel/JUnit_Serie.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,6 @@ public void test_actionneurs() throws Exception
Thread.sleep(2000);
data.traverseBascule();
Thread.sleep(2000);
data.funnyAction();
}
}

0 comments on commit d7902ce

Please sign in to comment.