Merge branch 'master' of ssh://mail.aseltd.eu:6922/volume1/git_repos/ase_perl
This commit is contained in:
@@ -140,7 +140,7 @@ sub trxelab {
|
|||||||
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
||||||
|
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
if ( $sth->rows < 0 ) {
|
if ( $sth->rows eq 0 ) {
|
||||||
die getTimeStamp("log") . " - pid $$ >> No unit ftp params selected.\n";
|
die getTimeStamp("log") . " - pid $$ >> No unit ftp params selected.\n";
|
||||||
}else {
|
}else {
|
||||||
while ( my $results = $sth->fetchrow_hashref ) {
|
while ( my $results = $sth->fetchrow_hashref ) {
|
||||||
@@ -178,8 +178,8 @@ sub trxelab {
|
|||||||
XShift, YShift, ZShift , X, Y, Z, HShift, HShiftDir, HShift_local,
|
XShift, YShift, ZShift , X, Y, Z, HShift, HShiftDir, HShift_local,
|
||||||
speed, speed_local, acceleration, acceleration_local, T_node, water_level, pressure, load_value, AlfaX, AlfaY, calcerr
|
speed, speed_local, acceleration, acceleration_local, T_node, water_level, pressure, load_value, AlfaX, AlfaY, calcerr
|
||||||
from ElabDataView
|
from ElabDataView
|
||||||
where UnitName = '$unit', ToolNameID = '$tool' and updated_at > '$matlab_timestamp'
|
where UnitName = '$unit' and ToolNameID = '$tool' and updated_at > '$matlab_timestamp'
|
||||||
order by ToolNameID DESC, EventDate, EventTime, convert(`NodeNum`, decimal) DESC
|
order by ToolNameID DESC, EventDate, EventTime, convert(`NodeNum`, UNSIGNED INTEGER) DESC
|
||||||
) resulting_set
|
) resulting_set
|
||||||
into outfile '$fileelab'
|
into outfile '$fileelab'
|
||||||
fields terminated by ',' optionally enclosed by '"' lines terminated by '\n'}
|
fields terminated by ',' optionally enclosed by '"' lines terminated by '\n'}
|
||||||
@@ -245,8 +245,10 @@ sub getNodesType {
|
|||||||
|
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
print getTimeStamp("log"). " - pid $$ >> $unit - $tool: " . $sth->rows . " rows selected to get node type/Ain/Din/channels.\n";
|
print getTimeStamp("log"). " - pid $$ >> $unit - $tool: " . $sth->rows . " rows selected to get node type/Ain/Din/channels.\n";
|
||||||
if ( $sth->rows < 0 ) {
|
if ( $sth->rows eq 0 ) {
|
||||||
die getTimeStamp("log") . " - pid $$ >> No node channels selected.\n";
|
print getTimeStamp("log"). " - pid $$ >> Node/Channels/Ain/Din not defined.\n";
|
||||||
|
print getTimeStamp("log"). " - pid $$ >> Execution ended.\n";
|
||||||
|
exit;
|
||||||
}else {
|
}else {
|
||||||
my $row = 0;
|
my $row = 0;
|
||||||
while ( my $results = $sth->fetchrow_hashref ) {
|
while ( my $results = $sth->fetchrow_hashref ) {
|
||||||
@@ -272,7 +274,7 @@ sub getUdbPwd {
|
|||||||
or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
||||||
|
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
if ( $sth->rows < 0 ) {
|
if ( $sth->rows eq 0 ) {
|
||||||
die getTimeStamp("log") . " - pid $$ >> No password selected.\n";
|
die getTimeStamp("log") . " - pid $$ >> No password selected.\n";
|
||||||
}else {
|
}else {
|
||||||
my $results = $sth->fetchrow_hashref;
|
my $results = $sth->fetchrow_hashref;
|
||||||
@@ -301,7 +303,7 @@ sub getMatlabCmd {
|
|||||||
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
) or die getTimeStamp("log") . " - pid $$ >> $DBI::errstr";
|
||||||
|
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
if ( $sth->rows < 0 ) {
|
if ( $sth->rows eq 0 ) {
|
||||||
die getTimeStamp("log"). " - pid $$ >> No tool's matlab function selected.\n";
|
die getTimeStamp("log"). " - pid $$ >> No tool's matlab function selected.\n";
|
||||||
}else {
|
}else {
|
||||||
while ( my $results = $sth->fetchrow_hashref ) {
|
while ( my $results = $sth->fetchrow_hashref ) {
|
||||||
@@ -470,12 +472,6 @@ while ( my $line = <FILE> ) {
|
|||||||
my ( $Vbat, $Tmod, $Ain1, $Ain2, $Din1, $Din2 ) =
|
my ( $Vbat, $Tmod, $Ain1, $Ain2, $Din1, $Din2 ) =
|
||||||
split( /;/, $NodeData );
|
split( /;/, $NodeData );
|
||||||
|
|
||||||
if ( scalar @din ) {
|
|
||||||
print getTimeStamp("log"). " - pid $$ >> Ain/Din not defined.\n";
|
|
||||||
print getTimeStamp("log"). " - pid $$ >> Execution ended.\n";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
my $idx = 0;
|
my $idx = 0;
|
||||||
$CSVData[$idx++] = $Vbat . ";" . $Tmod;
|
$CSVData[$idx++] = $Vbat . ";" . $Tmod;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user