Skip to content

Commit

Permalink
Now with working bar graphsgit add .
Browse files Browse the repository at this point in the history
  • Loading branch information
DieBieEngineering committed Aug 28, 2018
1 parent 014b480 commit 506a2c1
Show file tree
Hide file tree
Showing 81 changed files with 298 additions and 224 deletions.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion DieBieMSTool.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#-------------------------------------------------

# Version
DT_VERSION = 0.19
DT_VERSION = 0.20

DEFINES += DT_VERSION=$$DT_VERSION

Expand Down
2 changes: 1 addition & 1 deletion DieBieMSTool.pro.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.7.0, 2018-08-23T20:53:00. -->
<!-- Written by QtCreator 4.7.0, 2018-08-28T14:31:11. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down
16 changes: 14 additions & 2 deletions commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,21 @@ void Commands::processPacket(QByteArray data)
emit valuesReceived(values);
} break;

case COMM_GET_BMS_CELLS:
case COMM_GET_BMS_CELLS:{
mTimeoutCells = 0;
break;
int mCellAmount;
QVector<double> mCellVoltages;
mCellVoltages.clear();

mCellAmount = vb.vbPopFrontUint8();

for(int cellValuePointer = 0; cellValuePointer < mCellAmount; cellValuePointer++){
mCellVoltages.append(vb.vbPopFrontDouble16(1e3));
}

emit cellsReceived(mCellAmount,mCellVoltages);

} break;

case COMM_PRINT:
emit printReceived(QString::fromLatin1(vb));
Expand Down
3 changes: 3 additions & 0 deletions commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ class Commands : public QObject
void fwVersionReceived(int major, int minor, QString hw, QByteArray uuid);
void ackReceived(QString ackType);
void valuesReceived(BMS_VALUES values);

void cellsReceived(int cellCount, QVector<double> cellVoltageArray);

void printReceived(QString str);
void rotorPosReceived(double pos);
void bmsConfigCheckResult(QStringList paramsNotSet);
Expand Down
16 changes: 13 additions & 3 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ MainWindow::MainWindow(QWidget *parent) :
{
ui->setupUi(this);

QLoggingCategory::setFilterRules("qt.network.ssl.warning=false");

mVersion = QString::number(DT_VERSION);
mDieBieMS = new BMSInterface(this);
mStatusInfoTime = 0;
Expand Down Expand Up @@ -111,7 +113,7 @@ MainWindow::MainWindow(QWidget *parent) :
}
}

mPageDebugPrint->printConsole("VESC® Tool " + mVersion + " started<br>");
mPageDebugPrint->printConsole("DieBieMSTool " + mVersion + " started<br>");
}

MainWindow::~MainWindow()
Expand Down Expand Up @@ -153,14 +155,22 @@ void MainWindow::timerSlot()
ui->actionCanFwd->setChecked(mDieBieMS->commands()->getSendCan());
}

// RT data only every 10 iterations
// RT data only every 5 iterations
if (ui->actionRtData->isChecked()) {
static int values_cnt = 0;
static int cells_cnt = 0;

values_cnt++;
if(values_cnt >= 10) {
if(values_cnt >= 5) {
values_cnt = 0;
mDieBieMS->commands()->getValues();
}

cells_cnt++;
if(cells_cnt >= 20) {
cells_cnt = 0;
mDieBieMS->commands()->getCells();
}
}

// Send alive command once every 10 iterations
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <cmath>
#include <QEventLoop>
#include <QDesktopServices>
#include <QLoggingCategory>

#include "bmsinterface.h"
#include "ui_mainwindow.h"
Expand Down
1 change: 1 addition & 0 deletions pages/pagemastergeneral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void PageMasterGeneral::setDieBieMS(BMSInterface *dieBieMS)
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "notUsedCurrentThreshold");
ui->powerStateTab->addParamRow(mDieBieMS->bmsConfig(), "notUsedTimeout");


ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "CANID");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "CANIDStyle");
ui->canTab->addParamRow(mDieBieMS->bmsConfig(), "emitStatusOverCAN");
Expand Down
Loading

0 comments on commit 506a2c1

Please sign in to comment.