ilabs-flir 2.3.1 → 2.3.2

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.
@@ -241,8 +241,8 @@ object FlirManager {
241
241
  /**
242
242
  * Capture a high-fidelity radiometric snapshot (saves thermal data)
243
243
  */
244
- fun captureRadiometricSnapshot(path: String) {
245
- sdkManager?.captureRadiometricSnapshot(path)
244
+ fun captureRadiometricSnapshot(path: String, callback: FlirSdkManager.SnapshotCallback? = null) {
245
+ sdkManager?.captureRadiometricSnapshot(path, callback)
246
246
  }
247
247
 
248
248
  /**
@@ -257,6 +257,20 @@ class FlirModule(private val reactContext: ReactApplicationContext) : ReactConte
257
257
  }
258
258
  }
259
259
 
260
+ @ReactMethod
261
+ fun setSaveRadiometric(enabled: Boolean, promise: Promise?) {
262
+ try {
263
+ val varClass = Class.forName("ilabs.libs.io.data.Var")
264
+ val field = varClass.getField("saveRadiometric")
265
+ field.set(null, enabled)
266
+ Log.d(TAG, "Updated Var.saveRadiometric to $enabled via reflection")
267
+ promise?.resolve(true)
268
+ } catch (e: Exception) {
269
+ Log.w(TAG, "Could not update Var.saveRadiometric via reflection: ${e.message}")
270
+ promise?.reject("ERR_FLIR_SAVE_RADIOMETRIC", e)
271
+ }
272
+ }
273
+
260
274
  @ReactMethod
261
275
  fun updateAcol(value: Float, promise: Promise?) {
262
276
  try {
@@ -73,6 +73,13 @@ public class FlirSdkManager {
73
73
  void onError(String message);
74
74
  }
75
75
 
76
+ public interface SnapshotCallback {
77
+ void onSnapshotSaved(String path);
78
+ void onSnapshotError(String message);
79
+ }
80
+
81
+ private SnapshotCallback snapshotCallback;
82
+
76
83
  private FlirSdkManager(Context context) {
77
84
  this.context = context.getApplicationContext();
78
85
  }
@@ -364,13 +371,19 @@ public class FlirSdkManager {
364
371
  try {
365
372
  thermalImage.saveAs(snapshotPath);
366
373
  Log.i(TAG, "Radiometric snapshot saved to: " + snapshotPath);
374
+ if (snapshotCallback != null) {
375
+ snapshotCallback.onSnapshotSaved(snapshotPath);
376
+ }
367
377
  } catch (java.io.IOException e) {
368
378
  Log.e(TAG, "Failed to save radiometric snapshot", e);
379
+ if (snapshotCallback != null) {
380
+ snapshotCallback.onSnapshotError(e.getMessage());
381
+ }
369
382
  }
370
383
  }
371
384
 
372
385
  // 3. Generate Bitmap for display
373
- Bitmap bitmap = BitmapAndroid.createBitmap(thermalImage.getImage()).getBitMap();
386
+ Bitmap bitmap = BitmapAndroid.createBitmap(streamer.getImage()).getBitMap();
374
387
  if (bitmap != null) {
375
388
  latestBitmap = bitmap;
376
389
  if (listener != null) {
@@ -462,8 +475,9 @@ public class FlirSdkManager {
462
475
  Log.d(TAG, "Requested palette: " + paletteName);
463
476
  }
464
477
 
465
- public void captureRadiometricSnapshot(String path) {
478
+ public void captureRadiometricSnapshot(String path, SnapshotCallback callback) {
466
479
  this.pendingSnapshotPath = path;
480
+ this.snapshotCallback = callback;
467
481
  Log.d(TAG, "Pending radiometric snapshot: " + path);
468
482
  }
469
483
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ilabs-flir",
3
- "version": "2.3.1",
3
+ "version": "2.3.2",
4
4
  "description": "FLIR Thermal SDK for React Native - iOS & Android (bundled at compile time via postinstall)",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
@@ -55,9 +55,9 @@
55
55
  "adm-zip": "^0.5.10"
56
56
  },
57
57
  "devDependencies": {
58
- "typescript": "^5.0.0",
59
58
  "@types/react": "*",
60
- "@types/react-native": "*"
59
+ "@types/react-native": "*",
60
+ "typescript": "^5.0.0"
61
61
  },
62
62
  "react-native": {
63
63
  "ios": {