修改控制PLC部分
This commit is contained in:
@@ -31,6 +31,16 @@ qreal readCurrent(QString Dev){
|
||||
qreal CurrW = gOPC_NodeValue["ns=6;s=::AsGlobalPV:IN_Phase"+Dev+".Filtered30_W"] .toReal();
|
||||
return fmax(CurrU,fmax(CurrV,CurrW));
|
||||
}
|
||||
void P09_RemotePage::SetStyle2(QLabel *Label,QStringList List,bool b1,bool b2,bool isNull){
|
||||
QString Style = "border-image: url(" + BitMaps().ListChoice_2Mode( List , b1 , b2,isNull ) + ");";
|
||||
if(Label->styleSheet() != Style)
|
||||
Label->setStyleSheet(Style);
|
||||
}
|
||||
void P09_RemotePage::SetStyle3(QLabel *Label,QStringList List,bool b1,bool b2,bool b3,bool isNull){
|
||||
QString Style = "border-image: url(" + BitMaps().ListChoice_3Mode( List , b1 , b2, b3 ,isNull ) + ");";
|
||||
if(Label->styleSheet() != Style)
|
||||
Label->setStyleSheet(Style);
|
||||
}
|
||||
void P09_RemotePage::UIRefreshTimeOut()
|
||||
{
|
||||
if(gPageIndexStr != "P09")
|
||||
@@ -50,37 +60,42 @@ void P09_RemotePage::UIRefreshTimeOut()
|
||||
ui->Label_TransportPos->move(dX,dY);
|
||||
|
||||
// 通用模拟量
|
||||
ui->Label_DB_10-> setStyleSheet("border-image: url("+BitMaps().SwitchBut(extractUInt32_8BitPart(AK2,0)<127,extractUInt32_8BitPart(AK2,0)>127)+");");
|
||||
ui->Label_DialBut_14-> setStyleSheet("border-image: url("+BitMaps().DialBut(extractUInt32_8BitPart(AK2,1)<127,extractUInt32_8BitPart(AK2,1)>127,0)+");");
|
||||
ui->Label_DB_1-> setStyleSheet("border-image: url("+BitMaps().DiBut(extractUInt32_8BitPart(AK2,2)>127)+");");
|
||||
ui->Label_DB_10-> setStyleSheet("border-image: url("+BitMaps().DiBut(extractUInt32_8BitPart(AK2,4)>127)+");");
|
||||
|
||||
SetStyle2( ui->Switch_5 , BitMaps().RemUI_SwitchStyles , extractUInt32_8BitPart(AK2,0) < 127 , extractUInt32_8BitPart(AK2,0) > 127 );
|
||||
SetStyle2( ui->DialBut_2 , BitMaps().RemUI_PutterStyles , extractUInt32_8BitPart(AK2,1) < 127 , extractUInt32_8BitPart(AK2,1) > 127 );
|
||||
SetStyle2( ui->But_1 , BitMaps().RemUI_SwitchStyles , extractUInt32_8BitPart(AK2,2) > 127 , false );
|
||||
SetStyle2( ui->But_3 , BitMaps().RemUI_SwitchStyles , extractUInt32_8BitPart(AK2,4) > 127 , false );
|
||||
// 急停 复位 启动
|
||||
ui->Label_DB_5-> setStyleSheet("border-image: url("+BitMaps().DiBut(!(getBitOf32Data(DK1,0) && getBitOf32Data(DK1,31)))+");");
|
||||
ui->Label_DB_2-> setStyleSheet("border-image: url("+BitMaps().DiBut(getBitOf32Data(DK1,1,0))+");");
|
||||
ui->Label_DB_4-> setStyleSheet("border-image: url("+BitMaps().DiBut(getBitOf32Data(DK1,30,0))+");");
|
||||
SetStyle2( ui->But_5 , BitMaps().RemUI_SwitchStyles , !(getBitOf32Data(DK1,0) && getBitOf32Data(DK1,31)) , false );
|
||||
SetStyle2( ui->But_2 , BitMaps().RemUI_SwitchStyles , getBitOf32Data(DK1,1,0) , false );
|
||||
SetStyle2( ui->But_4 , BitMaps().RemUI_SwitchStyles , getBitOf32Data(DK1,30,0) , false );
|
||||
// 设备启停
|
||||
ui->Label_DB_6-> setStyleSheet("border-image: url("+BitMaps().SwitchBut(getBitOf32Data(DK1,2),getBitOf32Data(DK1,3))+");");
|
||||
ui->Label_DB_8-> setStyleSheet("border-image: url("+BitMaps().SwitchBut(getBitOf32Data(DK1,4),getBitOf32Data(DK1,5))+");");
|
||||
ui->Label_DB_7-> setStyleSheet("border-image: url("+BitMaps().SwitchBut(getBitOf32Data(DK1,6),getBitOf32Data(DK1,7))+");");
|
||||
ui->Label_DB_9-> setStyleSheet("border-image: url("+BitMaps().SwitchBut(getBitOf32Data(DK1,8),getBitOf32Data(DK1,9))+");");
|
||||
SetStyle2( ui->Switch_1 , BitMaps().RemUI_SwitchStyles , getBitOf32Data(DK1,2) , getBitOf32Data(DK1,3) );
|
||||
SetStyle2( ui->Switch_2 , BitMaps().RemUI_SwitchStyles , getBitOf32Data(DK1,4) , getBitOf32Data(DK1,5) );
|
||||
SetStyle2( ui->Switch_3 , BitMaps().RemUI_SwitchStyles , getBitOf32Data(DK1,6) , getBitOf32Data(DK1,7) );
|
||||
SetStyle2( ui->Switch_4 , BitMaps().RemUI_SwitchStyles , getBitOf32Data(DK1,8) , getBitOf32Data(DK1,9) );
|
||||
// 高低速
|
||||
ui->Label_DB_11-> setStyleSheet("border-image: url("+BitMaps().DiBut(getBitOf32Data(DK1,10,0))+");");
|
||||
SetStyle2( ui->Speed_1 , BitMaps().RemUI_SpeedStyles , !getBitOf32Data(DK1,10,0), getBitOf32Data(DK1,10,0) );
|
||||
|
||||
// 铲板液压
|
||||
ui->Label_DialBut_5->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,11),getBitOf32Data(DK1,12),0)+");");
|
||||
ui->Label_DialBut_6->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,13),getBitOf32Data(DK1,14),0)+");");
|
||||
SetStyle2( ui->DialBut_3 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,11) , getBitOf32Data(DK1,12),0);
|
||||
SetStyle2( ui->DialBut_4 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,13) , getBitOf32Data(DK1,14),0);
|
||||
// 运输液压
|
||||
ui->Label_DialBut_7->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,15),getBitOf32Data(DK1,16),0)+");");
|
||||
ui->Label_DialBut_8->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,17),getBitOf32Data(DK1,18),0)+");");
|
||||
SetStyle2( ui->DialBut_5 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,15) , getBitOf32Data(DK1,16),0);
|
||||
SetStyle2( ui->DialBut_6 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,17) , getBitOf32Data(DK1,18),0);
|
||||
// 临时支护液压
|
||||
ui->Label_DialBut_9->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,19),getBitOf32Data(DK1,20),0)+");");
|
||||
ui->Label_DialBut_10->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,21),getBitOf32Data(DK1,22),0)+");");
|
||||
SetStyle2( ui->DialBut_7 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,19) , getBitOf32Data(DK1,20),0);
|
||||
SetStyle2( ui->DialBut_8 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,21) , getBitOf32Data(DK1,22),0);
|
||||
// 后支撑液压
|
||||
ui->Label_DialBut_11->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,23),getBitOf32Data(DK1,24),0)+");");
|
||||
ui->Label_DialBut_12->setStyleSheet("border-image: url("+BitMaps().DialBut(getBitOf32Data(DK1,25),getBitOf32Data(DK1,26),0)+");");
|
||||
|
||||
SetStyle2( ui->DialBut_9 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,23) , getBitOf32Data(DK1,24),0);
|
||||
SetStyle2( ui->DialBut_10 , BitMaps().RemUI_PutterStyles , getBitOf32Data(DK1,25) , getBitOf32Data(DK1,26),0);
|
||||
|
||||
// 工作模式
|
||||
SetStyle3( ui->DialBut_1,
|
||||
BitMaps().RemUI_ModeStyles,
|
||||
getBitOf32Data(DK1,27),
|
||||
getBitOf32Data(DK1,28),
|
||||
getBitOf32Data(DK1,29)
|
||||
);
|
||||
|
||||
ui->LCD_RemoteCur_1->display(readCurrent("Pump"));
|
||||
ui->LCD_RemoteCur_2->display(readCurrent("Cut"));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define P09_REMOTEPAGE_H
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <QLabel>
|
||||
namespace Ui {
|
||||
class P09_RemotePage;
|
||||
}
|
||||
@@ -15,6 +15,8 @@ public:
|
||||
explicit P09_RemotePage(QWidget *parent = nullptr);
|
||||
~P09_RemotePage();
|
||||
void WinInit();
|
||||
void SetStyle2(QLabel *Leabel,QStringList List,bool b1,bool b2,bool isNull = false);
|
||||
void SetStyle3(QLabel *Leabel,QStringList List,bool b1,bool b2,bool b3,bool isNull = false);
|
||||
private slots:
|
||||
void UIRefreshTimeOut();
|
||||
private:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,7 @@ P13_InsPage::P13_InsPage(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_OpcUaManager = OpcUaManager::instance(); // 全局唯一OPC实例
|
||||
isControl(false);
|
||||
}
|
||||
|
||||
P13_InsPage::~P13_InsPage()
|
||||
@@ -71,7 +72,7 @@ void P13_InsPage::Write32Bit(uint8_t Key, uint8_t Index, bool Bit)
|
||||
}
|
||||
}
|
||||
void P13_InsPage::on_XZK_OperMode_activated(int index) {Write32Bit( 1, 0, static_cast<int8_t>(index));} //
|
||||
void P13_InsPage::on_XZK_SpeedMode_activated(int index) {Write32Bit( 4, 5, static_cast< bool >(index));} //
|
||||
void P13_InsPage::on_XZK_SpeedMode_activated(int index) {Write32Bit( 4, 4, static_cast< bool >(index));} //
|
||||
void P13_InsPage::on_Sider_Track_sliderMoved(int position) {Write32Bit( 1, 1, static_cast<int8_t>(position));} //
|
||||
void P13_InsPage::on_Sider_TrackL_sliderMoved(int position) {Write32Bit( 1, 2, static_cast<int8_t>(position));} //
|
||||
void P13_InsPage::on_Sider_TrackR_sliderMoved(int position) {Write32Bit( 1, 3, static_cast<int8_t>(position));} //
|
||||
@@ -132,7 +133,9 @@ void P13_InsPage::on_But_LubPump_pressed() {Write32Bit( 4, 0,
|
||||
void P13_InsPage::on_But_BoostPump_pressed() {Write32Bit( 4, 1, static_cast< bool >(true));}
|
||||
void P13_InsPage::on_But_TrackTension_pressed() {Write32Bit( 4, 2, static_cast< bool >(true));}
|
||||
void P13_InsPage::on_But_TransportTension_pressed() {Write32Bit( 4, 3, static_cast< bool >(true));}
|
||||
void P13_InsPage::on_But_DustFan_pressed() {Write32Bit( 4, 4, static_cast< bool >(true));}
|
||||
void P13_InsPage::on_But_DustStart_pressed() {Write32Bit( 4, 5, static_cast< bool >(true));}
|
||||
void P13_InsPage::on_But_DustStop_pressed() {Write32Bit( 4, 6, static_cast< bool >(true));}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -173,4 +176,29 @@ void P13_InsPage::on_But_LubPump_released() {Write32Bit( 4, 0,
|
||||
void P13_InsPage::on_But_BoostPump_released() {Write32Bit( 4, 1, static_cast< bool >(false));} //
|
||||
void P13_InsPage::on_But_TrackTension_released() {Write32Bit( 4, 2, static_cast< bool >(false));} //
|
||||
void P13_InsPage::on_But_TransportTension_released() {Write32Bit( 4, 3, static_cast< bool >(false));} //
|
||||
void P13_InsPage::on_But_DustFan_released() {Write32Bit( 4, 4, static_cast< bool >(false));} //
|
||||
void P13_InsPage::on_But_DustStart_released() {Write32Bit( 4, 5, static_cast< bool >(false));} //
|
||||
void P13_InsPage::on_But_DustStop_released() {Write32Bit( 4, 6, static_cast< bool >(false));} //
|
||||
|
||||
void P13_InsPage::isControl(bool ok){
|
||||
|
||||
|
||||
// 找中央部件里的所有 QPushButton
|
||||
QList<QPushButton*> btns = findChildren<QPushButton*>();
|
||||
for (auto b : btns)
|
||||
b->setEnabled(ok);
|
||||
|
||||
// 如果滑块也要禁
|
||||
QList<QSlider*> slds = findChildren<QSlider*>();
|
||||
for (auto s : slds)
|
||||
s->setEnabled(ok);
|
||||
|
||||
// 下拉框同理
|
||||
QList<QComboBox*> cbs = findChildren<QComboBox*>();
|
||||
for (auto c : cbs)
|
||||
c->setEnabled(ok);
|
||||
}
|
||||
|
||||
void P13_InsPage::on_ControlRequest_clicked(bool checked)
|
||||
{
|
||||
isControl(checked);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ public:
|
||||
~P13_InsPage();
|
||||
void Write32Bit(uint8_t Key, uint8_t Index, int8_t int8);
|
||||
void Write32Bit(uint8_t Key, uint8_t Index, bool Bit);
|
||||
void isControl(bool ok);
|
||||
private slots:
|
||||
void on_XZK_OperMode_activated(int index);
|
||||
void on_XZK_SpeedMode_activated(int index);
|
||||
@@ -45,6 +46,8 @@ private slots:
|
||||
void on_But_TransportStop_pressed();
|
||||
void on_But_StandbyStart_pressed();
|
||||
void on_But_StandbyStop_pressed();
|
||||
void on_But_DustStart_pressed();
|
||||
void on_But_DustStop_pressed();
|
||||
void on_But_Reset_pressed();
|
||||
void on_But_TransportLifterStr_pressed();
|
||||
void on_But_TransportLifterShr_pressed();
|
||||
@@ -70,7 +73,7 @@ private slots:
|
||||
void on_But_BoostPump_pressed();
|
||||
void on_But_TrackTension_pressed();
|
||||
void on_But_TransportTension_pressed();
|
||||
void on_But_DustFan_pressed();
|
||||
|
||||
|
||||
|
||||
void on_But_EStop_released();
|
||||
@@ -85,6 +88,8 @@ private slots:
|
||||
void on_But_TransportStop_released();
|
||||
void on_But_StandbyStart_released();
|
||||
void on_But_StandbyStop_released();
|
||||
void on_But_DustStart_released();
|
||||
void on_But_DustStop_released();
|
||||
void on_But_Reset_released();
|
||||
void on_But_TransportLifterStr_released();
|
||||
void on_But_TransportLifterShr_released();
|
||||
@@ -110,7 +115,10 @@ private slots:
|
||||
void on_But_BoostPump_released();
|
||||
void on_But_TrackTension_released();
|
||||
void on_But_TransportTension_released();
|
||||
void on_But_DustFan_released();
|
||||
|
||||
|
||||
void on_ControlRequest_clicked(bool checked);
|
||||
|
||||
private:
|
||||
Ui::P13_InsPage *ui;
|
||||
OpcUaManager* m_OpcUaManager; // 全局唯一OPC实例
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user