Jump to content
The simFlight Network Forums

Toggles on Button screen


DEN19

Recommended Posts

Pete

A couple of trivial questions for you.

Just in the process of revising my buttom screen to fit round the Peix instrument software on the slave pc. Whilst I am at it I decided to change some of the toggles to use the offsets rather than the fs control toggles for things like battery and avionics master. This has the advantage of always being in the same state for the same Button Screen toggle setting.

What crossed my mind was that, every time Wideclient is started the toggles appear in green. I would like them to appear initially in red, so that as I turn on the systems ( eg Battery master) they go from red to green. This means when I am ready to fly all lights are green rather than red. I tried changing the colours but then lost the green/red colour change.

It can be done by reversing the offset function but this means when Wideclient is started I would have to turn all toggles the other way just to turn them back again. Seems a bit daft. Also I would like to use this system for the AP controls so that when I turn on, say, the AP master it goes to green and is only red when turned off.

Is this possible?

Secondly I could not find an offset for setting the state of the door, and had to use the fs buttons for this. A search on "door" yielded only one offset but this only reported on the state of various doors, if I read it correctly, and not the option to set them.

Have I missed it or is there no offset I can use for this?

Thanks

Den

Link to comment
Share on other sites

What crossed my mind was that, every time Wideclient is started the toggles appear in green.

These are latching toggles, i presume?

I would like them to appear initially in red, so that as I turn on the systems ( eg Battery master) they go from red to green.

You mean you want Green to mean "ON" and Red to mean "OFF" -- whereas, of course, I use toggles for things like Dorrs and Pause, so I want them Red when On.

This means when I am ready to fly all lights are green rather than red. I tried changing the colours but then lost the green/red colour change.

What? You changed colours 2 and 3 -- those are the Toggle colours, as documented. That should certainly work. All colours 0-9 can be changed.

Secondly I could not find an offset for setting the state of the door, and had to use the fs buttons for this. A search on "door" yielded only one offset but this only reported on the state of various doors, if I read it correctly, and not the option to set them.

Where does it say it is read only? I use offset 3367. On FSX there's a separate bit for each of up to 4 doors. FS9 only has the one there.

Regards

Pete

Link to comment
Share on other sites

Following your thought provoking comments I realised what I'd done wrong on the colours, I'd set the colour on the actual button. Now I've set it in the Colour section and, lo and behold, it now works as I want it to. Thanks for that. It has also become obvious that some are best in red in one state whilst others, like doors and pause, are better the other way round- but I'll keep trying on that one.

With regard to the doors I've not yet sorted that out, since I'm not too certain about what exactly I'm supposed to do, despite a couple of hours reading this afternoon, offsets are a whole new ball game to me.

Den

Link to comment
Share on other sites

With regard to the doors I've not yet sorted that out, since I'm not too certain about what exactly I'm supposed to do, despite a couple of hours reading this afternoon, offsets are a whole new ball game to me.

Offset 3367 is bit-oriented. Bit 0 (value 1) for door 1, bit 1 (value 2) for door 2 and so on. At least that's the case for FSX -- with FS9 I there's only support for the one door.

To open a door, assign a button to "Offset byte setbits" with offset 3367 and parameter 1, for door 1 (2 for door 2, 4 for door 3 and 8 for door 4)

To close a door, assign a button to "Offset byte clrbits" with offset 3367 and parameter 1, for door 1, etc.

To open and close all doors in FSX together, as I do, use parameter 15 instead of 1. 15 is 0x0F in hex which is 1111 in binary (1+2+4+8), so operating all 4 doors together.

Regards

Pete

Link to comment
Share on other sites

I've now got all the toggles on my touchscreen to work in the sense I want them to, so that they are green in the obvious positions- eg battery master ON is green, pause OFF is green etc. This now gives me another problem, with the toggle colours reversed as Wideclient is started all toggles now come on in red colour ready to be switched on during start up. However the actual settings for pause, slew and door actuations are then in the incorrect sense i.e. door toggle is red but the doors are shut (which should equate to green status), pause toggle is red (which equates to pause on) but pause is off. I know I could just reset the toggles and they will always then be in the correct alignment with their fs function because of how I have assigned them in FSUIPC.

