-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipe_handler.h
66 lines (59 loc) · 1.78 KB
/
recipe_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include<fstream>
#include<sstream>
#include<iostream>
#include<cstring>
using namespace std;
struct Sequence
{
char led_color[32]; //Color of LED
float b_x, b_y, b_z; // B_X, B_Y, B_Z
float t_switch; // Time
float led_intensity; //LED intensity
float grad_x, grad_y, grad_z; //Grad_X, Grad_Y, Grad_Z
};
struct Recipe
{
Recipe()
{
n_cycles =0;
}
//Declare private variables here
//char version[32]; //Holds version
int n_cycles; // holds N_cycles
char name[32]; //Name of the recipe
//static int count; // Count of Recipe
int seq_idx; //Counts Sequence
Sequence sequence[10]; // max number of sequences 10
};
//Class for handling csv file
class Recipe_Handler
{
private:
//Declare private variables here
protected:
char filename[80]; //Holds filename
int max_lines; //Max lines to read
int index; //Position of file pointer
public:
Recipe_Handler(char * fname, int n = 256) //: filename(fname), max_lines(n)
{
strcpy(filename, fname);
max_lines = n;
}
/*Recipe_Handler()
{
cout<<"Please enter the filename: ";
cin>>filename;
cout<<"Please enter number of lines: [maximum 256]";
cin>>max_lines;
if (max_lines > 256)
{
cout<<"Warning: Maximum possible lines exceeded, setting to default (256)!";
max_lines = 256;
}
}*/
void start_line(char * line, Recipe * );
void split_text(char * , Recipe * );
friend void file_read(Recipe_Handler & );
//friend void file_write(Recipe_Handler );
};