-
Notifications
You must be signed in to change notification settings - Fork 0
/
signals.h
92 lines (63 loc) · 1.92 KB
/
signals.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef SIGNALS_H
#define SIGNALS_H
#include <QStringList>
#include <QFileDialog>
#include <QFileInfo>
#include <QDebug>
#include <QPicture>
#define MEASURE_TIME 0
/*************** Excel Writer ************/
#include "xlsxdocument.h"
#include "xlsxworksheet.h"
#define CANALES 4
struct WorkOrder{
QString ordenTrabajo;
QString cliente;
QString fecha;
QString equipo;
QString observaciones;
QString channelObs[6];
};
void CalcFilter();
class Signals
{
private:
double ganancias[6];
double offset[6];
double filtro[6];
double x0[6];
double x1[6]; // Valor x-1 para filtrado
double x2[6]; // Valor x-2 para filtrado
double y0[6];
double y1[6]; // Valor x-1 para filtrado
double y2[6]; // Valor x-2 para filtrado
double b0[6]; // Constantes de filtrado
double b1[6]; // Constantes de filtrado
double b2[6]; // Constantes de filtrado
double a0[6]; // Constantes de filtrado
double a1[6]; // Constantes de filtrado
double a2[6]; // Constantes de filtrado
void getLPCoefficientsButterworth2Pole(int samplerate, double cutoff, int m);
QStringList last_value;
QXlsx::Document xlsx;
QStringList datos[CANALES];
QStringList last_update, last_filtered;
bool filter;
long filas;
void initFilter();
public:
Signals();
~Signals();
double Filtro(double x, int i);
QStringList append(QStringList d, unsigned int cant);
void filterOff();
void filterOn();
void setOffset(int n, double g);
void setGain(int n, double g);
void setFilter(int n, double g);
void exportarExcel(WorkOrder *a);
QStringList lastValue();
QStringList lastValueUpdate();
QStringList lastValueFiltered();
};
#endif // SIGNALS_H