
| Current Path : /var/www/web-klick.de/dsh/90_akt/old/utility/Process/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/web-klick.de/dsh/90_akt/old/utility/Process/Ensemble.pm |
package Process::Ensemble;
use Logic::le;
use strict;
sub new {
my $class = shift;
my $self = {};
$self->{'DATA'} = shift;
bless($self,$class);
return($self);
}
#----------------------------------------------------------------
# Gibt die Namen aller Beteiligten fuer einen bestimmten Titel aus.
sub titelbesetzung {
my $self = shift;
my $titel = shift;
my $erg = Logic::le->new("St ? (x) cur x.f",$self->{'DATA'})->all();
print "EE: ". $#{$erg} ."\n";
print $erg->[0]->[0] . "\n";
}
#---------------------------------------------------------------
sub xxtitelbesetzung {
my $self = shift;
my $titel = shift;
my $o; my $o1; my $bed; my $rolle; my $person;
my $text = {};
foreach $o (split(/,/,$self->{'TITEL'}->{$titel})) {
$bed = 0;
foreach $rolle (keys %{$self->{'ROLLEN'}}) {
if ($rolle =~ /$o/) {
$bed = 1;
foreach $person (split(/,/,$self->{'ROLLEN'}->{$rolle})) {
$text->{$rolle . ": " . $person} = 1;
}
}
}
next if ($bed);
foreach $person (split(/,/,$self->titelbesetzung('ensemble'))) {
if ($person =~ /$o/) {
$text->{"PERSON: ".$person} = 1;
}
}
}
$text = join(",",sort keys %$text);
return($text);
}
#---------------------------------------------------------------
# Gibt die Namen aller bei einer Probe Beteiligten aus
sub xxprobenbesetzung {
my $self = shift;
my $probe = shift;
my $o; my $o1; my $person; my $fehlend; my $personen; my $titel;
my $text = {};
foreach $titel (split(/,/,$self->{'PROBE'}->{$probe})) {
$personen = $self->titelbesetzung($titel);
foreach $person (split(/,/,$personen)) {
foreach $fehlend (split(/,/,$self->{'FEHLE'}->{$probe})) {
if ($person =~ /(.*?)\: (.*?)$fehlend(.*)/) {
$person = $person . " (e)";
}
}
foreach $fehlend (split(/,/,$self->{'FEHLU'}->{$probe})) {
if ($person =~ /(.*?)\: (.*?)$fehlend(.*)/) {
$person = $person . " (u)";
}
}
$text->{$person} = 1;
}
}
$text = join(",",sort keys %$text);
return($text);
}
#****************************************************************
sub protokoll {
my $self = shift;
my $titel = shift;
my $text = $titel . ":\n\n";
my $o = $titel;
$titel = "," . $titel . ",";
my $fehlend; my $person; my $probe;
my $tt = {};
foreach $person (split(/,/,$self->titelbesetzung($o))) {
$tt->{$person} = [];
}
foreach $probe (sort keys %{$self->{'PROBE'}}) {
$o = "," . $self->{'PROBE'}->{$probe} . ",";
next if ($o !~ /$titel/);
foreach $person (keys %$tt) {
$o = $probe;
foreach $fehlend (split(/,/,$self->{'FEHLE'}->{$probe})) {
if ($person =~ /(.*?)\: (.*?)$fehlend(.*)/) {
$o = $o . "-";
}
}
foreach $fehlend (split(/,/,$self->{'FEHLU'}->{$probe})) {
if ($person =~ /(.*?)\: (.*?)$fehlend(.*)/) {
$o = $o . "=";
}
}
if ($o !~ /[=-]/) {
$o = $o . " ";
}
push(@{$tt->{$person}},$o);
}
}
$o = 0;
foreach $person (keys %$tt) {
if (length($person) > $o) { $o = length($person); }
$tt->{$person} = [sort @{$tt->{$person}}];
}
foreach $person (sort keys %$tt) {
$text = $text . substr($person . " ",0,$o) .
" " . join("",@{$tt->{$person}}) . "\n";
}
return($text);
}
#**************************************************************************
1;