Initial commit (project based on widgets)

This commit is contained in:
Yury Shuvakin
2022-08-01 21:53:36 +03:00
parent d9396cdc2f
commit 14a7aa699f
411 changed files with 95119 additions and 0 deletions

276
pages/pageconnection.cpp Normal file
View File

@@ -0,0 +1,276 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageconnection.h"
#include "ui_pageconnection.h"
#include "widgets/helpdialog.h"
#include "utility.h"
#include <QMessageBox>
#include <QSettings>
#include <cmath>
PageConnection::PageConnection(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageConnection)
{
ui->setupUi(this);
ui->rtCellsText->setMode(true);
layout()->setContentsMargins(0, 0, 0, 0);
// remove disabled widgets
for (;;)
{
int i;
for(i=0; i!=ui->tabWidget->count(); ++i)
if ( ! ui->tabWidget->widget(i)->isEnabled() )
break;
if ( i==ui->tabWidget->count() ) // nothing was found
break; // exit
ui->tabWidget->removeTab(i);
}
ui->groupBox->setVisible(false);
ui->autoConnectButton->setVisible(false);
ui->serialBaudBox->setVisible(false);
QString lastTcpServer =
QSettings().value("tcp_server", ui->tcpServerEdit->text()).toString();
ui->tcpServerEdit->setText(lastTcpServer);
int lastTcpPort =
QSettings().value("tcp_port", ui->tcpPortBox->value()).toInt();
ui->tcpPortBox->setValue(lastTcpPort);
mDieBieMS = 0;
mTimer = new QTimer(this);
connect(mTimer, SIGNAL(timeout()),
this, SLOT(timerSlot()));
mTimer->start(20);
}
PageConnection::~PageConnection()
{
delete ui;
}
BMSInterface *PageConnection::bms() const
{
return mDieBieMS;
}
void PageConnection::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
connect(mDieBieMS->bleDevice(), SIGNAL(scanDone(QVariantMap,bool)),this, SLOT(bleScanDone(QVariantMap,bool)));
connect(mDieBieMS->commands(), SIGNAL(valuesReceived(BMS_VALUES)),this, SLOT(valuesReceived(BMS_VALUES)));
connect(mDieBieMS->commands(), SIGNAL(cellsReceived(int,QVector<double>)),this, SLOT(cellsReceived(int,QVector<double>)));
QString lastBleAddr = QSettings().value("ble_addr").toString();
if (lastBleAddr != "") {
QString setName = mDieBieMS->getBleName(lastBleAddr);
QString name;
if (!setName.isEmpty()) {
name += setName;
name += " [";
name += lastBleAddr;
name += "]";
} else {
name = lastBleAddr;
}
ui->bleDevBox->insertItem(0, name, lastBleAddr);
}
on_serialRefreshButton_clicked();
}
void PageConnection::valuesReceived(BMS_VALUES values)
{
ui->rtText->setValues(values);
}
void PageConnection::cellsReceived(int cellCount, QVector<double> cellVoltageArray)
{
QVector<double> absValues;
std::transform(cellVoltageArray.begin(), cellVoltageArray.end(),
std::back_inserter(absValues), fabs);
ui->rtCellsText->setCells(absValues);
}
void PageConnection::timerSlot()
{
if (mDieBieMS) {
QString str = mDieBieMS->getConnectedPortName();
if (str != ui->statusLabel->text()) {
ui->statusLabel->setText(mDieBieMS->getConnectedPortName());
}
// CAN fwd
if (ui->canFwdButton->isChecked() != mDieBieMS->commands()->getSendCan()) {
ui->canFwdButton->setChecked(mDieBieMS->commands()->getSendCan());
}
if (ui->canFwdBox->value() != mDieBieMS->commands()->getCanSendId()) {
ui->canFwdBox->setValue(mDieBieMS->commands()->getCanSendId());;
}
}
}
void PageConnection::bleScanDone(QVariantMap devs, bool done)
{
if (done) {
ui->bleScanButton->setEnabled(true);
}
ui->bleDevBox->clear();
for (auto d: devs.keys()) {
QString devName = devs.value(d).toString();
QString addr = d;
QString setName = mDieBieMS->getBleName(addr);
if (!setName.isEmpty()) {
QString name;
name += setName;
name += " [";
name += addr;
name += "]";
ui->bleDevBox->insertItem(0, name, addr);
} else if (devName.contains("VESC") || devName.contains("Metr Pro")) {
QString name;
name += devName;
name += " [";
name += addr;
name += "]";
ui->bleDevBox->insertItem(0, name, addr);
} else {
QString name;
name += devName;
name += " [";
name += addr;
name += "]";
ui->bleDevBox->addItem(name, addr);
}
}
ui->bleDevBox->setCurrentIndex(0);
}
void PageConnection::on_serialRefreshButton_clicked()
{
if (mDieBieMS) {
ui->serialPortBox->clear();
QList<VSerialInfo_t> ports = mDieBieMS->listSerialPorts();
foreach(const VSerialInfo_t &port, ports) {
ui->serialPortBox->addItem(port.name, port.systemPath);
}
ui->serialPortBox->setCurrentIndex(0);
}
}
void PageConnection::on_serialDisconnectButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->disconnectPort();
}
}
void PageConnection::on_serialConnectButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->connectSerial(ui->serialPortBox->currentData().toString(),
ui->serialBaudBox->value());
}
}
void PageConnection::on_tcpDisconnectButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->disconnectPort();
}
}
void PageConnection::on_tcpConnectButton_clicked()
{
if (mDieBieMS) {
QString tcpServer = ui->tcpServerEdit->text();
int tcpPort = ui->tcpPortBox->value();
mDieBieMS->connectTcp(tcpServer, tcpPort);
QSettings().setValue("tcp_server", tcpServer);
QSettings().setValue("tcp_port", tcpPort);
}
}
void PageConnection::on_canFwdBox_valueChanged(int arg1)
{
if (mDieBieMS) {
mDieBieMS->commands()->setCanSendId(arg1);
}
}
void PageConnection::on_helpButton_clicked()
{
if (mDieBieMS) {
HelpDialog::showHelp(this, mDieBieMS->infoConfig(), "help_can_forward");
}
}
void PageConnection::on_canFwdButton_toggled(bool checked)
{
if (mDieBieMS) {
mDieBieMS->commands()->setSendCan(checked);
}
}
void PageConnection::on_autoConnectButton_clicked()
{
Utility::autoconnectBlockingWithProgress(mDieBieMS, this);
}
void PageConnection::on_bleScanButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->bleDevice()->startScan();
ui->bleScanButton->setEnabled(false);
}
}
void PageConnection::on_bleDisconnectButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->disconnectPort();
}
}
void PageConnection::on_bleConnectButton_clicked()
{
if (mDieBieMS) {
if (ui->bleDevBox->count() > 0) {
QString bleAddr = ui->bleDevBox->currentData().toString();
mDieBieMS->connectBle(bleAddr);
QSettings().setValue("ble_addr", bleAddr);
}
}
}

75
pages/pageconnection.h Normal file
View File

@@ -0,0 +1,75 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGECONNECTION_H
#define PAGECONNECTION_H
#include <QWidget>
#include <QTimer>
#include "bmsinterface.h"
namespace Ui {
class PageConnection;
}
class PageConnection : public QWidget
{
Q_OBJECT
public:
explicit PageConnection(QWidget *parent = 0);
~PageConnection();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private slots:
void timerSlot();
void bleScanDone(QVariantMap devs, bool done);
void on_serialRefreshButton_clicked();
void on_serialDisconnectButton_clicked();
void on_serialConnectButton_clicked();
void on_tcpDisconnectButton_clicked();
void on_tcpConnectButton_clicked();
void on_canFwdBox_valueChanged(int arg1);
void on_helpButton_clicked();
void on_canFwdButton_toggled(bool checked);
void on_autoConnectButton_clicked();
void on_bleScanButton_clicked();
void on_bleDisconnectButton_clicked();
void on_bleConnectButton_clicked();
void valuesReceived(BMS_VALUES values);
void cellsReceived(int cellCount, QVector<double> cellVoltageArray);
private:
Ui::PageConnection *ui;
BMSInterface *mDieBieMS;
QTimer *mTimer;
};
#endif // PAGECONNECTION_H

628
pages/pageconnection.ui Normal file
View File

@@ -0,0 +1,628 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageConnection</class>
<widget class="QWidget" name="PageConnection">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabPosition">
<enum>QTabWidget::North</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabSerial">
<attribute name="title">
<string>(USB-)Serial</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayoutUSBSerial">
<item>
<widget class="QLabel" name="labelSerial">
<property name="text">
<string>Port</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="serialPortBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Serial port</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="serialBaudBox">
<property name="toolTip">
<string>Baudrate</string>
</property>
<property name="suffix">
<string> bps</string>
</property>
<property name="prefix">
<string>Baud: </string>
</property>
<property name="maximum">
<number>3000000</number>
</property>
<property name="value">
<number>115200</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="serialRefreshButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Refresh serial port list</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Refresh-96.png</normaloff>:/res/icons/Refresh-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="serialDisconnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Disconnect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Disconnected-96.png</normaloff>:/res/icons/Disconnected-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="serialConnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Connect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Connected-96.png</normaloff>:/res/icons/Connected-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacerSerial">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>322</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabCANConverter">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>(USB-)CAN</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<layout class="QHBoxLayout" name="horizontalLayoutUSBCAN">
<item>
<widget class="QLabel" name="CANSerialLabel">
<property name="text">
<string>Port</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="CANSerialPortBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Serial port</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="CANSerialRefreshButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Refresh serial port list</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Refresh-96.png</normaloff>:/res/icons/Refresh-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="CANSerialDisconnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Disconnect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Disconnected-96.png</normaloff>:/res/icons/Disconnected-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="CANSerialConnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Connect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Connected-96.png</normaloff>:/res/icons/Connected-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTableView" name="tableView"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayoutUSBCANNode">
<item>
<widget class="QPushButton" name="CANNodeRefreshButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Refresh CAN nodes list</string>
</property>
<property name="text">
<string>Scan bus</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Refresh-96.png</normaloff>:/res/icons/Refresh-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="CANNodeConnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Connect to CAN node</string>
</property>
<property name="text">
<string>Connect node</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Connected-96.png</normaloff>:/res/icons/Connected-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="CANNodeDisconnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Disconnect from CAN node</string>
</property>
<property name="text">
<string>Disconnect node</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Disconnected-96.png</normaloff>:/res/icons/Disconnected-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabTCP">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>TCP</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayoutTCP">
<item>
<widget class="QLabel" name="labelTCP">
<property name="text">
<string>TCP Server</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="tcpServerEdit">
<property name="text">
<string>127.0.0.1</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="tcpPortBox">
<property name="prefix">
<string>Port: </string>
</property>
<property name="maximum">
<number>65535</number>
</property>
<property name="value">
<number>65102</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="tcpDisconnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Disconnect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Disconnected-96.png</normaloff>:/res/icons/Disconnected-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="tcpConnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Connect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Connected-96.png</normaloff>:/res/icons/Connected-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacerTCP">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>273</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabBlueTooth">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Bluetooth LE</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayoutBLE">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>BLE Device</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="bleDevBox">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bleScanButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Refresh serial port list</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Refresh-96.png</normaloff>:/res/icons/Refresh-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bleDisconnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Disconnect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Disconnected-96.png</normaloff>:/res/icons/Disconnected-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="bleConnectButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Connect</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Connected-96.png</normaloff>:/res/icons/Connected-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacerBLE">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>186</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="RtDataText" name="rtText" native="true"/>
</item>
<item>
<widget class="RtDataText" name="rtCellsText" native="true"/>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>CAN Forward</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QSpinBox" name="canFwdBox">
<property name="prefix">
<string>ID: </string>
</property>
<property name="maximum">
<number>255</number>
</property>
<property name="value">
<number>10</number>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="helpButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Show help</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Help-96.png</normaloff>:/res/icons/Help-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="canFwdButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Forward communication over CAN-bus</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/can_off.png</normaloff>
<normalon>:/res/icons/can_on.png</normalon>:/res/icons/can_off.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QPushButton" name="autoConnectButton">
<property name="toolTip">
<string>Try to automatically connect using the USB connection</string>
</property>
<property name="text">
<string>Autoconnect</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Wizard-96.png</normaloff>:/res/icons/Wizard-96.png</iconset>
</property>
<property name="iconSize">
<size>
<width>45</width>
<height>45</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="statusLabel">
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>RtDataText</class>
<extends>QWidget</extends>
<header>widgets/rtdatatext.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections/>
</ui>

