@blueharford/scrypted-spatial-awareness 0.6.21 → 0.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.nodejs.js +1 -1
- package/dist/main.nodejs.js.map +1 -1
- package/dist/plugin.zip +0 -0
- package/out/main.nodejs.js +11 -7
- package/out/main.nodejs.js.map +1 -1
- package/out/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/core/topology-discovery.ts +8 -4
- package/src/main.ts +3 -0
- package/src/ui/editor-html.ts +2 -2
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/out/main.nodejs.js
CHANGED
|
@@ -36828,7 +36828,13 @@ Use the mount height to help estimate distances - objects at ground level will a
|
|
|
36828
36828
|
this.status.lastScanTime = Date.now();
|
|
36829
36829
|
return null;
|
|
36830
36830
|
}
|
|
36831
|
-
//
|
|
36831
|
+
// ALWAYS generate suggestions from each camera's analysis first
|
|
36832
|
+
// This ensures landmarks and zones from individual cameras are captured
|
|
36833
|
+
for (const analysis of analyses) {
|
|
36834
|
+
this.generateSuggestionsFromAnalysis(analysis);
|
|
36835
|
+
}
|
|
36836
|
+
this.console.log(`[Discovery] Generated suggestions from ${analyses.length} camera analyses`);
|
|
36837
|
+
// Then correlate if we have multiple cameras (adds shared landmarks and connections)
|
|
36832
36838
|
let correlation = null;
|
|
36833
36839
|
if (analyses.length >= 2) {
|
|
36834
36840
|
correlation = await this.correlateScenes(analyses);
|
|
@@ -36836,10 +36842,6 @@ Use the mount height to help estimate distances - objects at ground level will a
|
|
|
36836
36842
|
this.generateSuggestionsFromCorrelation(correlation);
|
|
36837
36843
|
}
|
|
36838
36844
|
}
|
|
36839
|
-
else if (analyses.length === 1) {
|
|
36840
|
-
// Single camera - generate suggestions from its analysis
|
|
36841
|
-
this.generateSuggestionsFromAnalysis(analyses[0]);
|
|
36842
|
-
}
|
|
36843
36845
|
this.status.lastScanTime = Date.now();
|
|
36844
36846
|
this.status.pendingSuggestions = this.getPendingSuggestions().length;
|
|
36845
36847
|
return correlation;
|
|
@@ -40829,6 +40831,8 @@ class SpatialAwarenessPlugin extends sdk_1.ScryptedDeviceBase {
|
|
|
40829
40831
|
const landmarkData = suggestion.landmark;
|
|
40830
40832
|
const distanceFeet = landmarkData.distanceFeet || 50; // Default 50ft if not set
|
|
40831
40833
|
const distanceInPixels = distanceFeet * floorPlanScale;
|
|
40834
|
+
// Debug: log the distance data to verify it's being used correctly
|
|
40835
|
+
this.console.log(`[Discovery] Landmark "${suggestion.landmark.name}" distance data: distanceFeet=${distanceFeet}, distance="${landmarkData.distance || 'not set'}", floorPlanScale=${floorPlanScale}, distanceInPixels=${distanceInPixels}`);
|
|
40832
40836
|
// Use bounding box for horizontal positioning within the FOV
|
|
40833
40837
|
const bbox = landmarkData.boundingBox;
|
|
40834
40838
|
let angleOffset;
|
|
@@ -42463,7 +42467,7 @@ exports.EDITOR_HTML = `<!DOCTYPE html>
|
|
|
42463
42467
|
<div class="modal-overlay" id="add-zone-modal">
|
|
42464
42468
|
<div class="modal">
|
|
42465
42469
|
<h2>Create Zone</h2>
|
|
42466
|
-
<p style="color: #888; margin-bottom: 15px; font-size: 13px;">Click points on the canvas to draw a polygon.
|
|
42470
|
+
<p style="color: #888; margin-bottom: 15px; font-size: 13px;">Click points on the canvas to draw a polygon. Click "Finish Zone" button or press Enter to complete.</p>
|
|
42467
42471
|
<div class="form-group">
|
|
42468
42472
|
<label>Zone Name</label>
|
|
42469
42473
|
<input type="text" id="zone-name-input" placeholder="e.g., Front Yard">
|
|
@@ -43230,7 +43234,7 @@ exports.EDITOR_HTML = `<!DOCTYPE html>
|
|
|
43230
43234
|
ctx.fillStyle = '#fff';
|
|
43231
43235
|
ctx.font = 'bold 12px sans-serif';
|
|
43232
43236
|
ctx.textAlign = 'left';
|
|
43233
|
-
ctx.fillText('Click to add points.
|
|
43237
|
+
ctx.fillText('Click to add points. Click "Finish Zone" button or press Enter to complete. Esc to cancel.', 10, canvas.height - 10);
|
|
43234
43238
|
}
|
|
43235
43239
|
|
|
43236
43240
|
// Draw landmarks first (below cameras and connections)
|