
Paul Henty
Members-
Posts
1,724 -
Joined
-
Days Won
77
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by Paul Henty
-
I think this changed at some point. My understanding is that it's no longer needed if the interval is specified in the WASM configuration (which is the default now). At some point I will change this in the DLL and the docs, but at the moment you should just set the the LVARUpdateFrequency property to 0, before you call Start(). Paul
-
Me too. What about with programming it on a button with the FSUIPC interface? Paul
-
Are they working with SPAD on your machine? What about via the Joystick/Keyboard assignments in FSUIPC itself? Paul
-
That looks okay. The mouse flag also look correct according to the PMDG_NG3_SDK.h file. Have you tried programming a joystick button or key press for any PMDG controls in the FSUIPC interface? If it doesn't work there either, and if normal flight sim control work (e.g. pause), then it's probably a question for PMDG support. Yes Paul
-
No reason I can think of. Can you send standard flight sim events? Is it only the PMDG ones that don't work? Could you post the relevant lines of code are using to send the PMDG controls? Paul
-
You're welcome, but if you wait for the new client library I'm writing it'll be easier than writing the WebSocket client yourself. Paul
-
I've thought about this a bit more. I have already written a websocket server for transferring FSUIPC data. http://fsuipcwebsockets.paulhenty.com/#home It works with any version of FSUIPC from V3 onwards, but is included in the FSUIPC7 installer. It would make more sense for me to write a .NET library that will talk to this server. (It was designed for Javascript on Web pages but any language that can use websockets can use it). I will also need to extend the server to use the historic LVARs. At the moment it only reads LVARs from FSUIPC7/MSFS using John's WASM module. It'll take a few weeks, but this solution will bring the most benefit to everyone and open up the websocket server to all .NET languages. Paul
-
Best way to make browser interface with FSUIPC?
Paul Henty replied to Firefly's topic in FSUIPC Support Pete Dowson Modules
Hi Manuel, I don't know if I understand what you are asking for correctly. The server program will notify about new versions on the 'about' tab. Do you want a way for your client application (web page) to know if the server program needs to be updated (new version available)? Paul -
Not really, it would take hours to write and test and it would very long. Over the next few days I'll look into adding a simple client/server that uses sockets to my DLL. It'll just allow you to send text back and forth with a few lines of code, but that should be sufficient for most things. Paul
-
No, it's not possible with the 0x4200 offset. It always plays at maximum volume. All you can do it set the audio to the correct volume in the WAV files. But, you can't change it in real time. If you need more control over the audio you'll need a dedicated library like NAudio. Paul
-
Here are the offset declarations and two methods, one of playing sounds, one for stopping sounds. private Offset<byte> soundDevice = new Offset<byte>("sounds", 0x4201, true); private Offset<int> soundID = new Offset<int>("sounds", 0x4204, true); private Offset<string> soundFilePath = new Offset<string>("sounds", 0x4208, 248, true); private Offset<byte> soundCommand = new Offset<byte>("sounds", 0x4200, true); /// <summary> /// Plays a sound via FSUIPC /// </summary> /// <param name="filePath">The path to the WAV file. Can be a full path, or relative to the FlightSim's 'Sound' folder</param> /// <param name="loop">Pass true to play the sound in a continuous loop</param> /// <returns>The ID of the sound. Save this if you need to stop the sound later.</returns> private int PlaySound(string filePath, bool loop) { int id = new object().GetHashCode(); soundCommand.Value = (byte)(loop ? 0x2 : 0x1); // 2 = Play looped. 1 = Play Once soundID.Value = id; soundDevice.Value = 0; // 0 = Default sound card. (FSUIPC lists the devices in the [Sounds] section of its INI file.) soundFilePath.Value = filePath; FSUIPCConnection.Process("sounds"); return id; } private void StopSound(int id) { soundCommand.Value = 3; // STOP soundID.Value = id; soundDevice.Value = 0; soundFilePath.Value = ""; FSUIPCConnection.Process("sounds"); } To play a sound once call like this: // Play door closing - once. int id = PlaySound("xdoor_small.wav", false); Note that this WAV file is in the FlightSim's 'Sound' folder so I just use the file name. You can also specify a full path to anywhere on the disk if you want. Start with the drive letter (e.g C:\) If you don't need to stop the sound from playing later you can ignore the ID number that is returned from this method. To play a sound in a loop, call like this: // Play rain in loop. Save ID to stop it later. rainSoundID = PlaySound("precip\\xprecg4.wav", true); This wav is in the 'precip' folder under the 'sounds' folder. The ID returned is used to stop this sound in the next example: To stop a sound from playing: StopSound(rainSoundID); Note that the sounds are played by FSUIPC, so if your application exits while sounds are playing they will continue to play. If you don't want that, keep a list of all your long-running and looped sounds so you can stop them before your application exits.. I don't know if this is implemented in FSUIPC7 (for MSFS). Paul
-
Help Help Help TCA Boeing Throttle Quadrant
Paul Henty replied to Pilot1435's topic in FSUIPC Support Pete Dowson Modules
I don't know, as I say I don't have the aircraft. Have you tried one of the control ending in _SELECTOR, like EVT_MCP_ALTITUDE_SELECTOR? Like all the other controls you need to tell it what kind of mouse click you want to do on this switch, Paul -
Help Help Help TCA Boeing Throttle Quadrant
Paul Henty replied to Pilot1435's topic in FSUIPC Support Pete Dowson Modules
I guess that's just how the aircraft is programmed. If you click that control in the cockpit with the mouse it probably increases and decreases by 500 ft. Maybe some other mouse action is used for smaller or larger increments? Try MOUSE_FLAG_RIGHTDRAG 0x02000000 MOUSE_FLAG_LEFTDRAG 0x00800000 MOUSE_FLAG_WHEEL_UP 0x00004000 MOUSE_FLAG_WHEEL_DOWN 0x00002000 Paul -
Help Help Help TCA Boeing Throttle Quadrant
Paul Henty replied to Pilot1435's topic in FSUIPC Support Pete Dowson Modules
You probably need to use EVT_MCP_ALTITUDE_SELECTOR with the correct type of mouse click parameter (see my linked post). I don't have the PMDG but maybe left click is INC and right click is DEC? Paul -
The main example for writing offsets is here: http://fsuipcwebsockets.paulhenty.com/#cmdoffsetswrite The full code is available via the button at the bottom of the page. You'll just need to plug in your own offset declarations and write the appropriate values. I've never used these facilities but from looking at the documentation, this is probably what you need: Offset Declaration Request: var request = { command: 'offsets.declare', name: 'runpreset', offsets: [ { name: 'presetParameter', address: 0x7C80, type: 'int', size: 4 }, { name: 'presetName', address: 0x7C50, type: 'string', size: 48 }, ] } Write Request: var presetName = 'MyPreset'; var presetParameter = 0; var request = { command: 'offsets.write', name: 'runpreset', offsets: [ { name: 'presetParameter', value: presetParameter }, { name: 'presetName', value: 'P:' + presetString } ] } Paul
-
I don't know if the PMDG 737 Offsets work in FSUIPC7. @John Dowson will be able to tell you. Looking at the PMDG_NG3_SDK.h file, you should be able to use the normal PMDG 737 events (controls). In any case you need to enable the SDK broadcast in the PMDG 737 ini file. The video shows you how to do this, starting at 0:58. If you can't get it to work, please show some code. Paul
-
Yes, any offset can be used from the websocket server. There is no higher level APi for writing controls though, so you need to use the offset directly. To send the control, declare two offsets of type int with size 4. The first one should be the parameter value at 0x3114. The second should be the control number at 0x3110. The order is important. 0x3114 should be declared before 0x3110. 0x7C50 probably just needs to be declared as a string offset with the appropriate length. I can't find it in the docs I have here. Must be new. Paul
-
You'll need to ask PMDG. My DLL only lists the controls that are in the SDK. You send the action and screen position as the parameter to the PMDG_737_NGX_Control control. Here is an example of clicking the middle of the screen. int actionCode = 1; // Mouse click int x = 500; // Middle (0 = left side of screen, 1000 = right side of screen int y = 500; // Middle (as above goes from 0 to 1000. Docs doesn't say if 0 is top of bottom. You'll need to experiment). int parameterValue = (1000000 * actionCode) + (1000 * x) + y; FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_EFB_L_SCREEN_ACTION, parameterValue); Paul
-
C# demo for FsRunwayLightsInfo
Paul Henty replied to ozansayli's topic in FSUIPC Client DLL for .NET
This class is part of the AirportDatabase feature. There is demo code for this feature in the "example code" project: http://fsuipc.paulhenty.com/#downloads However, the example doesn't show the FsRunwayLightsInfo class specifically, but it simply holds the information about the runway's lights. You can get to it via the FsRunway class once you have the database loaded and have found the runway from the airport. The properties are self-explanatory and there is a little more detail about each property in the intellisense popup or the reference documentation: http://fsuipc.paulhenty.com/Reference/html/classFSUIPC_1_1FsRunwayLightsInfo.html No, all the information in the AirportsDatabase comes from text files generated by Pete's MakeRunways.exe program. My dll has no ability affect the scenery in the simulation. You will probably need a scenery editor for that. Paul -
Hi James, This thread (and forum) is about programming, so it's not relevant to your issues as a user of FSUIPC. I have the same version of FSX Steam Edition as you and FSUIPC4 works fine with it. If you're having issues you need to post in the main FSUIPC support forum where John (the developer for FSUIPC) can help you get it working. Follow this link and start a new topic: https://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/ Paul
-
FSUIPCConnection.SendKeyToFS - Question
Paul Henty replied to Skino2412's topic in FSUIPC Client DLL for .NET
Yes that looks like it would work. You will need to adjust the Enum.Parse call to make it case-insensitive since you are using lower-case letters: Pass 'True' as the second parameter. Paul -
FSUIPCConnection.SendKeyToFS - Question
Paul Henty replied to Skino2412's topic in FSUIPC Client DLL for .NET
Hi Peter, You can do this by converting the string into the 'Keys' enum using Enum.Parse(). (I think when you wrote Keys.1 you mean Keys.D1). Dim Taste1 As String = "D1" Dim Taste1Enum As Keys = Keys.None If [Enum].TryParse(Of Keys)(Taste1, Taste1Enum) Then ' Parse OK. Taste1Enum now has correct value FSUIPCConnection.SendKeyToFS(Taste1Enum, SendModifierKeys.Alt, Me.ParentForm) Else ' Text in Taste1 is not a valid Keys enum value End If For this to work, the string will need to be exactly the same as the Enum value text. Paul -
You're probably running with the debugger attached in both cases. (F5). Try running the release version without the debugger (ctrl-F5). That should be the same behaviour as running outside of VS. If it is (i,.e. it crashes when running via ctrl-f5) then it's very likely a timing issue. Your app is running slower with the VS debugger attached. For John: That's correct. I'm a bit confused about this bit. My DLL relies only on the call back registered with fsuipcw_registerLvarUpdateCallbackById to know when LVars have changed. (Parameter -1 for all Lvars). In this case, which setting is relevant: the wasm ini frequency or client frequency? Paul