RFC ToggleIcons: one icon per switch state

More
31 Jan 2013 22:46 #5867 by domcars0
Replied by domcars0 on topic RFC ToggleIcons: one icon per switch state
Hi rbe2012,
I just tested your mod, it's very nice and I understand that it can be usefull in Devos with color screen, but unfortunatly I think that it's not portable on low resolution B&W screens :( .
Anyway you've made a good job. Congratulation.

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
02 Feb 2013 15:02 #5907 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
Thanks to all who have tested my work. After correcting a bug it now compiles for 128x64x1 too (but no new functions for this).

Domcars0, I do not agree about b/w screen. At least we should give it a try using no/normal/inverted icons.
To support 128x64x1 we first should change the toggle object from guiLabel_t to guiImage_t as I have seen in the repos from domcars0 and suvsuv. Let's talk about how to do this...

For the ToggleIcons I reduced the variety of useable input sources. Instead of using "rud dr" and "!rud dr" (respectivly "rud dr1", "rud dr0", "!rud dr1" and "!rud dr0") I only offer "Rudder DR". This is because the values written above can be used when setting icons on value 0 and/or value1. So there is no necessarity for me to distinguish (and you have less clicks).
Do you agree and want it this way? Alternatively I could allow all the values we had before and calculate a litte to show everything correct. Both is possible, it's a question of what is useful and needed.

Please Log in or Create an account to join the conversation.

More
02 Feb 2013 15:39 #5909 by domcars0
Replied by domcars0 on topic RFC ToggleIcons: one icon per switch state

rbe2012 wrote: Thanks to all who have tested my work. After correcting a bug it now compiles for 128x64x1 too (but no new functions for this).

Domcars0, I do not agree about b/w screen. At least we should give it a try using no/normal/inverted icons.

You're right....

rbe2012 wrote: To support 128x64x1 we first should change the toggle object from guiLabel_t to guiImage_t as I have seen in the repos from domcars0 and suvsuv. Let's talk about how to do this...

For the ToggleIcons I reduced the variety of useable input sources. Instead of using "rud dr" and "!rud dr" (respectivly "rud dr1", "rud dr0", "!rud dr1" and "!rud dr0") I only offer "Rudder DR". This is because the values written above can be used when setting icons on value 0 and/or value1. So there is no necessarity for me to distinguish (and you have less clicks).
Do you agree and want it this way? Alternatively I could allow all the values we had before and calculate a litte to show everything correct. Both is possible, it's a question of what is useful and needed.

I think the second is better, cause this way, users can do want they want.
I think also that (may be) it will be good idea to define which kind of switches has the target radio in target/devoX/target_defs.h?

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

Please Log in or Create an account to join the conversation.

More
02 Feb 2013 15:56 - 02 Feb 2013 15:59 #5910 by domcars0
Replied by domcars0 on topic RFC ToggleIcons: one icon per switch state

rbe2012 wrote: Thanks to all who have tested my work. After correcting a bug it now compiles for 128x64x1 too (but no new functions for this).

It seems to big to fit on a Devo7e ...
CC      assert.o
  AR      libopencm3_stm32f1.a
 + Building 'devo7e.elf'
/home/domcars0/sat/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld: devo7e.elf section `.text' will not fit in region `rom'
/home/domcars0/sat/lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi/bin/ld: region `rom' overflowed by 5840 bytes
collect2: ld returned 1 exit status
make: *** [devo7e.elf] Erreur 1
One of the challenges is the code compatibility across targets :huh:

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:
Last edit: 02 Feb 2013 15:59 by domcars0.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
02 Feb 2013 20:50 #5918 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
Thanks for the hint - someboby has already placed an issue on my repo (have you been this? It's not so obvious with these names...). This is why I opened the new thread about " Addons: How to activate them? ". I am interested in the correct way of implementing such things. I realized that any addon should only be activated carefully in a controlled area to avoid those side effects.
I think I must work on my quality assurance (correct word?). Seems as if my testing methods still have some gaps.

Please Log in or Create an account to join the conversation.

More
02 Feb 2013 21:10 #5921 by domcars0
Replied by domcars0 on topic RFC ToggleIcons: one icon per switch state
Hi rbe2012,
Yes, it's me who declared the issue on your repository...
Hope that PB will give the correct answer to your new thread.

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
02 Feb 2013 21:37 #5924 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
I just have seen: it does not compile for Devo6 too (duplicate case - must have to do with channel mapping and double use of input names...).
I think PB will point me right.

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 00:32 #5932 by PhracturedBlue
Replied by PhracturedBlue on topic RFC ToggleIcons: one icon per switch state
Don't use snprintf in your code. It adds 20kB to the size of the image, and is why it doesn't fit on devo7e. Just make sure you bound the variable size properly.

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 00:42 #5934 by PhracturedBlue
Replied by PhracturedBlue on topic RFC ToggleIcons: one icon per switch state
I don't really like hard-coding the list of switches in main_page.c It is not scalable. Generally the GUI should not directly depend on the names of hardware functions, but on attributes. We violate this in the 'standard' mixer, but I want to keep that to a minimum.

It would be better to extend capabilities.h with the necessary information about switch groupings.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
03 Feb 2013 09:34 #5955 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
snprintf:
I did not think that it could be so easy: removed snprintf and the 7e-issue is gone. I thought that the additional space I need in the objects might be the reason.
capabilities.h:
Good idea to abstract gui and hardware - I haven't been deep enough in the code to realize that. I have tested it for Devo8, works. I will try to add this for the other txs too (later).

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 13:18 #5959 by Scream
Replied by Scream on topic RFC ToggleIcons: one icon per switch state
Hiya Gents!

I look at the screen while setting up the controller, just before I fly and when I land. ( I have some suggestions about timers and alarms, but not in a hurry to ask for more features just yet!)

I don't think we need to see all the switches at once, but to be able to quickly recognize that TH is on, or that you are in fmod2 so that you can avoid any disasters when you take off! IF you are concerned with sizing, I think that 3 or 4 icons at once is more than enough if the user could choose which ones were important to them or their needs similar to how you choose your current switches (1-4) now.

I cant contribute much in the progression of this topic, but I am more than willing to field test anything on devo10 if needed! As a bit of a noob, I can perhaps be a closer representation of the "general public" :)

Cheers!
-=S=-

Cheers!
-=S=-

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 15:13 #5963 by Scream
Replied by Scream on topic RFC ToggleIcons: one icon per switch state
Hi Again,

Sorry to be a nuisance but ...

Maybe the same functionality could be achieved for less effort by using a text formula that users can input themselves. This way you guys don't have to worry about language files, or making beautiful icons for b/w screens and everybody gets what they need and want?

IF you could define 2 or 3 switches to a text status summary then you don't have any space or icon issues for us monocromerz, just keep the current icons and switch setup plus something like this...

THx ON + DR low + FMOD0 = "READY!"
THx OFF +DR low + FMOD0 = "FLY!"
THx OFF +DR low + FMOD1 = "3D!"
THx OFF +DR Hi + FMOD1 = "Crazy 3D!"
THx OFF +DR low + FMOD2 = "WTF!"
THx OFF +DR Hi + FMOD2 = "OMG WTF!"


I certainly wouldn't complain if icons end up working in low rez MonoC, but a status summary might be visually more effective for our lil' screens vs. effort required :)


Thanks!

Cheers!
-=S=-
Attachments:

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 17:12 - 03 Feb 2013 17:18 #5965 by clearprop88
Replied by clearprop88 on topic RFC ToggleIcons: one icon per switch state
I think this is terrific.
The best way to improve it is to put it in a new release as soon as possible, and get user comments/suggestions.
It looks like it's ready to go.
Can't wait to start using it.
The proof is in the pudding.

I have been using Hexperiences GUI ( DeViation 2.1.0435334-X) since he released it, and find it very useful, and fun to use.
Last edit: 03 Feb 2013 17:18 by clearprop88. Reason: add

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 17:18 #5966 by domcars0
Replied by domcars0 on topic RFC ToggleIcons: one icon per switch state

Scream wrote: Maybe the same functionality could be achieved for less effort...

Not sure .... the config GUI does'nt seem to be so easy..

Devo 10 (+7e) owner. It's mine, please don't touch it with your big fingers :angry:

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
03 Feb 2013 18:56 #5969 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
My opinion: programming any kind of parser for user inputs is really a challenge. I think the idea is not that bad (thought about something similar myself) but it it much too complicated to code and might eat up the valuable space in ROM/RAM.
I like more the idea of treating this like the vSwitches I proposed a few days ago. In the discussion is to make logical operations available with special mixers. So anyone can define his own conditions.
The purpose of the ToggleIcons is only this: have the ability to represent a switch at one place on the screen and show another icon for every switch state (if you want to), not only one icon at one determined state.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
03 Feb 2013 19:13 #5971 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
I mofified the source code so that
- it fits in every tx (as far as I cat test, but no more errors)
- it uses the txs capabilities to control the hardware parts in the gui
- it compiles without error for every tx
So I believe it should run on Devo8 (tested), Devo6 (with less switches) and Devo12 (with more switches and much more 3-state-switches).
As far as I have seen it would not be hard to extend it to the bw-screens of the Devo10 and Devo7e. I just don't know if I should do that with the (for me actual) guiLabel_t or wait for domcar0's / suvsuv's guiImage_t. Can anyone who is deeper involved in creating the gui for the b/w-screen tell me if this will be a difference (for me)?

Please Log in or Create an account to join the conversation.

More
03 Feb 2013 19:35 #5973 by PhracturedBlue
Replied by PhracturedBlue on topic RFC ToggleIcons: one icon per switch state
we will merge suvsuv's code most likely (though I haven't looked at it yet). icons (however small) are much nicer than numbers that have no meaning.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
03 Feb 2013 20:49 - 03 Feb 2013 20:49 #5974 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
I am still not satisfied with the way the toggle icons are written to / read from the model file. I tried another representation (tglico1=3,14,5 instead if tglico1=3, tglico5=14...) and found that this is readeable from old versions (b911e0b) without problem (because atoi(value) is used). I will try to change the read/write methods to make a model config that is easily exchangeable. I only have to recalculate the switch I should store in the model file. But there will be no solution for saving configs where more than one icon was used in a way an old version can have the same functionality (quite obvious, I think). When only one is used, it will be identically useable in both versions.

Somewhere above I asked if the reduced list for selecting a switch is sufficient. As written I have integrated only one list item per switch (while in the old version there is one item per switch state and every of them is invertable). This makes the recalculation harder, but I still think that my method is easier / faster / more naturally to configure. Has anyone out there an opinion to this?
Last edit: 03 Feb 2013 20:49 by rbe2012.

Please Log in or Create an account to join the conversation.

More
04 Feb 2013 01:40 #5977 by PhracturedBlue
Replied by PhracturedBlue on topic RFC ToggleIcons: one icon per switch state
I'm torn on the one item per switch thing. I like the flexibility of being able to assign each icon to a different switch, but I'm not sure it is worth the inconvenience of configuring it that way.

Please Log in or Create an account to join the conversation.

  • rbe2012
  • rbe2012's Avatar Topic Author
  • Offline
  • So much to do, so little time...
More
07 Feb 2013 07:13 #6112 by rbe2012
Replied by rbe2012 on topic RFC ToggleIcons: one icon per switch state
I rewrote my in-/output methods to read and translate the old to the new ToggleIcons and back. Works as expected, but I will do a complete test in the evening. This will be the last work before readyness.
Afterwards I will try to merge it with PB's last commit (shouldn't bee too hard).
And then? Place a pull request?

Please Log in or Create an account to join the conversation.

Time to create page: 0.061 seconds
Powered by Kunena Forum