Skip to content
Snippets Groups Projects
Commit a5630cb0 authored by Paul Beuchat's avatar Paul Beuchat
Browse files

Small changes to the CS1 GUI

parent 9723c81b
No related branches found
No related tags found
No related merge requests found
...@@ -106,10 +106,10 @@ private slots: ...@@ -106,10 +106,10 @@ private slots:
void newDataForPerformingStepAndPlotting(float x); void newDataForPerformingStepAndPlotting(float x);
void analyseStepResponse(); void analyseStepResponse();
//void on_lineEdit_k_returnPressed(); void on_lineEdit_k_returnPressed();
//void on_lineEdit_T_returnPressed(); void on_lineEdit_T_returnPressed();
//void on_lineEdit_alpha_returnPressed(); void on_lineEdit_alpha_returnPressed();
//void on_lineEdit_step_size_returnPressed(); void on_lineEdit_step_size_returnPressed();
void on_set_controller_parameters_button_clicked(); void on_set_controller_parameters_button_clicked();
...@@ -152,7 +152,7 @@ private: ...@@ -152,7 +152,7 @@ private:
// > Time (as a float) for the horizontal axis // > Time (as a float) for the horizontal axis
float m_time_for_step = 0.0f; float m_time_for_step = 0.0f;
// > The duration for which to record the step // > The duration for which to record the step
float m_step_response_data_recording_duration = 10.0f; float m_step_response_data_recording_duration = 20.0f;
// > Line Series for the data // > Line Series for the data
QLineSeries *m_lineSeries_for_setpoint_x; QLineSeries *m_lineSeries_for_setpoint_x;
QLineSeries *m_lineSeries_for_measured_x; QLineSeries *m_lineSeries_for_measured_x;
......
...@@ -216,17 +216,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked() ...@@ -216,17 +216,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked()
if (k < 0.0) if (k < 0.0)
{ {
k = 0.0; k = 0.0;
ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 3)); ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 4));
} }
else if (T > 100.0) else if (T > 100.0)
{ {
k = 100.0; k = 100.0;
ui->lineEdit_T->setText(qstr + QString::number( k, 'f', 3)); ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 4));
} }
} }
else else
{ {
ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 3)); ui->lineEdit_k->setText(qstr + QString::number( k, 'f', 4));
} }
// > For T // > For T
...@@ -237,17 +237,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked() ...@@ -237,17 +237,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked()
if (T < 0.0) if (T < 0.0)
{ {
T = 0.0; T = 0.0;
ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 3)); ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 1));
} }
else if (T > 100.0) else if (T > 100.0)
{ {
T = 100.0; T = 100.0;
ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 3)); ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 1));
} }
} }
else else
{ {
ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 3)); ui->lineEdit_T->setText(qstr + QString::number( T, 'f', 1));
} }
// > For T // > For T
...@@ -258,17 +258,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked() ...@@ -258,17 +258,17 @@ void CsoneControllerTab::on_set_controller_parameters_button_clicked()
if (alpha < 0.0) if (alpha < 0.0)
{ {
alpha = 0.0; alpha = 0.0;
ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 3)); ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 2));
} }
else if (T > 100.0) else if (T > 100.0)
{ {
T = 100.0; T = 100.0;
ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 3)); ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 2));
} }
} }
else else
{ {
ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 3)); ui->lineEdit_alpha->setText(qstr + QString::number( alpha, 'f', 2));
} }
// Call the function to publish the setpoint // Call the function to publish the setpoint
...@@ -294,7 +294,7 @@ void CsoneControllerTab::publishControllerParamters(float k, float T, float alph ...@@ -294,7 +294,7 @@ void CsoneControllerTab::publishControllerParamters(float k, float T, float alph
this->requestControllerParamterChangePublisher.publish(msg); this->requestControllerParamterChangePublisher.publish(msg);
// Inform the user about the change // Inform the user about the change
ROS_INFO_STREAM("[CSONE CONTROLLER GUI] Published request for setpoint change to: [" << k << ", "<< T << ", "<< alpha << "]"); ROS_INFO_STREAM("[CSONE CONTROLLER GUI] Published request for new controller parameters (k,T,alpha) = (" << k << ", "<< T << ", "<< alpha << ")");
#else #else
// TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator" // TO ASSIST WITH DEBUGGING WHEN COMPILED AND RUN IN "QtCreator"
QTextStream(stdout) << "[CSONE CONTROLLER GUI] would publish request for: [" << k << ", "<< T << ", "<< alpha << "]"; QTextStream(stdout) << "[CSONE CONTROLLER GUI] would publish request for: [" << k << ", "<< T << ", "<< alpha << "]";
...@@ -303,25 +303,25 @@ void CsoneControllerTab::publishControllerParamters(float k, float T, float alph ...@@ -303,25 +303,25 @@ void CsoneControllerTab::publishControllerParamters(float k, float T, float alph
//void CsoneControllerTab::on_lineEdit_k_returnPressed() void CsoneControllerTab::on_lineEdit_k_returnPressed()
//{ {
// ui->set_setpoint_button->animateClick(); ui->set_controller_parameters_button->animateClick();
//} }
//void CsoneControllerTab::on_lineEdit_T_returnPressed() void CsoneControllerTab::on_lineEdit_T_returnPressed()
//{ {
// ui->set_setpoint_button->animateClick(); ui->set_controller_parameters_button->animateClick();
//} }
//void CsoneControllerTab::on_lineEdit_alpha_returnPressed() void CsoneControllerTab::on_lineEdit_alpha_returnPressed()
//{ {
// ui->set_setpoint_button->animateClick(); ui->set_controller_parameters_button->animateClick();
//} }
//void CsoneControllerTab::on_lineEdit_step_size_returnPressed() void CsoneControllerTab::on_lineEdit_step_size_returnPressed()
//{ {
// ui->set_setpoint_button->animateClick(); ui->set_controller_parameters_button->animateClick();
//} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment