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.

Need some XML help with gauge design...

Featured Replies

Hello All:New member here...not new to AVSIM, but this is my first time here in the forums.I'm trying to find some help with XML gauge design, and wanted make sure first that I'm in the right forum before submitting lengthy posts. I've built a zillion gauges using XML, so I'm reasonably adept with it, but that's all...I'm not a wizard at it, and I've stumbled into a few snags that are over my head.So...if I am in the right place, hopefully one you will let me know and I'll pop back in with my issues one at a time. Thanks in advance,Garry

Garry, Welcome.. Yes, drop off any issues. There's a great core of gents here each helping out one another with their specialty. Myself I check this forum almost daily with the morning coffee.Roman

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

 

  • Commercial Member

"I've come to the right place then..." - recognize this line from a movie?Post your questions hear mate, good luck.Engjell BerishaGood Day!

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

"I've come to the right place then..." - recognize this line from a movie?Casablanca? African Queen? I dunno, but it sure sounds familiar.Okay, Roman and Engjell...thanks, and here we go. Before I start, let me explain something, and I'll apologize now that this initial message will be a little long. As with you folks, I do lots of things to help others in the hobby; whatever I can, whenever I can. And nothing irritates me more than some guy who gives you a tiny thumbnail of info about some small problem embedded deep in a complex project, and expects you to know how the whole process is supposed to work! So I won't do that. Here's the deal: I have a bush-flying VA (LewisAire) that I started in '94 or '95, or thereabouts. I purely dislike dealing with .GAU files, so I've re-created every gauge for every aircraft in our fleet (22 of 'em) in XML. For a time, we had an XML guru in the airline (Jim Bertelson) who taught me essentially most of what I know about XML...and working with scenery. But Jim is no longer with the airline, so I'm the guy. Some of what I do in XML is original, but as with most guys into gauge-building, much of it is snippets borrowed from other gauges and modified. Bottom line, I've become "fairly handy" with XML simply by so much exposure, but no more than that...some things are just over my head. Okay, that said, I'll move on. I have several issues that I'll address singly, and the first one is that I'm trying to develop a standalone "Windshield Wiper" gauge in XML. Yes, I know it can be done in modeling, but that locks it to a single aircraft: I want a standalone gauge that can be added to any aircraft or vehicle, much like a fuel gauge, altimeter, airspeed, or whatever. Let me explain something here: I use a totally unconventional approach that works well. Since all my gauges are in XML, they exist in a CAB file inside the Panel folder for each aircraft, and the Panel.cfg refers to that CAB file...there is no reference to the main "Gauges" folder. Every LewisAire aircraft folder contains everything that aircraft will ever need to operate. So...back to my "Wipers" gauge. For starters and concept, what I did was swipe some code from one of our fuel guages, which I believe was probably written by Jim Bertelson. Modified it some, created BMPs, and it shows what I'm looking for in concept. However, this uses "Engine Anti Ice" as the variable, and it's a toggle...Click anywhere near the wiper and it swings in one direction, click it again and it swings back. Obviously this wont do...I need some code that will keep it swinging once I activate it, until I DE-activate it. That's what I'm missing. Also, this uses <Value> because the Click is internal...I need to activate this from a Wiper switch mounted somewhere on the panel, which would use <Visible> instead of <Value>. I'm okay with L: for Local, G: for Gauge, that sort of thing.Here's the code I'm using, and please remember that this is just for development and concept. But if you wish to try it, you'll see that it does work (sort of). The required images are attached (they're JPGs, you'll have to convert them to BMPs)...disregard the quality; I get picky-picky about graphics once everything is working.<Gauge Name="Wipers" Version="1.0"> <Image Name="Wipers-Backing.bmp"/> <Element> <Position X="270" Y="25"/> <Image Name="WiperArm.bmp" PointsTo="East"> <Axis X="20" Y="28.5"/> </Image> <Rotate> <Value Minimum="0" Maximum="100">(A:Eng Anti Ice:1,percent)</Value> <Nonlinearity> <Item Value="0" Degrees="60"/> <Item Value="100" Degrees="120"/> </Nonlinearity> <Delay DegreesPerSecond="180"/> </Rotate> </Element> <Mouse> <Area Left="3" Top="3" Width="500" Height="500"> <Cursor Type="Hand"/> <Click Event="ANTI_ICE_TOGGLE"/> </Area> </Mouse></Gauge>Anyway, that's it for this issue...XML code that will keep the wipers swinging back and forth when I activate them from a seperate switch. Again, I apologize for the length of this; anything in the future will be MUCH shorter.Thanks in advance for any help,Garry

  • Commercial Member

Hey Gary,It's sorta difficult to get a feel for someones knowledge from a single post, so bare with me.You'll probably be disappointed with yourself to find how simple this solution can be, I'll direct you to a few methods:Method 1Method 2Here's an XML Gauge by Guy De Smet:

<Gauge Name="Wiper" Version="1.0">   <!--Copyright Guy De Smet 2002-->   <Update Frequency="6"/>   <Element>      <Position X="551" Y="312"/>      <Image Name="Wiper_left.bmp" PointsTo="North" ImageSizes="49,360,0,0" Bright="Yes">         <Axis X="30" Y="303"/>      </Image>      <Rotate>         <Value Minimum="0" Maximum="60">(G:Var1) (G:Var2) + (>G:Var1) (G:Var1) 2 <= if{ (L:Wiper, enum) (>G:Var2) } (G:Var1) 60 >= if{ (L:Wiper, enum) /-/ (>G:Var2) } (G:Var1) 60 < if{ (L:Wiper, enum) 0 == if{ 2 (>G:Var2) } } (G:Var1)</Value>         <Nonlinearity>            <Item Value="0" X="0" Y="270"/>            <Item Value="30" X="369" Y="36"/>            <Item Value="60" X="669" Y="300"/>         </Nonlinearity>      </Rotate>   </Element></Gauge>

<Gauge Name="Wiper Switch" Version="1.0">   <!--Copyright Guy De Smet 2002-->   <Update Frequency="6"/>   <Size X="43" Y="26"/>   <Image Name="Dummy.bmp" ImageSizes="43,26,0,0"/>      <Element>      <Position X="0" Y="0"/>      <Select>         <Value>(L:Wiper, enum)</Value>         <Case Value="0">            <Image Name="Wipers_0.bmp" ImageSizes="43,26,0,0"/>         </Case>         <Case Value="2">            <Image Name="Wipers_1.bmp" ImageSizes="43,26,0,0"/>         </Case>         <Case Value="5">            <Image Name="Wipers_2.bmp" ImageSizes="43,26,0,0"/>         </Case>      </Select>   </Element>      <Mouse>	<Tooltip>Wiper One click to activate or 0, 2 clicks for 1 and 2</Tooltip>            <Area Left="0" Top="9" Width="15" Height="16">         <Cursor Type="Hand"/>         <Click Kind="LeftSingle">350 (>K:PANEL_ID_TOGGLE) 0 (>L:Wiper, enum)</Click>      </Area>      <Area Left="15" Top="9" Width="13" Height="16">         <Cursor Type="Hand"/>         <Click Kind="LeftSingle">350 (>K:PANEL_ID_TOGGLE) 2 (>L:Wiper, enum)</Click>      </Area>      <Area Left="29" Top="9" Width="14" Height="16">         <Cursor Type="Hand"/>         <Click Kind="LeftSingle">350 (>K:PANEL_ID_TOGGLE) 5 (>L:Wiper, enum)</Click>      </Area>   </Mouse></Gauge>

I hope the above helps you in your programming.I've seen a particularly interesting XML Wiper gauge using sin or cos to animate a wiper, and (P:LOCAL TIME,seconds) 60 % to animate on at a certain speed, etc. The concept is fairly simplistic and so is it's application.BTW, google is your friend: "I've come to the right place then..." :( Engjell BerishaGood Day!

Good Day,

Engjell Berisha

 

Angel-Simulations-Small.png

Hi Engjell:Those are excellent references and exactly what I was looking for! Surely I can work with at least some of it. But...the code from Guy De Smet is under copyright, apparently. Do you know if there's a way to contact him and ask for permission to use it? Most stuff that we all post out here is just up for grabs, as you know...but with restricted code, I prefer to ask before using it in the airline, if it's possible to contact the author. As for being disappointed with my own abilities...well, yeah, kind of. But I know my limitations, and his stuff is clearly over my head. I can work with what's there, but I could never write it from scratch. Jim Bertelson was a good hand at that; very sharp fellow.Anyway, thank you much...now maybe I can finally get those wipers working! Not sure if I said, but this first test will go on an 18-wheel log truck that I made for Flight Sim. I'll keep you posted on the progress...(or lack thereof)Garry

HOLY JUMPING SMOKES!!!These wipers work beautifully! Even speed control, for crying out loud! I've got some fiddling to do with rotation values, that sort of thing, and of course the creation of some good images. But I lined the code up, made a few sizing changes to work with my test BMPs, and the whole thing worked the very first time I hit them! I am impressed beyond word! Like I said, though....I can now use this code and work with it, but I could never write it from scratch.Okay...do you (or does anyone) know the scoop on using this code in LewisAire VA? If it's okay to use it, then I will...but I surely do not want to violate someone's proprietary rule. It's a free airline, so there's no money involved anywhere. I haven't had any luck yet finding an email address for the author, but I'll keep digging.Once again, Engjll...thank you a zillion times over! And if Mr. Smet is reading...please be sure that I appreciate your code and your efforts a great deal.Now I have to try and be of some value to this forum, and that'll be tough; this crowd is obviously way more qualified than me. But maybe scenery (we have a TON of that), or panels, or even gauges...got hundreds of those, all in XML.Later,Garry

  • Moderator

It's curious that anyone would attempt to claim a "copyright" for XML script... Even Microsoft/ACES didn't even try... :( In any case, since it is possible that Guy adapted someone elses script, it seems a bit disengenous to be honest. After all, there are only so many ways the goal may be achieved.Here for example, is nearly the identical script for a 2d wiper posted almost a year ago:http://forums1.avsim.net/index.php?showtop...mp;hl=Wiper+XMLHere is my XML script for a set of 3 speed, 3d wipers for the VC (interior) model, which I posted back in 2006:http://www.aerodynamika.com/cgi-bin/yabb/Y...=1166806963/0#0Oh look! We're even using the same control variable (L:Wiper,enum)... What a remarkable coincidence... :(

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Thanks Bill:Well then, apparently I'm making too much of an insignificant issue. It's a habit (good or bad...I dunno) that I acquired when I first started the airline. Like most (or maybe all) other VAs, I started with download planes, rather than build each one from scratch. I soon discovered that most designers are glad to have their work out there being used and displayed, as long as there's proper recognition. But I stumbled onto a few who were highly protective of their stuff. One guy said he was shocked and appaled that I had the "unmitigated audacity" to even ask if I could use his plane. Hmmm...Anyway, those wipers work great! A little tweaking and tuning, and that one is a done deal! Then, of course, I'll be back here with my next issue. Just so you guys understand, I really will try to contribute here in some fashion, not just show up begging for help all the time. I only have 2 or three issues that are bugging me, and they all seemed to pop up in this latest project.Take care, and thanks again.GarryP.S. One of the things I've considered doing (but just haven't gotten around to it yet) is make a catalogued inventory --with pictures-- of everthing we have that perhaps someone else could use and modifiy to their own situation. As with these wipers, it's pretty doggone handy to start with something that already works. The only issue might be that everything is strictly FS9, and I'm not sure how many are into FSX these days. Later,Garry

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.