Jump to content

PanelBuilder

Members
  • Posts

    286
  • Joined

  • Last visited

Everything posted by PanelBuilder

  1. Very nice indeed!
  2. Looks fantastic!
  3. Thank you sir.
  4. Well, that's how the sim does it, so that's how I do it too. Just get_weapon_type whenever you change stations. Cheers, Colin
  5. Is there any indicator or lamp that comes on when you've got proper AC power, like during the startup phase? I'm trying to determine when to switch on the 7-segment displays on my Weapon Status panel. So far it looks like: if either engine is at more that some rpm AND its alternator switch is on OR there's ground AC power then ... Thanks all.
  6. OK, thanks.
  7. It only updates the weapon type when you change stations. So if you jettison rockets, switch to other stations, and switch back, it will be blank. Cheers, Colin
  8. So if you're running on just batteries and inverters (engines off) do the batteries ever run down??
  9. All I can say is...wow.
  10. Hi, This is interesting. Can I ask what are you exporting to? Thanks, Colin
  11. Awesome.
  12. There's also 10.4 Inch Touchscreen LCD but it's more expensive than the 15 inch.
  13. I've tried 2 methods. First is to make sure lua has something to receive, if only a line feed, every frame. Second is to configure the receive to time out. Second method is better. You need to plow through the threads here. Maybe start at Oakes combined cockpit build thread. Cheers, Colin
  14. Cool!
  15. local gun = MainPanel:get_argument_value(615) Cheers, Colin
  16. Yes, try without the try :-) local inpst = c:receive() Cheers, Colin
  17. I can see why it would keep running at the end: there's a lot of data in the pipe. I don't get the delay at the start though. Are you still using IPAddress.Any ? What does "t=" look like? Cheers, Colin
  18. Hi ruprecht, would you mind posting a quick summary of why UDP is better? Thanks man, Colin
  19. local WSCdisplaystring = "/W"..ready..loaded..weaponcode..weaponcount..cannonrounds if lastWSCdisplaystring ~= WSCdisplaystring then socket.try(client:send(WSCdisplaystring)) lastWSCdisplaystring = WSCdisplaystring end I use TCP up til now. But I'll try UDP; I just don't know what the advantage might be. Cheers, Colin
  20. Hi! This is exactly what I do. I use a VB.Net program to read/write between the lua TCP client and a serial port. No, it just sends the value. It's totally under your control. You can send it every second (or tenth of a second) or every frame(cycle). I send it every frame, but only if it's different from the last value sent. Hope this helps. Keep asking if you're stuck at any point. We've got this pretty much figured out now, but I think for all of us, not too long ago, it was all a complete bloody mystery. Cheers, Colin
  21. You've come to the right place, mate. Here's some useful files: Ka-50\Temp\Error.log Enough said. Ka-50\Scripts\Aircrafts\Ka-50\Cockpit\devices.lua This has the device numbers you need for the various systems, for example: MainPanel = GetDevice(0) Weapon_System = GetDevice(12) Helmet = GetDevice(23) Ka-50\Scripts\Aircrafts\Ka-50\Cockpit\mainpanel_init.lua This has the ids you need to, for example, get a lamp state: MainPanel:get_argument_value(393) or GetDevice(0):get_argument_value(393) Ka-50\Scripts\Aircrafts\Ka-50\Cockpit\clickabledata.lua This has the action definitions you need to set a switch. For example, Master Arm is Button_1. So then you add 1 to 3000 (don't look at me like that) to get the action: Weapon_System:performClickableAction(3001,1) --master arm on or GetDevice(12):performClickableAction(3001,0)--master arm off Hope this helps, Colin
  22. This looks inteesting. http://www.simw.com/index.cfm?fuseaction=dsp_product_details&pid=1399 http://www.simw.com/index.cfm?fuseaction=dsp_product_details&pid=1438
  23. Here's some code to get you started. function LuaExportStart() dofile("./LuaSocket/Socket.lua") socket = require("socket") host = "127.0.0.1" port = 13000 c = socket.try(socket.connect(host, port)) -- connect to the listener socket c:setoption("tcp-nodelay",true) -- set immediate transmission mode socket.try(c:send("/Wt")) --This tells my WSC panel to run its self test display. --Self test runs between the time the connection is opened and the start of the mission socket.try(c:send("/Wa")) --This tells my WSC panel to send all its switch positions for startup socket.try(c:send("/Wr")) --This tells my WSC panel to run normal: only send changes c:settimeout(.01) end For the import: function LuaExportBeforeNextFrame() local inpst = socket.try(c:receive()) if inpst then <decode the rec'd string here> GetDevice(device):performClickableAction(action,setval) --set a switch end end And for the export: function LuaExportAfterNextFrame() local x = GetDevice(0):get_argument_value(400) --read the state of something <build a string to export here> socket.try(c:send(displaystring)) end And for the stop: function LuaExportStop() -- Works once just after mission stop. socket.try(c:send(WSCoff)) --blank the WSC displays --OK this bit is weird. It tell my WSC panel to send all switch positions --so there will be data sent *after* the connection is closed so the --windows app will notice it's closed. socket.try(c:send("/Wa")) --send all c:close() -- close the socket end Hope this helps. Cheers, Colin
  24. I wish there were working volt and amp meters.
×
×
  • Create New...