Results 1 to 9 of 9

Thread: Conditional expression in iVu, help

  1. #1
    Join Date
    Apr 2010
    Location
    Texas
    Posts
    785
    Post Likes

    Conditional expression in iVu, help

    So I've been playing around with some stuff just for my own reasons. I have a dual chiller setup at one account and I added a text toggle on the chiller overview screen to show the status of the dual chiller link. Works fine just reads yes or no. What I wanted to do was have the no show up in red text and the yes in green, as opposed to the default yellow that it is.

    I added this expression to the "variable color condition" section of that selection

    (($#eq_0_2/ccn_bi_pt4/preset_value$==true)?'#00cc00':'#ff0000')

    but it doesn't seem to work, the text stays yellow.

    What am I missing?

    This is in ViewBuilder 7, for a 7 Plus system.


  2. #2
    Join Date
    Apr 2010
    Location
    Texas
    Posts
    785
    Post Likes
    Thread Starter
    Well, nevermind, I guess just proofreading my post was enough, guess I should have done that to the expression I used.

    Its present, not preset.

    Works now. Well, I'll move on to the next thing.


  3. Likes MaxBurn liked this post.
  4. #3
    Join Date
    Apr 2010
    Location
    Texas
    Posts
    785
    Post Likes
    Thread Starter
    Okay, so how about this, most of the default text toggles are yellow, picked from the little color blocks in the style section. If I put in a conditional color expression, I have to pick a color using the hex value. For one value, I want that default yellow normally, but red for an alarm. So if I pick yellow from the expression box, it’s not exactly the same shade. How do I either find the hex value of that preselected color, or can you maybe make the conditional expression only change the default color to red?

  5. #4
    Join Date
    Dec 2006
    Location
    Washington, DC
    Posts
    658
    Post Likes
    In a variable color expression the first color is a hex decimal is when the expression is true, the second is the false. It works the same way single-line text expression where you can change the default point value displayed on the graphic. IE: the I/O point is setup as On/Off and you want to replace it with Start/Stop on the graphic " $sfan_bo/present_value$==1?'Start':'Stop' "

    Conditional Expressions are okay, but not the best for color change unless you know the exact hex decimal of the color you want. I typically use static text where you pick the color and use Conditional Hides between the two values on the graphic. Not only does it allow you to change the color, in the screenshot below when the points are in alarm it is bolded red instead of regular green.

    The Conditional Hide for the Freeze Stat is " $freeze_alm/present_value$==true " " show when " false " when normal. Then " $freeze_alm/present_value$==true " " show when " true " when in alarm.

    .
    Attached Images Attached Images  
    Quote Originally Posted by Qui-Gon Jinn (Star Wars Episode 1)
    "The ablilty to speak does not make you intelligent!"

  6. Likes CHAINIK liked this post.
  7. #5
    Join Date
    Dec 2006
    Location
    Washington, DC
    Posts
    658
    Post Likes
    This is a live screenshot with the water detector in in alarm ......
    .
    Attached Images Attached Images  
    Quote Originally Posted by Qui-Gon Jinn (Star Wars Episode 1)
    "The ablilty to speak does not make you intelligent!"

  8. #6
    Join Date
    Apr 2010
    Location
    Texas
    Posts
    785
    Post Likes
    Thread Starter
    So I got another kinda related question, the graphic that I'm currently using has the little red alarm bell that's in the stock graphics, stationary for normal and little clapper dinging gif for when it's in alarm. Problem is, even the non-alarm state graphic is bright red and says "ALARM" so the building engineer gets freaked out when he sees it on the chiller overview page.

    So I was looking into the conditional expression to hide it entirely unless its in alarm. But then I had another thought, can you accomplish the same thing in this case by simply deleting the "off" gif from the non alarm state in the button properties? Will it work this way too, and if so, is there some reason why I should or shouldn't do it this way?


  9. #7
    Join Date
    Dec 2006
    Location
    Washington, DC
    Posts
    658
    Post Likes
    Yes you can modify, both pictures in a toggle button must be the same size. I already had this modified years ago as we had the same issue with an engineer, it is attached for you to download.

    The alarm strobe in the new graphics is nicer, been using this for a couple years. It is an update for v7.0 and included with v8.0.
    Attached Images Attached Images    
    Quote Originally Posted by Qui-Gon Jinn (Star Wars Episode 1)
    "The ablilty to speak does not make you intelligent!"

  10. #8
    Join Date
    Apr 2010
    Location
    Texas
    Posts
    785
    Post Likes
    Thread Starter
    Haven't decided whether to use your modified icon for normal status or hide it completely. But, I did this other thing... I used your icon and loaded it & the stock one into an online gif editor, and replaced one frame with your modified one. Definite improvement. No dang way to miss it when its in alarm



    I guess if the ChEng had a sense of humor, I'd use this



  11. Likes MaxBurn liked this post.
  12. #9
    Join Date
    Mar 2018
    Posts
    101
    Post Likes
    I believe you have it sorted. A trick I use is to set the color to something not used like purple, then I let the expression change it to what I want. If it changes to normal but not alarm then the expression is fine but something else is wrong. If it is purple then the expression has a problem.

    I had an expression that would not work. I had to delete it and typed it in directly to finally get it to work. I still don't know what the problem was.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •