Jump to content
Sign in to follow this  
Guest rkruijer

60 Print statements.

Recommended Posts

Guest rkruijer

I have coded plenty of statements like this:AUTO------------------------------------------------I think about 60 or so. They actually need to be printed only once. How does one properly put these statements within an if{ }?Something like?: (L:Var1, bool) 0 || ! if(60 Elements like above -----------------------1 (>L:Var1, bool) } Roelof

Share this post


Link to post
Share on other sites

Roelof,I'm not sure to fully understand the question, but if you need to "print" all those elements in one step, maybe this works: (L:Var1,bool) ! ...601 (>L:Var1,bool)Tom

Share this post


Link to post
Share on other sites
Guest rkruijer

>Roelof,>>I'm not sure to fully understand the question, but if you need>to "print" all those elements in one step, maybe this works:>>> (L:Var1,bool) !> > > ...60>>1 (>L:Var1,bool)>>TomMaybe I should give you a better example: I'll use 2 print statements.This is an example of the first line to be printed on Y position 0This is an example of the second line to be printed on Y position 15My first question is: Can these 2 lines be printed using one element. From what I see in gauges, XML seems to be very inefficient!Second question: These 2 lines would be printed every time, depending on the update frequency, that could be many times using resources unnecessarily!From what you told me (G:Var1,bool) would print them only once providing G:Var1,bool would be False to begin with and made True when printing is done. This (G:Var1,bool) could be inserted in every Element and that's it, In my case 60 extra lines!Does this thing followed by solve that problem? I found this code searching for . Can you tell me please what does or is supposed to do? Is it in your example, just a name for an element having nothing to do with I notice 2 nesting statements in the code following.I will try your suggestion. Having said that I realize that you cannot check if it was printed only once can you? I'll take your word for it though. (-: I'm afraid I am taking up too much of your time.Roelof (A:Circuit general panel on, bool) (L:PFD Switch, bool) ! &&(L:Nav Display Switch, bool)%(360 (A:Plane heading degrees gyro, degrees) dnor near d 0 == ?)%!03d!

Share this post


Link to post
Share on other sites

Hi,Use Formattedtext with Tab's, Linespacing etc. etc.Only one Vis Tag necessary.As many text possible as you want.Look in the MS GPS for examplesJan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest rkruijer

>Hi,>>Use Formattedtext with Tab's, Linespacing etc. etc.>Only one Vis Tag necessary.>As many text possible as you want.>Look in the MS GPS for examples>>>JanThanks Jan. Tell me more! I what cab file do I find that or do you have a name of the XML file. I searched for GPS but that gave too many options.Roelof

Share this post


Link to post
Share on other sites

fs9gps.cab in the main gauges folderJan"Beatus ille qui procul negotiis..."

Share this post


Link to post
Share on other sites
Guest rkruijer

>fs9gps.cab in the main gauges folder>>JanI took a look and saw that it goes beyond my knowledge. I don't see how I can make use of what's in there. As far as I can see they use only one position.I am dealing with the fact that each line has to be printed on a different position. X and Y are changing al the time.Look at it as a list of names that are to be printed on a backgroundbut not on top of each other.There's more to it than I thought but I'll get it done one way or the other.Roelof

Share this post


Link to post
Share on other sites
Guest rkruijer

>Roelof,>>I'm not sure to fully understand the question, but if you need>to "print" all those elements in one step, maybe this works:>>> (L:Var1,bool) !> > > ...60>>1 (>L:Var1,bool)>>Hi TomI tried this with an update frequency of 1. It shows line 1 and 2 for a second and then cleans it. What am I doing wrong?Roelof (L:Var1,bool) ! Line1Line21 (>L:Var1,bool)

Share this post


Link to post
Share on other sites

Roelof, tells FS to refresh the code once a second.So, the "container" element and hence its "childs" elements have to be visible as long as (LVAR1) is 0. On the first pass, (LVar1) is 0 so the elements are visible. But at the end of the element you turn (LVAR1) to 1, so in the next cycle will be 0 then the elements will hide. Now, as the refresh freq is one cycle per second, you will see the elements during this time, and in the next cycle, after a second, they will hide.If you remove UpFreq line, you'll see the elements flash and dissapear almost inmediately because the default refresh rate is 18 cycles/second. To keep showing the elements, either do not use the (LVar)/Visible code or update (LVAR) according to other condition.Tom

Share this post


Link to post
Share on other sites

>My first question is: Can these 2 lines be printed using one>element. From what I see in gauges, XML seems to be very>inefficient!>As Jan stated you can use with "Tabs=" flag.I think this thread is more understandable than gps.xml :http://forums.avsim.net/dcboard.php?az=sho...ing_type=search>Second question: These 2 lines would be printed every time,>depending on the update frequency, that could be many times>using resources unnecessarily!Don't worry about resources, it wold be very rare to fall short of them when coding standard gauges. Bear in mind that in fact each line of code is executed every time (depending on freq as you stated).>From what you told me (G:Var1,bool) >would print them only once providing G:Var1,bool would be>False to begin with and made True when printing is done. This> (G:Var1,bool) could be inserted in every>Element and that's it, In my case 60 extra lines!>No, the idea is to use an that would be the "container" and its condition will extend to the nested elements preventing the need to add a flag to each one.For examplexx 1>If is not visible, neither will be Elements 2 and 3>Does this thing followed by >solve that problem? >Not but I just "named" the element to have a better reference of its meaning inside the gauge. I use to name almost all of my elements, because it becomes easier to debug when there are too much of them.>I found this code searching for . Can you tell me >please what does or is supposed to do? is a related flag, the same as . will refresh only those elements defined in the gauge that are positioned within its XY boundary. Maybe a carry from FS2002, not useful that I find it for FS9.In your example code, both Container and Update are placed within an Element; they shoudn't work as expected because as stated above, they are not but flags.Tom

Share this post


Link to post
Share on other sites

>I am dealing with the fact that each line has to be printed on a >different position. X and Y are changing al the time.>Look at it as a list of names that are to be printed on a background>but not on top of each other.If you need 60 XY positions which involves 60 , why not use a single bitmap with the 60 phrases printed on a transparent background? This would be far more efficient, because you're using a single element...Tom

Share this post


Link to post
Share on other sites
Guest rkruijer

>If you need 60 XY positions which involves 60 , why>not use a single bitmap with the 60 phrases printed on a>transparent background? This would be far more efficient,>because you're using a single element...>>TomNow that's a thought. You're a #### of a guy Tom. What would we do without you? Ever so greatful,Roelof (Greetings from the Netherlands btw.)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...