Commit 8b706b01 authored by Michael Carpenter's avatar Michael Carpenter

Change so battery monitor config screen properly reads battery voltage now

parent 214607c7
......@@ -32,6 +32,16 @@ BatteryMonitorConfig::BatteryMonitorConfig(QWidget *parent) : AP2ConfigWidget(pa
}
void BatteryMonitorConfig::activeUASSet(UASInterface *uas)
{
if (!uas)
{
return;
}
connect(uas,SIGNAL(batteryChanged(UASInterface*,double,double,double,int)),this,SLOT(batteryChanged(UASInterface*,double,double,double,int)));
AP2ConfigWidget::activeUASSet(uas);
}
void BatteryMonitorConfig::calcDividerSet()
{
if (!m_uas)
......@@ -222,6 +232,14 @@ void BatteryMonitorConfig::apmVerCurrentIndexChanged(int index)
BatteryMonitorConfig::~BatteryMonitorConfig()
{
}
void BatteryMonitorConfig::batteryChanged(UASInterface* uas, double voltage, double current, double percent, int seconds)
{
ui.calcVoltsLineEdit->setText(QString::number(voltage,'f',2));
if (ui.measuredVoltsLineEdit->text() == "")
{
ui.measuredVoltsLineEdit->setText(ui.calcVoltsLineEdit->text());
}
}
void BatteryMonitorConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value)
{
......
......@@ -20,6 +20,8 @@ private slots:
void calcDividerSet();
void ampsPerVoltSet();
void batteryCapacitySet();
void activeUASSet(UASInterface *uas);
void batteryChanged(UASInterface* uas, double voltage, double current, double percent, int seconds);
private:
Ui::BatteryMonitorConfig ui;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment