def on_play_tool_clicked(self, event): if ciclop_scan._inactive: self._enable_tool_scan(self.play_tool, False) self._enable_tool_scan(self.pause_tool, True) ciclop_scan.resume() else: if not calibration_data.check_calibration(): dlg = wx.MessageDialog(self, _("Calibration parameters are not correct.\n" "Please perform calibration process:\n" " 1. Scanner autocheck\n" " 2. Laser triangulation\n" " 3. Platform extrinsics"), _("Wrong calibration parameters"), wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy() return if profile.settings['laser_triangulation_hash'] != calibration_data.md5_hash(): dlg = wx.MessageDialog(self, _("Laser triangulation calibration has been performed \n" "with different camera intrinsics values.\n" "Please perform Laser triangulation calibration again:\n" " 1. Scanner autocheck\n" " 2. Laser triangulation"), _("Wrong calibration parameters"), wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy() return if profile.settings['platform_extrinsics_hash'] != calibration_data.md5_hash(): dlg = wx.MessageDialog(self, _("Platform extrinsics calibration has been performed \n" "with different camera intrinsics values.\n" "Please perform Platform extrinsics calibration again:\n" " 1. Scanner autocheck\n" " 2. Platform extrinsics"), _("Wrong calibration parameters"), wx.OK | wx.ICON_ERROR) dlg.ShowModal() dlg.Destroy() return result = True if self.scene_view._object is not None: dlg = wx.MessageDialog(self, _("Your current model will be deleted.\n" "Are you sure you want to delete it?"), _("Clear point cloud"), wx.YES_NO | wx.ICON_QUESTION) result = dlg.ShowModal() == wx.ID_YES dlg.Destroy() if result: ciclop_scan.set_callbacks(self.before_scan, None, lambda r: wx.CallAfter(self.after_scan, r)) ciclop_scan.start()
def on_stop_tool_clicked(self, event): paused = ciclop_scan._inactive ciclop_scan.pause() dlg = wx.MessageDialog(self, _("Your current scanning will be stopped.\n" "Are you sure you want to stop?"), _("Stop scanning"), wx.YES_NO | wx.ICON_QUESTION) result = dlg.ShowModal() == wx.ID_YES dlg.Destroy() if result: self.scanning = False ciclop_scan.stop() # Flush video image_capture.capture_texture() image_capture.capture_texture() image_capture.capture_texture() self.on_scan_finished() else: if not paused: ciclop_scan.resume()