Project Modular Simpit Controller - Version 0.1

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
I'm excited to announce my progress on my first addon - a modular simpit controller. Version 0.1 is released here, and will be on OH as soon as it gets approved! :probe:

Stable releases will reside on the master branch here, and unstable versions can be downloaded from the develop branch here.

First, a little background on the module. All of the submodules are linked into an event queue, and submodules can either fire or receive events. The submodules that will be included in v0.1 are the following (ignore the input/output designation, it was left over from the previous revision of the controller):
  • SerialInput -Recieves event information from an external serial/USB source, such as an Arduino, and it fires events. I use this submodule in my simpit so that external buttons/switches can trigger certain actions in Orbiter.
  • PanelEventOutput - Simulates mouseclicks on any 2D panel. This can be used to make simpits that have switches for vessel-specific actions. I use this to simulate clicks on all of the switches in the DGIV when their corresponding real life switch is pressed.
  • PanelClickRecorderOutput - The recorder which obtains the necessary information about a PanelMouseEvent to re-simulate it with PanelEventOutput
  • SimpitMFD - Places an ExternalMFD instance at a specified location with a specified size. It can also define a "clip" region, for more realistic-looking MFD's without the standard ExternalMFD border, like the ones in my simpit. Additionally, events can simulate MFD button presses.
  • ExternalOutput - Starts any program in response to an event. This can be used to trigger AutoHotKey scripts, play sound files, etc.
  • TimeBasedInput - Fires events at either simulation start, after a certain amount of real seconds, or after a certain amount of sim seconds.
  • KeyOutput - Sends Orbiter simulated keypresses in response to an event.
  • StateSaver - Stores information about the last-triggered event into the scenario file and can load that information on simulation start. Useful for syncronizing the Orbiter state with physical toggle switches.

The first six modules above are currently on Github and are testable.

Any combination of the above modules can be used. Because the controller is modular, you can use it for as simple or as complicated things as you want.

For example, even if you do not have a simpit, you could use one (or several) SimpitMFD submodules to automatically place and resize ExternalMFD's at simulation start. No more buggy AutoHotKey scripts are needed to place them!

On the other hand, you could use it to drive an entire vessel-specific simpit. I use a SerialInput to read switch states from an Arduino, and those events feed two SimpitMFD's, an ExternalOutput which displays fuel information through an AutoHotKey script, and a KeyOutput for controlling time acceleration with physical buttons. Also, as I use some two-way toggle switches, I use StateSaver to ensure that my simpit is always synched with the scenario before I begin.

To anyone, but especially simpit builders, are there any submodules that would be useful?

Thanks! :tiphat:
 
Last edited:

Donamy

Addon Developer
Addon Developer
Donator
Beta Tester
Joined
Oct 16, 2007
Messages
6,904
Reaction score
196
Points
138
Location
Cape
Sounds exciting.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
This looks great and is similar to something I myself had intended to work on soon! I can't try it tonight, but I should be able to within a day or so.
One suggestion that I had, and had intended to implement with my own stuff, was some kind of key map. For instance, I can trigger key J on vessels of Class Atlantis, but the same input triggers key K on vessels of Class DG-IV.
 
Last edited:

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
It probably won't work if you try it tomorrow, as not all of the modules work on the current develop branch (and some don't even exist on Github yet). A fair amount of code is only my local git repo, I'm going to test it personally before pushing it. I'll post when it should be testable.

As for the vessel-specific keymap, I could possibly do vessel-name specific key-presses in KeyOutput, it wouldn't be too hard :hmm: Thanks for the idea!
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Ah, ok, I wasn't sure what the state of development is, but I'll eagerly await.
But why make it use the vessel name though? I'm just curious, as it seems better to me to use class, as the same event should do the same thing on any XR2 for instance.
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
Yes, I will implement the keystrokes by vessel class, that makes sense.

The reason I originally wrote by name is because PanelEventOutput only outputs to a certain named vessel, and I was thinking that I would do something similar to KeyOutput. The reasoning behind it is because PanelEventOutput is likely getting events from a SerialInput/other input source, possibly linked to toggle switches.

In this case, if you switch between two XR2's, the second XR2's switches are probably not in sync with the simpit's physical switches. Now, if the user flips a switch, which XR2 should the event go to? At the moment, the event is sent to the named XR2 (the first one in this case), even if it is not the focus vessel, to maintain synchronization between the physical world and the simulated world.

As to the development state, the first six modules (SerialInput, PanelEventOutput, PanelClickRecorderOutput, SimpitMFD,ExternalOutput, and TimeBasedOutput) are on Github. Those all should function correctly and are testable :thumbup: Just clone the repo and build the code in the develop branch.

However, the only documentation at this point resides in the simpit config file, and some configurations, especially for the PanelOutputs, are cryptic...:uhh: I'll write better documentation on all of the modules before release.
 

micro_g

Donator
Donator
Joined
Oct 29, 2013
Messages
8
Reaction score
0
Points
0
Location
UK
Hi Zatnikitelman

I am currently working on a Joystick support add-on that does exactly that (HOTAS, see my post on this forum a few days ago). You can map the same joystick button to different keystroke for each vessel class and even have different mapping for the same vessel class that you can switch between depending on weather you are flying in the atmosphere or performing orbital maneuvers.

A working preview version and user manual is already available on request. I will release it once I have collected initial feedback.

I am currently supporting only joysticks (or anything that looks like one to the OS) but I will consider supporting other input devices in the future. Configuration is through a proprietary scripting file.

Drop me a line if you want to take a look.
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
You're right, I hadn't thought about synchronization. Unfortunately, that's going to be an issue regardless really. Unless the vessel is written with some kind of standardized talkback, there really isn't an easy way to generically synchronize switch states. Maybe the talkback interface is something we (the community) should have a go at.
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
A talkback interface would be nice.

At the moment, syncing isn't too bad. If you use StateSaver, you only have to manually synchronize once (by examining the virtual panels and adjusting the physical switches to match the virtual switches). Any further scenario loads will use the state data saved into them. When a scenario with state data loads, the module checks the current physical switch states and compares it with the saved data. Then, the user is prompted to flip certain physical switches until the simpit is synced with the virtual vessel, and the simulation can continue.

For my simpit, I manually synced and saved the state info into the standard DGIV scenarios, so most of the scenarios loaded will start synchronized.
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
All eight modules are done! All of the updates are pushed to the develop branch and are testable!

The last module required some *fun* win32 GUI programming that I had never done before... :compbash:
but I got it figured out :thumbup:

After I fully test every module, its on to documentation writing and release, perhaps tomorrow!
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
All modules are tested and fully operational. Now the documentation is the only thing left!
 

meson800

Addon Developer
Addon Developer
Donator
Joined
Aug 6, 2011
Messages
405
Reaction score
2
Points
18
Initial release of version 0.1 released here! :woohoo:

As soon as it gets approved by the admins, it'll be up at Orbit Hangar!

Looking forward to feedback and comments:)
 
Top