App-EventStreamr

 view release on metacpan or  search on metacpan

bin/station-mgr.pl  view on Meta::CPAN

  if ($self->{config}{mixer}{loop} && $self->{dvswitch}{running}) {
    if (-e $self->{config}{mixer}{loop}) {
      $loop->{role} = "ingest";
      $loop->{id} = $self->{config}{mixer}{loop};
      $loop->{type} = "file";
      run_stop($loop);
    } else {
      # Set status
      $self->{device_control}{$loop->{id}}{timestamp} = time;
      $self->{status}{$loop->{id}}{running} = 0;
      $self->{status}{$loop->{id}}{status} = "file_not_found";
      $self->{status}{$loop->{id}}{state} = "hard";
      $self->{status}{$loop->{id}}{name} = "standby loop";
      post_config();
    }
  }
  return;
}

## Stream
sub stream {

bin/station-mgr.pl  view on Meta::CPAN

        return;
      }

      $logger->error("Path creation failed for $device->{id}: $self->{device_control}{$device->{id}}{recordpath}");
      
      $self->{device_control}{$device->{id}}{runcount}++;
      # Set device status
      $self->{status}{$device->{id}}{type} = $device->{type};
      $self->{status}{$device->{id}}{timestamp} = time;
      $self->{status}{$device->{id}}{running} = 0;
      $self->{status}{$device->{id}}{status} = "not_writeable";
      $self->{status}{$device->{id}}{state} = "hard";
      post_config();
      
      return;
    }
  }

  if ($self->{dvswitch}{running} == 1) {
    run_stop($device);
  }

bin/station-mgr.pl  view on Meta::CPAN

  $device->{role} = "sync";
  $device->{id} = "sync";
  $device->{type} = "internal";
  if ($self->{config}{sync}{host} && $self->{config}{sync}{path}) {
    run_stop($device);
  } else {
    # set status
    $self->{status}{$device->{id}}{type} = $device->{type};
    $self->{status}{$device->{id}}{timestamp} = time;
    $self->{status}{$device->{id}}{running} = 0;
    $self->{status}{$device->{id}}{status} = "not_configured";
    $self->{status}{$device->{id}}{state} = "hard";
  }
  return;
}

# run, stop or restart a process 
sub run_stop {
  my ($device) = @_;
  my $time = time;

lib/App/EventStreamr/Roles/Record.pm  view on Meta::CPAN

  return $result; 
}

around 'run_stop' => sub {
  my $orig = shift;
  my $self = shift;
  
  if ( $self->_record_path() ) {
    $orig->($self);
  } else {
    $self->status->threshold($self->{id},'not_writeable');
  }
};

1;

__END__

=pod

=encoding UTF-8

share/status/app/js/controllers.js  view on Meta::CPAN


myCtrls.controller('status-list', ['$scope', '$http', '$timeout',
    function($scope, $http, $timeout) {
        var api_url = 'http://localhost:3000';
        $scope.getData = function() {
        $http.get( api_url + '/status' ).success(function(data) {
            for ( var station in data ) {
                var station_details = data[station];
                station_details.icon = 'ok';
                station_details.colour = 'green';
                var not_ok = 0;
                for ( var proc in station_details.status ) {
                    //alert( "station: " + station + " -> proc: " + proc );
                    var proc_details = station_details.status[proc];
                    if ( proc_details.status == 'started' ) {
                        proc_details.icon = 'ok';
                        proc_details.colour = 'green';
                    }
                    else {
                        not_ok++;
                        proc_details.icon = 'remove';
                        proc_details.colour = 'red';
                    }
                    proc_details.short_id = proc;
                    if ( proc_details.type == 'file' ) {
                        proc_details.short_id = proc.substring(proc.lastIndexOf("/")+1, proc.length);
                    }
                    if ( proc_details.type == 'internal' ) {
                        proc_details.label = proc;
                        proc_details.tooltip = "<em>internal process</em><br/>state: " + proc_details.status;
                    }
                    else {
                        proc_details.label = proc_details.type;
                        proc_details.tooltip = "state: " + proc_details.status + "<br/>id: " + proc_details.short_id;
                    }
                }
                if ( not_ok > 0 ) {
                    station_details.icon = 'remove';
                    station_details.colour = 'red';
                }
            }
            $scope.status_list = data;
        });
        }

        $scope.refreshData = function() {
            console.log( "refreshing data" );



( run in 0.585 second using v1.01-cache-2.11-cpan-cc502c75498 )