Better debugging

This commit is contained in:
Isaac Connor 2019-10-03 18:09:15 -04:00
parent 0515fe51fd
commit 5799815c2e
2 changed files with 11 additions and 9 deletions

View File

@ -61,7 +61,12 @@ sub DESTROY {
sub AUTOLOAD {
my $self = shift;
my $class = ref($self) || Fatal("$self not object");
my $class = ref($self);
if ( !$class ) {
my ( $caller, undef, $line ) = caller;
Fatal("$self not object from $caller:$line");
}
my $name = $AUTOLOAD;
$name =~ s/.*://;
if ( exists($self->{$name}) ) {

View File

@ -32,8 +32,6 @@ require ZoneMinder::Control;
our @ISA = qw(ZoneMinder::Control);
our $VERSION = $ZoneMinder::Base::VERSION;
# ==========================================================================
#
# Sony Network Camera Control Protocol
@ -50,7 +48,7 @@ sub open {
use LWP::UserAgent;
$self->{ua} = LWP::UserAgent->new;
$self->{ua}->agent( 'ZoneMinder Control Agent/'.$VERSION );
$self->{ua}->agent('ZoneMinder Control Agent/'.$ZoneMinder::Base::VERSION);
$self->{state} = 'open';
}
@ -102,10 +100,9 @@ sub moveConLeft {
sub moveConRight {
my $self = shift;
Debug( "Move Right" );
my $cmd = "/command/ptzf.cgi?Move=right,8,1";
$self->sendCmd( $cmd );
Debug('Move Right');
my $cmd = '/command/ptzf.cgi?Move=right,8,1';
$self->sendCmd($cmd);
}
sub moveConUpRight {
@ -206,7 +203,7 @@ sub moveRelUpLeft {
my $tiltstep = $self->getParam($params, 'tiltstep');
Debug("Step Up/Left $tiltstep/$panstep");
my $cmd = '/command/ptzf.cgi?relative=0705';
$self->sendCmd( $cmd );
$self->sendCmd($cmd);
}
sub moveRelDownRight {