RELEASE V4.1.0 : Voici les modifications apportées :

-> Refonte complète des afficheurs AFL départ et arrivée (+ Quais)
-> EVA DÉPARTS + ARRIVÉES

EN COURS DE DÉVELOPPEMENT :
-> REFONTE AFFICHEURS CLASSIQUES
-> IMPLÉMENTATION DONNÉES GTFS / GTFS-RT / SIRI LTE
This commit is contained in:
mathis committed 2026-08-29 18:24:44 +02:00
1 parent 6dfd798dd2
commit b1f180508e
23 files changed
+811 -686

No files matched your search

+34 -12
View File
@@ -26,7 +26,7 @@ const formatTimeWithColon = (v) => {
};
// Icône Passager avec valise à roulettes + Face avant de train (Logo En-tête EVA Arrivées)
const EVAArrivalsHeaderIcon = ({ size = '5.5vh', color = '#00d68f', style = {} }) => (
const EVAArrivalsHeaderIcon = ({ size = '59px', color = '#00d68f', style = {} }) => (
<svg
viewBox="0 0 64 64"
width={size}
@@ -72,7 +72,7 @@ const EVAArrivalsHeaderIcon = ({ size = '5.5vh', color = '#00d68f', style = {} }
);
// Icône de Bus / Autocar SNCF
const EVABusIcon = ({ size = '6.0vh', color = '#ffffff', style = {} }) => (
const EVABusIcon = ({ size = '65px', color = '#ffffff', style = {} }) => (
<svg
viewBox="0 0 24 24"
width={size}
@@ -85,7 +85,7 @@ const EVABusIcon = ({ size = '6.0vh', color = '#ffffff', style = {} }) => (
);
// Icône Information (Badge motif perturbation)
const EVAInfoIcon = ({ size = '2.4vh', color = '#000c2f', style = {} }) => (
const EVAInfoIcon = ({ size = '26px', color = '#000c2f', style = {} }) => (
<svg
viewBox="0 0 24 24"
width={size}
@@ -104,7 +104,7 @@ const EVAInfoIcon = ({ size = '2.4vh', color = '#000c2f', style = {} }) => (
);
// Icône Information Grande (Bandeau Travaux inférieur)
const EVABigAlertIcon = ({ size = '5.8vh', color = '#000c2f', style = {} }) => (
const EVABigAlertIcon = ({ size = '63px', color = '#000c2f', style = {} }) => (
<svg
viewBox="0 0 48 48"
width={size}
@@ -129,7 +129,7 @@ const EVABigAlertIcon = ({ size = '5.8vh', color = '#000c2f', style = {} }) => (
);
// Icône Horloge pour les pastilles de statut
const EVAClockIcon = ({ size = '2.5vh', color = 'currentColor', style = {} }) => (
const EVAClockIcon = ({ size = '27px', color = 'currentColor', style = {} }) => (
<svg
viewBox="0 0 24 24"
width={size}
@@ -147,7 +147,7 @@ const EVAClockIcon = ({ size = '2.5vh', color = 'currentColor', style = {} }) =>
);
// Icône Suppression (Croix)
const EVACrossIcon = ({ size = '2.5vh', color = 'currentColor', style = {} }) => (
const EVACrossIcon = ({ size = '27px', color = 'currentColor', style = {} }) => (
<svg
viewBox="0 0 24 24"
width={size}
@@ -441,7 +441,6 @@ export default function EVAArrivees() {
const [resolvedGareId, setResolvedGareId] = useState(gareIdParam || null);
useAnnonceSonoreRealtime(resolvedGareId, 'EVAArrivees');
useAutoAnnonce(horaires, currentTime, true);
// Récupération type de gare
useEffect(() => {
@@ -1068,7 +1067,7 @@ export default function EVAArrivees() {
if (h._date && h._date !== todayStr) return false;
if (!circulatesOn(h, today)) return false;
if (typeof h._depHM !== 'number') return false;
if (h._depHM < todayHM - 1) return false;
if (h._depHM < todayHM) return false;
if (h._travauxAppliesToday) return false;
return true;
});
@@ -1112,8 +1111,9 @@ export default function EVAArrivees() {
});
const annotated = applyPerturbationsToHoraires(finalList, filteredPerturb || [], null, null, serviceDateStr);
const withServiceDate = (annotated || []).map(a => ({ ...a, _serviceDate: serviceDateStr }));
setHoraires(annotated || []);
setHoraires(withServiceDate || []);
setPerturbations(filteredPerturb || []);
setTravaux(travauxData || []);
setTravauxSubstitutions(travauxSubstData || []);
@@ -1140,9 +1140,30 @@ export default function EVAArrivees() {
return () => clearInterval(delayTimer);
}, []);
// Filtrage en temps réel : ne plus afficher les horaires dont l'heure est dépassée
const currentHM = currentTime.getHours() * 60 + currentTime.getMinutes();
const pad = (n) => String(n).padStart(2, '0');
const todayDateStr = `${currentTime.getFullYear()}-${pad(currentTime.getMonth() + 1)}-${pad(currentTime.getDate())}`;
const activeHoraires = (horaires || []).filter(h => {
const sDate = h._serviceDate || h._date;
if (!sDate || sDate === todayDateStr) {
if (typeof h._depHM === 'number') {
const delay = (h._status && typeof h._status.delayMinutes === 'number') ? h._status.delayMinutes : 0;
const effectiveHM = h._depHM + delay;
if (effectiveHM < currentHM) {
return false;
}
}
}
return true;
});
useAutoAnnonce(activeHoraires, currentTime, true);
// Pagination : 4 trains par page sur les écrans EVA
const ITEMS_PER_PAGE = 4;
const totalPages = Math.max(1, Math.ceil(horaires.length / ITEMS_PER_PAGE));
const totalPages = Math.max(1, Math.ceil(activeHoraires.length / ITEMS_PER_PAGE));
const [pageIndex, setPageIndex] = useState(lockedPageIndex !== null ? lockedPageIndex : 0);
useEffect(() => {
@@ -1159,7 +1180,8 @@ export default function EVAArrivees() {
return () => clearInterval(pageInterval);
}, [lockedPageIndex, totalPages]);
const displayedHoraires = horaires.slice(pageIndex * ITEMS_PER_PAGE, (pageIndex + 1) * ITEMS_PER_PAGE);
const safePageIndex = Math.min(pageIndex, Math.max(0, totalPages - 1));
const displayedHoraires = activeHoraires.slice(safePageIndex * ITEMS_PER_PAGE, (safePageIndex + 1) * ITEMS_PER_PAGE);
// Recherche d'un message de travaux ou d'alerte pour le bandeau bas
const activeTravauxMessage = (() => {
@@ -1208,7 +1230,7 @@ export default function EVAArrivees() {
<ul className={`eva-arr-list ${activeTravauxMessage ? 'eva-arr-list--with-alert' : ''}`}>
{displayedHoraires.length === 0 ? (
<li className="eva-arr-row" key="empty">
<div style={{ color: '#000c2f', padding: '24px', fontSize: '2.8vh', fontWeight: 'bold' }}>
<div style={{ color: '#000c2f', padding: '24px', fontSize: '30px', fontWeight: 'bold' }}>
Aucune arrivée prévue pour le moment.
</div>
</li>