Skip to content

Commit c91b651

Browse files
authored
Merge pull request #72 from taunoe/arendus
Arendus
2 parents acd831f + 243567c commit c91b651

File tree

8 files changed

+91
-27
lines changed

8 files changed

+91
-27
lines changed

Arduino_examples/Labels/Labels.ino

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 20.02.2021 Tauno Erik
3+
*/
4+
5+
6+
void setup() {
7+
Serial.begin(115200);
8+
9+
randomSeed(analogRead(0));
10+
}
11+
12+
void loop() {
13+
// print a random numbers
14+
long r1 = random(10);
15+
long r2 = random(10, 20);
16+
long r3 = random(20, 30);
17+
long r4 = random(30, 40);
18+
long r5 = random(40, 50);
19+
20+
Serial.print("First");
21+
Serial.print(r1);
22+
23+
Serial.print("Second");
24+
Serial.print(r2*1.2);
25+
26+
Serial.print("Third");
27+
Serial.print(r3);
28+
29+
Serial.print("Fourth");
30+
Serial.print(r4);
31+
32+
Serial.print("Fifth");
33+
Serial.print(r5);
34+
/*
35+
long r6 = random(50, 60);
36+
Serial.print("Sight");
37+
Serial.print(r6);
38+
39+
long r7 = random(60, 70);
40+
Serial.print("Seventh");
41+
Serial.print(r7);
42+
43+
long r8 = random(70, 80);
44+
Serial.print("Label 8");
45+
Serial.print(r8/1.5);
46+
*/
47+
Serial.println("Min:0, Max:100");
48+
49+
delay(100);
50+
}
51+
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 20.02.2021 Tauno Erik
2+
* Copyright 19.10.2023 Tauno Erik
33
*/
44

55

@@ -12,37 +12,40 @@ void setup() {
1212
void loop() {
1313
// print a random numbers
1414
long r1 = random(10);
15+
long r2 = random(10, 20);
16+
long r3 = random(20, 30);
17+
long r4 = random(30, 40);
18+
long r5 = random(40, 50);
19+
20+
Serial.print("First");
1521
Serial.print(r1);
16-
Serial.print("_");
1722

18-
long r2 = random(10, 20);
23+
Serial.print("-");
1924
Serial.print(r2*1.2);
20-
Serial.print(",");
21-
22-
long r3 = random(20, 30);
23-
Serial.print(r3);
25+
2426
Serial.print(".");
27+
Serial.print(r3);
2528

26-
long r4 = random(30, 40);
29+
Serial.print("_");
2730
Serial.print(r4);
28-
Serial.print("a");
29-
30-
long r5 = random(40, 50);
31+
32+
Serial.print(" ");
3133
Serial.print(r5);
32-
Serial.print(":");
33-
34+
/*
3435
long r6 = random(50, 60);
36+
Serial.print("Sight");
3537
Serial.print(r6);
36-
Serial.print(";");
3738
3839
long r7 = random(60, 70);
40+
Serial.print("Seventh");
3941
Serial.print(r7);
40-
Serial.print("!");
4142
4243
long r8 = random(70, 80);
44+
Serial.print("Label 8");
4345
Serial.print(r8/1.5);
44-
46+
*/
4547
Serial.println("Min:0, Max:100");
4648

4749
delay(100);
4850
}
51+

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Tauno Serial Plotter
2+
23
[![tauno-serial-plotter](https://snapcraft.io/tauno-serial-plotter/badge.svg)](https://snapcraft.io/tauno-serial-plotter)
34

45
Serial Plotter for Arduino and other embedded devices.
@@ -17,10 +18,14 @@ Serial Plotter for Arduino and other embedded devices.
1718

1819
Do not add new line between multiple data items. Only in the end.
1920

21+
Label names cannot contain numbers.
22+
23+
If all data is not labelled. Then the labels will not be displayed.
24+
2025
```C++
21-
Serial.print("Label1");
26+
Serial.print("Label");
2227
Serial.print(data1);
23-
Serial.print("Label2");
28+
Serial.print("Label");
2429
Serial.print(data2);
2530
Serial.println();
2631
```

art.taunoerik.tauno-serial-plotter.appdata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@
5050
<content_rating type="oars-1.1" />
5151

5252
<releases>
53-
<release version="1.19.0" date="2023-10-01"/>
53+
<release version="1.19.10" date="2023-10-19"/>
5454
</releases>
5555
</component>

inno-setup-script.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
33

44
#define MyAppName "Tauno Serial Plotter"
5-
#define MyAppVersion "1.19.0"
5+
#define MyAppVersion "1.19.1"
66
#define MyAppPublisher "taunoerik.art"
77
#define MyAppURL "https://github.com/taunoe/tauno-serial-plotter"
88
#define SourcePath "C:\Users\tauno\Downloads\tauno-serial-plotter\dist\tauno-serial-plotter"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setuptools.setup(
1111
name="tauno-serial-plotter",
12-
version="1.18.9",
12+
version="1.19.1",
1313
author="Tauno Erik",
1414
author_email="[email protected]",
1515
description="Tauno-Serial-Plotter is simple serial plotter for Arduino and others.",

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: tauno-serial-plotter
22
base: core18
3-
version: '1.19.0'
3+
version: '1.19.1'
44
summary: Simple serial plotter
55
description: |
66
Tauno Serial Plotter is simple serial plotter for Arduino and others.

src/tauno-serial-plotter.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
File: Tauno-Serial-Plotter.py
44
Author: Tauno Erik
55
Started:07.03.2020
6-
Edited: 01.10.2023
6+
Edited: 19.10.2023
77
88
TODO:
99
- Add labels/legends
@@ -23,7 +23,7 @@
2323
import pyqtgraph as pg
2424
import platform
2525

26-
VERSION = '1.19.0'
26+
VERSION = '1.19.1'
2727
TIMESCALESIZE = 400 # = self.plot_timescale and self.plot_data_size
2828

2929
stop_port_scan = False # To kill port scan thread when sys.exit
@@ -335,8 +335,13 @@ def __init__(self, nr_plot_lines='1', labels=["sensor1"]):
335335
pen = pg.mkPen(color=(plot_colors[color_i]), width=3)
336336

337337
brush = pg.mkBrush(color=(plot_colors[color_i]))
338-
#
339-
line = self.serialplot.plot(x=self.x_axis, y=self.y_axis[i], name=self.data_labels[i],
338+
# Quick fix:
339+
# https://github.com/taunoe/tauno-serial-plotter/issues/71#issuecomment-1769499968
340+
if len(self.data_labels) == len(self.y_axis):
341+
line = self.serialplot.plot(x=self.x_axis, y=self.y_axis[i], name=self.data_labels[i],
342+
pen=pen, symbol='o', symbolBrush=brush, symbolSize=3)
343+
else:
344+
line = self.serialplot.plot(x=self.x_axis, y=self.y_axis[i],
340345
pen=pen, symbol='o', symbolBrush=brush, symbolSize=3)
341346
self.data_lines.append(line)
342347
# END of class Plot ------------------------------------------------------
@@ -457,7 +462,7 @@ def __init__(self, app, parent=None):
457462
self.plot_exist = False
458463
self.is_fullscreen = False
459464

460-
self.labels = ["sensor"]
465+
self.labels = ["label"]
461466
self.ports = [''] # list of avablie devices
462467
self.selected_port = self.ports[0] # '/dev/ttyACM0'
463468
self.baudrates = [

0 commit comments

Comments
 (0)