@aguacerowx/react-native 0.0.51 → 0.0.53
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/android/src/main/cpp/satellite_ktx_jni.cpp +6 -1
- package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayer.java +121 -1
- package/android/src/main/java/com/aguacerowx/reactnative/SatelliteLayerView.java +556 -384
- package/android/src/main/java/com/aguacerowx/reactnative/WeatherFrameProcessorModule.java +315 -311
- package/ios/SatelliteLayerView.swift +517 -510
- package/ios/WeatherFrameProcessorModule.swift +222 -219
- package/lib/commonjs/WeatherLayerManager.js +82 -46
- package/lib/commonjs/WeatherLayerManager.js.map +1 -1
- package/lib/commonjs/aguaceroRnDebug.js +9 -1
- package/lib/commonjs/aguaceroRnDebug.js.map +1 -1
- package/lib/commonjs/gridCdnAuth.js +64 -0
- package/lib/commonjs/gridCdnAuth.js.map +1 -0
- package/lib/commonjs/index.js +50 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/nexrad/nexradAndroidController.js +25 -25
- package/lib/commonjs/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/commonjs/nexrad/nexradDiag.js +24 -24
- package/lib/commonjs/satellite/satelliteAndroidController.js +32 -24
- package/lib/commonjs/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/commonjs/satelliteRnDebug.js +261 -0
- package/lib/commonjs/satelliteRnDebug.js.map +1 -0
- package/lib/module/WeatherLayerManager.js +82 -46
- package/lib/module/WeatherLayerManager.js.map +1 -1
- package/lib/module/aguaceroRnDebug.js +9 -1
- package/lib/module/aguaceroRnDebug.js.map +1 -1
- package/lib/module/gridCdnAuth.js +56 -0
- package/lib/module/gridCdnAuth.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/nexrad/nexradAndroidController.js +25 -25
- package/lib/module/nexrad/nexradAndroidController.js.map +1 -1
- package/lib/module/nexrad/nexradDiag.js +24 -24
- package/lib/module/satellite/satelliteAndroidController.js +32 -24
- package/lib/module/satellite/satelliteAndroidController.js.map +1 -1
- package/lib/module/satelliteRnDebug.js +248 -0
- package/lib/module/satelliteRnDebug.js.map +1 -0
- package/lib/typescript/WeatherLayerManager.d.ts.map +1 -1
- package/lib/typescript/aguaceroRnDebug.d.ts.map +1 -1
- package/lib/typescript/gridCdnAuth.d.ts +24 -0
- package/lib/typescript/gridCdnAuth.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/satellite/satelliteAndroidController.d.ts.map +1 -1
- package/lib/typescript/satelliteRnDebug.d.ts +81 -0
- package/lib/typescript/satelliteRnDebug.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/WeatherLayerManager.js +2044 -2004
- package/src/aguaceroRnDebug.js +9 -1
- package/src/gridCdnAuth.js +56 -0
- package/src/index.js +27 -15
- package/src/nexrad/nexradAndroidController.js +1078 -1078
- package/src/nexrad/nexradDiag.js +150 -150
- package/src/satellite/satelliteAndroidController.js +257 -245
- package/src/satelliteRnDebug.js +269 -0
package/src/nexrad/nexradDiag.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NEXRAD pipeline diagnostics (Android / Metro).
|
|
3
|
-
*
|
|
4
|
-
* Verbose phases / perf: off unless {@code global.__AGUACERO_NEXRAD_DEBUG = true}
|
|
5
|
-
* (filter {@code [Aguacero][NEXRAD]} and {@code [Aguacero][NEXRAD][PERF]}).
|
|
6
|
-
*
|
|
7
|
-
* Legacy pipe line-by-line bridge logs: only if {@code global.__AGUACERO_NEXRAD_PIPE_TRACE = true}.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export function nexradDiagEnabled() {
|
|
11
|
-
if (typeof globalThis !== 'undefined' && globalThis.__AGUACERO_NEXRAD_DEBUG === true) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (typeof globalThis !== 'undefined' && globalThis.__AGUACERO_DEBUG__ === true) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Opt-in only — line-by-line bridge logs.
|
|
22
|
-
* @param {string} tag
|
|
23
|
-
* @param {Record<string, unknown>} [detail]
|
|
24
|
-
*/
|
|
25
|
-
export function nexradPipeTrace(tag, detail) {
|
|
26
|
-
if (typeof globalThis === 'undefined' || globalThis.__AGUACERO_NEXRAD_PIPE_TRACE !== true) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
const msg =
|
|
31
|
-
detail !== undefined && detail !== null && typeof detail === 'object'
|
|
32
|
-
? JSON.stringify(detail)
|
|
33
|
-
: detail === undefined || detail === null
|
|
34
|
-
? ''
|
|
35
|
-
: String(detail);
|
|
36
|
-
console.warn(`[Aguacero][NEXRAD][PIPE] ${tag}`, msg);
|
|
37
|
-
} catch {
|
|
38
|
-
console.warn(`[Aguacero][NEXRAD][PIPE] ${tag}`, '(unserializable detail)');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function nexradDiag(phase, detail) {
|
|
43
|
-
if (!nexradDiagEnabled()) return;
|
|
44
|
-
if (detail !== undefined) {
|
|
45
|
-
console.warn(`[Aguacero][NEXRAD] ${phase}`, detail);
|
|
46
|
-
} else {
|
|
47
|
-
console.warn(`[Aguacero][NEXRAD] ${phase}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* @param {string} label
|
|
53
|
-
* @returns {{ elapsedMs: () => number, end: (detail?: Record<string, unknown>) => number }}
|
|
54
|
-
*/
|
|
55
|
-
export function nexradPerfSpan(label) {
|
|
56
|
-
const hasPerf = typeof performance !== 'undefined' && typeof performance.now === 'function';
|
|
57
|
-
const t0 = hasPerf ? performance.now() : Date.now();
|
|
58
|
-
return {
|
|
59
|
-
elapsedMs() {
|
|
60
|
-
const t1 = hasPerf ? performance.now() : Date.now();
|
|
61
|
-
return t1 - t0;
|
|
62
|
-
},
|
|
63
|
-
end(detail) {
|
|
64
|
-
const msActual = hasPerf ? performance.now() - t0 : Date.now() - t0;
|
|
65
|
-
if (!nexradDiagEnabled()) {
|
|
66
|
-
return msActual;
|
|
67
|
-
}
|
|
68
|
-
const payload =
|
|
69
|
-
detail !== undefined && detail !== null && typeof detail === 'object'
|
|
70
|
-
? { ms: msActual, ...detail }
|
|
71
|
-
: { ms: msActual };
|
|
72
|
-
console.warn(`[Aguacero][NEXRAD][PERF] ${label}`, payload);
|
|
73
|
-
return msActual;
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @param {Record<string, unknown>} [extra]
|
|
80
|
-
*/
|
|
81
|
-
export function nexradDiagBootSnapshot(extra = {}) {
|
|
82
|
-
if (!nexradDiagEnabled()) return;
|
|
83
|
-
const g = typeof globalThis !== 'undefined' ? globalThis : {};
|
|
84
|
-
nexradDiag('boot.snapshot', {
|
|
85
|
-
...extra,
|
|
86
|
-
workerType: typeof Worker,
|
|
87
|
-
navigatorProduct: typeof navigator !== 'undefined' ? navigator.product : undefined,
|
|
88
|
-
hermesInternal: typeof g.HermesInternal !== 'undefined',
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* @param {Uint8Array} gateData
|
|
94
|
-
* @param {number} nGates
|
|
95
|
-
* @param {number} nRays
|
|
96
|
-
* @param {number} valueScale
|
|
97
|
-
* @param {number} valueOffset
|
|
98
|
-
* @param {number} lutMin
|
|
99
|
-
* @param {number} lutMax
|
|
100
|
-
*/
|
|
101
|
-
export function nexradDiagGateTextureSummary(gateData, nGates, nRays, valueScale, valueOffset, lutMin, lutMax) {
|
|
102
|
-
if (!nexradDiagEnabled()) {
|
|
103
|
-
return { skipped: true };
|
|
104
|
-
}
|
|
105
|
-
if (!gateData?.length) return { error: 'empty' };
|
|
106
|
-
const pairCount = nGates * nRays;
|
|
107
|
-
const expected = pairCount * 2;
|
|
108
|
-
if (gateData.length < expected) {
|
|
109
|
-
return { error: 'shortBuffer', len: gateData.length, expected };
|
|
110
|
-
}
|
|
111
|
-
let sampleN = 0;
|
|
112
|
-
let nodataN = 0;
|
|
113
|
-
let inLutN = 0;
|
|
114
|
-
let minRaw = 32767;
|
|
115
|
-
let maxRaw = -32768;
|
|
116
|
-
let minPhys = Infinity;
|
|
117
|
-
let maxPhys = -Infinity;
|
|
118
|
-
const stride = Math.max(1, Math.floor(pairCount / 25000));
|
|
119
|
-
for (let p = 0; p < pairCount; p += stride) {
|
|
120
|
-
const o = p * 2;
|
|
121
|
-
const lo = gateData[o];
|
|
122
|
-
const hi = gateData[o + 1];
|
|
123
|
-
let raw = lo + hi * 256;
|
|
124
|
-
if (raw >= 32768) raw -= 65536;
|
|
125
|
-
sampleN++;
|
|
126
|
-
if (raw <= -32768) {
|
|
127
|
-
nodataN++;
|
|
128
|
-
continue;
|
|
129
|
-
}
|
|
130
|
-
if (raw < minRaw) minRaw = raw;
|
|
131
|
-
if (raw > maxRaw) maxRaw = raw;
|
|
132
|
-
const phys = raw * valueScale + valueOffset;
|
|
133
|
-
if (phys < minPhys) minPhys = phys;
|
|
134
|
-
if (phys > maxPhys) maxPhys = phys;
|
|
135
|
-
if (phys >= lutMin && phys <= lutMax) inLutN++;
|
|
136
|
-
}
|
|
137
|
-
return {
|
|
138
|
-
samples: sampleN,
|
|
139
|
-
nodataSamples: nodataN,
|
|
140
|
-
inLutSamples: inLutN,
|
|
141
|
-
minRaw: minRaw <= maxRaw ? minRaw : null,
|
|
142
|
-
maxRaw: minRaw <= maxRaw ? maxRaw : null,
|
|
143
|
-
minPhys: Number.isFinite(minPhys) ? minPhys : null,
|
|
144
|
-
maxPhys: Number.isFinite(maxPhys) ? maxPhys : null,
|
|
145
|
-
lutMin,
|
|
146
|
-
lutMax,
|
|
147
|
-
valueScale,
|
|
148
|
-
valueOffset,
|
|
149
|
-
};
|
|
150
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* NEXRAD pipeline diagnostics (Android / Metro).
|
|
3
|
+
*
|
|
4
|
+
* Verbose phases / perf: off unless {@code global.__AGUACERO_NEXRAD_DEBUG = true}
|
|
5
|
+
* (filter {@code [Aguacero][NEXRAD]} and {@code [Aguacero][NEXRAD][PERF]}).
|
|
6
|
+
*
|
|
7
|
+
* Legacy pipe line-by-line bridge logs: only if {@code global.__AGUACERO_NEXRAD_PIPE_TRACE = true}.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export function nexradDiagEnabled() {
|
|
11
|
+
if (typeof globalThis !== 'undefined' && globalThis.__AGUACERO_NEXRAD_DEBUG === true) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (typeof globalThis !== 'undefined' && globalThis.__AGUACERO_DEBUG__ === true) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Opt-in only — line-by-line bridge logs.
|
|
22
|
+
* @param {string} tag
|
|
23
|
+
* @param {Record<string, unknown>} [detail]
|
|
24
|
+
*/
|
|
25
|
+
export function nexradPipeTrace(tag, detail) {
|
|
26
|
+
if (typeof globalThis === 'undefined' || globalThis.__AGUACERO_NEXRAD_PIPE_TRACE !== true) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const msg =
|
|
31
|
+
detail !== undefined && detail !== null && typeof detail === 'object'
|
|
32
|
+
? JSON.stringify(detail)
|
|
33
|
+
: detail === undefined || detail === null
|
|
34
|
+
? ''
|
|
35
|
+
: String(detail);
|
|
36
|
+
console.warn(`[Aguacero][NEXRAD][PIPE] ${tag}`, msg);
|
|
37
|
+
} catch {
|
|
38
|
+
console.warn(`[Aguacero][NEXRAD][PIPE] ${tag}`, '(unserializable detail)');
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function nexradDiag(phase, detail) {
|
|
43
|
+
if (!nexradDiagEnabled()) return;
|
|
44
|
+
if (detail !== undefined) {
|
|
45
|
+
console.warn(`[Aguacero][NEXRAD] ${phase}`, detail);
|
|
46
|
+
} else {
|
|
47
|
+
console.warn(`[Aguacero][NEXRAD] ${phase}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @param {string} label
|
|
53
|
+
* @returns {{ elapsedMs: () => number, end: (detail?: Record<string, unknown>) => number }}
|
|
54
|
+
*/
|
|
55
|
+
export function nexradPerfSpan(label) {
|
|
56
|
+
const hasPerf = typeof performance !== 'undefined' && typeof performance.now === 'function';
|
|
57
|
+
const t0 = hasPerf ? performance.now() : Date.now();
|
|
58
|
+
return {
|
|
59
|
+
elapsedMs() {
|
|
60
|
+
const t1 = hasPerf ? performance.now() : Date.now();
|
|
61
|
+
return t1 - t0;
|
|
62
|
+
},
|
|
63
|
+
end(detail) {
|
|
64
|
+
const msActual = hasPerf ? performance.now() - t0 : Date.now() - t0;
|
|
65
|
+
if (!nexradDiagEnabled()) {
|
|
66
|
+
return msActual;
|
|
67
|
+
}
|
|
68
|
+
const payload =
|
|
69
|
+
detail !== undefined && detail !== null && typeof detail === 'object'
|
|
70
|
+
? { ms: msActual, ...detail }
|
|
71
|
+
: { ms: msActual };
|
|
72
|
+
console.warn(`[Aguacero][NEXRAD][PERF] ${label}`, payload);
|
|
73
|
+
return msActual;
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* @param {Record<string, unknown>} [extra]
|
|
80
|
+
*/
|
|
81
|
+
export function nexradDiagBootSnapshot(extra = {}) {
|
|
82
|
+
if (!nexradDiagEnabled()) return;
|
|
83
|
+
const g = typeof globalThis !== 'undefined' ? globalThis : {};
|
|
84
|
+
nexradDiag('boot.snapshot', {
|
|
85
|
+
...extra,
|
|
86
|
+
workerType: typeof Worker,
|
|
87
|
+
navigatorProduct: typeof navigator !== 'undefined' ? navigator.product : undefined,
|
|
88
|
+
hermesInternal: typeof g.HermesInternal !== 'undefined',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* @param {Uint8Array} gateData
|
|
94
|
+
* @param {number} nGates
|
|
95
|
+
* @param {number} nRays
|
|
96
|
+
* @param {number} valueScale
|
|
97
|
+
* @param {number} valueOffset
|
|
98
|
+
* @param {number} lutMin
|
|
99
|
+
* @param {number} lutMax
|
|
100
|
+
*/
|
|
101
|
+
export function nexradDiagGateTextureSummary(gateData, nGates, nRays, valueScale, valueOffset, lutMin, lutMax) {
|
|
102
|
+
if (!nexradDiagEnabled()) {
|
|
103
|
+
return { skipped: true };
|
|
104
|
+
}
|
|
105
|
+
if (!gateData?.length) return { error: 'empty' };
|
|
106
|
+
const pairCount = nGates * nRays;
|
|
107
|
+
const expected = pairCount * 2;
|
|
108
|
+
if (gateData.length < expected) {
|
|
109
|
+
return { error: 'shortBuffer', len: gateData.length, expected };
|
|
110
|
+
}
|
|
111
|
+
let sampleN = 0;
|
|
112
|
+
let nodataN = 0;
|
|
113
|
+
let inLutN = 0;
|
|
114
|
+
let minRaw = 32767;
|
|
115
|
+
let maxRaw = -32768;
|
|
116
|
+
let minPhys = Infinity;
|
|
117
|
+
let maxPhys = -Infinity;
|
|
118
|
+
const stride = Math.max(1, Math.floor(pairCount / 25000));
|
|
119
|
+
for (let p = 0; p < pairCount; p += stride) {
|
|
120
|
+
const o = p * 2;
|
|
121
|
+
const lo = gateData[o];
|
|
122
|
+
const hi = gateData[o + 1];
|
|
123
|
+
let raw = lo + hi * 256;
|
|
124
|
+
if (raw >= 32768) raw -= 65536;
|
|
125
|
+
sampleN++;
|
|
126
|
+
if (raw <= -32768) {
|
|
127
|
+
nodataN++;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (raw < minRaw) minRaw = raw;
|
|
131
|
+
if (raw > maxRaw) maxRaw = raw;
|
|
132
|
+
const phys = raw * valueScale + valueOffset;
|
|
133
|
+
if (phys < minPhys) minPhys = phys;
|
|
134
|
+
if (phys > maxPhys) maxPhys = phys;
|
|
135
|
+
if (phys >= lutMin && phys <= lutMax) inLutN++;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
samples: sampleN,
|
|
139
|
+
nodataSamples: nodataN,
|
|
140
|
+
inLutSamples: inLutN,
|
|
141
|
+
minRaw: minRaw <= maxRaw ? minRaw : null,
|
|
142
|
+
maxRaw: minRaw <= maxRaw ? maxRaw : null,
|
|
143
|
+
minPhys: Number.isFinite(minPhys) ? minPhys : null,
|
|
144
|
+
maxPhys: Number.isFinite(maxPhys) ? maxPhys : null,
|
|
145
|
+
lutMin,
|
|
146
|
+
lutMax,
|
|
147
|
+
valueScale,
|
|
148
|
+
valueOffset,
|
|
149
|
+
};
|
|
150
|
+
}
|