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
jaimeleon
Posts: 26
Hello all,
I have been using Mobiflight for a couple of months. I have been prototyping a control panel for FS2020, including a 20x4 LCD screen. I have read the posts that describe how to toggle different pages for the same screen, with up to seven values being displayed at a time. This seemed too low a limitation, as I feel a 20x4 display can easily display 8 values. There are posts describing a workaround to this limitation by concatenating several values into one string using dummy outputs using Transform and Compare. It seemed like a good solution, but a bit complicated to me.

I am happy to report that I found a workaround to directly write 10 values into one screen without the concatenation dummy outputs, by editing the mcc file with Notepad++. This is what I did:

1. In MFConnector, edit the LCD screen format with placeholders for 10 different values. MFConnector will only let you define up to seven different referenced variables as described in other posts. For now, your extra placeholders will show as regular text on the screen. Save the file as usual.

2. As you will be working outside of MFConnector, you should backup your mcc file before proceeding, just in case. Proceed at your own risk.

2. In Notepad++, open the mcc file. Please note this file keeps the information in a hierarchical xml format, which uses markers to indicate the start and end of each section e.g. config and /confiig. Please note that each output previously defined has a unique identifier code called guid which consists of 36 characters. Please note the location of the outputs you will be adding to your screen. You will need their guid later.

3. Search for the LCD screen config section. It should contain the type="LcdDisplay", but you can recognize it easily because it will contain a line by line print of the LCD screen as it was formatted in MFConnector. You should see the 10 placeholders you placed. Please note at the bottom of this section there is a subsection called configrefs which contains 6 lines of "configref" definitions. These are the six outputs allowed in MFConnector to be referenced with the placeholders, but we will add some more.

4. Within the same LCD config section, select the last "configref" definition of the six. Copy and paste it four more times just below, within the same "configrefs" section.

5. Now edit each of the new configref lines replacing the ref= field with the guid code of the output you wish to add. Make sure to edit the placeholder= field to use the placeholder characters you have previously used in step 1.

6. Save the mcc file. It is done.

Run MFConnector again. Your LCD screen now displays 10 values. Bear in mind, MFConnector will still only display the first 6 referenced variables. If you need to edit any of the variables not shown, you will need to go back to Notepad++. Enjoy.

Following is the mcc file section code for my LCD screen:

iconxml:
    <config guid="15b41346-c32c-4904-9c08-e3f3c9fcab06">
      <active>true</active>
      <description>LCD1 p2</description>
      <settings msdata:InstanceType="MobiFlight.OutputConfigItem, MFConnector, Version=8.0.2.0, Culture=neutral, PublicKeyToken=null" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
        <source type="FSUIPC" offset="0x66FF" offsetType="Integer" size="1" mask="0x00FF" bcdMode="False" />
        <comparison active="False" value="" operand="" ifValue="" elseValue="" />
        <display type="LcdDisplay" serial="MobiFlight Mega/ SN-483-39f" trigger="normal" address="LcdDisplay1">
          <line>FD aaa HDG   @@@ ///</line>
          <line>AP %%% ALT §§§§§ ???</line>
          <line>       SPD   BBB ###</line>
          <line>       VS  bbbbb ccc</line>
        </display>
        <preconditions>
          <precondition type="config" active="true" ref="b35385ce-e712-46f9-845d-3d7af690963c" operand="=" value="1" logic="and" />
        </preconditions>
        <transformation active="False" expression="$" substrStart="0" substrEnd="7" />
        <configrefs>
          <configref active="True" ref="e590adb7-5242-45a0-a014-06a97960e5eb" placeholder="%" />
          <configref active="True" ref="d12fe5be-2cdf-4b50-b1a0-ae1fc10ce1bc" placeholder="B" />
          <configref active="True" ref="b6212283-5acf-47e5-bfb1-82fe075f557b" placeholder="/" />
          <configref active="True" ref="0b45ba8f-6a4e-4696-ada7-5a42e19bc9c6" placeholder="@" />
          <configref active="True" ref="ba71d89a-d205-40af-ac77-0aa058e2288f" placeholder="?" />
          <configref active="True" ref="85bfa1d1-b3ae-45b4-8863-a4ed5542358f" placeholder="§" />
          <configref active="True" ref="b01a1faa-b8e5-4f28-a78a-110c28c93cf9" placeholder="#" />
          <configref active="True" ref="380d2ea4-03aa-40d0-afef-a04c96a28395" placeholder="a" />
          <configref active="True" ref="fc27f4a2-61d9-4d07-b38d-0248badb3479" placeholder="b" />
          <configref active="True" ref="68eeff29-ab60-436c-8c44-125a3766d213" placeholder="c" />
        </configrefs>
      </settings>
    </config>


It seems Mobiflight can handle the 10 values to LCD with no problem. At least, I have not noticed any problem.

Best regards,
Jaime
[Last edited by jaimeleon, 2021-03-14 00:36]
2021-03-14 00:28
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
What should i say now ?? :confused:

From one side i´m impressed ! :thumbup:
I not think about that easy and smart idea.... Cause techical i not believe it when i read it. In so many other cases Mobiflight is "self protected" . Means if there is a Line in the MCC that is against the main limitations of the MF Connector Code then there happen one of two things! It crash OR it ignore everything behind the last legal line.

All my ideas and workflows to override the current limits ( like my way to combine 2 Values into a longer string) was done, cause i not belive in a posibility like yours.

From the other side i´m scarred :thumbdown:

iconjaimeleon:

It seems Mobiflight can handle the 10 values to LCD with no problem. At least, I have not noticed any problem.


The world often seems perfect.... But there are mostly problems you can not realise at the moment when it´s happen.

E.g. What happen if you change in the GUI the first placeholder.... Does this effect in a RESET.... So the others are gone ?
Or much easy.... What happen if you just open the config in MF Conncetor and close it again.... Or basicly what happen if you load the MCC and simply close it.

In theory MF SAVE the File ( or offert you to do) in exact that situation that is currently used..... Means the LCD in Connector only got 6 Variables. "normaly" it should overwrite your yustom entrys now back to 6.
You can say now you not need to save it..... BUT if you create a new Line or rework a other.... You would not be able to save anymore without looosing the LCD Hacks.

Whatever if this not happen...... I will say there "can" be deeper problems you can not see. But sure... They not have to! May your right and this is a clean and perfect way !


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

Summary:
I´m for a increase by 1 Variable..... Biggest Displays in MF have 4 Lines.... Means logical a regulary user need a MAximum of 8 Values.
Currently 6+1 is possible..... 7+1 would be fianlay enough for 99% of Users.

Whatever.... If your System work ( and i will check and hopefully others will do, too) and we not find a bigger issue in the logic or negative side effects...
THEN this is a perfect way to solve "special" Situations in the future ( whatever we increase to 8 or not) .
Means USer who need extremly 14 Variables could simply build them without needness of changes in MF Master Code !

So... Thank You ! Nice Done !
Good Luck !
2021-03-14 09:51
Avatar
jaimeleon
Posts: 26
Hello pizman82,
Thanks, I was also surprised that this worked without any problem detected. I also thought that MFConnector could overwrite the configuration afterwards, but it seems the user interface simply ignores that part of the configuration. However, it does run with it when you go into "Run" mode. I have saved the file in MFConnector multiple times, even changing the format of the LCD screen and the display with 10 values continues to work.

This is mere speculation on my part, but It seems the existing code to drive the LCD screen is flexible enough to use all configref definitions that it finds (clearly not limited to 7 max). If this is correct, then it would seem that the limitation in displaying more than 7 values is currently in the user interface, which, in my humble opinion, should not be too difficult to expand. I only tested with 10 values, so I don't know where the actual limit is.

Why not expand the capability of the user interface to 10 or more referenced values and let the user decide if they need it or not? Maybe do this only for the LCD display configuration and not every config.

In my test LCD display example I still had some space left for maybe two more values. Granted that in order to fit that many values one has to be skimpy with the labels; but to me, the displayed information is more important.

Regards,
Jaime
2021-03-14 17:31
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 6010
Supporter
Hi again !

Stephan and myself made a lot of testings today.... And it looks good for now.

I hope you understand.... Our thoughts goes a little more deeper.
For example... What happen if you delete a Reverence Config ( One of the Configs that read the value raw and are used as a placeholder)
For the "official" Placeholders this occure in a delete also of the placeholder setting ( Cause the placeholder won´t work if the indication is lost)
So we need to test if this also work for your "invisible" lines.
We need to check if it work same way whatever the improvisional Configs are ABOVE or BELOW the 6 Official ones in the MCC file.
We need to check what happen if you "duplicate" the LCD Config.... Does it only duplicate the 6 lines or all 10.
Verry Important is to check if these additional Placehodlers also work for Syntax Code in the Transform field.

And so on.... You see. A lot of additional Tests and possibly issue spots you pretty sure not think about !


***************
About master question.

I agree.... It looks like the whole system work fine and the basic limit is the GUI..... But here i think Sebastian is not like to make a compromise now.
He was stricktly for 4 Placeholders only.... Took us months to convince him to 6. So 8 or 10 pretty sure he is not happy about.

I think his argument is the additional Lines in EACH Output Config ( and in some weeks also in each input config) .
Here the Main logic is a little unpracticable.... Cause MF create all Placeholder lines in each Config ( 6 a.t.m.) Whatever they are used or not.
Increase to 10 Placehodler need a enlarge of GUI and also occure in 4 Lines of Code in each Config

For my opinion in the future we should think about a fully other logic.... So Placeholder Code in MCC is only created if a Placeholder is in use.....
1 Placeholder = 1 Line.... 2 Placeholder = 2 Lines..... And 0 Placeholder is simply no line of code.
Whatever..... For 10 we also need something like a moving Bar to show them in GUI.... Or a fully new Logic for the GUI.


*******************
Summary: Same like above.... For now this looks as a cool incredible Solution for the "Special Projects" . Overall i will say 99 of 100 Users will NEVER create a Display with more then actual possible 7 Values.
But lets wait.... May Sebastian also like to increase the limit by himself !
Good Luck !
2021-03-14 23:22
Avatar
jaimeleon
Posts: 26
Hello pizman82,
I did new tests today.

I duplicated the LCD config in MFConnector and I checked the mcc file. The config copy has all 10 configref of the original.

I was able to increase the number of values in one single screen to 12 without detecting any problem. Using a 20x4 lcd screen this is about the maximum I can fit with labels. Without labels is another story :D .

I also tested plugging in two lcd screens, one with 8 values and the other with 12 values. No problem detected.

In MFConnector, I changed one variable in the lcd with 12 values (FSUIPC tab showing 6 referenced values) and saved. No problem in keeping all 12 values.

This is just a suggestion from an outsider: maybe it would be more efficient to have MFConnector only store the active configrefs, instead of each output config having a fixed number (6) of configref, which need to be checked for if active or inactive. A lot of the outputs (if not most) don't use any configref, so no need to carry the extra baggage. I would not be surprised if maybe 90% of configref in the mcc file are active="False".

On the other hand, the storage and cpu cycles saved by not having to check for 90% of the inactive configref could be used to allow the LCD display configs to have up to 12 configrefs. Just an idea :P :rolleyes: . Pretty please?

Best regards,
Jaime
2021-03-15 18:26
icon