View File

@@ -0,0 +1,59 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagedataanalysis.h"
#include "ui_pagedataanalysis.h"
PageDataAnalysis::PageDataAnalysis(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageDataAnalysis)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
}
PageDataAnalysis::~PageDataAnalysis()
{
delete ui;
}
BMSInterface *PageDataAnalysis::bms() const
{
return mDieBieMS;
}
void PageDataAnalysis::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ConfigParam *p = mDieBieMS->infoConfig()->getParam("data_analysis_description");
if (p != 0) {
ui->textEdit->setHtml(p->description);
} else {
ui->textEdit->setText("Data Analysis Description not found.");
}
}
}

53
pages/pagedataanalysis.h Normal file
View File

@@ -0,0 +1,53 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEDATAANALYSIS_H
#define PAGEDATAANALYSIS_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageDataAnalysis;
}
class PageDataAnalysis : public QWidget
{
Q_OBJECT
public:
explicit PageDataAnalysis(QWidget *parent = 0);
~PageDataAnalysis();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageDataAnalysis *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEDATAANALYSIS_H

31
pages/pagedataanalysis.ui Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageDataAnalysis</class>
<widget class="QWidget" name="PageDataAnalysis">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="VTextBrowser" name="textEdit"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>VTextBrowser</class>
<extends>QTextEdit</extends>
<header>widgets/vtextbrowser.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

54
pages/pagedebugprint.cpp Normal file
View File

@@ -0,0 +1,54 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagedebugprint.h"
#include "ui_pagedebugprint.h"
#include <QDateTime>
// Static member initialization
PageDebugPrint *PageDebugPrint::currentMsgHandler = 0;
PageDebugPrint::PageDebugPrint(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageDebugPrint)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
currentMsgHandler = this;
}
PageDebugPrint::~PageDebugPrint()
{
delete ui;
}
void PageDebugPrint::printConsole(QString str)
{
ui->consoleBrowser->moveCursor(QTextCursor::End);
ui->consoleBrowser->insertHtml(QDateTime::currentDateTime().
toString("yyyy-MM-dd hh:mm:ss: ")
+ str);
ui->consoleBrowser->moveCursor(QTextCursor::End);
}

52
pages/pagedebugprint.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEDEBUGPRINT_H
#define PAGEDEBUGPRINT_H
#include <QWidget>
namespace Ui {
class PageDebugPrint;
}
class PageDebugPrint : public QWidget
{
Q_OBJECT
public:
explicit PageDebugPrint(QWidget *parent = 0);
~PageDebugPrint();
static PageDebugPrint* currentMsgHandler;
public slots:
void printConsole(QString str);
private:
Ui::PageDebugPrint *ui;
};
#endif // PAGEDEBUGPRINT_H

88
pages/pagedebugprint.ui Normal file
View File

@@ -0,0 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageDebugPrint</class>
<widget class="QWidget" name="PageDebugPrint">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="VTextBrowser" name="consoleBrowser">
<property name="font">
<font>
<family>DejaVu Sans Mono</family>
</font>
</property>
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QPushButton" name="clearButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>3</pointsize>
</font>
</property>
<property name="toolTip">
<string>Clear all text from console</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Delete-96.png</normaloff>:/res/icons/Delete-96.png</iconset>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>VTextBrowser</class>
<extends>QTextEdit</extends>
<header>widgets/vtextbrowser.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections/>
</ui>

368
pages/pagefirmware.cpp Normal file
View File

@@ -0,0 +1,368 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagefirmware.h"
#include "ui_pagefirmware.h"
#include "widgets/helpdialog.h"
#include "utility.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QDirIterator>
PageFirmware::PageFirmware(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageFirmware)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
ui->cancelButton->setEnabled(false);
mDieBieMS = 0;
updateHwList();
updateBlList();
connect(ui->hwList, SIGNAL(currentRowChanged(int)),
this, SLOT(updateFwList()));
connect(ui->showNonDefaultBox, SIGNAL(toggled(bool)),
this, SLOT(updateFwList()));
}
PageFirmware::~PageFirmware()
{
delete ui;
}
BMSInterface *PageFirmware::bms() const
{
return mDieBieMS;
}
void PageFirmware::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->display->setText(mDieBieMS->commands()->getFirmwareUploadStatus());
QStringList fws = mDieBieMS->getSupportedFirmwares();
QString str;
for (int i = 0;i < fws.size();i++) {
str.append(fws.at(i));
if (i < (fws.size() - 1)) {
str.append(", ");
}
}
ui->supportedLabel->setText(str);
connect(mDieBieMS, SIGNAL(fwUploadStatus(QString,double,bool)),
this, SLOT(fwUploadStatus(QString,double,bool)));
connect(mDieBieMS->commands(), SIGNAL(fwVersionReceived(int,int,QString,QByteArray)),
this, SLOT(fwVersionReceived(int,int,QString,QByteArray)));
}
}
void PageFirmware::fwUploadStatus(const QString &status, double progress, bool isOngoing)
{
if (isOngoing) {
ui->display->setText(tr("%1 (%2 %)").
arg(status).
arg(progress * 100, 0, 'f', 1));
} else {
ui->display->setText(status);
}
ui->display->setValue(progress * 100.0);
ui->uploadButton->setEnabled(!isOngoing);
ui->cancelButton->setEnabled(isOngoing);
}
void PageFirmware::fwVersionReceived(int major, int minor, QString hw, QByteArray uuid)
{
QString fwStr;
QString strUuid = Utility::uuid2Str(uuid, true);
if (!strUuid.isEmpty()) {
fwStr += ", UUID: " + strUuid;
}
if (major >= 0) {
fwStr.sprintf("Fw: %d.%d", major, minor);
if (!hw.isEmpty()) {
fwStr += ", Hw: " + hw;
}
if (!strUuid.isEmpty()) {
fwStr += "\n" + strUuid;
}
}
ui->currentLabel->setText(fwStr);
updateHwList(hw);
updateBlList(hw);
update();
}
void PageFirmware::updateHwList(QString hw)
{
ui->hwList->clear();
QDirIterator it("://res/firmwares");
while (it.hasNext()) {
QFileInfo fi(it.next());
QStringList names = fi.fileName().split("_o_");
if (fi.isDir() && (hw.isEmpty() || names.contains(hw, Qt::CaseInsensitive))) {
QListWidgetItem *item = new QListWidgetItem;
QString name = names.at(0);
for(int i = 1;i < names.size();i++) {
name += " & " + names.at(i);
}
item->setText(name);
item->setData(Qt::UserRole, fi.absoluteFilePath());
ui->hwList->insertItem(ui->hwList->count(), item);
}
}
if (ui->hwList->count() > 0) {
ui->hwList->setCurrentRow(0);
}
updateFwList();
}
void PageFirmware::updateFwList()
{
ui->fwList->clear();
QListWidgetItem *item = ui->hwList->currentItem();
if (item != 0) {
QString hw = item->data(Qt::UserRole).toString();
QDirIterator it(hw);
while (it.hasNext()) {
QFileInfo fi(it.next());
if (ui->showNonDefaultBox->isChecked() ||
fi.fileName().toLower() == "ennoid-bms.bin") {
QListWidgetItem *item = new QListWidgetItem;
item->setText(fi.fileName());
item->setData(Qt::UserRole, fi.absoluteFilePath());
ui->fwList->insertItem(ui->fwList->count(), item);
}
}
}
if (ui->fwList->count() > 0) {
ui->fwList->setCurrentRow(0);
}
}
void PageFirmware::updateBlList(QString hw)
{
ui->blList->clear();
QDirIterator it("://res/bootloaders");
while (it.hasNext()) {
QFileInfo fi(it.next());
QStringList names = fi.fileName().replace(".bin", "").split("_o_");
if (!fi.isDir() && (hw.isEmpty() || names.contains(hw, Qt::CaseInsensitive))) {
QListWidgetItem *item = new QListWidgetItem;
QString name = names.at(0);
for(int i = 1;i < names.size();i++) {
name += " & " + names.at(i);
}
item->setText(name);
item->setData(Qt::UserRole, fi.absoluteFilePath());
ui->blList->insertItem(ui->blList->count(), item);
}
}
if (ui->blList->count() == 0) {
QFileInfo generic("://res/bootloaders/generic.bin");
if (generic.exists()) {
QListWidgetItem *item = new QListWidgetItem;
item->setText("generic");
item->setData(Qt::UserRole, generic.absoluteFilePath());
ui->blList->insertItem(ui->blList->count(), item);
}
}
if (ui->blList->count() > 0) {
ui->blList->setCurrentRow(0);
}
}
void PageFirmware::on_chooseButton_clicked()
{
QString filename = QFileDialog::getOpenFileName(this,
tr("Choose Firmware File"), ".",
tr("Binary files (*.bin)"));
if (filename.isNull()) {
return;
}
ui->fwEdit->setText(filename);
}
void PageFirmware::on_uploadButton_clicked()
{
if (mDieBieMS) {
if (!mDieBieMS->isPortConnected()) {
QMessageBox::critical(this,
tr("Connection Error"),
tr("The ENNOID-BMS is not connected. Please connect it."));
return;
}
QFile file;
if (ui->fwTabWidget->currentIndex() == 0) {
QListWidgetItem *item = ui->fwList->currentItem();
if (item) {
file.setFileName(item->data(Qt::UserRole).toString());
} else {
if (ui->hwList->count() == 0) {
QMessageBox::warning(this,
tr("Upload Error"),
tr("This version of DieBie does not include any firmware "
"for your hardware version. You can either "
"upload a custom file or look for a later version of ENNOID-BMS "
"Tool that might support your hardware."));
} else {
QMessageBox::warning(this,
tr("Upload Error"),
tr("No firmware is selected."));
}
return;
}
} else if (ui->fwTabWidget->currentIndex() == 1) {
file.setFileName(ui->fwEdit->text());
QFileInfo fileInfo(file.fileName());
if (!(fileInfo.fileName().startsWith("ENNOID")) || !fileInfo.fileName().endsWith(".bin")) {
QMessageBox::critical(this,tr("Upload Error"),tr("The selected file name seems to be invalid."));
return;
}
} else {
QListWidgetItem *item = ui->blList->currentItem();
if (item) {
file.setFileName(item->data(Qt::UserRole).toString());
} else {
if (ui->blList->count() == 0) {
QMessageBox::warning(this,
tr("Upload Error"),
tr("This version of ENNOID-BMS does not include any bootloader "
"for your hardware version."));
} else {
QMessageBox::warning(this,
tr("Upload Error"),
tr("No bootloader is selected."));
}
return;
}
}
if (!file.open(QIODevice::ReadOnly)) {
QMessageBox::critical(this,
tr("Upload Error"),
tr("Could not open file. Make sure that the path is valid."));
return;
}
if (file.size() > 400000) {
QMessageBox::critical(this,
tr("Upload Error"),
tr("The selected file is too large to be a firmware."));
return;
}
QMessageBox::StandardButton reply;
bool isBootloader = false;
if (ui->fwTabWidget->currentIndex() == 0 && ui->hwList->count() == 1) {
reply = QMessageBox::warning(this,
tr("Warning"),
tr("Uploading new firmware will clear all settings on your ENNOID-BMS "
"and you have to do the configuration again. Do you want to "
"continue?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
} else if ((ui->fwTabWidget->currentIndex() == 0 && ui->hwList->count() > 1) || ui->fwTabWidget->currentIndex() == 1) {
reply = QMessageBox::warning(this,
tr("Warning"),
tr("Uploading firmware for the wrong hardware version "
"WILL damage the ENNOID-BMS for sure. Are you sure that you have "
"chosen the correct hardware version?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
} else if (ui->fwTabWidget->currentIndex() == 2) {
reply = QMessageBox::warning(this,
tr("Warning"),
tr("This will attempt to upload a bootloader to the connected ENNOID-BMS. "
"If the connected ENNOID-BMS already has a bootloader this will destroy "
"the bootloader and firmware updates cannot be done anymore. Do "
"you want to continue?"),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
isBootloader = true;
} else {
reply = QMessageBox::No;
}
if (reply == QMessageBox::Yes) {
QByteArray data = file.readAll();
mDieBieMS->commands()->startFirmwareUpload(data, isBootloader);
QMessageBox::warning(this,
tr("Warning"),
tr("The firmware upload is now ongoing. After the upload has finished you must wait at least "
"10 seconds before unplugging power. Otherwise the firmware will get corrupted and your "
"ENNOID-BMS will become bricked. If that happens you need a SWD programmer to recover it."));
}
}
}
void PageFirmware::on_readVersionButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->commands()->getFwVersion();
}
}
void PageFirmware::on_cancelButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->commands()->cancelFirmwareUpload();
}
}
void PageFirmware::on_changelogButton_clicked()
{
HelpDialog::showHelp(this, "Firmware Changelog", Utility::fwChangeLog());
}

66
pages/pagefirmware.h Normal file
View File

@@ -0,0 +1,66 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEFIRMWARE_H
#define PAGEFIRMWARE_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageFirmware;
}
class PageFirmware : public QWidget
{
Q_OBJECT
public:
explicit PageFirmware(QWidget *parent = 0);
~PageFirmware();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private slots:
void fwUploadStatus(const QString &status, double progress, bool isOngoing);
void fwVersionReceived(int major, int minor, QString hw, QByteArray uuid);
void updateHwList(QString hw = "");
void updateFwList();
void updateBlList(QString hw = "");
void on_chooseButton_clicked();
void on_uploadButton_clicked();
void on_readVersionButton_clicked();
void on_cancelButton_clicked();
void on_changelogButton_clicked();
private:
Ui::PageFirmware *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEFIRMWARE_H

308
pages/pagefirmware.ui Normal file
View File

@@ -0,0 +1,308 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageFirmware</class>
<widget class="QWidget" name="PageFirmware">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Install New Firmware</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTabWidget" name="fwTabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Included Files</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_7">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Hardware Version</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="hwList"/>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Firmware</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="fwList"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QCheckBox" name="showNonDefaultBox">
<property name="toolTip">
<string>Show firmwares with non-default compilation options</string>
</property>
<property name="text">
<string>Show non-default firmwares</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="changelogButton">
<property name="toolTip">
<string>Show firmware changelog</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/About-96.png</normaloff>:/res/icons/About-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Custom File</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLineEdit" name="fwEdit"/>
</item>
<item>
<widget class="QPushButton" name="chooseButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Choose file...</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Open Folder-96.png</normaloff>:/res/icons/Open Folder-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>249</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Bootloader</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QListWidget" name="blList"/>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="DisplayPercentage" name="display" native="true"/>
</item>
<item>
<widget class="QPushButton" name="cancelButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Cancel upload</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Cancel-96.png</normaloff>:/res/icons/Cancel-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="uploadButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Update firmware on the connected ENNOID-BMS</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Download-96.png</normaloff>:/res/icons/Download-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Firmware, hardware and UUID</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="currentLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="readVersionButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Read firmware version</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Upload-96.png</normaloff>:/res/icons/Upload-96.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Supported Firmwares</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="supportedLabel">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>DisplayPercentage</class>
<extends>QWidget</extends>
<header>widgets/displaypercentage.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections/>
</ui>

110
pages/pagemastercell.cpp Normal file
View File

@@ -0,0 +1,110 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagemastercell.h"
#include "ui_pagemastercell.h"
PageMasterCell::PageMasterCell(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageMasterCell)
{
ui->setupUi(this);
// remove disabled widgets
for (;;)
{
int i;
for(i=0; i!=ui->tabWidget->count(); ++i)
if ( ! ui->tabWidget->widget(i)->isEnabled() )
break;
if ( i==ui->tabWidget->count() ) // nothing was found
break; // exit
ui->tabWidget->removeTab(i);
}
mDieBieMS = 0;
}
PageMasterCell::~PageMasterCell()
{
delete ui;
}
BMSInterface *PageMasterCell::bms() const
{
return mDieBieMS;
}
void PageMasterCell::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->specificationsTab->addRowSeparator(tr("Pack configuration"));
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellMonitorICType");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellMonitorICCount");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "noOfParallelModules");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "noOfCellsSeries");
ui->specificationsTab->addRowSeparator(tr("SOC - Pack capacity"));
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "noOfCellsParallel");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "batteryCapacity");
ui->specificationsTab->addRowSeparator(tr("Cell specifications"));
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellTechnology");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellHardUnderVoltage");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellHardOverVoltage");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellLCSoftUnderVoltage");
// ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellHCSoftUnderVoltage");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "cellSoftOverVoltage");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "maxUnderAndOverVoltageErrorCount");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "hysteresisDischarge");
ui->specificationsTab->addParamRow(mDieBieMS->bmsConfig(), "hysteresisCharge");
ui->balancingTab->addRowSeparator(tr("Balancing configuration"));
ui->balancingTab->addParamRow(mDieBieMS->bmsConfig(), "cellBalanceStart");
ui->balancingTab->addParamRow(mDieBieMS->bmsConfig(), "cellBalanceDifferenceThreshold");
ui->balancingTab->addParamRow(mDieBieMS->bmsConfig(), "cellBalanceUpdateInterval");
ui->balancingTab->addParamRow(mDieBieMS->bmsConfig(), "cellBalanceAllTime");
// ui->balancingTab->addParamRow(mDieBieMS->bmsConfig(), "maxSimultaneousDischargingCells");
ui->throttlingTab->addRowSeparator(tr("Discharge"));
ui->throttlingTab->addParamRow(mDieBieMS->bmsConfig(), "cellThrottleLowerStart");
ui->throttlingTab->addParamRow(mDieBieMS->bmsConfig(), "cellThrottleLowerMargin");
ui->throttlingTab->addParamRow(mDieBieMS->bmsConfig(), "throttleDisChargeIncreaseRate");
ui->throttlingTab->addRowSeparator(tr("Charge"));
ui->throttlingTab->addParamRow(mDieBieMS->bmsConfig(), "cellThrottleUpperStart");
ui->throttlingTab->addParamRow(mDieBieMS->bmsConfig(), "cellThrottleUpperMargin");
ui->throttlingTab->addParamRow(mDieBieMS->bmsConfig(), "throttleChargeIncreaseRate");
ui->socTab->addRowSeparator(tr("SoC general"));
ui->socTab->addParamRow(mDieBieMS->bmsConfig(), "stateOfChargeMethod");
ui->socTab->addParamRow(mDieBieMS->bmsConfig(), "stateOfChargeStoreInterval");
ui->socTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutChargeCompleted");
ui->socTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutChargingCompletedMinimalMismatch");
ui->socTab->addParamRow(mDieBieMS->bmsConfig(), "maxMismatchThreshold");
}
}

