From d39baa22191bdc84a9766fccf7037cb87bb6c9a7 Mon Sep 17 00:00:00 2001 From: battilo Date: Mon, 25 Sep 2017 23:32:27 +0200 Subject: [PATCH] gestione caricamento GD --- LoadCSVData.pl | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/LoadCSVData.pl b/LoadCSVData.pl index 1cd12f2..4d57f34 100644 --- a/LoadCSVData.pl +++ b/LoadCSVData.pl @@ -364,6 +364,12 @@ while ( my $line = ) { . " - pid $$ >> Found $tooltype tool name: $tool\n"; getNodesType(); } + elsif ( defined $info[3] && $info[3] =~ m/^GD\d*$/i ) { + $tool = uc $info[3]; + $tooltype = 'GD'; + print getTimeStamp("log") + . " - pid $$ >> Found $tooltype tool name: $tool\n"; + } } else { $NodeData =~ s/\x0d{0,1}\x0a\Z//s; @@ -397,6 +403,12 @@ while ( my $line = ) { $CSVData[0] = $Vbat . ";" . $Tmod; $CSVData[1] = $Din1; } + elsif ( $tooltype eq "GD" ) { + my ( $div, $Vbat, $Tmod ) = + split( /;/, $NodeData ); + $CSVData[0] = $Vbat . ";" . $Tmod; + $CSVData[1] = "n/a"; + } else { @CSVData = split( /\|/, $NodeData ); } @@ -436,9 +448,17 @@ while ( my $line = ) { close FILE; $sql[ ( $outcount % $maxsqllines ) - 1 ] =~ s/,$/;/g; writeOutSql($tool); -matlabCalc(); -if ($ftp_send) { - trxelab(); +if ( $tooltype eq "GD" ) { + + #update DT corrispondente con stesso ToolNameID, EventDate, EventTime + +} +else { +#update DT se esiste GD corrispondente con stesso ToolNameID, EventDate, EventTime + matlabCalc(); + if ($ftp_send) { + trxelab(); + } } print getTimeStamp("log") . " - pid $$ >> Execution ended.\n";