修改控制PLC部分
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user