carte_strategie_2019
Dependencies: mbed SerialHalfDuplex SDFileSystem DISCO-F469NI_portrait liaison_Bluetooth ident_crac
Instruction/Instruction.h@68:accb12ba82a7, 2019-05-26 (annotated)
- Committer:
- Artiom
- Date:
- Sun May 26 15:25:09 2019 +0000
- Revision:
- 68:accb12ba82a7
- Parent:
- 67:96f914f92d2d
bezier modif de merde pour mbed de merde;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
antbig | 0:ad97421fb1fb | 1 | #ifndef CRAC_INSTRUCTION |
antbig | 0:ad97421fb1fb | 2 | #define CRAC_INSTRUCTION |
antbig | 0:ad97421fb1fb | 3 | |
Artiom | 68:accb12ba82a7 | 4 | #define caca 40 |
antbig | 0:ad97421fb1fb | 5 | |
antbig | 0:ad97421fb1fb | 6 | enum E_InstructionType |
antbig | 0:ad97421fb1fb | 7 | { |
Artiom | 67:96f914f92d2d | 8 | MV_BEZIER, |
antbig | 0:ad97421fb1fb | 9 | MV_COURBURE, // C -> Courbure |
antbig | 0:ad97421fb1fb | 10 | MV_LINE, // L -> Ligne droite |
antbig | 0:ad97421fb1fb | 11 | MV_TURN, // T -> Rotation sur place |
antbig | 0:ad97421fb1fb | 12 | MV_XYT, // X -> Aller à |
antbig | 0:ad97421fb1fb | 13 | MV_RECALAGE, // R -> Recalage bordure |
antbig | 0:ad97421fb1fb | 14 | ACTION, // A -> Action |
Sitkah | 38:76f886a1c8e6 | 15 | UNKNOWN, // Erreur, instruction inconnue |
Sitkah | 38:76f886a1c8e6 | 16 | POSITION_DEBUT //P |
antbig | 0:ad97421fb1fb | 17 | }; |
antbig | 0:ad97421fb1fb | 18 | enum E_InstructionDirection |
antbig | 0:ad97421fb1fb | 19 | { |
antbig | 0:ad97421fb1fb | 20 | NODIRECTION, // N -> Parametre absent |
antbig | 0:ad97421fb1fb | 21 | BACKWARD, |
antbig | 0:ad97421fb1fb | 22 | FORWARD, |
antbig | 0:ad97421fb1fb | 23 | RELATIVE, |
antbig | 11:ed13a480ddca | 24 | ABSOLUTE, |
antbig | 11:ed13a480ddca | 25 | LEFT, |
antbig | 11:ed13a480ddca | 26 | RIGHT |
antbig | 0:ad97421fb1fb | 27 | }; |
antbig | 0:ad97421fb1fb | 28 | enum E_InstructionPrecisionOuRecalage |
antbig | 0:ad97421fb1fb | 29 | { |
antbig | 0:ad97421fb1fb | 30 | NOPRECISION,// N -> Parametre absent |
antbig | 0:ad97421fb1fb | 31 | PRECISION, // P -> Precision, verifier la position à la fin du mouvement et refaire un XYT si erreur > 1cm |
antbig | 0:ad97421fb1fb | 32 | RECALAGE_X, // X -> Recalage en X, indique un recalage sur l'axe X |
Sitkah | 34:6aa4b46b102e | 33 | RECALAGE_Y, // Y -> Recalage en Y, indique un recalage sur l'axe Y |
Sitkah | 34:6aa4b46b102e | 34 | RECALAGE_T |
antbig | 0:ad97421fb1fb | 35 | }; |
antbig | 0:ad97421fb1fb | 36 | enum E_InstructionNextActionType |
antbig | 0:ad97421fb1fb | 37 | { |
antbig | 0:ad97421fb1fb | 38 | NONEXTACTION, // N -> Parametre absent |
antbig | 0:ad97421fb1fb | 39 | JUMP, |
antbig | 0:ad97421fb1fb | 40 | WAIT, |
Sitkah | 34:6aa4b46b102e | 41 | ENCHAINEMENT, |
Sitkah | 34:6aa4b46b102e | 42 | MECANIQUE, |
Sitkah | 34:6aa4b46b102e | 43 | CAPTEUR |
antbig | 0:ad97421fb1fb | 44 | }; |
antbig | 0:ad97421fb1fb | 45 | enum E_InstructionNextActionJumpType |
antbig | 0:ad97421fb1fb | 46 | { |
antbig | 0:ad97421fb1fb | 47 | NONEXTACTIONJUMPTYPE, // N -> Parametre absent |
antbig | 0:ad97421fb1fb | 48 | JUMP_TIME, |
antbig | 0:ad97421fb1fb | 49 | JUMP_POSITION |
antbig | 0:ad97421fb1fb | 50 | }; |
antbig | 0:ad97421fb1fb | 51 | struct S_Instruction |
antbig | 0:ad97421fb1fb | 52 | { |
antbig | 0:ad97421fb1fb | 53 | short lineNumber;//Numéro de la ligne |
antbig | 0:ad97421fb1fb | 54 | enum E_InstructionType order; //Type de l'instruction |
antbig | 0:ad97421fb1fb | 55 | enum E_InstructionDirection direction; //BackWard ou Forward || Relative ou Absolu |
antbig | 0:ad97421fb1fb | 56 | |
antbig | 0:ad97421fb1fb | 57 | unsigned short arg1; |
antbig | 0:ad97421fb1fb | 58 | unsigned short arg2; |
antbig | 0:ad97421fb1fb | 59 | signed short arg3; |
antbig | 0:ad97421fb1fb | 60 | |
antbig | 0:ad97421fb1fb | 61 | enum E_InstructionPrecisionOuRecalage precision; |
antbig | 0:ad97421fb1fb | 62 | enum E_InstructionNextActionType nextActionType; |
antbig | 0:ad97421fb1fb | 63 | enum E_InstructionNextActionJumpType jumpAction; |
antbig | 0:ad97421fb1fb | 64 | unsigned short JumpTimeOrX; |
antbig | 0:ad97421fb1fb | 65 | unsigned short JumpY; |
antbig | 0:ad97421fb1fb | 66 | unsigned short nextLineOK; |
antbig | 0:ad97421fb1fb | 67 | unsigned short nextLineError; |
Artiom | 67:96f914f92d2d | 68 | |
Artiom | 67:96f914f92d2d | 69 | unsigned short arg4; |
Artiom | 67:96f914f92d2d | 70 | unsigned short arg5; |
Artiom | 67:96f914f92d2d | 71 | signed short arg6; |
antbig | 0:ad97421fb1fb | 72 | }; |
antbig | 0:ad97421fb1fb | 73 | |
antbig | 0:ad97421fb1fb | 74 | /** |
antbig | 0:ad97421fb1fb | 75 | * Convertir un char en type d'instruction |
antbig | 0:ad97421fb1fb | 76 | **/ |
antbig | 0:ad97421fb1fb | 77 | enum E_InstructionType charToInstructionType(char type); |
antbig | 0:ad97421fb1fb | 78 | |
antbig | 0:ad97421fb1fb | 79 | /** |
antbig | 0:ad97421fb1fb | 80 | * |
antbig | 0:ad97421fb1fb | 81 | **/ |
antbig | 0:ad97421fb1fb | 82 | enum E_InstructionDirection charToInstructionDirection(char type); |
antbig | 0:ad97421fb1fb | 83 | |
antbig | 0:ad97421fb1fb | 84 | /** |
antbig | 0:ad97421fb1fb | 85 | * Convertir un char |
antbig | 0:ad97421fb1fb | 86 | **/ |
antbig | 0:ad97421fb1fb | 87 | enum E_InstructionPrecisionOuRecalage charToInstructionPrecisionOuRecalage(char type); |
antbig | 0:ad97421fb1fb | 88 | |
antbig | 0:ad97421fb1fb | 89 | /** |
antbig | 0:ad97421fb1fb | 90 | * |
antbig | 0:ad97421fb1fb | 91 | **/ |
antbig | 0:ad97421fb1fb | 92 | enum E_InstructionNextActionType charToInstructionNextActionType(char type); |
antbig | 0:ad97421fb1fb | 93 | |
antbig | 0:ad97421fb1fb | 94 | /** |
antbig | 0:ad97421fb1fb | 95 | * |
antbig | 0:ad97421fb1fb | 96 | **/ |
antbig | 0:ad97421fb1fb | 97 | enum E_InstructionNextActionJumpType charToInstructionNextActionJumpType(char type); |
antbig | 0:ad97421fb1fb | 98 | |
antbig | 4:88431b537477 | 99 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 100 | /* FUNCTION NAME: stringToInstruction */ |
antbig | 4:88431b537477 | 101 | /* DESCRIPTION : Conversion d'une ligne du fichier de strat en instruction */ |
antbig | 4:88431b537477 | 102 | /****************************************************************************************/ |
antbig | 0:ad97421fb1fb | 103 | struct S_Instruction stringToInstruction(char line[]); |
antbig | 0:ad97421fb1fb | 104 | |
antbig | 4:88431b537477 | 105 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 106 | /* FUNCTION NAME: loadAllInstruction */ |
antbig | 4:88431b537477 | 107 | /* DESCRIPTION : Charger toutes les instructions du fichier de stratégie */ |
antbig | 4:88431b537477 | 108 | /* Il faut utiliser strcpy(cheminFileStart,"/local/strat.txt"); */ |
antbig | 4:88431b537477 | 109 | /* pour indiquer le fichier à utiliser */ |
antbig | 4:88431b537477 | 110 | /****************************************************************************************/ |
Sitkah | 29:41e02746041d | 111 | void loadAllInstruction( signed char Strategie); |
antbig | 0:ad97421fb1fb | 112 | |
antbig | 4:88431b537477 | 113 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 114 | /* FUNCTION NAME: FileExists */ |
antbig | 4:88431b537477 | 115 | /* DESCRIPTION : Permet de vérifier si un fichier existe */ |
antbig | 4:88431b537477 | 116 | /****************************************************************************************/ |
antbig | 4:88431b537477 | 117 | int FileExists(const char *fname); |
antbig | 4:88431b537477 | 118 | |
antbig | 0:ad97421fb1fb | 119 | |
antbig | 0:ad97421fb1fb | 120 | #endif |