52
pages/pagemastercell.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEMASTERCELL_H
#define PAGEMASTERCELL_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageMasterCell;
}
class PageMasterCell : public QWidget
{
Q_OBJECT
public:
explicit PageMasterCell(QWidget *parent = 0);
~PageMasterCell();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageMasterCell *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEMASTERCELL_H

81
pages/pagemastercell.ui Normal file
View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageMasterCell</class>
<widget class="QWidget" name="PageMasterCell">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="Specifications">
<attribute name="title">
<string>Specifications</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="specificationsTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Balancing">
<attribute name="title">
<string>Balancing</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="ParamTable" name="balancingTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Throttling">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Throttling</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="ParamTable" name="throttlingTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="SoC">
<attribute name="title">
<string>SoC</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="ParamTable" name="socTab"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,60 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagemasterdisplay.h"
#include "ui_pagemasterdisplay.h"
PageMasterDisplay::PageMasterDisplay(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageMasterDisplay)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageMasterDisplay::~PageMasterDisplay()
{
delete ui;
}
BMSInterface *PageMasterDisplay::bms() const
{
return mDieBieMS;
}
void PageMasterDisplay::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->durationsTab->addParamRow(mDieBieMS->bmsConfig(), "displayTimeoutBatteryDead");
ui->durationsTab->addParamRow(mDieBieMS->bmsConfig(), "displayTimeoutBatteryError");
ui->durationsTab->addParamRow(mDieBieMS->bmsConfig(), "displayTimeoutBatteryErrorPreCharge");
ui->durationsTab->addParamRow(mDieBieMS->bmsConfig(), "displayTimeoutSplashScreen");
ui->customTab->addRowSeparator(tr("Options"));
ui->customTab->addParamRow(mDieBieMS->bmsConfig(), "displayStyle");
}
}

52
pages/pagemasterdisplay.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEMASTERDISPLAY_H
#define PAGEMASTERDISPLAY_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageMasterDisplay;
}
class PageMasterDisplay : public QWidget
{
Q_OBJECT
public:
explicit PageMasterDisplay(QWidget *parent = 0);
~PageMasterDisplay();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageMasterDisplay *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEMASTERDISPLAY_H

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageMasterDisplay</class>
<widget class="QWidget" name="PageMasterDisplay">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="Durations">
<attribute name="title">
<string>Durations</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="durationsTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Custom">
<attribute name="title">
<string>Custom</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="ParamTable" name="customTab"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

119
pages/pagemastergeneral.cpp Normal file
View File

@@ -0,0 +1,119 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagemastergeneral.h"
#include "ui_pagemastergeneral.h"
PageMasterGeneral::PageMasterGeneral(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageMasterGeneral)
{
ui->setupUi(this);
// remove disabled widgets
for (;;)
{
int i;
for(i=0; i!=ui->tabWidget->count(); ++i)
if ( ! ui->tabWidget->widget(i)->isEnabled() )
break;
if ( i==ui->tabWidget->count() ) // nothing was found
break; // exit
ui->tabWidget->removeTab(i);
}
mDieBieMS = 0;
}
PageMasterGeneral::~PageMasterGeneral()
{
delete ui;
}
BMSInterface *PageMasterGeneral::bms() const
{
return mDieBieMS;
}
void PageMasterGeneral::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->powerStateTab->addRowSeparator(tr("Onstate"));
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "pulseToggleButton");
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "notUsedCurrentThreshold");
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "notUsedTimeout");
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "powerDownDelay");
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "allowForceOn");
ui->powerStateTab->addRowSeparator(tr("Jump to"));
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "extEnableState");
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "chargeEnableState");
ui->masterLimitsTab->addRowSeparator(tr("Current"));
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "maxAllowedCurrent");
ui->masterLimitsTab->addRowSeparator(tr("Temperature discharging"));
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBattDischargingMax");
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBattDischargingMin");
ui->masterLimitsTab->addRowSeparator(tr("Temperature charging"));
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBattChargingMax");
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBattChargingMin");
ui->masterLimitsTab->addRowSeparator(tr("Temperature cooling/heating"));
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBattCoolingMax");
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBattCoolingMin");
ui->masterLimitsTab->addRowSeparator(tr("Temperature Master board"));
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBMSMax");
ui->masterLimitsTab->addParamRow(mDieBieMS->bmsConfig(), "allowedTempBMSMin");
ui->canTab->addRowSeparator(tr("CAN Configuration"));
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "CANID");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "CANIDStyle");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "CANBaudRate");
ui->canTab->addRowSeparator(tr("CAN Messaging"));
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "emitStatusOverCAN");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "emitStatusProtocolType");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "useCANSafetyInput");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "useCANDelayedPowerDown");
ui->masterSensorsTab->addRowSeparator(tr("NTC specifications battery"));
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "tempEnableMaskBattery");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "noOfTempSensorPerModule");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCLTC25Deg");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCLTCBeta");
ui->masterSensorsTab->addRowSeparator(tr("NTC specifications expansion Board"));
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "tempEnableMaskExpansion");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "noOfExpansionBoard");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "noOfTempSensorPerExpansionBoard");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCEXP25Deg");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCEXPBeta");
ui->masterSensorsTab->addRowSeparator(tr("NTC advanced settings"));
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "maxUnderAndOverTemperatureErrorCount");
ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "humidityICType");
// ui->masterSensorsTab->addRowSeparator(tr("Water detect enable mask"));
// ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "waterSensorEnableMask");
// ui->masterSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "waterSensorThreshold");
}
}

