verifica monitor completed

This commit is contained in:
2021-02-04 21:56:06 +01:00
parent 2edd1e5f90
commit 5efa7672d1

View File

@@ -122,12 +122,7 @@ sub writeOutSql {
}
sub matlabCalc {
getMatlabCmd();
if ( $tool_status eq 'Monitoring Completed' ) {
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool - Monitoring completed: MatLab calc by-passed.\n";
}
else {
$matlab_timestamp = getTimeStamp("db_ts");
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool MatLab calc started...\n";
@@ -141,10 +136,8 @@ sub matlabCalc {
or die "cannot change: $!\n";
print getTimeStamp("log")
. " - pid $$ >> current dir: $matlab_func_dir\n";
my @args = (
'timeout', $matlab_timeout, $matlab_cmd, $matlab_rt, $unit,
$tool
);
my @args =
( 'timeout', $matlab_timeout, $matlab_cmd, $matlab_rt, $unit, $tool );
if ( system(@args) != 0 ) {
open( my $fh, '<', $MatlabErrorFilename )
or warn print getTimeStamp("log")
@@ -191,7 +184,7 @@ sub matlabCalc {
}
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool MatLab calc executed.\n";
}
return;
}
@@ -292,9 +285,10 @@ sub getMatlabCmd {
. " - pid $$ >> Could not connect to database: $DBI::errstr";
my $sth = $dbh->prepare(
'select m.matcall, t.ftp_send , t.unit_id from matfuncs as m
'select m.matcall, t.ftp_send , t.unit_id, s.`desc` as statustools from matfuncs as m
inner join tools as t on t.matfunc = m.id
inner join units as u on u.id = t.unit_id
inner join statustools as s on t.statustool_id = s.id
where t.name = "' . $tool . '" and u.name = "' . $unit . '";'
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
@@ -627,6 +621,16 @@ if ( $tooltype eq "GD" ) {
print getTimeStamp("log") . " - pid $$ >> tool GD: nothing to do.\n";
}
else {
getMatlabCmd();
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool - Status $tool_status.\n";
if ( $tool_status eq 'Monitoring Completed' ) {
print getTimeStamp("log")
. " - pid $$ >> $unit - $tool - Monitoring completed: MatLab calc by-passed.\n";
}
else {
matlabCalc();
if ($ftp_send) {
@@ -635,6 +639,7 @@ else {
}
trxelab();
}
}
}
print getTimeStamp("log") . " - pid $$ >> Execution ended.\n";