feat: Implement RSSI service for iOS and Web platforms

- Added IosRssiService to handle synthetic RSSI data for iOS.
- Created WebRssiService to simulate RSSI scanning on the web.
- Defined shared types for WifiNetwork and RssiService in rssi.service.ts.
- Introduced simulation service to generate synthetic sensing data.
- Implemented WebSocket service for real-time data handling with reconnection logic.
- Established Zustand stores for managing application state related to MAT and pose data.
- Developed theme context and utility functions for consistent styling and formatting.
- Added type definitions for various application entities including API responses and sensing data.
- Created utility functions for color mapping and URL validation.
- Configured TypeScript settings for the mobile application.
This commit is contained in:
ruv
2026-03-02 10:30:33 -05:00
parent 02192b0232
commit fdc7142dfa
131 changed files with 24090 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
import { create } from 'zustand';
import type { Alert, DisasterEvent, ScanZone, Survivor } from '@/types/mat';
export interface MatState {
events: DisasterEvent[];
zones: ScanZone[];
survivors: Survivor[];
alerts: Alert[];
selectedEventId: string | null;
upsertEvent: (event: DisasterEvent) => void;
addZone: (zone: ScanZone) => void;
upsertSurvivor: (survivor: Survivor) => void;
addAlert: (alert: Alert) => void;
setSelectedEvent: (id: string | null) => void;
}
export const useMatStore = create<MatState>((set) => ({
events: [],
zones: [],
survivors: [],
alerts: [],
selectedEventId: null,
upsertEvent: (event) => {
set((state) => {
const index = state.events.findIndex((item) => item.event_id === event.event_id);
if (index === -1) {
return { events: [...state.events, event] };
}
const events = [...state.events];
events[index] = event;
return { events };
});
},
addZone: (zone) => {
set((state) => {
const index = state.zones.findIndex((item) => item.id === zone.id);
if (index === -1) {
return { zones: [...state.zones, zone] };
}
const zones = [...state.zones];
zones[index] = zone;
return { zones };
});
},
upsertSurvivor: (survivor) => {
set((state) => {
const index = state.survivors.findIndex((item) => item.id === survivor.id);
if (index === -1) {
return { survivors: [...state.survivors, survivor] };
}
const survivors = [...state.survivors];
survivors[index] = survivor;
return { survivors };
});
},
addAlert: (alert) => {
set((state) => {
if (state.alerts.some((item) => item.id === alert.id)) {
return {
alerts: state.alerts.map((item) => (item.id === alert.id ? alert : item)),
};
}
return { alerts: [...state.alerts, alert] };
});
},
setSelectedEvent: (id) => {
set({ selectedEventId: id });
},
}));