-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
234 lines (212 loc) · 5.92 KB
/
mainwindow.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include <QHostAddress>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QFileInfo>
#include <QSettings>
#include <QTimer>
#include <QLabel>
#include <QPropertyAnimation>
#include "scripter_edit.h"
#include "range_silder.h"
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QScrollBar>
#include <QDesktopServices>
#include <QWindow>
#include <QFileDialog>
#include <QWebSocket>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
QString server_ip;
QString client_address;
int port;
QTcpServer *server;
QTcpSocket *socket;
int port_id;
int baudrate;
QSerialPort::DataBits databits;
QSerialPort::Parity parity;
QSerialPort::StopBits stopbits;
QSerialPort::FlowControl flowcontrol;
QList<QSerialPortInfo> ports_list;
QSettings *settings;
QString btn_sty1;
QString btn_sty2;
QString btn_sty3;
QString btn_sty4;
QString btn_sty5;
QString btn_sty6;
QString btn_sty7;
void ui_init();
void config_init();
void btn_init();
void run_btn_clicked();
bool build_server;
QTimer timer1;
QTimer timer2;
QTimer timer3;
void delay_change1();
QWidget *tips_window;
QLayout *tips_layout;
QLabel *tips;
QPropertyAnimation *m_animation;
void delay_change2();
void tips_window_init();
void tips_window_start();
void tips_window_end();
void link_btn_clicked();
bool SerialPort_link;
QSerialPort *ser;
void new_connected();
void server_read();
void server_disconnected();
void handleSerialError(QSerialPort::SerialPortError error);
QString file_path;
int index;
double sleep_time;
QList<float> inserts;
QList<float> surges;
QList<float> sways;
QList<float> twists;
QList<float> pitchs;
QList<float> rolls;
QList<float> blowjob_inserts;
QList<float> blowjob_surges;
QList<float> blowjob_sways;
QList<float> blowjob_twists;
QList<float> blowjob_pitchs;
QList<float> blowjob_rolls;
QList<float> breastsex_inserts;
QList<float> breastsex_surges;
QList<float> breastsex_sways;
QList<float> breastsex_twists;
QList<float> breastsex_pitchs;
QList<float> breastsex_rolls;
QList<float> handjobL_inserts;
QList<float> handjobL_surges;
QList<float> handjobL_sways;
QList<float> handjobL_twists;
QList<float> handjobL_pitchs;
QList<float> handjobL_rolls;
QList<float> handjobR_inserts;
QList<float> handjobR_surges;
QList<float> handjobR_sways;
QList<float> handjobR_twists;
QList<float> handjobR_pitchs;
QList<float> handjobR_rolls;
int L0;
int L1;
int L2;
int R0;
int R1;
int R2;
int last_L0;
int last_L1;
int last_L2;
int last_R0;
int last_R1;
int last_R2;
QList<int> L0s;
QList<int> L1s;
QList<int> L2s;
QList<int> R0s;
QList<int> R1s;
QList<int> R2s;
void list_clear();
float bodywidth;
float surge_offset;
float sway_offset;
float insert_max;
float insert_min;
Scripter_edit *scripterL0;
Scripter_edit *scripterL1;
Scripter_edit *scripterL2;
Scripter_edit *scripterR0;
Scripter_edit *scripterR1;
Scripter_edit *scripterR2;
Range_Silder *silderL0;
Range_Silder *silderL1;
Range_Silder *silderL2;
Range_Silder *silderR0;
Range_Silder *silderR1;
Range_Silder *silderR2;
QFile* scripter_L0;
QFile* scripter_L1;
QFile* scripter_L2;
QFile* scripter_R0;
QFile* scripter_R1;
QFile* scripter_R2;
QJsonObject config_L0;
QJsonObject config_L1;
QJsonObject config_L2;
QJsonObject config_R0;
QJsonObject config_R1;
QJsonObject config_R2;
void save_scripter();
void regenerate_scripter();
void copy_values(QList<int> values,QList<int> index);
void setplaytime(int index);
void set_play();
void rebuildtimes(QList<int> rebuild_times);
void rebuildblowjobtimes(QList<int> rebuild_times);
void rebuildbreastsextimes(QList<int> rebuild_times);
void rebuildhandjobLtimes(QList<int> rebuild_times);
void rebuildhandjobRtimes(QList<int> rebuild_times);
void update_list(QObject* sender,int way,QList<int> rebuild_times);
bool top_windows;
bool isMenuExpanded;
QPropertyAnimation *m_animation0;
void mousePressEvent(QMouseEvent* event) override;
void mouseMoveEvent(QMouseEvent* event) override;
void mouseReleaseEvent(QMouseEvent* event) override;
QPointF press_point;
QPointF move_point;
bool mouse1;
int orientation;
bool m_drag;
QPoint m_dragPosition;
bool event(QEvent *event) override;
int scripterL0_current_hover_x;
QString intiface_central_ip;
QWebSocket *webclient;
QTimer timeoutTimer;
QTimer timeoutrestoreTimer;
QTimer requestdevicelistTimer;
void webclient_onconnected();
void webclient_ondisconnected();
void onTextMessageReceived(const QString &message);
struct Device
{
QString name;
int index;
QList<int> feature;
QString work_way;
QList<int> feature_enable;
};
QList<Device> devices;
QList<int> devices_index;
void handleDeviceAdded(const QJsonObject &deviceInfo);
void handleDeviceList(const QJsonObject &deviceList);
void sent_LinearCmd(int& i,Device& device,int& sleeptime,int& move);
QTimer reScanningTimer;
QTimer writerTimer;
bool allowriter;
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H