From 71baf829e62b0d91427728e37a869e3bcea0abea Mon Sep 17 00:00:00 2001 From: Adriano Dal Pastro Date: Thu, 21 May 2026 16:06:43 +0200 Subject: [PATCH] feat(pose_3d): bottone Sblocca braccia --- web/pose_3d.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/web/pose_3d.js b/web/pose_3d.js index f45dad3..370c98a 100644 --- a/web/pose_3d.js +++ b/web/pose_3d.js @@ -574,6 +574,21 @@ function bindPoseButtons() { $('p3PoseDelBtn').addEventListener('click', onDeletePose); } +async function onUnlock() { + clearError(); + try { + await jsonFetch('/api/pose_3d/unlock', { method: 'POST' }); + $('p3Status').textContent = '✓ Braccia sbloccate'; + $('p3Status').className = 'p3-status ok'; + } catch (e) { + showError(`Unlock fallito: ${e.message}`); + } +} + +function bindUnlockButton() { + $('p3UnlockBtn').addEventListener('click', onUnlock); +} + // ----- init triggered on first activation ----- let inited = false; function ensureInit() { @@ -590,6 +605,7 @@ function ensureInit() { bindPreciseControl(); bindJogAutoApply(); bindPoseButtons(); + bindUnlockButton(); pollState(); pollTimer = setInterval(pollState, POLL_MS); }