Skip to content
Snippets Groups Projects
Commit 0d2617e5 authored by Generic Bliss account for Control Software's avatar Generic Bliss account for Control Software
Browse files

add qr code functionality

parent 4bbf58bf
Branches add_qr_code
No related tags found
No related merge requests found
Pipeline #216759 passed
......@@ -413,6 +413,8 @@ class TomoSampleChanger(Device):
self.attr_ParkingPosition_read = False
self.attr_SafetyChainOK_read = False
self.attr_RobotSpeed_read = "None"
self.attr_QRCode_read = False
self.attr_QRCodeValue_read = "None"
# init flags for state and status
self.init_done = False
self.init_error = None
......@@ -475,7 +477,8 @@ class TomoSampleChanger(Device):
robot.cs8LibraryName = 'id19tomo'
elif self.robot_controller == "bm05":
from StaubPy.bm05Controller2 import BM05Controller2
robot = BM05Controller2(controllerAssociated=self.robot_host, logOnController=False)
#robot = BM05Controller2(controllerAssociated=self.robot_host, logOnController=False)
robot = BM05Controller2(controllerAssociated=self.robot_host, logOnController=False, qrcodeReaderIP="172.29.132.125",qrcodeScanEachLoading=True)
robot.cs8LibraryName = 'bm05tomo'
elif self.robot_controller == "sim":
import mock
......@@ -602,6 +605,44 @@ class TomoSampleChanger(Device):
# PROTECTED REGION ID(TomoSampleChanger.set_speed) ENABLED START #
self.robot.accelForLargeMovesMultiplicator = speed
# PROTECTED REGION END # // TomoSampleChanger.set_speed
scan_qr_code = attribute(
label="Scan QR Code",
dtype=bool,
fget="get_scan_qr_code", fset="set_scan_qr_code",
doc="sample changer qr code reader")
def get_scan_qr_code(self):
# PROTECTED REGION ID(TomoSampleChanger.get_scan_qr_code) ENABLED START #
if self.is_moving == False:
self.attr_QRCode_read = self.robot.qrcodeScanEachLoading
return self.attr_QRCode_read
# PROTECTED REGION END # // TomoSampleChanger.get_scan_qr_code
def set_scan_qr_code(self, scan_qr_code):
# PROTECTED REGION ID(TomoSampleChanger.set_scan_qr_code) ENABLED START #
self.robot.qrcodeScanEachLoading = scan_qr_code
# PROTECTED REGION END # // TomoSampleChanger.set_scan_qr_code
qr_code = attribute(
label="QR Code",
dtype=bool,
fget="get_qr_code",
doc="sample changer qr code value")
def get_qr_code(self):
# PROTECTED REGION ID(TomoSampleChanger.get_scan_qr_code) ENABLED START #
if self.robot.qrcodeScanEachLoading:
if self.is_moving == False:
if self.robot.lastqrCodeReaded != "QRCODE_NOT_READABLE":
self.attr_QRCodeValue_read = self.robot.lastqrCodeReaded
elif self.robot.lastqrCodeReaded2 != "QRCODE_NOT_READABLE":
self.attr_QRCodeValue_read = self.robot.lastqrCodeReaded2
elif self.robot.lastqrCodeReaded3 != "QRCODE_NOT_READABLE":
self.attr_QRCodeValue_read = self.robot.lastqrCodeReaded3
return self.attr_QRCodeValue_read
# PROTECTED REGION END # // TomoSampleChanger.get_scan_qr_code
# --------
# Commands
# --------
......
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