From 9e37ded7cb7faadcba869564aa017d3a0de8c7fb Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 5 Jun 2016 22:08:47 -0400 Subject: [PATCH 1/4] Fixes for many issues in flowview, graphing window, and frame playback. In FlowView: - Drastically improved functionality of live mode. It actually works now - Fixed several crash bugs - Program didn't used to pick up new frames properly. This is now corrected. In Graphing window: - Fixed dynamic updates to work properly even under heavy bus loads In frame playback: - Fixed a bug where single stepping through frames didn't send them over canbus --- SavvyCAN.pro | 11 ++++-- config.h | 2 +- deltamodel.cpp | 36 ++++++++++++++++++++ deltamodel.h | 25 ++++++++++++++ deltawindow.cpp | 14 ++++++++ deltawindow.h | 22 ++++++++++++ deltawindow.ui | 24 +++++++++++++ flowviewwindow.cpp | 74 +++++++++++++++++++++++++++++++---------- flowviewwindow.h | 2 ++ frameplaybackwindow.cpp | 4 +++ graphingwindow.cpp | 12 +++++-- 11 files changed, 202 insertions(+), 24 deletions(-) create mode 100644 deltamodel.cpp create mode 100644 deltamodel.h create mode 100644 deltawindow.cpp create mode 100644 deltawindow.h create mode 100644 deltawindow.ui diff --git a/SavvyCAN.pro b/SavvyCAN.pro index 6040390..07fc638 100644 --- a/SavvyCAN.pro +++ b/SavvyCAN.pro @@ -48,7 +48,9 @@ SOURCES += main.cpp\ udsscanwindow.cpp \ can_structs.cpp \ isotp_interpreterwindow.cpp \ - isotp_handler.cpp + isotp_handler.cpp \ + deltawindow.cpp \ + deltamodel.cpp HEADERS += mainwindow.h \ can_structs.h \ @@ -83,7 +85,9 @@ HEADERS += mainwindow.h \ fuzzingwindow.h \ udsscanwindow.h \ isotp_interpreterwindow.h \ - isotp_handler.h + isotp_handler.h \ + deltawindow.h \ + deltamodel.h FORMS += mainwindow.ui \ graphingwindow.ui \ @@ -105,7 +109,8 @@ FORMS += mainwindow.ui \ dbcloadsavewindow.ui \ fuzzingwindow.ui \ udsscanwindow.ui \ - isotp_interpreterwindow.ui + isotp_interpreterwindow.ui \ + deltawindow.ui DISTFILES += diff --git a/config.h b/config.h index 33378ea..12accfa 100644 --- a/config.h +++ b/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG #define CONFIG -#define VERSION 155 +#define VERSION 156 //try to keep this in sync. //SavvyCAN will complain if you connect a GVRET board with a revision diff --git a/deltamodel.cpp b/deltamodel.cpp new file mode 100644 index 0000000..98f88fa --- /dev/null +++ b/deltamodel.cpp @@ -0,0 +1,36 @@ +#include "deltamodel.h" + +DeltaModel::DeltaModel(QObject *parent) + : QAbstractTableModel(parent) +{ +} + +QVariant DeltaModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + // FIXME: Implement me! +} + +int DeltaModel::rowCount(const QModelIndex &parent) const +{ + if (!parent.isValid()) + return 0; + + // FIXME: Implement me! +} + +int DeltaModel::columnCount(const QModelIndex &parent) const +{ + if (!parent.isValid()) + return 0; + + // FIXME: Implement me! +} + +QVariant DeltaModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid()) + return QVariant(); + + // FIXME: Implement me! + return QVariant(); +} diff --git a/deltamodel.h b/deltamodel.h new file mode 100644 index 0000000..c0444d8 --- /dev/null +++ b/deltamodel.h @@ -0,0 +1,25 @@ +#ifndef DELTAMODEL_H +#define DELTAMODEL_H + +#include + +class DeltaModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + explicit DeltaModel(QObject *parent = 0); + + // Header: + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; + + // Basic functionality: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + +private: +}; + +#endif // DELTAMODEL_H \ No newline at end of file diff --git a/deltawindow.cpp b/deltawindow.cpp new file mode 100644 index 0000000..8a1b3c0 --- /dev/null +++ b/deltawindow.cpp @@ -0,0 +1,14 @@ +#include "deltawindow.h" +#include "ui_deltawindow.h" + +DeltaWindow::DeltaWindow(QWidget *parent) : + QDialog(parent), + ui(new Ui::DeltaWindow) +{ + ui->setupUi(this); +} + +DeltaWindow::~DeltaWindow() +{ + delete ui; +} diff --git a/deltawindow.h b/deltawindow.h new file mode 100644 index 0000000..e9c30cf --- /dev/null +++ b/deltawindow.h @@ -0,0 +1,22 @@ +#ifndef DELTAWINDOW_H +#define DELTAWINDOW_H + +#include + +namespace Ui { +class DeltaWindow; +} + +class DeltaWindow : public QDialog +{ + Q_OBJECT + +public: + explicit DeltaWindow(QWidget *parent = 0); + ~DeltaWindow(); + +private: + Ui::DeltaWindow *ui; +}; + +#endif // DELTAWINDOW_H diff --git a/deltawindow.ui b/deltawindow.ui new file mode 100644 index 0000000..3a67a5e --- /dev/null +++ b/deltawindow.ui @@ -0,0 +1,24 @@ + + + DeltaWindow + + + + 0 + 0 + 978 + 654 + + + + Dialog + + + + + + + + + + diff --git a/flowviewwindow.cpp b/flowviewwindow.cpp index 424925e..f443d49 100644 --- a/flowviewwindow.cpp +++ b/flowviewwindow.cpp @@ -158,9 +158,9 @@ void FlowViewWindow::writeSettings() /* * Keyboard shortcuts to allow for quick work without needing to move around a mouse. - * E = resume or pause playback - * Q = go back one frame - * W = go forward one frame + * R = resume or pause playback + * T = go back one frame + * Y = go forward one frame */ bool FlowViewWindow::eventFilter(QObject *obj, QEvent *event) { @@ -371,27 +371,64 @@ void FlowViewWindow::updatedFrames(int numFrames) else //just got some new frames. See if they are relevant. { if (numFrames > modelFrames->count()) return; - int refID = frameCache[0].ID; + int refID; + if (frameCache.count() > 0) refID = frameCache[0].ID; + else refID = 0; bool needRefresh = false; for (int i = modelFrames->count() - numFrames; i < modelFrames->count(); i++) { thisFrame = modelFrames->at(i); + + if (!foundID.contains(thisFrame.ID)) + { + foundID.append(thisFrame.ID); + QListWidgetItem* item = new QListWidgetItem(Utility::formatNumber(thisFrame.ID), ui->listFrameID); + } + if (thisFrame.ID == refID) { frameCache.append(thisFrame); - if (ui->cbLiveMode->checkState() == Qt::Checked) + + for (int k = 0; k < 8; k++) { - currentPosition = frameCache.count() - 1; + if (ui->cbTimeGraph->isChecked()) + { + if (secondsMode){ + x[k].append((double)(thisFrame.timestamp) / 1000000.0); + } + else + { + x[k].append(thisFrame.timestamp); + } + } + else + { + x[k].append(x[k].count()); + } + y[k].append(thisFrame.data[k]); needRefresh = true; } - } + } + } + if (ui->cbLiveMode->checkState() == Qt::Checked) + { + currentPosition = frameCache.count() - 1; + memcpy(currBytes, frameCache.at(currentPosition).data, 8); + memcpy(refBytes, currBytes, 8); + } if (needRefresh) { - updateDataView(); + for (int k = 0; k < 8; k++) + { + graphRef[k]->setData(x[k], y[k]); + } + ui->graphView->replot(); + updateDataView(); if (ui->cbSync->checkState() == Qt::Checked) emit sendCenterTimeID(frameCache[currentPosition].ID, frameCache[currentPosition].timestamp / 1000000.0); } } + updateFrameLabel(); } void FlowViewWindow::removeAllGraphs() @@ -409,7 +446,10 @@ void FlowViewWindow::createGraph(int byteNum) int numEntries = frameCache.count(); - QVector x(numEntries), y(numEntries); + x[byteNum].clear(); + y[byteNum].clear(); + x[byteNum].resize(numEntries); + y[byteNum].resize(numEntries); for (int j = 0; j < numEntries; j++) { @@ -418,26 +458,26 @@ void FlowViewWindow::createGraph(int byteNum) if (graphByTime) { if (secondsMode){ - x[j] = (double)(frameCache[j].timestamp) / 1000000.0; + x[byteNum][j] = (double)(frameCache[j].timestamp) / 1000000.0; } else { - x[j] = frameCache[j].timestamp; + x[byteNum][j] = frameCache[j].timestamp; } } else { - x[j] = j; + x[byteNum][j] = j; } - y[j] = tempVal; - if (y[j] < minval) minval = y[j]; - if (y[j] > maxval) maxval = y[j]; + y[byteNum][j] = tempVal; + if (y[byteNum][j] < minval) minval = y[byteNum][j]; + if (y[byteNum][j] > maxval) maxval = y[byteNum][j]; } - ui->graphView->addGraph(); + graphRef[byteNum] = ui->graphView->addGraph(); ui->graphView->graph()->setName(QString("Graph %1").arg(ui->graphView->graphCount()-1)); - ui->graphView->graph()->setData(x,y); + ui->graphView->graph()->setData(x[byteNum],y[byteNum]); ui->graphView->graph()->setLineStyle(QCPGraph::lsLine); //connect points with lines QPen graphPen; graphPen.setColor(graphColors[byteNum]); diff --git a/flowviewwindow.h b/flowviewwindow.h index 78f5b71..165a13e 100644 --- a/flowviewwindow.h +++ b/flowviewwindow.h @@ -55,6 +55,8 @@ private: bool playbackForward; static const QColor graphColors[8]; bool secondsMode; + QVector x[8], y[8]; + QCPGraph *graphRef[8]; void refreshIDList(); void updateFrameLabel(); diff --git a/frameplaybackwindow.cpp b/frameplaybackwindow.cpp index 765f482..be6dae7 100644 --- a/frameplaybackwindow.cpp +++ b/frameplaybackwindow.cpp @@ -400,10 +400,12 @@ void FramePlaybackWindow::btnLoadLive() void FramePlaybackWindow::btnBackOneClick() { + sendingBuffer.clear(); playbackTimer->stop(); //pushing this button halts automatic playback playbackActive = false; updatePosition(false); + emit sendFrameBatch(&sendingBuffer); } void FramePlaybackWindow::btnPauseClick() @@ -450,9 +452,11 @@ void FramePlaybackWindow::btnPlayClick() void FramePlaybackWindow::btnFwdOneClick() { + sendingBuffer.clear(); playbackTimer->stop(); playbackActive = false; updatePosition(true); + emit sendFrameBatch(&sendingBuffer); } void FramePlaybackWindow::changePlaybackSpeed(int newSpeed) diff --git a/graphingwindow.cpp b/graphingwindow.cpp index 0deecd5..6aff9ec 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -142,6 +142,7 @@ void GraphingWindow::updatedFrames(int numFrames) } else //just got some new frames. See if they are relevant. { + bool appendedToGraph = false; if (numFrames > modelFrames->count()) return; for (int i = modelFrames->count() - numFrames; i < modelFrames->count(); i++) { @@ -151,10 +152,17 @@ void GraphingWindow::updatedFrames(int numFrames) if (graphParams[j].ID == thisFrame.ID) { appendToGraph(graphParams[j], thisFrame); + appendedToGraph = true; } } } - ui->graphingView->replot(); + if (appendedToGraph) { + for (int j = 0; j < graphParams.count(); j++) + { + graphParams[j].ref->setData(graphParams[j].x, graphParams[j].y); + } + ui->graphingView->replot(); + } } } @@ -931,8 +939,6 @@ void GraphingWindow::appendToGraph(GraphParams ¶ms, CANFrame &frame) params.x.append(frame.timestamp - params.xbias); } params.y.append((tempVal * params.scale) + params.bias); - - params.ref->setData(params.x,params.y); } void GraphingWindow::createGraph(GraphParams ¶ms, bool createGraphParam) From 3e630a79f41e782f131c2a1538cef5f31d38442d Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Sun, 5 Jun 2016 22:17:13 -0400 Subject: [PATCH 2/4] ??? --- docs/make.bat | 526 +++++++++++++++++++++++++------------------------- 1 file changed, 263 insertions(+), 263 deletions(-) diff --git a/docs/make.bat b/docs/make.bat index da8b07a..22da6bc 100644 --- a/docs/make.bat +++ b/docs/make.bat @@ -1,263 +1,263 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source -set I18NSPHINXOPTS=%SPHINXOPTS% source -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - echo. coverage to run coverage check of the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -REM Check if sphinx-build is available and fallback to Python version if any -%SPHINXBUILD% 2> nul -if errorlevel 9009 goto sphinx_python -goto sphinx_ok - -:sphinx_python - -set SPHINXBUILD=python -m sphinx.__init__ -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -:sphinx_ok - - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SavvyCAN.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SavvyCAN.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %~dp0 - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "coverage" ( - %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage - if errorlevel 1 exit /b 1 - echo. - echo.Testing of coverage in the sources finished, look at the ^ -results in %BUILDDIR%/coverage/python.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=build +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source +set I18NSPHINXOPTS=%SPHINXOPTS% source +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^` where ^ is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. xml to make Docutils-native XML files + echo. pseudoxml to make pseudoxml-XML files for display purposes + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + echo. coverage to run coverage check of the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + + +REM Check if sphinx-build is available and fallback to Python version if any +%SPHINXBUILD% 2> nul +if errorlevel 9009 goto sphinx_python +goto sphinx_ok + +:sphinx_python + +set SPHINXBUILD=python -m sphinx.__init__ +%SPHINXBUILD% 2> nul +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +:sphinx_ok + + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\SavvyCAN.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\SavvyCAN.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdf" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "latexpdfja" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + cd %BUILDDIR%/latex + make all-pdf-ja + cd %~dp0 + echo. + echo.Build finished; the PDF files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/text. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "coverage" ( + %SPHINXBUILD% -b coverage %ALLSPHINXOPTS% %BUILDDIR%/coverage + if errorlevel 1 exit /b 1 + echo. + echo.Testing of coverage in the sources finished, look at the ^ +results in %BUILDDIR%/coverage/python.txt. + goto end +) + +if "%1" == "xml" ( + %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The XML files are in %BUILDDIR%/xml. + goto end +) + +if "%1" == "pseudoxml" ( + %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. + goto end +) + +:end From 5253dc4d474d9161139f96234be48526ed28eaba Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 7 Jun 2016 10:01:00 -0400 Subject: [PATCH 3/4] Fixed a compile time bug in deltamodel. Whoops. Also fixed some warnings in graphing window. --- deltamodel.cpp | 5 +++++ graphingwindow.cpp | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/deltamodel.cpp b/deltamodel.cpp index 98f88fa..4d501d2 100644 --- a/deltamodel.cpp +++ b/deltamodel.cpp @@ -8,6 +8,7 @@ DeltaModel::DeltaModel(QObject *parent) QVariant DeltaModel::headerData(int section, Qt::Orientation orientation, int role) const { // FIXME: Implement me! + return QVariant(); } int DeltaModel::rowCount(const QModelIndex &parent) const @@ -15,6 +16,8 @@ int DeltaModel::rowCount(const QModelIndex &parent) const if (!parent.isValid()) return 0; + return 0; + // FIXME: Implement me! } @@ -23,6 +26,8 @@ int DeltaModel::columnCount(const QModelIndex &parent) const if (!parent.isValid()) return 0; + return 0; + // FIXME: Implement me! } diff --git a/graphingwindow.cpp b/graphingwindow.cpp index 6aff9ec..e555f0f 100644 --- a/graphingwindow.cpp +++ b/graphingwindow.cpp @@ -837,7 +837,7 @@ void GraphingWindow::loadDefinitions() for (int b = 0; b < 8; b++) { - if (oldMask & (1 << b)) + if (oldMask & (1ull << b)) { gp.startBit = (8 * oldEnd) + b; break; @@ -846,7 +846,7 @@ void GraphingWindow::loadDefinitions() for (int c = 7; c >= 0; c--) { - if ( oldMask & (1<<(((numBytes - 1) * 8) + c)) ) + if ( oldMask & (1ull << (((numBytes - 1) * 8) + c)) ) { gp.numBits -= (7-c); break; @@ -865,7 +865,7 @@ void GraphingWindow::loadDefinitions() gp.numBits = 8; for (int b = 0; b < 8; b++) { - if (oldMask & (1 << b)) + if (oldMask & (1ull << b)) { gp.startBit = 8 * oldStart + b; gp.numBits = 8 - b; From 8ab304228360be5e8095e2bb932588a110660b46 Mon Sep 17 00:00:00 2001 From: Collin Kidder Date: Tue, 7 Jun 2016 10:58:13 -0400 Subject: [PATCH 4/4] Tweaks to make compiling possible on 32 bit systems. --- canframemodel.cpp | 25 +++++++++++++++++++------ canframemodel.h | 1 + 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/canframemodel.cpp b/canframemodel.cpp index fe54877..ef08b4f 100644 --- a/canframemodel.cpp +++ b/canframemodel.cpp @@ -34,8 +34,21 @@ int CANFrameModel::columnCount(const QModelIndex &index) const CANFrameModel::CANFrameModel(QObject *parent) : QAbstractTableModel(parent) { - frames.reserve(50000000); //yes, preallocating a huge number of frames. - filteredFrames.reserve(50000000); //the goal is to prevent a reallocation from ever happening + + if (QSysInfo::WordSize > 32) + { + qDebug() << "64 bit OS detected. Requesting a large preallocation"; + preallocSize = 50000000; + } + else //if compiling for 32 bit you can't ask for gigabytes of preallocation so tone it down. + { + qDebug() << "32 bit OS detected. Requesting a much restricted prealloc"; + preallocSize = 5000000; + } + + frames.reserve(preallocSize); + filteredFrames.reserve(preallocSize); //the goal is to prevent a reallocation from ever happening + dbcHandler = NULL; interpretFrames = false; overwriteDups = false; @@ -159,7 +172,7 @@ void CANFrameModel::recalcOverwrite() while (frames.count() > lastUnique) frames.removeLast(); filteredFrames.clear(); - filteredFrames.reserve(50000000); + filteredFrames.reserve(preallocSize); for (int i = 0; i < frames.count(); i++) { @@ -360,7 +373,7 @@ void CANFrameModel::sendRefresh() beginResetModel(); filteredFrames.clear(); filteredFrames.append(tempContainer); - filteredFrames.reserve(50000000); + filteredFrames.reserve(preallocSize); lastUpdateNumFrames = filteredFrames.count(); endResetModel(); mutex.unlock(); @@ -416,8 +429,8 @@ void CANFrameModel::clearFrames() frames.clear(); filteredFrames.clear(); filters.clear(); - frames.reserve(50000000); - filteredFrames.reserve(50000000); + frames.reserve(preallocSize); + filteredFrames.reserve(preallocSize); this->endResetModel(); lastUpdateNumFrames = 0; mutex.unlock(); diff --git a/canframemodel.h b/canframemodel.h index 7e93007..a994857 100644 --- a/canframemodel.h +++ b/canframemodel.h @@ -62,6 +62,7 @@ private: bool needFilterRefresh; uint64_t timeOffset; int lastUpdateNumFrames; + uint32_t preallocSize; };