纠正数据极性,添加曲线,修改曲线刷新率

This commit is contained in:
hm
2020-10-26 21:42:04 +08:00
parent 791b81d871
commit 839bb9c0dc
31 changed files with 2443 additions and 926 deletions
+89
View File
@@ -28,6 +28,7 @@ ToolsUI::ToolsUI(QWidget *parent) :
ui->ServoSystem->setFixedSize(w,h);
ui->pushButton_ShowExtern->setFixedSize(w,h);
ui->pushButton_CommandBox->setFixedSize(w,h);
ui->pushButton_Diagram->setFixedSize(w,h);
@@ -55,6 +56,10 @@ ToolsUI::ToolsUI(QWidget *parent) :
command = new CommandBox(ui->frame);
command->hide();
diagram = new Diagram(ui->frame);
diagram->hide();
//connect(index4,SIGNAL(destroyed(QObject*)))
connect(this,SIGNAL(IndexChanged(int)),
@@ -87,6 +92,9 @@ ToolsUI::ToolsUI(QWidget *parent) :
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
}
ToolsUI::~ToolsUI()
@@ -135,6 +143,7 @@ void ToolsUI::resizeEvent(QResizeEvent *event)
servosystem->setGeometry(0,0,ui->frame->geometry().width(),ui->frame->geometry().height());
diagram->setGeometry(0,0,ui->frame->geometry().width(),ui->frame->geometry().height());
update();
}
@@ -286,6 +295,24 @@ void ToolsUI::onTabIndexChanged(const int &index)//界面选择管理
if(command->parent())
command->hide();
}
if(index == 8)
{
if(diagram->parent())
{
diagram->show();
}
else
{
diagram->showNormal();
diagram->activateWindow();
}
}
else {
if(diagram->parent())
diagram->hide();
}
}
@@ -317,6 +344,9 @@ void ToolsUI::on_pushButton_Inspector_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -348,6 +378,9 @@ void ToolsUI::on_pushButton_Log_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -379,6 +412,9 @@ void ToolsUI::on_pushButton_Replay_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -410,6 +446,9 @@ void ToolsUI::on_pushButton_Console_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -442,6 +481,9 @@ void ToolsUI::on_pushButton_Servos_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -473,6 +515,9 @@ void ToolsUI::on_PowerSystem_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -504,6 +549,9 @@ void ToolsUI::on_ServoSystem_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
@@ -535,7 +583,43 @@ void ToolsUI::on_pushButton_CommandBox_clicked()
setPushButtonState(ui->pushButton_CommandBox,
state::Selected);
setPushButtonState(ui->pushButton_Diagram,
state::unSelected);
emit IndexChanged(CurrentIndex);
}
void ToolsUI::on_pushButton_Diagram_clicked()
{
CurrentIndex = 8;
setPushButtonState(ui->pushButton_Inspector,
state::unSelected);
setPushButtonState(ui->pushButton_Log,
state::unSelected);
setPushButtonState(ui->pushButton_Replay,
state::unSelected);
setPushButtonState(ui->pushButton_Console,
state::unSelected);
setPushButtonState(ui->pushButton_Servos,
state::unSelected);
setPushButtonState(ui->PowerSystem,
state::unSelected);
setPushButtonState(ui->ServoSystem,
state::unSelected);
setPushButtonState(ui->pushButton_CommandBox,
state::unSelected);
setPushButtonState(ui->pushButton_Diagram,
state::Selected);
emit IndexChanged(CurrentIndex);
}
@@ -568,8 +652,13 @@ void ToolsUI::on_pushButton_ShowExtern_clicked()
case 7:
command->setFloat();
break;
case 8:
diagram->setFloat();
break;
}
}