52
pages/pagemastergeneral.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEMASTERGENERAL_H
#define PAGEMASTERGENERAL_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageMasterGeneral;
}
class PageMasterGeneral : public QWidget
{
Q_OBJECT
public:
explicit PageMasterGeneral(QWidget *parent = 0);
~PageMasterGeneral();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageMasterGeneral *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEMASTERGENERAL_H

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageMasterGeneral</class>
<widget class="QWidget" name="PageMasterGeneral">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="PowerState">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>PowerState</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="powerStateTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Limits">
<attribute name="title">
<string>Limits</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="ParamTable" name="masterLimitsTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="CAN">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>CAN</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="ParamTable" name="canTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="TemperatureSensors">
<attribute name="title">
<string>Sensors</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="ParamTable" name="masterSensorsTab"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,118 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagemastersettings.h"
#include "ui_pagemastersettings.h"
PageMasterSettings::PageMasterSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageMasterSettings)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
}
PageMasterSettings::~PageMasterSettings()
{
delete ui;
}
BMSInterface *PageMasterSettings::bms() const
{
return mDieBieMS;
}
void PageMasterSettings::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
#if 0
ConfigParam *p = mDieBieMS->infoConfig()->getParam("master_setting_description");
if (p != 0) {
ui->textEdit->setHtml(p->description);
} else {
ui->textEdit->setText("Master Setting Description not found.");
}
#endif
ConfigParams *const conf = mDieBieMS->bmsConfig();
ParamTable *const pt = ui->masterStateTab;
pt->addRowSeparator(tr("Current"));
pt->addParamRow(conf, "shuntLCFactor");
pt->addParamRow(conf, "shuntOffset");
pt->addRowSeparator(tr("Pack configuration"));
#if 0 // disable
pt->addParamRow(conf, "cellMonitorICType");
#endif
pt->addParamRow(conf, "cellMonitorICCount");
pt->addParamRow(conf, "noOfParallelModules");
pt->addParamRow(conf, "noOfCellsSeries");
pt->addRowSeparator(tr("SOC - Pack capacity"));
pt->addParamRow(conf, "noOfCellsParallel");
pt->addParamRow(conf, "batteryCapacity");
pt->addRowSeparator(tr("Cell specifications"));
pt->addParamRow(conf, "cellHardUnderVoltage");
pt->addParamRow(conf, "cellHardOverVoltage");
pt->addParamRow(conf, "cellLCSoftUnderVoltage");
pt->addParamRow(conf, "cellSoftOverVoltage");
pt->addRowSeparator(tr("Balancing configuration"));
pt->addParamRow(conf, "cellBalanceStart");
pt->addParamRow(conf, "cellBalanceDifferenceThreshold");
pt->addParamRow(conf, "cellBalanceUpdateInterval");
pt->addRowSeparator(tr("SoC general"));
#if 0 // disable
pt->addParamRow(conf, "stateOfChargeStoreInterval");
pt->addParamRow(conf, "timeoutChargeCompleted");
pt->addParamRow(conf, "timeoutChargingCompletedMinimalMismatch");
#endif
pt->addParamRow(conf, "minimalPrechargePercentage"); // from pagemastersettings.cpp
pt->addParamRow(conf, "timeoutLCPreCharge"); // from pagemastersettings.cpp
pt->addRowSeparator(tr("Limits"));
pt->addParamRow(conf, "maxMismatchThreshold");
pt->addParamRow(conf, "maxAllowedCurrent");
#if 0
pt->addParamRow(conf, "allowedTempBattDischargingMax");
pt->addParamRow(conf, "allowedTempBattDischargingMin");
#endif
pt->addParamRow(conf, "allowedTempBattChargingMax");
pt->addParamRow(conf, "allowedTempBattChargingMin");
#if 0 // disable
pt->addRowSeparator(tr("NTC specifications battery"));
pt->addParamRow(mDieBieMS->bmsConfig(), "noOfTempSensorPerModule");
pt->addParamRow(mDieBieMS->bmsConfig(), "NTCLTC25Deg");
pt->addRowSeparator(tr("NTC specifications expansion Board"));
pt->addParamRow(mDieBieMS->bmsConfig(), "noOfExpansionBoard");
pt->addParamRow(mDieBieMS->bmsConfig(), "noOfTempSensorPerExpansionBoard");
#endif
}
}

View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEMASTERSETTINGS_H
#define PAGEMASTERSETTINGS_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageMasterSettings;
}
class PageMasterSettings : public QWidget
{
Q_OBJECT
public:
explicit PageMasterSettings(QWidget *parent = 0);
~PageMasterSettings();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageMasterSettings *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEMASTERSETTINGS_H

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageMasterSettings</class>
<widget class="QWidget" name="PageMasterSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="ParamTable" name="masterStateTab"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,75 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagemastersignals.h"
#include "ui_pagemastersignals.h"
PageMasterSignals::PageMasterSignals(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageMasterSignals)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageMasterSignals::~PageMasterSignals()
{
delete ui;
}
BMSInterface *PageMasterSignals::bms() const
{
return mDieBieMS;
}
void PageMasterSignals::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->signalsTab->addRowSeparator(tr("Discharge Current"));
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "shuntLCFactor");
ui->signalsTab->addRowSeparator(tr("Pack voltage"));
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "voltageLCFactor");
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "voltageLCOffset");
ui->signalsTab->addRowSeparator(tr("Load voltage"));
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "loadVoltageFactor");
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "loadVoltageOffset");
ui->signalsTab->addRowSeparator(tr("Charger voltage"));
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "chargerVoltageFactor");
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "chargerVoltageOffset");
// ui->signalsTab->addRowSeparator(tr("High current path"));
// ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "HCLoadVoltageDataSource");
// ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "HCLoadCurrentDataSource");
// ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "shuntHCFactor");
// ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "shuntHCOffset");
ui->signalsTab->addRowSeparator(tr("Data source"));
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "packVoltageDataSource");
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "packCurrentDataSource");
ui->signalsTab->addRowSeparator(tr("Buzzer control"));
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "buzzerSignalSource");
ui->signalsTab->addParamRow(mDieBieMS->bmsConfig(), "buzzerPersistent");
}
}

52
pages/pagemastersignals.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEMASTERSIGNALS_H
#define PAGEMASTERSIGNALS_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageMasterSignals;
}
class PageMasterSignals : public QWidget
{
Q_OBJECT
public:
explicit PageMasterSignals(QWidget *parent = 0);
~PageMasterSignals();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageMasterSignals *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEMASTERSIGNALS_H

View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageMasterSignals</class>
<widget class="QWidget" name="PageMasterSignals">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="Signals">
<attribute name="title">
<string>Signals</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="signalsTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Conditions">
<attribute name="title">
<string>Conditions</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="ParamTable" name="conditionsTab"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,67 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagemasterswitch.h"
#include "ui_pagemasterswitch.h"
PageMasterSwitch::PageMasterSwitch(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageMasterSwitch)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageMasterSwitch::~PageMasterSwitch()
{
delete ui;
}
BMSInterface *PageMasterSwitch::bms() const
{
return mDieBieMS;
}
void PageMasterSwitch::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->dischargeTab->addRowSeparator(tr("Current output switch"));
ui->dischargeTab->addParamRow(mDieBieMS->bmsConfig(), "LCUseDischarge");
ui->dischargeTab->addParamRow(mDieBieMS->bmsConfig(), "LCUsePrecharge");
#if 0 /* moved to general settings page */
ui->dischargeTab->addParamRow(mDieBieMS->bmsConfig(), "minimalPrechargePercentage");
ui->dischargeTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutLCPreCharge");
#endif
ui->dischargeTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutDischargeRetry");
ui->chargeTab->addRowSeparator(tr("General charger switch"));
ui->chargeTab->addParamRow(mDieBieMS->bmsConfig(), "chargerEnabledThreshold");
ui->chargeTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutChargerDisconnected");
ui->chargeTab->addParamRow(mDieBieMS->bmsConfig(), "allowChargingDuringDischarge");
ui->chargeTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutChargeRetry");
}
}

