Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Programming Question XML or C

Featured Replies

Good Day, I cannot find a clear description of the "%" operator used in C ?? and or XML gauges. Taking Modulo ????Remainder divides the last two stack entries ???Could someone give example in normal math? What would be a good purpose for its use?Thanx Roman(KGRB)Technology Vs. Ignition Timing ,,,,, So far advanced.... It's retarded. :-)

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Modulo or remainder dicision is the same.Take for example the division of 11 by 2. In floats it is 5.5 or in integer 5 with remainder 1. So 11%2=1 or 11 mod 2 = 1. It's often handy to cut away leading digits.Arne Bartels

  • Author

Arne, Thanks as always !!! It is exactly what I was looking for, I need to extract a number of valid decimal places after the decimal point and assign a value. Doesn't work yet properly, but very close.Also, do you ( or anyone ) know where to find more information on strings and their formats to coincide with the new information provided by the panel sdk? Thanx again. Roman(KGRB)Technology Vs. Ignition Timing ,,,,, So far advanced.... It's retarded. :-)

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

  • 3 weeks later...

Time for a bump :)I really need some help with this as well. I'm trying to 'concatenate' some information and present it in a new way, an endurance string, with 4,5 hours being presented as 4:30The calculation goes as this (hopefully correct):4,5 is put on stack by fuelamount/(flow1+flow2+0.0001) for my twin.duplicate floor duplicate store0 (4 in reg0, 4.5 and 4 on stack)modulo 60 multiply s1 (4 in reg0, 30 in reg1, stack empty)Assuming the above is correct, how do I concatenate %reg0% %:% %reg1% into a presentable string? Reading and writing string code seems pretty hard for me. I've checked the DME.xml and similar gauges, that pieces together various information into a single string, but I'm not able to spot the 'how-to-do-it'.Anyone?

  • Author

Karl,Once again not tested, but theoretically correct, I'm sure Arne may find a better way. :-)%((A:Fuel total quantity weight, pound) (A:Fuel weight per gallon, pound) / (A:Recip eng1 fuel flow, gallons per hour) (A:Recip eng2 fuel flow, gallons per hour) + / s0 abs)%!d!:%(l0 d abs - 60 *)%!d!%{end} In "english" after the calculations to get remaining time:-Store time (s0)-Take absolute value and display with colon (hours) (abs)-Load time (l0)-Duplicate Previous and take the absolute value (d abs)-Subtract the 2 to get decimal minutes (-) -Decimal minutes * 60 to get minutes and display (60 *)You could also use only the fuel remaining in the tanks currently selected. ((A:Fuel selected quantity, gallons) to replace ((A:Fuel total quantity weight, pound) (A:Fuel weight per gallon, pound) / Not sure why you used 0.0001 + ??P.S. Still haven't found any real good resources on strings, anybody?Hope this helps.Have a good day. Roman(KGRB)

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Thanks.Great help as usual. I'll dig right into it.The 0.0001 + was just to prevent division by zero, don't know how picky FS really is. I use it 'always', due previous bad code in other aspects :)Don't know if this is interresting to someone, but I made a 'check-list' type display yesterday. It's probably very basic for you guys, but maybe some other (I'm talking about me nw :)) newbie can find it useful. %((L:Checklist Number, enum))%{case}%{:0}COMPLETE%{:1}ON%{:2}CHECK%{:3}PRESSURIZE%{:4}CHECK%{:5}[email protected]"%{:6}MAIN/AUX 90MIN%{:7}REVIEW%{:8}ENRICH%{:9}[email protected]%{:10}OFF%{end}%Obviously you'll need a switch to 'scroll' through the items that sets the L:Checklist Number, enum. This is just one of a total of twentytwo 'items' (elements), that build a total of eleven checklists. Each checklist has nine checks to complete.One thing though. If I use small characters, letters like g, y, q, that go below the 'baseline' is somewhat cropped, but I thought the y axis offset would prevent that.Thanks.

LOL, whups... Well, you get the picture :)

  • Author

Karl,Excellent Idea on the checklists :-)>>>One thing though. If I use small characters, letters like g, y, q, that go below the 'baseline' is somewhat cropped, but I thought the y axis offset would prevent that.If you change mulitline="No" to "Yes" That should take care of it, although you are probably are going to have to realign everything as fontweight and text width changes. I thought multiline would do what it says-- allow more than one line, doesn't seem to be the case, or am I missing something here. BTW your entry of 444 for fontweight,,, Did that work for you?I am only able to use multiples of 400 to see any results. IE 400,800,1600. Roman(KGRB)

20AUG21_Avsim_Sig.png?dl=1  FS RTWR   SHRS F-111   JoinFS   Little Navmap 
 

 

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.