Skip to content
Extraits de code Groupes Projets
Valider b36fe270 rédigé par hieda_kyuko@hpr's avatar hieda_kyuko@hpr
Parcourir les fichiers

Fix last index & reference

parent 12c43990
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -247,7 +247,7 @@ foreach my $file (@trains) ...@@ -247,7 +247,7 @@ foreach my $file (@trains)
$frame{'id'} = $basename; $frame{'id'} = $basename;
Frame::frame_info \%frame; Frame::frame_info \%frame;
$master{$basename} = \%frame; $master{'rosen'}{$basename} = \%frame;
close $dia_file; close $dia_file;
} }
...@@ -261,13 +261,14 @@ foreach my $file (@trains) ...@@ -261,13 +261,14 @@ foreach my $file (@trains)
# > maybe use a null footpath? # > maybe use a null footpath?
# TODO overall, find more generic criteria for matching two similar stations # TODO overall, find more generic criteria for matching two similar stations
my @master_ekis; my @master_ekis;
foreach my $frame (values %master) foreach my $frame (values %{ $master{'rosen'} })
{ {
my @old_ekis = @{ $frame->{'eki'} }; my @old_ekis = @{ $frame->{'eki'} };
my @new_ekis; my @new_ekis;
my @new_refs;
my $index = 0; my $index = 0;
my $update_index = 1; my $update_index = 1;
for (my $i = 0; $i < $#old_ekis; $i++) for (my $i = 0; $i <= $#old_ekis; $i++)
{ {
$update_index = 1; $update_index = 1;
...@@ -308,7 +309,11 @@ foreach my $frame (values %master) ...@@ -308,7 +309,11 @@ foreach my $frame (values %master)
if ($update_index) { $index++; } if ($update_index) { $index++; }
} }
# Replace old station structures with references
# The order is conserved so there's no need to modify {'jikoku'} in {'dia'}
$frame->{'eki'} = \@new_ekis;
push @master_ekis, @new_ekis; push @master_ekis, @new_ekis;
} }
p @master_ekis; $master{'eki_index'} = @master_ekis;
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter