PlantScada - Startup/Timing issue for Theme_SetHilightColor when using custom theme

Hi,

In my startup script I've added following two lines for custom Theme setup:

//Project Theme settings
Theme_SetHeaderColor(5, 0); 
Theme_SetHilightColor(5, 1); 

Custom Theme 5 is set at "Standards ->Labels: _THEME_Default ->Expression = 5

It looks like there might be an timing issue with my startup script and the execution of FUNCTION Theme_SetTheme (INT nTheme) that again execute DspSetCurColor. 

1-2 runtime starts of 10, the array value for Theme_SetHilightColor is not set when function DspSetCurColor is executed, hence highlight color defaults to 0 and not my custom color 1. 

Appreciate any input,

Thanks

Rune

 

Parents
  • Thanks Jacky,

    I've also found two workaround that seems to work. At least when using either of these in my start-up script I haven't been able to reproduce the issue. 

    Alternative1:

     //Project Theme settings
    Theme_SetHeaderColor(5, 0);
    Theme_SetHilightColor(5, 1); 
    SleepMS(0);
    Theme_SetTheme(5);

    Alternative2:

     //Project Theme settings
    Theme_SetHeaderColor(5, 0);
    Theme_SetHilightColor(5, 1); 

    Theme_SetTheme(5);

Reply
  • Thanks Jacky,

    I've also found two workaround that seems to work. At least when using either of these in my start-up script I haven't been able to reproduce the issue. 

    Alternative1:

     //Project Theme settings
    Theme_SetHeaderColor(5, 0);
    Theme_SetHilightColor(5, 1); 
    SleepMS(0);
    Theme_SetTheme(5);

    Alternative2:

     //Project Theme settings
    Theme_SetHeaderColor(5, 0);
    Theme_SetHilightColor(5, 1); 

    Theme_SetTheme(5);

Children