
pilotjohn
Members-
Posts
407 -
Joined
-
Last visited
-
Days Won
3
Content Type
Profiles
Forums
Events
Gallery
Downloads
Everything posted by pilotjohn
-
Ok, another question. I'm trying to write to B000 (instead of using the structs) but it's not working for me. I'm setting dynamics 0, global mode, and clearing via NWI, then write "GLOB ..." to 0xB000 via ipc.writeSTR(0xB000, "GLOB ...") but FSUIPC show only this: 5498536 NW_DYNAMICS command, setting weather dynamics = 0 5499457 NW_GLOBAL command, setting weather to global mode 5500377 NW_CLEAR weather command received 5500377 NWI weather clear actioned 5500377 External weather discarded 5500424 Weather Mode now = Theme 5500424 Weather Mode now = Global 5502187 Setting Metar: "" Any ideas? Writing to B000 seems to trigger that "Setting Metar" log message, but regardless of the string I send, it's shown as blank.
-
Is there no way to specify cloud height and/or tops? I notice the NWI has structure for it (UpperAlt), but logging shows no such data being sent since it's not part of the extended METAR. Also, I turned on logging and noticed that there are constant reads and writes for weather. I turned off all FSUIPC "weather" options and writes stopped (they were writes to nearby stations even though GLOB mode was active) but the reads continue. Is there anyway to tell what might be using FSUIPC to request the reads, or whether it's FSUIPC itself?
-
Yes, I'm in global mode. I placed FSX in global mode and write the weather for "GLOB" ID. The only way I seem to be able to "fix" visibility is if set NWI.Vis to -1 to 0 for altitude, and then use UpperVisibility layers from 1..whatever to set visibility. It seems only the NWI.Vis settings behave oddly.
-
Thanks... a few more questions. So far setting temperature layers works great, and so does setting visibilities with one problem. The NWI.Vis (the surface visibility) is set but then immediately starts to change on its own (visibly and viewed in WeatherSet2) to a higher value, about every 3-5 seconds or so, until it reaches the limit I set in FSUIPC. This happens even if I disable the limits in FSUIPC (and then it changes to 60). The upper level visibility layers I set appear to be untouched. This is regardless of whether I use NW_SET or NW_SETEXACT and ensure that dynamic is set to 0 prior to any of the changes. It also happens if I change he visibility with WeatherSet2. Any ideas?
-
I have some questions about NWI, specifically whether certain fields are used and their meaning by/for FSX: _NewWind.Variance: Is this +/- for variable wind? Is it used? _NewWind.SpeedFract: What is it used for? How? _NewCloud.Deviation: What is it? _NewTemp.DayNightVar: Is this an amount subtracted from Day temp when night falls? Dew point is unaffected? Will this simulated fog if T/D converge at night? Is it for FSX? It this used only for surface or all altitudes? Will clouds form when T/D converge at upper altitudes? _NewPress.Drift: What is this for? Your comments say "? Maybe" I'm planning on writing global weather generator (which seems to work, at least I can clear through Lua using vstruct), but if I chose to add location based variation, do you have any insights? If I write a different weather at 1 degree lat/long intervals, does FSX try to interpolate between them? For example, if I generate two MVFR conditions 60 NM apart and vis/clouds are different, what happens. Or, do I need to write weather only to ICAO locations?
-
New Weather Interface and Observations
pilotjohn replied to pilotjohn's topic in FSUIPC Support Pete Dowson Modules
It was determined empirically, slewing up/down using many combinations of settings. A few more questions... As I mentioned, I'm working on a Lua Random Weather generator. I'm using vstruct to pack/unpack structures and need confirmation that chars are 1 byte, shorts are 2 bytes, and ints are 4 bytes, as FSX/FSUIPC is compiled. Is this correct? Also, NewWeather.h in the SDK is different than NewWeather.h in New Weather Interface for FS2004.zip. Which one is the correct one for FSX? -
Pete, Looking for some additional info on NWI. 1. What is the tops setting, it doesn't seem to make difference? 2. Why are there 10 cloud types, but only 1, 8, 9, 10 seem to be used? For others, I empirically determined some cloud/precip. rendering rules (maybe it'll be helpful to some): Cirrus: Thin no matter what. Stratus: Half as thick as requested. Cumulus: Less than 2000 puffy, otherwise dark base, more than 15000 towering. Thunder: Less than 15000 towering, otherwise as requested. P-base: Write 10x, will not be lower than real top of layer below.
-
PMDG JetStream 4100 (JS41/J41) Saitek Multi-Panel Lua
pilotjohn replied to pilotjohn's topic in User Contributions
Here's an update... it fixes the J41's A/P from selecting +/-100FPM VS when new ALT is selected while ALT HLD is engaged (thus causing the plane to leave the captured altitude). Also, a mention in the instructions that you need UseProfiles=No and the name after Auto should be Jetstream not JetStream. Rename .txt to .lua. JS41SaitekMP.txt -
The FSUIPC GUI Key Press area doesn't save the parameter value. I have a LuaToggle defined, and regardless of what I put in parameter (>0) when I save and return to the GUI, the parameter reads 0. If I edit it in FSUIPC.ini and then open the GUI, the parameter shows correctly. This is version 4.731.
-
PMDG JetStream 4100 (JS41/J41) Saitek Multi-Panel Lua
pilotjohn replied to pilotjohn's topic in User Contributions
Here it is inline as well... -- PMDG JetStream 4100 Saitek Multi-Panel Synchronizer 1.0.0 -- E-mail: pilotjohn at gearsdown.com -- -- Synchronizes the JS41 autopilot functionality with the default FSX -- behavior. This allows standard FSX compatible equipment (Saitek Multi-Panel) -- to be used for some, if not most, auto-pilot functions. -- Developed along SPAD, untested otherwise. -- Setup: -- -- 1. Edit "FSUIPC.ini" and add (substitute X for 1 or next # if exists): -- [General] -- ShortAircraftNameOk=Substring -- [Auto.JetStream] -- X=Lua JS41SaitekMP -------------------------------------------------------------------------------- -- Helpers meters2feet = 100/2.54/12 feet2meters = 12*2.54/100 -------------------------------------------------------------------------------- -- Callbacks local lalt=-1 local latm=-1 function altitude_set(ofs, val) local nalt = math.floor(val*meters2feet/65536 + 0.5) if (lalt == nalt) then -- eliminate double calls return elseif (lalt >= 0 and math.abs(lalt - nalt) > 10000) then -- if VS is pressed altitude is set 60000, ignore and reset ipc.writeUD(0x07D4, math.floor(lalt*feet2meters*65536 + 0.5)) return else lalt = nalt end local jalt = ipc.readLvar("AltSelAlt") local diff = math.abs(nalt - jalt) / 100 ipc.writeLvar("IrcAltSelKnob", 1) if (jalt < nalt) then for i=1,diff do ipc.control(66587, 3921) end elseif (nalt < jalt) then for i=1,diff do ipc.control(66587, 3920) end end ipc.control(66587, 8031) latm = ipc.elapsedtime() end local lspd = -1 local lstm = -1 function airspeed_set(ofs, val) local nspd = val if (lspd == nspd) then -- eliminate double calls return else lspd = nspd end local jspd = ipc.readLvar("VSIASTarget") if (jspd < 0) then ipc.writeUW(0x07E2, 0) return end local diff = math.abs(nspd - jspd) if (jspd < nspd) then for i=1,diff do ipc.control(66587, 1500) end elseif (nspd < jspd) then for i=1,diff do ipc.control(66587, 1501) end end ipc.control(66587, 8031) lstm = ipc.elapsedtime() end local lhdg = -1 local lhtm = -1 function heading_set(ofs, val) local nhdg = math.floor(val*360/65536 + 0.5) if (lhdg == nhdg) then -- eliminate double calls return else lhdg = nhdg end local jhdg = ipc.readLvar("HDGBug") local diff = math.abs(nhdg - jhdg) if (jhdg < nhdg) then for i=1,diff do ipc.control(66587, 26902) end elseif (nhdg < jhdg) then for i=1,diff do ipc.control(66587, 26901) end end ipc.control(66587, 8031) lhtm = ipc.elapsedtime() end function apm_toggle(ctrl, param) ipc.writeLvar("L:APEngageSwitchSelect", 1) ipc.control(65580) ipc.control(66587,8038) ipc.sleep(100) ipc.writeLvar("L:APEngageSwitchSelect", 0) ipc.control(66587,8038) end function hdg_toggle(ctrl, param) ipc.writeLvar("L:FdModeselHdgSwitch", 1) ipc.control(66587,277) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselHdgSwitch", 0) ipc.control(66587,8031) end function nav_toggle(ofs, val) ipc.writeLvar("L:FdModeselNavSwitch", 1) ipc.control(66587,278) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselNavSwitch", 0) ipc.control(66587,8031) end function apr_toggle(ofs, val) ipc.writeLvar("L:FdModeselAprSwitch", 1) ipc.control(66587,279) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselAprSwitch", 0) ipc.control(66587,8031) end function bcr_toggle(ofs, val) ipc.writeLvar("L:FdModeselBcSwitch", 1) ipc.control(66587,280) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselBcSwitch", 0) ipc.control(66587,8031) end function alt_toggle(ofs, val) ipc.writeLvar("L:FdModeselAltselSwitch", 1) ipc.control(66587,282) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselAltselSwitch", 0) ipc.control(66587,8031) end function vsi_toggle(ofs, val) ipc.writeLvar("L:FdModeselVsSwitch", 1) ipc.control(66587,283) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselVsSwitch", 0) ipc.control(66587,8031) end function ias_toggle(ofs, val) ipc.writeLvar("L:FdModeselIasSwitch", 1) ipc.control(66587,284) ipc.control(66587,8031) ipc.sleep(100) ipc.writeLvar("L:FdModeselIasSwitch", 0) ipc.control(66587,8031) end function altitude_update() if (ipc.elapsedtime() - latm < 1000) then -- give the gauge time to update return end -- update bug local jalt = ipc.readLvar("AltSelAlt") local oalt = math.floor(ipc.readUD(0x07D4)*meters2feet/65536 + 0.5) if (jalt ~= oalt) then ipc.writeUD(0x07D4, math.floor(jalt*feet2meters*65536 + 0.5)) end end local lvsi = nil function vertical_update() local jvsi = 0 local ovsi = ipc.readSW(0x07F2) -- fix IAS to VS swap going to -9900 FPM if (lvsi ~= nil and math.abs(lvsi - ovsi) > 1000) then ipc.writeSW(0x07F2, lvsi) else lvsi = ovsi end jvsi = ipc.readLvar("CoamingAPVS") ovsi = ipc.readUD(0x07EC) if (jvsi ~= ovsi) then ipc.writeUD(0x07EC, jvsi) end end function airspeed_update() if (ipc.elapsedtime() - lstm < 1000) then -- give the gauge time to update return end -- update bug local jspd = ipc.readLvar("VSIASTarget") if (jspd < 0) then jspd = 0 end local ospd = ipc.readUW(0x07E2) if (jspd ~= ospd) then ipc.writeUW(0x07E2, jspd) end jspd = ipc.readLvar("CoamingAPIAS") ospd = ipc.readUD(0x07DC) if (jspd ~= ospd) then ipc.writeUD(0x07DC, jspd) end end function heading_update() if (ipc.elapsedtime() - lhtm < 1000) then -- give the gauge time to update return end -- update bug local jhdg = ipc.readLvar("HDGBug") local ohdg = math.floor(ipc.readUW(0x07CC)*360/65536 + 0.5) if (jhdg ~= ohdg) then ipc.writeUW(0x07CC, math.floor(jhdg*65536/360 + 0.5)) end -- update switch -- jhdg = ipc.readLvar("CoamingAPHDG") -- ohdg = ipc.readUD(0x07C8) -- if (jdgs ~= ohdg) then -- ipc.writeUD(0x07C8, jhdg) -- end end function ias_update() end function vs_update() end function no_op(ofs, val) end function run_update(t) altitude_update() vertical_update() airspeed_update() heading_update() end -------------------------------------------------------------------------------- -- Main event.offset(0x07D4, "UD", "altitude_set") event.offset(0x07E2, "UW", "airspeed_set") event.offset(0x07CC, "UW", "heading_set") event.intercept(0x07BC, "UD", "apm_toggle") event.intercept(0x07C8, "UD", "hdg_toggle") event.intercept(0x07C4, "UD", "nav_toggle") event.intercept(0x07FC, "UD", "no_op") event.intercept(0x0800, "UD", "apr_toggle") event.intercept(0x0804, "UD", "bcr_toggle") event.intercept(0x07D0, "UD", "alt_toggle") event.intercept(0x07EC, "UD", "vsi_toggle") event.intercept(0x07DC, "UD", "ias_toggle") event.timer(1000, "run_update") -
PMDG JetStream 4100 (JS41/J41) Saitek Multi-Panel Lua
pilotjohn replied to pilotjohn's topic in User Contributions
Attached... I forgot to press the "Attach files" button. JS41SaitekMP.txt -
PMDG JetStream 4100 (JS41/J41) Saitek Multi-Panel Lua
pilotjohn posted a topic in User Contributions
EDIT: Latest version (1.2.1) attached as of 12/6/2011 Here's a Lua script that makes the Saitek Multi-Panel via SPAD (default config) work with the JS41. Some minor inconveniences/notes: 1. HDG light may come one when HDG is not ON on the panel (AP ON and no LNAV selected, or sometimes when VS selected) 2. ALT light comes on when VS or IAS is selected whether ALT/ALTSEL is ON on the panel or not 3. ALT switch toggles ALTSEL mode not ALT 4. If no mode is selected when AP turned ON, heading may drift 5. Eliminates a bug in the AP where switching from IAS to VS sets VS to -9900 FPM Rename attached .txt to .lua. JS41SaitekMP.txt -
0x02B4 is ground speed, and so is 0x6030 (GPS). What is the difference between the two? Does the GPS one work if there's no GPS configured in the plane (gauge) or it's not ON, and is the update rate the same? The GPS one has a ground track available, is there no "generic" ground track data available otherwise?
-
No worries... it's the failure script I'm working on, but it's using both offset and control. The configuration defines what to do for a failure (e.g. set FSX failure mode, or set flap control to 0) and if it's not a standard FSX failure, there's the option to re-"force" it on an event. The event function is global (e.g. failure_force) and if a failure needs to be reset, I have to recreate all the existing events since I have to cancel all events on failure_force. It's not problem, as I will likely allow only a full failure reset, not individual ones as I originally planned. I was just contrasting the API with standard stuff like addListener/removeListener type paradigms in call-back scenarios.
-
I can't do this because the controls to monitor (and even whether to monitor) are coming from a "configuration" array... I'll work around the limitation.
-
I know there's an event.cancel() function to cancel all events assigned to a function. But is there a way to cancel the event handler for a specific type of event only? For example, if i'm watching event.control(X, "func") an event.control(Y, "func") and event.control(Z, "func") can I somehow cancel events for control X only, without canceling all event on the function "func"? If not, maybe this could be done with something like event.control(X, "") or event with a separate function to cancel per function, like event.cancelControl(X, "func")
-
On a separate note, there appears to be a limit on Lua script names. "PersistentFailure.lua" is truncated to PersistentFailur. Can it be expanded to more than 16, maybe 64?
-
In the current SimConnect docs (http://msdn.microsoft.com/en-us/library/cc526981.aspx) under "Racing" there appear to be some additional things related to engine cylinders. These do not apply to FSX?
-
I'm working on a small persistent failure script, and wondering if there are some undocumented ones not listed in the documentation. If I look in the FSX failures menu there are individual failures for engine components (cylinders, magnetos, fire, oil leak), and a lot of other things (individual gears, static system, individual ailerons, fuel leak etc.), that don't seem to be available as offsets. Is this because they're unavailable to you? Would it be possible to add them all?
-
Weather Control through 0xF1C
pilotjohn replied to pilotjohn's topic in FSUIPC Support Pete Dowson Modules
Found it... Thanks! -
Thanks... I'll look at those.
-
Weather Control through 0xF1C
pilotjohn replied to pilotjohn's topic in FSUIPC Support Pete Dowson Modules
Ok... is there any documentation on NWI you could point me to? I couldn't find any, and the only thing I found was the extended METAR syntax. Specifically I'm curious what the syntax of the structure would be to set global mode first, to be able to then write the extended METAR for GLOB. -
Well the Landing Critic would clearly provide "metrics" on your masterful approach, flare and roll-out. I suppose though the others would just be temporary/optional "notices". The only problem is that if one script shows something important, and another happens to pop up something temporary, the temp display may clear and remove the "permanent" one. If I come up with more concrete examples, I'll try to convince you more. In either case though, it would nice. :)
-
Weather Control through 0xF1C
pilotjohn replied to pilotjohn's topic in FSUIPC Support Pete Dowson Modules
Or is 0xC000 with the extended METAR format the correct facility to use to write weather into FSX? -
Would you consider expanding FSUIPC's Lua functionality to provide the capability of separate "windows" for display of each Lua script? I'm working on a few Lua utilities (persistent failures, landing critic etc.) and the sharing of a display output window is not very manageable.