-
Notifications
You must be signed in to change notification settings - Fork 221
New web UI, store highest channel number used #1739
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
base: 0.10
Are you sure you want to change the base?
Changes from 2 commits
34a7769
6d7a9af
f5faaec
da36879
8f443cb
4eacc64
1f57145
c5b8700
02faeaa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,19 @@ | |
| ola.factory('$ola', ['$http', '$window', 'OLA', | ||
| function($http, $window, OLA) { | ||
| 'use strict'; | ||
| var highestChannelNumberUsed = 0; | ||
|
|
||
| var updatehighestChannelNumberUsed = function(dmx) { | ||
peternewman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| for (var channel = dmx.length; channel > highestChannelNumberUsed; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A comment might be nice here, just so we don't automatically assume it's iterating from dmx.length to zero as I did. Something like "we only care about checking channels higher than our existing highest" or similar maybe. |
||
| channel--) { | ||
|
|
||
| if ((dmx[channel - 1] > OLA.MIN_CHANNEL_VALUE) && | ||
| (highestChannelNumberUsed < channel)) { | ||
|
||
| highestChannelNumberUsed = channel; | ||
| } | ||
cmouttet marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| }; | ||
|
|
||
| // TODO(Dave_o): once olad supports json post data postEncode | ||
| // can go away and the header in post requests too. | ||
| var postEncode = function(data) { | ||
|
|
@@ -63,6 +76,9 @@ ola.factory('$ola', ['$http', '$window', 'OLA', | |
| strip = false; | ||
| } | ||
| } | ||
| while (integers.length < highestChannelNumberUsed) { | ||
| integers.push(OLA.MIN_CHANNEL_VALUE); | ||
| } | ||
peternewman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return integers.join(','); | ||
| }; | ||
| return { | ||
|
|
@@ -118,6 +134,7 @@ ola.factory('$ola', ['$http', '$window', 'OLA', | |
| } | ||
| }) | ||
| .then(function(response) { | ||
| updatehighestChannelNumberUsed(response.data.dmx); | ||
|
||
| return response.data; | ||
| }); | ||
| }, | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.