From 0a7f042e42bf82a2f618683ac36b8319f342db3c Mon Sep 17 00:00:00 2001 From: PF Date: Wed, 24 May 2017 03:56:05 +0200 Subject: [PATCH] La funny action est faite par le LL --- pc/src/config/ConfigInfo.java | 2 +- pc/src/pathfinding/chemin/CheminPathfinding.java | 2 +- pc/src/robot/Robot.java | 13 ------------- pc/src/serie/BufferOutgoingOrder.java | 13 ------------- pc/src/serie/SerialProtocol.java | 1 - pc/src/tests/lowlevel/JUnit_Robot.java | 1 - pc/src/tests/lowlevel/JUnit_Serie.java | 2 -- .../threads/serie/ThreadSerialInputCoucheOrdre.java | 1 - 8 files changed, 2 insertions(+), 33 deletions(-) diff --git a/pc/src/config/ConfigInfo.java b/pc/src/config/ConfigInfo.java index 55dce7cd..11b5ab66 100644 --- a/pc/src/config/ConfigInfo.java +++ b/pc/src/config/ConfigInfo.java @@ -131,7 +131,7 @@ public enum ConfigInfo IMPRECISION_MAX_ORIENTATION(0.1), // quelle imprecision maximale sur l'angle // du robot peut-on attendre (en // radians) - TAILLE_BUFFER_RECALAGE(20), // combien de mesures sont nécessaires pour + TAILLE_BUFFER_RECALAGE(50), // combien de mesures sont nécessaires pour // obtenir une correction de recalage PEREMPTION_CORRECTION(100), // temps maximal entre deux mesures de // correction au sein d'un même buffer (en ms) diff --git a/pc/src/pathfinding/chemin/CheminPathfinding.java b/pc/src/pathfinding/chemin/CheminPathfinding.java index 3b75abe3..61cee9f0 100644 --- a/pc/src/pathfinding/chemin/CheminPathfinding.java +++ b/pc/src/pathfinding/chemin/CheminPathfinding.java @@ -215,7 +215,7 @@ public synchronized boolean isArrived() * * @return */ - public boolean isEmpty() + public synchronized boolean isEmpty() { return empty; } diff --git a/pc/src/robot/Robot.java b/pc/src/robot/Robot.java index f6ab7222..4211ad8d 100755 --- a/pc/src/robot/Robot.java +++ b/pc/src/robot/Robot.java @@ -199,19 +199,6 @@ public void rearmeAutreCote() throws InterruptedException, ActionneurException public abstract Ticket traverseBascule() throws InterruptedException, ActionneurException; - public void funnyAction() throws InterruptedException - { - try - { - bloque("funnyAction"); - } - catch(ActionneurException e) - { - log.critical(e); - // impossible - } - } - /** * On est sûr que le filet est vide */ diff --git a/pc/src/serie/BufferOutgoingOrder.java b/pc/src/serie/BufferOutgoingOrder.java index 6340186c..45f06af5 100644 --- a/pc/src/serie/BufferOutgoingOrder.java +++ b/pc/src/serie/BufferOutgoingOrder.java @@ -232,19 +232,6 @@ public synchronized Ticket ouvreFilet() return t; } - /** - * Active la funny action - * - * @return - */ - public synchronized Ticket funnyAction() - { - Ticket t = new Ticket(); - bufferBassePriorite.add(new Order(OutOrder.FUNNY_ACTION, t)); - notify(); - return t; - } - /** * Verrouille le filet */ diff --git a/pc/src/serie/SerialProtocol.java b/pc/src/serie/SerialProtocol.java index be892e2b..e23ec39a 100644 --- a/pc/src/serie/SerialProtocol.java +++ b/pc/src/serie/SerialProtocol.java @@ -52,7 +52,6 @@ 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), LOCK_NET(0x48, Type.LONG), SCAN(0x49, Type.LONG), CLOSE_NET_FORCE(0x4A, Type.LONG), diff --git a/pc/src/tests/lowlevel/JUnit_Robot.java b/pc/src/tests/lowlevel/JUnit_Robot.java index ded2c328..e4910df2 100644 --- a/pc/src/tests/lowlevel/JUnit_Robot.java +++ b/pc/src/tests/lowlevel/JUnit_Robot.java @@ -177,7 +177,6 @@ public void test_actionneurs() throws Exception robot.fermeFilet(); robot.verrouilleFilet(); robot.traverseBascule(); - robot.funnyAction(); } @Test diff --git a/pc/src/tests/lowlevel/JUnit_Serie.java b/pc/src/tests/lowlevel/JUnit_Serie.java index f0feda26..366f75f1 100644 --- a/pc/src/tests/lowlevel/JUnit_Serie.java +++ b/pc/src/tests/lowlevel/JUnit_Serie.java @@ -161,7 +161,5 @@ public void test_actionneurs() throws Exception data.fermeFiletForce(); Thread.sleep(2000); data.traverseBascule(); - Thread.sleep(2000); - data.funnyAction(); } } diff --git a/pc/src/threads/serie/ThreadSerialInputCoucheOrdre.java b/pc/src/threads/serie/ThreadSerialInputCoucheOrdre.java index 7af964c0..ddb2005c 100644 --- a/pc/src/threads/serie/ThreadSerialInputCoucheOrdre.java +++ b/pc/src/threads/serie/ThreadSerialInputCoucheOrdre.java @@ -225,7 +225,6 @@ else if(paquet.origine == OutOrder.START_MATCH_CHRONO) else { paquet.ticket.set(InOrder.MATCH_FINI); - robot.funnyAction(); // On arrête le thread principal container.interruptWithCodeError(ErrorCode.END_OF_MATCH); }