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

Bugfixes [TBC] #621

Merged
merged 6 commits into from
Sep 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions assets/webconfig/content/conf_leds.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ <h4 class="panel-title">
</div>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_cl_generate" class="btn btn-warning"><i class="fa fa-fw fa-television"></i><span data-i18n="conf_leds_layout_cl_generate">Generate LED configuration</span></button>
<button id="btn_cl_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
Expand Down Expand Up @@ -255,7 +254,6 @@ <h4 class="panel-title">
</table>
</div>
<div class="panel-footer" style="text-align:right;">
<button id="btn_ma_generate" class="btn btn-warning"><i class="fa fa-fw fa-th"></i><span data-i18n="conf_leds_layout_cl_generate">Generate LED configuration</span></button>
<button id="btn_ma_save" class="btn btn-primary"><i class="fa fa-fw fa-save"></i><span data-i18n="conf_leds_layout_button_savelay">Save layout</span></button>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion assets/webconfig/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
"conf_leds_layout_cl_reversdir": "Richtung umkehren",
"conf_leds_layout_cl_hleddepth": "Horizontale LED Tiefe",
"conf_leds_layout_cl_vleddepth": "Vertikale LED Tiefe",
"conf_leds_layout_cl_generate": "Generiere LED Konfiguration",
"conf_leds_layout_cl_edgegap": "Rahmenabstand",
"conf_leds_layout_cl_cornergap": "Eckabstand",
"conf_leds_layout_cl_overlap": "Überlappung",
Expand Down
1 change: 0 additions & 1 deletion assets/webconfig/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@
"conf_leds_layout_cl_reversdir" : "Reverse direction",
"conf_leds_layout_cl_hleddepth" : "Horizontal LED depth",
"conf_leds_layout_cl_vleddepth" : "Vertical LED depth",
"conf_leds_layout_cl_generate" : "Generate LED configuration",
"conf_leds_layout_cl_edgegap" : "Edge Gap",
"conf_leds_layout_cl_cornergap" : "Corner Gap",
"conf_leds_layout_cl_overlap" : "Overlap",
Expand Down
2 changes: 1 addition & 1 deletion assets/webconfig/js/content_dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ $(document).ready( function() {
}

// add more info
$('#dash_leddevice').html(window.serverInfo.ledDevices.active);
$('#dash_leddevice').html(window.serverConfig.device.type);
$('#dash_currv').html(window.currentChannel+' '+window.currentVersion);
$('#dash_instance').html(window.currentHyperionInstanceName);
$('#dash_ports').html(window.serverConfig.flatbufServer.port+' | '+window.serverConfig.protoServer.port);
Expand Down
4 changes: 4 additions & 0 deletions assets/webconfig/js/content_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ $(document).ready( function() {

if(!isInData)
{
//Delete Storage information about the last used but now stopped instance
if (getStorage('lastSelectedInstance', false))
removeStorage('lastSelectedInstance', false)

currentHyperionInstance = 0;
currentHyperionInstanceName = getInstanceNameByIndex(0);
requestServerConfig();
Expand Down
28 changes: 7 additions & 21 deletions assets/webconfig/js/content_leds.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
var ledsCustomCfgInitialized = false;
var finalLedArray = [];
var conf_editor = null;
var aceEdt = null;

function round(number) {
var factor = Math.pow(10, 4);
Expand Down Expand Up @@ -53,6 +54,9 @@ function createLedPreview(leds, origin){
if($('#leds_prev_toggle_num').hasClass('btn-success'))
$('.led_prev_num').css("display", "inline");

// update ace Editor content
aceEdt.set(finalLedArray);

}

function createClassicLeds(){
Expand Down Expand Up @@ -343,16 +347,9 @@ $(document).ready(function() {
// check access level and adjust ui
if(storedAccess == "default")
{
$('#btn_ma_generate').toggle(false);
$('#btn_cl_generate').toggle(false);
$('#texfield_panel').toggle(false);
$('#previewcreator').toggle(false);
}
else
{
$('#btn_ma_save').toggle(false);
$('#btn_cl_save').toggle(false);
}

//Wiki link
$('#leds_wl').append('<p style="font-weight:bold">'+$.i18n('general_wiki_moreto',$.i18n('conf_leds_nav_label_ledlayout'))+buildWL("user/moretopics/ledarea","Wiki")+'</p>');
Expand All @@ -371,7 +368,7 @@ $(document).ready(function() {
// v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
var ledschema = {"items":{"additionalProperties":false,"required":["h","v"],"properties":{"colorOrder":{"enum":["rgb","bgr","rbg","brg","gbr","grb"],"type":"string"},"h":{"additionalProperties":false,"properties":{"max":{"maximum":1,"minimum":0,"type":"number"},"min":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"v":{"additionalProperties":false,"properties":{"max":{"maximum":1,"minimum":0,"type":"number"},"min":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"}},"type":"object"},"type":"array"};
//create jsonace editor
var aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
mode: 'code',
schema: ledschema,
onChange: function(){
Expand Down Expand Up @@ -411,17 +408,6 @@ $(document).ready(function() {
// leds to finalLedArray
finalLedArray = window.serverConfig.leds;

// cl/ma leds push to textfield
$('#btn_cl_generate, #btn_ma_generate').off().on("click", function(e) {
if(e.currentTarget.id == "btn_cl_generate")
$('#collapse1').collapse('hide');
else
$('#collapse2').collapse('hide');

aceEdt.set(finalLedArray);
$('#collapse4').collapse('show');
});

// create and update editor
$("#leddevices").off().on("change", function() {
var generalOptions = window.serverSchema.properties.device;
Expand All @@ -436,7 +422,7 @@ $(document).ready(function() {

var values_general = {};
var values_specific = {};
var isCurrentDevice = (window.serverInfo.ledDevices.active == $(this).val());
var isCurrentDevice = (window.serverConfig.device.type == $(this).val());

for(var key in window.serverConfig.device){
if (key != "type" && key in generalOptions.properties)
Expand Down Expand Up @@ -507,7 +493,7 @@ $(document).ready(function() {
$("#leddevices").append(createSel(optArr[3], $.i18n('conf_leds_optgroup_network')));
$("#leddevices").append(createSel(optArr[4], $.i18n('conf_leds_optgroup_usb')));
$("#leddevices").append(createSel(optArr[5], $.i18n('conf_leds_optgroup_debug')));
$("#leddevices").val(window.serverInfo.ledDevices.active);
$("#leddevices").val(window.serverConfig.device.type);
$("#leddevices").trigger("change");

// validate textfield and update preview
Expand Down
11 changes: 11 additions & 0 deletions assets/webconfig/js/ui_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,17 @@ function setStorage(item, value, session)
}
}

function removeStorage(item, session)
{
if(storageComp())
{
if(session === true)
sessionStorage.removeItem(item);
else
localStorage.removeItem(item);
}
}

function debugMessage(msg)
{
if (window.debugMessagesActive)
Expand Down
18 changes: 11 additions & 7 deletions assets/webconfig/js/wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -705,17 +705,21 @@ function beginWizardHue()
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
});

//create hue led config
for(var key in lightIDs)
$('#btn_wiz_save').off().on("click", function(){
var hueLedConfig = [];
var finalLightIds = [];

//create hue led config
for(var key in lightIDs)
{
if($('#hue_'+key).val() != "disabled")
{
if($('#hue_'+key).val() != "disabled")
{
hueLedConfig.push(assignHuePos(key, $('#hue_'+key).val()));
finalLightIds.push(parseInt(key));
}
hueLedConfig.push(assignHuePos(key, $('#hue_'+key).val()));
finalLightIds.push(parseInt(key));
}
}


window.serverConfig.leds = hueLedConfig;

//Adjust gamma, brightness and compensation
Expand Down
1 change: 0 additions & 1 deletion libsrc/api/JsonAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,6 @@ void JsonAPI::handleServerInfoCommand(const QJsonObject& message, const QString&

// get available led devices
QJsonObject ledDevices;
ledDevices["active"] = _hyperion->getActiveDevice();
QJsonArray availableLedDevices;
for (auto dev: LedDeviceWrapper::getDeviceMap())
{
Expand Down
6 changes: 6 additions & 0 deletions libsrc/hyperion/Hyperion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,12 @@ void Hyperion::handleSettingsUpdate(const settings::type& type, const QJsonDocum
{
_ledString = hyperion::createLedString(getSetting(settings::LEDS).array(), hyperion::createColorOrder(dev));
_imageProcessor->setLedString(_ledString);

_ledStringColorOrder.clear();
for (Led& led : _ledString.leds())
{
_ledStringColorOrder.push_back(led.colorOrder);
}
}

// do always reinit until the led devices can handle dynamic changes
Expand Down