Skip to content
Snippets Groups Projects
Commit 8f2d9559 authored by esarrey's avatar esarrey
Browse files

Merge remote-tracking branch 'refs/remotes/origin/main'

parents 9b9f1d49 c10d4806
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@ pip install nidaqmx
# Todo list
- Redesign the motor control panel
- Joystcick speed | jog speed
- Mesurer plus vite (check NI)
- Menu
- Documentation
......@@ -11,6 +11,7 @@ class Direction(Enum):
class Joystick(QWidget):
joystickMoved = pyqtSignal(Direction, float)
relax = pyqtSignal()
THRESHOLD = 10.0
def __init__(self, parent=None):
......@@ -67,6 +68,7 @@ class Joystick(QWidget):
def mouseReleaseEvent(self, event):
self.grabCenter = False
self.movingOffset = QPointF(0, 0)
self.relax.emit()
self.update()
def mouseMoveEvent(self, event):
......
......@@ -127,17 +127,14 @@ class Stage():
def jog_x(self, dir):
if not self.motor_x.is_moving() and self.open:
sleep(0.1)
self.motor_x.jog(dir)
def jog_y(self, dir):
if not self.motor_y.is_moving() and self.open:
sleep(0.1)
self.motor_y.jog(dir)
def jog_z(self, dir):
if not self.motor_z.is_moving() and self.open:
sleep(0.1)
self.motor_z.jog(dir)
#################################################################
......
from PyQt5 import QtWidgets
from PyQt5.QtGui import QFont
from PyQt5.QtCore import QThread, Qt
from pymeasure.display.widgets import TabWidget
from PyQt5.QtCore import Qt
......@@ -76,6 +78,9 @@ class ControlTab(TabWidget, QtWidgets.QWidget):
super().__init__(parent)
self.name = name
font = QFont()
font.setPointSize(16)
layout = QtWidgets.QGridLayout()
layout.addWidget(QtWidgets.QLabel("Current Position", self), 0, 0, 1, 6)
......@@ -129,6 +134,21 @@ class ControlTab(TabWidget, QtWidgets.QWidget):
layout.addWidget(label_arrows_X, 6, 0, 1, 3)
layout.addWidget(label_arrows_Y, 7, 0, 1, 3)
layout.addWidget(label_arrows_Z, 8, 0, 1, 3)
self.joystick_label_xy = QtWidgets.QLabel('(X, Y) Plane', self)
self.joystick_label_xy.setAlignment(Qt.AlignCenter)
self.joystick_label_xy.setFont(font)
self.joystick_label_zy = QtWidgets.QLabel('(Z, Y) Plane', self)
self.joystick_label_zy.setAlignment(Qt.AlignCenter)
self.joystick_label_zy.setFont(font)
self.joystick_xy = Joystick()
self.joystick_zy = Joystick()
self.joystick_xy.joystickMoved.connect(self.move_stage_xy)
self.joystick_xy.relax.connect(self.stop_stage)
self.joystick_zy.joystickMoved.connect(self.move_stage_yz)
self.joystick_zy.relax.connect(self.stop_stage)
group1 = ArrowButtonGroup(self, 'x')
group2 = ArrowButtonGroup(self, 'y')
......
......@@ -356,6 +356,7 @@ class UIWindowBase(QtWidgets.QMainWindow):
when it is called by the button and calls the `self.queue` method without
any arguments.
"""
self.widget_list[0].close_connections() # Not clean because works only for this really specific case
for i in range(self.number_repetitions):
self.queue()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment