Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Many exceptions #8

Open
ImNotSatan opened this issue Nov 14, 2017 · 0 comments
Open

Many exceptions #8

ImNotSatan opened this issue Nov 14, 2017 · 0 comments

Comments

@ImNotSatan
Copy link

ImNotSatan commented Nov 14, 2017

I have 2 channels
1: 4 strips
2: 2 strips

It looks like the Ambilight is working fine but it keeps spamming at:
if (huePorts.huePorts[currentLed.device].isEnabled)
+ Exception Exception thrown: 'System.IndexOutOfRangeException' in HueLight+.exe ("De index ligt buiten de matrixgrenzen.") System.IndexOutOfRangeException

After startup:
Randomly blinks lights and then they go black again and does absolutely nothing besides that

When i turn on multithreading:
Still randomly blinks lights but amblight does work

Sorry if this was a bad description im quite new to C#.

One ting i noticed

The config.json did not load properly at first untill i changed it to this: (i use vistual studio 2017 with the newest windows 10).

`        private void SetupAmbiLight()
        {
            dynamic config = JsonConvert.DeserializeObject(File.ReadAllText("config.json"));

            bool formIsHidden = config["startsHidden"];
            double gamma = config["gamma"];

            AmbiLight.multiThreading = config["multiThreading"];
            AmbiLight.scanDepth = config["scanDepth"];
            AmbiLight.pixelsToSkipPerCoordinate = config["pixelsToSkipPerCoordinate"];
            AmbiLight.delay = config["delay"];
            AmbiLight.frameTimeout = config["frameTimeout"];
            AmbiLight.previewMode = config["preview"];

            HuePorts huePorts = new HuePorts(config["devices"].ToObject<Device[]>(), gamma);
            ScreenSide right = new ScreenSide(config["ambiLight"]["right"]["screenRegions"].ToObject<ScreenRegion[]>(), Direction.Right);
            ScreenSide left = new ScreenSide(config["ambiLight"]["left"]["screenRegions"].ToObject<ScreenRegion[]>(), Direction.Left);
            ScreenSide top = new ScreenSide(config["ambiLight"]["top"]["screenRegions"].ToObject<ScreenRegion[]>(), Direction.Top);
            ScreenSide bottom = new ScreenSide(config["ambiLight"]["bottom"]["screenRegions"].ToObject<ScreenRegion[]>(), Direction.Bottom);
            ScreenSide[] screenSides = new ScreenSide[] { top, right, bottom, left };

            ambiLight = new AmbiLight(screenSides, formIsHidden, huePorts, previewImage);
            Logger.Add("Loaded AmbiLight from config.json");
            Logger.Add("----------------------------");
        }`

Tings as config.startsHidden did not work for me but config["startsHidden"] did work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant