npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-redhawk

v0.5.1

Published

Angular library for interfacing with REDHAWK SDR via Geon's fork of REST-python

Downloads

29

Readme

Angular REDHAWK

The angular-redhawk library is a back-end interface to the REST and socket services of Geon's fork of REST-Python. It provides minimal examples of very low-level interfaces to these services. For higher-level interfaces, see the Angular-REDHAWK UIKit (angular-redhawk-uikit).

This Angular library interfaces with the REST-Python server from Geon Technologies. It provides two modules top-level, Support and UI Kit. The former contains the high-level Components users can implement in their designs to facilitate easy access to the underlying Services. It also contains the generic REST Model definitions that are returned by those Services. The UI Kit contains re-usable UI Components that use those support module Component interfaces to view and manipulate the Models.

Installing Angular-REDHAWK

If you are installing Angular-REDHAWK into your application, use npm to install it as a dependency:

npm install --save angular-redhawk

Import the AngularRedhawkModule into your application:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';

import { AngularRedhawkModule } from 'angular-redhawk';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    AngularRedhawkModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Configuring the REST-Python Service

Angular-REDHAWK connects to the REST-Python server using the RestPythonService. The default configuration connects to whatever host is serving your web application at port 8080, which is the default for Geon's REST-Python server. The RestPythonService supports two methods for configuring that connection: pre- and post- Angular Dependency Injection. In either case, the interface is defined by IRestPythonConfig.

Pre-injection

In your application's top-level module, import the REST_PYTHON_CONFIG from AngularRedhawkModule and provide it to dependency injection:

import {
  AngularRedhawkModule,
  REST_PYTHON_CONFIG
}

@NgModule({
  imports: [
    AngularRedhawkModule
  ],
  providers: [
    { provide: REST_PYTHON_CONFIG, useValue: { host: 'aa.bb.cc.dd' } }
  ]
})

Post-injection

You can configure the service connection at your application's startup by injecting the RestPythonService into the top-level Component and then using setConfiguration:

import { RestPythonService } from 'angular-redhawk';

// In the Component
constructor(rp: RestPythonService) {
  rp.setConfiguration({ port: 9999 });
}

Important: Socket services do not support reconfiguring URLs at this time. Do not reconfigure RestPythonService using this method after your application is already running!

Developing the Library

If you are developing on Angular-REDHAWK:

git clone <path to>/angular-redhawk
cd angular-redhawk
npm install
npm run build
cd dist
npm link

Then, in your application where you want to use it, link the library:

npm link angular-redhawk

Note: If you're using @angular/cli for your application, you may need to use --preserve-symlinks when running tasks such as ng serve or ng build. For example, add to the app's package.json:

"scripts": {
  "start":     "ng serve",
  "start:dev": "npm run start --preserve-symlinks"
}

Contributing

Use the NPM task lint to quality check your code (it runs TSLint) and build to ensure your code has a better chance of working in a downstream Angular application.

npm run lint
npm run build

Please correct all "errors" generated by TSlint. Some sound like nitpicks (like whitespace at the end of lines), but each is there to help transpiling, bundling, etc. in some way.