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.

icon
Avatar
fjgaspar
Posts: 18
Hi,

I am learning so much about Mobiflight, but I have many questions as I go deeper. Now, a question about placeholders.
I have a button to select VS mode. Then, when selected, I have a rotary that modifies the value of the vspeed, and a 7 segment display that shows the value. I am trying to accomplish that the display only show numbers when VS mode is active, and all numbers are off when not.

I have achieved it making two configs with one precondition any: first, show value ($) of the offset when vsmode is selected (via a config that reads the offset corresponding to vsmode). Second, selecting the offset, setting to string, and setting the string to " ", with precondition vsmode is 0 (not selected). If I don't change the offset to string, and let it as int, a 0 appears in display despite I assing a value of " ".

So I have read about placeholders: VSPEED display set to corresponding offset, select as confing from list below, the VSMode output as A. Then, in transform, the formula if(A=1,$," "). Doesn't work. Whatever I select VS mode or not, display never goes blank. What am I doing bad?
2020-12-21 22:42
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi
Your still on right way and got the ideas..... Just the final workarounds are not fully correct.

1. You need a Indicator.

If the Indicator is the same Config as the Value Config you like to show then it is verry easy and no preconditions are needed.
For example if you like to show a Temperature on a Display but the Display should be blank aslong THIS Temperature is below 30°C Here we would simply say " If $ <30 THEN "Blank" ELSE Show $" We not need Preconditions or Placeholder cause the Information is still "$" and can be used directly

If the Indicator is in a different Offset ( most of the time this is the case) then we need a Precondition System. For Example... VS is on Offset A .... And the Indication if VS is ON or OFF is read on Offset B ..... Then your right. Then we need Preconditions and/or Placeholders.

*******

2. Your idea with a STRING ( as typ of Offset) is wrong !
The Offsettyp is always related to the data of the Readed Offset. So if your Indicator is a INTEGER .... For example it show 1 or 0 then you can NOT use STRING for it as Offset Typ! But we not need to do this like you try!

The key is the COMPARE Tab . There you can compare the Raw Value into everything you like.... So also into a String !
Enable the Compare function by checkmark.... And say e.g. If Value "=" ... 1 ... In Then field you write HELLO .... in Else field you write WORLD .
Now if raw value is 1 then the config is change to the word HELLO. If it´s not 1 then it will show WORLD always.
So you compare the Integer Raw Value into a string word.

*****

3. Solution

You have 2 Ways here.... Via Precondition or Placeholder.

Precondition:
As you still say... You use TWO Configs. One show the Offset Value. The Other show "Spaces" . And each got a Precondition related to the "indicator config"
The First Config simply show "$" (no Compare needed) and work e.g. if Indicator is 1
The Second Config use a Compare like "IF Value = 0 THEN show "5 spaces" ELSE show "5 Spaces) ( means 5 time Space Button for 5 blanked Diggits) We use it for ELSE and THEN so this Config ALWAYS is show Blank ! . If you know that Offset ( e.g. Offset adress 0000 ) is always Zero then the THEN Field is enogh cause it never be something else like 0.
And finaly it´s precondition say only work if Indicator is 0


Placeholder:
Here we work with your formula again. You define the Indicator as a Placeholder in the Display Config. Lets say symbol "a"
Now we need a transform that include the Condition.
BUT here is a importantn Point !
We are NOT allowed to use a String within the Transform Field. So we can not say something like "if(a=1,$,' ') Cause "Spaces" are Characters.... And thats not allowed.
Those Formulas can only be used within the Compare Tab !


But we can use a simple trick !
We use a FAKE Value that never can occure in the readout Offset. For example 99999 .
So we say if(a=1,$,99999)
Means if Indicator of VS is 1 then show $ ( VS Value) .... If NOT then show "99999"
And finaly in Compare you say If Value = 99999 THEN "5 Space Buttons"

***********
Summary:
I recommend the Placeholder logic..... It save you one Config line.... And it allow to inmplement more elements in a easy way.
For example you use additional Varibale B for Battery Switch ( Display should be Off if Battery is Off) and Variable C for Lighttest (Display should show 88888 in Test mode)
here Formula would be something like if(a=0||b=0,99999,if(c=1,88888,$)) ( If Indicator OR Battery is 0 show 99999 (spaces), ELSEIF Lighttest is 1 then show 88888, ELSE show Value )

You see.... Much more Deeper.... Much more comfortable aslong you understand the syntax.
Good Luck !
2020-12-25 08:05
Avatar
fjgaspar
Posts: 18
Thanks for the info. I have applied all to my settings. I have included the battery check, and everything is working perfect with placeholders. When I begin to use airliners, I will include the light test condition. Much more simple and efficient the placeholders solution than preconditions.
2020-12-28 00:04
icon