|
@@ -47,6 +47,15 @@ Widget::Widget(QWidget *parent) :
|
|
|
//ui->stackedWidget_Main->setCurrentWidget(ui->page_7);
|
|
//ui->stackedWidget_Main->setCurrentWidget(ui->page_7);
|
|
|
m_pMSGWidget=new MSGWidget(this);
|
|
m_pMSGWidget=new MSGWidget(this);
|
|
|
m_pMSGWidget->hide();
|
|
m_pMSGWidget->hide();
|
|
|
|
|
+ bool bDataSet=connect(this,SIGNAL(signal_SetData(QLabel*,QString)),this,SLOT(SetData(QLabel*,QString)),Qt::QueuedConnection);
|
|
|
|
|
+ if(bDataSet)
|
|
|
|
|
+ {
|
|
|
|
|
+ qDebug()<<"Connect Link Success";
|
|
|
|
|
+ }else
|
|
|
|
|
+ {
|
|
|
|
|
+ qDebug()<<"Connect Link Error";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Widget::~Widget()
|
|
Widget::~Widget()
|
|
@@ -140,37 +149,51 @@ void Widget::SetData(QLabel *pLab, QString strShow)
|
|
|
{
|
|
{
|
|
|
if(pLab)
|
|
if(pLab)
|
|
|
{
|
|
{
|
|
|
|
|
+ if(pLab==ui->label_V)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(ui->label_V->text()!=strShow)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(strShow=="OFF")
|
|
|
|
|
+ {
|
|
|
|
|
+ ui->label_V->setStyleSheet(LABEL_RED);
|
|
|
|
|
+ }else
|
|
|
|
|
+ {
|
|
|
|
|
+ ui->label_V->setStyleSheet("QLabel{color: rgb(0, 255, 0);}");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
pLab->setText(strShow);
|
|
pLab->setText(strShow);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Widget::SetV(QString strShow)
|
|
void Widget::SetV(QString strShow)
|
|
|
{
|
|
{
|
|
|
- SetData(ui->label_8,strShow);SetData(ui->label_phV,strShow);
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_8,strShow);emit signal_SetData(ui->label_phV,strShow);
|
|
|
if(m_nMonwayType==3)
|
|
if(m_nMonwayType==3)
|
|
|
{
|
|
{
|
|
|
- SetData(ui->label_V,strShow);
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_V,strShow);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-void Widget::SetA(QString strShow){SetData(ui->label_13,strShow);SetData(ui->label_A,strShow);SetData(ui->label_phA,strShow);}
|
|
|
|
|
|
|
+void Widget::SetA(QString strShow){emit signal_SetData(ui->label_13,strShow);emit signal_SetData(ui->label_A,strShow);emit signal_SetData(ui->label_phA,strShow);}
|
|
|
|
|
|
|
|
-void Widget::SetW(QString strShow){SetData(ui->label_16,strShow);SetData(ui->label_W,strShow);SetData(ui->label_phW,strShow);}
|
|
|
|
|
|
|
+void Widget::SetW(QString strShow){emit signal_SetData(ui->label_16,strShow);emit signal_SetData(ui->label_W,strShow);emit signal_SetData(ui->label_phW,strShow);}
|
|
|
|
|
|
|
|
-void Widget::SetF(QString strShow){SetData(ui->label_15,strShow);SetData(ui->label_F,strShow);SetData(ui->label_phF,strShow);}
|
|
|
|
|
|
|
+void Widget::SetF(QString strShow){emit signal_SetData(ui->label_15,strShow);emit signal_SetData(ui->label_F,strShow);emit signal_SetData(ui->label_phF,strShow);}
|
|
|
|
|
|
|
|
-void Widget::SetSUM(QString strShow){SetData(ui->label_14,strShow);SetData(ui->label_S,strShow);SetData(ui->label_phKw,strShow);}
|
|
|
|
|
|
|
+void Widget::SetSUM(QString strShow){emit signal_SetData(ui->label_14,strShow);emit signal_SetData(ui->label_S,strShow);emit signal_SetData(ui->label_phKw,strShow);}
|
|
|
|
|
|
|
|
-void Widget::SetT(QString strShow){SetData(ui->label_Temp,strShow+ " ℃");}
|
|
|
|
|
-void Widget::SetH(QString strShow){SetData(ui->label_Humidity,strShow+" %");}
|
|
|
|
|
-void Widget::SetCO2(QString strShow){SetData(ui->label_CO2,strShow+" PPM");}
|
|
|
|
|
|
|
+void Widget::SetT(QString strShow){emit signal_SetData(ui->label_Temp,strShow+ " ℃");}
|
|
|
|
|
+void Widget::SetH(QString strShow){emit signal_SetData(ui->label_Humidity,strShow+" %");}
|
|
|
|
|
+void Widget::SetCO2(QString strShow){emit signal_SetData(ui->label_CO2,strShow+" PPM");}
|
|
|
|
|
|
|
|
-void Widget::SetVer(QString strShow){SetData(ui->label_2,"Version:"+strShow);}
|
|
|
|
|
|
|
+void Widget::SetVer(QString strShow){emit signal_SetData(ui->label_2,"Version:"+strShow);}
|
|
|
|
|
|
|
|
void Widget::SetStatus(QString strShow){
|
|
void Widget::SetStatus(QString strShow){
|
|
|
if(m_nMonwayType==2)
|
|
if(m_nMonwayType==2)
|
|
|
{
|
|
{
|
|
|
- SetData(ui->label_V,strShow);
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_V,strShow);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -186,7 +209,7 @@ void Widget::SetIP(QString strIP)
|
|
|
void Widget::setCH(int nIndex)
|
|
void Widget::setCH(int nIndex)
|
|
|
{
|
|
{
|
|
|
QString strShow=QString("Output CH%1").arg(nIndex);
|
|
QString strShow=QString("Output CH%1").arg(nIndex);
|
|
|
- SetData(ui->label_chName,strShow);
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_chName,strShow);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
void Widget::setPH(int nIndex,int nPHType)
|
|
void Widget::setPH(int nIndex,int nPHType)
|
|
@@ -214,7 +237,7 @@ void Widget::setPH(int nIndex,int nPHType)
|
|
|
{
|
|
{
|
|
|
strPHShow=QString("Output CH%1%2").arg(nIndex).arg(strShow);
|
|
strPHShow=QString("Output CH%1%2").arg(nIndex).arg(strShow);
|
|
|
}
|
|
}
|
|
|
- SetData(ui->label_18,strPHShow);
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_18,strPHShow);
|
|
|
qDebug()<<"CH_Select:"<<nIndex<<"PH_Select:"<<nPHType;
|
|
qDebug()<<"CH_Select:"<<nIndex<<"PH_Select:"<<nPHType;
|
|
|
}
|
|
}
|
|
|
/*
|
|
/*
|
|
@@ -305,7 +328,11 @@ void Widget::pageUp()
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
+ int nMainIndex= ui->stackedWidget_Main->currentIndex();
|
|
|
|
|
+ int nbaseIndex= ui->stackedWidget->currentIndex();
|
|
|
|
|
+ int nSetingIndex= ui->stackedWidget_Setting->currentIndex();
|
|
|
qDebug()<<"Index:"<<nIndex<<"ChID:"<<nChidIndex;
|
|
qDebug()<<"Index:"<<nIndex<<"ChID:"<<nChidIndex;
|
|
|
|
|
+ qDebug()<<"QTStackedIndex Base="<<nbaseIndex<<" Main="<<nMainIndex<<" Set="<<nSetingIndex;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Widget::pageDown()
|
|
void Widget::pageDown()
|
|
@@ -356,6 +383,10 @@ void Widget::pageDown()
|
|
|
ui->stackedWidget_Main->setCurrentIndex(nIndex-1);
|
|
ui->stackedWidget_Main->setCurrentIndex(nIndex-1);
|
|
|
}
|
|
}
|
|
|
qDebug()<<"Index:"<<nIndex<<"ChID:"<<nChidIndex;
|
|
qDebug()<<"Index:"<<nIndex<<"ChID:"<<nChidIndex;
|
|
|
|
|
+ int nMainIndex= ui->stackedWidget_Main->currentIndex();
|
|
|
|
|
+ int nbaseIndex= ui->stackedWidget->currentIndex();
|
|
|
|
|
+ int nSetingIndex= ui->stackedWidget_Setting->currentIndex();
|
|
|
|
|
+ qDebug()<<"QTStackedIndex Base="<<nbaseIndex<<" Main="<<nMainIndex<<" Set="<<nSetingIndex;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void Widget::ChangeView(int widgetType, int nIndex)
|
|
void Widget::ChangeView(int widgetType, int nIndex)
|
|
@@ -554,13 +585,13 @@ void Widget::setMonwayType(int nType)
|
|
|
{
|
|
{
|
|
|
ui->label_34->setText("Volt(V):");
|
|
ui->label_34->setText("Volt(V):");
|
|
|
ui->label_V->setStyleSheet("");
|
|
ui->label_V->setStyleSheet("");
|
|
|
- SetData(ui->label_V,"0.00");
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_V,"0.00");
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
{
|
|
{
|
|
|
ui->label_34->setText("Switch");
|
|
ui->label_34->setText("Switch");
|
|
|
- SetData(ui->label_V,"OFF");
|
|
|
|
|
|
|
+ emit signal_SetData(ui->label_V,"OFF");
|
|
|
#ifdef RS485Type
|
|
#ifdef RS485Type
|
|
|
ui->label_V->setStyleSheet("QLabel {color: rgb(0,255,255);}");
|
|
ui->label_V->setStyleSheet("QLabel {color: rgb(0,255,255);}");
|
|
|
#else
|
|
#else
|