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

@tfdidesign/fsuipc-typescript-client

v0.9.52

Published

fsuipc api using koise10 fsuipc wrapper

Downloads

172

Readme

fsuipc-typescript-client

fsuipc-typescript-client is a node dependency wirtten to allow easy access to the FSUIPC API.

This package offers:

  • Read offset
  • Write offset*
  • Ability to get raw fsuipc data
  • Error handling/disconnect handling
  • Easily controllable update interval

*Write support is only supported for Bit and Numbers offset types.

Disclamer

This package is a modifided version of fsuipc-node (fsuipc-node) and built off fsuipc (fsuipc)

Requirements

In order for fsuipc (fsuipc-node) and @tfdidesign/fsuipc-typescript-client to work, and and therefore, this API, you must have on your machine:

  • Windows 10 64bit or Windows 11 64bit
  • Node 12+
  • Python 3.7 (don't forget to add it to your PATH)
  • Visual Studio 2017+ with desktop C++ package
  • FSUIPC installed as flight simulator plugin

Node API usage requirements:

  • rxjs >= 6.5.0

Get Started

Download the dependency using the following options: npm :

npm i --save @tfdidesign/fsuipc-typescript-client

or yarn:

yarn add @tfdidesign/fsuipc-typescript-client

After import, you can use FsuipcClient to listen to provided values.

Import

new FsuipcClient() takes one argument:

  • options [{interval : number, simulator: ?Simulator, closeOnError : ?boolean, includeRaw: ?boolean}]:
import { FsuipcClient, Simulator } from '@tfdidesign/fsuipc-typescript-client';
const fsuipcClient = new  FsuipcClient({ interval :  1000, simulator :  Simulator.FSX, closeOnError :  false, includeRaw :  false });

options:

  • Interval type Number : time in ms passed after each stream update.
  • Simulator is type Simulator: targeted simulator.
  • closeOnError type boolean: if the client need to close connection with the simulator if error accours down the stream.
  • includeRaw type boolean: this will include raw data on each stream update.

Init

FsuipcClient.connect() returns a promise when you are properly connected to FSUIPC stream. In case your flight simulator isn't running, this will throw an error.

Listen to offsets values

FsuipcClient.listen() method take 1 argument :

  • offsetsList [string[]]: a list of string representing offsets you want to subscribe This method returns a ConvertedOffsetValues observable. You can subscribe to this observable to handle values polled from stream.

Complete example

import { FsuipcClient } from '@tfdidesign/fsuipc-typescript-client';

const fsuipcClient =  new  FsuipcClient({ interval :  1000, simulator : Simulator.FSX, closeOnError :  false, includeRaw :  false  });

fsuipcClient.connect().then(() => {
  fsuipcClient.listen([
    'gs',
    'altitude',
    'comFreq',
    'lights',
  ]).subscribe((result) => {
    // Use the result here
    console.log(JSON.stringify(result));
  });
}).catch((e) =>
  console.error(e)
);