https://github.com/pixsper/posistagedotnet
C# implementation of the PosiStageNet protocol for network transport of positional data
https://github.com/pixsper/posistagedotnet
posistagenet-protocol protocol
Last synced: 5 months ago
JSON representation
C# implementation of the PosiStageNet protocol for network transport of positional data
- Host: GitHub
- URL: https://github.com/pixsper/posistagedotnet
- Owner: pixsper
- License: lgpl-3.0
- Created: 2016-01-06T12:31:54.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2022-03-20T22:44:27.000Z (about 4 years ago)
- Last Synced: 2025-08-01T05:27:06.020Z (11 months ago)
- Topics: posistagenet-protocol, protocol
- Language: C#
- Size: 2.51 MB
- Stars: 20
- Watchers: 3
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PosiStageDotNet is a C# library for implementing the PosiStageNet protocol in any project compatible with .Net 4.5 or .Net Platform Standard 1.3. The protocol is used to pass position, speed, orientation and other automation data between entertainment control systems, for example, between an automation controller and a lighting desk or media server.

See for more information on PosiStageNet.
[](https://ci.appveyor.com/project/Pixsper/posistagedotnet)
## NuGet

The library is available from NuGet.org as [DBDesign.PosiStageDotNet](https://www.nuget.org/packages/DBDesign.PosiStageDotNet).
## License
The library is [LGPL 3.0](http://www.gnu.org/licenses/lgpl-3.0.en.html) licensed, allowing use in non-GPL-licensed projects. Any modifications to the source however must be given back to the community under the same license.
## Simple Examples
### Sending Data
```C#
// Set this to the IP of the network interface you want to send PSN packets on
var adapterIp = IPAddress.Parse("10.0.0.1");
var psnServer = new PsnServer("Test PSN Server", adapterIp);
var trackers = new []
{
new PsnTracker(0, "Tracker 0",
position: Tuple.Create(0f, 0f, 0f),
speed: Tuple.Create(0f, 0f, 0f),
orientation: Tuple.Create(0f, 0f, 0f)),
new PsnTracker(1, "Tracker 1",
position: Tuple.Create(10.4f, 0f, 0f),
speed: Tuple.Create(1.23f, 0f, 0f),
orientation: Tuple.Create(0f, 85.34f, 0f)),
new PsnTracker(2, "Tracker 2",
position: Tuple.Create(5.232f, 2.654f, 13.765f),
speed: Tuple.Create(1f, 3f, 0f),
orientation: Tuple.Create(23.3f, 43.3f, 76.2f))
};
psnServer.SetTrackers(trackers);
psnServer.StartSending();
// Take some more readings...
// PsnTrackers are immutable, use the 'with' methods to create a copy with mutated values
var tracker2Update = trackers[2].WithPosition(Tuple.Create(6.345f, 2.23f, 13.098f));
// We can update values for individual trackers, replacing any tracker data with the same index
psnServer.UpdateTrackers(tracker2Update);
// When you're finished...
psnServer.StopSending();
// Don't forget to dispose!
psnServer.Dispose();
```
### Receiving Data
```C#
// Set this to the IP of the network interface you want to listen for PSN packets on
var adapterIp = IPAddress.Parse("10.0.0.1");
var psnClient = new PsnClient(adapterIp);
psnClient.TrackersUpdated += (s, e) =>
{
foreach (var t in e.Values)
Console.WriteLine(t);
};
psnClient.StartListening();
// Do something with the tracker data
// When you're finished...
psnClient.StopListening();
// Don't forget to dispose!
psnClient.Dispose();
```