Easy Training / Mbed 2 deprecated Teach_demo

Dependencies:   mbed Teach memory

Committer:
MarcelPortmann
Date:
Mon Apr 27 05:07:00 2020 +0000
Revision:
3:b22580585b9c
Parent:
2:6dc660d146b7
memory incl.;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
MarcelPortmann 0:ad924d8a2f98 1 /*
MarcelPortmann 0:ad924d8a2f98 2 teach function:
MarcelPortmann 0:ad924d8a2f98 3 Class to aquier new tranings for the EasyFit Device.
MarcelPortmann 0:ad924d8a2f98 4 It Records a position in the 3d room and puts the them in serie to create a "hose" to
MarcelPortmann 0:ad924d8a2f98 5 be repeated in the mode Training.
MarcelPortmann 0:ad924d8a2f98 6
MarcelPortmann 0:ad924d8a2f98 7 when questions ask someone else
MarcelPortmann 0:ad924d8a2f98 8 the autor is not responsible for any spelling mistakes
MarcelPortmann 0:ad924d8a2f98 9
MarcelPortmann 0:ad924d8a2f98 10 */
MarcelPortmann 1:33fdaabcdeda 11 #include <vector>
MarcelPortmann 2:6dc660d146b7 12 #include "mbed.h"
MarcelPortmann 3:b22580585b9c 13 #include "memory.h"
MarcelPortmann 0:ad924d8a2f98 14
MarcelPortmann 0:ad924d8a2f98 15 #ifndef teach_H // no idea what this does
MarcelPortmann 0:ad924d8a2f98 16 #define teach_H // seems important
MarcelPortmann 0:ad924d8a2f98 17
MarcelPortmann 2:6dc660d146b7 18 #define MAX_SIZE 500000000 // maximal usebal flash befor error
MarcelPortmann 1:33fdaabcdeda 19
MarcelPortmann 1:33fdaabcdeda 20 struct posdata{
MarcelPortmann 1:33fdaabcdeda 21 int time;
MarcelPortmann 1:33fdaabcdeda 22 int hi, low;
MarcelPortmann 1:33fdaabcdeda 23 bool end, start;
MarcelPortmann 1:33fdaabcdeda 24 float pos[3];
MarcelPortmann 1:33fdaabcdeda 25 };
MarcelPortmann 1:33fdaabcdeda 26
MarcelPortmann 1:33fdaabcdeda 27 struct temp_arry{
MarcelPortmann 1:33fdaabcdeda 28 int time;
MarcelPortmann 1:33fdaabcdeda 29 float pos[3];
MarcelPortmann 1:33fdaabcdeda 30 };
MarcelPortmann 1:33fdaabcdeda 31
MarcelPortmann 1:33fdaabcdeda 32
MarcelPortmann 0:ad924d8a2f98 33
MarcelPortmann 0:ad924d8a2f98 34 class teach
MarcelPortmann 0:ad924d8a2f98 35 {
MarcelPortmann 0:ad924d8a2f98 36 public:
MarcelPortmann 1:33fdaabcdeda 37 teach(void); // Sets all parameters for the class teach constructor
MarcelPortmann 1:33fdaabcdeda 38
MarcelPortmann 0:ad924d8a2f98 39
MarcelPortmann 1:33fdaabcdeda 40 //functions to be used outside of class
MarcelPortmann 1:33fdaabcdeda 41 void setstart(float posx,float posy,float posz, int time); // creates a temporary begin of line point
MarcelPortmann 1:33fdaabcdeda 42 void setpoint(float posx,float posy,float posz, int time); // creates a temporary position point
MarcelPortmann 1:33fdaabcdeda 43 void setend(float posx,float posy,float posz, int time); // creates a temporary end of line point
MarcelPortmann 3:b22580585b9c 44 void save(string name); // wen calld from main stores the whole training in memory
MarcelPortmann 1:33fdaabcdeda 45 void stop(void); // deleats all temp data and resets counters/pointers
MarcelPortmann 0:ad924d8a2f98 46
MarcelPortmann 0:ad924d8a2f98 47 private:
MarcelPortmann 1:33fdaabcdeda 48 std::vector<posdata> data_vec; // Vektor mit allen datenpunkten
MarcelPortmann 1:33fdaabcdeda 49 int highcount,lowcount; // Counters for data recording
MarcelPortmann 1:33fdaabcdeda 50 void temp_store(void); // Stors data temporary; Data==Pointer to a Data Array (position(x,y,z),time)
MarcelPortmann 1:33fdaabcdeda 51 void process(void); // rounds the houses to trainings
MarcelPortmann 1:33fdaabcdeda 52 void contr_sice(void); // controlls the sice of temp array
MarcelPortmann 1:33fdaabcdeda 53 struct posdata temp; // temporary data storage
MarcelPortmann 3:b22580585b9c 54 memory store; // store and load data from memory
MarcelPortmann 3:b22580585b9c 55 string tr_name;
MarcelPortmann 1:33fdaabcdeda 56
MarcelPortmann 0:ad924d8a2f98 57 // objekte von display,memory,position // für interaktion mit anderen Klassen
MarcelPortmann 0:ad924d8a2f98 58
MarcelPortmann 0:ad924d8a2f98 59 };
MarcelPortmann 0:ad924d8a2f98 60
MarcelPortmann 0:ad924d8a2f98 61 #endif
MarcelPortmann 0:ad924d8a2f98 62
MarcelPortmann 0:ad924d8a2f98 63
MarcelPortmann 0:ad924d8a2f98 64
MarcelPortmann 0:ad924d8a2f98 65
MarcelPortmann 0:ad924d8a2f98 66