RGBScript works in DEV Tool, but not in QLC+

Post Reply
mruttenn
Posts: 2
Joined: Tue Dec 10, 2019 6:30 pm
Real Name: Menno

Dear all,

I rewrote one of the provided RGBScripts. My version does work in the QLC+ RGB DEV Tool but it does not work in QLC. I am running version 4.12.2

EDIT: Removed _spacing in getSpacing function

My RGB code:

Code: Select all

/*
  Q Light Controller Plus
  spacedstripes.js

  Copyright (c) Menno Rutten

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0.txt

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/

// Development tool access
var testAlgo;

(
  function()
  {
    var algo = new Object;
    algo.apiVersion = 2;
    algo.name = "Spaced Stripes";
    algo.author = "Menno Rutten";
    
    algo.spacing = 2;
    
    algo.properties = new Array();
    algo.properties.push("name:spacing|type:range|display:Spacing|values:0,7|write:setSpacing|read:getSpacing");
    
    algo.setSpacing = function(_spacing) {
      algo.spacing = _spacing;
    }
    
    algo.getSpacing = function() {
      return algo.spacing;
    }
    
    algo.rgbMap = function(width, height, rgb, step)
    {
      var map = new Array(height);
      for (var y = 0; y < height; y++)
      {
        map[y] = new Array();
        for (var x = 0; x < width; x++)
        {
          if ((step % (algo.spacing + 1)) === (x % (algo.spacing + 1)))
            {
              map[y][x] = rgb;
              continue;
            }
          map[y][x] = 0;
        }
      }
      return map;
    };

    algo.rgbMapStepCount = function(width, height)
    {
      return width;
    };
    
    // Development tool access
    testAlgo = algo;
    
    return algo;
    }
)();
The DEV tool shows multiple stripes but QLC+ shows only one.
Can someone help me with this? Thanks in advance.
Last edited by mruttenn on Wed Dec 11, 2019 2:31 pm, edited 1 time in total.
User avatar
mcallegari
Posts: 4482
Joined: Sun Apr 12, 2015 9:09 am
Location: Italy
Real Name: Massimo Callegari
Contact:

maybe this

Code: Select all

algo.getSpacing = function(_spacing)
Remove _spacing. A get function does not need parameters.
mruttenn
Posts: 2
Joined: Tue Dec 10, 2019 6:30 pm
Real Name: Menno

mcallegari wrote: Wed Dec 11, 2019 7:55 am maybe this

Code: Select all

algo.getSpacing = function(_spacing)
Remove _spacing. A get function does not need parameters.
I tried this but it did not solved the issue.
Post Reply