修复bug
This commit is contained in:
parent
8102b9dee7
commit
129d4bbc93
@ -443,7 +443,7 @@ typedef struct {
|
|||||||
int percentage;
|
int percentage;
|
||||||
} RecorderOut;
|
} RecorderOut;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct TachometerVariables_{
|
||||||
int id;
|
int id;
|
||||||
QString point_name;
|
QString point_name;
|
||||||
bool active;
|
bool active;
|
||||||
@ -464,6 +464,9 @@ typedef struct {
|
|||||||
bool overspeed_latching;
|
bool overspeed_latching;
|
||||||
bool normal_latching;
|
bool normal_latching;
|
||||||
bool fail;
|
bool fail;
|
||||||
|
TachometerVariables_(){
|
||||||
|
fail = true;
|
||||||
|
}
|
||||||
} TachometerVariables;
|
} TachometerVariables;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|||||||
16
keyphase.cpp
16
keyphase.cpp
@ -178,9 +178,9 @@ void KeyPhase::Init() {
|
|||||||
ui->doubleSpinBox_hysteresis_1->setValue(keyphase_data->variables_[i].hysteresis);
|
ui->doubleSpinBox_hysteresis_1->setValue(keyphase_data->variables_[i].hysteresis);
|
||||||
ui->spinBox_events_per_revolution_1->setValue(keyphase_data->variables_[i].events_per_revolution);
|
ui->spinBox_events_per_revolution_1->setValue(keyphase_data->variables_[i].events_per_revolution);
|
||||||
if(keyphase_data->variables_[i].fail)
|
if(keyphase_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge->setCheckable(true);
|
ui->radioButton_falling_edge->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge->setCheckable(true);
|
ui->radioButton_rising_edge->setChecked(true);
|
||||||
} else if (i + 1 == 2) {
|
} else if (i + 1 == 2) {
|
||||||
ui->checkBox_enable_2->setChecked(keyphase_data->variables_[i].active);
|
ui->checkBox_enable_2->setChecked(keyphase_data->variables_[i].active);
|
||||||
ui->doubleSpinBox_high_2->setValue(keyphase_data->variables_[i].normal_voltage_high);
|
ui->doubleSpinBox_high_2->setValue(keyphase_data->variables_[i].normal_voltage_high);
|
||||||
@ -200,9 +200,9 @@ void KeyPhase::Init() {
|
|||||||
ui->doubleSpinBox_hysteresis_2->setValue(keyphase_data->variables_[i].hysteresis);
|
ui->doubleSpinBox_hysteresis_2->setValue(keyphase_data->variables_[i].hysteresis);
|
||||||
ui->spinBox_events_per_revolution_2->setValue(keyphase_data->variables_[i].events_per_revolution);
|
ui->spinBox_events_per_revolution_2->setValue(keyphase_data->variables_[i].events_per_revolution);
|
||||||
if(keyphase_data->variables_[i].fail)
|
if(keyphase_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge_2->setCheckable(true);
|
ui->radioButton_falling_edge_2->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge_2->setCheckable(true);
|
ui->radioButton_rising_edge_2->setChecked(true);
|
||||||
} else if (i + 1 == 3) {
|
} else if (i + 1 == 3) {
|
||||||
ui->checkBox_enable_3->setChecked(keyphase_data->variables_[i].active);
|
ui->checkBox_enable_3->setChecked(keyphase_data->variables_[i].active);
|
||||||
ui->doubleSpinBox_high_3->setValue(keyphase_data->variables_[i].normal_voltage_high);
|
ui->doubleSpinBox_high_3->setValue(keyphase_data->variables_[i].normal_voltage_high);
|
||||||
@ -222,9 +222,9 @@ void KeyPhase::Init() {
|
|||||||
ui->doubleSpinBox_hysteresis_3->setValue(keyphase_data->variables_[i].hysteresis);
|
ui->doubleSpinBox_hysteresis_3->setValue(keyphase_data->variables_[i].hysteresis);
|
||||||
ui->spinBox_events_per_revolution_3->setValue(keyphase_data->variables_[i].events_per_revolution);
|
ui->spinBox_events_per_revolution_3->setValue(keyphase_data->variables_[i].events_per_revolution);
|
||||||
if(keyphase_data->variables_[i].fail)
|
if(keyphase_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge_3->setCheckable(true);
|
ui->radioButton_falling_edge_3->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge_3->setCheckable(true);
|
ui->radioButton_rising_edge_3->setChecked(true);
|
||||||
} else if (i + 1 == 4) {
|
} else if (i + 1 == 4) {
|
||||||
ui->checkBox_enable_4->setChecked(keyphase_data->variables_[i].active);
|
ui->checkBox_enable_4->setChecked(keyphase_data->variables_[i].active);
|
||||||
ui->doubleSpinBox_high_4->setValue(keyphase_data->variables_[i].normal_voltage_high);
|
ui->doubleSpinBox_high_4->setValue(keyphase_data->variables_[i].normal_voltage_high);
|
||||||
@ -244,9 +244,9 @@ void KeyPhase::Init() {
|
|||||||
ui->doubleSpinBox_hysteresis_4->setValue(keyphase_data->variables_[i].hysteresis);
|
ui->doubleSpinBox_hysteresis_4->setValue(keyphase_data->variables_[i].hysteresis);
|
||||||
ui->spinBox_events_per_revolution_4->setValue(keyphase_data->variables_[i].events_per_revolution);
|
ui->spinBox_events_per_revolution_4->setValue(keyphase_data->variables_[i].events_per_revolution);
|
||||||
if(keyphase_data->variables_[i].fail)
|
if(keyphase_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge_4->setCheckable(true);
|
ui->radioButton_falling_edge_4->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge_4->setCheckable(true);
|
ui->radioButton_rising_edge_4->setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->comboBox_relative_number->setCurrentIndex(base_ptr->relative_number);
|
ui->comboBox_relative_number->setCurrentIndex(base_ptr->relative_number);
|
||||||
|
|||||||
@ -122,7 +122,7 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
//qInstallMessageHandler(messageHandler);
|
//qInstallMessageHandler(messageHandler);
|
||||||
#endif
|
#endif
|
||||||
QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
QDate buildDate = QLocale( QLocale::English ).toDate( QString(__DATE__).replace(" ", " 0"), "MMM dd yyyy");
|
||||||
QString Version = "V1.0_" + buildDate.toString("yyyyMMdd") + "_3609";
|
QString Version = "V1.0_" + buildDate.toString("yyyyMMdd") + "_8102";
|
||||||
ui->label_version->setText(Version);
|
ui->label_version->setText(Version);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -276,6 +276,7 @@ void Tachometer::Init() {
|
|||||||
}
|
}
|
||||||
std::shared_ptr<TachometerData> speed_data = std::dynamic_pointer_cast<TachometerData>(base_ptr);
|
std::shared_ptr<TachometerData> speed_data = std::dynamic_pointer_cast<TachometerData>(base_ptr);
|
||||||
for (int i = 0; i < CHANNEL_COUNT_SPEED; i++) {
|
for (int i = 0; i < CHANNEL_COUNT_SPEED; i++) {
|
||||||
|
qDebug() << "speed_data->variables_[i].fail" << i << speed_data->variables_[i].fail;
|
||||||
if (i + 1 == 1) {
|
if (i + 1 == 1) {
|
||||||
ui->checkBox_chan_1->setChecked(speed_data->variables_[i].active);
|
ui->checkBox_chan_1->setChecked(speed_data->variables_[i].active);
|
||||||
ui->doubleSpinBox_high_1->setValue(speed_data->variables_[i].normal_voltage_high);
|
ui->doubleSpinBox_high_1->setValue(speed_data->variables_[i].normal_voltage_high);
|
||||||
@ -299,10 +300,13 @@ void Tachometer::Init() {
|
|||||||
ui->spinBox_events_per_revolution_1->setValue(speed_data->variables_[i].events_per_revolution);
|
ui->spinBox_events_per_revolution_1->setValue(speed_data->variables_[i].events_per_revolution);
|
||||||
ui->comboBox_record_output_1->setCurrentIndex(speed_data->variables_[i].record_output);
|
ui->comboBox_record_output_1->setCurrentIndex(speed_data->variables_[i].record_output);
|
||||||
ui->checkBox_two_ma_clamp_1->setChecked(speed_data->variables_[i].two_ma_clamp);
|
ui->checkBox_two_ma_clamp_1->setChecked(speed_data->variables_[i].two_ma_clamp);
|
||||||
if(speed_data->variables_[i].fail)
|
if(speed_data->variables_[i].fail){
|
||||||
ui->radioButton_falling_edge->setCheckable(true);
|
ui->radioButton_falling_edge->setChecked(true);
|
||||||
else
|
}
|
||||||
ui->radioButton_rising_edge->setCheckable(true);
|
else{
|
||||||
|
ui->radioButton_rising_edge->setChecked(true);
|
||||||
|
}
|
||||||
|
|
||||||
// -alarm
|
// -alarm
|
||||||
ui->lineEdit_danger_high_level->setText(QString::number(speed_data->danger_high[i].level));
|
ui->lineEdit_danger_high_level->setText(QString::number(speed_data->danger_high[i].level));
|
||||||
ui->lineEdit_danger_high_hysteresis->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
ui->lineEdit_danger_high_hysteresis->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
||||||
@ -351,9 +355,9 @@ void Tachometer::Init() {
|
|||||||
ui->comboBox_record_output_2->setCurrentIndex(speed_data->variables_[i].record_output);
|
ui->comboBox_record_output_2->setCurrentIndex(speed_data->variables_[i].record_output);
|
||||||
ui->checkBox_two_ma_clamp_2->setChecked(speed_data->variables_[i].two_ma_clamp);
|
ui->checkBox_two_ma_clamp_2->setChecked(speed_data->variables_[i].two_ma_clamp);
|
||||||
if(speed_data->variables_[i].fail)
|
if(speed_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge_2->setCheckable(true);
|
ui->radioButton_falling_edge_2->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge_2->setCheckable(true);
|
ui->radioButton_rising_edge_2->setChecked(true);
|
||||||
// -alarm
|
// -alarm
|
||||||
ui->lineEdit_danger_high_level_2->setText(QString::number(speed_data->danger_high[i].level));
|
ui->lineEdit_danger_high_level_2->setText(QString::number(speed_data->danger_high[i].level));
|
||||||
ui->lineEdit_danger_high_hysteresis_2->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
ui->lineEdit_danger_high_hysteresis_2->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
||||||
@ -402,9 +406,9 @@ void Tachometer::Init() {
|
|||||||
ui->comboBox_record_output_3->setCurrentIndex(speed_data->variables_[i].record_output);
|
ui->comboBox_record_output_3->setCurrentIndex(speed_data->variables_[i].record_output);
|
||||||
ui->checkBox_two_ma_clamp_3->setChecked(speed_data->variables_[i].two_ma_clamp);
|
ui->checkBox_two_ma_clamp_3->setChecked(speed_data->variables_[i].two_ma_clamp);
|
||||||
if(speed_data->variables_[i].fail)
|
if(speed_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge_3->setCheckable(true);
|
ui->radioButton_falling_edge_3->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge_3->setCheckable(true);
|
ui->radioButton_rising_edge_3->setChecked(true);
|
||||||
// -alarm
|
// -alarm
|
||||||
ui->lineEdit_danger_high_level_3->setText(QString::number(speed_data->danger_high[i].level));
|
ui->lineEdit_danger_high_level_3->setText(QString::number(speed_data->danger_high[i].level));
|
||||||
ui->lineEdit_danger_high_hysteresis_3->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
ui->lineEdit_danger_high_hysteresis_3->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
||||||
@ -453,9 +457,9 @@ void Tachometer::Init() {
|
|||||||
ui->comboBox_record_output_4->setCurrentIndex(speed_data->variables_[i].record_output);
|
ui->comboBox_record_output_4->setCurrentIndex(speed_data->variables_[i].record_output);
|
||||||
ui->checkBox_two_ma_clamp_4->setChecked(speed_data->variables_[i].two_ma_clamp);
|
ui->checkBox_two_ma_clamp_4->setChecked(speed_data->variables_[i].two_ma_clamp);
|
||||||
if(speed_data->variables_[i].fail)
|
if(speed_data->variables_[i].fail)
|
||||||
ui->radioButton_falling_edge_4->setCheckable(true);
|
ui->radioButton_falling_edge_4->setChecked(true);
|
||||||
else
|
else
|
||||||
ui->radioButton_rising_edge_4->setCheckable(true);
|
ui->radioButton_rising_edge_4->setChecked(true);
|
||||||
// -alarm
|
// -alarm
|
||||||
ui->lineEdit_danger_high_level_4->setText(QString::number(speed_data->danger_high[i].level));
|
ui->lineEdit_danger_high_level_4->setText(QString::number(speed_data->danger_high[i].level));
|
||||||
ui->lineEdit_danger_high_hysteresis_4->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
ui->lineEdit_danger_high_hysteresis_4->setText(QString::number(speed_data->danger_high[i].hysteresis));
|
||||||
|
|||||||
@ -874,7 +874,7 @@
|
|||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>30</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -893,7 +893,7 @@
|
|||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>30</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
@ -915,7 +915,7 @@
|
|||||||
<property name="maximumSize">
|
<property name="maximumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>16777215</width>
|
<width>16777215</width>
|
||||||
<height>30</height>
|
<height>16777215</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user