Jump to content
The simFlight Network Forums

Paul Henty

Members
  • Posts

    1,646
  • Joined

  • Days Won

    74

Everything posted by Paul Henty

  1. Are they working with SPAD on your machine? What about via the Joystick/Keyboard assignments in FSUIPC itself? Paul
  2. 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
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. 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
  13. 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
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. Got it, thanks. So it sounds like the WASM ini should be set to off when using my dll. Is that the default? Paul
  22. 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
  23. [ERROR]: Error setting Client Data lvar value 295=58.039216 This error is being generated by @John Dowson's WASMIF module. Looking at his source code it's generated when a SimConnect call fails when trying to write the LVar value. John might have some ideas about why this could happen. The main difference would be the speed your application runs at. It will be much faster in release. Maybe the writes are too fast and SimConnect is getting overwhelmed. It would depend on how you're controlling the timing though. Most of the .NET timers only tick as fast as the code running on the Tick event can complete. It could be that in debug mode the timer is running slower than your timer interval setting. But in release the timer tick code runs faster and the timer ticks AT the timer interval setting. Paul
  24. It just means that there are two of these offsets, one for each switch. So for the CRS switch the first one is at 6520, the second will be 2 bytes later (Short is two bytes) at 6522. For your flight director led, the first one is at 6538, the second one will be 1 byte later at 6539. You might find it easier to use the provided 737 Offsets class as all this is handled for you. You also won't need to code the offset declarations. To get the information you want you would use this code: 1. Create an instance of the PMDG 737 Offsets class at the form level: Dim PMDG737 As PMDG_737_NGX_Offsets = New PMDG_737_NGX_Offsets() 2. Refresh the data (like calling Process()) and read the offsets you want. All offsets are named like the offsets pdf. PMDG737.RefreshData() label1.Text = PMDG737.MCP_Course(0).Value label2.Text = PMDG737.MCP_Course(1).Value radioButton1.Checked = (PMDG737.MCP_annunFD(0).Value = 1) radioButton2.Checked = (PMDG737.MCP_annunFD(1).Value = 1) Note that if there is only one switch or display, you don't need the array accessor at the end. e.g. for the MCP heading it's just: lblHeading.Text = PMDG737.MCP_Heading.Value.ToString() Paul
  25. You need to use both. There is not enough information in 0x3124 alone. The platform type at 0x3308 will tell you how to interpret the version code at 0x3124. In short: If it's P3D or MSFS you divide the version code by 10. (e.g. 21 = V2.1). if it's FSX then version code 1= RTM, 2 = SP1, 3 = SP2 and 4= Acceleration (all non-steam editions). Anything over 100 means Steam Edition and you subtract 100 to get the specific build number. (e.g. 109 = Build 9 = Last stable release. 112 = Build 12 = Latest Beta). Paul
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.