MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

05/03/2024 - This forum is read-only

The community support for MobiFlight has moved exclusively over to our Discord server. Register for free and enjoy more interactive functions like image and video upload, voice chat. More than 7,000 registered users around the world make it a great experience!

See you on our MobiFlight Community Discord server.

A HUGE Thank You to everyone who participated in the forum, especially obviously to Pizman and Stephan who did an outstanding job over so many years providing an incredible service to the MobiFlight community.

The forum is still providing a lot of good content, hence we keep this information accessible.

Go to page 1Go to page 012Go to page 2Go to page 2
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hello,

I am thinking to build my own simple box with buttons leds 7seg ...
I also would like to put one LCD to have some info on.
:confused: Q: Is it possible to have on one line of the LCD two different values like "COM1:<ACT_FREQ>/<STB_FREQ>"

iconCode:
COM1 <ACT_FREQ>/<STB_FREQ>
NAV1 <ACT_FREQ>/<STB_FREQ>
NAV2 <ACT_FREQ>/<STB_FREQ>
ADF <FREQ> XPDR <1234>


I have not yet any HW so I try to anticipate what I have to buy and I found on Ali some LCD 12C with 20*4 that could go for this.

Thank you,

Have a nice weekend.

K.

Thank you.
K.
2020-11-27 23:41
Avatar
StephanHo
Moderator
From: EDDG, Germany
Posts: 1867
Supporter
Hi kbumbaz,

welcome to MobiFlight!

You can only have 7 different values to show on a LCD (at the moment).
So you have the 6 placeholders of your choice (without $) and a 7th from the present offset named $
Grüße,
Stephan (Time: UTC+2)
2020-11-29 13:28
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

About Parts.... The Display must be controleld with a IC2 controller. So 20x4 will work if it is IC2.

About 2 Things in a Line.... YES Thats Posible

About Limits.
As Stephan Said. A.t.M. Only 6 Variables and 1 own Value ..... So 7 overall. 4 Lines each with 2 Values like in your Example would be 8!
BUT
I hope Sebastian will increase the Placeholders to 8 in next time. If NOT then i can guide you to use also 8 Values with current Mobiflight System with a little trick !

Summary: YES Your requested idea is possible with Mobiflight !
Good Luck !
2020-11-30 13:02
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hi Both,

Thank you. Understood this concept of placeholder. Have to dig a bit.

@pizman82 > I2C, yes I am stuck with my standard screen without I2C, I bought 2 of adapters on Ali.
Do you have a post for this trick that you mention, I can read it so I don't bother you.

Thank you guys.

K.
K.
2020-11-30 13:40
Avatar
Hortax
From: LFST, France
Posts: 19
Supporter
Hi kbumbaz,

I'll try to explain how i did this "trick" Pizman82 did mention.
You will need the values to display, in my example i'll use NAV1 active and NAV2 standby.

1 : Create an "output" for NAV1_ACT
FSUIPC tab


2 : Create an "output" for NAV1_STBY
FSUIPC tab


3 : Create the "output" to concatenate the two values into the one that will be displayed
Using References and Transform is the trick
FSUIPC tab
Config References :
- use NAV1_ACT as A
- use NAV1_STBY as B

Then concatenate (assemble) the two values with Transform :
You have to multiply the A value to "move" it to the left by adding enough zeros then add the B value:
example : 12350*100000+11950=1235011950 (123.50<NAV1>119.50)



Next step is to configure the placeholders on your LCD display (assuming your LCD device is configured and working



So, on your LCD output (create it if needed ;))

FSUIPC tab
Configure the references
In my example, use NAV1 as @



Display tab

Type the text and the placeholders as you like : @@@.@@ <NAV1>@@@.@@ in my example (remember the 123.50<NAV1>119.50 some lines above)



Et voilà !
I hope that this little tutorial will help you.
[Last edited by Hortax, 2021-01-02 13:30]
2020-12-23 09:12
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hi Hortax...

Bordel, Merci !

By digging a bit I found that alone a few days ago, this is why I did not follow up on that one. But big thank you.
Yeah, maths and smart coding from MF team make it possible. Very nice.

BTW, I think you should do a sticky of your post because you took time to write this here but it can give a lot of value for others. @pizman82 ?

Still one last question:

Now I have an LCD like that.

iconCode:
COM1 ###.##  ###.##
NAV1  §§§.§§  §§§.§§
NAV2  ???.??  ???.??
 ADF  @@@ XPDR  ----


I have on the left side of my LCD one encoder that allow me to switch from COM1 NAV1 NAV2 ADF XPDP, and on the right side of my LCD an encoder that tune the frequency.

