Announcement

Collapse
No announcement yet.

What to call first and what to call on updates.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What to call first and what to call on updates.

    I have two questions.

    Question 1:
    I have a a screen with about 8 controls on it and I have some questions about the code that is generated for me. Below is two sections of code, the first is an subset of the generated code. From what I understand I call the below code when I first build the screen, and then do I just call the second half of the code when something changes?

    Question 2:
    Since I have 4-7 meters on the screen and only one may be changing at any one time, I was just going to call the individual gauge updates when I detect a change to the value. Is this the correct methodology?


    CODE TO CALL WHEN SCREEN IS DISPLAYED AT FIRST.

    // HopperCountLed 1.0 generated 3/28/2014 6:17:40 PM img_Show(hndl, iHopperCountLed); // show all digits at 0, only do this once ledDigitsDisplay(numx, iHopperCountLed+1, 96, 1, 1, 15, 0) ;
    // MainButton1 1.0 generated 3/28/2014 6:17:41 PM img_ClearAttributes(hndl, iMainButton1, I_TOUCH_DISABLE); // set to enable touch, only need to do this once
    img_Show(hndl, iMainButton1); // show button, only do this once img_SetWord(hndl, iMainButton1, IMAGE_INDEX, state); // where state is 0 for up and 1 for down img_Show(hndl,iMainButton1) ;

    ????? CODE TO CALL WHEN THERE IS A CHANGE IN THE VALUES ??????

    Call when LedValueChanges ????
    ledDigitsDisplay(numx, iHopperCountLed+1, 96, 1, 1, 15, 0) ;

    Call when User Presses the button.????
    img_SetWord(hndl, iMainButton1, IMAGE_INDEX, state); // where state is 0 for up and 1 for down img_Show(hndl,iMainButton1) ;

  • #2


    1. Pretty much, you only need do the 'only need to do this once' code as initialization. Have a look at the File, Samples, Picaso ViSi, FancyButtons Example.

    2. Yes, only call when there's a change.
    Mark

    Comment

    Working...
    X