diff --git a/CounterRealTime/CounterWindowRT.cpp b/CounterRealTime/CounterWindowRT.cpp index e90c359..13b18ef 100644 --- a/CounterRealTime/CounterWindowRT.cpp +++ b/CounterRealTime/CounterWindowRT.cpp @@ -54,10 +54,6 @@ QTimer::singleShot(100, qApp, SLOT(quit())); } - ((QWidget *) ui->widgetContent->children().at(2))->setProperty("form", "devAlarm"); - channelNameList.at(14)->setProperty("labType", "channelNameAlarm"); - channelValueList.at(14)->setProperty("labType", "channelValueAlarm"); - // 初始化设备和通道 getDeviceList(); @@ -408,6 +404,7 @@ if (ConstCache::getInstance().deviceIdLoopA.contains(alarmDev.at(i))) { ((QWidget *)ui->widgetContent->children().at(devicePtr->getFormColIndex() + 1))->setProperty("form", "devAlarm"); + this->setDevAndChannelAlarm(devicePtr->getFormColIndex(), 0, 0); } } else if (settingForm->getDisplayGroupFlag() == 0) { @@ -441,6 +438,23 @@ return nullptr; } +void CounterWindowRT::setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm) +{ + // TODO + ((QWidget *) ui->widgetContent->children().at(devIndex + 1))->setStyleSheet("border: 3px solid #FF0000"); + + for (int i = 1; i < ui->widgetContent->children().at(devIndex + 1)->children().size(); i++) + { + ((QWidget *) ui->widgetContent->children().at(devIndex + 1)->children().at(i))->setStyleSheet("border: 0px;"); + } + + devTitleList.at(devIndex)->setStyleSheet("border-top-left-radius: 10px; border: 3px solid #1E5A7C;"); + devRefList.at(devIndex)->setStyleSheet("border-top-right-radius: 10px; border: 3px solid #1E5A7C;"); + + channelNameList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-left-radius: 10px; border: 3px solid #123553;"); + channelValueList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-right-radius: 10px; border: 3px solid #123553;"); +} + void CounterWindowRT::updateDateAndTime() { QString date = QDate::currentDate().toString("yyyy-MM-dd"); diff --git a/CounterRealTime/CounterWindowRT.cpp b/CounterRealTime/CounterWindowRT.cpp index e90c359..13b18ef 100644 --- a/CounterRealTime/CounterWindowRT.cpp +++ b/CounterRealTime/CounterWindowRT.cpp @@ -54,10 +54,6 @@ QTimer::singleShot(100, qApp, SLOT(quit())); } - ((QWidget *) ui->widgetContent->children().at(2))->setProperty("form", "devAlarm"); - channelNameList.at(14)->setProperty("labType", "channelNameAlarm"); - channelValueList.at(14)->setProperty("labType", "channelValueAlarm"); - // 初始化设备和通道 getDeviceList(); @@ -408,6 +404,7 @@ if (ConstCache::getInstance().deviceIdLoopA.contains(alarmDev.at(i))) { ((QWidget *)ui->widgetContent->children().at(devicePtr->getFormColIndex() + 1))->setProperty("form", "devAlarm"); + this->setDevAndChannelAlarm(devicePtr->getFormColIndex(), 0, 0); } } else if (settingForm->getDisplayGroupFlag() == 0) { @@ -441,6 +438,23 @@ return nullptr; } +void CounterWindowRT::setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm) +{ + // TODO + ((QWidget *) ui->widgetContent->children().at(devIndex + 1))->setStyleSheet("border: 3px solid #FF0000"); + + for (int i = 1; i < ui->widgetContent->children().at(devIndex + 1)->children().size(); i++) + { + ((QWidget *) ui->widgetContent->children().at(devIndex + 1)->children().at(i))->setStyleSheet("border: 0px;"); + } + + devTitleList.at(devIndex)->setStyleSheet("border-top-left-radius: 10px; border: 3px solid #1E5A7C;"); + devRefList.at(devIndex)->setStyleSheet("border-top-right-radius: 10px; border: 3px solid #1E5A7C;"); + + channelNameList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-left-radius: 10px; border: 3px solid #123553;"); + channelValueList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-right-radius: 10px; border: 3px solid #123553;"); +} + void CounterWindowRT::updateDateAndTime() { QString date = QDate::currentDate().toString("yyyy-MM-dd"); diff --git a/CounterRealTime/CounterWindowRT.h b/CounterRealTime/CounterWindowRT.h index 86d7e4a..a0208e7 100644 --- a/CounterRealTime/CounterWindowRT.h +++ b/CounterRealTime/CounterWindowRT.h @@ -60,6 +60,8 @@ CounterChannel * getChannelByDevAndId(QString deviceId, QString channelId); + void setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm); + private slots: void updateDateAndTime(); diff --git a/CounterRealTime/CounterWindowRT.cpp b/CounterRealTime/CounterWindowRT.cpp index e90c359..13b18ef 100644 --- a/CounterRealTime/CounterWindowRT.cpp +++ b/CounterRealTime/CounterWindowRT.cpp @@ -54,10 +54,6 @@ QTimer::singleShot(100, qApp, SLOT(quit())); } - ((QWidget *) ui->widgetContent->children().at(2))->setProperty("form", "devAlarm"); - channelNameList.at(14)->setProperty("labType", "channelNameAlarm"); - channelValueList.at(14)->setProperty("labType", "channelValueAlarm"); - // 初始化设备和通道 getDeviceList(); @@ -408,6 +404,7 @@ if (ConstCache::getInstance().deviceIdLoopA.contains(alarmDev.at(i))) { ((QWidget *)ui->widgetContent->children().at(devicePtr->getFormColIndex() + 1))->setProperty("form", "devAlarm"); + this->setDevAndChannelAlarm(devicePtr->getFormColIndex(), 0, 0); } } else if (settingForm->getDisplayGroupFlag() == 0) { @@ -441,6 +438,23 @@ return nullptr; } +void CounterWindowRT::setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm) +{ + // TODO + ((QWidget *) ui->widgetContent->children().at(devIndex + 1))->setStyleSheet("border: 3px solid #FF0000"); + + for (int i = 1; i < ui->widgetContent->children().at(devIndex + 1)->children().size(); i++) + { + ((QWidget *) ui->widgetContent->children().at(devIndex + 1)->children().at(i))->setStyleSheet("border: 0px;"); + } + + devTitleList.at(devIndex)->setStyleSheet("border-top-left-radius: 10px; border: 3px solid #1E5A7C;"); + devRefList.at(devIndex)->setStyleSheet("border-top-right-radius: 10px; border: 3px solid #1E5A7C;"); + + channelNameList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-left-radius: 10px; border: 3px solid #123553;"); + channelValueList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-right-radius: 10px; border: 3px solid #123553;"); +} + void CounterWindowRT::updateDateAndTime() { QString date = QDate::currentDate().toString("yyyy-MM-dd"); diff --git a/CounterRealTime/CounterWindowRT.h b/CounterRealTime/CounterWindowRT.h index 86d7e4a..a0208e7 100644 --- a/CounterRealTime/CounterWindowRT.h +++ b/CounterRealTime/CounterWindowRT.h @@ -60,6 +60,8 @@ CounterChannel * getChannelByDevAndId(QString deviceId, QString channelId); + void setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm); + private slots: void updateDateAndTime(); diff --git a/CounterRealTime/common/HttpRequestController.cpp b/CounterRealTime/common/HttpRequestController.cpp index 2f8cf16..0a907f1 100644 --- a/CounterRealTime/common/HttpRequestController.cpp +++ b/CounterRealTime/common/HttpRequestController.cpp @@ -254,6 +254,7 @@ QUrlQuery query; query.addQueryItem("offset", "1"); query.addQueryItem("limit", QString::number(limit)); + query.addQueryItem("status", "0"); url.setQuery(query); request.setUrl(url); diff --git a/CounterRealTime/CounterWindowRT.cpp b/CounterRealTime/CounterWindowRT.cpp index e90c359..13b18ef 100644 --- a/CounterRealTime/CounterWindowRT.cpp +++ b/CounterRealTime/CounterWindowRT.cpp @@ -54,10 +54,6 @@ QTimer::singleShot(100, qApp, SLOT(quit())); } - ((QWidget *) ui->widgetContent->children().at(2))->setProperty("form", "devAlarm"); - channelNameList.at(14)->setProperty("labType", "channelNameAlarm"); - channelValueList.at(14)->setProperty("labType", "channelValueAlarm"); - // 初始化设备和通道 getDeviceList(); @@ -408,6 +404,7 @@ if (ConstCache::getInstance().deviceIdLoopA.contains(alarmDev.at(i))) { ((QWidget *)ui->widgetContent->children().at(devicePtr->getFormColIndex() + 1))->setProperty("form", "devAlarm"); + this->setDevAndChannelAlarm(devicePtr->getFormColIndex(), 0, 0); } } else if (settingForm->getDisplayGroupFlag() == 0) { @@ -441,6 +438,23 @@ return nullptr; } +void CounterWindowRT::setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm) +{ + // TODO + ((QWidget *) ui->widgetContent->children().at(devIndex + 1))->setStyleSheet("border: 3px solid #FF0000"); + + for (int i = 1; i < ui->widgetContent->children().at(devIndex + 1)->children().size(); i++) + { + ((QWidget *) ui->widgetContent->children().at(devIndex + 1)->children().at(i))->setStyleSheet("border: 0px;"); + } + + devTitleList.at(devIndex)->setStyleSheet("border-top-left-radius: 10px; border: 3px solid #1E5A7C;"); + devRefList.at(devIndex)->setStyleSheet("border-top-right-radius: 10px; border: 3px solid #1E5A7C;"); + + channelNameList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-left-radius: 10px; border: 3px solid #123553;"); + channelValueList.at(devIndex * 16 + 15)->setStyleSheet("border-bottom-right-radius: 10px; border: 3px solid #123553;"); +} + void CounterWindowRT::updateDateAndTime() { QString date = QDate::currentDate().toString("yyyy-MM-dd"); diff --git a/CounterRealTime/CounterWindowRT.h b/CounterRealTime/CounterWindowRT.h index 86d7e4a..a0208e7 100644 --- a/CounterRealTime/CounterWindowRT.h +++ b/CounterRealTime/CounterWindowRT.h @@ -60,6 +60,8 @@ CounterChannel * getChannelByDevAndId(QString deviceId, QString channelId); + void setDevAndChannelAlarm(int devIndex, int channelIndex, bool alarm); + private slots: void updateDateAndTime(); diff --git a/CounterRealTime/common/HttpRequestController.cpp b/CounterRealTime/common/HttpRequestController.cpp index 2f8cf16..0a907f1 100644 --- a/CounterRealTime/common/HttpRequestController.cpp +++ b/CounterRealTime/common/HttpRequestController.cpp @@ -254,6 +254,7 @@ QUrlQuery query; query.addQueryItem("offset", "1"); query.addQueryItem("limit", QString::number(limit)); + query.addQueryItem("status", "0"); url.setQuery(query); request.setUrl(url); diff --git a/CounterRealTime/qss/mainClock.css b/CounterRealTime/qss/mainClock.css index 8bf2cbb..f9ec3e2 100644 --- a/CounterRealTime/qss/mainClock.css +++ b/CounterRealTime/qss/mainClock.css @@ -35,13 +35,6 @@ /* widgetTitle */ /* widgetContent */ -QWidget#widgetLeft, QWidget#widgetRight { - margin-left: 15px; - margin-right: 15px; - padding-right: 10px; - margin-bottom: 20px; -} - QWidget[form="dev"] { border: 3px solid #0BB2E9; border-radius: 12px; @@ -53,7 +46,6 @@ QWidget#widgetContent QLabel { font-weight: bold; -/* font-family: "Microsoft Yahei";*/ } QLabel[labType='devTitle4'] { font-size: 28px;