gestione G301

This commit is contained in:
2021-04-19 22:37:36 +02:00
parent 19e708d72c
commit a8d6e04bd9
2 changed files with 24 additions and 3 deletions

View File

@@ -51,6 +51,7 @@ my $from = 'ASE Alert System<alert@aseltd.eu>';
my ( $email_msg, $email_obj );
my $G201_fcheck = 0;
my $D2W_fcheck = 0;
my $G301_fcheck = 0;
my $FtpToCustomerCmd = 'SendFtpElabData.pl';
my ( $scriptname, $scriptpath );
my $MatlabErrorFilename = "/tmp/";
@@ -436,7 +437,14 @@ elsif ( $filecsvname =~ m/^D2W_ID\d\d\d\d_DT\d\d\d\d_\d*$/i ) {
$unittype = $strings[0];
$unit = $strings[1];
$tool = $strings[2];
$tooltype = 'D2W';
$tooltype = 'MUX';
}
elsif ( $filecsvname =~ m/^G301_ID\d\d\d\d_DT\d\d\d\d_\d*$/i ) {
my @strings = $filecsvname =~ /(.{1,3})_(.{1,6})_(.{1,6}).*/;
$unittype = $strings[0];
$unit = $strings[1];
$tool = $strings[2];
$tooltype = 'MUX'; # inserire tooltype corretto
}
while ( my $line = <FILE> ) {
@@ -483,8 +491,14 @@ while ( my $line = <FILE> ) {
getNodesType();
$D2W_fcheck = 1;
}
if ( $unittype eq 'G301' and $G301_fcheck eq 0 ) {
print getTimeStamp("log")
. " - pid $$ >> Found $tooltype tool name: $tool\n";
getNodesType();
$G301_fcheck = 1;
}
if ( $tooltype eq "MUX" or $tooltype eq "D2W" ) {
if ( $tooltype eq "MUX" ) {
#$NodeData =~ s/Dis\./N\/A/g;
@NewData = grep /\S/, split( /\||;/, $NodeData );

View File

@@ -43,6 +43,11 @@ sub getUnitName { # parm => file received ($trfile)
$unittype = $strings[0];
$unit = $strings[1];
}
elsif ( $filenamecsv =~ m/^G301_ID\d\d\d\d_DT\d\d\d\d$/i ) {
my @strings = $filenamecsv =~ /(.{1,4})_(.{1,6})_(.{1,6}).*/;
$unittype = $strings[0];
$unit = $strings[1];
}
else {
open FILE, $filename
or warn getTimeStamp("log")
@@ -84,7 +89,8 @@ while ( my $line = $tail->GetLine() ) {
( ( uc $suffix ) eq ( uc $ext ) )
and ( $filename =~ m/^(\d\d_\d\d\d\d_|)(DT\d\d\d\d|LOC\d*|GD\d*)$/i
or $filename =~ m/^G201_ID\d\d\d\d_DT\d\d\d\d_\d*$/i
or $filename =~ m/^D2W_ID\d\d\d\d_DT\d\d\d\d$/i )
or $filename =~ m/^D2W_ID\d\d\d\d_DT\d\d\d\d$/i
or $filename =~ m/^G301_ID\d\d\d\d_DT\d\d\d\d$/i )
)
{
my $unit = getUnitName($trfile);
@@ -122,6 +128,7 @@ while ( my $line = $tail->GetLine() ) {
m/^(\d\d_\d\d\d\d_|)(DT\d\d\d\d|LOC\d.*|GD\d*)$/i
or $filename =~ m/^G201_ID\d\d\d\d_DT\d\d\d\d_\d*$/i
or $filename =~ m/^D2W_ID\d\d\d\d_DT\d\d\d\d$/i
or $filename =~ m/^G301_ID\d\d\d\d_DT\d\d\d\d$/i
)
and ( $unit ne 'ID9999' )
and ( $truser ne 'corra' )