code strat avant match 2, strat inversée OK normalement

Fork of CRAC-Strat_2017_fin_premier_match by CRAC Team

Revision:
0:ad97421fb1fb
Child:
4:88431b537477
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Instruction/Instruction.h	Wed Apr 13 22:04:54 2016 +0000
@@ -0,0 +1,100 @@
+#ifndef CRAC_INSTRUCTION
+#define CRAC_INSTRUCTION
+
+#include "global.h"
+
+enum E_InstructionType
+{
+    MV_COURBURE,    // C -> Courbure
+    MV_LINE,        // L -> Ligne droite
+    MV_TURN,        // T -> Rotation sur place
+    MV_XYT,         // X -> Aller à
+    MV_RECALAGE,    // R -> Recalage bordure
+    ACTION,         // A -> Action
+    UNKNOWN         // Erreur, instruction inconnue
+};
+enum E_InstructionDirection
+{
+    NODIRECTION,     // N -> Parametre absent
+    BACKWARD,
+    FORWARD,
+    RELATIVE,
+    ABSOLUTE
+};
+enum E_InstructionPrecisionOuRecalage
+{
+    NOPRECISION,// N -> Parametre absent
+    PRECISION,  // P -> Precision, verifier la position à la fin du mouvement et refaire un XYT si erreur > 1cm
+    RECALAGE_X, // X -> Recalage en X, indique un recalage sur l'axe X
+    RECALAGE_Y  // Y -> Recalage en Y, indique un recalage sur l'axe Y
+};
+enum E_InstructionNextActionType
+{
+    NONEXTACTION,    // N -> Parametre absent
+    JUMP, 
+    WAIT,
+    ENCHAINEMENT
+};
+enum E_InstructionNextActionJumpType
+{
+    NONEXTACTIONJUMPTYPE,    // N -> Parametre absent
+    JUMP_TIME,
+    JUMP_POSITION
+};
+struct S_Instruction
+{
+    short lineNumber;//Numéro de la ligne
+    enum E_InstructionType order; //Type de l'instruction
+    enum E_InstructionDirection direction; //BackWard ou Forward || Relative ou Absolu
+    
+    unsigned short  arg1;
+    unsigned short  arg2;
+    signed   short  arg3;
+    
+    enum E_InstructionPrecisionOuRecalage    precision;
+    enum E_InstructionNextActionType         nextActionType;
+    enum E_InstructionNextActionJumpType     jumpAction;
+    unsigned short JumpTimeOrX;
+    unsigned short JumpY;
+    unsigned short nextLineOK;
+    unsigned short nextLineError;
+};
+
+/**
+* Convertir un char en type d'instruction
+**/
+enum E_InstructionType charToInstructionType(char type);
+
+/**
+* 
+**/
+enum E_InstructionDirection charToInstructionDirection(char type);
+
+/**
+* Convertir un char 
+**/
+enum E_InstructionPrecisionOuRecalage charToInstructionPrecisionOuRecalage(char type);
+
+/**
+* 
+**/
+enum E_InstructionNextActionType charToInstructionNextActionType(char type);
+
+/**
+* 
+**/
+enum E_InstructionNextActionJumpType charToInstructionNextActionJumpType(char type);
+
+/**
+* 
+**/
+struct S_Instruction stringToInstruction(char line[]);
+
+/**
+Charger toutes les instructions du fichier de strat
+Il faut utiliser strcpy(cheminFileStart,"/local/strat.txt");
+**/
+void loadAllInstruction(void);
+
+
+#endif
\ No newline at end of file