-
Notifications
You must be signed in to change notification settings - Fork 2
/
tscontroller.h
133 lines (127 loc) · 3.48 KB
/
tscontroller.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef TSVIEW_H
#define TSVIEW_H
#include <QMainWindow>
#include <QMessageBox>
#include <tscurvebuffer.h>
#include <QPixmap>
#include <QPainter>
#include <QTimer>
#include <tsreaderthread.h>
#include <tsusb3000reader.h>
#include <QRegExp>
#include "models/TSExaminations.h"
#include "models/TSPatients.h"
#include <QTableWidget>
#include "ui_tsprintview.h"
#include "tsusbdatareader.h"
namespace Ui {
class TSView;
class TSProgressDialog;
class MainWindow;
class TSVolSignalWidget;
class Form;
}
enum CurrentAction {NoAction,CreatePatientProfileAction,EditPatientProfileAction,GetingVolZero};
class TSController : public QMainWindow
{
Q_OBJECT
public:
explicit TSController(QWidget *parent = 0);
~TSController();
public slots:
float fabs(float a);
void incCurrentIndex();
void decCurrentIndex();
void editPatientProfile();
void savePatientProfile();
void rejectPatientProfile();
void calibrateVolume();
void calibrateTemperature();
void rejectColibration();
void threadFinished();
void startExam();
void stopExam();
void scrollGraphics(int value);
void plotNow();
void plotCalibration();
void openPatientList();
void completePatientName(QString string);
void openPatientProfile(QModelIndex ind);
void showAverageData(int avgTempIn, int avgTempOut,int avgDO, int avgCHD);
void completePatientId();
void createNewExam();
void openExam(QModelIndex ind);
void scaleTempIn(int value);
void scaleTempOut(int value);
void scaleVolume(int value);
void scaleForHorizontal(int value);
void changeScrollBarAfterScaling(int before,int after);
void changeTempInScrollValue(int value);
void changeTempOutScrollValue(int value);
void breakExam();
void processDataParams();
void deletePatient(int index);
void deleteExam(int index);
void printReport();
protected:
void initPaintDevices();
void resizeEvent(QResizeEvent *evt);
bool eventFilter(QObject *obj, QEvent *e);
void openPrivateDB(QSqlRecord record);
private:
QWidget wpf;
QDialog *mvlDialog;
QTableWidgetItem* getQTableWidgetItem(QVariant text);
Ui::TSView *ui;
Ui::MainWindow *w;
Ui::TSVolSignalWidget *volWidget;
CurrentAction currentAction;
QRegExp nameRegExp;
QRegExp intRegExp;
bool openUser;
//Âñå äëÿ ðèñîâàíèÿ
TSCurveBuffer* curveBuffer;
QTimer plotingTimer;
QTimer cPlotingTimer;
QPixmap bcVolume;
QPixmap bVolume;
QPixmap bTempIn;
QPixmap bTempOut;
QPainter pcVolume;
QPainter pVolume;
QPainter pTempIn;
QPainter pTempOut;
int* volume;
int* tempIn;
int* tempOut;
int screenLimit;
int startIndex;
int W;
int H;
int cH;
int cW;
bool recordingStarted;
float volumeScaleRate;
float tempInScaleRate;
float tempOutScaleRate;
float horizontalStep;
int tempInZerPos;
int tempOutZerPos;
int scaleScroll[5];
int* tempInInterval;
float tempInAdaptive;
int* tempOutInterval;
float tempOutAdaptive;
float volumeAdaptive;
//Òðåä äëÿ ÷òåíèÿ
TSReaderThread *readerThread;
//ìîäåëè
TSPatients *patientsModel;
TSExaminations *examinationsModel;
QSqlDatabase patientsConnection;
QSqlDatabase examinationsConnection;
bool isInitialized;
TSUsbDataReader *rdr;
QThread *trd;
};
#endif // TSVIEW_H