But I was wondering if it would be possible to write a Lua plug-in or something else ( I'm downloading Lua for Windows as I type this) so that this plug-in is run once as wideclient is opened and resets toggles according to their offset status. From what I have read so far Lua can read offset status (I think!) but can it write to Wideclient to alter the state of toggles on the buttonscreen?

Or does anyone know of a different way I can achieve this.

Den

Link to comment
Share on other sites

... I was wondering if it would be possible to write a Lua plug-in or something else ( I'm downloading Lua for Windows as I type this) so that this plug-in is run once as wideclient is opened and resets toggles according to their offset status.

The "offset status" you are talking about is only the default comiler-made initialisation of values to zero, but those are just in local memory in WideClient.

From what I have read so far Lua can read offset status (I think!) but can it write to Wideclient to alter the state of toggles on the buttonscreen?

Not to any old WideClient memory locations, no. WideClient only gets data about offsets from WideServer.

I'm not clear which you are getting into all this complciation. I start off any sessions in my cockpit with a flight saved "cold and dark" with everything off and in a known state. That way everything always stays in sync. Are you in the habit or starting things off in different phases of flight?

There are two WideClient enhancements I can think of which you might regard as a help:

1) Have a set of FSUIPC offsets assigned with a bit for each "virtual button" which reflects the last state of whatever ButtonScreen cell is programmed to change it and which can be changed to cause the state in the ButtonScreen display to change.

This is probably what you want, but is very problematic. There's no one-to-one correspondence of ButtonScreen display cells to virtual buttons as it now depends on the arrangement and use of other cells. Additionally, some users (myself included) have virtual buttons not only controlled from one Client display, but from others too and from real switches or other programs doing other things. I hate to imagine what conflicts might arise. I suspect I could resolve all this and make it work, but it isn't really something I'd want to do.

2) Allow an initial toggle setting flag in the ButtonScreen, so when Wideclient starts up you can have some inidicating "on" whilst others indicate "off", according to the parameters.

This one is pretty easy, and i could do that quite quickly.

Regards

Pete

Link to comment
Share on other sites

I'm not clear which you are getting into all this complciation. I start off any sessions in my cockpit with a flight saved "cold and dark" with everything off and in a known state. That way everything always stays in sync. Are you in the habit or starting things off in different phases of flight?

I have a saved flight with C & D for the Cessna at EGNJ, which I do use but it still has 1 drawback: -

Even using the C & D flight some of the toggles are in the wrong sense e.g Pause and Slew are the 2 obvious ones but there are others. I have all toggles set to show red in the "off" state (which I have done as this is how they come on asWideclient is started) and green in the "on" state. This is fine for most things, like battery master, which I want to be red when off and green when on.

Some toggles however, like Pause and Slew, I want to be red in the active state ( to fsx). By this I mean when Pause is on in fsx I want it to show red and to do this I have set the control assignments in reverse in FSUIPC. When these toggles are switched OFF they go red but they put the relevant function to ON in FSX and vice versa. This was the only way I could think of to have the majority of them working in the correct sense for red and green "lights" on the touch screen.

So, in retrospect, it doesn't matter about a C & D saved flight becouse I don't want all the toggles in the same start on wideclient start up.

It does have a second drawback that if I want to fly from somewhere else I have load the flight twice when I move airports and this takes some time as I have GenX photo scenery and loading times are longer. This, however, isn't related to FSUIPC or Wideclient but is still a PITA!

2) Allow an initial toggle setting flag in the ButtonScreen, so when Wideclient starts up you can have some inidicating "on" whilst others indicate "off", according to the parameters.

This sounds like exactly what I want to happen and by a much simpler means.

BTW All this came about because I saw an advert somewhere for a small usb touch screen which claims to read what state the controls are in and shows them on the screen in the appropriate position, and I thought "I wonder if I could get mine to do that"

Thanks

Den

Link to comment
Share on other sites

2) Allow an initial toggle setting flag in the ButtonScreen, so when Wideclient starts up you can have some inidicating "on" whilst others indicate "off", according to the parameters.

This sounds like exactly what I want to happen and by a much simpler means.

Okay. I'll do that, probably later this week.

BTW All this came about because I saw an advert somewhere for a small usb touch screen which claims to read what state the controls are in and shows them on the screen in the appropriate position, and I thought "I wonder if I could get mine to do that"

Well you can, of course, but not without writing a program. All the ButtonScreen option provides is a set of buttons. What they are programmed to do in FS doesn't easily or necessarily relate to any status. Most would be actions or even sequences of actions, as in macros.

Regards

Pete

Link to comment
Share on other sites

Thanks Pete- look forward to that.

My revised Wideclient is ready, but I'm unable to put it on the Updates announcement at present due to server problems, it seems. So please find it (WideClient version 6.787) attached. The user guide is updated to list the new facility -- just a "TN" in place of "T" for "Toggle oN" (default is still off).

Regards

Pete

WideClient6787.zip

Link to comment
Share on other sites

That's done the trick for me. Thanks, Pete.

Also been doing some exerimenting with the C & D scenario. I have discovered that there is a really simple solution.

I have made the C & D flight the default. Now when I load fsx the "create a flight" screen comes up with the C & D settings automatically, allowing any flight loaded to start C & D.

Wish I'd thought of that years ago!

I'm a happy bunny again.

Den

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.