-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed examples, fixed ethercat frame corruption on sending
- Loading branch information
1 parent
6f22412
commit dbe5164
Showing
14 changed files
with
304 additions
and
288 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,43 @@ | ||
#!/usr/bin/python3 | ||
|
||
import sys | ||
import matplotlib | ||
from matplotlib import pyplot as plt | ||
import numpy as np | ||
import pyqtgraph as pg | ||
from eve.apputils import * | ||
from PyQt5.QtGui import QColor | ||
|
||
source = sys.argv[1] | ||
def style(color): | ||
return dict( | ||
pen = (color[0], color[1], color[2], 150), | ||
symbol = 'o', | ||
symbolSize = 3, | ||
symbolBrush = color, | ||
symbolPen = None, | ||
) | ||
|
||
record = [] | ||
for line in open(source, 'r').readlines(): | ||
groups = line.split() | ||
frame = [] | ||
for group in groups: | ||
try: frame.append(int(group)) | ||
except ValueError: break | ||
else: | ||
record.append(frame) | ||
@qtschedule | ||
def show(): | ||
|
||
matplotlib.use('qtagg') | ||
plt.plot(record) | ||
plt.show(block=True) | ||
source = sys.argv[1] | ||
|
||
record = [] | ||
for line in open(source, 'r').readlines(): | ||
groups = line.split() | ||
frame = [] | ||
for group in groups: | ||
try: frame.append(int(group)) | ||
except ValueError: break | ||
else: | ||
record.append(frame) | ||
record = np.array(record) | ||
|
||
pg.setConfigOptions(antialias=True) | ||
win = qtwindow(pg.GraphicsLayoutWidget(title=source)) | ||
win.resize(1000, 300) | ||
fig = win.addPlot() | ||
|
||
colorcycle = [(100, 255, 100), (100, 100, 255), (100, 200, 200), (200, 200, 200), (200, 100, 255), (200, 255, 100)] | ||
for i, slave in enumerate(record.transpose()): | ||
fig.plot(slave, **style(colorcycle[i%len(colorcycle)])) | ||
|
||
qtmain() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.