aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjakobst1n <jakob.stendahl@outlook.com>2018-12-04 16:19:02 +0000
committerjakobst1n <jakob.stendahl@outlook.com>2018-12-04 16:19:02 +0000
commitec3b7655b3b265cfe0086d7ad20ffa28cfa8629d (patch)
treea2e8eab6034a0beaa643c9bc2d30cc704c2ba9ea
parent7799a9bf44f6afdacb7742768d3da0cce0f06186 (diff)
downloadLuxcena-Neo-ec3b7655b3b265cfe0086d7ad20ffa28cfa8629d.tar.gz
Luxcena-Neo-ec3b7655b3b265cfe0086d7ad20ffa28cfa8629d.zip
:sparkles: Matrix is now setting itself up correctly
Have bypassed a try-catch for now
-rw-r--r--package-lock.json44
-rw-r--r--src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Matrix.py8
-rw-r--r--src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Strip.py12
3 files changed, 45 insertions, 19 deletions
diff --git a/package-lock.json b/package-lock.json
index ac5f897..8b1b5de 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2651,7 +2651,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
@@ -2672,12 +2673,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -2692,17 +2695,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -2819,7 +2825,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
@@ -2831,6 +2838,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -2845,6 +2853,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -2852,12 +2861,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.2.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.1",
"yallist": "^3.0.0"
@@ -2876,6 +2887,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -2956,7 +2968,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -2968,6 +2981,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
@@ -3053,7 +3067,8 @@
"safe-buffer": {
"version": "5.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -3089,6 +3104,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -3108,6 +3124,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -3151,12 +3168,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
@@ -4383,8 +4402,7 @@
"monaco-editor": {
"version": "0.14.3",
"resolved": "https://registry.npmjs.org/monaco-editor/-/monaco-editor-0.14.3.tgz",
- "integrity": "sha512-RhaO4xXmWn/p0WrkEOXe4PoZj6xOcvDYjoAh0e1kGUrQnP1IOpc0m86Ceuaa2CLEMDINqKijBSmqhvBQnsPLHQ==",
- "dev": true
+ "integrity": "sha512-RhaO4xXmWn/p0WrkEOXe4PoZj6xOcvDYjoAh0e1kGUrQnP1IOpc0m86Ceuaa2CLEMDINqKijBSmqhvBQnsPLHQ=="
},
"move-concurrently": {
"version": "1.0.1",
diff --git a/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Matrix.py b/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Matrix.py
index 0986b45..4a93247 100644
--- a/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Matrix.py
+++ b/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Matrix.py
@@ -37,6 +37,14 @@ class Matrix:
def get(self, x, y):
""" Return the value of a place in the matrix given x and y coordinates """
return self.matrix[y][x]
+
+ def dump(self):
+ for y in self.matrix:
+ thisYLine = ""
+ for x in y:
+ thisYLine += str(x) + ( ' ' * (5 - len(str(x))) )
+ print(thisYLine)
+
if __name__ == "__main__":
testMatrix = Matrix(
diff --git a/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Strip.py b/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Strip.py
index e671d42..4856076 100644
--- a/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Strip.py
+++ b/src/compileAndRun/pythonSupportFiles/LuxcenaNeo/Strip.py
@@ -38,11 +38,11 @@ class Strip:
self.strip.show()
# Setup matrix
- pixelMatrix = Matrix(self.SEGMENTS, stripConf["matrix"])
- try:
- print("TESTING")
- except:
- print("Something went wrong while setting up your self-defined matrix.")
+ #try:
+ self.pixelMatrix = Matrix(self.SEGMENTS, stripConf["matrix"])
+ self.pixelMatrix.dump()
+ #except:
+ # print("Something went wrong while setting up your self-defined matrix.")
def show(self):
"""Update the display with the data from the LED buffer."""
@@ -76,7 +76,7 @@ class Strip:
"""Set a whole segment to the provided red, green and blue color.
Each color component should be a value from 0 to 255 (where 0 is the
lowest intensity and 255 is the highest intensity)."""
- for n in getSegmentRange(self.segments, segment):
+ for n in getSegmentRange(self.SEGMENTS, segment):
self.strip.setPixelColor(n, Color(red, green, blue, white))
def setBrightness(self, brightness):