52
pages/pagemasterswitch.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEMASTERSWITCH_H
#define PAGEMASTERSWITCH_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageMasterSwitch;
}
class PageMasterSwitch : public QWidget
{
Q_OBJECT
public:
explicit PageMasterSwitch(QWidget *parent = 0);
~PageMasterSwitch();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageMasterSwitch *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEMASTERSWITCH_H

58
pages/pagemasterswitch.ui Normal file
View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageMasterSwitch</class>
<widget class="QWidget" name="PageMasterSwitch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="Discharge">
<attribute name="title">
<string>Discharge</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="dischargeTab"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="Charge">
<attribute name="title">
<string>Charge</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="ParamTable" name="chargeTab"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

584
pages/pagertdata.cpp Normal file
View File

@@ -0,0 +1,584 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagertdata.h"
PageRtData::PageRtData(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageRtData)
{
ui->setupUi(this);
// remove disabled widgets
for (;;)
{
int i;
for(i=0; i!=ui->tabWidget->count(); ++i)
if ( ! ui->tabWidget->widget(i)->isEnabled() )
break;
if ( i==ui->tabWidget->count() ) // nothing was found
break; // exit
ui->tabWidget->removeTab(i);
}
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
mTimer = new QTimer(this);
mTimer->start(20);
mSecondCounter = 0.0;
mLastUpdateTime = 0;
mUpdateValPlot = false;
ui->ivLCGraph->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
ui->cellGraph->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
ui->cellLimitsGraph->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
ui->tempGraph->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
// LC IVGraph
int graphIndex = 0;
ui->ivLCGraph->addGraph();
ui->ivLCGraph->graph(graphIndex)->setPen(QPen(Qt::red));
ui->ivLCGraph->graph(graphIndex)->setName("Pack Voltage");
graphIndex++;
ui->ivLCGraph->addGraph();
ui->ivLCGraph->graph(graphIndex)->setPen(QPen(Qt::darkGreen));
ui->ivLCGraph->graph(graphIndex)->setName("Load Voltage");
graphIndex++;
ui->ivLCGraph->addGraph(ui->ivLCGraph->xAxis, ui->ivLCGraph->yAxis2);
ui->ivLCGraph->graph(graphIndex)->setPen(QPen(Qt::green));
ui->ivLCGraph->graph(graphIndex)->setName("Current");
graphIndex++;
/* HC IVGraph
graphIndex = 0;
ui->ivHCGraph->addGraph();
ui->ivHCGraph->graph(graphIndex)->setPen(QPen(Qt::blue));
ui->ivHCGraph->graph(graphIndex)->setName("HC Voltage");
graphIndex++;
ui->ivHCGraph->addGraph(ui->ivHCGraph->xAxis, ui->ivHCGraph->yAxis2);
ui->ivHCGraph->graph(graphIndex)->setPen(QPen(Qt::magenta));
ui->ivHCGraph->graph(graphIndex)->setName("HC Current");
graphIndex++;
*/
// Cell voltage graph
#if 0
graphIndex = 0;
ui->cellGraph->addGraph();
ui->cellGraph->graph(graphIndex)->setPen(QPen(Qt::green));
ui->cellGraph->graph(graphIndex)->setName("Cell high");
graphIndex++;
ui->cellGraph->addGraph();
ui->cellGraph->graph(graphIndex)->setPen(QPen(Qt::blue));
ui->cellGraph->graph(graphIndex)->setName("Cell average");
graphIndex++;
ui->cellGraph->addGraph();
ui->cellGraph->graph(graphIndex)->setPen(QPen(Qt::red));
ui->cellGraph->graph(graphIndex)->setName("Cell low");
graphIndex++;
#endif
// For cellGraph use configuration similar to
// ui->cellBarGraph, i.e. hard coded 12 cells & 2.5-4.5volts
const enum Qt::GlobalColor colors[12]={
Qt::black, Qt::blue, Qt::red, Qt::green, Qt::cyan, Qt::magenta,
Qt::darkGray, Qt::darkBlue, Qt::darkRed, Qt::darkGreen, Qt::darkCyan, Qt::darkMagenta
};
for(int i=0; i!=12; ++i)
{
QCPGraph *const pg = ui->cellGraph->addGraph();
pg->setPen(QPen( colors[i] ));
pg->setName(QString(tr("Cell ")+QString::number(i)));
}
// Temperature graph
graphIndex = 0;
ui->tempGraph->addGraph();
ui->tempGraph->graph(graphIndex)->setPen(QPen(Qt::blue));
ui->tempGraph->graph(graphIndex)->setName("BMS high");
graphIndex++;
ui->tempGraph->addGraph();
ui->tempGraph->graph(graphIndex)->setPen(QPen(Qt::darkBlue));
ui->tempGraph->graph(graphIndex)->setName("BMS Average");
graphIndex++;
ui->tempGraph->addGraph();
ui->tempGraph->graph(graphIndex)->setPen(QPen(Qt::darkYellow));
ui->tempGraph->graph(graphIndex)->setName("BMS Low");
graphIndex++;
ui->tempGraph->addGraph();
ui->tempGraph->graph(graphIndex)->setPen(QPen(Qt::green));
ui->tempGraph->graph(graphIndex)->setName("Battery high");
graphIndex++;
ui->tempGraph->addGraph();
ui->tempGraph->graph(graphIndex)->setPen(QPen(Qt::darkGreen));
ui->tempGraph->graph(graphIndex)->setName("Battery Average");
graphIndex++;
ui->tempGraph->addGraph();
ui->tempGraph->graph(graphIndex)->setPen(QPen(Qt::darkRed));
ui->tempGraph->graph(graphIndex)->setName("Battery Low");
graphIndex++;
QFont legendFont = font();
legendFont.setPointSize(9);
//LC Graph
ui->ivLCGraph->legend->setVisible(true);
ui->ivLCGraph->legend->setFont(legendFont);
ui->ivLCGraph->axisRect()->insetLayout()->setInsetAlignment(0, Qt::AlignRight|Qt::AlignBottom);
ui->ivLCGraph->legend->setBrush(QBrush(QColor(255,255,255,230)));
ui->ivLCGraph->xAxis->setLabel("Seconds (s)");
ui->ivLCGraph->yAxis->setLabel("Voltage (V)");
ui->ivLCGraph->yAxis2->setLabel("Current (A)");
ui->ivLCGraph->yAxis->setRange(0, 60);
ui->ivLCGraph->yAxis2->setRange(-5, 5);
ui->ivLCGraph->yAxis2->setVisible(true);
//Cell voltage Graph
ui->cellGraph->legend->setVisible(true);
ui->cellGraph->legend->setFont(legendFont);
ui->cellGraph->axisRect()->insetLayout()->setInsetAlignment(0, Qt::AlignRight|Qt::AlignBottom);
ui->cellGraph->legend->setBrush(QBrush(QColor(255,255,255,230)));
ui->cellGraph->xAxis->setLabel("Seconds (s)");
ui->cellGraph->yAxis->setLabel("Voltage (V)");
ui->cellGraph->yAxis->setRange(0, 4.2);
//Temperature Graph
ui->tempGraph->legend->setVisible(true);
ui->tempGraph->legend->setFont(legendFont);
ui->tempGraph->axisRect()->insetLayout()->setInsetAlignment(0, Qt::AlignRight|Qt::AlignBottom);
ui->tempGraph->legend->setBrush(QBrush(QColor(255,255,255,230)));
ui->tempGraph->xAxis->setLabel("Seconds (s)");
ui->tempGraph->yAxis->setLabel("Temperature (\u00B0C)");
ui->tempGraph->yAxis->setRange(0, 60);
// Cell bar graph
group = new QCPBarsGroup(ui->cellBarGraph);
barsNormal = new QCPBars(ui->cellBarGraph->xAxis, ui->cellBarGraph->yAxis);
barsBalance = new QCPBars(ui->cellBarGraph->xAxis, ui->cellBarGraph->yAxis);
barsNormal->setBrush(QColor(0, 255, 0, 50));
barsNormal->setPen(QColor(0, 211, 56));
barsNormal->setWidth(0.9);
barsNormal->setBarsGroup(group);
barsBalance->setBrush(QColor(0, 0, 255, 50));
barsBalance->setPen(QColor(0, 211, 56));
barsBalance->setWidth(0.9);
barsBalance->setBarsGroup(group);
barsBalance->moveAbove(barsNormal);
ui->cellBarGraph->xAxis->setRange(1, 12);
ui->cellBarGraph->yAxis->setRange(2.5, 4.15);
ui->cellBarGraph->yAxis->setLabel("Voltage (V)");
ui->cellBarGraph->xAxis->setTickLabelRotation(85);
ui->cellBarGraph->xAxis->setSubTicks(false);
ui->cellBarGraph->xAxis->setTickLength(0, 5);
// Aux bar graph
group2 = new QCPBarsGroup(ui->auxBarGraph);
barsTemperature = new QCPBars(ui->auxBarGraph->xAxis, ui->auxBarGraph->yAxis);
barsTemperature->setBrush(QColor(0, 255, 0, 50));
barsTemperature->setPen(QColor(0, 211, 56));
barsTemperature->setWidth(0.9);
barsTemperature->setBarsGroup(group2);
ui->auxBarGraph->xAxis->setRange(1, 9);
ui->auxBarGraph->yAxis->setRange(-40, 75);
ui->auxBarGraph->yAxis->setLabel("Temperature (°C)");
ui->auxBarGraph->xAxis->setTickLabelRotation(85);
ui->auxBarGraph->xAxis->setSubTicks(false);
ui->auxBarGraph->xAxis->setTickLength(0, 5);
// Expansion bar graph
group3 = new QCPBarsGroup(ui->expBarGraph);
ExpBarsTemperature = new QCPBars(ui->expBarGraph->xAxis, ui->expBarGraph->yAxis);
ExpBarsTemperature->setBrush(QColor(0, 255, 0, 50));
ExpBarsTemperature->setPen(QColor(0, 211, 56));
ExpBarsTemperature->setWidth(0.9);
ExpBarsTemperature->setBarsGroup(group3);
ui->expBarGraph->xAxis->setRange(1, 8);
ui->expBarGraph->yAxis->setRange(-40, 75);
ui->expBarGraph->yAxis->setLabel("Temperature (°C)");
ui->expBarGraph->xAxis->setTickLabelRotation(85);
ui->expBarGraph->xAxis->setSubTicks(false);
ui->expBarGraph->xAxis->setTickLength(0, 5);
// cell limits graph
{
auto *widget = ui->cellLimitsGraph;
widget->legend->setVisible(true);
widget->legend->setFont(legendFont);
widget->axisRect()->insetLayout()->setInsetAlignment(0, Qt::AlignRight|Qt::AlignBottom);
widget->legend->setBrush(QBrush(QColor(255,255,255,230)));
widget->xAxis->setLabel("Seconds (s)");
widget->yAxis->setLabel("Voltage (V)");
widget->yAxis->setRange(0, 5.0);
widget->addGraph();
widget->graph(0)->setPen(QPen(Qt::green));
widget->graph(0)->setName("Cell high");
widget->addGraph();
widget->graph(1)->setPen(QPen(Qt::blue));
widget->graph(1)->setName("Cell average");
widget->addGraph();
widget->graph(2)->setPen(QPen(Qt::red));
widget->graph(2)->setName("Cell low");
}
connect(mTimer, SIGNAL(timeout()),this, SLOT(timerSlot()));
}
PageRtData::~PageRtData()
{
delete ui;
}
BMSInterface *PageRtData::bms() const
{
return mDieBieMS;
}
void PageRtData::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
connect(mDieBieMS->commands(), SIGNAL(valuesReceived(BMS_VALUES)),this, SLOT(valuesReceived(BMS_VALUES)));
connect(mDieBieMS->commands(), SIGNAL(cellsReceived(int,QVector<double>)),this, SLOT(cellsReceived(int,QVector<double>)));
connect(mDieBieMS->commands(), SIGNAL(auxReceived(int,QVector<double>)),this, SLOT(auxReceived(int,QVector<double>)));
connect(mDieBieMS->commands(), SIGNAL(expTempReceived(int,QVector<double>)),this, SLOT(expTempReceived(int,QVector<double>)));
}
}
void PageRtData::timerSlot()
{
if (mUpdateValPlot) {
int dataSize = mPackVoltage.size();
QVector<double> xAxis(dataSize);
for (int i = 0;i < mSeconds.size();i++) {
xAxis[i] = mSeconds[i];
}
// Current and duty-plot
int graphIndex = 0;
ui->ivLCGraph->graph(graphIndex++)->setData(xAxis, mPackVoltage);
ui->ivLCGraph->graph(graphIndex++)->setData(xAxis, mLCLoadVoltage);
ui->ivLCGraph->graph(graphIndex++)->setData(xAxis, mLCLoadCurrent);
#if 0
graphIndex = 0;
ui->cellGraph->graph(graphIndex++)->setData(xAxis, mCellVHigh);
ui->cellGraph->graph(graphIndex++)->setData(xAxis, mCellVAverage);
ui->cellGraph->graph(graphIndex++)->setData(xAxis, mCellVLow);
#endif
graphIndex = 0;
ui->cellLimitsGraph->graph(graphIndex++)->setData(xAxis, mCellVHigh);
ui->cellLimitsGraph->graph(graphIndex++)->setData(xAxis, mCellVAverage);
ui->cellLimitsGraph->graph(graphIndex++)->setData(xAxis, mCellVLow);
graphIndex = 0;
ui->tempGraph->graph(graphIndex++)->setData(xAxis, mTempBMSHigh);
ui->tempGraph->graph(graphIndex++)->setData(xAxis, mTempBMSAverage);
ui->tempGraph->graph(graphIndex++)->setData(xAxis, mTempBMSLow);
ui->tempGraph->graph(graphIndex++)->setData(xAxis, mTempBattHigh);
ui->tempGraph->graph(graphIndex++)->setData(xAxis, mTempBattAverage);
ui->tempGraph->graph(graphIndex++)->setData(xAxis, mTempBattLow);
if (ui->autoscaleButton->isChecked()) {
ui->ivLCGraph->rescaleAxes();
#if 0 // do not autoscale since we're displaying cell voltages
ui->cellGraph->rescaleAxes();
#endif
// only scale X axis
ui->cellGraph->xAxis->rescale();
ui->cellLimitsGraph->xAxis->rescale();
ui->tempGraph->rescaleAxes();
}
ui->ivLCGraph->replot();
ui->cellGraph->replot();
ui->cellLimitsGraph->replot();
ui->tempGraph->replot();
ui->cellBarGraph->replot();
ui->auxBarGraph->replot();
ui->expBarGraph->replot();
mUpdateValPlot = false;
}
}
void PageRtData::valuesReceived(BMS_VALUES values)
{
ui->rtText->setValues(values);
const int maxS = 500;
appendDoubleAndTrunc(&mPackVoltage, values.packVoltage, maxS);
appendDoubleAndTrunc(&mLCLoadVoltage, values.loadLCVoltage, maxS);
appendDoubleAndTrunc(&mLCLoadCurrent, values.loadLCCurrent, maxS);
appendDoubleAndTrunc(&mHCLoadVoltage, values.loadHCVoltage, maxS);
appendDoubleAndTrunc(&mHCLoadCurrent, values.loadHCCurrent, maxS);
appendDoubleAndTrunc(&mChargerVoltage, values.chargerVoltage, maxS);
appendDoubleAndTrunc(&mAuxVoltage, values.auxVoltage, maxS);
appendDoubleAndTrunc(&mAuxCurrent, values.auxCurrent, maxS);
appendDoubleAndTrunc(&mCellVHigh, values.cVHigh, maxS);
appendDoubleAndTrunc(&mCellVAverage, values.cVAverage, maxS);
appendDoubleAndTrunc(&mCellVLow, values.cVLow, maxS);
appendDoubleAndTrunc(&mTempBMSHigh, values.tempBMSHigh, maxS);
appendDoubleAndTrunc(&mTempBMSAverage, values.tempBMSAverage, maxS);
appendDoubleAndTrunc(&mTempBMSLow, values.tempBMSLow, maxS);
appendDoubleAndTrunc(&mTempBattHigh, values.tempBattHigh, maxS);
appendDoubleAndTrunc(&mTempBattAverage, values.tempBattAverage, maxS);
appendDoubleAndTrunc(&mTempBattLow, values.tempBattLow, maxS);
appendDoubleAndTrunc(&mHumidity, values.humidity, maxS);
qint64 tNow = QDateTime::currentMSecsSinceEpoch();
double elapsed = (double)(tNow - mLastUpdateTime) / 1000.0;
if (elapsed > 1.0) {
elapsed = 1.0;
}
mSecondCounter += elapsed;
appendDoubleAndTrunc(&mSeconds, mSecondCounter, maxS);
mLastUpdateTime = tNow;
mUpdateValPlot = true;
}
void PageRtData::cellsReceived(int cellCount, QVector<double> cellVoltageArray){
QVector<double> dataxNew;
dataxNew.clear();
QVector<double> datayNormal;
datayNormal.clear();
QVector<double> datayBalance;
datayBalance.clear();
QVector<QString> labels;
int indexPointer;
double cellHardUnder = mDieBieMS->bmsConfig()->getParamDouble("cellHardUnderVoltage");
double cellHardOver = mDieBieMS->bmsConfig()->getParamDouble("cellHardOverVoltage");
for(indexPointer = 0; indexPointer < cellCount; indexPointer++){
dataxNew.append(indexPointer + 1);
if(cellVoltageArray[indexPointer] < 0.0){
datayNormal.append(0.0);
datayBalance.append(fabs(cellVoltageArray[indexPointer]));
}else{
datayNormal.append(fabs(cellVoltageArray[indexPointer]));
datayBalance.append(0.0);
}
QString voltageString = QStringLiteral("%1V (C").arg(fabs(cellVoltageArray[indexPointer]), 0, 'f',3);
labels.append(voltageString + QString::number(indexPointer+1) + ")");
}
QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
textTicker->addTicks(dataxNew, labels);
int idx = 0;
double plotx = mSeconds.empty() ? 0 : mSeconds.last();
for(auto v : cellVoltageArray)
{
if ( auto *pg = ui->cellGraph->graph(idx) )
{
auto ploty = fabs(v);
pg->addData(plotx, ploty);
}
++idx;
}
ui->cellBarGraph->xAxis->setTicker(textTicker);
ui->cellBarGraph->xAxis->setRange(0.5, indexPointer + 0.5);
ui->cellBarGraph->yAxis->setRange(cellHardUnder, cellHardOver);
barsNormal->setData(dataxNew, datayNormal);
barsBalance->setData(dataxNew, datayBalance);
}
void PageRtData::auxReceived(int auxCount, QVector<double> auxVoltageArray){
QVector<double> dataxNew;
dataxNew.clear();
QVector<double> datayNormal;
datayNormal.clear();
QVector<QString> labels;
int indexPointer;
for(indexPointer = 0; indexPointer < auxCount; indexPointer++){
dataxNew.append(indexPointer + 1);
if(auxVoltageArray[indexPointer] < -50.0){
datayNormal.append(0.0);
}else{
datayNormal.append(auxVoltageArray[indexPointer]);
}
QString voltageString = QStringLiteral("%1°C (TH").arg(auxVoltageArray[indexPointer], 0, 'f',3);
labels.append(voltageString + QString::number(indexPointer+1) + ")");
}
QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
textTicker->addTicks(dataxNew, labels);
ui->auxBarGraph->xAxis->setTicker(textTicker);
ui->auxBarGraph->xAxis->setRange(0.5, indexPointer + 0.5);
ui->auxBarGraph->yAxis->setRange(-40, 75);
barsTemperature->setData(dataxNew, datayNormal);
}
void PageRtData::expTempReceived(int expTempCount, QVector<double> expTempVoltageArray){
QVector<double> dataxNew;
dataxNew.clear();
QVector<double> datayNormal;
datayNormal.clear();
QVector<QString> labels;
int indexPointer;
for(indexPointer = 0; indexPointer < expTempCount; indexPointer++){
dataxNew.append(indexPointer + 1);
if(expTempVoltageArray[indexPointer] < -50.0){
datayNormal.append(0.0);
}else{
datayNormal.append(expTempVoltageArray[indexPointer]);
}
QString voltageString = QStringLiteral("%1°C (T").arg(expTempVoltageArray[indexPointer], 0, 'f',3);
labels.append(voltageString + QString::number(indexPointer) + ")");
}
QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
textTicker->addTicks(dataxNew, labels);
ui->expBarGraph->xAxis->setTicker(textTicker);
ui->expBarGraph->xAxis->setRange(0.5, indexPointer + 0.5);
ui->expBarGraph->yAxis->setRange(-40, 75);
ExpBarsTemperature->setData(dataxNew, datayNormal);
}
void PageRtData::appendDoubleAndTrunc(QVector<double> *vec, double num, int maxSize)
{
vec->append(num);
if(vec->size() > maxSize) {
vec->remove(0, vec->size() - maxSize);
}
}
void PageRtData::updateZoom()
{
Qt::Orientations plotOrientations = (Qt::Orientations)
((ui->zoomHButton->isChecked() ? Qt::Horizontal : 0) |
(ui->zoomVButton->isChecked() ? Qt::Vertical : 0));
ui->ivLCGraph->axisRect()->setRangeZoom(plotOrientations);
ui->cellGraph->axisRect()->setRangeZoom(plotOrientations);
ui->cellLimitsGraph->axisRect()->setRangeZoom(plotOrientations);
ui->tempGraph->axisRect()->setRangeZoom(plotOrientations);
}
void PageRtData::on_zoomHButton_toggled(bool checked)
{
(void)checked;
updateZoom();
}
void PageRtData::on_zoomVButton_toggled(bool checked)
{
(void)checked;
updateZoom();
}
void PageRtData::on_rescaleButton_clicked()
{
ui->ivLCGraph->rescaleAxes();
ui->cellGraph->rescaleAxes();
ui->cellLimitsGraph->rescaleAxes();
ui->tempGraph->rescaleAxes();
ui->ivLCGraph->replot();
ui->cellGraph->replot();
ui->cellLimitsGraph->replot();
ui->tempGraph->replot();
}
void PageRtData::on_tempShowBMSBox_toggled(bool checked)
{
ui->tempGraph->graph(0)->setVisible(checked);
ui->tempGraph->graph(1)->setVisible(checked);
}
void PageRtData::on_tempShowBatteryBox_toggled(bool checked)
{
ui->tempGraph->graph(2)->setVisible(checked);
ui->tempGraph->graph(3)->setVisible(checked);
}
/*
void PageRtData::on_csvChooseDirButton_clicked()
{
ui->csvFileEdit->setText(QFileDialog::getExistingDirectory(this,
"Choose CSV output directory"));
}
void PageRtData::on_csvEnableLogBox_clicked(bool checked)
{
if (checked) {
if (mDieBieMS) {
mDieBieMS->openRtLogFile(ui->csvFileEdit->text());
}
} else {
mDieBieMS->closeRtLogFile();
}
}
void PageRtData::on_csvHelpButton_clicked()
{
HelpDialog::showHelp(this, mDieBieMS->infoConfig(), "help_rt_logging");
}
*/