My left side encoder change an Offset from 0 to 4 and my right side encoder have a precondition to tune the correct frequency according to 0 to 4 value. It works perfectly well. However, I would like to add a star * just near the COM1 NAV1 NAV2 ADF XPDP so I know the position set from my left encoder.

for COM1
iconCode:
COM1* ###.##  ###.##
NAV1  §§§.§§  §§§.§§
NAV2  ???.??  ???.??
 ADF  @@@ XPDR  ----


or for NAV1
iconCode:
COM1 ###.##  ###.##
NAV1*  §§§.§§  §§§.§§
NAV2  ???.??  ???.??
 ADF  @@@ XPDR  ----


..

I don't really know with this maths approach how to achieve this.

Currently I have 5 time the same LCD duplicated with the * where it should goes and precondition on each of them depending on the offset set with the left encoder.
It works perfectly well, and I am absolutely fine to stay like that. But do you know a more elegant way to do this ?

Thank you all.
K.
2020-12-23 15:02
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

Yes This should be posible.....
The way with the 5 configs work.... But it is a little difficult and also need some resources in the Mega and software.

****
Solution..... Not tested. Just Theory !

The Logic i recommend is the same like with the Combined COM´s.... You use there on Display e.g. "COM1 ###.## ###.##"
So the 10 number Value of the combined Value is split in 4 Blocks.... So you still understand the Placeholder must NOT be in one sequence.... It can be splitted on the Display.

NOW you need a STAR* on 5 different Spots (Right of the Function) .... And you still know the indicator ( the 0-4 Offset of left Selector you use also for precondition of your 5 Displays)

So simply make another Placeholder here and Split it again.... Lets say we use Symbol %

iconCode:
COM1% ###.##  ###.##
NAV1%  §§§.§§  §§§.§§
NAV2%  ???.??  ???.??
ADF%  @@@ XPDR%  ----


The used Offset read the Config you use for The Output of the Left switch ( 0-4)
And now we need a tricky formula to Handle this.

NOTE: Here in forum it´s difficult to write multiple spaces or show you them..... So i use now the "#" Symbol for the spaces. You need to remove and fill spacebuttons there.


In Compare we can make the first Situation within the THEN Field....
We Say IF Value = 0 THEN *#### ( Then the First Diggit The % on Com1 show the * the other 4 show spaces)
Badly we only get one ELSE Field so we need to write a formula for the other 4
In ELSE we say.... if($=1,'#*###',if($=2,'##*##',if($=3,'###*#','####*')))
THIS Formula include now the 4 other situations..... e.g. If Offset is "1" it show #*### Means the 1st and the 3 last diggits show spaces..... Only the second show Star*


In easy words... You build a "String" That show a Star and 4 Spaces.... And 5 Situations with the Star on the different Spots.
The Placeholder on Display is splittet into these 5 Spots.... And one will show the Star..... The other 4 show spaces !

Maybe a much more easy solution is available..... I looking forward to hear.... If not this should work !
Good Luck !
2020-12-25 01:20
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hi pizman82,

