ilabs-flir 1.0.2 → 1.0.4
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/Flir.podspec +31 -31
- package/README.md +1271 -1271
- package/android/Flir/build.gradle.kts +85 -80
- package/android/Flir/libs/flir-stubs.jar +0 -0
- package/android/Flir/src/main/AndroidManifest.xml +31 -31
- package/android/Flir/src/main/java/com/flir/thermalsdk/ErrorCode.java +13 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/ErrorCodeException.java +14 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/ThermalSdkAndroid.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/androidsdk/image/BitmapAndroid.java +20 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/ImageBuffer.java +11 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/JavaImageBuffer.java +35 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/Palette.java +15 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/PaletteManager.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/Point.java +11 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/ThermalImage.java +23 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/image/ThermalValue.java +9 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/Camera.java +26 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/CameraType.java +8 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/CommunicationInterface.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/ConnectParameters.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/Identity.java +23 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/IpSettings.java +9 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/RemoteControl.java +16 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/connectivity/ConnectionStatusListener.java +7 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/discovery/DiscoveryEventListener.java +14 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/discovery/DiscoveryFactory.java +33 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/remote/OnReceived.java +5 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/remote/OnRemoteError.java +7 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/streaming/Stream.java +8 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/streaming/ThermalStreamer.java +28 -0
- package/android/Flir/src/main/java/com/flir/thermalsdk/live/streaming/VisualStreamer.java +18 -0
- package/android/Flir/src/main/java/flir/android/FlirCommands.java +136 -0
- package/android/Flir/src/main/java/flir/android/FlirDownloadManager.kt +76 -75
- package/android/Flir/src/main/java/flir/android/FlirDownloadPackage.kt +16 -16
- package/android/Flir/src/main/java/flir/android/FlirFrameCache.kt +6 -6
- package/android/Flir/src/main/java/flir/android/FlirManager.kt +477 -248
- package/android/Flir/src/main/java/flir/android/FlirModule.kt +74 -74
- package/android/Flir/src/main/java/flir/android/FlirPackage.kt +19 -19
- package/android/Flir/src/main/java/flir/android/FlirSDKLoader.kt +165 -117
- package/android/Flir/src/main/java/flir/android/FlirSdkManager.java +1511 -0
- package/android/Flir/src/main/java/flir/android/FlirStatus.kt +12 -12
- package/android/Flir/src/main/java/flir/android/FlirView.kt +48 -48
- package/android/Flir/src/main/java/flir/android/FlirViewManager.kt +13 -13
- package/app.plugin.js +264 -264
- package/expo-module.config.json +5 -5
- package/ios/Flir/Framework/ThermalSDK/FLIRBattery.h +76 -76
- package/ios/Flir/Framework/ThermalSDK/FLIRCalibration.h +108 -108
- package/ios/Flir/Framework/ThermalSDK/FLIRCamera.h +156 -156
- package/ios/Flir/Framework/ThermalSDK/FLIRCameraDeviceInfo.h +53 -53
- package/ios/Flir/Framework/ThermalSDK/FLIRCameraEvent.h +132 -132
- package/ios/Flir/Framework/ThermalSDK/FLIRCameraImport.h +204 -204
- package/ios/Flir/Framework/ThermalSDK/FLIRColorDistributionSettings.h +204 -204
- package/ios/Flir/Framework/ThermalSDK/FLIRColorizer.h +82 -82
- package/ios/Flir/Framework/ThermalSDK/FLIRDiscoveredCamera.h +44 -44
- package/ios/Flir/Framework/ThermalSDK/FLIRDiscovery.h +132 -132
- package/ios/Flir/Framework/ThermalSDK/FLIRDisplaySettings.h +29 -29
- package/ios/Flir/Framework/ThermalSDK/FLIRFocus.h +70 -70
- package/ios/Flir/Framework/ThermalSDK/FLIRFusion.h +192 -192
- package/ios/Flir/Framework/ThermalSDK/FLIRFusionController.h +136 -136
- package/ios/Flir/Framework/ThermalSDK/FLIRFusionTransformation.h +35 -35
- package/ios/Flir/Framework/ThermalSDK/FLIRIdentity.h +264 -264
- package/ios/Flir/Framework/ThermalSDK/FLIRImageBase.h +196 -196
- package/ios/Flir/Framework/ThermalSDK/FLIRImageColorizer.h +26 -26
- package/ios/Flir/Framework/ThermalSDK/FLIRImageStatistics.h +61 -61
- package/ios/Flir/Framework/ThermalSDK/FLIRIsotherms.h +208 -208
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementArea.h +38 -38
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementCollection.h +147 -147
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementDelta.h +62 -62
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementDimensions.h +33 -33
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementEllipse.h +49 -49
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementLine.h +66 -66
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementMarker.h +69 -69
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementParameters.h +41 -41
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementRectangle.h +36 -36
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementReference.h +27 -27
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementShape.h +46 -46
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementSpot.h +33 -33
- package/ios/Flir/Framework/ThermalSDK/FLIRMeasurementsController.h +160 -160
- package/ios/Flir/Framework/ThermalSDK/FLIRMeterLinkSensorPoll.h +247 -247
- package/ios/Flir/Framework/ThermalSDK/FLIROverlayController.h +27 -27
- package/ios/Flir/Framework/ThermalSDK/FLIRPalette.h +60 -60
- package/ios/Flir/Framework/ThermalSDK/FLIRPaletteController.h +36 -36
- package/ios/Flir/Framework/ThermalSDK/FLIRPaletteManager.h +97 -97
- package/ios/Flir/Framework/ThermalSDK/FLIRQuantification.h +55 -55
- package/ios/Flir/Framework/ThermalSDK/FLIRRemoteControl.h +393 -393
- package/ios/Flir/Framework/ThermalSDK/FLIRRenderer.h +35 -35
- package/ios/Flir/Framework/ThermalSDK/FLIRRendererImpl.h +17 -17
- package/ios/Flir/Framework/ThermalSDK/FLIRScale.h +99 -99
- package/ios/Flir/Framework/ThermalSDK/FLIRScaleController.h +44 -44
- package/ios/Flir/Framework/ThermalSDK/FLIRStream.h +109 -109
- package/ios/Flir/Framework/ThermalSDK/FLIRStreamer.h +124 -124
- package/ios/Flir/Framework/ThermalSDK/FLIRSystem.h +40 -40
- package/ios/Flir/Framework/ThermalSDK/FLIRTemperatureRange.h +43 -43
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalDelta.h +77 -77
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalImage.h +331 -331
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalImageFile.h +56 -56
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalParameters.h +31 -31
- package/ios/Flir/Framework/ThermalSDK/FLIRThermalValue.h +92 -92
- package/ios/Flir/Framework/ThermalSDK/FLIRWirelessCameraDetails.h +88 -88
- package/ios/Flir/Framework/ThermalSDK/ThermalSDK.h +73 -73
- package/ios/Flir/SDKLoader/FlirSDKLoader.m +13 -13
- package/ios/Flir/SDKLoader/FlirSDKLoader.swift +175 -175
- package/ios/Flir/src/FlirEventEmitter.h +12 -12
- package/ios/Flir/src/FlirEventEmitter.m +33 -33
- package/ios/Flir/src/FlirModule.h +10 -10
- package/ios/Flir/src/FlirModule.m +381 -381
- package/ios/Flir/src/FlirPreviewView.h +13 -13
- package/ios/Flir/src/FlirPreviewView.m +24 -24
- package/ios/Flir/src/FlirState.h +20 -20
- package/ios/Flir/src/FlirState.m +79 -79
- package/ios/Flir/src/FlirViewManager.h +9 -9
- package/ios/Flir/src/FlirViewManager.m +16 -16
- package/package.json +60 -60
- package/react-native.config.js +14 -14
- package/scripts/copy_ios_libs.sh +32 -32
- package/scripts/create_stubs.py +174 -174
- package/scripts/download-sdk.js +62 -62
- package/scripts/prepare-binaries.sh +171 -171
- package/sdk-manifest.json +37 -30
- package/src/FlirDownload.ts +78 -78
- package/src/index.d.ts +17 -17
- package/src/index.js +7 -7
- package/src/index.ts +7 -7
- package/android/Flir/src/main/java/flir/android/CameraHandler.java +0 -194
- package/android/Flir/src/main/java/flir/android/FlirController.kt +0 -11
- package/android/Flir/src/main/java/flir/android/FrameDataHolder.java +0 -14
package/scripts/create_stubs.py
CHANGED
|
@@ -1,174 +1,174 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import subprocess
|
|
3
|
-
|
|
4
|
-
def create_file(path, content):
|
|
5
|
-
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
6
|
-
with open(path, 'w') as f:
|
|
7
|
-
f.write(content)
|
|
8
|
-
|
|
9
|
-
# Define stub classes
|
|
10
|
-
stubs = {
|
|
11
|
-
"com/flir/thermalsdk/androidsdk/image/BitmapAndroid.java": """
|
|
12
|
-
package com.flir.thermalsdk.androidsdk.image;
|
|
13
|
-
import android.graphics.Bitmap;
|
|
14
|
-
import com.flir.thermalsdk.image.JavaImageBuffer;
|
|
15
|
-
public class BitmapAndroid {
|
|
16
|
-
public static BitmapAndroid createBitmap(JavaImageBuffer buffer) { return null; }
|
|
17
|
-
public Bitmap getBitMap() { return null; }
|
|
18
|
-
}
|
|
19
|
-
""",
|
|
20
|
-
"com/flir/thermalsdk/image/JavaImageBuffer.java": """
|
|
21
|
-
package com.flir.thermalsdk.image;
|
|
22
|
-
public interface JavaImageBuffer {}
|
|
23
|
-
""",
|
|
24
|
-
"com/flir/thermalsdk/image/ThermalImage.java": """
|
|
25
|
-
package com.flir.thermalsdk.image;
|
|
26
|
-
public class ThermalImage {
|
|
27
|
-
public Fusion getFusion() { return null; }
|
|
28
|
-
}
|
|
29
|
-
""",
|
|
30
|
-
"com/flir/thermalsdk/image/Fusion.java": """
|
|
31
|
-
package com.flir.thermalsdk.image;
|
|
32
|
-
public class Fusion {
|
|
33
|
-
public JavaImageBuffer getPhoto() { return null; }
|
|
34
|
-
}
|
|
35
|
-
""",
|
|
36
|
-
"com/flir/thermalsdk/live/Camera.java": """
|
|
37
|
-
package com.flir.thermalsdk.live;
|
|
38
|
-
import java.util.List;
|
|
39
|
-
import com.flir.thermalsdk.live.connectivity.ConnectionStatusListener;
|
|
40
|
-
import com.flir.thermalsdk.live.streaming.Stream;
|
|
41
|
-
public class Camera {
|
|
42
|
-
public void connect(Identity id, ConnectionStatusListener listener, ConnectParameters params) {}
|
|
43
|
-
public void disconnect() {}
|
|
44
|
-
public boolean isConnected() { return false; }
|
|
45
|
-
public List<Stream> getStreams() { return null; }
|
|
46
|
-
public RemoteControl getRemoteControl() { return null; }
|
|
47
|
-
}
|
|
48
|
-
""",
|
|
49
|
-
"com/flir/thermalsdk/live/RemoteControl.java": """
|
|
50
|
-
package com.flir.thermalsdk.live;
|
|
51
|
-
public class RemoteControl {
|
|
52
|
-
public CameraInformation cameraInformation() { return null; }
|
|
53
|
-
}
|
|
54
|
-
""",
|
|
55
|
-
"com/flir/thermalsdk/live/CameraInformation.java": """
|
|
56
|
-
package com.flir.thermalsdk.live;
|
|
57
|
-
public class CameraInformation {
|
|
58
|
-
public CameraInformationSync getSync() { return null; }
|
|
59
|
-
}
|
|
60
|
-
""",
|
|
61
|
-
"com/flir/thermalsdk/live/CameraInformationSync.java": """
|
|
62
|
-
package com.flir.thermalsdk.live;
|
|
63
|
-
public class CameraInformationSync {
|
|
64
|
-
public String displayName;
|
|
65
|
-
}
|
|
66
|
-
""",
|
|
67
|
-
"com/flir/thermalsdk/live/CommunicationInterface.java": """
|
|
68
|
-
package com.flir.thermalsdk.live;
|
|
69
|
-
public enum CommunicationInterface {
|
|
70
|
-
USB, EMULATOR
|
|
71
|
-
}
|
|
72
|
-
""",
|
|
73
|
-
"com/flir/thermalsdk/live/ConnectParameters.java": """
|
|
74
|
-
package com.flir.thermalsdk.live;
|
|
75
|
-
public class ConnectParameters {}
|
|
76
|
-
""",
|
|
77
|
-
"com/flir/thermalsdk/live/Identity.java": """
|
|
78
|
-
package com.flir.thermalsdk.live;
|
|
79
|
-
public class Identity {
|
|
80
|
-
public String deviceId;
|
|
81
|
-
public CommunicationInterface communicationInterface;
|
|
82
|
-
}
|
|
83
|
-
""",
|
|
84
|
-
"com/flir/thermalsdk/ErrorCode.java": """
|
|
85
|
-
package com.flir.thermalsdk;
|
|
86
|
-
public class ErrorCode {}
|
|
87
|
-
""",
|
|
88
|
-
"com/flir/thermalsdk/live/discovery/DiscoveredCamera.java": """
|
|
89
|
-
package com.flir.thermalsdk.live.discovery;
|
|
90
|
-
import com.flir.thermalsdk.live.Identity;
|
|
91
|
-
public class DiscoveredCamera {
|
|
92
|
-
public Identity identity;
|
|
93
|
-
}
|
|
94
|
-
""",
|
|
95
|
-
"com/flir/thermalsdk/live/connectivity/ConnectionStatusListener.java": """
|
|
96
|
-
package com.flir.thermalsdk.live.connectivity;
|
|
97
|
-
import com.flir.thermalsdk.ErrorCode;
|
|
98
|
-
public interface ConnectionStatusListener {
|
|
99
|
-
void onDisconnected(ErrorCode errorCode);
|
|
100
|
-
}
|
|
101
|
-
""",
|
|
102
|
-
"com/flir/thermalsdk/live/discovery/DiscoveryEventListener.java": """
|
|
103
|
-
package com.flir.thermalsdk.live.discovery;
|
|
104
|
-
import com.flir.thermalsdk.live.CommunicationInterface;
|
|
105
|
-
import com.flir.thermalsdk.ErrorCode;
|
|
106
|
-
public interface DiscoveryEventListener {
|
|
107
|
-
void onCameraFound(DiscoveredCamera camera);
|
|
108
|
-
void onDiscoveryError(CommunicationInterface communicationInterface, ErrorCode errorCode);
|
|
109
|
-
}
|
|
110
|
-
""",
|
|
111
|
-
"com/flir/thermalsdk/live/discovery/DiscoveryFactory.java": """
|
|
112
|
-
package com.flir.thermalsdk.live.discovery;
|
|
113
|
-
import com.flir.thermalsdk.live.CommunicationInterface;
|
|
114
|
-
public class DiscoveryFactory {
|
|
115
|
-
public static DiscoveryFactory getInstance() { return new DiscoveryFactory(); }
|
|
116
|
-
public void scan(DiscoveryEventListener listener, CommunicationInterface... ifaces) {}
|
|
117
|
-
public void stop(CommunicationInterface... ifaces) {}
|
|
118
|
-
}
|
|
119
|
-
""",
|
|
120
|
-
"com/flir/thermalsdk/live/streaming/Stream.java": """
|
|
121
|
-
package com.flir.thermalsdk.live.streaming;
|
|
122
|
-
import com.flir.thermalsdk.image.JavaImageBuffer;
|
|
123
|
-
public interface Stream {
|
|
124
|
-
boolean isStreaming();
|
|
125
|
-
void stop();
|
|
126
|
-
boolean isThermal();
|
|
127
|
-
void start(OnImageReceivedListener listener, OnErrorListener errorListener);
|
|
128
|
-
interface OnImageReceivedListener { void onImageReceived(Void v); }
|
|
129
|
-
interface OnErrorListener { void onError(Object error); }
|
|
130
|
-
}
|
|
131
|
-
""",
|
|
132
|
-
"com/flir/thermalsdk/live/streaming/ThermalStreamer.java": """
|
|
133
|
-
package com.flir.thermalsdk.live.streaming;
|
|
134
|
-
import com.flir.thermalsdk.image.ThermalImage;
|
|
135
|
-
import com.flir.thermalsdk.image.JavaImageBuffer;
|
|
136
|
-
public class ThermalStreamer {
|
|
137
|
-
public ThermalStreamer(Stream stream) {}
|
|
138
|
-
public void update() {}
|
|
139
|
-
public void withThermalImage(OnThermalImageReceivedListener listener) {}
|
|
140
|
-
public JavaImageBuffer getImage() { return null; }
|
|
141
|
-
public interface OnThermalImageReceivedListener { void onThermalImageReceived(ThermalImage image); }
|
|
142
|
-
}
|
|
143
|
-
"""
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
# Create source files
|
|
147
|
-
base_dir = "stubs_src"
|
|
148
|
-
for path, content in stubs.items():
|
|
149
|
-
create_file(os.path.join(base_dir, path), content)
|
|
150
|
-
|
|
151
|
-
# Mock android.graphics.Bitmap
|
|
152
|
-
create_file(os.path.join(base_dir, "android/graphics/Bitmap.java"), "package android.graphics; public class Bitmap {}")
|
|
153
|
-
|
|
154
|
-
# Compile
|
|
155
|
-
sources_file = "sources.txt"
|
|
156
|
-
with open(sources_file, 'w') as f:
|
|
157
|
-
for root, dirs, files in os.walk(base_dir):
|
|
158
|
-
for file in files:
|
|
159
|
-
if file.endswith(".java"):
|
|
160
|
-
f.write(os.path.join(root, file) + "\n")
|
|
161
|
-
|
|
162
|
-
subprocess.run(["javac", "@" + sources_file], check=True)
|
|
163
|
-
|
|
164
|
-
# Jar
|
|
165
|
-
subprocess.run(["jar", "cf", "flir-stubs.jar", "-C", base_dir, "."], check=True)
|
|
166
|
-
|
|
167
|
-
# Move to libs
|
|
168
|
-
os.rename("flir-stubs.jar", "android/Flir/libs/flir-stubs.jar")
|
|
169
|
-
|
|
170
|
-
# Cleanup
|
|
171
|
-
import shutil
|
|
172
|
-
shutil.rmtree(base_dir)
|
|
173
|
-
os.remove(sources_file)
|
|
174
|
-
print("Done!")
|
|
1
|
+
import os
|
|
2
|
+
import subprocess
|
|
3
|
+
|
|
4
|
+
def create_file(path, content):
|
|
5
|
+
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
6
|
+
with open(path, 'w') as f:
|
|
7
|
+
f.write(content)
|
|
8
|
+
|
|
9
|
+
# Define stub classes
|
|
10
|
+
stubs = {
|
|
11
|
+
"com/flir/thermalsdk/androidsdk/image/BitmapAndroid.java": """
|
|
12
|
+
package com.flir.thermalsdk.androidsdk.image;
|
|
13
|
+
import android.graphics.Bitmap;
|
|
14
|
+
import com.flir.thermalsdk.image.JavaImageBuffer;
|
|
15
|
+
public class BitmapAndroid {
|
|
16
|
+
public static BitmapAndroid createBitmap(JavaImageBuffer buffer) { return null; }
|
|
17
|
+
public Bitmap getBitMap() { return null; }
|
|
18
|
+
}
|
|
19
|
+
""",
|
|
20
|
+
"com/flir/thermalsdk/image/JavaImageBuffer.java": """
|
|
21
|
+
package com.flir.thermalsdk.image;
|
|
22
|
+
public interface JavaImageBuffer {}
|
|
23
|
+
""",
|
|
24
|
+
"com/flir/thermalsdk/image/ThermalImage.java": """
|
|
25
|
+
package com.flir.thermalsdk.image;
|
|
26
|
+
public class ThermalImage {
|
|
27
|
+
public Fusion getFusion() { return null; }
|
|
28
|
+
}
|
|
29
|
+
""",
|
|
30
|
+
"com/flir/thermalsdk/image/Fusion.java": """
|
|
31
|
+
package com.flir.thermalsdk.image;
|
|
32
|
+
public class Fusion {
|
|
33
|
+
public JavaImageBuffer getPhoto() { return null; }
|
|
34
|
+
}
|
|
35
|
+
""",
|
|
36
|
+
"com/flir/thermalsdk/live/Camera.java": """
|
|
37
|
+
package com.flir.thermalsdk.live;
|
|
38
|
+
import java.util.List;
|
|
39
|
+
import com.flir.thermalsdk.live.connectivity.ConnectionStatusListener;
|
|
40
|
+
import com.flir.thermalsdk.live.streaming.Stream;
|
|
41
|
+
public class Camera {
|
|
42
|
+
public void connect(Identity id, ConnectionStatusListener listener, ConnectParameters params) {}
|
|
43
|
+
public void disconnect() {}
|
|
44
|
+
public boolean isConnected() { return false; }
|
|
45
|
+
public List<Stream> getStreams() { return null; }
|
|
46
|
+
public RemoteControl getRemoteControl() { return null; }
|
|
47
|
+
}
|
|
48
|
+
""",
|
|
49
|
+
"com/flir/thermalsdk/live/RemoteControl.java": """
|
|
50
|
+
package com.flir.thermalsdk.live;
|
|
51
|
+
public class RemoteControl {
|
|
52
|
+
public CameraInformation cameraInformation() { return null; }
|
|
53
|
+
}
|
|
54
|
+
""",
|
|
55
|
+
"com/flir/thermalsdk/live/CameraInformation.java": """
|
|
56
|
+
package com.flir.thermalsdk.live;
|
|
57
|
+
public class CameraInformation {
|
|
58
|
+
public CameraInformationSync getSync() { return null; }
|
|
59
|
+
}
|
|
60
|
+
""",
|
|
61
|
+
"com/flir/thermalsdk/live/CameraInformationSync.java": """
|
|
62
|
+
package com.flir.thermalsdk.live;
|
|
63
|
+
public class CameraInformationSync {
|
|
64
|
+
public String displayName;
|
|
65
|
+
}
|
|
66
|
+
""",
|
|
67
|
+
"com/flir/thermalsdk/live/CommunicationInterface.java": """
|
|
68
|
+
package com.flir.thermalsdk.live;
|
|
69
|
+
public enum CommunicationInterface {
|
|
70
|
+
USB, EMULATOR
|
|
71
|
+
}
|
|
72
|
+
""",
|
|
73
|
+
"com/flir/thermalsdk/live/ConnectParameters.java": """
|
|
74
|
+
package com.flir.thermalsdk.live;
|
|
75
|
+
public class ConnectParameters {}
|
|
76
|
+
""",
|
|
77
|
+
"com/flir/thermalsdk/live/Identity.java": """
|
|
78
|
+
package com.flir.thermalsdk.live;
|
|
79
|
+
public class Identity {
|
|
80
|
+
public String deviceId;
|
|
81
|
+
public CommunicationInterface communicationInterface;
|
|
82
|
+
}
|
|
83
|
+
""",
|
|
84
|
+
"com/flir/thermalsdk/ErrorCode.java": """
|
|
85
|
+
package com.flir.thermalsdk;
|
|
86
|
+
public class ErrorCode {}
|
|
87
|
+
""",
|
|
88
|
+
"com/flir/thermalsdk/live/discovery/DiscoveredCamera.java": """
|
|
89
|
+
package com.flir.thermalsdk.live.discovery;
|
|
90
|
+
import com.flir.thermalsdk.live.Identity;
|
|
91
|
+
public class DiscoveredCamera {
|
|
92
|
+
public Identity identity;
|
|
93
|
+
}
|
|
94
|
+
""",
|
|
95
|
+
"com/flir/thermalsdk/live/connectivity/ConnectionStatusListener.java": """
|
|
96
|
+
package com.flir.thermalsdk.live.connectivity;
|
|
97
|
+
import com.flir.thermalsdk.ErrorCode;
|
|
98
|
+
public interface ConnectionStatusListener {
|
|
99
|
+
void onDisconnected(ErrorCode errorCode);
|
|
100
|
+
}
|
|
101
|
+
""",
|
|
102
|
+
"com/flir/thermalsdk/live/discovery/DiscoveryEventListener.java": """
|
|
103
|
+
package com.flir.thermalsdk.live.discovery;
|
|
104
|
+
import com.flir.thermalsdk.live.CommunicationInterface;
|
|
105
|
+
import com.flir.thermalsdk.ErrorCode;
|
|
106
|
+
public interface DiscoveryEventListener {
|
|
107
|
+
void onCameraFound(DiscoveredCamera camera);
|
|
108
|
+
void onDiscoveryError(CommunicationInterface communicationInterface, ErrorCode errorCode);
|
|
109
|
+
}
|
|
110
|
+
""",
|
|
111
|
+
"com/flir/thermalsdk/live/discovery/DiscoveryFactory.java": """
|
|
112
|
+
package com.flir.thermalsdk.live.discovery;
|
|
113
|
+
import com.flir.thermalsdk.live.CommunicationInterface;
|
|
114
|
+
public class DiscoveryFactory {
|
|
115
|
+
public static DiscoveryFactory getInstance() { return new DiscoveryFactory(); }
|
|
116
|
+
public void scan(DiscoveryEventListener listener, CommunicationInterface... ifaces) {}
|
|
117
|
+
public void stop(CommunicationInterface... ifaces) {}
|
|
118
|
+
}
|
|
119
|
+
""",
|
|
120
|
+
"com/flir/thermalsdk/live/streaming/Stream.java": """
|
|
121
|
+
package com.flir.thermalsdk.live.streaming;
|
|
122
|
+
import com.flir.thermalsdk.image.JavaImageBuffer;
|
|
123
|
+
public interface Stream {
|
|
124
|
+
boolean isStreaming();
|
|
125
|
+
void stop();
|
|
126
|
+
boolean isThermal();
|
|
127
|
+
void start(OnImageReceivedListener listener, OnErrorListener errorListener);
|
|
128
|
+
interface OnImageReceivedListener { void onImageReceived(Void v); }
|
|
129
|
+
interface OnErrorListener { void onError(Object error); }
|
|
130
|
+
}
|
|
131
|
+
""",
|
|
132
|
+
"com/flir/thermalsdk/live/streaming/ThermalStreamer.java": """
|
|
133
|
+
package com.flir.thermalsdk.live.streaming;
|
|
134
|
+
import com.flir.thermalsdk.image.ThermalImage;
|
|
135
|
+
import com.flir.thermalsdk.image.JavaImageBuffer;
|
|
136
|
+
public class ThermalStreamer {
|
|
137
|
+
public ThermalStreamer(Stream stream) {}
|
|
138
|
+
public void update() {}
|
|
139
|
+
public void withThermalImage(OnThermalImageReceivedListener listener) {}
|
|
140
|
+
public JavaImageBuffer getImage() { return null; }
|
|
141
|
+
public interface OnThermalImageReceivedListener { void onThermalImageReceived(ThermalImage image); }
|
|
142
|
+
}
|
|
143
|
+
"""
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# Create source files
|
|
147
|
+
base_dir = "stubs_src"
|
|
148
|
+
for path, content in stubs.items():
|
|
149
|
+
create_file(os.path.join(base_dir, path), content)
|
|
150
|
+
|
|
151
|
+
# Mock android.graphics.Bitmap
|
|
152
|
+
create_file(os.path.join(base_dir, "android/graphics/Bitmap.java"), "package android.graphics; public class Bitmap {}")
|
|
153
|
+
|
|
154
|
+
# Compile
|
|
155
|
+
sources_file = "sources.txt"
|
|
156
|
+
with open(sources_file, 'w') as f:
|
|
157
|
+
for root, dirs, files in os.walk(base_dir):
|
|
158
|
+
for file in files:
|
|
159
|
+
if file.endswith(".java"):
|
|
160
|
+
f.write(os.path.join(root, file) + "\n")
|
|
161
|
+
|
|
162
|
+
subprocess.run(["javac", "@" + sources_file], check=True)
|
|
163
|
+
|
|
164
|
+
# Jar
|
|
165
|
+
subprocess.run(["jar", "cf", "flir-stubs.jar", "-C", base_dir, "."], check=True)
|
|
166
|
+
|
|
167
|
+
# Move to libs
|
|
168
|
+
os.rename("flir-stubs.jar", "android/Flir/libs/flir-stubs.jar")
|
|
169
|
+
|
|
170
|
+
# Cleanup
|
|
171
|
+
import shutil
|
|
172
|
+
shutil.rmtree(base_dir)
|
|
173
|
+
os.remove(sources_file)
|
|
174
|
+
print("Done!")
|
package/scripts/download-sdk.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const https = require('https');
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const { execSync } = require('child_process');
|
|
6
|
-
const crypto = require('crypto');
|
|
7
|
-
|
|
8
|
-
const manifest = require('../sdk-manifest.json');
|
|
9
|
-
const platform = process.argv[2] || (process.platform === 'darwin' ? 'ios' : 'android');
|
|
10
|
-
|
|
11
|
-
const config = manifest[platform];
|
|
12
|
-
if (!config) {
|
|
13
|
-
console.error(`Unknown platform: ${platform}`);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const downloadUrl = platform === 'ios' ? config.downloadUrl : config.directDownload.downloadUrl;
|
|
18
|
-
const expectedHash = platform === 'ios' ? config.sha256 : config.directDownload.sha256;
|
|
19
|
-
const destDir = platform === 'ios' ? 'ios/Flir/libs' : 'android/Flir/libs';
|
|
20
|
-
|
|
21
|
-
console.log(`Downloading ${platform} SDK...`);
|
|
22
|
-
|
|
23
|
-
const zipPath = path.join(__dirname, '..', `${platform}-sdk.zip`);
|
|
24
|
-
const file = fs.createWriteStream(zipPath);
|
|
25
|
-
|
|
26
|
-
https.get(downloadUrl, (response) => {
|
|
27
|
-
const total = parseInt(response.headers['content-length'], 10);
|
|
28
|
-
let downloaded = 0;
|
|
29
|
-
|
|
30
|
-
response.on('data', (chunk) => {
|
|
31
|
-
downloaded += chunk.length;
|
|
32
|
-
const pct = ((downloaded / total) * 100).toFixed(1);
|
|
33
|
-
process.stdout.write(`\rProgress: ${pct}%`);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
response.pipe(file);
|
|
37
|
-
|
|
38
|
-
file.on('finish', () => {
|
|
39
|
-
console.log('\nVerifying checksum...');
|
|
40
|
-
|
|
41
|
-
const hash = crypto.createHash('sha256');
|
|
42
|
-
const data = fs.readFileSync(zipPath);
|
|
43
|
-
hash.update(data);
|
|
44
|
-
const actualHash = hash.digest('hex');
|
|
45
|
-
|
|
46
|
-
if (actualHash !== expectedHash) {
|
|
47
|
-
console.error('Checksum mismatch!');
|
|
48
|
-
fs.unlinkSync(zipPath);
|
|
49
|
-
process.exit(1);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
console.log('Extracting...');
|
|
53
|
-
fs.mkdirSync(destDir, { recursive: true });
|
|
54
|
-
execSync(`unzip -o "${zipPath}" -d "${destDir}"`);
|
|
55
|
-
fs.unlinkSync(zipPath);
|
|
56
|
-
|
|
57
|
-
console.log(`Done! SDK installed to ${destDir}`);
|
|
58
|
-
});
|
|
59
|
-
}).on('error', (err) => {
|
|
60
|
-
console.error('Download failed:', err.message);
|
|
61
|
-
process.exit(1);
|
|
62
|
-
});
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const https = require('https');
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
const { execSync } = require('child_process');
|
|
6
|
+
const crypto = require('crypto');
|
|
7
|
+
|
|
8
|
+
const manifest = require('../sdk-manifest.json');
|
|
9
|
+
const platform = process.argv[2] || (process.platform === 'darwin' ? 'ios' : 'android');
|
|
10
|
+
|
|
11
|
+
const config = manifest[platform];
|
|
12
|
+
if (!config) {
|
|
13
|
+
console.error(`Unknown platform: ${platform}`);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const downloadUrl = platform === 'ios' ? config.downloadUrl : config.directDownload.downloadUrl;
|
|
18
|
+
const expectedHash = platform === 'ios' ? config.sha256 : config.directDownload.sha256;
|
|
19
|
+
const destDir = platform === 'ios' ? 'ios/Flir/libs' : 'android/Flir/libs';
|
|
20
|
+
|
|
21
|
+
console.log(`Downloading ${platform} SDK...`);
|
|
22
|
+
|
|
23
|
+
const zipPath = path.join(__dirname, '..', `${platform}-sdk.zip`);
|
|
24
|
+
const file = fs.createWriteStream(zipPath);
|
|
25
|
+
|
|
26
|
+
https.get(downloadUrl, (response) => {
|
|
27
|
+
const total = parseInt(response.headers['content-length'], 10);
|
|
28
|
+
let downloaded = 0;
|
|
29
|
+
|
|
30
|
+
response.on('data', (chunk) => {
|
|
31
|
+
downloaded += chunk.length;
|
|
32
|
+
const pct = ((downloaded / total) * 100).toFixed(1);
|
|
33
|
+
process.stdout.write(`\rProgress: ${pct}%`);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
response.pipe(file);
|
|
37
|
+
|
|
38
|
+
file.on('finish', () => {
|
|
39
|
+
console.log('\nVerifying checksum...');
|
|
40
|
+
|
|
41
|
+
const hash = crypto.createHash('sha256');
|
|
42
|
+
const data = fs.readFileSync(zipPath);
|
|
43
|
+
hash.update(data);
|
|
44
|
+
const actualHash = hash.digest('hex');
|
|
45
|
+
|
|
46
|
+
if (actualHash !== expectedHash) {
|
|
47
|
+
console.error('Checksum mismatch!');
|
|
48
|
+
fs.unlinkSync(zipPath);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
console.log('Extracting...');
|
|
53
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
54
|
+
execSync(`unzip -o "${zipPath}" -d "${destDir}"`);
|
|
55
|
+
fs.unlinkSync(zipPath);
|
|
56
|
+
|
|
57
|
+
console.log(`Done! SDK installed to ${destDir}`);
|
|
58
|
+
});
|
|
59
|
+
}).on('error', (err) => {
|
|
60
|
+
console.error('Download failed:', err.message);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
});
|