Use lighting steps to the GUI and when executing.

This commit is contained in:
mmcw-dev 2018-03-16 12:59:23 -04:00
parent c1d5e52a10
commit fc73859f8f
2 changed files with 12 additions and 9 deletions

View File

@ -124,8 +124,6 @@ light.set = function (rgb, callback) { //rgb = [0,0,0]
rgb : rgb, rgb : rgb,
id : uuid.v4() id : uuid.v4()
}; };
console.log(rgb)
console.log(obj)
ipcRenderer.sendSync('light', obj); ipcRenderer.sendSync('light', obj);
if (typeof callback !== 'undefined') { if (typeof callback !== 'undefined') {

View File

@ -60,11 +60,16 @@ mse.mscript.toGUI = function () {
for (let i = 0; i < mse.mscript.data.arr.length; i++) { for (let i = 0; i < mse.mscript.data.arr.length; i++) {
c = mse.mscript.data.arr[i]; c = mse.mscript.data.arr[i];
mcopy.state.sequence.arr[i] = c; mcopy.state.sequence.arr[i] = c;
//if (c === 'CF' || c === 'CB') { console.dir(mse.mscript.data);
if (c === 'CF' || c === 'CB') {
if (typeof mse.mscript.data.light[i] !== 'undefined' && mse.mscript.data.light[i] !== '') {
mcopy.state.sequence.light[i] = mse.mscript.data.light[i];
} else {
mcopy.state.sequence.light[i] = light.color.join(','); mcopy.state.sequence.light[i] = light.color.join(',');
//} else { }
//mcopy.state.sequence.light[i] = ''; } else {
//} mcopy.state.sequence.light[i] = '';
}
gui.grid.state(i); gui.grid.state(i);
} }
}; };
@ -114,11 +119,11 @@ mse.mscript.prepare = function () {
obj = { obj = {
cmd : mse.mscript.data.arr[i] cmd : mse.mscript.data.arr[i]
}; };
/*if (mse.mscript.data.light[i] !== '') { if (typeof mse.mscript.data.light[i] !== 'undefined' && mse.mscript.data.light[i] !== '') {
obj.light = mse.mscript.data.light[i]; obj.light = mse.mscript.data.light[i];
} else { } else {
obj.light = light.color.join(','); obj.light = light.color.join(',');
}*/ }
arr.push(obj); arr.push(obj);
} }
return arr; return arr;