Jump to content

WSC is workimg!


PanelBuilder

Recommended Posts

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

Link to comment
Share on other sites

it killed the cat apparently but i'm very curious about the "automatic switch alignment"

 

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

Link to comment
Share on other sites

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.

 

Nice, really smart as well. even if they aren't in the correct pos. for start up, they will at least correspond with the screen, i like it, i like it a lot actually. (and it didn't kill me either )

Link to comment
Share on other sites

so, if you are flying when mission starts and switches are off, BS will turn them off and you fall out of sky? You still have to manually set switches to the sim beforehand, no?

 

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

Link to comment
Share on other sites

Nice, really smart as well. even if they aren't in the correct pos. for start up, they will at least correspond with the screen, i like it, i like it a lot actually. (and it didn't kill me either )

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.

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 months later...
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

 

Hi Colin

 

Did you find a solution for this problem.....because now I have the same problem:)...

 

/Oakes

Link to comment
Share on other sites

local gun = MainPanel:get_argument_value(615)

 

Cheers,

Colin

 

Yep, thanks again Colin, gave me a little bit of a headache though..but now it's solved.

 

Problem:

MainPanel:get_argument_value(615) returns -1 if the gun is the Safe/Non-selected position.

Returns 0 if the gun is armed / selected and returns 1 if the gun trigger is pressed.

 

Funny thing though, if you press the trigger with the gun in the safe position the function still returns 1.

 

So you can't say that as long as MainPanel:get_argument_value(615) == -1 show the weapon type/remain values, as soon as you press the gun trigger the values disappear since MainPanel:get_argument_value(615) now returns 1.

 

Solution:

Use a global variable that is set to "Armed" if MainPanel:get_argument_value(615) == 0 and to "Safe" if MainPanel:get_argument_value(615) == -1

=> if you just press the trigger MainPanel:get_argument_value(615) goes more or less directly from -1 to 1 (without hitting 0) => the global variable is still "Safe".

 

Then use this value to determine if the weapon type / remain number should show or not....

 

I guess that the real cyclic makes it impossible to press the gun trigger while in the safe/non-selected position.......

 

 

/Oakes

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...