-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwrightvaluedialog.h
More file actions
84 lines (68 loc) · 2.69 KB
/
wrightvaluedialog.h
File metadata and controls
84 lines (68 loc) · 2.69 KB
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
#ifndef WRIGHTVALUEDIALOG_H
#define WRIGHTVALUEDIALOG_H
#include <QDialog>
#include <QDebug>
#include <QtSerialPort/QtSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include "modbusmaster.h"
//#include "setupdialog.h"
#define ILLEGAL_FUNC_ERR 1 /*illegal function error*/
#define ILLEG_DAT_ADR_ERR 2 /*illegal data address*/
#define ILLEGAL_DATA_ERR 3 /*illegal data value*/
#define ACKNOWLEDGE_ERR 5 /*acknowledge*/
#define MEMORY_PARITY_ERR 8 /*memory parity error*/
#define ASCII_WRITE_EEPROM 102
#define ASCII_READ_EEPROM 100
#define ASCII_READ_RAM 101
#define ASCII_READ_COILS 110
#define ASCII_READ_DIS_IN 111
#define ASCII_READ_HOLD_REG 112
#define ASCII_IN_REG 113
#define READ_STATUS_COM 2 /*read status from device*/
#define READ_HOLD_COM 3 /*read holding register from eeprom*/
#define READ_INP_REG_COM 4 /*read input register*/
#define PRESET_SINGLE_COM 6 /*write preset single holding register*/
namespace Ui {
class WrightValueDialog;
//class MainWindow;
}
class WrightValueDialog : public QDialog
{
Q_OBJECT
public slots:
void openingslot(QString,QString,QString,int);
void WriteTimeOuttimerSlot();
void timerSlot();
public:
explicit WrightValueDialog(QWidget *parent = 0);
~WrightValueDialog();
// void openingslot(QString &ID,QString &Address,QString &Quantity);
QImage *greenI,*redI,*yellowI;
QImage podngred,podnggreen,podngyellow;
QTimer *writetimer = new QTimer(this);
QTimer *WriteTimeOuttimer = new QTimer(this);
bool error = false,good = false, Limited = false;
ModBusMaster ModBusMaster_new;
QString ID,Function,Address,Quantity,CRC,ByteCount,receivedData;
QString writetable,received;
// QSerialPort *writeserial;
bool Sci_New_Packet = false, packageStarted = false, Charerror = false , pollbool = false, pollbutonbool = false;
bool polltimerbool = false, SetupEntered = false, GraphicSetupEntered = false, osmanb = false,firstvalueB = false;
int TimeOuttime_write;
QString writeserialPortName;
int SelectedConnection, SelectedPort, SelectedBaud, SelectedDataBits, SelectedStop, SelectedParity,SelectedTimeOut;
bool SelectedComMode = false,savesets = false;
bool sendwritingvalue_flag = false,writingsuccesful_flag = false,unsuccesful_flag = false;
signed int Min_Limit_S= 0,Max_Limit_S=0;
// unsigned int Min_Limit_US,Max_Limit_US;
private slots:
void on_pushButton_clicked();
// void writeserialReceived();
void on_pushButton_Limit_clicked();
private:
Ui::WrightValueDialog *ui;
//SetupDialog setupdialog;
unsigned char gs_ucErrortReg;
unsigned int gs_uiExor1;
};
#endif // WRIGHTVALUEDIALOG_H