tolto update temp gd
This commit is contained in:
@@ -454,49 +454,15 @@ while ( my $line = <FILE> ) {
|
|||||||
close FILE;
|
close FILE;
|
||||||
$sql[ ( $outcount % $maxsqllines ) - 1 ] =~ s/,$/;/g;
|
$sql[ ( $outcount % $maxsqllines ) - 1 ] =~ s/,$/;/g;
|
||||||
writeOutSql($tool);
|
writeOutSql($tool);
|
||||||
if ( $tooltype eq "GD-disattivato" ) {
|
if ( $tooltype eq "GD" ) {
|
||||||
my ( $Vbat, $Tmod ) = split( /;/, $CSVData[0] );
|
print getTimeStamp("log") . " - pid $$ >> tool GD: nothing to do.\n";
|
||||||
my ( $TName, $STime, $ETime ) = split( /;/, $CSVData[1] );
|
|
||||||
my $dbh =
|
|
||||||
DBI->connect( "DBI:mysql:$db_lar;host=$server", $username, $password )
|
|
||||||
or die getTimeStamp("log")
|
|
||||||
. " - pid $$ >> Could not connect to database: $DBI::errstr";
|
|
||||||
|
|
||||||
my $sth =
|
|
||||||
$dbh->prepare( "UPDATE RAWDATACOR "
|
|
||||||
. "SET BatLevel = '"
|
|
||||||
. $Vbat
|
|
||||||
. "', Temperature = '"
|
|
||||||
. $Tmod
|
|
||||||
. "' WHERE UnitName = '"
|
|
||||||
. $unit
|
|
||||||
. "' and ToolNameID = '"
|
|
||||||
. $TName
|
|
||||||
. "' and EventDate = '"
|
|
||||||
. $GDEventDate
|
|
||||||
. "' and EventTime between '"
|
|
||||||
. $STime
|
|
||||||
. "' and '"
|
|
||||||
. $ETime
|
|
||||||
. "';" )
|
|
||||||
or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr ";
|
|
||||||
|
|
||||||
$sth->execute();
|
|
||||||
$sth->finish;
|
|
||||||
|
|
||||||
# Disconnect
|
|
||||||
$dbh->disconnect;
|
|
||||||
|
|
||||||
#update DT corrispondente con stessa parte numerica ToolNameID, EventDate, EventTime e UnitName
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
#update DT se esiste GD corrispondente con stesso ToolNameID, EventDate, EventTime
|
|
||||||
matlabCalc();
|
matlabCalc();
|
||||||
if ($ftp_send) {
|
if ($ftp_send) {
|
||||||
if ( $tool = 'DT0076' ) {
|
if ( $tool eq 'DT0076' ) {
|
||||||
sleep(600);
|
sleep(600);
|
||||||
}
|
}
|
||||||
|
|
||||||
trxelab();
|
trxelab();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user