Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed Teach memory
teach.h@1:33fdaabcdeda, 2020-04-21 (annotated)
- Committer:
- MarcelPortmann
- Date:
- Tue Apr 21 15:49:22 2020 +0000
- Revision:
- 1:33fdaabcdeda
- Parent:
- 0:ad924d8a2f98
- Child:
- 2:6dc660d146b7
processes all data no implementation of memory
Who changed what in which revision?
User | Revision | Line number | New 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 | 0:ad924d8a2f98 | 12 | |
MarcelPortmann | 0:ad924d8a2f98 | 13 | #ifndef teach_H // no idea what this does |
MarcelPortmann | 0:ad924d8a2f98 | 14 | #define teach_H // seems important |
MarcelPortmann | 0:ad924d8a2f98 | 15 | |
MarcelPortmann | 1:33fdaabcdeda | 16 | #define MAX_SIZE 500000000 |
MarcelPortmann | 1:33fdaabcdeda | 17 | |
MarcelPortmann | 1:33fdaabcdeda | 18 | struct posdata{ |
MarcelPortmann | 1:33fdaabcdeda | 19 | int time; |
MarcelPortmann | 1:33fdaabcdeda | 20 | int hi, low; |
MarcelPortmann | 1:33fdaabcdeda | 21 | bool end, start; |
MarcelPortmann | 1:33fdaabcdeda | 22 | float pos[3]; |
MarcelPortmann | 1:33fdaabcdeda | 23 | }; |
MarcelPortmann | 1:33fdaabcdeda | 24 | |
MarcelPortmann | 1:33fdaabcdeda | 25 | struct temp_arry{ |
MarcelPortmann | 1:33fdaabcdeda | 26 | int time; |
MarcelPortmann | 1:33fdaabcdeda | 27 | float pos[3]; |
MarcelPortmann | 1:33fdaabcdeda | 28 | }; |
MarcelPortmann | 1:33fdaabcdeda | 29 | |
MarcelPortmann | 1:33fdaabcdeda | 30 | |
MarcelPortmann | 0:ad924d8a2f98 | 31 | |
MarcelPortmann | 0:ad924d8a2f98 | 32 | class teach |
MarcelPortmann | 0:ad924d8a2f98 | 33 | { |
MarcelPortmann | 0:ad924d8a2f98 | 34 | public: |
MarcelPortmann | 1:33fdaabcdeda | 35 | teach(void); // Sets all parameters for the class teach constructor |
MarcelPortmann | 1:33fdaabcdeda | 36 | |
MarcelPortmann | 0:ad924d8a2f98 | 37 | |
MarcelPortmann | 1:33fdaabcdeda | 38 | //functions to be used outside of class |
MarcelPortmann | 1:33fdaabcdeda | 39 | void setstart(float posx,float posy,float posz, int time); // creates a temporary begin of line point |
MarcelPortmann | 1:33fdaabcdeda | 40 | void setpoint(float posx,float posy,float posz, int time); // creates a temporary position point |
MarcelPortmann | 1:33fdaabcdeda | 41 | void setend(float posx,float posy,float posz, int time); // creates a temporary end of line point |
MarcelPortmann | 1:33fdaabcdeda | 42 | void save(void); // wen calld from main stores the whole training in memory |
MarcelPortmann | 1:33fdaabcdeda | 43 | void stop(void); // deleats all temp data and resets counters/pointers |
MarcelPortmann | 0:ad924d8a2f98 | 44 | |
MarcelPortmann | 0:ad924d8a2f98 | 45 | private: |
MarcelPortmann | 1:33fdaabcdeda | 46 | std::vector<posdata> data_vec; // Vektor mit allen datenpunkten |
MarcelPortmann | 1:33fdaabcdeda | 47 | int highcount,lowcount; // Counters for data recording |
MarcelPortmann | 1:33fdaabcdeda | 48 | void temp_store(void); // Stors data temporary; Data==Pointer to a Data Array (position(x,y,z),time) |
MarcelPortmann | 1:33fdaabcdeda | 49 | void process(void); // rounds the houses to trainings |
MarcelPortmann | 1:33fdaabcdeda | 50 | void contr_sice(void); // controlls the sice of temp array |
MarcelPortmann | 1:33fdaabcdeda | 51 | struct posdata temp; // temporary data storage |
MarcelPortmann | 1:33fdaabcdeda | 52 | |
MarcelPortmann | 0:ad924d8a2f98 | 53 | // objekte von display,memory,position // für interaktion mit anderen Klassen |
MarcelPortmann | 0:ad924d8a2f98 | 54 | |
MarcelPortmann | 0:ad924d8a2f98 | 55 | }; |
MarcelPortmann | 0:ad924d8a2f98 | 56 | |
MarcelPortmann | 0:ad924d8a2f98 | 57 | #endif |
MarcelPortmann | 0:ad924d8a2f98 | 58 | |
MarcelPortmann | 0:ad924d8a2f98 | 59 | |
MarcelPortmann | 0:ad924d8a2f98 | 60 | |
MarcelPortmann | 0:ad924d8a2f98 | 61 | |
MarcelPortmann | 0:ad924d8a2f98 | 62 |