Jump to content
The simFlight Network Forums

Scotfleiger

Members
  • Posts

    392
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by Scotfleiger

  1. Test ran with many restarts with FSUIPC5103fT4. No Invalid Arguments or other problems found. Well done and thank you. FSUIPC5.log
  2. Hi Tom, yes that statement will provide the result you are looking for.
  3. Very strange. I must be age. Mine or LUA 5.1 I could not tell. This statement formats a floating point but the first zero is not used as a filler as Tom requires. ans = string.format("%02.02f", val) For val=1.23 it gives " 1.23" and not "01.23".
  4. Hi Tom The LUA string.format does not appear to be able to handle the decimal point as I thought. I wrote this test function using LINDA LUA editor which I believe achieves what you want: function test() for i = 1, 9999, 1 do val = i/100 val1 = math.floor(i / 100) val2 = math.floor((((i / 100) - val1) * 100) + 0.5) --ans = string.format("%02d.02d", val) --ans = string.format("%02d.%02d", val1, val2) ans = string.format("%02d", val1) .. '.' .. string.format("%02d", val2) _log('i = ' .. i .. ' ans = ' .. ans .. ' (val1 = ' .. val1 .. ' val2 = ' .. val2 .. ')') ipc.sleep(10) end end The commented out lines "--ans =" do not work but the following does using val1 as the integer part and val2 and the decimal part: ans = string.format("%02d", val1) .. '.' .. string.format("%02d", val2) The _log() function is for writing to the LINDA console for debugging purposes. See LINDA Downloads. Google is a invaluable tool for the programmer. See http://lua-users.org/wiki/StringLibraryTutorial.
  5. I'm back!! I have run repeated tests with 5.103fT3. There were no crashes or invalid arguments. I initially changed my code to reverse the forward to back slashes (entered as "\\" in strings) for the path used to access my system files. First, this stopped the file_exists() finding the files based on the \modules root. Secondly, the Split function generates an error - this is used to process all the Lua libraries used and built into a long string of file path names separated by the pound/hash sign. Windows is indifferent to whether forward or back slashes are used in pathnames and in most cases does not cause the LuaRun/LuaKill function calls any problems. FSUIPC5.log
  6. Yesterday's tests with crashes I had P3Dv4, 5.103fT2 and LINDA 3.0.1 running. Possibly AS16. Devices were VRI MCP2a, Saitek panels, throttles and CH Flightstick. No buttons were pushed during test. Only CYRL+ALT+R used to restart.
  7. Ticking the Profile checkbox will allow you to define an aircraft profile to assign Lua code to.
  8. Further test with all FSUIPC logging off except buttons/keys as requested. No crashes. One occurrence of Invalid Argument and a number of the different .lua filenames. FSUIPC5-C.log
  9. I have attached the 2 reports P3Dv4 crashes from yesterday (1752 and 1759) - logs in reverse time order. P3Dv4-FSUIPC5103fT2-crashreports.txt
  10. Try "%02d.02f". The 0 means leading zeros, the 2s means two places, the d means decimal and the f means floating points. Search also for printf formatting for C and even Delphi formatStr which should give you the meaning of the format codes.
  11. The string.format has 2 arguments: a format definition string and the value to format. Try string.format("%02.2f", value) for 02.34 or string.format("%.2f", value) for 2.34.
  12. The attached log is from 20 mins of testing. P3Dv4 did not crash in this test. There was one example of Invalid Argument at 697000. In this case I restarted before LINDA had completed its initialisation. In a number of cases, the logging is a little confusing. The debug reports RunLua just called and show init.lua as the filename. I would have expected linda.lua which is killed and a thread created in the 2 subsequent lines. 694734 RunLua just called: Filename "C:\P3Dv4\Modules\linda/system/init.lua" 694890 LUA: "C:\P3Dv4\Modules\linda.lua": killed 694890 About to Create the Lua thread: Entry 1, Filename "C:\P3Dv4\Modules\linda.lua" 694890 Create Lua thread: Entry 1, Filename "C:\P3Dv4\Modules\linda.lua" 694890 LUA.1: [START] *********************** STARTING LINDA *********************** I will be out all day tomorrow. FSUIPC5.log
  13. Ran the latest test twice. On both occasions, P3Dv4 eventually crashed at the point RunLua(path) was called on restart. In log-A, it came up with Filename "" on first running the initialisation code but went on to create the new thread, the same occurred in Log-B: 92937 LUA.1: LINDA:: [START] Calling Initialisation... 92937 LUA.1: LINDA:: [START] Path = linda/system/init 92953 RunLua just called: Filename "" 92953 About to Create the Lua thread: Entry 0, Filename "C:\P3Dv4\Modules\linda/system/init.lua" 92953 Create Lua thread: Entry 0, Filename "C:\P3Dv4\Modules\linda/system/init.lua" 92968 LUA.0: LINDA:: [INIT] Starting Initialisation... Others, killed init.lua: 151078 LUA.1: LINDA:: [START] Calling Initialisation... 151078 LUA.1: LINDA:: [START] Path = linda/system/init 151078 RunLua just called: Filename "C:\P3Dv4\Modules\linda/system/init.lua" 151234 LUA: "C:\P3Dv4\Modules\linda/system/init.lua": killed 153328 About to Create the Lua thread: Entry 0, Filename "C:\P3Dv4\Modules\linda/system/init.lua" 153328 Create Lua thread: Entry 0, Filename "C:\P3Dv4\Modules\linda/system/init.lua" 153343 LUA.0: LINDA:: [INIT] Starting Initialisation... But then crashed P3Dv4 at: 157875 LUA.1: LINDA:: [START] Calling Initialisation... 157875 LUA.1: LINDA:: [START] Path = linda/system/init 157875 RunLua just called: Filename "C:\P3Dv4\Modules\linda/system/init.lua" 158031 LUA: "C:\P3Dv4\Modules\linda/system/init.lua": killed I can not see any of the invalid argument fails. I will run the test again but it will be later. FSUIPC5.log-A FSUIPC5.log-B
  14. Still not letting me in Not Found The requested URL /beta/FSUIPC5103fT2.zip was not found on this server.
  15. I ran the test for 10 mins forcing the restarts. On 15 occasions when I restarted I got: 123859 LUA.1: LINDA:: [START] Calling Initialisation... 123859 LUA.1: LINDA:: [START] Path = linda/system/init 124016 LUA: "C:\P3Dv4\Modules\linda/system/init.lua": killed 126109 LuaThread called: Entry 0, Filename "C:\P3Dv4\Modules\linda/system/init.lua" 126109 About to load the Lua file: Entry 0, Filename "C:\P3Dv4\Modules\linda/system/init.lua" 126141 LUA.0: LINDA:: [INIT] Starting Initialisation... Only on one occasion I got: 304641 LUA.1: LINDA:: [START] Calling Initialisation... 304656 LUA.1: LINDA:: [START] Path = linda/system/init 304797 LUA: "C:\P3Dv4\Modules\linda/system/init.lua": killed 306906 LuaThread called: Entry 0, Filename "" 306906 About to load the Lua file: Entry 0, Filename "" 306906 *** LUA Error: cannot open : Invalid argument 307563 LUA: "C:\P3Dv4\Modules\linda.lua": killed. <<<< automatic restart by LINDA 307563 LuaThread called: Entry 0, Filename "C:\P3Dv4\Modules\linda.lua" 307563 About to load the Lua file: Entry 0, Filename "C:\P3Dv4\Modules\linda.lua" 307563 LUA.0: [START] *********************** STARTING LINDA ***********************
  16. I ran the LUA logging enabled test for over 5 mins with multiple restart creating a 5GB file. There is one LuaL event at 178735. Zipped file attached. FSUIPC5-LUA.log.zip
  17. The code used in linda.lua (called from ipcReady.lua) is as shown. It does a test to ensure path to init.lua exists before calling runlua(path). I don't possess Visual Studio and my knowledge of C is limited. I am happy with my workaround self-restart so don't waste your valuable time on this problem.
  18. Hi Pete I have run several test but the attached log includes your LuaL_loadfile message (a single occurrence). As suspected, the filename argument appears to be of zero length. I performed a number of forced restarts (using LINDA's CTRL_ALT+R hotkey) and also by changing the aircraft. On the last reset as init.lua is killed P3Dv4 crashed. As mentioned, I now have a added a trap to detect the Invalid Argument and automatically trigger a LUA restart. FSUIPC5.log
  19. Hi Pete Thank you for getting back to me. I have implemented the workaround in code to detect the error and automatically trigger a restart. I am seeing the problem in the logs but not your level of debugging as before. Can you remind me of the Debug code you need me to use?
  20. Pete/Stefan i am using the same CH Flightstick with FSUIPC 5.103 (formal) and LINDA 3.0.0 beta in my role as LINDA Support Developer I am not seeing any disconnects. Without full LINDA verbose logging Stefan I can not see what LINDA is doing. The disconnecting/reconnecting of HID devices is a Windows function as Pete says and the Win10 power saving is a known problem with higher powered USB devices like Saitek Radio/Mulit Panels.
  21. Hi Pete Brain functioning again. Sorry! I have run the 5.103a with the additional logging. In over 10 restarts I got one error report: 238750 LUA.1: LINDA:: [START] Calling Initialisation... 238750 LUA.1: LINDA:: [START] Path = linda/system/init 238906 LUA: "C:\P3Dv4\Modules\linda/system/init.lua": killed 240578 luaL_loadfile fopen error 0, filename "" 240578 *** LUA Error: cannot open : Invalid argument 253093 LUA: "C:\P3Dv4\Modules\linda.lua": killed 253093 LUA.0: [START] *********************** STARTING LINDA *********************** It appears that the file path passed is being lost between init.lua being killed and the runlua being executed. There is a 1672ms delay between these events. After manually initiating a restart I have noticed a delay of 1600 to 2000ms. FSUIPC5.log
  22. Your help is much appreciated but I am busy with other important work and I need to think. Brain fart in progress!!!
×
×
  • 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.