Skip to content

Commit

Permalink
Code base refactored: Icon toolbar, no axes limit, room for new proto…
Browse files Browse the repository at this point in the history
…cols (#1)

* Folder ordering

* More movings

* Added updated version  v1.3.2 of qcustomplot from http://qcustomplot.com/index.php/download

* Updated qcustomplot correctly integrated

* Resources hierarchy and Icons Set

Resource hierarchy fix
*Icon Line Set* icons pack is added in 3 variants (black, qdark text and white colors)
Added Windows exe manifest

* Unified UI colors and tweaks

Lines color list is added
Unstylable GUI colors are added to a separate list
Every reference to a hardcoded color is replaced
[WiP] Removed axes numbering and its limit

* mainwindow.cpp regroup and doxygen friendly comments (WiP)

* Cleaning + working UI (stopbutton bug)

* StopButton bugfix and new screenshot

* Added 'lynny (2x)' icon set

* UI icon alias and lynny fully integrated

* Replaced line colors, now 14, better color progression

* Legend w/ name modify + Channel selection

A legend is added to the plot (top-right) with a little transparency
New channel adds default name text
Double click on legend text allows modify
Click on legend text selects the corresponding channel

* Update screenshot

* Installer files and script + relative paths on project files

* Toolbar connect + disconnect

First approach of toolbar use: Connect (Play) and Disconnect (Stop) are working
README fixes
Installer name fix

* Clear button + UI clearing + Pause working

* Zoom when plotting and Clear working

Zoom is applied both from spinbox and plot, but inversed

* Update README.md + screen

* Update README.md
  • Loading branch information
CieNTi authored Aug 28, 2016
1 parent 36c670f commit 474290b
Show file tree
Hide file tree
Showing 1,750 changed files with 9,134 additions and 3,384 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "res/qdark_stylesheet"]
path = res/qdark_stylesheet
url = https://github.com/ColinDuquesnoy/QDarkStyleSheet.git
67 changes: 59 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
# Serial Port Plotter

This is a Windows application that displays real time data from serial port. I had to create it for a project and I would like to put the code here so more people could use it. The application is 32-bit and built with Qt and QCustomPlot library. It can plot up to three axes and 1000 data points. Plot refresh rate is 20 Hz, independent of incoming data frequency. It can also export JPG with the plot.
This is a Windows application that displays real time data from serial port. The application is 32-bit and built with Qt and QCustomPlot library.

