123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- #pragma once
- #include <QtWidgets/QMainWindow>
- #include <QtSerialPort/qserialportinfo.h>
- #include "ui_Line.h"
- #include "ui_port.h"
- #include "ui_port_dialog.h"
- #include <conio.h>
- #include <Windows.h>
- #include <QtSerialPort/qserialport.h>
- #include <qthread>
- #include <qtimer>
- class Line : public QMainWindow
- {
- Q_OBJECT
- public:
- Line(QWidget *parent = Q_NULLPTR);
- public:
- QString getcomm(int index, QString keyorvalue);
- void SerialSend(QByteArray data);
- uint8_t MODBUS_ASCII_GetLrc(QByteArray data);
- void F3send(unsigned char *buff, int size);
- #if 1
- void out_buff(unsigned char *buff, int size);
- int in_buff(unsigned char *buff, int time_out);
- int calcrc(const unsigned char *ptr, int count);
- int check(int crc, const unsigned char *buf, int sz);
- int xmodemTransmit(unsigned char *src, int srcsz);
- #endif
- QByteArray FloattoHex(float f_val);
- void Simulation_OilUnloadSend(QByteArray command);
- void Simulation_AngleSend(QByteArray command);
- private slots:
- void portclick();
- void portopen();
- void portclose();
- void sendaddr();
- void sendvol();
- void change_update();
- void reboot_dev();
- void Clear_dev();
- void read_line();
- void on_openfile();
- void downfile();
- void down_file();
- void readver();
- void sendconnect();
- void readconnect();
- void Read_RegVal();
- void Write_RegVal();
- void into_cali();
- void quit_cali();
- void sendPT();
- void ReadPT();
- void sendCT();
- void ReadCT();
- void Receive_Data();
- void ReadStore();
- void SetStore();
- void GetControlDateTime();
- void SetControlDateTime();
- void StopUpGrade();
- void RebootControl();
- void ReadAutoSealTime();
- void SetAutoSealTime();
- void ReadConfig();
- void SetConfig();
- void ReadCoefExp();
- void SetCoefExp();
- void ReadUart1TimeOut();
- void SetUart1TimeOut();
- void ReadTankCapicity();
- void SetTankCapicity();
- void ReadBlankSeal();
- void SetBlankSeal();
- void CJReadStore();
- void CJSetStore();
- void RebootCollect();
- void CJReadOilUnload();
- void CJSetOilUnload();
- void CJReadBottomValve();
- void CJSetBottomValve();
- void CJReadVersion();
- void CJReadManHoleCover();
- void CJSetManHoleCover();
- void CJReadLevelType();
- void CJSetLevelType();
- void CJReadLevelZero();
- void CJSetLevelZero();
- void CJReadAttitudeType();
- void CJSetAttitudeType();
- void CJReadTemperatureType();
- void CJSetTemperatureType();
- void CJReadManHoleCoverThreshold();
- void CJSetManHoleCoverThreshold();
- void CJSetOilUnloadZero();
- void CJSetManHoleZero();
- void CJTransparentTransmition();
- void ReadControlSoftwareVer();
- void on_pushButton_clicked();
- void textEdit_append(QString str_txt);
- void on_pushButton_2_clicked();
- void on_pushButton_md5_clicked();
- void on_pushButton_decode_clicked();
- void on_pushButton_A2HEX_clicked();
- public:
- QMenu * portmenu;
- QDialog *portdialog;
- HKEY hKey;
- LPCWSTR subkey;
- wchar_t keyname[256]; //��������
- unsigned char keyvalue[256]; //��ֵ����
- DWORD keysize, type, valuesize;
- int indexnum;
- QSerialPort* myserial;
- char sendflag;
- char recvflag;
- //QByteArray s;
- int timerid;
- int retry;
- int len;
- int crc;
- unsigned int packetno;
- QByteArray q;
- QThread tt;
- protected:
- void timerEvent(QTimerEvent *event);
- void timerEvent_old(QTimerEvent *event);
- int timer_id_searil; //串口定时器ID
- int timer_id_old; //串口定时器ID
-
- private:
- Ui::LineClass ui;
- Ui::Dialog_port portui;
- };
|