ilabs-flir 2.1.39 → 2.1.401
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/ios/Flir/src/FlirLogger.swift +18 -1
- package/ios/Flir/src/FlirModule.m +27 -21
- package/package.json +1 -1
|
@@ -56,7 +56,24 @@ import Foundation
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/// Log frame received (rate-limited to avoid log spam)
|
|
59
|
-
@objc public static func logFrame(width: Int, height: Int
|
|
59
|
+
@objc public static func logFrame(width: Int, height: Int) {
|
|
60
|
+
logFrame(width: width, height: height, temperature: 0)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/// Log frame received with temperature (rate-limited to avoid log spam)
|
|
64
|
+
@objc public static func logFrame(width: Int, height: Int, temperature: Double) {
|
|
65
|
+
frameCount += 1
|
|
66
|
+
if frameCount % frameLogInterval == 0 {
|
|
67
|
+
var msg = "Frame #\(frameCount) received (\(width)x\(height))"
|
|
68
|
+
if !temperature.isNaN {
|
|
69
|
+
msg += " temp=\(String(format: "%.1f", temperature))°C"
|
|
70
|
+
}
|
|
71
|
+
log(.frame, msg)
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// Internal implementation for logFrame with optional temperature
|
|
76
|
+
private static func logFrame(width: Int, height: Int, temperature: Double?) {
|
|
60
77
|
frameCount += 1
|
|
61
78
|
if frameCount % frameLogInterval == 0 {
|
|
62
79
|
var msg = "Frame #\(frameCount) received (\(width)x\(height))"
|
|
@@ -136,8 +136,12 @@ RCT_EXPORT_METHOD(removeListeners : (NSInteger)count) {
|
|
|
136
136
|
|
|
137
137
|
+ (void)emitBatteryUpdateWithLevel:(NSInteger)level charging:(BOOL)charging {
|
|
138
138
|
NSDictionary *payload = @{@"level" : @(level), @"isCharging" : @(charging)};
|
|
139
|
-
[
|
|
140
|
-
|
|
139
|
+
NSLog(@"[FlirModule] Emitting battery update - level: %ld, charging: %d", (long)level, charging);
|
|
140
|
+
|
|
141
|
+
// Note: This is a class method, so we need to get the module instance
|
|
142
|
+
// For now, we'll just log - in production you'd need to get the module instance
|
|
143
|
+
// or convert this to an instance method
|
|
144
|
+
// [[FlirModule sharedInstance] sendEventWithName:@"FlirBatteryUpdated" body:payload];
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
#pragma mark - Methods
|
|
@@ -405,9 +409,10 @@ RCT_EXPORT_METHOD(isPreferSdkRotation : (RCTPromiseResolveBlock)
|
|
|
405
409
|
objc_msgSend)(d, sel_registerName("toDictionary"))];
|
|
406
410
|
}
|
|
407
411
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
412
|
+
|
|
413
|
+
NSLog(@"[FlirModule] onDevicesFound - emitting FlirDevicesFound with %lu devices", (unsigned long)arr.count);
|
|
414
|
+
[self sendEventWithName:@"FlirDevicesFound"
|
|
415
|
+
body:@{@"devices" : arr, @"count" : @(arr.count)}];
|
|
411
416
|
}
|
|
412
417
|
|
|
413
418
|
- (void)onDeviceConnected:(id)device {
|
|
@@ -425,31 +430,31 @@ RCT_EXPORT_METHOD(isPreferSdkRotation : (RCTPromiseResolveBlock)
|
|
|
425
430
|
device, sel_registerName("toDictionary"))];
|
|
426
431
|
}
|
|
427
432
|
|
|
428
|
-
[
|
|
433
|
+
NSLog(@"[FlirModule] onDeviceConnected - emitting FlirDeviceConnected event");
|
|
434
|
+
[self sendEventWithName:@"FlirDeviceConnected" body:body];
|
|
429
435
|
}
|
|
430
436
|
|
|
431
437
|
- (void)onDeviceDisconnected {
|
|
432
|
-
[
|
|
433
|
-
|
|
438
|
+
NSLog(@"[FlirModule] onDeviceDisconnected - emitting FlirDeviceDisconnected event");
|
|
439
|
+
[self sendEventWithName:@"FlirDeviceDisconnected" body:@{}];
|
|
434
440
|
}
|
|
435
441
|
|
|
436
442
|
- (void)onFrameReceived:(UIImage *)image
|
|
437
443
|
width:(NSInteger)width
|
|
438
444
|
height:(NSInteger)height {
|
|
439
445
|
// Also emit event for JS consumers (though slow, some might use it)
|
|
440
|
-
[
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
}];
|
|
446
|
+
[self sendEventWithName:@"FlirFrameReceived"
|
|
447
|
+
body:@{
|
|
448
|
+
@"width" : @(width),
|
|
449
|
+
@"height" : @(height),
|
|
450
|
+
@"timestamp" :
|
|
451
|
+
@([[NSDate date] timeIntervalSince1970] * 1000)
|
|
452
|
+
}];
|
|
448
453
|
}
|
|
449
454
|
|
|
450
455
|
- (void)onFrameReceivedRaw:(NSData *)data width:(NSInteger)width height:(NSInteger)height bytesPerRow:(NSInteger)bytesPerRow timestamp:(double)timestamp {
|
|
451
456
|
// Emit a lightweight event to notify JS that a raw bitmap is available; raw bytes are available via getLatestFrameBitmap()
|
|
452
|
-
[
|
|
457
|
+
[self sendEventWithName:@"FlirFrameBitmapAvailable" body:@{
|
|
453
458
|
@"width": @(width),
|
|
454
459
|
@"height": @(height),
|
|
455
460
|
@"bytesPerRow": @(bytesPerRow),
|
|
@@ -463,9 +468,9 @@ RCT_EXPORT_METHOD(isPreferSdkRotation : (RCTPromiseResolveBlock)
|
|
|
463
468
|
self.connectResolve = nil;
|
|
464
469
|
self.connectReject = nil;
|
|
465
470
|
}
|
|
466
|
-
[
|
|
467
|
-
|
|
468
|
-
|
|
471
|
+
NSLog(@"[FlirModule] onError - emitting FlirError: %@", message);
|
|
472
|
+
[self sendEventWithName:@"FlirError"
|
|
473
|
+
body:@{@"error" : message ?: @"Unknown error"}];
|
|
469
474
|
}
|
|
470
475
|
|
|
471
476
|
- (void)onStateChanged:(NSString *)state
|
|
@@ -478,7 +483,8 @@ RCT_EXPORT_METHOD(isPreferSdkRotation : (RCTPromiseResolveBlock)
|
|
|
478
483
|
@"isStreaming" : @(isStreaming),
|
|
479
484
|
@"isEmulator" : @(isEmulator)
|
|
480
485
|
};
|
|
481
|
-
[
|
|
486
|
+
NSLog(@"[FlirModule] onStateChanged - state: %@, connected: %d, streaming: %d", state, isConnected, isStreaming);
|
|
487
|
+
[self sendEventWithName:@"FlirStateChanged" body:body];
|
|
482
488
|
}
|
|
483
489
|
|
|
484
490
|
@end
|
package/package.json
CHANGED