The application supports zooming and dragging using the mouse wheel. Clicking anywhere in the plot displays the X and Y values of the graph in the status bar.
# Features
- No axes limit: An unknown/new channel data create a new graph and uses it
- 14 available line colors (cyclic)
- No data point limit: All received data is kept so user can explore old data
- Exports to PNG
- Zooming and dragging using the mouse wheel (X axis only)
- Moving around the plot displays the X and Y values of the graph in the status bar
- Channel's name legend (double-click to modify)
- Channel selection (click on legend's text)

# Screenshot

![Serial Port Plotter screenshot](gh_assets/screen.jpg)
![Serial Port Plotter screenshot](res/screen_v1.1.0.png)

# How to use the application

Just send your integer data over the serial port. The application expects certain format so it can differentiate between values. Each message you send must start with '$' and end with ';' (semi-colon) and the integers inside need to be space-separated. The Help button displays comprehensive instructions. Example: If you need to plot two values, use this code in your mbed source file:
Just send your integer data over the serial port. The application expects certain format so it can differentiate between values. Each message you send must start with '$' and end with ';' (semi-colon) and the integers inside need to be space-separated. The Help button displays comprehensive instructions.

Use the mouse wheel over controls to change its values and use it over plot area to zoom.

When stopped/paused, plot area can be dragged.

# Send data over the serial port

```c
pc.printf("$%d %d;", data1, data2);
wait_ms(10);
/* Example: Plot two values */
printf ("$%d %d;", data1, data2);
```
Depending on how much data you want to display, you can adjust the number of data points. For example, if you send data from the serial port of the mbed every 10 ms (100 Hz) and the plotter is set to display 500 points, it will contain information for 5 seconds of data.
Expand All @@ -27,5 +39,44 @@ Source and .pro file of the Qt Project are available. A standalone .exe is inclu
# Credits
* Original programmer: [Borislav K](https://developer.mbed.org/users/borislav/ )
* Source: [Serial Port Plotter at mbed forums](https://developer.mbed.org/users/borislav/notebook/serial-port-plotter/)
- [Serial Port Plotter at mbed forums](https://developer.mbed.org/users/borislav/notebook/serial-port-plotter/) by [Borislav K](https://developer.mbed.org/users/borislav/)
- [Line Icon Set](http://www.flaticon.com/packs/line-icon-set) by [Situ Herrera](http://www.flaticon.com/authors/situ-herrera) icon pack
- [Lynny](http://www.1001freedownloads.com/free-vector/lynny-icons-full) icon pack
- [Changelog](http://keepachangelog.com/)
# Changelog
All notable changes to this project will be documented below this line.
This project adheres to [Semantic Versioning](http://semver.org/).
## [1.1.0] - 2016-08-28
### Added
- Original qdarkstyle resources (icons are working now)
- Manifest and all Windows related/recommended configs
- *Line Icon Set* icons in 3 colors
- *Lynny* icons in 3 colors
- Inno Setup file with auto-pack .bat file (installer tested on WinXP-32b and Win10-64b)
- Play/Pause/Stop, Clear and Help toolbar buttons
### Changed
- Resources structure
- Updated qcustomplot to v1.3.2
- Menubar is replaced by icon toolbar for usability
- [WiP] mainwindow.cpp doxygen friendly comments
### Removed
- Control over number of points
- Delete previous graph data
- *Connect* and *Start/Stop plot* buttons
## [1.0.0] - 2014-08-31
### Added
- Original [Borislav Kereziev]([email protected]) work commit [source](https://developer.mbed.org/users/borislav/notebook/serial-port-plotter/)
[1.1.0]: https://github.com/CieNTi/serial_port_plotter/releases/tag/v1.1.0
[1.0.0]: https://github.com/CieNTi/serial_port_plotter/releases/tag/v1.0.0
# To-Do
- Port list refresh
- Fill baud automatically and allow custom by textbox (when COM ui)
- PNG *WITH* transparency
23 changes: 15 additions & 8 deletions SerialPortPlotter.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,32 @@ CONFIG += c++11

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport

TARGET = SerialPortPlotter
TARGET = serial_port_plotter
TEMPLATE = app

SOURCES += main.cpp\
mainwindow.cpp \
qcustomplot.cpp \
qcustomplot/qcustomplot.cpp \
helpwindow.cpp

HEADERS += mainwindow.hpp \
qcustomplot.h \
qcustomplot/qcustomplot.h \
helpwindow.hpp


FORMS += mainwindow.ui \
helpwindow.ui

RC_FILE = myapp.rc

RESOURCES += \
appresources.qrc


res/serial_port_plotter.qrc \
res/qdark_stylesheet/qdarkstyle/style.qrc

# The following line compiles on Release but not on Debug, so this workaroung is used:
# RC_FILE = res/serial_port_plotter.rc
# Call the resource compiler
win32:mkver_rc.target = serial_port_plotter_res.o
win32:mkver_rc.commands = windres --use-temp-file -i ../res/serial_port_plotter.rc -o serial_port_plotter_res.o --include-dir=../res -DVERSION_H_INTERN $(DEFINES)
win32:QMAKE_EXTRA_TARGETS += mkver_rc
win32:PRE_TARGETDEPS += serial_port_plotter_res.o

LIBS += serial_port_plotter_res.o
Loading

0 comments on commit 474290b

Please sign in to comment.