Is there a way to hook it?MFDs call oapiOpenInputBox() to read user data, and oapiOpenInputBox() always renders the dialog box into the main window.
I look forward to the next evolution :thumbup:
Is there a way to hook it?MFDs call oapiOpenInputBox() to read user data, and oapiOpenInputBox() always renders the dialog box into the main window.
For 'readonly' MFDs you pretty much have it. I would like a config value to set the default frame rate (I would like to start with it high).Actually, I think this add-on is complete as far as I am concerned.
The basic functionality (i.e. viewing the MFD on another device) works. Touch screen device can be used. The panel layout is user configurable. As an icing on the cake, the Cougar frames can be used to control the MFDs. So, this completes support for my setup. Also, given that MFDs are the most problematic thing in the simpit, I think I have made a small breakthrough by demonstrating how to make 2 MFDs for a mere 180 EUR
Hooks in the DLL for integration with Orb::Connect etc. are provided. It's now left to add VNCMFD support in Orb::Connect, so Orb::Connect can be used for controllling the MFD buttons in a simpit environment, if you want to use something other then Cougars.
So, basically, I do not see any missing features
I now have some ideas about what to do with unused buttons on the Cougars, but this will likely take form of a separate add-on.
NetDialog
=========
The NetDialog Orbiter plugin intercepts function calls in Orbiter core
responsinble for drawing MFD dialog boxes and redirects these to a network socket.
The plugin is intended for use with solutions allowing remote display of
MFD screens, such as WebMFD or VNCMFD.
Since the plugin patches the Orbiter binary at run-time, it will only work with
Orbiter version 2010-P1 (100830). Both orbiter.exe and orbiter_ng.exe are supported.
Operation
=========
After the plugin is loaded, a TCP server is started on port 31337.
No function interception is done (yet), and Orbiter operates normally.
After the client connects to the server, the plugin intercepts two core functions,
responsible for drawing the object selector and the input box.
When the MFD code wants to open the body selector box or a dialog box (for example,
if user presses "REF" or "TGT" button in OrbitMFD), the plugin will send the
prompt to the connected network client. It will then wait for the response from the
client (terminated with CRLF) and forward this to the MFD code. It will then send
the status message to the client.
A typical network exchange look like this:
SERVER>QUERY Orbit MFD: Target\r\n
CLIENT>iss\r\n
SERVER>STATUS 1\r\n
(\r\n represents the newline characters. It is sent automatically by a terminal
software when the user presses the "Enter" key.)
The "QUERY" message contains the dialog box title.
The "STATUS" message informs the client if MFD accepted the input.
"1" means that the input was accepted, "0" means that it was not.
If the client response is empty (i.e. contains nothing but the \r\n characters)
the server replies with "ABORT" message.
NOTE: The plugin will NOT accept a new data request before the previous one
is satisfied (i.e. between the QUERY and STATUS/ABORT messages). In other words,
pressing the MFD button which prompts for user input for the second time will
have no effect, until the user response is sent.
For the MapMFD, please enter "[no orbit]" and "[no base]" (without quotes)
to remove the orbit / base selection.
Only one network connection at the time is supported.
After the client disconnects, the function interceptions are removed, and Orbiter
returns to normal operation (i.e. the dialog boxes are drawn in the main window).
Technical details
=================
Runtime function interception is done using the Detours 3.0 library from Microsoft.
Please see Hook.cpp for more information.
License
=======
This add-on uses Detours Express 3.0 library from Microsoft. This library is made
available under the license agreement which includes the following:
<<<<
You may use, copy, reproduce, and distribute this Software for any non-commercial purpose,
subject to the restrictions in this MSR-SSLA. Some purposes which can be non-commercial
are teaching, academic research, public demonstrations and personal experimentation.
You may also distribute this Software with books or other teaching materials,
or publish the Software on websites, that are intended to teach the use of the Software
for academic or other non-commercial purposes.
You may not use or distribute this Software or any derivative works in any form for
commercial purposes. Examples of commercial purposes would be running business operations,
licensing, leasing, or selling the Software, distributing the Software for use with
commercial products, using the Software in the creation or use of commercial products
or any other activity which purpose is to procure a commercial gain to you or others.
>>>>
Please see orbitersdk\samples\netdialog\detours\license.rtf for more information.
Compilation
===========
The add-on was developed using Microsoft Visual C++ 2010 Express.
First, you must compile the Detours library. To do so, run the Visual Studio Command prompt.
cd to orbitersdk\samples\netdialog\detours\license.rtf and run "nmake" to build the library.
Then, open orbitersdk\samples\netdialog\netdialog.sln in Visual Studio and build the project.
For a non-touchpad, you could use AutoHotKey (AHK) to open and position your client windows, then map key presses to a mouse click action at each specific button location. If the keys are really game controller buttons, though, I don't know if his Cougar functionality would be directly usable.I haven't yet had a chance to look under the hood but I would be interested to see if you could bind keyboard keys to the MFD options client side. it seems like this would make it more compatible with different devices via joy 2 key as well as home brew keyboard hacks.
Finished initialising world
Module DeltaGliderIV.dll ..... [Build ******, API 060425]
Finished initialising status
Finished initialising camera
Finished initialising panels
OrbConnect::Initializing solar system with 32 bodies
OrbConnect::Found Config File
OrbConnect::Module Initialized
Finished setting up render state
OrbConnect::Module Shutdown
ERROR: DDraw object is still referenced: 22
---------------------------------------------------------------
>>> ERROR: Destroy framework objects failed
>>> [OrbiterGraphics::Exit3DEnvironment | .\OGraphics.cpp | 1034]
---------------------------------------------------------------
**** Closing simulation session
Finished initialising world
Module DeltaGliderIV.dll ..... [Build ******, API 060425]
Finished initialising status
Finished initialising camera
Finished initialising panels
Finished setting up render state
ERROR: DDraw object is still referenced: 18
---------------------------------------------------------------
>>> ERROR: Destroy framework objects failed
>>> [OrbiterGraphics::Exit3DEnvironment | .\OGraphics.cpp | 1034]
---------------------------------------------------------------
**** Closing simulation session
If the keys are really game controller buttons, though, I don't know if his Cougar functionality would be directly usable.
Also, I have had no luck dis-abling the plugin without removing the dll.
For a non-touchpad, you could use AutoHotKey (AHK) to open and position your client windows, then map key presses to a mouse click action at each specific button location.
You're talking about this Cougar, aren't you?Cougar is a joystick with 28 buttons and 0 axes...
Yes, that's the one.You're talking about this Cougar, aren't you?
You're talking about this Cougar, aren't you?
I was doing some basic math on kamaz's approach, and find it scales pretty well.
That system should support up to 6 MFDs.
Con: Limited individual MFD size
a 21" touch screen monitor (~$300 ea)
to maintain the same functionality as the tablets....why do you need the touchscreen?
Yes, although you could use the buttons from the VNC, no? Except to map the upper sel/mnu buttons down below?. Aesthetically, you could give this a nice 3D bezel look and feel, 'cause I haven't seen a bezel from Thrustmaster for something like this.You mean something like that?
I just put that together in C#; took me about 10 minutes. The buttons are non-working at the moment, because I still didn't have time to code client-side support for Orb::Connect.
ORB:VirtualMFDs
ORB:VirtualMFDs=83066280,370489960
ORB:SendMFDKey:83066280:59
Yes, although you could use the buttons from the VNC, no? Except to map the upper sel/mnu buttons down below?.
Aesthetically, you could give this a nice 3D bezel look and feel, 'cause I haven't seen a bezel from Thrustmaster for something like this.