Jump to content

PanelBuilder

Members
  • Posts

    286
  • Joined

  • Last visited

Everything posted by PanelBuilder

  1. That's right, each panel has a PIC. Actually the WSC has two, one for the switches and one for the displays. I doesn't have to be broken up that way; that's just the way it worked out. For the landing gear panel I'll use one PIC for both the switches and the LEDs. The displays are actually not that complicated. I try to send bytes that the PIC can just about put direcly on its output pins. For the two-character russian weapon codes, here's how I set it up in lua: -- Here we define how the 7 segments are wired to the port pins sega = 0x01 segb = 0x02 segc = 0x04 segd = 0x08 sege = 0x10 segf = 0x20 segg = 0x40 leftbit1 = 0x80 -- Now we can build any character; 128 possibilities char6 = string.char(leftbit1 + sega + segf + sege + segd + segc + segg) charA = string.char(leftbit1 + sega + segb + segc + sege + segf + segg) charC = string.char(leftbit1 + sega + segf + sege + segd) charH = string.char(leftbit1 + segb + segc + sege + segf + segg) charN = string.char(leftbit1 + sega + segb + segc + sege + segf) charP = string.char(leftbit1 + sega + segb + sege + segf + segg) -- Now we can build the 2-character weapon display codes weaponNC = charN..charC weaponHP = charH..charP weaponNN = charN..charN weaponA6 = charA..char6 Cheers, Colin
  2. Hi, In my case everything runs on the same PC. 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 On the PC basically you open a TCP port and a serial port and read/write between them. As far as getting data out, we're only limited by the lua functions provided. For example, the WSC function is LoGetPayloadInfo(), so: local loadout = LoGetPayloadInfo() Then, after a bit of massaging, send some bytes out that the PIC on the panel can put on its output pins (here, "/W" is the name of the panel) : local WSCdisplaystring = "/W"..ready..loaded..code..count..rounds Socket.try(c:send(WSCdisplaystring)) And that's all there is to it :-)
  3. That might have been me. Works real well. You have to use lua to export the data. Lua exports to a tcp port. I use a console app to move the data from the tcp port out to a serial port (usb to serial). I get the switch data in the same way. Cheers, Colin
  4. I've found this can be a bit dicey. It's hard to tell if you're in the open position or just between positions. Works OK with 3-ways though, since between positions and the middle position are the same thing :-) Cheers, Colin
  5. Great news! Thank you so much. Next up for me is the gear panel. Can we get the gear positions? Thanks again, Colin
  6. Thank you, that's great to know.
  7. Thank you, thank you. The displays are cool too. Depending on where in lua you put the send commands, the displays can light up to match the sim panel *before* you hit pause/break.
  8. When you press pause/break to start the mission the sim changes all its switches to match the physical switches. The other option is to not send the board the "send all" command. Then the sim only gets switch positions when one changes. So, if say Master Arm was off in the sim and on on the panel, then to turn it on in the sim you would turn it off on the panel (which the sim ignores since its already off) and then turn it on. I like the first way better but there is some risk if your'e going to start in the air. Cheers, Colin
  9. Has anyone seen those tapered knobs like on the tv brightness and contrast controls? Seen them for sale I mean? Thankls guys, Colin
  10. Sorry, here's what I meant by automatic switch alignment: at mission start lua sends a command to the WSC board that says "send me all your switch positions". When it gets them, lua compares them to the known startup switch positions in the sim and makes any adjustments required. For the WSC switches, I think the startup positions are the same for all mission types. For other panels though, positions can vary depending on whether it's a cold start, a warm start, or a hot start (already in the air) so that has to be determined. On the other hand, the WSC displays should not light up on a cold start. And that's what I'm working on today, determining if it's a cold start or not. Cheers, Colin
  11. Absolutley you can. I don't think I'd want to go with single digit displays for this application though. Three digit multiplexed is probably what you want.
  12. Maybe someone could make a few buildings that look exactly like trees and we can see how that works,
  13. Hey! My Weapon Status and Control panel is finally up and running. Switches are all good, including the automatic switch alignment at mission start. 7-seg dispalays are good -- actually a little too good: the Selected Weapon and Selected Remaining indicators don't always blank when they do in the sim, like when the cannon is selected. Anybody know how to tell in lua if the cannon is selected? I'll post some pics if I can firgure out where I hid my camera. Maybe a little movie would be a good idea. You can see the Selected Remaining indicator count down real fast when you jettison Vikhrs. BTW in case anyone was wondering, the cannon rounds remaining display in the sim truncates, doesn't round. :-) Cheers, Colin
  14. I can't seem to get LoGetPayloadInfo() to return 2 for .CurrentStation. It does 0 for none and 1 for outer and then 3 for both inner and all. Any ideas guys? Thanks a lot, Colin if stations then selected = stations.CurrentStation
  15. Hi all, I have this weird problem getting the Shkval brightness and contrast controls to accept keystrokes. Simple keys are assigned to them (no modifiers). The keys work fine on the keyboard, but when I try to send them from my usb keyboard emulator this sim just doesn't repond. Notepad displays them fine. Sending keys for switches in the sim works great. Maybe the sim handles inputs for these dials differently than for switches and buttons? Any ideas? TIA Colin
  16. Hi Spinter, Can I ask, what are you exporting to? If I understood that it would really help me get a handle on this. Thanks, Colin
  17. I can't find them either. I don't think they exist. What are you trying to do? Let's keep this thread going as a place we can talk about this stuff. Cheers, Colin
  18. Thanks so much. This sounds like just what the doctor ordered. As for me, I was trying to export to a serial port -- a usb board configured as a serial port -- without much success. I'm thinking now I should configure it as some kind of HID device. So far I've just got it working as a keyboard so I can send keystrokes to the sim. What's everyone else doing?
  19. Cool. Maybe you guys can help with something. I've got this weapons control panel that I'm programming. I know what the switch positions are in the sim at the start of a mission, so I compare that to the switch positions on the physical panel, and then send any necessary keystrokes to make the sim panel switch positions match. The problem is, I need to know when the misssion has started (after the break/pause key. Cause you don't want to send the keystrokes when nobody's listening. And you only want to send them once. Any ideas? Thanks everyone.
  20. Yes indeed. For example, do we have to send key strokes or can we send "native" BS commands. Can we export switch positions frome the sim, or can we send absolute switch positions to the sim. Side rant: Every flight sim I've ever had uses the same key for gear up and gear down and it drives me crazy.
  21. I wonder when we're going to hear more about the mentioned Physical Cockpit Interface Package (PCIP).
  22. I agree. We all need to keep after DCS about delivering on the Physical Cockpit Interface stuff.
  23. page 2-63, 21. Used meteo Also, I'm not sure what's meant by "navigation wind".
×
×
  • Create New...