@@ -590,41 +590,21 @@ def deactivate_flex_mount(self):
590590 result = self .send_command (self .address , 'W035' , '0' )
591591 return map (float , result )
592592
593+ def set_flex_mount (self , angle , distance ):
594+ """Sets the FLEX Mount feature to a specific angle and distance."""
595+ data = '{:.2f};{:.2f}' .format (angle , distance )
596+ return self .send_command (self .address , 'W036' , data )
597+
598+ def teach_flex_mount (self , reference_thickness ):
599+ """Sets the FLEX Mount feature to a specific angle and distance."""
600+ return self .send_command (self .address , 'W037' , str (reference_thickness ))
601+
593602 def adjust_to_dark_object (self , is_dark_object ):
594603 """Adjusts the sensor to detect darker or lighter surfaces."""
595604 data = '1' if is_dark_object else '0'
596605 result = self .send_command (self .address , 'W032' , data )
597606 return map (float , result )
598607
599- # def set_flex_mount(self, angle, distance):
600- # """Sets the FLEX Mount feature to a specific angle and distance."""
601- # # result = self.send_command(self.address, 'W036', ('{:.2f}'.format(angle), '{:.2f}'.format(distance)))
602- # # return map(float, result)
603- # # data = ('{:.2f}'.format(angle), '{:.2f}'.format(distance))
604- # data=('{:.2f}'.format(angle),'{:.2f}'.format(angle))
605- # result = self.send_command(self.address, 'W036', data)
606- # return map(float, result)
607-
608- # def get_live_monitor_data(self):
609- # """Retrieves the distance to the surface in the center of the laser beam and the
610- # angle at which it's found.
611-
612- # Returns:
613- # `list`
614- # angle and distance to the reference surface.
615-
616- # Note
617- # ----
618- # This function is designed to aid in the installation of the sensor at an angle.
619- # """
620- # result = self.send_command(self.address, 'R051')
621-
622- # if len(result) != 2:
623- # raise ProtocolError('Unexpected result: ' + str(result))
624-
625- # return map(float, result[0])
626-
627608 def reset (self ):
628609 """Resets the sensor to factory settings."""
629610 self .send_command (self .address , 'W202' , '0' )
630-
0 commit comments