Jump to content

Color change


BuzziBi

Recommended Posts

Someone that can help me with this?

I am working with a gps display.

I want to change the color of the indicated altitude (the FormattedText), ie the altitude drops below 5000 ft.

This is the code I use to display the indicated altitude:

 

        


ALTITUDE





%((A:Indicated Altitude, feet))%!d!\{dpl=ft}

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

A couple ways to do it, one would be with an If statement.

 

Another...

     
(A:Indicated Altitude, feet) 5000 %gt;


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}



(A:Indicated Altitude, feet) 5000 %lt;


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}

 

..should work, I did not test it.

 

peace,

the Bean

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

Thank you for the replay StringBean.

I was testing with the xxxx "dodas" because I thought this was the way to go. However, with your suggestion, the altitude becomes red both above and below the set altitude. I wonder if there is more to this than meets the eye :confused: Maby rawdata?

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

Typo in my code.

 

Replace the percent signs with Ampersands.

 

     
(A:Indicated Altitude, feet) 5000 >


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}



(A:Indicated Altitude, feet) 5000 


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

TX! StringBean. Now that worked like a charm :pilot:

Oh how I envy you who knows c ++

The only coding I have some experience with, is the simplified coding for Arduino.

But I saw that I had not been far from the truth. I had tryed with the "

"

Anyway, thank you for your help. I hope you are present for future questions.

I have a huge challenge ahead of me. Next I'll try to make a new "page group" that will contain .bmp's of the aeordrome charts for the airports in Norway.

Here is a picture of my GPS. Time will tell if this is how it will look like at the end :)

It will take me a huge amont of time. I used 2 days just to get the power on/off on the screens to work ;)

2016-01-15_15-55-33.jpg

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

At the end I ended up with 4 colorchanges ;)

  




ALTITUDE




(A:Indicated Altitude, feet) 6000 >


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}



(A:Indicated Altitude, feet) 6000  


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}



(A:Indicated Altitude, feet) 3000 


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}



(A:Indicated Altitude, feet) 1000 


%((A:Indicated Altitude, feet))%!d!\{dpl=ft}

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

Hmmm,...that is not gonna work.

 

Replace....

 

(A:Indicated Altitude, feet) 3000

 

...with...

 

1000 3000 (A:Indicated Altitude, feet) rng

 

...and it should work as desired.

 

peace,

the Bean

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

The

(A:Indicated Altitude, feet) 3000 works :) so do the

1000 3000 (A:Indicated Altitude, feet) rng

Nonetheless, your line is cleaner.

I also found a way to display PLANE latitude/longitude, but that nearly gave me a headache :)

2016-01-19_08-32-10.jpg

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

I suppose interpretation depends on one's definition of "works..."

 

Just because something is displayed doesn't mean it actually does work correctly. :cool:

Bill Leaming http://smileys.sur-la-toile.com/repository/Combat/0054.gif

Gauge Programming - 3d Modeling Military Visualizations

Flightsim.com Panels & Gauges Forum Moderator

Flightsim Rig: Intel Core i7-2600K - 8GB DDR3 1333 - EVGA GTX770 4GB - Win7 64bit Home Premium

Development Rig1: Intel Core i7-3770k - 16GB DDR3 - Dual Radeon HD7770 SLI 1GB - Win7 64bit Professional

Development Rig2: Intel Core i7-860 - 8GB DDR3 Corsair - GeForce GTS240 1GB - Win7 64bit Home Premium

NOTE: Unless explicitly stated in the post, everything written by my hand is MY opinion. I do NOT speak for any company, real or imagined...

Link to comment
Share on other sites

I thought that Visible statements in separate Element sections did not always work in FSX and later?

 

http://www.fsdeveloper.com/forum/threads/multiple-visibilities-not-showing-up.434951/page-3

 

I tested my code in FSX/A and it worked as expected.

 

I do not have P3D to test in.

 

I will attempt to digest the topic you noted when I have more time. It appears there might be more going on there than just tags.

 

Thanks for posting Tom.

 

peace,

the Bean

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

I thought that Visible statements in separate Element sections did not always work in FSX and later?

 

http://www.fsdeveloper.com/forum/threads/multiple-visibilities-not-showing-up.434951/page-3

 

Thanks again Tom.

 

It appears to be a problem when displaying only text.

 

As said, it works for me in FSX/A.

 

The only thing I saw was if you were at the exact transition altitude (6000 ft for example) you might see some flickering between the two colors due to meeting two visibility requirements.

 

This is easy to fix...

 

1001 3000 (A:Indicated Altitude, feet) rng

3001 5999 (A:Indicated Altitude, feet) rng

 

 

...or something to that effect.

 

peace,

the Bean

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

More help required :o

 

If this line works:

(A:Indicated Altitude, feet) 1000

 

How can i combine it with this:

(P:Absolute time,seconds) 1 % 0.5 > !

(A:Indicated Altitude, feet) 1000  ! &&

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

TX StringBean. I tested that earlyer to day with no luck. (found something similar in another code) I was just going to reply to my own question when I saw your answer :D

 

I finaly got it to work:

(A:Indicated Altitude, feet) 1000 ! &

WARN\{bo}

"

 

Is it not posible to use a " if (condition) " in this context?

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

What sim are you coding for?

 

I give you code that I test in FS9 and FSX/A and you say it does not work.

 

You give me code that you say works and I cannot get it to work in FS9 or FSX/A.

 

Is it not possible to use a " if (condition) " in this context?

 

Possible? Yes.

(A:Indicated Altitude, feet) 1000  ! }

 

Or at least it works for me.

 

In this case && and if both work though some would say the && is cleaner and easier to read.

 

One of the challenges is that we do not have your whole code so when you asked to integrate the blink and neglected to say that you had changed the to text, we might get different results.

 

I suggest you read the thread Tom linked to earlier in regards to text strings and tags.

 

BTW, I did see where my code in post #17 occasionally loads with no value visible when the plane is on the ground. However once the plane climbs one foot the altitude displays.

 

I suspect this ties into Tom's thread.

 

I have no more time to test this morning.

 

peace,

the Bean

WWOD---What Would Opa Do? Farewell, my freind (sp)

 

Never argue with idiots.

They drag you down to their level and beat you with experience

Link to comment
Share on other sites

Beleave me, I am new to this guage coding, so there is not much I do understand ;)

Is there any difference in where a is placed? I got my under the:

It is difficult to learn if I can not get things that you say works, to work for me :)

And I'm all like...Weeeeeeeeee
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...