Jump to content
The simFlight Network Forums

Andy B.

Members
  • Posts

    46
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Andy B.

  1. I figured it out. The timer that does the processing for the offsets was missing. Had to stop the connection timer when connection opens and start the process timer. If the process timer throws an exception, restart the connection timer. It all works now. 🙂
  2. Just did a test where all the timer did is report the activity count. When I started my app before MSFS was loaded, the total count is 0. After getting to the welcome screen, it still reported 0, even though IsOpen reported true. After restarting my app, I now have a total count of 219. Now, when I close MSFS, the display in my app still shows 219/connected for the current status. I don't understand, because this method works for other parts like aircraft panels. Not sure why it doesn't work here.
  3. I tried this offset. I have the same result as when checking IsOpen. The app shows not connected until MSFS is active, then changes to connected as expected. However, closing MSFS while the app is open still results in the connected message staying on screen, even when MSFS has completely unloaded. Restarting my app then displays not connected. Wonder why it's doing this...strange.
  4. So I understand, FSUIPCConnection.IsOpen only checks to see if FSUIPC itself is actively running. It knows nothing about MSFS or its current state. When MSFS closes, my app will always return the last known state of FSUIPC, which was open at the end of the test. To deal with this, I should check the activity counter offset since it can determine if MSFS is currently loaded. I can use the offset for now, but is there a way you can add this as a property to FSUIPCConnection?
  5. I have a C# WPF app with a main window that controls startup routines. In the main window, I have the following. The user control displays connection status. Unfortunately, the connection status shows 'not connected' when the window loads if MSFS is closed. It will also display 'connected' when MSFS is loaded. When the app is running and MSFS closes, the status remains at 'connected'. It should toggle between not connected and connected based on the status of MSFS/FSUIPC. Any ideas how I can fix it? connectionTimer = new() { AutoReset = true, Enabled = true, Interval = 300, }; // Connection elapsed event. #region connectionTimer.Elapsed += (s, e) => { // Try to open the connection. Otherwise connection timer will do nothing. try { FSUIPCConnection.Open(); FSUIPCConnection.Process(); } catch(Exception ex) { } }; #endregion connectionTimer.Start(); #endregion In the user control embedded into the main window, I have the following. var timer = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(300), IsEnabled = true, }; timer.Tick += async (s, args) => await UpdatePanelControlsAsync(); timer.Start(); private async Task UpdatePanelControlsAsync() { await Task.Run(() => { string status = FSUIPCConnection.IsOpen? "Connected" : "Not connected"; Dispatcher.Invoke(() => { connectionStatusTextBox.Text = status.ToString(); }); });
  6. Oh, nevermind. I didn't see your line that said the test switches mapped to the probe heat switches. Guess I should use the test switches then 🙂
  7. So, what should I use for the probe heat switches, the test probe heat switches, or something else?
  8. Hi, I am working on Talking flight monitor and the PMDG 737. I noticed that the anti-ice probe heat switches are missing. Is it possible to add them to the library?
  9. This fix worked. I also threw the MakeRwys.exe process and the BuildAirportsDatabase methods on different tasks.
  10. After running BuildAirportsDatabaseAsync through the debugger, I found this stack trace. I don't understand where it came from, or why it is causing problems. I have 229GB left on my internal drive and over 3TB on my external. I also have 16GB of memory and 8GB of dedicated video memory. In the event this process is blowing out my memory, is there another way that isn't as resource intence? System.ComponentModel.Win32Exception HResult=0x80004005 Message=Not enough quota is available to process this command. Source=WindowsBase StackTrace: at MS.Win32.UnsafeNativeMethods.PostMessage(HandleRef hwnd, WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndTarget.UpdateWindowSettings(Boolean enableRenderTarget, Nullable`1 channelSet) at System.Windows.Interop.HwndTarget.UpdateWindowPos(IntPtr lParam) at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
  11. Here is the log. BuildAirportsDatabaseAsync never makes it to the build part for some reason. Last log entry was just before the db.MakeRunwaysFiles check. Here is the log. [Info]: Loading screen reader driver.: [tfm.App.Application_Startup]: [2023-09-18 18:16] [Debug]: Deleting existing MSFS make runways output folder.: [tfm.App.RunMakeRunways]: [2023-09-18 18:16] [Debug]: Creating MSFS make runways output folder.: [tfm.App.RunMakeRunways]: [2023-09-18 18:16] [Debug]: Copying C:\Users\a_bor\Documents\GitHub\talking-flight-monitor\source\bin\Debug\net7.0-windows\data\MakeRwys\MakeRwys.exe to C:\Users\a_bor\AppData\Local\tfm\Make runways\MSFS\MakeRwys.exe.: [tfm.App.RunMakeRunways]: [2023-09-18 18:16] [Debug]: Waiting for make runways to finish.: [tfm.App.RunMakeRunways]: [2023-09-18 18:16] [Debug]: Getting a copy of the current airports database.: [tfm.App.BuildAirportsDatabaseAsync]: [2023-09-18 18:40] [Debug]: Assigned MSFS make runways output folder: C:\Users\a_bor\AppData\Local\tfm\Make runways\MSFS.: [tfm.App.BuildAirportsDatabaseAsync]: [2023-09-18 18:40] [Debug]: Assigned MSFS airports database folder: C:\Users\a_bor\AppData\Local\tfm\Airports database\MSFS: [tfm.App.BuildAirportsDatabaseAsync]: [2023-09-18 18:40]
  12. Some additional info. I tried running the feature again. Everything works as expected with the BuildAirportsDatabaseAsync method until it creates the airports database location (for the binary files). After that, the app dies with no notice to the user.
  13. I have two methods: RunMakeRunways that takes a parameter from a WPF dialog asking the user to choose a simulator to build the database for. After choosing, then browsing to the P3D install folder if required, pressing the OK button launches a process that runs MakeRwys.exe in the proper location. In case of MSFS, %localappdata%\tfm\Make runways\MSFS. In P3D's case, the install folder with the working path for the process set to the P3D install folder. Once the RunMakeRunways method is complete (it finishes the MakeRwys.exe process), it bases the original simulator choice to BuildAirportsDatabaseAsync (the method in the previous post). Now, in the case of if(simulator == "P3D") block, everything works as expected. As for the if(simulator == "MSFS") block, I have done the following: * Put logging statements after every line of code. * Ran it through the debugger, which strangely works as expected. * Ran it outside of the debugger and get this strange behavior. * Consulted AI models with no luck. At the end of the entire process, the message box is supposed to show how many airports were loaded. Unfortunately, when passing "MSFS" to BuildAirportsDatabaseAsync, execution apparently stops at the line: var db = FSUIPCConnection.AirportsDatabase; The next log statement never appears, and Talking flight monitor is no longer running. No errors or exceptions.
  14. Hi, I tried building and loading the database offline. It works for P3D, but not MSFS. Here is my BuildAirportsAsync method where the "P3D" condition suceeds and the "MSFS" condition fails. In fact, when "MSFS" is passed into this method, db = FSUIPCConnection.AirportsDatabase fails, and the method stops working with no errors or exceptions. What might be wrong? public static async void BuildAirportsDatabaseAsync(string simulator) { // In case a simulator is running, clear the database before rebuilding. if (FSUIPCConnection.IsOpen) { if (FSUIPCConnection.AirportsDatabase.IsLoaded) { FSUIPCConnection.AirportsDatabase.Clear(); } } try { var db = FSUIPCConnection.AirportsDatabase; if (simulator == "MSFS") { db.MakeRunwaysFolder = msfsMakeRunwaysOutputPath; db.DatabaseFolder = msfsAirportsDatabaseFolder; } if(simulator == "P3D") { db.DatabaseFolder = p3dAirportsDatabaseFolder; db.MakeRunwaysFolder = p3dMakeRunwaysOutputPath; } if (db.MakeRunwaysFilesExist) { await db.RebuildDatabaseAsync(); db.Load(); System.Windows.MessageBox.Show($"{simulator} airports build successfully. Total {db.Airports.Count}"); logger.Info($"{simulator} airports build successfully. Total {db.Airports.Count}"); } } catch(FSUIPCException x) { System.Windows.MessageBox.Show($"{x.Message}"); } }
  15. Hi, I am putting in Talking flight monitor a way to automatically run make runways after choosing a simulater, mainly MSFS and P3D. Running it for MSFS is easy: Just put MakeRwys.exe wherever you want, then start it. P3D is a little more complicated. One of the steps includes copying the output files from one location to another. Is there a way that you could include a feature to copy all of the output files from one location to another?
  16. Hi, I am rebuilding Talking flight monitor with WPF, C#, and dotnet 7. I am trying to rebuild the airports database while disconnected from a simulator. I figured I would try MSFS first because it is easier to code for in this sense. Whenever I try to create or otherwise access the database, I get a null reference exception saying that the database doesn't exist. Here is my build database method. The msfs/p3d database and make runways variables are pointing to the desired path. So, how would I be able to build the database files offline? public static async void BuildAirportsDatabaseAsync(string simulator) { // In case a simulator is running, clear the database before rebuilding. if (FSUIPCConnection.IsOpen) { if (FSUIPCConnection.AirportsDatabase.IsLoaded) { FSUIPCConnection.AirportsDatabase.Clear(); } } try { var db = FSUIPCConnection.AirportsDatabase; if (simulator == "MSFS") { db.MakeRunwaysFolder = msfsMakeRunwaysOutputPath; db.DatabaseFolder = msfsAirportsDatabaseFolder; } if (db.MakeRunwaysFilesExist) { await db.RebuildDatabaseAsync(); System.Windows.MessageBox.Show($"MSFS airports build successfully. Total {db.Airports.Count}"); logger.Info($"MSFS airports build successfully. Total {db.Airports.Count}"); } } catch(FSUIPCException x) { System.Windows.MessageBox.Show($"{x.Message}"); } }
  17. Hi, Around a week ago, I started asking Open AI chat (now Open GPT) some questions about the PMDG 737 and some parameters for undocumented events such as the events that control the efis or hgs. It returned a very large laundry list of offsets for the efis and hgs. This prompted me to ask it other questions about event parameters and offsets that weren't documented anywhere that I know about. Some systems I asked about were icas, the du displays, the efis, hgs, isd, flight path, nd, and the map. It returned lists upon lists of offsets. The more I asked, the more it gave. Are these valid systems that have offsets that we can use, or is Open AI misleading me? I tried some of its recommended icas offsets in private, and everything works. I don't want to publish the offset memory blocks in case they shouldn't make it into the wild, but am wondering if we could use them?
  18. Hi, I am wondering if there is a way to track the 3 dimensional aspect of clouds? At the moment, we can get the height of a cloud layer, but are interested in getting its length and width. Is this possible, or will we have to deal with using only the height?
  19. Hi, I noticed that the PMDG 747's Overhead Maint/EEC panel has ch selectors. Unfortunately, TFM's users can't read the selectors values as they press the selectors in TFM. Is there some way to read the values of the ch selectors so I can put the values in a more usable form? What are the possible values for these selectors?
  20. Hi, Talking flight monitor users want to experience the weather with automatic announcements of weather changes. For example, some users are interested in knowing when the aircraft enters/exits a cloud. They want to know what type of cloud it is and if it is raining/snowing/hailing/sleeting and so on. They also want to know if it is possible to get a polygon of GPS coordinates (3d) of a storm, cloud, or other weather event. This will help them be able to request diversions from ATC. Is this possible with the FSUIPC .net library? If not, what would it take to add something that can do this?
  21. Hi, While adding events to Talking flight monitor, I found that the towing power event is missing. Here is the line from the PMDG 747 SDK. #define EVT_OH_ELEC_TOWING_PWR (THIRD_PARTY_EVENT_ID_MIN + 287) // 747-8 Can you add this event?
  22. I got rebuild to work. The startup routine now works - lets you know if it failed and to see the logs for more, or that it successfully loaded. I also have rewritten a few database features and am getting used to how the new layout works. Thanks for the help and rewrite!
  23. Hi, Your sample worked and the following code will load the database once built. Unfortunately, it doesn't rebuild it for the first time. public static async void LoadAirportsDatabase() { if (FSUIPCConnection.IsOpen) { AirportsDatabase database = FSUIPCConnection.AirportsDatabase; database.MakeRunwaysFolder = Properties.Settings.Default.P3DAirportsDatabasePath; if(database.MakeRunwaysFilesExist && database.DatabaseFilesExist == false) { await database.RebuildDatabaseAsync(); } else if (database.DatabaseFilesExist) { database.Load(); } if (database.IsLoaded) { Tolk.Output("Airports database loaded."); } } // open connection. } // LoadAirportsDatabase
  24. Hi, To answer your questions, We are using .net 4.8 and we aren't using the progress class. Our database loading routine uses tolk to speak the status of database loading.
×
×
  • 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.