Easy Training / Mbed 2 deprecated Teach_demo

Dependencies:   mbed Teach memory

teach.h

Committer:
MarcelPortmann
Date:
2020-04-22
Revision:
2:6dc660d146b7
Parent:
1:33fdaabcdeda
Child:
3:b22580585b9c

File content as of revision 2:6dc660d146b7:

/*
teach function:
Class to aquier new tranings for the EasyFit Device.
It Records a position in the 3d room and puts the them in serie to create a "hose" to
be repeated in the mode Training.

when questions ask someone else
the autor is not responsible for any spelling mistakes

*/
#include <vector>
#include "mbed.h"

#ifndef teach_H                                         // no idea what this does
#define teach_H                                         // seems important

#define MAX_SIZE 500000000                              // maximal usebal flash befor error

struct posdata{
    int time;
    int hi, low;
    bool end, start;
    float pos[3];
};

struct temp_arry{
    int time;
    float pos[3];
};



class teach
{
public:
    teach(void);                                                // Sets all parameters for the class teach constructor
    
                    
    //functions to be used outside of class
    void setstart(float posx,float posy,float posz, int time); // creates a temporary begin of line point       
    void setpoint(float posx,float posy,float posz, int time); // creates a temporary position point
    void setend(float posx,float posy,float posz, int time);   // creates a temporary end of line point
    void save(void);                                           // wen calld from main stores the whole training in memory
    void stop(void);                                           // deleats all temp data and resets counters/pointers
    
private:
    std::vector<posdata> data_vec;                       // Vektor mit allen datenpunkten 
    int  highcount,lowcount;                             // Counters for data recording
    void temp_store(void);                               // Stors data temporary; Data==Pointer to a Data Array (position(x,y,z),time)
    void process(void);                                  // rounds the houses to trainings
    void contr_sice(void);                               // controlls the sice of temp array
    struct posdata temp;                                 // temporary data storage
    
    // objekte von display,memory,position               // für interaktion mit anderen Klassen
    
};

#endif