|
| 1 | +# waveCanvas widget |
| 2 | +# Furrtek 2025 |
| 3 | + |
| 4 | +import time |
| 5 | + |
1 | 6 | from PyQt5 import QtCore, QtGui, QtWidgets
|
2 | 7 | from PyQt5.QtCore import QSize, Qt, pyqtSignal
|
3 | 8 | from PyQt5.QtWidgets import QWidget
|
4 | 9 |
|
5 |
| -import time |
6 |
| - |
7 | 10 | class waveCanvas(QWidget):
|
8 | 11 | clicked = pyqtSignal(int, bool)
|
9 | 12 | scrolled = pyqtSignal(int)
|
10 | 13 |
|
11 |
| - #def __init__(self, parent = None): |
12 | 14 | def __init__(self, sampleCount, showCursor, enableScrolling):
|
13 | 15 | QWidget.__init__(self)
|
14 | 16 | self.setMouseTracking(True)
|
@@ -146,7 +148,7 @@ def paintEvent(self, e):
|
146 | 148 | # Block stripes, if enabled
|
147 | 149 | if self.blockView:
|
148 | 150 | blockColorAlt = 0 if self.sampleStart & 512 else 1 # Start color
|
149 |
| - blockCount = (self.sampleCount // 2) >> 8 |
| 151 | + blockCount = self.sampleCount >> 9 |
150 | 152 | blockOffset = int((512 - (self.sampleStart & 511)) / self.XDelta)
|
151 | 153 | blockWidth = width / blockCount
|
152 | 154 |
|
@@ -179,7 +181,7 @@ def paintEvent(self, e):
|
179 | 181 | pen_a = QtGui.QPen(QtGui.QColor('darkRed'))
|
180 | 182 | pen_b = QtGui.QPen(QtGui.QColor('darkGreen'))
|
181 | 183 | for reset in self.vfile.resets:
|
182 |
| - v = ((reset[0] * 2) << 8) - self.sampleStart |
| 184 | + v = (reset[0] << 9) - self.sampleStart |
183 | 185 | if v >= 0 and v < self.sampleStart + self.sampleCount:
|
184 | 186 | x_pos = int(v / self.XDelta)
|
185 | 187 | painter.setPen(pen_b if reset[1] else pen_a)
|
|
0 commit comments