增加UI配置项
This commit is contained in:
@@ -59,11 +59,11 @@ void SetStyleStr(QLabel *L,bool Status,QString TStr,QString FStr){
|
||||
void P02_ShieldPage::UIRefreshTimeOut(){
|
||||
if(gPageIndexStr != "P02")
|
||||
return;
|
||||
Status1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.DataStatus1"] .toUInt();
|
||||
Status2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.DataStatus2"] .toUInt();
|
||||
Shield1 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.isShield1"] .toUInt();
|
||||
Shield2 = gOPC_NodeValue["ns=6;s=::AsGlobalPV:But_Shield.isShield2"] .toUInt();
|
||||
uint32_t TmpBool = gOPC_NodeValue["ns=6;s=::AsGlobalPV:PageBOOLS.B0"] .toUInt();
|
||||
Status1 = getNodeValue("But_Shield.DataStatus1") .toUInt();
|
||||
Status2 = getNodeValue("But_Shield.DataStatus2") .toUInt();
|
||||
Shield1 = getNodeValue("But_Shield.isShield1") .toUInt();
|
||||
Shield2 = getNodeValue("But_Shield.isShield2") .toUInt();
|
||||
uint32_t TmpBool = getNodeValue("PageBOOLS.B0") .toUInt();
|
||||
|
||||
// 急停的显示
|
||||
for (uint8_t i=0;i<12;i++) {
|
||||
@@ -79,7 +79,6 @@ void P02_ShieldPage::UIRefreshTimeOut(){
|
||||
SetStyleStr(ui->Status_QESR_1,getBitOf32Data(TmpBool, 14,false),"border-image: url(:/Icos/Icos/LED2_Green.png);","border-image: url(:/Icos/Icos/LED3_Rad (2).png);");
|
||||
SetStyleStr(ui->Status_QESR_2,getBitOf32Data(TmpBool, 15,false),"border-image: url(:/Icos/Icos/LED2_Green.png);","border-image: url(:/Icos/Icos/LED3_Rad (2).png);");
|
||||
|
||||
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
QString TextObjName = QString("TxtStatus_Shield_%1").arg(i);
|
||||
QLabel* Label = findChild<QLabel*>(TextObjName);
|
||||
@@ -93,6 +92,19 @@ void P02_ShieldPage::UIRefreshTimeOut(){
|
||||
Label->setStyleSheet(StyleStr);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
QString TextObjName = QString("TxtStatus_Shield_%1").arg(i+32);
|
||||
QLabel* Label = findChild<QLabel*>(TextObjName);
|
||||
if (Label) {
|
||||
QString StyleStr = "border-image: url(:/Frames/null.png);\n";
|
||||
if(getBitOf32Data(Status2, i,false)){
|
||||
StyleStr = StyleStr + TrueColor[i+32]+"\n";
|
||||
}else{
|
||||
StyleStr = StyleStr + FalseColor[i+32]+"\n";
|
||||
}
|
||||
Label->setStyleSheet(StyleStr);
|
||||
}
|
||||
}
|
||||
if(isRefreshBut){
|
||||
for (int i = 0; i < 32; ++i)
|
||||
{
|
||||
@@ -118,28 +130,14 @@ void P02_ShieldPage::UIRefreshTimeOut(){
|
||||
if (checkBox) {
|
||||
if(getBitOf32Data(Shield2, i,false)){
|
||||
checkBox->setChecked(true);
|
||||
checkBox->setText(ShieldText[i]+32);
|
||||
checkBox->setText(ShieldText[i+32]);
|
||||
}else{
|
||||
checkBox->setChecked(false);
|
||||
checkBox->setText(unShieldText[i]+32);
|
||||
checkBox->setText(unShieldText[i+32]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 32; ++i) {
|
||||
QString TextObjName = QString("TxtStatus_Shield_%1").arg(i+32);
|
||||
QLabel* Label = findChild<QLabel*>(TextObjName);
|
||||
if (Label) {
|
||||
QString StyleStr = "border-image: url(:/Frames/null.png);\n";
|
||||
if(getBitOf32Data(Status1, i,false)){
|
||||
StyleStr = StyleStr + TrueColor[i+32]+"\n";
|
||||
}else{
|
||||
StyleStr = StyleStr + FalseColor[i+32]+"\n";
|
||||
}
|
||||
Label->setStyleSheet(StyleStr);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
void P02_ShieldPage::WriteShield( uint8_t var,uint8_t Index,bool Checked){
|
||||
isRefreshBut = false;
|
||||
@@ -152,7 +150,7 @@ void P02_ShieldPage::WriteShield( uint8_t var,uint8_t Index,bool Checked){
|
||||
}
|
||||
int8_t Count = 0;
|
||||
if(var <2 && Index<32){
|
||||
QString NodeId = "ns=6;s=::AsGlobalPV:But_Shield.isShield"+QString::number(var+1);
|
||||
QString NodeId = "But_Shield.isShield"+QString::number(var+1);
|
||||
bool isOK = false;
|
||||
if(var == 0) {
|
||||
writeBitOf32Data(Shield1,Index,Checked);
|
||||
|
||||
Reference in New Issue
Block a user