#include <qdebug.h>
mcu_arm1 *ARM3;//调用串口通信
+
bool cspz_flag=false;
void Delay_MSec1(unsigned int msec)
label_cspz_3_31->setGeometry(360,406,20,30);
label_cspz_3_31->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(255, 255, 255)");
label_cspz_3_31->setText("分");
- label_cspz_3_15->setGeometry(700,354,80,30);
+ //label_cspz_3_15->setGeometry(700,354,80,30);
+ label_cspz_3_15->setGeometry(310,270,80,30);
label_cspz_3_15->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(255, 255, 255)");
label_cspz_3_18->setGeometry(450,231,100,30);
void canshupeizhi::callKeyBoard(QLineEdit *a)
{
+ if(keyBoard_flag==true)
+ {
+ keyBoard1->close();
+ }
if(KeyBoard_Code==false)
{
keyBoard1 = new KeyBoard(0, a);
}
else
{
- if(keyBoard_flag==true)
- {
- keyBoard1->close();
- }
keyBoard1 = new KeyBoard(0, a);
keyBoard1->setGeometry(490, 200, 321, 182);
keyBoard1->show();
}
+ keyBoard1->setAttribute(Qt::WA_DeleteOnClose);
}
void canshupeizhi::callKeyBoard_ABC_Can(QLineEdit *a)
{
+ if(keyBoard_ABC_flag==true)
+ {
+ keyBoard_ABC1->close();
+ }
if(KeyBoard_ABC_Code==false)
{
keyBoard_ABC1 = new KeyBoard_ABC(0, a);
}
else
{
- if(keyBoard_ABC_flag==true)
- {
- keyBoard_ABC1->close();
- }
keyBoard_ABC1 = new KeyBoard_ABC(0, a);
keyBoard_ABC1->setGeometry(5, 326, 790, 143);
keyBoard_ABC1->show();
}
+ keyBoard_ABC1->setAttribute(Qt::WA_DeleteOnClose);
}
void canshupeizhi::button_cspz_1_1_Clicked()
}
ARM3->rxy_state(); //下发热像仪状态 23.8.30
+ Delay_MSec1(500);
}
void canshupeizhi::button_cspz_rxy2_start_Clicked()//开启热像仪2
button_cspz_rxy2_start->setText("关闭热像仪2");
}
ARM3->rxy_state(); //下发热像仪状态 23.8.30
+ Delay_MSec1(500);
}
void canshupeizhi::button_cspz_5_1_Clicked()//开启风机
{
ARM3->setFanState(1);
+ Delay_MSec1(500);
}
void canshupeizhi::button_cspz_5_2_Clicked()//关闭风机
{
ARM3->setFanState(0);
+ Delay_MSec1(500);
}
bool fengji_flag=true;
file_write2.close();
Delay_MSec1(50);
ARM3->setoverheat();
- Delay_MSec1(10);
+ Delay_MSec1(500);
if(label_cspz_5_19->text()=="风机定时运行已开启!")
{
ARM3->setFanTiming(0x01);//串口发送启动风机定时
{
ARM3->setFanTiming(0x00);//串口发送关闭风机定时
}
- Delay_MSec1(10);
+ Delay_MSec1(500);
ARM3->setFanStartT();
- Delay_MSec1(10);
+ Delay_MSec1(500);
label_cspz_5_18->setText("保存成功!");
Delay_MSec1(500);
label_cspz_5_18->clear();
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.11.1, 2023-06-07T17:42:52. -->
+<!-- Written by QtCreator 4.11.1, 2023-08-15T17:34:46. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<rect>
<x>0</x>
<y>0</y>
- <width>1039</width>
- <height>190</height>
+ <width>919</width>
+ <height>242</height>
</rect>
</property>
<property name="cursor">
<rect>
<x>1</x>
<y>1</y>
- <width>1021</width>
- <height>161</height>
+ <width>791</width>
+ <height>141</height>
</rect>
</property>
<property name="styleSheet">
<rect>
<x>0</x>
<y>0</y>
- <width>1013</width>
- <height>161</height>
+ <width>791</width>
+ <height>141</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
Thermal_imager_Alarm_file_rxy1=in.readLine();
}
file_read.close();
-
label_9_1->clear();
button9_1->show();
button9_1->raise();
bool kaiji_flag_ok=false;
+int rxy_state_flag = 0;
+bool powerlost_flag = true;
+int powerlost_times = 0;
+
wangluo *wangluo_thread=nullptr;
canshupeizhi *canshupeizhi_thread=nullptr;
xitongshezhi *xitongshezhi_thread=nullptr;
int main_back_color;
int where_page;
+
+void Delay_MSec3(unsigned int msec)
+{
+ QEventLoop eventloop;
+ QTimer::singleShot((int)msec, &eventloop, SLOT(quit()));
+ eventloop.exec();
+}
+
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
Pop_alarm_rxy_disconnect->show();
Pop_alarm_rxy_disconnect->raise();
Pop_alarm_rxy_disconnect->setText("热像仪掉线");
-
+ int flag_rxy = 0;
+ if(file_alarm6_1.exists() == true && file_alarm6_2.exists() == false)
+ {
+ flag_rxy = 1;
+ }
+ else if(file_alarm6_2.exists() == true && file_alarm6_1.exists() == false)
+ {
+ flag_rxy = 2;
+ }
+ else
+ {
+ flag_rxy = 3;
+ }
+ if(rxy_state_flag != flag_rxy)
+ {
+ rxy_state_flag = flag_rxy;
ARM_1->rxy_state(); //向下位机发送警报 23.8.16
+ Delay_MSec3(100);
+ }
}
else
DIG.alarm_rxy = 0;
alarm_flag4=false;
Pop_alarm_rxy_disconnect->hide();
+ rxy_state_flag = 0;
}
}
}
}
-void Delay_MSec3(unsigned int msec)
-{
- QEventLoop eventloop;
- QTimer::singleShot((int)msec, &eventloop, SLOT(quit()));
- eventloop.exec();
-}
void MainWindow::usb_file_selcet()
{
}else {
ARM_1->GetRtcTime();
}
+ Delay_MSec3(50);
QDateTime date_time=QDateTime::currentDateTimeUtc();
long nowtime = date_time.toTime_t() + 28800;
//23.8.24 增加断电
if(data_alarm & BIT(4))
{
+ if(powerlost_flag || powerlost_times == 20)
+ {
+ powerlost_times = 0;
+ powerlost_flag = false;
postDataMod->powerlost();
+ Delay_MSec3(100);
+ }
+ powerlost_times++;
+ }
+ else
+ {
+ powerlost_flag = true;
}
}
alarm_flag13 = (data_alarm & BIT(4)) ? false: true;
alarm_flag12 = (data_alarm & BIT(3)) ? false: true;
+
}
void MainWindow::onLanTuBiaoStateUpdate(bool state)
#include "net_thread.h"
#include "QTime"
#include <QFileDialog>
+#include <qthread.h>
extern QSerialPort SerialPort1;
UART1 *uart_mcu1;
extern uint16_t CRC1;
void mcu_delay(unsigned int msec)
{
- QTime _Timer = QTime::currentTime().addMSecs(msec);
- while( QTime::currentTime() < _Timer )
- QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
+ QThread::msleep(msec);
+// QTime _Timer = QTime::currentTime().addMSecs(msec);
+// while( QTime::currentTime() < _Timer )
+// QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
}
void mcu_arm1::GetRtcTime(){
void setFanTiming(uint8_t state);
void setBuzzerState(uint8_t state);
- void rxy_state(); // ÈÈÏñÒÇ״̬ 23.8.16
- void Realtime_temperature(int max,int min,int average); //ÈÈÏñÒÇ1ʵʱÎÂ¶È 23.8.16
- void Realtime_temperature1(int max,int min,int average); //ÈÈÏñÒÇ2ʵʱÎÂ¶È 23.8.16
- void Powerlost_datapost(bool isok); //¶ÏµçÊý¾ÝÉÏ´«³É¹¦ÐźÅ
+ void rxy_state(); // 热像仪状态 23.8.16
+ void Realtime_temperature(int max,int min,int average); //热像仪1实时温度 23.8.16
+ void Realtime_temperature1(int max,int min,int average); //热像仪2实时温度 23.8.16
+ void Powerlost_datapost(bool isok); //断电数据上传成功信号
private:
QSerialPort *m_serialPort;
void wangluo::callKeyBoard(QLineEdit *a)
{
+ if(keyBoard_flag==true)
+ {
+ keyBoard->close();
+ }
if(KeyBoard_Code==false)
{
keyBoard = new KeyBoard(0, a);
keyBoard->setGeometry(490, 200, 321, 182);
keyBoard->show();
}
+ keyBoard->setAttribute(Qt::WA_DeleteOnClose);
}
void wangluo::callKeyBoard_ABC(QLineEdit *a)
{
+ if(keyBoard_ABC_flag==true)
+ {
+ keyBoard_ABC->close();
+ }
if(KeyBoard_ABC_Code==false)
{
keyBoard_ABC = new KeyBoard_ABC(0, a);
keyBoard_ABC->setGeometry(5, 326, 790, 143);
keyBoard_ABC->show();
}
+ keyBoard_ABC->setAttribute(Qt::WA_DeleteOnClose);
}
void wangluo::button_wlxx_1_1_Clicked()//4G配置页面保存参数槽函数
label_xtsz_0_3->setAlignment(Qt::AlignCenter);
label_xtsz_0_3->setText("故障记录");
+
xtsz_page(1);
xtsz_shebei_page();
void xitongshezhi::label_xtsz_3_show(int a)
{
+ label_xtsz_0_3_1->show();
if(a==1)
{
label_xtsz_3_1->show();
count=0;
model_error->sort(0,Qt::DescendingOrder);
tableView_error->show();
+ label_xtsz_0_3_1->hide();
+
}
else
{
tableView_error->hide();
label_xtsz_3_1->hide();
+ label_xtsz_0_3_1->hide();
}
+
}
void xitongshezhi::xtsz_page(int a)
void xitongshezhi::xtsz_error_record_page()
{
label_xtsz_3_1=new QLabel(this);
+ label_xtsz_0_3_1=new QLabel(this);
label_xtsz_3_1->setGeometry(240,190,400,30);
label_xtsz_3_1->setStyleSheet("background: rgb(145, 145, 145);font: 12pt 黑体 bold;color: rgb(255, 255, 255)");
label_xtsz_3_1->setText("发生时间 故障类型");
+ label_xtsz_0_3_1->setGeometry(650,190,120,39);
+ label_xtsz_0_3_1->setAlignment(Qt::AlignCenter);
+ label_xtsz_0_3_1->setText("记录读取中...");
tableView_error = new QTableView;
/* 设置表格视图大小 */
extern bool lowpower_mode_flag1;
extern bool cspz_flag,wlpz_flag;
-static QString version="软件版本号:A20230831test";
+static QString version="软件版本号:A20230914test";
namespace Ui {
class xitongshezhi;
QLabel *label_xtsz_0_1;//左右滑动切换页面label(4G配置)
QLabel *label_xtsz_0_2;//左右滑动切换页面label(LORA配置)
QLabel *label_xtsz_0_3;
+ QLabel *label_xtsz_0_3_1; //读取进度
QLabel *label_xtsz_1_1;
QLabel *label_xtsz_1_2;