109
pages/pagertdata.h Normal file
View File

@@ -0,0 +1,109 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGERTDATA_H
#define PAGERTDATA_H
#include <QWidget>
#include <QVector>
#include <QTimer>
#include "bmsinterface.h"
#include "ui_pagertdata.h"
namespace Ui {
class PageRtData;
}
class PageRtData : public QWidget
{
Q_OBJECT
public:
explicit PageRtData(QWidget *parent = 0);
~PageRtData();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private slots:
void timerSlot();
void valuesReceived(BMS_VALUES values);
void cellsReceived(int cellCount, QVector<double> cellVoltageArray);
void auxReceived(int auxCount, QVector<double> auxVoltageArray);
void expTempReceived(int expTempCount, QVector<double> expTempVoltageArray);
void on_zoomHButton_toggled(bool checked);
void on_zoomVButton_toggled(bool checked);
void on_rescaleButton_clicked();
void on_tempShowBMSBox_toggled(bool checked);
void on_tempShowBatteryBox_toggled(bool checked);
//void on_csvChooseDirButton_clicked();
//void on_csvEnableLogBox_clicked(bool checked);
//void on_csvHelpButton_clicked();
private:
Ui::PageRtData *ui;
BMSInterface *mDieBieMS;
QTimer *mTimer;
QVector<double> mPackVoltage;
QVector<double> mLCLoadVoltage;
QVector<double> mLCLoadCurrent;
QVector<double> mHCLoadVoltage;
QVector<double> mHCLoadCurrent;
QVector<double> mChargerVoltage;
QVector<double> mAuxVoltage;
QVector<double> mAuxCurrent;
QVector<double> mCellVHigh;
QVector<double> mCellVAverage;
QVector<double> mCellVLow;
QVector<double> mTempBMSHigh;
QVector<double> mTempBMSAverage;
QVector<double> mTempBMSLow;
QVector<double> mTempBattHigh;
QVector<double> mTempBattAverage;
QVector<double> mTempBattLow;
QVector<double> mHumidity;
QVector<double> mSeconds;
double mSecondCounter;
qint64 mLastUpdateTime;
bool mUpdateValPlot;
QCPBarsGroup *group;
QCPBars *barsNormal;
QCPBars *barsBalance;
QCPBarsGroup *group2;
QCPBarsGroup *group3;
QCPBars *barsTemperature;
QCPBars *ExpBarsTemperature;
void appendDoubleAndTrunc(QVector<double> *vec, double num, int maxSize);
void updateZoom();
};
#endif // PAGERTDATA_H

354
pages/pagertdata.ui Normal file
View File

