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
Schwalberich
Posts: 3
Hi all,

I have a specific problem which is probably related to the fact that I want to have a multi purpose module with only 2 7-Segment displays which change the displayed values based on a mode variable.
So Mode 1 is Coms, 2 is speed and heading and 3 is altitude and v/s
Basically this is all working.

But I want to clean up the formatting so that for instance altitude gives me 6 digits with leading 0s and the 7. digit is reserved for an o if the altitude is in managed mode.
This would work if my displays would only show this value and then I could just work with the digits selection in the Display Tab of the output.

Due to the fact that different outputs are different in length I all my outputs need to have the same amount of digits selected, otherwise the values would not change if I change to a different mode.

With the compare tab I am able to get a spacing/padding in front of a value, even with a space.
But if I want a trailing ' ' and I enter it in the compare tab it gets cut off and ignored. If I however enter a letter, for instance - it works without any issues.

Is this a bug or do I have to do something special to get trailing spaces after my values in the compare tab?

Greetings
2022-07-30 15:59
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi

At first... Your right.
The 7Seg basic porgramming logic in MF have a "bottleneck" you still explore.
We can Split a Module in e.g. 2 Blocks of 4 Diggits or so.
We can also work with Preconditions and let a Value shown only if condition is True (like your mode)
BUT there is a Limitation.
Each Situation must handshake with the same Diggit Logic as it comes from....
So lets say you have in Mode1 2 Outputs .... First is Dig 0,1,2,3 the Second is Dig 4,5,6,7
When you like to use in Mode 2 a 8 Digit Display with just one config , then it will not work.

To solve this... We always logking forward to combine all Things ( or split them) in a way that all modes use the same number of diggits.

In the upper example we could "split" the 8 Diggit Value from Mode 2 into 2 Single Values ( Truncate and Modulo)
OR
We combine the 2x4 Values from Mode A together so its 8 Diggits long finally same like Mode 2.
E.g. Value1*10000+ Value 2 .... e.g. 1234*10000 = 12340000 + 5678=12345678


****
About Bug:
This is a very rare situation. Maybe there is a missfunction that nobody find out till now, cause nobody like to put a "space" on the back.

Could you give me a example where you need this ?
Normaly all Aircraft Systems work straight... Means if we need spaces then they are to the Left!
Like on a 3 Digit Display "1" is shown as _ _ 1 ....... 24 = _ 2 4 ..... its not 1 _ _ or 2 4 _ .

We can also build your Right Spaces with MF. So maybe its more logical to handle Zeros with compare and let spaces be done by the Peft Padding Tool.
Good Luck !
2022-07-30 22:31
Avatar
Schwalberich
Posts: 3
Thanks pizman for your input, I will have a look if I am able to do something with combining or splitting values.

In regards to the trailing 'space'.
As my longest parameter is the COMs frequencies I have to use 6 digits for all my output (2,3,4,5,6,7) (0 and 1 are exclusively used for displaying the current mode and nowhere else used)
If I want to show the AP-altitude I only need 5 digits (2,3,4,5,6) my plan was to use digit 7 as an indicator that the AP managed altitude mode of the A320 is engaged. (I don't have LEDs so I just want to display a 'o' if it is engaged and nothing (an empty digit) if it is not. -> AAAAAM where A is altitude and M is managed mode
Together with the "Use left padding 0" and if the managed altitude mode is enabled I get it correctly e.g. '02800o'
I achieved this with the compare tab where I just stated "$o".
The goal would be, if managed mode is not engaged to show '02000 ' but instead it gets padded to the complete right '002000'. In the compare Tab I entered "$ "
It works if I use this formula "$_" for instance, but then I have the underscore shown always when AP is not managed. The space gets truncated or ignored.

Update: I tested various characters and I achieved the desired result with following formula "$?" where the ? just wont get shown on the display. Other non printable characters won't work and will also be truncated.


Now I just have to figure out how I can get leading 0s if I want prepend other characters.

(I know I wouldn't have the problems if I just used multiple segments for just a single purpose. But I don't have the Desktop Real Estate for a full blown cockpit :D)
2022-07-31 12:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
OK. As i expect.... What you looking for is a little strange :-)

At first... I never saw a aircraft will now who show "02000" . Altitudes are always shown with Left Padding Active Typ Space.
(_ underscore represent a space) ..... 12000 ft is shown as 12000 1000ft is shown as _1000 ..... 100 ft is shown as _ _100
There are "normaly" no leading Zeors in a Altutude Display!

About Logic:
As you say i also would think about the usage of a non showable Character.

Vut maybe its more easy....
if you like "Value" and behind a "o" why not simply say $+'o'

A Value of 1234 should be finally shown as 1234o

********
If the problem is at the end really the last diggit ( i dont think so)
Then you can go the inverted way.
Show the Com in 2 Parts. Part 1 is "123.45" Part 2 is "6"
Then in Mode 1 you have 2 Configs.... One for Dis 12345 the other for Dig 6 (0 and 7 are out of thought)
Mean NOW its possible to show in Mode 2 Altitude on Diggit 12345 and Managed mode as own Value on Dig 6.

As i said.... Our target is All Precondition Modes have to use the same Dsiplay Configuration. In your case voth use 123456 OR both use 12345 / 6


EDIT:
Your name sounds german.
If you can, then join DISCORD and get a Headset.
There we can talk in german via voice and can build/test this together !
Good Luck !
2022-08-01 00:52
Avatar
Schwalberich
Posts: 3
The AP-Altitude of the Airbus A320 shows the values as "02000" :)

Well the $+'o' was not really the problem, that worked flawlessly. It was just the trailing ' ' which caused the issues, but has been solved
by using the '?' character, which shows as an empty digit on the 7-segment display.

With your input about splitting up the display to smaller chunks I could build the config as I wanted to.
Just needed to get rid of the "Mode" indicator which used 2 digits. So I was able to part it in 2 3-digit and 1 1-digit block per display.

Still needed some nested if conditions in the compare tab to achieve Master ON/OFF states together with the '-12oo' indicator of V/S for the
Airbus. But it's all working now :)

Thank you very much!
2022-08-05 07:55
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Just a little last note.

Since one of the last Versions, Mobiflight have a new tool/feature that is very usefull here ( whatever it was not planed for that usage)
I talk about the dimming Function for 7Seg Displays !

We can now enebale this Checkmark ( Brightness Indication) and there we can bind a other existing Output Config to it.
Means related to the value of that Config the Display Brightness is set from 0 - 15 (0 OFF - 15 Full Bright )

The usefull tricky feature.... Whatever we not like multiple dimm states or so.... We can "Blank" the Display now in a easy way without use compares like in the past.
There we have to say something like "if Battery Switch is OFF then show 5 Spaces , else show value of Altitude"
NOW we simply use the Bright Setting and in the Indication Config we read the "Off State" like the Battery switch.
A little Transform like $*15 there means..... If Battery Swtich is OFF then its 0 (0*15=0) .... If its ON then its 15 ( 1*15=15)
So we have a Value of 0 or 15 .... Means our Displays are Full Birght or OFF related to the Battery Switch.

Benefit:
You not need to handle this in the compare of the Display itself. This save you some nested and deep If Conditions when you already need Dashes and other tricky things there.
And for sure.... It not have to be the Batery Master. You can include there also other things like Bus Voltage or MCP Main State or so.
Good Luck !
2022-08-05 14:04
icon