Page 1 of 1

Posible Bug - RGBMatrix does not work until a user edits all properties

Posted: Thu Jul 14, 2016 12:12 pm
by Tubby
Hey All,

Is anyone able to have a look at this for me, I'm not sure if i have screwed something up in my script or if this may be an issue with QLC.

The issue is: After selecting the pattern/algorithm the on screen preview works but playing on real fixtures does not.
I can get it to work on real fixtures by changing the patterns properties (doesn't matter the value just needs a change).

This doesn't seem to be an issue with the provided scripts only the ones i have written. Script and Workspace attached.

Steps to reproduce:
- Create New RGBMatrix.
- Set Fixture Group.
- Set Pattern to Color Wave.
- Observe On Screen Preview works.
- Click Preview.
- Observe Fixture Monitor shows no DMX activity.
- Modify Hue Range to 121 then to 120.
- Modify Hue Direction to Counter-Clockwise then to Clockwise.
- Observe Fixture Monitor shows DMX activity (if you didn't stop Preview).

Re: Posible Bug - RGBMatrix does not work until a user edits all properties

Posted: Thu Jul 14, 2016 1:00 pm
by janosvitok
Tubby,

I can't look into his problem now, but you get big golden medal for perfect report!

Re: Posible Bug - RGBMatrix does not work until a user edits all properties

Posted: Sun Jul 17, 2016 2:57 pm
by mcallegari
I haven't tested the script yet, but after a quick look at the code I noticed:

- declare arrays like "new Array()" and not the Python style [ ]
- no need for a semicolumn at the end of a function declaration (actually JS doesn't need semicolumns at all)
- the algorithm parameters are numbers, then why do you change them to strings like the following ?

Code: Select all

algo.HueRange = 120;
algo.getHueRange = function()
{
  return ""+algo.HueRange;
};

Re: Posible Bug - RGBMatrix does not work until a user edits all properties

Posted: Tue Jul 19, 2016 11:38 am
by Tubby
Hey Massimo,

Thanks for having a look at it.
For points 1 and 2, i was following the recommendation of JSHint, I'm new to JS.
For point 3, i don't know what i was thinking :oops: .

Re: Posible Bug - RGBMatrix does not work until a user edits all properties

Posted: Thu Jul 21, 2016 8:02 am
by mcallegari
For point 3, i don't know what i was thinking
And fixing it solves the issue you're having ?

Re: Posible Bug - RGBMatrix does not work until a user edits all properties

Posted: Thu Jul 21, 2016 10:32 am
by Tubby
Sorry for not getting back to you. Those changes didn't resolve the issue.

I have been looking at it a bit more in depth and i think i have found the cause.
I believe it is related to how script list properties are handed.

The script i wrote expected the value of "algo.HueDirection" to be set otherwise it fails. This value is set by a list property. I updated my code to so that when "algo.HueDirection" isn't set it displays the opposite colour than the supplied RGB.

Running this (ColorWave V4) in QLC+ i found that:
- Initially the on screen preview works as expected.
- Then when previewing (on DMX) the script displayed the opposite colour (ie "algo.HueDirection" has not been set) .
- Then when i stopped previewing the on screen preview displayed the opposite colour as well (ie "algo.HueDirection" has not been set).

After further digging this only happens when the default for "algo.HueDirection" (value set at the start of the anonymous function) is set to be the first value in the list ("Clockwise" in this example), setting the default to the 2nd or 3rd value everything works fine.

My suspicion is QLC+ isn't storing the value so it only works the first time after a script is loaded (ie when the anonymous function is fully executed). The workspace files seem to confirm this as they show this property to be blank.