gestione g201 2

This commit is contained in:
2018-05-13 11:50:10 +02:00
parent 32b7853754
commit 8b7d08a347
2 changed files with 26 additions and 11 deletions

View File

@@ -365,6 +365,8 @@ if ( $filename = m/^(\d\d_\d\d\d\d_|)(DT\d\d\d\d|LOC\d.*|GD\d*)$/i ) { # GD801
$fileTime = $strings[3] . ":" . $strings[4] . ":" . $strings[5];
$unittype = $strings[6];
$unit = $strings[7];
$tool = $strings[8];
$tooltype = 'MUX';
}
while ( my $line = <FILE> ) {
@@ -455,10 +457,15 @@ while ( my $line = <FILE> ) {
}
else {
my ( $y, $m, $d, $t ) = split( /[\s\/]/, $first );
if (length($y) != 4) { # G201 con la data invertita
my $w = $y;
$y = $d;
$m = sprintf('%02d',$m);
$d = sprintf('%02d',$w);
}
foreach (@data) {
if ( $sql[ ( $outcount % $maxsqllines ) ] eq "" ) {
$sql[ ( $outcount % $maxsqllines ) ] =
"('$unit','$tool','$nodenum','$y-$m-$d','$t','$toolbatt','$tooltemp'";
$sql[ ( $outcount % $maxsqllines ) ] = "('$unit','$tool','$nodenum','$y-$m-$d','$t','$toolbatt','$tooltemp'";
}
$sql[ ( $outcount % $maxsqllines ) ] .= ",'" . $_ . "'";
}