@@ -0,0 +1,354 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageRtData</class>
<widget class="QWidget" name="PageRtData">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>834</width>
<height>505</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>6</number>
</property>
<widget class="QWidget" name="cellBarGraphTab">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Cells Voltage</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QCustomPlot" name="cellBarGraph" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="auxBarGraphTab">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Temperatures LTC</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QCustomPlot" name="auxBarGraph" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="expBarGraphTab">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>Temperatures Expansion</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QCustomPlot" name="expBarGraph" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="ivLCGraphTab">
<property name="enabled">
<bool>false</bool>
</property>
<attribute name="title">
<string>IV Graph</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCustomPlot" name="ivLCGraph" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="cellGraphTab">
<attribute name="title">
<string>Cell Graph</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCustomPlot" name="cellGraph" native="true"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tempGraphTab">
<attribute name="title">
<string>Temp Graph</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="1,0">
<item>
<widget class="QCustomPlot" name="tempGraph" native="true"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="tempShowBMSBox">
<property name="toolTip">
<string>Show MOSFET temperature</string>
</property>
<property name="text">
<string>BMS</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="tempShowBatteryBox">
<property name="toolTip">
<string>Show motor temperature</string>
</property>
<property name="text">
<string>Battery</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QCustomPlot" name="cellLimitsGraph">
<attribute name="title">
<string>Cell Limits</string>
</attribute>
</widget>
</widget>
</item>
<item>
<widget class="QFrame" name="buttonFrame">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="QToolButton" name="autoscaleButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>3</pointsize>
</font>
</property>
<property name="toolTip">
<string>Autoscale plots with incoming samples</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/size_off.png</normaloff>
<normalon>:/res/icons/size_on.png</normalon>:/res/icons/size_off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="zoomHButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>3</pointsize>
</font>
</property>
<property name="toolTip">
<string>Enable horizontal zoom</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/expand_off.png</normaloff>
<normalon>:/res/icons/expand_on.png</normalon>:/res/icons/expand_off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="zoomVButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>3</pointsize>
</font>
</property>
<property name="toolTip">
<string>Enable vertical zoom</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/expand_v_off.png</normaloff>
<normalon>:/res/icons/expand_v_on.png</normalon>:/res/icons/expand_v_off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="rescaleButton">
<property name="toolTip">
<string>Rescale plots to fit</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/size_off.png</normaloff>:/res/icons/size_off.png</iconset>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="RtDataText" name="rtText" native="true"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>RtDataText</class>
<extends>QWidget</extends>
<header>widgets/rtdatatext.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>QCustomPlot</class>
<extends>QWidget</extends>
<header>widgets/qcustomplot.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections/>
</ui>

65
pages/pages.pri Normal file
View File

@@ -0,0 +1,65 @@
FORMS += \
$$PWD/pageconnection.ui \
$$PWD/pagedebugprint.ui \
$$PWD/pageterminal.ui \
$$PWD/pagefirmware.ui \
$$PWD/pagertdata.ui \
$$PWD/pagewelcome.ui \
$$PWD/pagedataanalysis.ui \
$$PWD/pagesetupcalculators.ui \
$$PWD/pagesettings.ui \
$$PWD/pagemastersettings.ui \
$$PWD/pageslavesettings.ui \
$$PWD/pagemastergeneral.ui \
$$PWD/pagemasterswitch.ui \
$$PWD/pagemastercell.ui \
$$PWD/pagemasterdisplay.ui \
$$PWD/pageslavegeneral.ui \
$$PWD/pageslaveswitch.ui \
$$PWD/pageslaveio.ui \
$$PWD/pageslavefan.ui \
$$PWD/pagemastersignals.ui
HEADERS += \
$$PWD/pageconnection.h \
$$PWD/pagedebugprint.h \
$$PWD/pageterminal.h \
$$PWD/pagefirmware.h \
$$PWD/pagertdata.h \
$$PWD/pagewelcome.h \
$$PWD/pagedataanalysis.h \
$$PWD/pagesetupcalculators.h \
$$PWD/pagesettings.h \
$$PWD/pagemastersettings.h \
$$PWD/pageslavesettings.h \
$$PWD/pagemastergeneral.h \
$$PWD/pagemasterswitch.h \
$$PWD/pagemastercell.h \
$$PWD/pagemasterdisplay.h \
$$PWD/pageslavegeneral.h \
$$PWD/pageslaveswitch.h \
$$PWD/pageslaveio.h \
$$PWD/pageslavefan.h \
$$PWD/pagemastersignals.h
SOURCES += \
$$PWD/pageconnection.cpp \
$$PWD/pagedebugprint.cpp \
$$PWD/pageterminal.cpp \
$$PWD/pagefirmware.cpp \
$$PWD/pagertdata.cpp \
$$PWD/pagewelcome.cpp \
$$PWD/pagedataanalysis.cpp \
$$PWD/pagesetupcalculators.cpp \
$$PWD/pagesettings.cpp \
$$PWD/pagemastersettings.cpp \
$$PWD/pageslavesettings.cpp \
$$PWD/pagemastergeneral.cpp \
$$PWD/pagemasterswitch.cpp \
$$PWD/pagemastercell.cpp \
$$PWD/pagemasterdisplay.cpp \
$$PWD/pageslavegeneral.cpp \
$$PWD/pageslaveswitch.cpp \
$$PWD/pageslaveio.cpp \
$$PWD/pageslavefan.cpp \
$$PWD/pagemastersignals.cpp

61
pages/pagesettings.cpp Normal file
View File

@@ -0,0 +1,61 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagesettings.h"
#include "ui_pagesettings.h"
PageSettings::PageSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSettings)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
if (mSettings.contains("app_scale_factor")) {
ui->uiScaleBox->setValue(mSettings.value("app_scale_factor").toDouble());
}
if (mSettings.contains("app_scale_auto")) {
ui->uiAutoScaleBox->setChecked(mSettings.value("app_scale_auto").toBool());
}
ui->uiScaleBox->setEnabled(!ui->uiAutoScaleBox->isChecked());
}
PageSettings::~PageSettings()
{
delete ui;
}
void PageSettings::on_uiScaleBox_valueChanged(double arg1)
{
mSettings.setValue("app_scale_factor", arg1);
}
void PageSettings::on_uiAutoScaleBox_toggled(bool checked)
{
mSettings.setValue("app_scale_auto", checked);
ui->uiScaleBox->setEnabled(!checked);
}

55
pages/pagesettings.h Normal file
View File

@@ -0,0 +1,55 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESETTINGS_H
#define PAGESETTINGS_H
#include <QWidget>
#include <QSettings>
namespace Ui {
class PageSettings;
}
class PageSettings : public QWidget
{
Q_OBJECT
public:
explicit PageSettings(QWidget *parent = 0);
~PageSettings();
private slots:
void on_uiScaleBox_valueChanged(double arg1);
void on_uiAutoScaleBox_toggled(bool checked);
private:
Ui::PageSettings *ui;
QSettings mSettings;
};
#endif // PAGESETTINGS_H

92
pages/pagesettings.ui Normal file
View File

@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSettings</class>
<widget class="QWidget" name="PageSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>745</width>
<height>352</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>UI Scale Factor (restart required)</string>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="uiScaleBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Scale the user intefrace with this factor. Useful for high resolution monitors. VESC Tool must be restarted for this setting to take effect.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="minimum">
<double>1.000000000000000</double>
</property>
<property name="maximum">
<double>3.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="uiAutoScaleBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Try to determine the scaling factor automatically from the screen resolution and the system font settings. VESC Tool must be restarted for this setting to take effect.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Auto</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>144</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,62 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagesetupcalculators.h"
#include "ui_pagesetupcalculators.h"
PageSetupCalculators::PageSetupCalculators(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSetupCalculators)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
}
PageSetupCalculators::~PageSetupCalculators()
{
delete ui;
}
void PageSetupCalculators::on_addSetupButton_clicked()
{
}
void PageSetupCalculators::on_removeSetupButton_clicked()
{
}
BMSInterface *PageSetupCalculators::bms() const
{
return mDieBieMS;
}
void PageSetupCalculators::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
}

View File

@@ -0,0 +1,57 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESETUPCALCULATORS_H
#define PAGESETUPCALCULATORS_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageSetupCalculators;
}
class PageSetupCalculators : public QWidget
{
Q_OBJECT
public:
explicit PageSetupCalculators(QWidget *parent = 0);
~PageSetupCalculators();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private slots:
void on_addSetupButton_clicked();
void on_removeSetupButton_clicked();
private:
Ui::PageSetupCalculators *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGESETUPCALCULATORS_H

View File

@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSetupCalculators</class>
<widget class="QWidget" name="PageSetupCalculators">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>734</width>
<height>536</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="VTextBrowser" name="setupText"/>
<widget class="QWidget" name="">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>-1</number>
</property>
<property name="tabsClosable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="addSetupButton">
<property name="text">
<string>Add Setup</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Plus Math-96.png</normaloff>:/res/icons/Plus Math-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="removeSetupButton">
<property name="text">
<string>Remove Setup</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Cancel-96.png</normaloff>:/res/icons/Cancel-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>VTextBrowser</class>
<extends>QTextEdit</extends>
<header>widgets/vtextbrowser.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections/>
</ui>

52
pages/pageslavefan.cpp Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageslavefan.h"
#include "ui_pageslavefan.h"
PageSlaveFAN::PageSlaveFAN(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSlaveFAN)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageSlaveFAN::~PageSlaveFAN()
{
delete ui;
}
BMSInterface *PageSlaveFAN::bms() const {
return mDieBieMS;
}
void PageSlaveFAN::setDieBieMS(BMSInterface *dieBieMS) {
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->slaveFANTab->addRowSeparator(tr("TBD"));
}
}

52
pages/pageslavefan.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESLAVEFAN_H
#define PAGESLAVEFAN_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageSlaveFAN;
}
class PageSlaveFAN : public QWidget
{
Q_OBJECT
public:
explicit PageSlaveFAN(QWidget *parent = 0);
~PageSlaveFAN();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageSlaveFAN *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGESLAVEFAN_H

31
pages/pageslavefan.ui Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSlaveFAN</class>
<widget class="QWidget" name="PageSlaveFAN">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="ParamTable" name="slaveFANTab"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,62 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageslavegeneral.h"
#include "ui_pageslavegeneral.h"
PageSlaveGeneral::PageSlaveGeneral(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSlaveGeneral)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageSlaveGeneral::~PageSlaveGeneral()
{
delete ui;
}
BMSInterface *PageSlaveGeneral::bms() const {
return mDieBieMS;
}
void PageSlaveGeneral::setDieBieMS(BMSInterface *dieBieMS) {
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->slaveSensorsTab->addRowSeparator(tr("NTC's local"));
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpPCBTopResistor");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpPCB25Deg");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpPCBBeta");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpExtTopResistor");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpExt25Deg");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpExtBeta");
ui->slaveSensorsTab->addRowSeparator(tr("NTC Aux"));
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpAUXTopResistor");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpAUX25Deg");
ui->slaveSensorsTab->addParamRow(mDieBieMS->bmsConfig(), "NTCHiAmpAUXBeta");
}
}

52
pages/pageslavegeneral.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESLAVEGENERAL_H
#define PAGESLAVEGENERAL_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageSlaveGeneral;
}
class PageSlaveGeneral : public QWidget
{
Q_OBJECT
public:
explicit PageSlaveGeneral(QWidget *parent = 0);
~PageSlaveGeneral();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageSlaveGeneral *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGESLAVEGENERAL_H

45
pages/pageslavegeneral.ui Normal file
View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSlaveGeneral</class>
<widget class="QWidget" name="PageSlaveGeneral">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<widget class="QWidget" name="Sensors">
<attribute name="title">
<string>Sensors</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="slaveSensorsTab"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

60
pages/pageslaveio.cpp Normal file
View File

@@ -0,0 +1,60 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageslaveio.h"
#include "ui_pageslaveio.h"
PageSlaveIO::PageSlaveIO(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSlaveIO)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageSlaveIO::~PageSlaveIO()
{
delete ui;
}
BMSInterface *PageSlaveIO::bms() const {
return mDieBieMS;
}
void PageSlaveIO::setDieBieMS(BMSInterface *dieBieMS) {
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->slaveIOTabAUX->addRowSeparator(tr("AUX0"));
ui->slaveIOTabAUX->addParamRow(mDieBieMS->bmsConfig(), "AUX0SignalSource");
ui->slaveIOTabAUX->addParamRow(mDieBieMS->bmsConfig(), "AUX0TurnOnDelay");
ui->slaveIOTabAUX->addParamRow(mDieBieMS->bmsConfig(), "AUX0TurnOffDelay");
ui->slaveIOTabAUX->addRowSeparator(tr("AUX1"));
ui->slaveIOTabAUX->addParamRow(mDieBieMS->bmsConfig(), "AUX1SignalSource");
ui->slaveIOTabAUX->addParamRow(mDieBieMS->bmsConfig(), "AUX1TurnOnDelay");
ui->slaveIOTabAUX->addParamRow(mDieBieMS->bmsConfig(), "AUX1TurnOffDelay");
}
}