Ho yes, using placeholder vertically and not horizontally. Smart.
I did a few test. Unfortunately it does not work, I suppose because:
- Offset with type String can't have a custom formulas, only substring.
- Offset with type Int can't have a string output that represent something else than a string.
There should be a cast in the code tries that convert "00100" and it gives 100 :) but "##*##" fails :( with Problem with transform. An error occured on parsing your value formula. Please review and correct any errors.

OK IF you can have a look and test, good... but my crappy solution works with a potential impact of the overall performance. Noted.
Thanks again for the time you spend on that.

K.
K.
2020-12-25 22:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
You mixup STRING and INT.

- The Raw value is a INT ( Your Config that define Switch position have value 0-4 so its a INT)

- Your Right.... A Transform can not occure in a String. Its INT at all times.... And also Yes... A String Raw Value have no transform line !

The key.... COMPARE Tab!
In Compare we can chnage the Raw Value.... Into another Value ( INT) or also into a String !

NOTE: If you get more experince i can also show you how you can use Strings more deeper within Formulas.... Cause in Compare Tab we can use them ( not in transform).
It is also possible to handle Real STRING Offsets within formulas..... Again only in Compare. But it´s possible.

*************
If i find time ( or maybe Stephan will do) i can check this. I will say you just make a issue. The basic logic looks clean and should work 99% sure
Good Luck !
2020-12-26 09:55
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hey Pizman82, I am on hold for a few days. I will test when back to business. I will let you know.
Thx
Season greatings for all of you.

K.
K.
2020-12-27 22:39
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hi Pizman82,

Back on track.

"Compare tab", got it, thank you again, it is clear now. You already mention it on you message from 2020-12-25 but I did not read it well.
So I did what you said and it seems MobiFlight is managing one instance of the string per line because if my placeholder % is 'ABCDE' and my LCD templace is

COM1% ###.## ###.##
NAV1% §§§.§§ §§§.§§
NAV2% ???.?? ???.??
ADF% @@@ XPDR% ----


Result is

COM1E ###.## ###.##
NAV1E §§§.§§ §§§.§§
NAV2E ???.?? ???.??
ADFD @@@ XPDRE ----


So foreach line display some kind of "String.Format with right alignement"

Any idea?

iconQuote:


NOTE: If you get more experince i can also show you how you can use Strings more deeper within Formulas.... Cause in Compare Tab we can use them ( not in transform).
It is also possible to handle Real STRING Offsets within formulas..... Again only in Compare. But it´s possible.



If you have some literature I am please to read it to improve what I can do. Thanks.


Thank you.
K.
2021-01-03 00:35
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Thanks for Reply....
As i said... I not test it so it was pure theory. But a little honor to myself.... The idea itself was cool :thumbup:
So interesting result.... The Strings can not be "hang" over multiple lines in the LCD. I not know this till now.

************

Basicly.... You still got the solutiion with preconditions .... So it will be possible already.
Whatever.... I see also another way.

If we can not split it into different lines..... Then we must include the "*" into the existing Variables that are in a single line....
The STAR is always LEFT of the Variable.....
Fo example "COM1% ###.## ###.##" Here the % Represent the Star or a Space. And it is LEFT of the #### Value like in all other Variables.

So why not "include" it into the COM1 Variable .....
Looks like "COM1# ###.## ###.##"
Means the Value of COM1 is e.g 123,45 119.25 ..... So currently Value is 1234511925 in our Variable.
We need now to Change it into "*1234511925" or "_1234511925" ( _ Represent a Space)

In easy words... We must Change the 5 Values you show in that Display in a way that all have a additional Diggit left of the current Value and that is "*" or "space".
Make no sense to post the formula without testing. I need to figure out the syntax.... BUT i´m sure this is possible also !
Good Luck !
2021-01-03 14:52
Avatar
kbumbaz
From: Nice, France
Posts: 15
Hi pizman82,

Yes I agree with that approach.

- in Compare can we use placeholder? I did a small try but seems not.

For NAV1 I was tempted to say IF offset representing my frequency selector = 1 (for NAV1) THEN set it to *# else #

with # the placeholder representing NAV1 ACT STB > ###.## ###.##

Do you have more advanced formulas to play with ? If you give me some literature I can try to find it by myself.
Thanks again for your help.

K.
K.
2021-01-05 13:23
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Yes.... Right way.
I´m sorry i still find no time to do this..... So its cool if you like to try out.

Basic Ideas:

1. Transformation should be happen in the Read Configs.... Not in the Final Display Config.
The Display Config work same way like now..... Only difference is you enlarge the placeholders by the additional Diggit to the Left.

2. In the READ Configs that create the raw value ( You finaly use as placeholder symbol in the Display Config) you must do the change !
In case you have a combinded Config ( That build the Long value out of COM1 and COM2 into one .... So the "*" Including must happen here. For ADF and XPDR the "*" is included in there Read configs.

3. The Logic must be located in the Compare Tab !.... And YES you can use a placeholder there in a formula.

The Compare have one hardcoded problem ..... The master line IF xxxx is based always to the Config Value. So we can not say something like IF "A" = 1 THEN.
BUT we can use the Placeholders in the THEN and ELSE Field.

So i always use a trick and say..... IF Value >= 0 Means whatever value is 0 or bigger..... So it always execute the THEN field.
Alother way is to use e.g. IF Value = 0 .... And then insert your custom Formula in the THEN and ELSE Filed.... Both the same formula. Means whatever the Offset is.... It will always execute our formula. ( I know this is umpracticable.... But the only way to do this in current GUI)

About the Formula:
Lets say you use a Placeholder "a" in that config that represent the Indicator ( 0 means a * at com1)
Try.... if(a=0,'*'+$,' '+$) ...... Or if(a=0,'*'$,' '$) .... or (if(a=0,'*''$',' ''$')

If all this not work we need to use a additional config maybe that read The Indicator instead of the Frequency and use the Freqency as Placeholder.
Here we would say if Value = 0 THEN *+a ELSE _+a ( _ means space)

If you like play with that stuff..... Pretty sure you find it . Please share with us or tell me if i should test myself next time !
Good Luck !
2021-01-05 18:12
Avatar
kbumbaz
From: Nice, France
Posts: 15
OMFG... it works.



I will post later my config here so we can share on it. It is time for son homework.

Your are awesome guys ! Well done.
K.
2021-01-05 18:45
Go to page 1Go to page 012Go to page 2Go to page 2