52
pages/pageslaveio.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESLAVEIO_H
#define PAGESLAVEIO_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageSlaveIO;
}
class PageSlaveIO : public QWidget
{
Q_OBJECT
public:
explicit PageSlaveIO(QWidget *parent = 0);
~PageSlaveIO();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageSlaveIO *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGESLAVEIO_H

58
pages/pageslaveio.ui Normal file
View File

@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSlaveIO</class>
<widget class="QWidget" name="PageSlaveIO">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="tabShape">
<enum>QTabWidget::Triangular</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tabIOAUX">
<attribute name="title">
<string>AUX</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ParamTable" name="slaveIOTabAUX"/>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabIOOpto">
<attribute name="title">
<string>Opto</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="ParamTable" name="slaveIOTabOpto"/>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@@ -0,0 +1,60 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageslavesettings.h"
#include "ui_pageslavesettings.h"
PageSlaveSettings::PageSlaveSettings(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSlaveSettings)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
}
PageSlaveSettings::~PageSlaveSettings()
{
delete ui;
}
BMSInterface *PageSlaveSettings::bms() const
{
return mDieBieMS;
}
void PageSlaveSettings::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ConfigParam *p = mDieBieMS->infoConfig()->getParam("slave_setting_description");
if (p != 0) {
ui->textEdit->setHtml(p->description);
} else {
ui->textEdit->setText("Slave Setting Description not found.");
}
}
}

52
pages/pageslavesettings.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESLAVESETTINGS_H
#define PAGESLAVESETTINGS_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageSlaveSettings;
}
class PageSlaveSettings : public QWidget
{
Q_OBJECT
public:
explicit PageSlaveSettings(QWidget *parent = 0);
~PageSlaveSettings();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageSlaveSettings *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGESLAVESETTINGS_H

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSlaveSettings</class>
<widget class="QWidget" name="PageSlaveSettings">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="VTextBrowser" name="textEdit"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>VTextBrowser</class>
<extends>QTextEdit</extends>
<header>widgets/vtextbrowser.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

61
pages/pageslaveswitch.cpp Normal file
View File

@@ -0,0 +1,61 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageslaveswitch.h"
#include "ui_pageslaveswitch.h"
PageSlaveSwitch::PageSlaveSwitch(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageSlaveSwitch)
{
ui->setupUi(this);
mDieBieMS = 0;
}
PageSlaveSwitch::~PageSlaveSwitch()
{
delete ui;
}
BMSInterface *PageSlaveSwitch::bms() const {
return mDieBieMS;
}
void PageSlaveSwitch::setDieBieMS(BMSInterface *dieBieMS) {
mDieBieMS = dieBieMS;
if (mDieBieMS) {
ui->switchTab->addRowSeparator(tr("High current output switch"));
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "HCUseRelay");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "togglePowerModeDirectHCDelay");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "HCUsePrecharge");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutHCPreCharge");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutHCPreChargeRetryInterval");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "timeoutHCRelayOverlap");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "HCUseLoadDetect");
ui->switchTab->addParamRow(mDieBieMS->bmsConfig(), "HCLoadDetectThreshold");
ui->switchTab->addRowSeparator(tr("DCDC Converter"));
}
}

52
pages/pageslaveswitch.h Normal file
View File

@@ -0,0 +1,52 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGESLAVESWITCH_H
#define PAGESLAVESWITCH_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageSlaveSwitch;
}
class PageSlaveSwitch : public QWidget
{
Q_OBJECT
public:
explicit PageSlaveSwitch(QWidget *parent = 0);
~PageSlaveSwitch();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private:
Ui::PageSlaveSwitch *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGESLAVESWITCH_H

31
pages/pageslaveswitch.ui Normal file
View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageSlaveSwitch</class>
<widget class="QWidget" name="PageSlaveSwitch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>700</width>
<height>500</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="ParamTable" name="switchTab"/>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ParamTable</class>
<extends>QTableWidget</extends>
<header>widgets/paramtable.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

81
pages/pageterminal.cpp Normal file
View File

@@ -0,0 +1,81 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pageterminal.h"
#include "ui_pageterminal.h"
PageTerminal::PageTerminal(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageTerminal)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
}
PageTerminal::~PageTerminal()
{
delete ui;
}
void PageTerminal::clearTerminal()
{
ui->terminalBrowser->clear();
}
BMSInterface *PageTerminal::bms() const
{
return mDieBieMS;
}
void PageTerminal::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
if (mDieBieMS) {
connect(mDieBieMS->commands(), SIGNAL(printReceived(QString)),
this, SLOT(printReceived(QString)));
}
}
void PageTerminal::printReceived(QString str)
{
ui->terminalBrowser->append(str);
}
void PageTerminal::on_sendButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->commands()->sendTerminalCmd(ui->terminalEdit->text());
ui->terminalEdit->clear();
}
}
void PageTerminal::on_helpButton_clicked()
{
if (mDieBieMS) {
mDieBieMS->commands()->sendTerminalCmd("help");
}
}

60
pages/pageterminal.h Normal file
View File

@@ -0,0 +1,60 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGETERMINAL_H
#define PAGETERMINAL_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageTerminal;
}
class PageTerminal : public QWidget
{
Q_OBJECT
public:
explicit PageTerminal(QWidget *parent = 0);
~PageTerminal();
void clearTerminal();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
private slots:
void printReceived(QString str);
void on_sendButton_clicked();
void on_helpButton_clicked();
private:
Ui::PageTerminal *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGETERMINAL_H

142
pages/pageterminal.ui Normal file
View File

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageTerminal</class>
<widget class="QWidget" name="PageTerminal">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>632</width>
<height>452</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTextBrowser" name="terminalBrowser">
<property name="font">
<font>
<family>DejaVu Sans Mono</family>
</font>
</property>
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="helpButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Send help command to VESC</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Help-96.png</normaloff>:/res/icons/Help-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="HistoryLineEdit" name="terminalEdit"/>
</item>
<item>
<widget class="QPushButton" name="sendButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Send command</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Send File-96.png</normaloff>:/res/icons/Send File-96.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="clearButton">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Clear terminal</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Delete-96.png</normaloff>:/res/icons/Delete-96.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>HistoryLineEdit</class>
<extends>QLineEdit</extends>
<header>widgets/historylineedit.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections>
<connection>
<sender>clearButton</sender>
<signal>clicked()</signal>
<receiver>terminalBrowser</receiver>
<slot>clear()</slot>
<hints>
<hint type="sourcelabel">
<x>599</x>
<y>423</y>
</hint>
<hint type="destinationlabel">
<x>577</x>
<y>368</y>
</hint>
</hints>
</connection>
<connection>
<sender>terminalEdit</sender>
<signal>returnPressed()</signal>
<receiver>sendButton</receiver>
<slot>click()</slot>
<hints>
<hint type="sourcelabel">
<x>538</x>
<y>425</y>
</hint>
<hint type="destinationlabel">
<x>571</x>
<y>424</y>
</hint>
</hints>
</connection>
</connections>
</ui>

59
pages/pagewelcome.cpp Normal file
View File

@@ -0,0 +1,59 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "pagewelcome.h"
#include "ui_pagewelcome.h"
#include "utility.h"
#include <QMessageBox>
PageWelcome::PageWelcome(QWidget *parent) :
QWidget(parent),
ui(new Ui::PageWelcome)
{
ui->setupUi(this);
layout()->setContentsMargins(0, 0, 0, 0);
mDieBieMS = 0;
ui->bgWidget->setPixmap(QPixmap("://res/bg.png"));
}
PageWelcome::~PageWelcome()
{
delete ui;
}
BMSInterface *PageWelcome::bms() const
{
return mDieBieMS;
}
void PageWelcome::setDieBieMS(BMSInterface *dieBieMS)
{
mDieBieMS = dieBieMS;
}
void PageWelcome::on_autoConnectButton_clicked()
{
Utility::autoconnectBlockingWithProgress(mDieBieMS, this);
}

58
pages/pagewelcome.h Normal file
View File

@@ -0,0 +1,58 @@
/*
Original copyright 2018 Benjamin Vedder benjamin@vedder.se and the VESC Tool project ( https://github.com/vedderb/vesc_tool )
Forked to:
Copyright 2018 Danny Bokma github@diebie.nl (https://github.com/DieBieEngineering/DieBieMS-Tool)
Now forked to:
Copyright 2019 - 2020 Kevin Dionne kevin.dionne@ennoid.me (https://github.com/EnnoidMe/ENNOID-BMS-Tool)
This file is part of ENNOID-BMS Tool.
ENNOID-BMS Tool is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ENNOID-BMS Tool is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PAGEWELCOME_H
#define PAGEWELCOME_H
#include <QWidget>
#include "bmsinterface.h"
namespace Ui {
class PageWelcome;
}
class PageWelcome : public QWidget
{
Q_OBJECT
public:
explicit PageWelcome(QWidget *parent = 0);
~PageWelcome();
BMSInterface *bms() const;
void setDieBieMS(BMSInterface *dieBieMS);
public slots:
private slots:
void on_autoConnectButton_clicked();
private:
Ui::PageWelcome *ui;
BMSInterface *mDieBieMS;
};
#endif // PAGEWELCOME_H

86
pages/pagewelcome.ui Normal file
View File

@@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PageWelcome</class>
<widget class="QWidget" name="PageWelcome">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>760</width>
<height>461</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="ImageWidget" name="bgWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1">
<property name="leftMargin">
<number>30</number>
</property>
<property name="topMargin">
<number>30</number>
</property>
<property name="rightMargin">
<number>30</number>
</property>
<property name="bottomMargin">
<number>30</number>
</property>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:20pt;&quot;&gt;Welcome to &lt;/span&gt;&lt;span style=&quot; font-size:20pt; font-weight:600;&quot;&gt;ENNOID-BMS&lt;/span&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;®&lt;/span&gt;&lt;span style=&quot; font-size:20pt; font-weight:600;&quot;&gt; Tool&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;You must connect your battery to your ENNOID-BMS before use. Once the battery is connected, the &lt;/span&gt;&lt;span style=&quot; font-size:14pt; font-style:italic;&quot;&gt;power&lt;/span&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt; LED on the ENNOID-BMS should normally turn &lt;/span&gt;&lt;span style=&quot; font-size:14pt; font-weight:600; font-style:italic;&quot;&gt;ON &lt;/span&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;after connecting the USB to a computer host. &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;Click on the &lt;/span&gt;&lt;span style=&quot; font-size:14pt; font-weight:600; font-style:italic;&quot;&gt;Connect &lt;/span&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;button below. The indicator in the bottom right corner should turn green and shows &lt;/span&gt;&lt;span style=&quot; font-size:14pt; font-style:italic;&quot;&gt;&amp;quot;Connected&amp;quot;. &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt; vertical-align:sub;&quot;&gt;(If the connection fails, please make sure you have the appropriate driver for &amp;quot;Silicon Labs CP2104&amp;quot; installed on your computer)&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;Before using this application for configuring the ENNOID-BMS, make sure you have updated the firmware with one of the included files available in the &amp;quot;Firmware&amp;quot; page. &lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;br/&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:14pt;&quot;&gt;Follow the indicated instructions in the &amp;quot;Settings&amp;quot; page for configuring your ENNOID-BMS.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QPushButton" name="autoConnectButton">
<property name="toolTip">
<string>Automatically connect using the USB connection.</string>
</property>
<property name="text">
<string>Connect</string>
</property>
<property name="icon">
<iconset resource="../res.qrc">
<normaloff>:/res/icons/Connected-96.png</normaloff>:/res/icons/Connected-96.png</iconset>
</property>
<property name="iconSize">
<size>
<width>45</width>
<height>45</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ImageWidget</class>
<extends>QWidget</extends>
<header>widgets/imagewidget.h</header>
<container>1</container>
</customwidget>
</customwidgets>
<resources>
<include location="../res.qrc"/>
</resources>
<connections/>
</ui>