Merge remote-tracking branch 'refs/remotes/hyperion-project/master' into effects
@ -52,7 +52,7 @@ if ( NOT DEFINED PLATFORM )
|
||||
STRING ( TOLOWER "${SYSTEM_CPUINFO}" SYSTEM_CPUINFO )
|
||||
if ( "${SYSTEM_CPUINFO}" MATCHES "amlogic" AND ${CMAKE_SIZEOF_VOID_P} EQUAL 4 )
|
||||
SET( PLATFORM "amlogic" )
|
||||
elseif ( ("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
|
||||
elseif ( ("${SYSTEM_CPUINFO}" MATCHES "amlogic" OR "${SYSTEM_CPUINFO}" MATCHES "odroid-c2" OR "${SYSTEM_CPUINFO}" MATCHES "vero4k") AND ${CMAKE_SIZEOF_VOID_P} EQUAL 8 )
|
||||
SET( PLATFORM "amlogic64" )
|
||||
endif()
|
||||
endif()
|
||||
|
@ -107,9 +107,9 @@ To generate make files on OS X:
|
||||
|
||||
After which you can run cmake with the correct qt5 path:
|
||||
```
|
||||
cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.7.0 -DCMAKE_BUILD_TYPE=Release ..
|
||||
export QVER=$(find /usr/local/Cellar/qt5 -type d -name "5.*" | sort -n | head -n1)
|
||||
cmake -DCMAKE_PREFIX_PATH=$QVER -DCMAKE_BUILD_TYPE=Release ..
|
||||
```
|
||||
|
||||
### Run make to build Hyperion
|
||||
The `-j $(nproc)` specifies the amount of CPU cores to use.
|
||||
```bash
|
||||
|
@ -157,13 +157,13 @@ void setup() {
|
||||
#if INITIAL_LED_TEST_ENABLED == true
|
||||
for (int v=0;v<INITIAL_LED_TEST_BRIGHTNESS;v++)
|
||||
{
|
||||
showColor(CRGB(v,v,v);
|
||||
showColor(CRGB(v,v,v));
|
||||
delay(INITIAL_LED_TEST_TIME_MS/2/INITIAL_LED_TEST_BRIGHTNESS);
|
||||
}
|
||||
|
||||
for (int v=0;v<INITIAL_LED_TEST_BRIGHTNESS;v++)
|
||||
{
|
||||
showColor(CRGB(v,v,v);
|
||||
showColor(CRGB(v,v,v));
|
||||
delay(INITIAL_LED_TEST_TIME_MS/2/INITIAL_LED_TEST_BRIGHTNESS);
|
||||
}
|
||||
#endif
|
||||
|
250
assets/firmware/arduino/adalight_mega_pwm/hyperion_mega.ino
Normal file
@ -0,0 +1,250 @@
|
||||
|
||||
#include "FastLED.h"
|
||||
|
||||
#define ANALOG_MODE_AVERAGE 0
|
||||
#define ANALOG_MODE_LAST_LED 1
|
||||
|
||||
/**************************************
|
||||
S E T U P
|
||||
|
||||
set following values to your needs
|
||||
**************************************/
|
||||
|
||||
// Number of leds in your strip. set to 1 and ANALOG_OUTPUT_ENABLED to true to activate analog only
|
||||
#define NUM_LEDS 100
|
||||
|
||||
#define LED_TYPE WS2812B // type of your led controller, possible values, see below
|
||||
|
||||
// 3 wire (pwm): NEOPIXEL BTM1829 TM1812 TM1809 TM1804 TM1803 UCS1903 UCS1903B UCS1904 UCS2903 WS2812 WS2852
|
||||
// S2812B SK6812 SK6822 APA106 PL9823 WS2811 WS2813 APA104 WS2811_40 GW6205 GW6205_40 LPD1886 LPD1886_8BIT
|
||||
// 4 wire (spi): LPD8806 WS2801 WS2803 SM16716 P9813 APA102 SK9822 DOTSTAR
|
||||
|
||||
// For 3 wire led stripes line Neopixel/Ws2812, which have a data line, ground, and power, you just need to define DATA_PIN.
|
||||
// For led chipsets that are SPI based (four wires - data, clock, ground, and power), both defines DATA_PIN and CLOCK_PIN are needed
|
||||
|
||||
// DATA_PIN, or DATA_PIN, CLOCK_PIN
|
||||
#define LED_PINS MOSI // 3 wire leds
|
||||
//#define LED_PINS MOSI, SCK // 4 wire leds
|
||||
|
||||
#define COLOR_ORDER GRB // colororder of the stripe, set RGB in hyperion
|
||||
|
||||
#define OFF_TIMEOUT 15000 // ms to switch off after no data was received, set 0 to deactivate
|
||||
|
||||
// analog rgb uni color led stripe - using of hyperion smoothing is recommended
|
||||
#define ANALOG_MODE ANALOG_MODE_LAST_LED // use ANALOG_MODE_AVERAGE or ANALOG_MODE_LAST_LED
|
||||
|
||||
|
||||
// overall color adjustments
|
||||
#define ANALOG_BRIGHTNESS_RED 255 // maximum brightness for analog 0-255
|
||||
#define ANALOG_BRIGHTNESS_GREEN 255 // maximum brightness for analog 0-255
|
||||
#define ANALOG_BRIGHTNESS_BLUE 255 // maximum brightness for analog 0-255
|
||||
|
||||
#define BRIGHTNESS 128 // maximum brightness 0-255
|
||||
#define DITHER_MODE BINARY_DITHER // BINARY_DITHER or DISABLE_DITHER
|
||||
#define COLOR_TEMPERATURE CRGB(255,255,255) // RGB value describing the color temperature
|
||||
#define COLOR_CORRECTION TypicalLEDStrip // predefined fastled color correction
|
||||
//#define COLOR_CORRECTION CRGB(255,255,255) // or RGB value describing the color correction
|
||||
|
||||
|
||||
// Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)
|
||||
#define serialRate 115200 // use 115200 for ftdi based boards
|
||||
//#define serialRate 460800 // use 115200 for ftdi based boards
|
||||
|
||||
// ATTENTION this pin config is default for atmega328 based arduinos, others might work to
|
||||
// if you have flickering analog leds this might be caused by unsynced pwm signals
|
||||
// try other pins is more or less the only thing that helps
|
||||
|
||||
#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
|
||||
// 2 3 4 5 6 7 8 9 10 11 12 13 44 45 46
|
||||
// R B G R B G R B G R B G R B G
|
||||
#define ANALOG_PINS_MAX 15
|
||||
#define ANALOG_RGB_STRIPES 4
|
||||
const byte ANALOG_PINS[ANALOG_PINS_MAX] = {2,4,3,5,7,6,8,10,9,11,13,12,44,46,45};
|
||||
#else
|
||||
// 9 10 11
|
||||
// R B G
|
||||
#define ANALOG_PINS_MAX 3
|
||||
#define ANALOG_RGB_STRIPES 1
|
||||
const byte ANALOG_PINS[ANALOG_PINS_MAX] = {9,11,10};
|
||||
#endif
|
||||
|
||||
/**************************************
|
||||
A D A L I G H T C O D E
|
||||
|
||||
no user changes needed
|
||||
**************************************/
|
||||
|
||||
// Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data
|
||||
uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;
|
||||
|
||||
unsigned long endTime;
|
||||
|
||||
// Define the array of leds
|
||||
CRGB leds[NUM_LEDS];
|
||||
|
||||
// set rgb to analog led stripe
|
||||
void showAnalogRGB(const CRGB& led, const short stripeId=-1) {
|
||||
if (ANALOG_RGB_STRIPES > 0) {
|
||||
byte r = map(led.r, 0,255,0,ANALOG_BRIGHTNESS_RED);
|
||||
byte g = map(led.g, 0,255,0,ANALOG_BRIGHTNESS_GREEN);
|
||||
byte b = map(led.b, 0,255,0,ANALOG_BRIGHTNESS_BLUE);
|
||||
if (stripeId<0) {
|
||||
for (byte i=0;i<ANALOG_RGB_STRIPES;i++) {
|
||||
analogWrite(ANALOG_PINS[3*i+1], r);
|
||||
analogWrite(ANALOG_PINS[3*i] , g);
|
||||
analogWrite(ANALOG_PINS[3*i+2], b);
|
||||
}
|
||||
} else {
|
||||
analogWrite(ANALOG_PINS[stripeId*3] , g);
|
||||
analogWrite(ANALOG_PINS[stripeId*3+1], r);
|
||||
analogWrite(ANALOG_PINS[stripeId*3+2], b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// set color to all leds
|
||||
void showColor(const CRGB& led) {
|
||||
#if NUM_LEDS > ANALOG_RGB_STRIPES
|
||||
LEDS.showColor(led);
|
||||
#endif
|
||||
showAnalogRGB(led);
|
||||
}
|
||||
|
||||
|
||||
// function to check if serial data is available
|
||||
// if timeout occured leds switch of, if configured
|
||||
bool checkIncommingData() {
|
||||
boolean dataAvailable = true;
|
||||
while (!Serial.available()) {
|
||||
if ( OFF_TIMEOUT > 0 && endTime < millis()) {
|
||||
showColor(CRGB(0,0,0)); // leds off
|
||||
dataAvailable = false;
|
||||
endTime = millis() + OFF_TIMEOUT;
|
||||
}
|
||||
}
|
||||
|
||||
return dataAvailable;
|
||||
}
|
||||
|
||||
// main function that setups and runs the code
|
||||
void setup() {
|
||||
|
||||
// analog output
|
||||
if (ANALOG_RGB_STRIPES > 0) {
|
||||
for (byte i=0;i<ANALOG_PINS_MAX;i++) {
|
||||
pinMode(ANALOG_PINS[i], OUTPUT);
|
||||
}
|
||||
}
|
||||
|
||||
// Uncomment/edit one of the following lines for your leds arrangement.
|
||||
int ledCount = NUM_LEDS;
|
||||
if (ANALOG_MODE == ANALOG_MODE_LAST_LED) {
|
||||
ledCount -= ANALOG_RGB_STRIPES;
|
||||
}
|
||||
|
||||
#if NUM_LEDS > ANALOG_RGB_STRIPES
|
||||
FastLED.addLeds<LED_TYPE, LED_PINS, COLOR_ORDER>(leds, ledCount);
|
||||
#endif
|
||||
|
||||
// color adjustments
|
||||
FastLED.setBrightness ( BRIGHTNESS );
|
||||
FastLED.setTemperature( COLOR_TEMPERATURE );
|
||||
FastLED.setCorrection ( COLOR_CORRECTION );
|
||||
FastLED.setDither ( DITHER_MODE );
|
||||
|
||||
// initial RGB flash
|
||||
showColor(CRGB(255, 0, 0)); delay(400);
|
||||
showColor(CRGB(0, 255, 0)); delay(400);
|
||||
showColor(CRGB(0, 0, 255)); delay(400);
|
||||
showColor(CRGB(0, 0, 0));
|
||||
|
||||
Serial.begin(serialRate);
|
||||
while (!Serial) {
|
||||
; // wait for serial port to connect. Needed for native USB
|
||||
}
|
||||
Serial.print("Ada\n"); // Send "Magic Word" string to host
|
||||
|
||||
boolean transmissionSuccess;
|
||||
unsigned long sum_r, sum_g, sum_b;
|
||||
|
||||
// loop() is avoided as even that small bit of function overhead
|
||||
// has a measurable impact on this code's overall throughput.
|
||||
while (true) {
|
||||
// wait for first byte of Magic Word
|
||||
for (i = 0; i < sizeof prefix; ++i) {
|
||||
// If next byte is not in Magic Word, the start over
|
||||
if (!checkIncommingData() || prefix[i] != Serial.read()) {
|
||||
i = 0;
|
||||
}
|
||||
}
|
||||
// Hi, Lo, Checksum
|
||||
if (!checkIncommingData()) continue;
|
||||
hi = Serial.read();
|
||||
if (!checkIncommingData()) continue;
|
||||
lo = Serial.read();
|
||||
if (!checkIncommingData()) continue;
|
||||
chk = Serial.read();
|
||||
|
||||
// if checksum does not match go back to wait
|
||||
if (chk != (hi ^ lo ^ 0x55)) continue;
|
||||
|
||||
memset(leds, 0, NUM_LEDS * sizeof(struct CRGB));
|
||||
transmissionSuccess = true;
|
||||
sum_r = 0;
|
||||
sum_g = 0;
|
||||
sum_b = 0;
|
||||
|
||||
// read the transmission data and set LED values
|
||||
for (uint8_t idx = 0; idx < NUM_LEDS; idx++) {
|
||||
byte r, g, b;
|
||||
if (!checkIncommingData()) {
|
||||
transmissionSuccess = false;
|
||||
break;
|
||||
}
|
||||
r = Serial.read();
|
||||
if (!checkIncommingData()) {
|
||||
transmissionSuccess = false;
|
||||
break;
|
||||
}
|
||||
g = Serial.read();
|
||||
if (!checkIncommingData()) {
|
||||
transmissionSuccess = false;
|
||||
break;
|
||||
}
|
||||
b = Serial.read();
|
||||
leds[idx].r = r;
|
||||
leds[idx].g = g;
|
||||
leds[idx].b = b;
|
||||
#if ANALOG_OUTPUT_ENABLED == true && ANALOG_MODE == ANALOG_MODE_AVERAGE
|
||||
sum_r += r;
|
||||
sum_g += g;
|
||||
sum_b += b;
|
||||
#endif
|
||||
}
|
||||
|
||||
// shows new values
|
||||
if (transmissionSuccess) {
|
||||
endTime = millis() + OFF_TIMEOUT;
|
||||
#if NUM_LEDS > ANALOG_RGB_STRIPES
|
||||
FastLED.show();
|
||||
#endif
|
||||
|
||||
#if ANALOG_RGB_STRIPES > 0
|
||||
#if ANALOG_MODE == ANALOG_MODE_LAST_LED
|
||||
for ( byte x=1; x<=ANALOG_RGB_STRIPES; x++) {
|
||||
showAnalogRGB(leds[NUM_LEDS-x], x-1);
|
||||
}
|
||||
#else
|
||||
showAnalogRGB(CRGB(sum_r/NUM_LEDS, sum_g/NUM_LEDS, sum_b/NUM_LEDS));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
} // end of setup
|
||||
|
||||
|
||||
void loop() {
|
||||
// Not used. See note in setup() function.
|
||||
}
|
||||
|
BIN
assets/webconfig/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 33 KiB |
@ -4,16 +4,22 @@
|
||||
<div class="col-lg-6">
|
||||
<div id="about_cont"></div>
|
||||
</div>
|
||||
<div id="danger_act"class="col-lg-6" style="display:none">
|
||||
<h4>You found a hidden service menu!</h4>
|
||||
<button id="reset_cache" class="btn btn-danger">Reset Browser Cache</button>
|
||||
<button id="hyp_restart" class="btn btn-danger">Force Hyperion Restart</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
performTranslation();
|
||||
|
||||
var si = serverInfo.info.hyperion[0];
|
||||
|
||||
var si = sysInfo.hyperion;
|
||||
var libs = {"Bootstrap 3" : "http://getbootstrap.com/", "JQuery" : "https://jquery.com/", "Bootstrap Colorpicker" : "https://itsjavi.com/bootstrap-colorpicker/", "JSON-Editor" : "http://jeremydorn.com/json-editor/", "jQuery.i18n" : "https://github.com/wikimedia/jquery.i18n", "metisMenu" : "http://mm.onokumus.com/index.html", "download.js" : "http://danml.com/download.html", "gijgo" : "http://gijgo.com/"};
|
||||
var libh = "";
|
||||
var lang = [];
|
||||
var dcount = 0;
|
||||
|
||||
for(var i = 0; i<availLang.length; i++)
|
||||
lang.push($.i18n('general_speech_'+availLang[i]));
|
||||
@ -21,14 +27,26 @@
|
||||
libh += '<a href="'+libs[key]+'" target="_blank">'+key+'</a>, ';
|
||||
libh += "<br/>"+$.i18n("about_credits");
|
||||
|
||||
lang = lang.toString().replace(",",", ");
|
||||
lang = lang.toString().replace(/,/g,", ");
|
||||
|
||||
var fc = [$.i18n("about_version"),$.i18n("about_build"),$.i18n("about_builddate"),$.i18n("about_translations"),$.i18n("about_resources", $.i18n("general_webui_title"))];
|
||||
var sc = [currentVersion,si.build,si.time,'('+availLang.length+')<p>'+lang+'</p><p><a href="#" target="_blank">'+$.i18n("about_contribute")+'</a></p>',libh];
|
||||
|
||||
var fc = ['<span id="danger_trig">'+$.i18n("about_version")+'<span>',$.i18n("about_build"),$.i18n("about_builddate"),$.i18n("about_translations"),$.i18n("about_resources", $.i18n("general_webui_title"))];
|
||||
var sc = [currentVersion,si.build,si.time,'('+availLang.length+')<p>'+lang+'</p><p><a href="https://hyperion-project.org/contribute/?pk_campaign=WebUI&pk_kwd=about_contribute" target="_blank">'+$.i18n("about_contribute")+'</a></p>',libh];
|
||||
|
||||
createTable("","atb","about_cont");
|
||||
for(var i = 0; i<fc.length; i++)
|
||||
$('.atb').append(createTableRow([fc[i],sc[i]], "atb", false, true));
|
||||
|
||||
$('#danger_trig').off().on('click',function(){
|
||||
dcount++;
|
||||
if(dcount > 2)
|
||||
$('#danger_act').toggle(true);
|
||||
});
|
||||
|
||||
$('#reset_cache').off().on('click',function(){
|
||||
localStorage.clear();
|
||||
});
|
||||
|
||||
$('#hyp_restart').off().on('click',function(){
|
||||
initRestart();
|
||||
});
|
||||
</script>
|
@ -18,6 +18,7 @@
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="btn_wiz_holder"></div>
|
||||
<div id="ledDeviceOptions"> <div id='editor_container'></div> </div>
|
||||
</div>
|
||||
<div class="panel-footer" style="text-align:right">
|
||||
@ -267,8 +268,8 @@
|
||||
</div>
|
||||
<div id="collapse4" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<p data-i18n="conf_leds_layout_textf1">This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.</p>
|
||||
<textarea rows="25" id="ledconfig" class="form-control"></textarea>
|
||||
<p id="leds_wl" data-i18n="conf_leds_layout_textf1">This textfield shows by default your current loaded layout and will be overwritten if you generate a new one above. Optional you could perform further edits.</p>
|
||||
<div id="aceedit" style="width:100%;height:500px"></div>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button type="button" class="btn btn-warning" id="leds_custom_updsim"><i class="fa fa-search fa-fw"></i><span data-i18n="conf_leds_layout_button_updsim">Update preview</span></button>
|
||||
@ -286,6 +287,7 @@
|
||||
<div class="panel-body">
|
||||
<p id="previewcreator" style="font-weight:bold"></p>
|
||||
<p id="previewledcount" style="font-weight:bold"></p>
|
||||
<p id="previewledpower" style="font-weight:bold"></p>
|
||||
<div id="led_vis_help"></div>
|
||||
<div class="col-lg-12 st_helper" style="padding-left:0px; padding-right:0px">
|
||||
<div id="leds_preview"></div>
|
||||
|
@ -6,6 +6,12 @@
|
||||
<div class="row" id='conf_cont'></div>
|
||||
<hr />
|
||||
<div id="log_content"><span style="font-weight:bold;font-size:17px" data-i18n="conf_logging_nomessage"></span></div>
|
||||
<hr>
|
||||
<h4 style="font-weight:bold"><i class="fa fa-reorder fa-fw"></i><span data-i18n="conf_logging_report">Bericht</span></h4>
|
||||
<button class="btn btn-primary" id="btn_logupload"><i class="fa fa-upload fa-fw"></i><span data-i18n="conf_logging_btn_pbupload"></span></button>
|
||||
<div id="log_upl_pol"></div>
|
||||
<div id="upl_link" style="margin-top:10px;font-weight:bold;"></div>
|
||||
<div id="prev_reports"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,22 +1,22 @@
|
||||
|
||||
<div class="container" style="margin:20px auto;max-width:600px;">
|
||||
<center>
|
||||
<img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!">
|
||||
<div>
|
||||
<h2 data-i18n="info_conlost_label_title">Lost connection to Hyperion service!</h2>
|
||||
<hr>
|
||||
<h4 data-i18n="info_conlost_label_reason">Possible reasons:</h4>
|
||||
<p data-i18n="info_conlost_label_reason1">- Hyperion restarts</p>
|
||||
<p data-i18n="info_conlost_label_reason2">- You perform an update</p>
|
||||
<p data-i18n="info_conlost_label_reason3">- Hyperion isn't running</p>
|
||||
<hr>
|
||||
<i class="fa fa-refresh fa-spin" style="font-size:50px"></i>
|
||||
<h4 data-i18n="info_conlost_label_autorefresh">This page will be automatically refreshed.</h4>
|
||||
<h4 data-i18n="info_conlost_label_autorecon">We reconnect again after Hyperion is available.</h4>
|
||||
<a href="/" data-i18n="info_conlost_label_reload">If not, click me or reload the page</a>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
<div class="container" style="margin:20px auto;max-width:600px;">
|
||||
<center>
|
||||
<img src="img/hyperion/hyperionlostconnection.png" alt="Redefine ambient light!">
|
||||
<div>
|
||||
<h2 data-i18n="info_conlost_label_title">Lost connection to Hyperion service!</h2>
|
||||
<hr>
|
||||
<h4 data-i18n="info_conlost_label_reason">Possible reasons:</h4>
|
||||
<p data-i18n="info_conlost_label_reason1">- Hyperion restarts</p>
|
||||
<p data-i18n="info_conlost_label_reason2">- You perform an update</p>
|
||||
<p data-i18n="info_conlost_label_reason3">- Hyperion isn't running</p>
|
||||
<hr>
|
||||
<i class="fa fa-refresh fa-spin reconstop" style="font-size:50px"></i>
|
||||
<h4 class="reconstop" data-i18n="info_conlost_label_autorefresh">This page will be automatically refreshed.</h4>
|
||||
<h4 class="reconstop" data-i18n="info_conlost_label_autorecon">We reconnect again after Hyperion is available.</h4>
|
||||
<span id="counter" class="reconstop"></span>
|
||||
<a class="reconstop" style="display:none" href="/" data-i18n="info_conlost_label_reload"></a>
|
||||
</div>
|
||||
</center>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ************************************ -->
|
||||
@ -25,19 +25,36 @@
|
||||
performTranslation();
|
||||
var connectionLost = false;
|
||||
var connectionTimer;
|
||||
var count = 1;
|
||||
|
||||
function tryReconnect()
|
||||
{
|
||||
if(count > 100)
|
||||
{
|
||||
window.clearInterval(connectionTimer);
|
||||
$('.reconstop').toggle();
|
||||
}
|
||||
|
||||
$('#counter').html(count+'/100');
|
||||
|
||||
$.ajax({ url: "/" }).done(function(data) {
|
||||
window.clearInterval(connectionTimer);
|
||||
window.location.href ="/";
|
||||
})
|
||||
.fail( function( jqXHR, textStatus ) {
|
||||
count++;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function connectionLostAction()
|
||||
{
|
||||
connectionLost = true;
|
||||
connectionTimer = window.setInterval(tryReconnect, 4000);
|
||||
if(!connectionLost)
|
||||
{
|
||||
window.clearInterval(cronId);
|
||||
connectionLost = true;
|
||||
connectionTimer = window.setInterval(tryReconnect, 4000);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -14,24 +14,39 @@
|
||||
<table class="table borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td>
|
||||
<td id="currentversion">unknown</td>
|
||||
<td data-i18n="dashboard_infobox_label_statush"></td>
|
||||
<td id="dash_statush" style="font-weight:bold">unknown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
|
||||
<td id="latestversion">unknown</td>
|
||||
<td data-i18n="dashboard_infobox_label_platform">Platform:</td>
|
||||
<td id="dash_platform"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-i18n="conf_leds_contr_label_contrtype">LED type:</td>
|
||||
<td id="dash_leddevice">unknown</td>
|
||||
<td id="dash_leddevice"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-i18n="dashboard_infobox_label_device">Device:</td>
|
||||
<td id="dash_systeminfo"></td>
|
||||
<td data-i18n="dashboard_infobox_label_instance">Instance</td>
|
||||
<td id="dash_instance"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-i18n="dashboard_infobox_label_ports">Ports</td>
|
||||
<td id="dash_ports"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-i18n="dashboard_infobox_label_currenthyp">Hyperion version:</td>
|
||||
<td id="dash_currv">unknown</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td data-i18n="dashboard_infobox_label_latesthyp">Latest version:</td>
|
||||
<td id="dash_latev">unknown</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<p style="font-weight:bold" data-i18n="dashboard_infobox_label_smartacc">Smart Access<p>
|
||||
<span id="btn_hsc"></span>
|
||||
<hr>
|
||||
<span id="versioninforesult"></span>
|
||||
</div>
|
||||
</div>
|
||||
@ -60,10 +75,11 @@
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<i class="fa fa-newspaper-o fa-fw"></i>
|
||||
<span data-i18n="dashboard_newsbox_label_title">Latest blog posts</span>
|
||||
<span data-i18n="dashboard_newsbox_label_title">Visit Hyperion Blog</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div id="dash_news" style="margin-bottom:7px"></div>
|
||||
<a href="https://hyperion-project.org/blog/?pk_campaign=WebUI&pk_kwd=visitblog" target="_blank" data-i18n="dashboard_newsbox_visitblog"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
11
assets/webconfig/content/ie_not_supported.html
Normal file
@ -0,0 +1,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Hyperion WebUI - IE not supported</title>
|
||||
<meta content="">
|
||||
<style> body {margin:auto; padding:2%; text-align:center; font-family:arial;}</style>
|
||||
</head>
|
||||
<body>
|
||||
<img src="../img/hyperion/hyperionlogo.png" alt="Redefine ambient light!" style="margin-bottom:20px;">
|
||||
<h2><span style="color:red">We are sorry, Internet Explorer is not supported!</span><br /><br /> Please use recent versions of Firefox, Chrome, Safari or MS Edge.</h2>
|
||||
</body>
|
||||
</html>
|
@ -1,16 +1,7 @@
|
||||
<div class="container-fluid">
|
||||
<h3 class="page-header"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></h3>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<h3 class="page-header"><i class="fa fa-wifi fa-fw"></i><span data-i18n="main_menu_remotecontrol_token">Remote Control</span></h3>
|
||||
<div class="row">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-8 col-xxl-7">
|
||||
<div class="col-md-12 col-lg-8 col-xxl-7">
|
||||
<div class="panel panel-default" >
|
||||
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_input_label">Source selection</span></div>
|
||||
<div class="panel-body">
|
||||
@ -20,7 +11,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-xxl-5">
|
||||
<div class="col-md-6 col-lg-4 col-xxl-5">
|
||||
<div class="panel panel-default" >
|
||||
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_components_label">Components control</span></div>
|
||||
<div class="panel-body" id="comp_intro">
|
||||
@ -28,35 +19,48 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-xxl-4">
|
||||
<div class="col-md-6 col-lg-6 col-xxl-4">
|
||||
<div class="panel panel-default" >
|
||||
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_color_label">Colors/Effects</span></div>
|
||||
<div class="panel-body" id="color_intro">
|
||||
<table class="table borderless">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align:middle"><label data-i18n="remote_color_label_color"></label></td>
|
||||
<td><div id="cp2" class="colorpicker-component input-group">
|
||||
<input type="text" class="form-control"/><span class="input-group-addon"><i></i></span>
|
||||
<td style="vertical-align:middle"><label for="cpeff" data-i18n="remote_color_label_color"></label></td>
|
||||
<td>
|
||||
<div id="cp2" class="colorpicker-component input-group">
|
||||
<input type="text" id="cpeff" class="form-control"/>
|
||||
<span class="input-group-addon"><i></i></span>
|
||||
<span class="input-group-addon" id="remote_input_rescol" title="Repeat Color" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:middle"><label data-i18n="remote_effects_label_effects">Effect:</label></td>
|
||||
<td><select id="effect_select" class="form-control"></select></td>
|
||||
<td style="vertical-align:middle"><label for="effect_select" data-i18n="remote_effects_label_effects">Effect:</label></td>
|
||||
<td class="input-group">
|
||||
<select id="effect_select" class="form-control"></select>
|
||||
<span class="input-group-addon" id="remote_input_reseff" title="Repeat Effect" style="cursor:pointer"><i class="fa fa-repeat"></i></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="display:none">
|
||||
<td style="vertical-align:middle"><label for="remote_input_img" >Picture:</label></td>
|
||||
<td><input id="remote_input_img" type="file" accept="image/*" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="vertical-align:middle"><label for="remote_duration" data-i18n="remote_input_duration"></label></td>
|
||||
<td class="input-group">
|
||||
<input id="remote_duration" type="number" class="form-control" value="0" min="0"/>
|
||||
<span class="input-group-addon" data-i18n="edt_append_s"></span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<button data-i18n="remote_color_button_reset" type="button" class="btn btn-warning" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
|
||||
<button data-i18n="remote_color_button_reset" type="button" class="btn btn-primary" id="reset_color" style="margin-top:10px;">Reset Color/Effect</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-xxl-3">
|
||||
<div class="col-md-6 col-lg-6 col-xxl-3">
|
||||
<div class="panel panel-default" >
|
||||
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_maptype_label">Mapping types</span></div>
|
||||
<div class="panel-body" id="maptype_intro">
|
||||
@ -64,7 +68,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-xxl-5">
|
||||
<div class="col-md-6 col-lg-6 col-xxl-5">
|
||||
<div class="panel panel-default" >
|
||||
<div class="panel-heading"><i class="fa fa-wifi fa-fw"></i><span data-i18n="remote_adjustment_label"></span></div>
|
||||
<div class="panel-body" id="adjust_content">
|
||||
@ -73,5 +77,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/js/content_remote.js" ></script>
|
||||
|
@ -17,19 +17,30 @@
|
||||
performTranslation();
|
||||
var connectionLost = false;
|
||||
var connectionTimer;
|
||||
var count = 1;
|
||||
|
||||
function tryReconnect()
|
||||
{
|
||||
if(count > 25)
|
||||
window.clearInterval(connectionTimer);
|
||||
|
||||
$.ajax({ url: "/" }).done(function(data) {
|
||||
window.clearInterval(connectionTimer);
|
||||
window.location.href ="/";
|
||||
})
|
||||
.fail( function( jqXHR, textStatus ) {
|
||||
count++;
|
||||
});
|
||||
}
|
||||
|
||||
function restartAction()
|
||||
{
|
||||
connectionLost = true;
|
||||
connectionTimer = window.setInterval(tryReconnect, 1000);
|
||||
if(!connectionLost)
|
||||
{
|
||||
window.clearInterval(cronId);
|
||||
connectionLost = true;
|
||||
connectionTimer = window.setInterval(tryReconnect, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -4,14 +4,14 @@
|
||||
<h3 class="page-header"><i class="fa fa-info fa-fw"></i><span data-i18n="support_label_title">Support Hyperion</span></h3>
|
||||
<div id="supp_intro"></div>
|
||||
<h4 style="font-weight: bold" data-i18n="support_label_spreadtheword">Spread the word</h4>
|
||||
<a href="#" target="_blank" class="unlink">
|
||||
<a href="https://www.facebook.com/Hyperion-1415088231896140/" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-facebook bg-color-fb"></i>
|
||||
<h4>Facebook</h4>
|
||||
<p data-i18n="support_label_fbtext">Share our Hyperion Facebook page and get a notice when new updates are released</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="#" target="_blank" class="unlink">
|
||||
<a href="https://twitter.com/HyperionAmbient" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-twitter bg-color-tw"></i>
|
||||
<h4>Twitter</h4>
|
||||
@ -32,6 +32,13 @@
|
||||
<p data-i18n="support_label_yttext">Bored from pictures? Checkout our Youtube channel!</p>
|
||||
</div>
|
||||
</a>
|
||||
<a href="https://www.instagram.com/hyperionambient/" target="_blank" class="unlink">
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-instagram bg-color-ig"></i>
|
||||
<h4>Instagram</h4>
|
||||
<p data-i18n="support_label_igtext"></p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<hr>
|
||||
@ -65,19 +72,18 @@
|
||||
<li><a href="http://rover.ebay.com/rover/1/1185-53479-19255-0/1?pub=5575174930&toolid=10001&campid=1185-53479-19255-0&customid=&mpt=1016300&mpre=http%3A%2F%2Fwww.ebay.es" target="_blank" data-i18n="general_country_es">Spain</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<a href="https://www.paypal.me/hyperionproject/10" target="_blank" class="unlink">
|
||||
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-paypal bg-color-pp"></i>
|
||||
<h4>Paypal</h4>
|
||||
<p data-i18n="support_label_donationpp">Donation:</p><a href="https://www.paypal.me/hyperionproject/10" target="_blank">Paypal</a>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="col-xs-12 col-sm-6 col-lg-3 support-container">
|
||||
<i class="fa fa-btc bg-color-btc"></i>
|
||||
<h4>Bitcoin</h4>
|
||||
<p data-i18n="support_label_btctext">Address:</p>
|
||||
<p>1GGZbsT6fH3cGq25H5HS2PfisPfDnffSJR</p>
|
||||
<p style="word-break: break-all;">1GGZbsT6fH3cGq25H5HS2PfisPfDnffSJR</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -118,7 +124,5 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
performTranslation();
|
||||
|
||||
if(showOptHelp)
|
||||
createHintH("intro", $.i18n('support_label_intro'), "supp_intro");
|
||||
createHintH("intro", $.i18n('support_label_intro'), "supp_intro");
|
||||
</script>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Bootstrap Colorpicker v2.4.0
|
||||
* Bootstrap Colorpicker v2.5.1
|
||||
* https://itsjavi.com/bootstrap-colorpicker/
|
||||
*
|
||||
* Originally written by (c) 2012 Stefan Petre
|
||||
|
6757
assets/webconfig/css/bootstrap.css
vendored
14
assets/webconfig/css/bootstrap.min.css
vendored
Normal file
1
assets/webconfig/css/flag-icon.min.css
vendored
@ -9,7 +9,24 @@ body{font-family:Roboto,"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:15
|
||||
#page-content {
|
||||
padding-bottom:50px;
|
||||
}
|
||||
body{
|
||||
overflow-y: scroll;
|
||||
}
|
||||
.btn{margin: 2px 0;}
|
||||
/*
|
||||
#page-wrapper a[target=_blank]::after {
|
||||
content:"\f08e";
|
||||
position:relative;
|
||||
font:normal normal normal 10px/1 FontAwesome;
|
||||
top:-3px;
|
||||
left:3px;
|
||||
margin-right:5px;
|
||||
}
|
||||
*/
|
||||
/* fixed brand icon */
|
||||
@media (min-width: 768px){
|
||||
.navbar-brand{position:fixed}
|
||||
}
|
||||
|
||||
/*mobile nav*/
|
||||
@media (max-width: 768px){
|
||||
@ -85,6 +102,7 @@ table label{margin:0}
|
||||
/*Dashboard*/
|
||||
.component-on{color:green;}
|
||||
.component-off{color:grey;}
|
||||
#dash_news hr{margin:10px 0}
|
||||
|
||||
/*Colorpicker 2x*/
|
||||
.colorpicker-2x {z-index:99999}
|
||||
@ -119,6 +137,7 @@ table label{margin:0}
|
||||
.support-container:hover .bg-color-btc{background-color:#f7931a; color:white;}
|
||||
.support-container:hover .bg-color-pp{background-color:#0070ba; color:white;}
|
||||
.support-container:hover .bg-color-am{background-color:#ef9c00; color:white;}
|
||||
.support-container:hover .bg-color-ig{background-color:#ab3392; color:white;}
|
||||
|
||||
/*Config introduction*/
|
||||
.introd h4{padding-left:14px;border-left:5px solid #0088cc;}
|
||||
@ -130,6 +149,23 @@ table label{margin:0}
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
/*wizard button*/
|
||||
.btn-wizard {
|
||||
color: #fff;
|
||||
background-color: #993399;
|
||||
border-color: #732673;
|
||||
}
|
||||
.btn-wizard:hover{
|
||||
color: #fff;
|
||||
background-color: #732673;
|
||||
border-color: #602060;
|
||||
}
|
||||
.btn-wizard:focus{
|
||||
color: #fff;
|
||||
background-color: #732673;
|
||||
border-color: #602060;
|
||||
}
|
||||
|
||||
/*led preview & led visualisation*/
|
||||
#leds_canvas {background-color:#AAAAAA; position:absolute; margin:15px; background-image:url(/img/hyperion/hyperionlogo.png); background-repeat:no-repeat; background-position: center;}
|
||||
.led { display:inline-block; border: 1px solid black; position:absolute; opacity:0.8; text-align:center; vertical-align:middle; padding:4px; border-radius:2px;}
|
||||
@ -219,6 +255,70 @@ li a:active:after {
|
||||
transition: 0s;
|
||||
}
|
||||
|
||||
/*Bootstrap callouts*/
|
||||
.bs-callout {
|
||||
padding: 15px;
|
||||
margin: 15px 0;
|
||||
border: 1px solid #eee;
|
||||
border-left-width: 5px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
.bs-callout h4 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.bs-callout p:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.bs-callout code {
|
||||
border-radius: 3px;
|
||||
}
|
||||
.bs-callout+.bs-callout {
|
||||
margin-top: -5px;
|
||||
}
|
||||
.bs-callout-default {
|
||||
border-left-color: #777;
|
||||
}
|
||||
.bs-callout-default h4 {
|
||||
color: #777;
|
||||
}
|
||||
.bs-callout-primary {
|
||||
border-left-color: #428bca;
|
||||
}
|
||||
.bs-callout-primary h4 {
|
||||
color: #428bca;
|
||||
}
|
||||
.bs-callout-success {
|
||||
border-left-color: #5cb85c;
|
||||
}
|
||||
.bs-callout-success h4 {
|
||||
color: #5cb85c;
|
||||
}
|
||||
.bs-callout-danger {
|
||||
border-left-color: #d9534f;
|
||||
}
|
||||
.bs-callout-danger h4 {
|
||||
color: #d9534f;
|
||||
}
|
||||
.bs-callout-warning {
|
||||
border-left-color: #f0ad4e;
|
||||
}
|
||||
.bs-callout-warning h4 {
|
||||
color: #f0ad4e;
|
||||
}
|
||||
.bs-callout-info {
|
||||
border-left-color: #5bc0de;
|
||||
}
|
||||
.bs-callout-info h4 {
|
||||
color: #5bc0de;
|
||||
}
|
||||
.bs-callout-wizard {
|
||||
border-left-color: #993399;
|
||||
}
|
||||
.bs-callout-wizard h4 {
|
||||
color: #993399;
|
||||
}
|
||||
|
||||
/**add a dditional width defintion for bootstrap**/
|
||||
@media (min-width: 1500px) {
|
||||
.col-xxl-1, .col-xxl-2, .col-xxl-3, .col-xxl-4, .col-xxl-5, .col-xxl-6, .col-xxl-7, .col-xxl-8, .col-xxl-9, .col-xxl-10, .col-xxl-11, .col-xxl-12 {
|
||||
|
@ -1,68 +0,0 @@
|
||||
/**
|
||||
* jQuery Lined Textarea Plugin
|
||||
* http://alan.blog-city.com/jquerylinedtextarea.htm
|
||||
*
|
||||
* Copyright (c) 2010 Alan Williamson
|
||||
*
|
||||
* Released under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Usage:
|
||||
* Displays a line number count column to the left of the textarea
|
||||
*
|
||||
* Class up your textarea with a given class, or target it directly
|
||||
* with JQuery Selectors
|
||||
*
|
||||
* $(".lined").linedtextarea({
|
||||
* selectedLine: 10,
|
||||
* selectedClass: 'lineselect'
|
||||
* });
|
||||
*
|
||||
*/
|
||||
|
||||
.linedwrap {
|
||||
border: 1px solid #c0c0c0;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.linedtextarea {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.linedtextarea textarea, .linedwrap .codelines .lineno {
|
||||
font-size: 10pt;
|
||||
font-family: monospace;
|
||||
line-height: normal !important;
|
||||
}
|
||||
|
||||
.linedtextarea textarea {
|
||||
padding-right:0.3em;
|
||||
padding-top:0.3em;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.linedwrap .lines {
|
||||
margin-top: 0px;
|
||||
width: 50px;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
border-right: 1px solid #c0c0c0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.linedwrap .codelines {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
.linedwrap .codelines .lineno {
|
||||
color:#AAAAAA;
|
||||
padding-right: 0.5em;
|
||||
padding-top: 0.0em;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.linedwrap .codelines .lineselect {
|
||||
color: red;
|
||||
}
|
1
assets/webconfig/css/jsonaceeditor.min.css
vendored
Normal file
Before Width: | Height: | Size: 1.1 KiB |
BIN
assets/webconfig/favicon.png
Normal file
After Width: | Height: | Size: 5.0 KiB |
@ -1,7 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="512" width="512" version="1">
|
||||
<g fill-rule="evenodd" stroke-width="1pt">
|
||||
<path fill="#fc0" d="M0 341.338h512.005v170.67H0z"/>
|
||||
<path d="M0 0h512.005v170.67H0z"/>
|
||||
<path fill="red" d="M0 170.67h512.005v170.668H0z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 289 B |
@ -1,15 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="512" width="512">
|
||||
<defs>
|
||||
<clipPath id="a">
|
||||
<path fill-opacity=".67" d="M250 0h500v500H250z"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g clip-path="url(#a)" transform="translate(-256) scale(1.024)">
|
||||
<g stroke-width="1pt">
|
||||
<path fill="#006" d="M0 0h1000.02v500.01H0z"/>
|
||||
<path d="M0 0v55.903l888.218 444.11h111.802V444.11L111.802.003H0zm1000.02 0v55.9L111.802 500.01H0v-55.9L888.218 0h111.802z" fill="#fff"/>
|
||||
<path d="M416.675 0v500.01h166.67V0h-166.67zM0 166.67v166.67h1000.02V166.67H0z" fill="#fff"/>
|
||||
<path d="M0 200.004v100.002h1000.02V200.004H0zM450.01 0v500.01h100V0h-100zM0 500.01l333.34-166.67h74.535L74.535 500.01H0zM0 0l333.34 166.67h-74.535L0 37.27V0zm592.145 166.67L925.485 0h74.535L666.68 166.67h-74.535zm407.875 333.34L666.68 333.34h74.535l258.805 129.403v37.267z" fill="#c00"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 889 B |
@ -1,7 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" version="1">
|
||||
<g fill-rule="evenodd" stroke-width="1pt">
|
||||
<path fill="#fc0" d="M0 320h640v160.002H0z"/>
|
||||
<path d="M0 0h640v160H0z"/>
|
||||
<path fill="red" d="M0 160h640v160H0z"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 264 B |
@ -1,15 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="480" width="640">
|
||||
<defs>
|
||||
<clipPath id="a">
|
||||
<path fill-opacity=".67" d="M-85.333 0h682.67v512h-682.67z"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
<g clip-path="url(#a)" transform="translate(80) scale(.94)">
|
||||
<g stroke-width="1pt">
|
||||
<path fill="#006" d="M-256 0H768.02v512.01H-256z"/>
|
||||
<path d="M-256 0v57.244l909.535 454.768H768.02V454.77L-141.515 0H-256zM768.02 0v57.243L-141.515 512.01H-256v-57.243L653.535 0H768.02z" fill="#fff"/>
|
||||
<path d="M170.675 0v512.01h170.67V0h-170.67zM-256 170.67v170.67H768.02V170.67H-256z" fill="#fff"/>
|
||||
<path d="M-256 204.804v102.402H768.02V204.804H-256zM204.81 0v512.01h102.4V0h-102.4zM-256 512.01L85.34 341.34h76.324l-341.34 170.67H-256zM-256 0L85.34 170.67H9.016L-256 38.164V0zm606.356 170.67L691.696 0h76.324L426.68 170.67h-76.324zM768.02 512.01L426.68 341.34h76.324L768.02 473.848v38.162z" fill="#c00"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 934 B |
@ -39,7 +39,6 @@
|
||||
"dashboard_infobox_label_title": "Información",
|
||||
"dashboard_infobox_label_currenthyp": "Tu versión de Hyperion:",
|
||||
"dashboard_infobox_label_latesthyp": "Última versión de Hyperion:",
|
||||
"dashboard_infobox_label_device": "Sistema:",
|
||||
"dashboard_infobox_message_updatewarning": "¡Una versión más nueva de Hyperion está disponible! (V$1)",
|
||||
"dashboard_infobox_message_updatesuccess": "Ejecutas la última versión de Hyperion.",
|
||||
"dashboard_componentbox_label_title": "Estado de los componentes",
|
||||
@ -94,10 +93,6 @@
|
||||
"conf_leds_optgroup_usb": "USB",
|
||||
"conf_leds_optgroup_debug": "Depurar",
|
||||
"conf_leds_layout_btn_checklist": "Mostrar lista",
|
||||
"conf_leds_leyout_checkp1": "El led negro es tu primer led, el primer led es el punto donde introduces tu señal de datos.",
|
||||
"conf_leds_leyout_checkp2": "La disposición es siempre la vista delantera de tu TV, nunca la visión posterior.",
|
||||
"conf_leds_leyout_checkp3": "Asegúrate de que la dirección es correcta. Los leds grises indican los led números 2 y 3 para visualizar la dirección de los datos.",
|
||||
"conf_leds_leyout_checkp4": "Caso Hueco: Para crear un hueco, ignóralo primero cuando definas Superior/Inferior/Izquieda/Derecha y ajusta después su longitud de hueco para eliminar una cantidad de leds. Modifica la posición del hueco hasta que coincida.",
|
||||
"conf_leds_layout_frame": "Disposición Clásica (Marco LED)",
|
||||
"conf_leds_layout_matrix": "Disposición de Matriz (Pared LED)",
|
||||
"conf_leds_layout_generatedconf": "Configuración LED Generada/Actual",
|
||||
@ -245,7 +240,6 @@
|
||||
"infoDialog_general_error_title": "Error",
|
||||
"infoDialog_general_warning_title": "Advertencia",
|
||||
"infoDialog_checklist_title": "¡Lista!",
|
||||
"InfoDialog_leds_validfail_title": "¡Validación JSON fallida!",
|
||||
"infoDialog_effconf_deleted_text": "¡El efecto \"$1\" ha sido eliminado con éxito!",
|
||||
"infoDialog_effconf_created_text": "¡El efecto \"$1\" ha sido creado con éxito!",
|
||||
"InfoDialog_lang_title": "Configuración de idioma",
|
||||
@ -287,11 +281,11 @@
|
||||
"wiz_cc_kodidisconlink": "Descarga enlaces de imagenes:",
|
||||
"wiz_cc_kodicon": "Servidor web Kodi encontrado, proceder con el soporte de Kodi.",
|
||||
"wiz_cc_kodimsg_start": "Prueba con éxito - ¡tiempo de continuar!",
|
||||
"wiz_cc_kodishould": "Kodi debería la siguiente imagen: $1",
|
||||
"wiz_cc_kodishould": "Kodi debería mostrar la siguiente imagen: $1",
|
||||
"wiz_cc_lettvshow": "Deja que tu TV muestre la siguiente imagen: $1",
|
||||
"wiz_cc_lettvshowm": "Comprueba esto con las siguientes imágenes: $1",
|
||||
"wiz_cc_adjustit": "Ajusta tu \"$1\", hasta que estés agusto con él. Ten en cuenta: Cuanto más lo ajustes fuera del valor predeterminado, el espectro de color será limitado (también para todos los colores intermedios). Dependiendo del espectro de color de TV/LED, los resultados variarán.",
|
||||
"wiz_cc_adjustgamma": "Gamma: What you have to do is, adjust gamma levels of each channel until you have the same perceived amount of each channel. For example, if your Grey is a bit reddish it means that you have to increase red gamma to reduce the amount of red (the more gamma, the less amount of color).",
|
||||
"wiz_cc_adjustgamma": "Gamma: Lo que tienes que hacer es ajustar los niveles gamma de cada canal hasta que tengas la misma cantidad percibida de cada canal. Por ejemplo, si su Gris es un poco rojizo, significa que tiene que aumentar el gamma rojo para reducir la cantidad de rojo (más gamma, menos cantidad de color).",
|
||||
"wiz_cc_chooseid": "Define un nombre para éste perfil.",
|
||||
"wiz_cc_btn_switchpic": "Cambiar imagen",
|
||||
"wiz_cc_backlight": "Adicionalmente podrías definir una retroiluminación para solucionar \"malos colores\" en áreas casi oscuras o si no te gusta el cambio entre color y apagado durante la observación. Adicionalmente se podría definir si debe haber algún color en ella o simplemente blanco. Esto se desactiva durante el estado \"Off\", \"Color\" y \"Efecto\".",
|
||||
@ -577,7 +571,6 @@
|
||||
"edt_eff_rotationtime_title": "Tiempo de rotación",
|
||||
"edt_eff_sleeptime_title": "Hora de dormir",
|
||||
"edt_eff_reversedirection_title": "Dirección inversa",
|
||||
"edt_eff_fadetime_title": "Tiempo de fundido",
|
||||
"edt_eff_colorstart_title": "Color de inicio",
|
||||
"edt_eff_colorend_title": "Color final",
|
||||
"edt_eff_colorshift_title": "Cambio de Color",
|
||||
@ -662,15 +655,44 @@
|
||||
"edt_msg_button_delete_row_title_short": "Eliminar",
|
||||
"edt_msg_button_collapse": "Colapsar",
|
||||
"edt_msg_button_expand": "Expandir",
|
||||
"@metadata": {
|
||||
"authors": [
|
||||
"brindosch"
|
||||
],
|
||||
"project": "WebUI Hyperion",
|
||||
"locale": "en",
|
||||
"last-updated": "2016-11-30",
|
||||
"message-documentation": "qqq.json"
|
||||
},
|
||||
"edt_conf_color_channelAdjustment_header_expl": "Ajustes para color, brillo, linealización y más.",
|
||||
"general_speech_es": "Español"
|
||||
"general_speech_es": "Español",
|
||||
"dashboard_infobox_label_platform": "Plataforma:",
|
||||
"dashboard_infobox_label_instance": "Instancia:",
|
||||
"dashboard_infobox_label_ports": "Puertos (json|proto):",
|
||||
"dashboard_newsbox_visitblog": "Visitar Hyperion-Blog",
|
||||
"dashboard_newsbox_noconn": "No se puede conectar al Servidor Hyperion para recuperar los últimos mensajes, ¿Funciona tu conexión a Internet?",
|
||||
"dashboard_newsbox_readmore": "Leer más",
|
||||
"conf_leds_layout_checkp1": "El led negro es tu primer led, el primer led es el punto donde introduces tu señal de datos.",
|
||||
"conf_leds_layout_checkp2": "La disposición es siempre la vista delantera de tu TV, nunca la visión posterior.",
|
||||
"conf_leds_layout_checkp3": "Asegúrate de que la dirección es correcta. Los leds grises indican los led número 2 y 3 para visualizar la dirección de los datos.",
|
||||
"conf_leds_layout_checkp4": "Hueco: Para crear un hueco, ignóralo primero cuando defina Superior/Inferior/Izquierda/Derecha y ajusta después la longitud del hueco para eliminar una cantidad de leds. Modifica la posición del hueco hasta que coincida.",
|
||||
"conf_leds_layout_preview_ledpower": "Consumo Máx. de energía: $1 A",
|
||||
"info_404": "¡La pagina que buscas no está disponible!",
|
||||
"edt_conf_fg_width_title": "Anchura",
|
||||
"edt_conf_fg_width_expl": "Encoge la imagen a este ancho, como imagen raw necesita un montón de tiempo de CPU.",
|
||||
"edt_conf_fg_height_title": "Altura",
|
||||
"edt_conf_fg_height_expl": "Reducir la imagen a esta altura, como material raw necesita un montón de tiempo de CPU.",
|
||||
"edt_conf_effp_paths_expl": "Puedes definir más carpetas que contengan efectos. El configurador de efectos siempre guardará en la primera carpeta.",
|
||||
"edt_conf_v4l2_signalDetection_title": "Habilitar detección de señal",
|
||||
"general_comp_LEDDEVICE": "Dispositivo LED",
|
||||
"conf_logging_lastreports": "Informes anteriores",
|
||||
"support_label_igtext": "¡Visítanos en Instagram para ver las últimas imágenes de Hyperion!",
|
||||
"edt_conf_v4l2_signalDetection_expl": "Si está habilitado, la captura USB estará temporaalmente deshabilitada cuando no se haya encontrado señal.",
|
||||
"general_btn_iswitch": "Cambiar",
|
||||
"dashboard_infobox_label_statush": "Estado de Hyperion:",
|
||||
"dashboard_infobox_label_smartacc": "Acceso Inteligente",
|
||||
"dashboard_infobox_label_enableh": "Habilitar Hyperion",
|
||||
"dashboard_infobox_label_disableh": "Deshabilitar Hyperion",
|
||||
"remote_input_clearall": "Borrar todos los Efectos/Colores",
|
||||
"InfoDialog_iswitch_title": "Conmutador Hyperion",
|
||||
"InfoDialog_iswitch_text": "Si ejecutas Hyperion más de una vez en tu red local, puedes cambiar entre las configuraciones web. ¡Selecciona la instancia de Hyperion a continuación y cambia!",
|
||||
"edt_eff_fadeintime_title": "Tiempo de fundido",
|
||||
"edt_eff_fadeouttime_title": "Tiempo para desvancer",
|
||||
"edt_eff_repeat_title": "Repetir",
|
||||
"edt_eff_colorendtime_title": "Tiempo para mantener el color de inicio",
|
||||
"edt_eff_colorstarttime_title": "Tiempo para mantener el color de fin",
|
||||
"edt_dev_spec_brightnessFactor_title": "Factor de brillo",
|
||||
"edt_conf_color_brightnessComp_title": "Compensación de brillo",
|
||||
"edt_conf_color_brightnessComp_expl": "Compensa las diferencias de brillo entre RGB, CMY y blanco. 100 significa compensación completa, 0 sin compensación"
|
||||
}
|
@ -2,54 +2,58 @@
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<script>
|
||||
if (/MSIE/.test(navigator.userAgent) || /Trident/.test(navigator.userAgent))
|
||||
{
|
||||
window.location.pathname = '/content/ie_not_supported.html';
|
||||
}
|
||||
</script>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
|
||||
<meta name="description" content="">
|
||||
|
||||
<title data-i18n="general_webui_title">Hyperion - Error</title>
|
||||
<meta name="description" content="Hyperion Web Configuration">
|
||||
<meta name="msapplication-TileColor" content="#91989C">
|
||||
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
|
||||
<link rel="apple-touch-icon-precomposed" sizes="180x180" href="/apple-touch-icon.png">
|
||||
<link rel="icon" type="image/png" href="/favicon.png" sizes="32x32">
|
||||
|
||||
<title data-i18n="general_webui_title">Hyperion - Web Configuration</title>
|
||||
|
||||
<!-- jQuery -->
|
||||
<script src="/js/lib/jquery.min.js"></script>
|
||||
<script src="js/lib/jquery.min.js"></script>
|
||||
|
||||
<!-- Hyperion -->
|
||||
<script src="/js/hyperion.js"></script>
|
||||
<script src="/js/ui_utils.js"></script>
|
||||
|
||||
<!-- textarea -->
|
||||
<script src="/js/lib/jquery-linedtextarea.js"></script>
|
||||
<link href="/css/jquery-linedtextarea.css" type="text/css" rel="stylesheet" />
|
||||
<script src="js/hyperion.js"></script>
|
||||
<script src="js/ui_utils.js"></script>
|
||||
|
||||
<!-- Colorpicker -->
|
||||
<script src="/js/lib/bootstrap-colorpicker.min.js"></script>
|
||||
<link href="/css/bootstrap-colorpicker.min.css" rel="stylesheet">
|
||||
<script src="js/lib/bootstrap-colorpicker.min.js"></script>
|
||||
<link href="css/bootstrap-colorpicker.min.css" rel="stylesheet">
|
||||
|
||||
<!-- JSONEditor -->
|
||||
<script src="/js/lib/jsoneditor.js"></script>
|
||||
<script src="js/lib/jsoneditor.js"></script>
|
||||
|
||||
<!--Language Support -->
|
||||
<script src="/js/lib/jquery.i18n.js"></script>
|
||||
<script src="/js/lib/jquery.i18n.messagestore.js"></script>
|
||||
<script src="/js/lib/jquery.i18n.fallbacks.js"></script>
|
||||
<script src="/js/lib/jquery.i18n.parser.js"></script>
|
||||
<script src="/js/lib/jquery.i18n.emitter.js"></script>
|
||||
<script src="/js/lib/jquery.i18n.language.js"></script>
|
||||
<script src="js/lib/jquery.i18n.js"></script>
|
||||
<script src="js/lib/jquery.i18n.messagestore.js"></script>
|
||||
<script src="js/lib/jquery.i18n.fallbacks.js"></script>
|
||||
<script src="js/lib/jquery.i18n.parser.js"></script>
|
||||
<script src="js/lib/jquery.i18n.emitter.js"></script>
|
||||
<script src="js/lib/jquery.i18n.language.js"></script>
|
||||
|
||||
<!-- Bootstrap Core CSS -->
|
||||
<link href="/css/bootstrap.css" rel="stylesheet">
|
||||
|
||||
<!-- Flags -->
|
||||
<link href="/css/flag-icon.min.css" rel="stylesheet">
|
||||
<link href="css/bootstrap.min.css" rel="stylesheet">
|
||||
|
||||
<!-- MetisMenu CSS -->
|
||||
<link href="/css/metisMenu.css" rel="stylesheet">
|
||||
<link href="css/metisMenu.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom CSS -->
|
||||
<link href="/css/sb-admin-2.css" rel="stylesheet">
|
||||
<link href="/css/hyperion.css" rel="stylesheet">
|
||||
<link href="css/sb-admin-2.css" rel="stylesheet">
|
||||
<link href="css/hyperion.css" rel="stylesheet">
|
||||
|
||||
<!-- Custom Fonts -->
|
||||
<link href="/css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
@ -87,14 +91,9 @@
|
||||
<!-- /.navbar-header -->
|
||||
|
||||
<ul class="nav navbar-top-links navbar-right">
|
||||
<li class="dropdown" id="btn_setlang">
|
||||
<li class="dropdown" id="btn_instanceswitch" style="display:none">
|
||||
<a>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown" id="btn_setaccess">
|
||||
<a>
|
||||
<i class="fa fa-key fa-fw"></i>
|
||||
<i class="fa fa-exchange fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown" id="btn_open_ledsim">
|
||||
@ -125,19 +124,33 @@
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_wizard_philipshue">
|
||||
</ul>
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
<li class="dropdown">
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">
|
||||
<i class="fa fa-wrench fa-fw"></i> <i class="fa fa-caret-down"></i>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-alerts">
|
||||
<li id="btn_setlang">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-magic fa-fw"></i>
|
||||
<span data-i18n="wiz_hue_title"></span>
|
||||
<i class="fa fa-globe fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_lang_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li id="btn_setaccess">
|
||||
<a>
|
||||
<div>
|
||||
<i class="fa fa-key fa-fw"></i>
|
||||
<span data-i18n="InfoDialog_access_title"></span>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- /.dropdown-alerts -->
|
||||
</li>
|
||||
<!-- /.dropdown -->
|
||||
</ul>
|
||||
<!-- /.navbar-top-left -->
|
||||
|
||||
@ -177,11 +190,18 @@
|
||||
</nav>
|
||||
|
||||
<!-- Page Content -->
|
||||
<div id="page-wrapper" style="padding-top:10px">
|
||||
<div id="hyperion_reload_notify" class="alert alert-warning" style="display:none;padding:10px;margin:0">
|
||||
<div class="panel-danger" style="text-align:right">
|
||||
<div style="float:left;line-height:33px;" data-i18n="dashboard_alert_message_confedit">Your Hyperion configuration has been modified. To apply it, restart Hyperion.</div>
|
||||
<button id="btn_hyperion_reload" class="btn btn-danger" data-i18n="general_btn_restarthyperion">Restart Hyperion</button>
|
||||
<div id="page-wrapper" style="padding-top:10px; overflow: hidden;">
|
||||
<div id="hyperion_reload_notify" style="display:none;padding:0 10px;margin:0">
|
||||
<div class="bs-callout bs-callout-warning">
|
||||
<h4 data-i18n="dashboard_alert_message_confedit_t"></h4>
|
||||
<span data-i18n="dashboard_alert_message_confedit"></span>
|
||||
<p><button id="btn_hyperion_reload" class="btn btn-warning btn-sm" style="margin-top:10px" data-i18n="general_btn_restarthyperion"></button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="hyperion_disabled_notify" style="display:none;padding:0 10px;margin:0">
|
||||
<div class="bs-callout bs-callout-danger">
|
||||
<h4 data-i18n="dashboard_alert_message_disabled_t"></h4>
|
||||
<span data-i18n="dashboard_alert_message_disabled"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -254,25 +274,29 @@
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap Core JavaScript -->
|
||||
<script src="/js/lib/bootstrap.min.js"></script>
|
||||
<script src="js/lib/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Metis Menu Plugin JavaScript -->
|
||||
<script src="/js/lib/metisMenu.min.js"></script>
|
||||
<script src="js/lib/metisMenu.min.js"></script>
|
||||
|
||||
<!-- Custom Theme JavaScript -->
|
||||
<script src="/js/lib/sb-admin-2.js"></script>
|
||||
<script src="js/lib/sb-admin-2.js"></script>
|
||||
|
||||
<script src="/js/content_index.js"></script>
|
||||
<script src="/js/settings.js"></script>
|
||||
<script src="/js/wizard.js"></script>
|
||||
<script src="js/content_index.js"></script>
|
||||
<script src="js/settings.js"></script>
|
||||
<script src="js/wizard.js"></script>
|
||||
|
||||
<!--gijgo dialog-->
|
||||
<script src="/js/lib/draggable.min.js"></script>
|
||||
<script src="/js/lib/dialog.min.js"></script>
|
||||
<script src="/js/ledsim.js"></script>
|
||||
<script src="js/lib/draggable.min.js"></script>
|
||||
<script src="js/lib/dialog.min.js"></script>
|
||||
<script src="js/ledsim.js"></script>
|
||||
|
||||
<!--Client-side download-->
|
||||
<script src='/js/lib/download.min.js'></script>
|
||||
<script src='js/lib/download.min.js'></script>
|
||||
|
||||
<!--JsonAceEditor-->
|
||||
<script src='js/lib/jsonaceeditor.min.js'></script>
|
||||
<link href="css/jsonaceeditor.min.css" rel="stylesheet" type="text/css">
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -68,6 +68,9 @@ $(document).ready( function() {
|
||||
requestWriteConfig(editor_blackborder.getValue());
|
||||
});
|
||||
|
||||
//wiki links
|
||||
$('#editor_container_blackborder').append(buildWL("user/moretopics/bbmode","edt_conf_bb_mode_title",true));
|
||||
|
||||
//create introduction
|
||||
if(showOptHelp)
|
||||
{
|
||||
|
@ -1,24 +1,73 @@
|
||||
$(document).ready( function() {
|
||||
performTranslation();
|
||||
|
||||
function newsCont(t,e,l)
|
||||
{
|
||||
var h = '<div style="padding-left:9px;border-left:6px solid #0088cc;">';
|
||||
h += '<h4 style="font-weight:bold;font-size:17px">'+t+'</h4>';
|
||||
h += e;
|
||||
h += '<a href="'+l+'" class="" target="_blank"><i class="fa fa-fw fa-newspaper-o"></i>'+$.i18n('dashboard_newsbox_readmore')+'</a>';
|
||||
h += '</div><hr/>';
|
||||
$('#dash_news').append(h);
|
||||
}
|
||||
|
||||
function createNews(d)
|
||||
{
|
||||
for(var i = 0; i<d.length; i++)
|
||||
{
|
||||
if(i > 5)
|
||||
break;
|
||||
|
||||
title = d[i].title.rendered;
|
||||
excerpt = d[i].excerpt.rendered;
|
||||
link = d[i].link+'?pk_campaign=WebUI&pk_kwd=news_'+d[i].slug;
|
||||
|
||||
newsCont(title,excerpt,link);
|
||||
}
|
||||
}
|
||||
|
||||
function getNews()
|
||||
{
|
||||
var h = '<span style="color:red;font-weight:bold">'+$.i18n('dashboard_newsbox_noconn')+'</span>';
|
||||
$.ajax({
|
||||
url: 'https://hyperion-project.org/wp-json/wp/v2/posts?_embed',
|
||||
dataType: 'json',
|
||||
type: 'GET',
|
||||
timeout: 2000
|
||||
})
|
||||
.done( function( data, textStatus, jqXHR ) {
|
||||
if(jqXHR.status == 200)
|
||||
createNews(data);
|
||||
else
|
||||
$('#dash_news').html(h);
|
||||
})
|
||||
.fail( function( jqXHR, textStatus ) {
|
||||
$('#dash_news').html(h);
|
||||
});
|
||||
}
|
||||
|
||||
//getNews();
|
||||
|
||||
function updateComponents()
|
||||
{
|
||||
var components = serverInfo.info.components;
|
||||
var components = serverInfo.components;
|
||||
components_html = "";
|
||||
for ( idx=0; idx<components.length;idx++)
|
||||
{
|
||||
components_html += '<tr><td>'+$.i18n('general_comp_'+components[idx].name)+'</td><td><i class="fa fa-circle component-'+(components[idx].enabled?"on":"off")+'"></i></td></tr>';
|
||||
}
|
||||
$("#tab_components").html(components_html);
|
||||
|
||||
//info
|
||||
$('#dash_statush').html(serverInfo.hyperion.off? '<span style="color:red">'+$.i18n('general_btn_off')+'</span>':'<span style="color:green">'+$.i18n('general_btn_on')+'</span>');
|
||||
$('#btn_hsc').html(serverInfo.hyperion.off? '<button class="btn btn-sm btn-success" onClick="requestSetComponentState(\'ALL\',true)">'+$.i18n('dashboard_infobox_label_enableh')+'</button>' : '<button class="btn btn-sm btn-danger" onClick="requestSetComponentState(\'ALL\',false)">'+$.i18n('dashboard_infobox_label_disableh')+'</button>');
|
||||
}
|
||||
|
||||
// get active led device
|
||||
var leddevice = serverInfo.info.ledDevices.active;
|
||||
$('#dash_leddevice').html(leddevice);
|
||||
|
||||
// get host
|
||||
var hostname = serverInfo.info.hostname;
|
||||
$('#dash_systeminfo').html(hostname+':'+jsonPort);
|
||||
// add more info
|
||||
$('#dash_leddevice').html(serverInfo.ledDevices.active);
|
||||
$('#dash_currv').html(currentVersion);
|
||||
$('#dash_instance').html(serverConfig.general.name);
|
||||
$('#dash_ports').html(jsonPort+' | '+serverConfig.protoServer.port);
|
||||
|
||||
$.get( "https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/version.json", function( data ) {
|
||||
parsedUpdateJSON = JSON.parse(data);
|
||||
@ -26,15 +75,32 @@ $(document).ready( function() {
|
||||
var cleanLatestVersion = latestVersion.replace(/\./g, '');
|
||||
var cleanCurrentVersion = currentVersion.replace(/\./g, '');
|
||||
|
||||
$('#currentversion').html(currentVersion);
|
||||
$('#latestversion').html(latestVersion);
|
||||
// $('#dash_latev').html(latestVersion);
|
||||
|
||||
if ( cleanCurrentVersion < cleanLatestVersion )
|
||||
$('#versioninforesult').html('<div style="margin:0px;" class="alert alert-warning">'+$.i18n('dashboard_infobox_message_updatewarning', latestVersion)+'</div>');
|
||||
else
|
||||
$('#versioninforesult').html('<div style="margin:0px;" class="alert alert-success">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||
// if ( cleanCurrentVersion < cleanLatestVersion )
|
||||
// $('#versioninforesult').html('<div class="bs-callout bs-callout-warning" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatewarning', latestVersion)+'</div>');
|
||||
// else
|
||||
$('#versioninforesult').html('<div class="bs-callout bs-callout-success" style="margin:0px">'+$.i18n('dashboard_infobox_message_updatesuccess')+'</div>');
|
||||
});
|
||||
|
||||
//determine platform
|
||||
var grabbers = serverInfo.grabbers.available;
|
||||
var html = "";
|
||||
|
||||
if(grabbers.indexOf('dispmanx') > -1)
|
||||
html += 'Raspberry Pi';
|
||||
else if(grabbers.indexOf('x11') > -1)
|
||||
html += 'X86';
|
||||
else if(grabbers.indexOf('osx') > -1)
|
||||
html += 'OSX';
|
||||
else if(grabbers.indexOf('amlogic') > -1)
|
||||
html += 'Amlogic';
|
||||
else
|
||||
html += 'Framebuffer';
|
||||
|
||||
$('#dash_platform').html(html);
|
||||
|
||||
|
||||
//interval update
|
||||
updateComponents();
|
||||
$(hyperion).on("cmd-serverinfo",updateComponents);
|
||||
|
@ -99,13 +99,17 @@ $(document).ready( function() {
|
||||
});
|
||||
|
||||
$('#btn_submit_foregroundEffect').off().on('click',function() {
|
||||
//requestWriteConfig(foregroundEffect_editor.getValue());
|
||||
console.log(foregroundEffect_editor.getValue());
|
||||
var value = foregroundEffect_editor.getValue();
|
||||
if(typeof value.foregroundEffect.effect == 'undefined')
|
||||
value.foregroundEffect.effect = serverConfig.foregroundEffect.effect;
|
||||
requestWriteConfig(value);
|
||||
});
|
||||
|
||||
$('#btn_submit_backgroundEffect').off().on('click',function() {
|
||||
//requestWriteConfig(backgroundEffect_editor.getValue());
|
||||
console.log(backgroundEffect_editor.getValue());
|
||||
var value = backgroundEffect_editor.getValue();
|
||||
if(typeof value.backgroundEffect.effect == 'undefined')
|
||||
value.backgroundEffect.effect = serverConfig.backgroundEffect.effect;
|
||||
requestWriteConfig(value);
|
||||
});
|
||||
|
||||
//create introduction
|
||||
@ -119,7 +123,7 @@ $(document).ready( function() {
|
||||
function updateEffectlist(){
|
||||
if(editorReady)
|
||||
{
|
||||
var newEffects = serverInfo.info.effects;
|
||||
var newEffects = serverInfo.effects;
|
||||
if (newEffects.length != oldEffects.length)
|
||||
{
|
||||
$('#root_foregroundEffect_effect').html('');
|
||||
|
@ -10,7 +10,7 @@ $(document).ready( function() {
|
||||
createHintH("intro", $.i18n('effectsconfigurator_label_intro'), "intro_effc");
|
||||
|
||||
function updateDelEffectlist(){
|
||||
var newDelList = serverInfo.info.effects;
|
||||
var newDelList = serverInfo.effects;
|
||||
if(newDelList.length != oldDelList.length)
|
||||
{
|
||||
var EffectHtml = null;
|
||||
|
@ -3,6 +3,14 @@ $(document).ready( function() {
|
||||
var conf_editor_v4l2 = null;
|
||||
var conf_editor_fg = null;
|
||||
|
||||
function hideEl(el)
|
||||
{
|
||||
for(var i = 0; i<el.length; i++)
|
||||
{
|
||||
$('[data-schemapath*="root.framegrabber.'+el[i]+'"]').toggle(false);
|
||||
}
|
||||
}
|
||||
|
||||
if(showOptHelp)
|
||||
{
|
||||
//fg
|
||||
@ -55,6 +63,18 @@ $(document).ready( function() {
|
||||
createHint("intro", $.i18n('conf_grabber_v4l_intro'), "editor_container_v4l2");
|
||||
}
|
||||
|
||||
//hide specific options
|
||||
conf_editor_fg.on('ready',function() {
|
||||
var grabbers = serverInfo.grabbers.available;
|
||||
|
||||
if(grabbers.indexOf('dispmanx') > -1)
|
||||
hideEl(["device","verticalPixelDecimation","horizontalPixelDecimation","useXGetImage"]);
|
||||
else if(grabbers.indexOf('x11') > -1)
|
||||
hideEl(["device","width","height"]);
|
||||
else if(grabbers.indexOf('osx') > -1 || grabbers.indexOf('amlogic') > -1)
|
||||
hideEl(["device","verticalPixelDecimation","horizontalPixelDecimation","useXGetImage","cropLeft","cropBottom","cropTop","cropRight"]);
|
||||
});
|
||||
|
||||
removeOverlay();
|
||||
});
|
||||
|
||||
|
@ -1,20 +1,24 @@
|
||||
$(document).ready( function() {
|
||||
var uiLock = false;
|
||||
var prevSess = 0;
|
||||
|
||||
loadContentTo("#container_connection_lost","connection_lost");
|
||||
loadContentTo("#container_restart","restart");
|
||||
initWebSocket();
|
||||
|
||||
$(hyperion).on("cmd-serverinfo",function(event){
|
||||
serverInfo = event.response;
|
||||
currentVersion = serverInfo.info.hyperion[0].version;
|
||||
serverInfo = event.response.info;
|
||||
$(hyperion).trigger("ready");
|
||||
|
||||
if (serverInfo.info.hyperion[0].config_modified)
|
||||
if (serverInfo.hyperion.config_modified)
|
||||
$("#hyperion_reload_notify").fadeIn("fast");
|
||||
else
|
||||
$("#hyperion_reload_notify").fadeOut("fast");
|
||||
|
||||
if (serverInfo.hyperion.off)
|
||||
$("#hyperion_disabled_notify").fadeIn("fast");
|
||||
else
|
||||
$("#hyperion_disabled_notify").fadeOut("fast");
|
||||
|
||||
if ($("#logmessages").length == 0 && loggingStreamActive)
|
||||
{
|
||||
@ -22,7 +26,7 @@ $(document).ready( function() {
|
||||
loggingStreamActive = false;
|
||||
}
|
||||
|
||||
if (!serverInfo.info.hyperion[0].config_writeable)
|
||||
if (!serverInfo.hyperion.config_writeable)
|
||||
{
|
||||
showInfoDialog('uilock',$.i18n('InfoDialog_nowrite_title'),$.i18n('InfoDialog_nowrite_text'));
|
||||
$('#wrapper').toggle(false);
|
||||
@ -35,8 +39,34 @@ $(document).ready( function() {
|
||||
uiLock = false;
|
||||
}
|
||||
|
||||
var sess = serverInfo.hyperion.sessions;
|
||||
if (sess.length != prevSess)
|
||||
{
|
||||
wSess = [];
|
||||
prevSess = sess.length;
|
||||
for(var i = 0; i<sess.length; i++)
|
||||
{
|
||||
if(sess[i].type == "_hyperiond-http._tcp.")
|
||||
{
|
||||
wSess.push(sess[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (wSess.length > 1)
|
||||
$('#btn_instanceswitch').toggle(true);
|
||||
else
|
||||
$('#btn_instanceswitch').toggle(false);
|
||||
}
|
||||
|
||||
}); // end cmd-serverinfo
|
||||
|
||||
$(hyperion).one("cmd-sysinfo", function(event) {
|
||||
requestServerInfo();
|
||||
sysInfo = event.response.info;
|
||||
|
||||
currentVersion = sysInfo.hyperion.version;
|
||||
});
|
||||
|
||||
$(hyperion).one("cmd-config-getschema", function(event) {
|
||||
serverSchema = event.response.result;
|
||||
requestServerConfig();
|
||||
@ -46,7 +76,7 @@ $(document).ready( function() {
|
||||
|
||||
$(hyperion).one("cmd-config-getconfig", function(event) {
|
||||
serverConfig = event.response.result;
|
||||
requestServerInfo();
|
||||
requestSysInfo();
|
||||
|
||||
showOptHelp = serverConfig.general.showOptHelp;
|
||||
});
|
||||
@ -67,8 +97,9 @@ $(document).ready( function() {
|
||||
initRestart();
|
||||
});
|
||||
|
||||
$(".mnava").on('click', function(e){
|
||||
$(".mnava").bind('click.menu', function(e){
|
||||
loadContent(e);
|
||||
window.scrollTo(0, 0);
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -1,16 +1,7 @@
|
||||
|
||||
var ledsCustomCfgInitialized = false;
|
||||
var finalLedArray = [];
|
||||
|
||||
function validateText(){
|
||||
e = isJsonString($("#ledconfig").val());
|
||||
|
||||
if (e.length != 0){
|
||||
showInfoDialog("error", $.i18n('InfoDialog_leds_validfail_title'), e);
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
var conf_editor = null;
|
||||
|
||||
function round(number) {
|
||||
var factor = Math.pow(10, 4);
|
||||
@ -35,6 +26,7 @@ function createLedPreview(leds, origin){
|
||||
}
|
||||
|
||||
$('#previewledcount').html($.i18n('conf_leds_layout_preview_totalleds', leds.length));
|
||||
$('#previewledpower').html($.i18n('conf_leds_layout_preview_ledpower', ((leds.length * 0.06)*1.1).toFixed(1)));
|
||||
|
||||
$('.st_helper').css("border", "8px solid grey");
|
||||
|
||||
@ -105,7 +97,7 @@ function createClassicLeds(){
|
||||
}
|
||||
|
||||
function rotateArray(array, times){
|
||||
if (times > "0"){
|
||||
if (times > 0){
|
||||
while( times-- ){
|
||||
array.push(array.shift())
|
||||
}
|
||||
@ -363,39 +355,76 @@ $(document).ready(function() {
|
||||
$('#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>');
|
||||
|
||||
// bind change event to all inputs
|
||||
$('.ledCLconstr').bind("change", function() {
|
||||
valValue(this.id,this.value,this.min,this.max);
|
||||
createClassicLeds();
|
||||
});
|
||||
|
||||
$('.ledMAconstr').bind("change", function() {
|
||||
valValue(this.id,this.value,this.min,this.max);
|
||||
createMatrixLeds();
|
||||
});
|
||||
|
||||
// cl leds push to textfield and save values
|
||||
$('#btn_cl_generate').off().on("click", function() {
|
||||
if (finalLedArray != ""){
|
||||
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t"));
|
||||
$('#collapse1').collapse('hide');
|
||||
$('#collapse4').collapse('show');
|
||||
}
|
||||
});
|
||||
|
||||
// ma leds push to textfield and save values
|
||||
$('#btn_ma_generate').off().on("click", function() {
|
||||
if (finalLedArray != ""){
|
||||
$("#ledconfig").text(JSON.stringify(finalLedArray, null, "\t"));
|
||||
$('#collapse2').collapse('hide');
|
||||
$('#collapse4').collapse('show');
|
||||
}
|
||||
});
|
||||
|
||||
// fill textfield with current led conf and copy to finalLedArray
|
||||
$("#ledconfig").text(JSON.stringify(serverConfig.leds, null, "\t"));
|
||||
// v4 of json schema with diff required assignment - remove when hyperion schema moved to v4
|
||||
var ledschema = {"items":{"additionalProperties":false,"required":["hscan","vscan","index"],"properties":{"clone":{"type":"integer"},"colorOrder":{"enum":["rgb","bgr","rbg","brg","gbr","grb"],"type":"string"},"hscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"},"index":{"type":"integer"},"vscan":{"additionalProperties":false,"properties":{"maximum":{"maximum":1,"minimum":0,"type":"number"},"minimum":{"maximum":1,"minimum":0,"type":"number"}},"type":"object"}},"type":"object"},"type":"array"}
|
||||
//create jsonace editor
|
||||
var aceEdt = new JSONACEEditor(document.getElementById("aceedit"),{
|
||||
mode: 'code',
|
||||
schema: ledschema,
|
||||
onChange: function(){
|
||||
var success = true;
|
||||
try{
|
||||
aceEdt.get();
|
||||
}
|
||||
catch(err)
|
||||
{
|
||||
success = false;
|
||||
}
|
||||
|
||||
if(success)
|
||||
{
|
||||
$('#leds_custom_updsim').attr("disabled", false);
|
||||
$('#leds_custom_save').attr("disabled", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#leds_custom_updsim').attr("disabled", true);
|
||||
$('#leds_custom_save').attr("disabled", true);
|
||||
}
|
||||
}
|
||||
}, serverConfig.leds);
|
||||
|
||||
//TODO: HACK! No callback for schema validation - Add it!
|
||||
setInterval(function(){
|
||||
if($('#aceedit table').hasClass('jsoneditor-text-errors'))
|
||||
{
|
||||
$('#leds_custom_updsim').attr("disabled", true);
|
||||
$('#leds_custom_save').attr("disabled", true);
|
||||
}
|
||||
},1000)
|
||||
|
||||
$('.jsoneditor-menu').toggle();
|
||||
|
||||
// leds to finalLedArray
|
||||
finalLedArray = 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
|
||||
var conf_editor = null;
|
||||
$("#leddevices").off().on("change", function() {
|
||||
generalOptions = serverSchema.properties.device;
|
||||
specificOptions = serverSchema.properties.alldevices[$(this).val()];
|
||||
@ -406,7 +435,7 @@ $(document).ready(function() {
|
||||
|
||||
values_general = {};
|
||||
values_specific = {};
|
||||
isCurrentDevice = (serverInfo.info.ledDevices.active == $(this).val());
|
||||
isCurrentDevice = (serverInfo.ledDevices.active == $(this).val());
|
||||
|
||||
for(var key in serverConfig.device){
|
||||
if (key != "type" && key in generalOptions.properties)
|
||||
@ -426,10 +455,22 @@ $(document).ready(function() {
|
||||
|
||||
// change save button state based on validation result
|
||||
conf_editor.validate().length ? $('#btn_submit_controller').attr('disabled', true) : $('#btn_submit_controller').attr('disabled', false);
|
||||
|
||||
// led controller sepecific wizards
|
||||
if($(this).val() == "philipshue")
|
||||
{
|
||||
createHint("wizard", $.i18n('wiz_hue_title'), "btn_wiz_holder","btn_led_device_wiz");
|
||||
$('#btn_led_device_wiz').off().on('click',startWizardPhilipsHue);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#btn_wiz_holder').html("")
|
||||
$('#btn_led_device_wiz').off();
|
||||
}
|
||||
});
|
||||
|
||||
// create led device selection
|
||||
ledDevices = serverInfo.info.ledDevices.available
|
||||
ledDevices = serverInfo.ledDevices.available
|
||||
devRPiSPI = ['apa102', 'ws2801', 'lpd6803', 'lpd8806', 'p9813', 'sk6812spi', 'sk6822spi', 'ws2812spi'];
|
||||
devRPiPWM = ['ws281x'];
|
||||
devRPiGPIO = ['piblaster'];
|
||||
@ -465,14 +506,12 @@ $(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(serverInfo.info.ledDevices.active);
|
||||
$("#leddevices").val(serverInfo.ledDevices.active);
|
||||
$("#leddevices").trigger("change");
|
||||
|
||||
// validate textfield and update preview
|
||||
$("#leds_custom_updsim").off().on("click", function() {
|
||||
if (validateText()){
|
||||
createLedPreview(JSON.parse($("#ledconfig").val()), 'text');
|
||||
}
|
||||
createLedPreview(aceEdt.get(), 'text');
|
||||
});
|
||||
|
||||
// save led config and saveValues - passing textfield
|
||||
@ -481,13 +520,10 @@ $(document).ready(function() {
|
||||
saveValues();
|
||||
});
|
||||
|
||||
// validate and save led config from textfield
|
||||
// save led config from textfield
|
||||
$("#leds_custom_save").off().on("click", function() {
|
||||
if (validateText())
|
||||
{
|
||||
requestWriteConfig(JSON.parse('{"leds" :'+$("#ledconfig").val()+'}'));
|
||||
saveValues();
|
||||
}
|
||||
requestWriteConfig(JSON.parse('{"leds" :'+aceEdt.getText()+'}'));
|
||||
saveValues();
|
||||
});
|
||||
|
||||
// toggle led numbers
|
||||
@ -498,7 +534,7 @@ $(document).ready(function() {
|
||||
|
||||
// open checklist
|
||||
$('#leds_prev_checklist').off().on("click", function() {
|
||||
var liList = [$.i18n('conf_leds_leyout_checkp1'),$.i18n('conf_leds_leyout_checkp3'),$.i18n('conf_leds_leyout_checkp2'),$.i18n('conf_leds_leyout_checkp4')];
|
||||
var liList = [$.i18n('conf_leds_layout_checkp1'),$.i18n('conf_leds_layout_checkp3'),$.i18n('conf_leds_layout_checkp2'),$.i18n('conf_leds_layout_checkp4')];
|
||||
var ul = document.createElement("ul");
|
||||
ul.className = "checklist"
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
var messages;
|
||||
var reportUrl = 'https://report.hyperion-project.org/#';
|
||||
|
||||
$('#conf_cont').append(createOptPanel('fa-reorder', $.i18n("edt_conf_log_heading_title"), 'editor_container', 'btn_submit'));
|
||||
if(showOptHelp)
|
||||
@ -13,6 +14,7 @@ $(document).ready(function() {
|
||||
$('#conf_cont').append(createHelpTable(schema.logger.properties, $.i18n("edt_conf_log_heading_title")));
|
||||
createHintH("intro", $.i18n('conf_logging_label_intro'), "log_head");
|
||||
}
|
||||
$("#log_upl_pol").append('<span style="color:grey;font-size:80%">'+$.i18n("conf_logging_uplpolicy")+' '+buildWL("user/support#report_privacy_policy",$.i18n("conf_logging_contpolicy")));
|
||||
|
||||
conf_editor = createJsonEditor('editor_container', {
|
||||
logger : schema.logger
|
||||
@ -25,36 +27,86 @@ $(document).ready(function() {
|
||||
$('#btn_submit').off().on('click',function() {
|
||||
requestWriteConfig(conf_editor.getValue());
|
||||
});
|
||||
|
||||
$('#btn_logupload').off().on('click',function() {
|
||||
uploadLog();
|
||||
$(this).attr("disabled", true);
|
||||
$('#upl_link').html($.i18n('conf_logging_uploading'))
|
||||
});
|
||||
|
||||
//show prev uploads
|
||||
var ent;
|
||||
|
||||
if(getStorage("prev_reports"))
|
||||
{
|
||||
ent = JSON.parse(getStorage("prev_reports"));
|
||||
$('#prev_reports').append('<h4 style="margin-top:30px">'+$.i18n('conf_logging_lastreports')+'</h4>');
|
||||
for(var i = 0; i<ent.length; i++)
|
||||
{
|
||||
$('#prev_reports').append('<p><a href="'+reportUrl+ent[i].id+'" target="_blank">'+ent[i].title+'('+ent[i].time+')</a></p>');
|
||||
}
|
||||
}
|
||||
else
|
||||
ent = [];
|
||||
|
||||
function updateLastReports(id,time,title)
|
||||
{
|
||||
if(ent.length > 4)
|
||||
ent.pop();
|
||||
ent.unshift({"id": id ,"time": time,"title": title})
|
||||
setStorage("prev_reports",JSON.stringify(ent));
|
||||
}
|
||||
|
||||
function uploadLog()
|
||||
{
|
||||
var reportUrl = 'https://glot.io/snippets/';
|
||||
var log = "";
|
||||
var config = JSON.stringify(serverConfig, null, "\t").replace(/"/g, '\\"');
|
||||
var prios = serverInfo.info.priorities;
|
||||
var comps = serverInfo.info.components;
|
||||
var config = JSON.stringify(serverConfig, null).replace(/"/g, '\"');
|
||||
var prios = serverInfo.priorities;
|
||||
var comps = serverInfo.components;
|
||||
var sys = sysInfo.system;
|
||||
var shy = sysInfo.hyperion;
|
||||
var info;
|
||||
|
||||
//create log
|
||||
for(var i = 0; i<messages.length; i++)
|
||||
if(messages)
|
||||
{
|
||||
app_name = messages[i].appName;
|
||||
logger_name = messages[i].loggerName;
|
||||
function_ = messages[i].function;
|
||||
line = messages[i].line;
|
||||
file_name = messages[i].fileName;
|
||||
msg = messages[i].message;
|
||||
level_string = messages[i].levelString;
|
||||
debug = "";
|
||||
for(var i = 0; i<messages.length; i++)
|
||||
{
|
||||
app_name = messages[i].appName;
|
||||
logger_name = messages[i].loggerName;
|
||||
function_ = messages[i].function;
|
||||
line = messages[i].line;
|
||||
file_name = messages[i].fileName;
|
||||
msg = messages[i].message;
|
||||
level_string = messages[i].levelString;
|
||||
debug = "";
|
||||
|
||||
if(level_string == "DEBUG") {
|
||||
debug = "<"+file_name+":"+line+":"+function_+"()> ";
|
||||
}
|
||||
if(level_string == "DEBUG") {
|
||||
debug = "<"+file_name+":"+line+":"+function_+"()> ";
|
||||
}
|
||||
|
||||
log += "["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+"\n";
|
||||
log += "["+app_name+" "+logger_name+"] <"+level_string+"> "+debug+msg+"\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
log = "Log was empty!";
|
||||
|
||||
//create general info
|
||||
info = "### GENERAL ### \n";
|
||||
info += 'Build: '+shy.build+'\n';
|
||||
info += 'Build time: '+shy.time+'\n';
|
||||
info += 'Version: '+shy.version+'\n';
|
||||
info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n';
|
||||
info += 'UI Access: '+storedAccess+'\n';
|
||||
info += 'Log lvl: '+serverConfig.logger.level+'\n';
|
||||
info += 'Avail Capt: '+serverInfo.grabbers.available+'\n\n';
|
||||
info += 'Distribution:'+sys.prettyName+'\n';
|
||||
info += 'Arch: '+sys.architecture+'\n';
|
||||
info += 'Kernel: '+sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))\n';
|
||||
info += 'Browser/OS: '+navigator.userAgent+'\n\n';
|
||||
|
||||
//create prios
|
||||
var info = "######## PRIORITIES ######## \n";
|
||||
info += "### PRIORITIES ### \n";
|
||||
for(var i = 0; i<prios.length; i++)
|
||||
{
|
||||
info += prios[i].priority;
|
||||
@ -64,23 +116,28 @@ $(document).ready(function() {
|
||||
info += ' ';
|
||||
info += ' ('+prios[i].component+') Owner: '+prios[i].owner+'\n';
|
||||
}
|
||||
info += '\npriorities_autoselect: '+serverInfo.info.priorities_autoselect+'\n\n';
|
||||
info += '\npriorities_autoselect: '+serverInfo.priorities_autoselect+'\n\n';
|
||||
|
||||
//create comps
|
||||
info += '######## COMPONENTS ######## \n'
|
||||
info += '### COMPONENTS ### \n'
|
||||
for(var i = 0; i<comps.length; i++)
|
||||
{
|
||||
info += comps[i].enabled+' - '+comps[i].name+'\n';
|
||||
}
|
||||
|
||||
//escape data
|
||||
info = JSON.stringify(info);
|
||||
log = JSON.stringify(log);
|
||||
config = JSON.stringify(config);
|
||||
var title = 'Hyperion '+currentVersion+' Report ('+serverConfig.general.name+' ('+serverInfo.ledDevices.active+'))';
|
||||
|
||||
$.ajax({
|
||||
url: 'https://snippets.glot.io/snippets',
|
||||
// headers: { "Authorization": "Token 9ed92d37-36ca-4430-858f-47b6a3d4d535", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Methods": "GET,HEAD,OPTIONS,POST,PUT", "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept, Authorization" },
|
||||
url: 'https://api.hyperion-project.org/report.php',
|
||||
crossDomain: true,
|
||||
contentType: 'application/json',
|
||||
type: 'POST',
|
||||
timeout: 7000,
|
||||
data: '{"language":"plaintext","title":"Hyperion '+currentVersion+' Report ('+serverConfig.general.name+' ('+serverInfo.info.ledDevices.active+'))","public":false,"files":[{"name":"Info","content":"'+info+'"},{"name":"Hyperion Log","content":"'+log+'"},{"name":"Hyperion Config","content":"'+config+'"}]}'
|
||||
data: '{"title":"'+title+'","info":'+info+',"log":'+log+',"config":'+config+'}'
|
||||
})
|
||||
.done( function( data, textStatus, jqXHR ) {
|
||||
reportUrl += data.id;
|
||||
@ -88,6 +145,7 @@ $(document).ready(function() {
|
||||
{
|
||||
$('#upl_link').html($.i18n('conf_logging_yourlink')+': <a href="'+reportUrl+'" target="_blank">'+reportUrl+'</a>');
|
||||
$("html, body").animate({ scrollTop: 9999 }, "fast");
|
||||
updateLastReports(data.id,data.time,title);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -96,7 +154,9 @@ $(document).ready(function() {
|
||||
}
|
||||
})
|
||||
.fail( function( jqXHR, textStatus ) {
|
||||
//console.log(jqXHR, textStatus)
|
||||
console.log(jqXHR,textStatus);
|
||||
$('#btn_logupload').attr("disabled", false);
|
||||
$('#upl_link').html('<span style="color:red">'+$.i18n('conf_logging_uplfailed')+'<span>');
|
||||
});
|
||||
}
|
||||
|
||||
@ -107,17 +167,12 @@ $(document).ready(function() {
|
||||
messages = (event.response.result.messages);
|
||||
if(messages.length != 0 && !createdCont)
|
||||
{
|
||||
$('#log_content').html('<pre><div id="logmessages" style="overflow:scroll;max-height:400px"></div></pre><button class="btn btn-primary" id="btn_logupload">'+$.i18n('conf_logging_btn_pbupload')+'</button><button class="btn btn-success" id="btn_autoscroll" style="margin-left:10px;">'+$.i18n('conf_logging_btn_autoscroll')+'</button><div id="upl_link" style="margin-top:10px;font-weight:bold;"></div>');
|
||||
$('#log_content').html('<pre><div id="logmessages" style="overflow:scroll;max-height:400px"></div></pre><button class="btn btn-success" id="btn_autoscroll"><i class="fa fa-long-arrow-down fa-fw"></i>'+$.i18n('conf_logging_btn_autoscroll')+'</button>');
|
||||
createdCont = true;
|
||||
|
||||
$('#btn_autoscroll').off().on('click',function() {
|
||||
toggleClass('#btn_autoscroll', "btn-success", "btn-danger");
|
||||
});
|
||||
$('#btn_logupload').off().on('click',function() {
|
||||
uploadLog();
|
||||
$(this).attr("disabled", true);
|
||||
$('#upl_link').html($.i18n('conf_logging_uploading'))
|
||||
});
|
||||
}
|
||||
for(var idx=0; idx<messages.length; idx++)
|
||||
{
|
||||
|
@ -4,7 +4,9 @@ $(document).ready(function() {
|
||||
var oldEffects = [];
|
||||
var cpcolor = '#B500FF';
|
||||
var mappingList = serverSchema.properties.color.properties.imageToLedMappingType.enum;
|
||||
|
||||
var duration = 0;
|
||||
var rgb = {r:255,g:0,b:0};
|
||||
|
||||
//create html
|
||||
createTable('ssthead', 'sstbody', 'sstcont');
|
||||
$('.ssthead').html(createTableRow([$.i18n('remote_input_origin'), $.i18n('remote_input_owner'), $.i18n('remote_input_priority'), $.i18n('remote_input_status')], true, true));
|
||||
@ -23,7 +25,7 @@ $(document).ready(function() {
|
||||
|
||||
//color adjustment
|
||||
var sColor = sortProperties(serverSchema.properties.color.properties.channelAdjustment.items.properties)
|
||||
var values = serverInfo.info.adjustment[0]
|
||||
var values = serverInfo.adjustment[0]
|
||||
|
||||
for(key in sColor)
|
||||
{
|
||||
@ -52,19 +54,37 @@ $(document).ready(function() {
|
||||
}
|
||||
else
|
||||
{
|
||||
if(sColor[key].key == "brightness" || sColor[key].key == "backlightThreshold")
|
||||
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.0" max="1.0" step="0.05" value="'+value+'"/>';
|
||||
if(sColor[key].key == "brightness" || sColor[key].key == "brightnessCompensation" || sColor[key].key == "backlightThreshold")
|
||||
property = '<div class="input-group"><input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0" max="100" step="10" value="'+value+'"/><span class="input-group-addon">'+$.i18n("edt_append_percent")+'</span></div>';
|
||||
else
|
||||
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.0" max="4.0" step="0.1" value="'+value+'"/>';
|
||||
property = '<input id="cr_'+sColor[key].key+'" type="number" class="form-control" min="0.1" max="4.0" step="0.1" value="'+value+'"/>';
|
||||
|
||||
$('.crtbody').append(createTableRow([title, property], false, true));
|
||||
$('#cr_'+sColor[key].key).off().on('change', function(e){
|
||||
valValue(this.id,this.value,this.min,this.max);
|
||||
requestAdjustment(e.target.id.substr(e.target.id.indexOf("_") + 1), e.currentTarget.value);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function sendEffect()
|
||||
{
|
||||
efx = $("#effect_select").val();
|
||||
if(efx != "__none__")
|
||||
{
|
||||
requestPriorityClear();
|
||||
$(hyperion).one("cmd-clear", function(event) {
|
||||
setTimeout(function() {requestPlayEffect(efx,duration)}, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function sendColor()
|
||||
{
|
||||
requestSetColor(rgb.r, rgb.g, rgb.b,duration);
|
||||
}
|
||||
|
||||
function updateRemote()
|
||||
{
|
||||
if ($('#componentsbutton').length == 0)
|
||||
@ -84,12 +104,17 @@ $(document).ready(function() {
|
||||
{
|
||||
$('.sstbody').html("");
|
||||
var data = "";
|
||||
var prios = serverInfo.info.priorities
|
||||
var prios = serverInfo.priorities
|
||||
var i;
|
||||
var clearAll = false;
|
||||
|
||||
for(i = 0; i < prios.length; i++)
|
||||
{
|
||||
var origin = "not impl";
|
||||
var ip = "xxx.xxx.xxx.xxx";
|
||||
var origin = prios[i].origin ? prios[i].origin : "System";
|
||||
origin = origin.split("@");
|
||||
var ip = origin[1];
|
||||
origin = origin[0];
|
||||
|
||||
var owner = prios[i].owner;
|
||||
var active = prios[i].active;
|
||||
var visible = prios[i].visible;
|
||||
@ -99,44 +124,64 @@ $(document).ready(function() {
|
||||
var btn_type = "default";
|
||||
var btn_text = $.i18n('remote_input_setsource_btn');
|
||||
var btn_state = "enabled";
|
||||
if (active) btn_type = "warning";
|
||||
|
||||
if (active)
|
||||
btn_type = "primary";
|
||||
|
||||
if(priority > 254)
|
||||
continue;
|
||||
if(priority < 254 && (compId == "EFFECT" || compId == "COLOR") )
|
||||
clearAll = true;
|
||||
|
||||
if (visible)
|
||||
{
|
||||
btn_state = "disabled";
|
||||
btn_type = "success";
|
||||
btn_text = $.i18n('remote_input_sourceactiv_btn');
|
||||
}
|
||||
|
||||
if(ip)
|
||||
origin += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_ip')+' '+ip+'</span>';
|
||||
if(compId == "10")
|
||||
owner = $.i18n('remote_effects_label_effects')+' '+owner;
|
||||
if(compId == "9")
|
||||
owner = $.i18n('remote_color_label_color')+' '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+prios[i].value.RGB+'); display:inline-block" title="RGB: ('+prios[i].value.RGB+')"></div>';
|
||||
if(compId == "7")
|
||||
owner = $.i18n('general_comp_GRABBER')+': ('+owner+')';
|
||||
if(compId == "8")
|
||||
owner = $.i18n('general_comp_V4L')+': ('+owner+')';
|
||||
if(compId == "6")
|
||||
owner = $.i18n('general_comp_BOBLIGHTSERVER');
|
||||
if(compId == "5")
|
||||
owner = $.i18n('general_comp_UDPLISTENER');
|
||||
if(owner == "Off")
|
||||
owner = $.i18n('general_btn_off');
|
||||
if(duration)
|
||||
|
||||
switch (compId)
|
||||
{
|
||||
case "EFFECT":
|
||||
owner = $.i18n('remote_effects_label_effects')+' '+owner;
|
||||
break;
|
||||
case "COLOR":
|
||||
owner = $.i18n('remote_color_label_color')+' '+'<div style="width:18px; height:18px; border-radius:20px; margin-bottom:-4px; border:1px grey solid; background-color: rgb('+prios[i].value.RGB+'); display:inline-block" title="RGB: ('+prios[i].value.RGB+')"></div>';
|
||||
break;
|
||||
case "GRABBER":
|
||||
owner = $.i18n('general_comp_GRABBER')+': ('+owner+')';
|
||||
break;
|
||||
case "V4L":
|
||||
owner = $.i18n('general_comp_V4L')+': ('+owner+')';
|
||||
break;
|
||||
case "BOBLIGHTSERVER":
|
||||
owner = $.i18n('general_comp_BOBLIGHTSERVER');
|
||||
break;
|
||||
case "UDPLISTENER":
|
||||
owner = $.i18n('general_comp_UDPLISTENER');
|
||||
break;
|
||||
}
|
||||
|
||||
if(duration && compId != "GRABBER" && compId != "PROTOSERVER")
|
||||
owner += '<br/><span style="font-size:80%; color:grey;">'+$.i18n('remote_input_duration')+' '+duration.toFixed(0)+$.i18n('edt_append_s')+'</span>';
|
||||
|
||||
var btn = '<button id="srcBtn'+i+'" type="button" '+btn_state+' class="btn btn-'+btn_type+' btn_input_selection" onclick="requestSetSource('+priority+');">'+btn_text+'</button>';
|
||||
|
||||
if((compId == "10" || compId == "9") && priority != 254)
|
||||
if((compId == "EFFECT" || compId == "COLOR") && priority < 254)
|
||||
btn += '<button type="button" class="btn btn-sm btn-danger" style="margin-left:10px;" onclick="requestPriorityClear('+priority+');"><i class="fa fa-close"></button>';
|
||||
|
||||
if(btn_type != 'default')
|
||||
$('.sstbody').append(createTableRow([origin, owner, priority, btn], false, true));
|
||||
}
|
||||
var btn_auto_color = (serverInfo.info.priorities_autoselect? "btn-success" : "btn-danger");
|
||||
var btn_auto_state = (serverInfo.info.priorities_autoselect? "disabled" : "enabled");
|
||||
var btn_auto_text = (serverInfo.info.priorities_autoselect? $.i18n('general_btn_on') : $.i18n('general_btn_off'));
|
||||
$('#auto_btn').html('<button id="srcBtn'+i+'" type="button" '+btn_auto_state+' class="btn '+btn_auto_color+'" style="margin:10px;display:inline-block;" onclick="requestSetSource(\'auto\');">'+$.i18n('remote_input_label_autoselect')+' ('+btn_auto_text+')</button>');
|
||||
var btn_auto_color = (serverInfo.priorities_autoselect? "btn-success" : "btn-danger");
|
||||
var btn_auto_state = (serverInfo.priorities_autoselect? "disabled" : "enabled");
|
||||
var btn_auto_text = (serverInfo.priorities_autoselect? $.i18n('general_btn_on') : $.i18n('general_btn_off'));
|
||||
var btn_call_state = (clearAll? "enabled" : "disabled");
|
||||
$('#auto_btn').html('<button id="srcBtn'+i+'" type="button" '+btn_auto_state+' class="btn '+btn_auto_color+'" style="margin-right:5px;display:inline-block;" onclick="requestSetSource(\'auto\');">'+$.i18n('remote_input_label_autoselect')+' ('+btn_auto_text+')</button>');
|
||||
$('#auto_btn').append('<button type="button" '+btn_call_state+' class="btn btn-danger" style="display:inline-block;" onclick="requestClearAll();">'+$.i18n('remote_input_clearall')+'</button>');
|
||||
|
||||
var max_width=100;
|
||||
$('.btn_input_selection').each(function() {
|
||||
@ -148,7 +193,7 @@ $(document).ready(function() {
|
||||
|
||||
function updateLedMapping()
|
||||
{
|
||||
mapping = serverInfo.info.ledMAppingType;
|
||||
mapping = serverInfo.ledMAppingType;
|
||||
|
||||
$('#mappingsbutton').html("");
|
||||
for(var ix = 0; ix < mappingList.length; ix++)
|
||||
@ -156,15 +201,15 @@ $(document).ready(function() {
|
||||
if(mapping == mappingList[ix])
|
||||
btn_style = 'btn-success';
|
||||
else
|
||||
btn_style = 'btn-warning';
|
||||
btn_style = 'btn-primary';
|
||||
|
||||
$('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:10px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>');
|
||||
$('#mappingsbutton').append('<button type="button" id="lmBtn_'+mappingList[ix]+'" class="btn '+btn_style+'" style="margin:3px;min-width:200px" onclick="requestMappingType(\''+mappingList[ix]+'\');">'+$.i18n('remote_maptype_label_'+mappingList[ix])+'</button><br/>');
|
||||
}
|
||||
}
|
||||
|
||||
function updateComponents()
|
||||
{
|
||||
components = serverInfo.info.components;
|
||||
components = serverInfo.components;
|
||||
// create buttons
|
||||
$('#componentsbutton').html("");
|
||||
for ( idx=0; idx<components.length;idx++)
|
||||
@ -173,27 +218,28 @@ $(document).ready(function() {
|
||||
enable_icon = (components[idx].enabled? "fa-play" : "fa-stop");
|
||||
comp_name = components[idx].name;
|
||||
comp_btn_id = "comp_btn_"+comp_name;
|
||||
comp_goff = serverInfo.hyperion.off? "disabled" : "enabled";
|
||||
|
||||
// create btn if not there
|
||||
if ($("#"+comp_btn_id).length == 0)
|
||||
{
|
||||
d='<p><button type="button" id="'+comp_btn_id+'" class="btn '+enable_style
|
||||
d='<span style="display:block;margin:3px"><button type="button" '+comp_goff+' id="'+comp_btn_id+'" class="btn '+enable_style
|
||||
+'" onclick="requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)
|
||||
+')"><i id="'+comp_btn_id+'_icon" class="fa '+enable_icon+'"></i></button> '+$.i18n('general_comp_'+components[idx].name)+'</p>';
|
||||
+')"><i id="'+comp_btn_id+'_icon" class="fa '+enable_icon+'"></i></button> '+$.i18n('general_comp_'+components[idx].name)+'</span>';
|
||||
$('#componentsbutton').append(d);
|
||||
}
|
||||
else // already create, update state
|
||||
{
|
||||
setClassByBool( $('#'+comp_btn_id) , components[idx].enabled, "btn-danger", "btn-success" );
|
||||
setClassByBool( $('#'+comp_btn_id+"_icon"), components[idx].enabled, "fa-stop" , "fa-play" );
|
||||
$('#'+comp_btn_id).attr("onclick",'requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)+')');
|
||||
$('#'+comp_btn_id).attr("onclick",'requestSetComponentState(\''+comp_name+'\','+(!components[idx].enabled)+')').attr(comp_goff);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateEffectlist()
|
||||
{
|
||||
var newEffects = serverInfo.info.effects;
|
||||
var newEffects = serverInfo.effects;
|
||||
if (newEffects.length != oldEffects.length)
|
||||
{
|
||||
$('#effect_select').html('<option value="__none__"></option>');
|
||||
@ -217,10 +263,20 @@ $(document).ready(function() {
|
||||
|
||||
// colorpicker and effect
|
||||
if (getStorage('rmcpcolor') != null)
|
||||
{
|
||||
cpcolor = getStorage('rmcpcolor');
|
||||
rgb = hexToRgb(cpcolor);
|
||||
}
|
||||
|
||||
if (getStorage('rmduration') != null)
|
||||
{
|
||||
$("#remote_duration").val(getStorage('rmduration'));
|
||||
duration = getStorage('rmduration');
|
||||
}
|
||||
|
||||
createCP('cp2', cpcolor, function(rgb,hex){
|
||||
requestSetColor(rgb.r, rgb.g, rgb.b);
|
||||
createCP('cp2', cpcolor, function(rgbT,hex){
|
||||
rgb = rgbT;
|
||||
sendColor()
|
||||
$("#effect_select").val("__none__");
|
||||
setStorage('rmcpcolor', hex);
|
||||
});
|
||||
@ -229,16 +285,28 @@ $(document).ready(function() {
|
||||
requestPriorityClear();
|
||||
$("#effect_select").val("__none__");
|
||||
});
|
||||
|
||||
$("#remote_duration").off().on("change", function(){
|
||||
duration = valValue(this.id,this.value,this.min,this.max);
|
||||
setStorage('rmduration', duration);
|
||||
});
|
||||
|
||||
$("#effect_select").off().on("change", function(event) {
|
||||
efx = $(this).val();
|
||||
if(efx != "__none__")
|
||||
{
|
||||
requestPriorityClear();
|
||||
$(hyperion).one("cmd-clear", function(event) {
|
||||
setTimeout(function() {requestPlayEffect(efx)}, 100);
|
||||
});
|
||||
}
|
||||
sendEffect();
|
||||
});
|
||||
|
||||
$("#remote_input_reseff, #remote_input_rescol").off().on("click", function(){
|
||||
if(this.id == "remote_input_rescol")
|
||||
sendColor();
|
||||
else
|
||||
sendEffect();
|
||||
});
|
||||
|
||||
$("#remote_input_img").change(function(){
|
||||
readImg(this, function(src,width,height){
|
||||
console.log(src,width,height)
|
||||
requestSetImage(src,width,height,duration)
|
||||
});
|
||||
});
|
||||
|
||||
//force first update
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
// global vars
|
||||
var webPrio = 1;
|
||||
var webOrigin = "Web Configuration";
|
||||
var showOptHelp;
|
||||
var currentVersion;
|
||||
var latestVersion;
|
||||
@ -9,6 +10,7 @@ var parsedUpdateJSON = {};
|
||||
var serverSchema = {};
|
||||
var serverConfig = {};
|
||||
var schema;
|
||||
var sysInfo = {};
|
||||
var jsonPort = 19444;
|
||||
var websocket = null;
|
||||
var hyperion = {};
|
||||
@ -20,6 +22,7 @@ var loggingStreamActive = false;
|
||||
var loggingHandlerInstalled = false;
|
||||
var watchdog = 0;
|
||||
var debugMessagesActive = true;
|
||||
var wSess = [];
|
||||
|
||||
function initRestart()
|
||||
{
|
||||
@ -38,7 +41,7 @@ function cron()
|
||||
|
||||
function connectionLostDetection(type)
|
||||
{
|
||||
if ( watchdog > 1 )
|
||||
if ( watchdog > 2 )
|
||||
{
|
||||
var interval_id = window.setInterval("", 9999); // Get a reference to the last
|
||||
for (var i = 1; i < interval_id; i++)
|
||||
@ -170,6 +173,11 @@ function requestServerInfo()
|
||||
sendToHyperion("serverinfo");
|
||||
}
|
||||
|
||||
function requestSysInfo()
|
||||
{
|
||||
sendToHyperion("sysinfo");
|
||||
}
|
||||
|
||||
function requestServerConfigSchema()
|
||||
{
|
||||
sendToHyperion("config","getschema");
|
||||
@ -217,14 +225,24 @@ function requestPriorityClear(prio)
|
||||
sendToHyperion("clear", "", '"priority":'+prio+'');
|
||||
}
|
||||
|
||||
function requestPlayEffect(effectName)
|
||||
function requestClearAll()
|
||||
{
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+'');
|
||||
sendToHyperion("clearall");
|
||||
}
|
||||
|
||||
function requestSetColor(r,g,b)
|
||||
{
|
||||
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+'');
|
||||
function requestPlayEffect(effectName, duration)
|
||||
{
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'"},"priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
|
||||
}
|
||||
|
||||
function requestSetColor(r,g,b,duration)
|
||||
{
|
||||
sendToHyperion("color", "", '"color":['+r+','+g+','+b+'], "priority":'+webPrio+',"duration":'+validateDuration(duration)+',"origin":"'+webOrigin+'"');
|
||||
}
|
||||
|
||||
function requestSetImage(data,width,height,duration)
|
||||
{
|
||||
sendToHyperion("image", "", '"imagedata":"'+data+'", "imagewidth":'+width+',"imageheight":'+height+', "priority":'+webPrio+',"duration":'+validateDuration(duration)+'');
|
||||
}
|
||||
|
||||
function requestSetComponentState(comp, state)
|
||||
@ -271,7 +289,7 @@ function requestWriteEffect(effectName,effectPy,effectArgs)
|
||||
|
||||
function requestTestEffect(effectName,effectPy,effectArgs)
|
||||
{
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'},"priority":'+webPrio+', "pythonScript":"'+effectPy+'"}');
|
||||
sendToHyperion("effect", "", '"effect":{"name":"'+effectName+'", "args":'+effectArgs+'}, "priority":'+webPrio+', "origin":"'+webOrigin+'", "pythonScript":"'+effectPy+'"}');
|
||||
}
|
||||
|
||||
function requestDeleteEffect(effectName)
|
||||
|
12
assets/webconfig/js/lib/bootstrap.min.js
vendored
126
assets/webconfig/js/lib/jquery-linedtextarea.js
vendored
@ -1,126 +0,0 @@
|
||||
/**
|
||||
* jQuery Lined Textarea Plugin
|
||||
* http://alan.blog-city.com/jquerylinedtextarea.htm
|
||||
*
|
||||
* Copyright (c) 2010 Alan Williamson
|
||||
*
|
||||
* Version:
|
||||
* $Id: jquery-linedtextarea.js 464 2010-01-08 10:36:33Z alan $
|
||||
*
|
||||
* Released under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Usage:
|
||||
* Displays a line number count column to the left of the textarea
|
||||
*
|
||||
* Class up your textarea with a given class, or target it directly
|
||||
* with JQuery Selectors
|
||||
*
|
||||
* $(".lined").linedtextarea({
|
||||
* selectedLine: 10,
|
||||
* selectedClass: 'lineselect'
|
||||
* });
|
||||
*
|
||||
* History:
|
||||
* - 2010.01.08: Fixed a Google Chrome layout problem
|
||||
* - 2010.01.07: Refactored code for speed/readability; Fixed horizontal sizing
|
||||
* - 2010.01.06: Initial Release
|
||||
*
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
$.fn.linedtextarea = function(options) {
|
||||
|
||||
// Get the Options
|
||||
var opts = $.extend({}, $.fn.linedtextarea.defaults, options);
|
||||
|
||||
|
||||
/*
|
||||
* Helper function to make sure the line numbers are always
|
||||
* kept up to the current system
|
||||
*/
|
||||
var fillOutLines = function(codeLines, h, lineNo){
|
||||
while ( (codeLines.height() - h ) <= 0 ){
|
||||
if ( lineNo == opts.selectedLine )
|
||||
codeLines.append("<div class='lineno lineselect'>" + lineNo + "</div>");
|
||||
else
|
||||
codeLines.append("<div class='lineno'>" + lineNo + "</div>");
|
||||
|
||||
lineNo++;
|
||||
}
|
||||
return lineNo;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Iterate through each of the elements are to be applied to
|
||||
*/
|
||||
return this.each(function() {
|
||||
var lineNo = 1;
|
||||
var textarea = $(this);
|
||||
|
||||
/* Turn off the wrapping of as we don't want to screw up the line numbers */
|
||||
textarea.attr("wrap", "off");
|
||||
textarea.css({resize:'none'});
|
||||
var originalTextAreaWidth = textarea.outerWidth();
|
||||
|
||||
/* Wrap the text area in the elements we need */
|
||||
textarea.wrap("<div class='linedtextarea'></div>");
|
||||
var linedTextAreaDiv = textarea.parent().wrap("<div class='linedwrap' style='width:" + originalTextAreaWidth + "px'></div>");
|
||||
var linedWrapDiv = linedTextAreaDiv.parent();
|
||||
|
||||
linedWrapDiv.prepend("<div class='lines' style='width:50px'></div>");
|
||||
|
||||
var linesDiv = linedWrapDiv.find(".lines");
|
||||
linesDiv.height( textarea.height() + 6 );
|
||||
|
||||
|
||||
/* Draw the number bar; filling it out where necessary */
|
||||
linesDiv.append( "<div class='codelines'></div>" );
|
||||
var codeLinesDiv = linesDiv.find(".codelines");
|
||||
lineNo = fillOutLines( codeLinesDiv, linesDiv.height(), 1 );
|
||||
|
||||
/* Move the textarea to the selected line */
|
||||
if ( opts.selectedLine != -1 && !isNaN(opts.selectedLine) ){
|
||||
var fontSize = parseInt( textarea.height() / (lineNo-2) );
|
||||
var position = parseInt( fontSize * opts.selectedLine ) - (textarea.height()/2);
|
||||
textarea[0].scrollTop = position;
|
||||
}
|
||||
|
||||
|
||||
/* Set the width */
|
||||
var sidebarWidth = linesDiv.outerWidth();
|
||||
var paddingHorizontal = parseInt( linedWrapDiv.css("border-left-width") ) + parseInt( linedWrapDiv.css("border-right-width") ) + parseInt( linedWrapDiv.css("padding-left") ) + parseInt( linedWrapDiv.css("padding-right") );
|
||||
var linedWrapDivNewWidth = originalTextAreaWidth - paddingHorizontal;
|
||||
var textareaNewWidth = originalTextAreaWidth - sidebarWidth - paddingHorizontal - 20;
|
||||
|
||||
textarea.width( textareaNewWidth );
|
||||
linedWrapDiv.width( linedWrapDivNewWidth );
|
||||
|
||||
|
||||
|
||||
/* React to the scroll event */
|
||||
textarea.scroll( function(tn){
|
||||
var domTextArea = $(this)[0];
|
||||
var scrollTop = domTextArea.scrollTop;
|
||||
var clientHeight = domTextArea.clientHeight;
|
||||
codeLinesDiv.css( {'margin-top': (-1*scrollTop) + "px"} );
|
||||
lineNo = fillOutLines( codeLinesDiv, scrollTop + clientHeight, lineNo );
|
||||
});
|
||||
|
||||
|
||||
/* Should the textarea get resized outside of our control */
|
||||
textarea.resize( function(tn){
|
||||
var domTextArea = $(this)[0];
|
||||
linesDiv.height( domTextArea.clientHeight + 6 );
|
||||
});
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
// default options
|
||||
$.fn.linedtextarea.defaults = {
|
||||
selectedLine: -1,
|
||||
selectedClass: 'lineselect'
|
||||
};
|
||||
})(jQuery);
|
49
assets/webconfig/js/lib/jsonaceeditor.min.js
vendored
Normal file
@ -6690,7 +6690,10 @@ JSONEditor.defaults.themes.bootstrap3 = JSONEditor.AbstractTheme.extend({
|
||||
},
|
||||
getButton: function(text, icon, title) {
|
||||
var el = this._super(text, icon, title);
|
||||
el.className += 'btn btn-sm btn-primary';
|
||||
if(icon.className.includes("fa-times"))
|
||||
el.className += 'btn btn-sm btn-danger';
|
||||
else
|
||||
el.className += 'btn btn-sm btn-primary';
|
||||
return el;
|
||||
},
|
||||
getTable: function() {
|
||||
|
@ -5,7 +5,8 @@ $(function() {
|
||||
|
||||
});
|
||||
|
||||
var oldWidth;
|
||||
var mInit = false;
|
||||
|
||||
//Loads the correct sidebar on window load,
|
||||
//collapses the sidebar on window resize.
|
||||
// Sets the min-height of #page-wrapper to window size
|
||||
@ -13,28 +14,32 @@ $(function() {
|
||||
$(window).bind("load resize", function() {
|
||||
var topOffset = 50;
|
||||
var width = (this.window.innerWidth > 0) ? this.window.innerWidth : this.screen.width;
|
||||
if(oldWidth != width)
|
||||
if (width < 768)
|
||||
{
|
||||
if (width < 768)
|
||||
if(!mInit)
|
||||
{
|
||||
mInit = true;
|
||||
$('#main-nav').css({"position":"fixed","right":"-235px","top":"45px","width":"230px","border":"1px solid rgba(0, 0, 0, .2)","box-shadow":"0 3px 9px rgba(0, 0, 0, .5)"});
|
||||
topOffset = 100; // 2-row-menu
|
||||
$('.mnava').on('click', function(){
|
||||
$("html, body").animate({ scrollTop: 0 }, "fast");
|
||||
|
||||
$('.mnava').bind('click.smnav', function(){
|
||||
$( "#main-nav" ).animate({right: "-235px",}, 300 );
|
||||
$(".navbar-toggle").addClass("closed");
|
||||
});
|
||||
}
|
||||
else
|
||||
$( "#main-nav" ).removeAttr("style").css({"position":"absolute"});
|
||||
}
|
||||
else
|
||||
{
|
||||
$( "#main-nav" ).removeAttr('style').css({"position":"fixed"});
|
||||
$( ".mnava" ).unbind('click.smnav');
|
||||
mInit = false;
|
||||
}
|
||||
|
||||
|
||||
var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
|
||||
height = height - topOffset;
|
||||
if (height < 1) height = 1;
|
||||
if (height > topOffset) {
|
||||
$("#page-wrapper").css("min-height", (height-11) + "px");
|
||||
}
|
||||
var height = ((this.window.innerHeight > 0) ? this.window.innerHeight : this.screen.height) - 1;
|
||||
height = height - topOffset;
|
||||
if (height < 1) height = 1;
|
||||
if (height > topOffset) {
|
||||
$("#page-wrapper").css("min-height", (height-11) + "px");
|
||||
}
|
||||
});
|
||||
|
||||
@ -55,7 +60,7 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('.navbar-toggle').off().on('click', function(){
|
||||
$('.navbar-toggle').on('click', function(){
|
||||
if($('#main-nav').css("right") != "-2px")
|
||||
{
|
||||
$('#main-nav').animate({right: "-2px",}, 300 );
|
||||
|
@ -115,4 +115,24 @@ $(document).ready( function() {
|
||||
//hide menu elements
|
||||
if (storedAccess != 'expert')
|
||||
$('#load_webconfig').toggle(false);
|
||||
|
||||
|
||||
// instance switcher
|
||||
$('#btn_instanceswitch').off().on('click',function() {
|
||||
var lsys = sysInfo.system.hostName+':'+serverConfig.webConfig.port;
|
||||
showInfoDialog('iswitch', $.i18n('InfoDialog_iswitch_title'), $.i18n('InfoDialog_iswitch_text'));
|
||||
|
||||
for (var i = 0; i<wSess.length; i++)
|
||||
{
|
||||
|
||||
if(lsys != wSess[i].host+':'+wSess[i].port)
|
||||
$('#id_select').append(createSelOpt('http://'+wSess[i].address+':'+wSess[i].port, wSess[i].name))
|
||||
}
|
||||
|
||||
$('#id_btn_saveset').off().on('click',function() {
|
||||
$("#loading_overlay").addClass("overlay");
|
||||
window.location.href = $('#id_select').val()
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -48,6 +48,14 @@ function debugMessage(msg)
|
||||
}
|
||||
}
|
||||
|
||||
function validateDuration(d)
|
||||
{
|
||||
if(typeof d === "undefined" || d < 0)
|
||||
return d = 0;
|
||||
else
|
||||
return d *= 1000;
|
||||
}
|
||||
|
||||
function getHashtag()
|
||||
{
|
||||
if(getStorage('lasthashtag', true) != null)
|
||||
@ -81,7 +89,7 @@ function loadContent(event)
|
||||
$("#page-content").off();
|
||||
$("#page-content").load("/content/"+tag+".html", function(response,status,xhr){
|
||||
if(status == "error")
|
||||
$("#page-content").html('<h3>The page you requested is no longer available, click on another menu item!</h3>');
|
||||
$("#page-content").html('<h3>'+$.i18n('info_404')+'</h3>');
|
||||
removeOverlay();
|
||||
});
|
||||
}
|
||||
@ -146,6 +154,11 @@ function showInfoDialog(type,header,message)
|
||||
$('#id_footer').html('<button type="button" id="id_btn_saveset" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saveandreload')+'</button>');
|
||||
$('#id_footer').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
|
||||
}
|
||||
else if (type == "iswitch"){
|
||||
$('#id_body').html('<img style="margin-bottom:20px" src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_footer').html('<button type="button" id="id_btn_saveset" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-fw fa-exchange"></i>'+$.i18n('general_btn_iswitch')+'</button>');
|
||||
$('#id_footer').append('<button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
|
||||
}
|
||||
else if (type == "uilock"){
|
||||
$('#id_body').html('<img src="img/hyperion/hyperionlogo.png" alt="Redefine ambient light!">');
|
||||
$('#id_footer').html('<b>'+$.i18n('InfoDialog_nowrite_foottext')+'</b>');
|
||||
@ -166,7 +179,7 @@ function showInfoDialog(type,header,message)
|
||||
$('#id_body').append('<h4 style="font-weight:bold;text-transform:uppercase;">'+header+'</h4>');
|
||||
$('#id_body').append(message);
|
||||
|
||||
if(type == "select")
|
||||
if(type == "select" || type == "iswitch")
|
||||
$('#id_body').append('<select id="id_select" class="form-control" style="margin-top:10px;width:auto;"></select>');
|
||||
|
||||
$("#modal_dialog").modal({
|
||||
@ -184,7 +197,7 @@ function createHintH(type, text, container)
|
||||
$('#'+container).prepend('<div class="'+tclass+'"><h4 style="font-size:16px">'+text+'</h4><hr/></div>');
|
||||
}
|
||||
|
||||
function createHint(type, text, container)
|
||||
function createHint(type, text, container, buttonid, buttontxt)
|
||||
{
|
||||
var fe, tclass;
|
||||
|
||||
@ -209,8 +222,15 @@ function createHint(type, text, container)
|
||||
tclass = "warning-hint";
|
||||
}
|
||||
|
||||
if(fe == "")
|
||||
$('#'+container).prepend('<div class="'+tclass+'">'+text+'</div>');
|
||||
if(buttonid)
|
||||
buttonid = '<p><button id="'+buttonid+'" class="btn btn-wizard" style="margin-top:15px;">'+text+'</button></p>';
|
||||
else
|
||||
buttonid = "";
|
||||
|
||||
if(type == "intro")
|
||||
$('#'+container).prepend('<div class="bs-callout bs-callout-primary" style="margin-top:0px"><h4>'+$.i18n("conf_helptable_expl")+'</h4>'+text+'</div>');
|
||||
else if(type == "wizard")
|
||||
$('#'+container).prepend('<div class="bs-callout bs-callout-wizard" style="margin-top:0px"><h4>'+$.i18n("wiz_wizavail")+'</h4>'+$.i18n('wiz_guideyou',text)+buttonid+'</div>');
|
||||
else
|
||||
{
|
||||
createTable('','htb',container, true, tclass);
|
||||
@ -218,6 +238,40 @@ function createHint(type, text, container)
|
||||
}
|
||||
}
|
||||
|
||||
function valValue(id,value,min,max)
|
||||
{
|
||||
if(typeof max === 'undefined' || max == "")
|
||||
max = 999999;
|
||||
|
||||
if(Number(value) > Number(max))
|
||||
{
|
||||
$('#'+id).val(max);
|
||||
showInfoDialog("warning","",$.i18n('edt_msg_error_maximum_incl',max));
|
||||
return max;
|
||||
}
|
||||
else if(Number(value) < Number(min))
|
||||
{
|
||||
$('#'+id).val(min);
|
||||
showInfoDialog("warning","",$.i18n('edt_msg_error_minimum_incl',min));
|
||||
return min;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function readImg(input,cb)
|
||||
{
|
||||
if (input.files && input.files[0]) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = function (e) {
|
||||
var i = new Image();
|
||||
i.src = e.target.result;
|
||||
cb(i.src,i.width,i.height);
|
||||
}
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function isJsonString(str)
|
||||
{
|
||||
try
|
||||
@ -273,6 +327,28 @@ function createJsonEditor(container,schema,setconfig,usePanel)
|
||||
return editor;
|
||||
}
|
||||
|
||||
function buildWL(link,linkt,cl)
|
||||
{
|
||||
var baseLink = "https://docs.hyperion-project.org/";
|
||||
var lang;
|
||||
|
||||
if(typeof linkt == "undefined")
|
||||
linkt = "Placeholder";
|
||||
|
||||
if(storedLang == "de" || navigator.locale == "de")
|
||||
lang = "de";
|
||||
else
|
||||
lang = "en";
|
||||
|
||||
if(cl === true)
|
||||
{
|
||||
linkt = $.i18n(linkt);
|
||||
return '<div class="bs-callout bs-callout-primary"><h4>'+linkt+'</h4>'+$.i18n('general_wiki_moreto',linkt)+': <a href="'+baseLink+lang+'/'+link+'" target="_blank">'+linkt+'<a></div>'
|
||||
}
|
||||
else
|
||||
return ': <a href="'+baseLink+lang+'/'+link+'" target="_blank">'+linkt+'<a>';
|
||||
}
|
||||
|
||||
function rgbToHex(rgb)
|
||||
{
|
||||
if(rgb.length == 3)
|
||||
@ -286,6 +362,16 @@ function rgbToHex(rgb)
|
||||
debugMessage('rgbToHex: Given rgb is no array or has wrong length');
|
||||
}
|
||||
|
||||
function hexToRgb(hex) {
|
||||
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
||||
return result ? {
|
||||
r: parseInt(result[1], 16),
|
||||
g: parseInt(result[2], 16),
|
||||
b: parseInt(result[3], 16)
|
||||
} : null;
|
||||
}
|
||||
|
||||
|
||||
function createCP(id, color, cb)
|
||||
{
|
||||
if(Array.isArray(color))
|
||||
|
@ -1,4 +1,4 @@
|
||||
$(document).ready( function() {
|
||||
|
||||
//clear priority and other tasks if people reload the page or lost connection while a wizard was active
|
||||
$(hyperion).one("ready", function(event) {
|
||||
if(getStorage("wizardactive") === 'true')
|
||||
@ -517,21 +517,29 @@ $(document).ready( function() {
|
||||
$('#btn_wizard_colorcalibration').off().on('click', startWizardCC);
|
||||
|
||||
//hue wizard
|
||||
var hueIPs = [];
|
||||
var hueIPsinc = 0;
|
||||
var lightIDs = null;
|
||||
var huePosTop = {hscan: {maximum: 0.85,minimum: 0.15},index: 0,vscan: {maximum: 0.2,minimum: 0}};
|
||||
var huePosBottom = {hscan: {maximum: 0.85,minimum: 0.15},index: 2,vscan: {maximum: 1,minimum: 0.8}};
|
||||
var huePosLeft = {hscan: {maximum: 0.15,minimum: 0},index: 1,vscan: {maximum: 0.85,minimum: 0.15}};
|
||||
var huePosRight = {hscan: {maximum: 1,minimum: 0.85},index: 3,vscan: {maximum: 0.85,minimum: 0.15}};
|
||||
var huePosEntire = {hscan: {maximum: 1.0,minimum: 0.0},index: 0,vscan: {maximum: 1.0,minimum: 0.0}};
|
||||
|
||||
function startWizardPhilipsHue()
|
||||
{
|
||||
//create html
|
||||
$('#wiz_header').html('<i class="fa fa-magic fa-fw"></i>'+$.i18n('wiz_hue_title'));
|
||||
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">'+$.i18n('wiz_hue_title')+'</h4><p>'+$.i18n('wiz_hue_intro1')+'</p><p style="font-weight:bold;">'+$.i18n('wiz_hue_intro2')+'</p>');
|
||||
$('#wizp1_body').html('<h4 style="font-weight:bold;text-transform:uppercase;">'+$.i18n('wiz_hue_title')+'</h4><p>'+$.i18n('wiz_hue_intro1')+'</p>');
|
||||
$('#wizp1_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_cont"><i class="fa fa-fw fa-check"></i>'+$.i18n('general_btn_continue')+'</button><button type="button" class="btn btn-danger" data-dismiss="modal"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
|
||||
$('#wizp2_body').append('<span id="ip_alert" style="display:none; color:red; font-weight: bold;">'+$.i18n('wiz_hue_failure_ip')+'</span>');
|
||||
$('#wizp2_body').append('<span id="abortConnection" style="display:none; color:red; font-weight: bold;">'+$.i18n('wiz_hue_failure_connection')+'</span><br />');
|
||||
$('#wizp2_body').append('<div class="form-group"><label>'+$.i18n('wiz_hue_ip')+'</label><div class="input-group" style="width:150px"><input type="text" class="input-group" id="ip"></div></div>');
|
||||
$('#wizp2_body').append('<div class="form-group"><label>'+$.i18n('wiz_hue_username')+'</label<div class="input-group" style="width:150px"><input type="text" class="input-group" id="user" readonly="readonly"></div></div>');
|
||||
$('#wizp2_body').append('<div id="hue_lights" class="row"><table></table></div>');
|
||||
$('#wizp2_footer').html('<button type="button" class="btn btn-success" id="wiz_hue_create_user"> <i class="fa fa-floppy-o"></i>'+$.i18n('wiz_hue_create_user')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
|
||||
$('#wizp3_body').html('<span>'+$.i18n('wiz_hue_press_link')+'</span> <br /><br /><center><span id="connectionTime"></span><br /><img src="/img/hyperion/ring-alt.svg" /><center>');
|
||||
|
||||
|
||||
$('#wizp2_body').html('<div id="wh_topcontainer"></div>');
|
||||
$('#wh_topcontainer').append('<p style="font-weight:bold">'+$.i18n('wiz_hue_desc1')+'</p><div class="form-group"><label>'+$.i18n('wiz_hue_ip')+'</label><div class="input-group" style="width:175px"><input type="text" class="input-group form-control" id="ip"><span class="input-group-addon" id="retry_bridge" style="cursor:pointer"><i class="fa fa-refresh"></i></span></div></div><span style="font-weight:bold;color:red" id="wiz_hue_ipstate"></span>');
|
||||
$('#wh_topcontainer').append('<div class="form-group" id="usrcont" style="display:none"><label>'+$.i18n('wiz_hue_username')+'</label><div class="input-group" style="width:250px"><input type="text" class="form-control" id="user"><span class="input-group-addon" id="retry_usr" style="cursor:pointer"><i class="fa fa-refresh"></i></span></div><span style="font-weight:bold;color:red" id="wiz_hue_usrstate"></span><br><button type="button" class="btn btn-primary" style="display:none" id="wiz_hue_create_user"> <i class="fa fa-fw fa-plus"></i>'+$.i18n('wiz_hue_create_user')+'</button></div>');
|
||||
$('#wizp2_body').append('<div id="hue_ids_t" style="display:none"><p style="font-weight:bold">'+$.i18n('wiz_hue_desc2')+'</p></div>');
|
||||
createTable("lidsh", "lidsb", "hue_ids_t");
|
||||
$('.lidsh').append(createTableRow([$.i18n('edt_dev_spec_lightid_title'),$.i18n('wiz_hue_pos'),$.i18n('wiz_hue_ident')], true));
|
||||
$('#wizp2_footer').html('<button type="button" class="btn btn-primary" id="btn_wiz_save" style="display:none"><i class="fa fa-fw fa-save"></i>'+$.i18n('general_btn_saverestart')+'</button><button type="button" class="btn btn-danger" id="btn_wiz_abort"><i class="fa fa-fw fa-close"></i>'+$.i18n('general_btn_cancel')+'</button>');
|
||||
$('#wizp3_body').html('<span>'+$.i18n('wiz_hue_press_link')+'</span> <br /><br /><center><span id="connectionTime"></span><br /><i class="fa fa-cog fa-spin" style="font-size:100px"></i></center>');
|
||||
|
||||
//open modal
|
||||
$("#wizard_modal").modal({
|
||||
@ -548,17 +556,207 @@ $(document).ready( function() {
|
||||
});
|
||||
}
|
||||
|
||||
function checkHueBridge(cb,hueUser){
|
||||
var usr = "";
|
||||
|
||||
if(typeof hueUser != "undefined")
|
||||
usr = hueUser;
|
||||
|
||||
$.ajax({
|
||||
url: 'http://'+hueIPs[hueIPsinc].internalipaddress+'/api/'+usr,
|
||||
contentType: 'application/json',
|
||||
type: 'GET',
|
||||
timeout: 2000
|
||||
})
|
||||
.done( function( data, textStatus, jqXHR ) {
|
||||
if(Array.isArray(data) && data[0].error && data[0].error.type == 4)
|
||||
cb(true);
|
||||
else if(Array.isArray(data) && data[0].error)
|
||||
cb(false);
|
||||
else
|
||||
cb(true);
|
||||
})
|
||||
.fail( function( jqXHR, textStatus ) {
|
||||
cb(false);
|
||||
});
|
||||
}
|
||||
|
||||
function checkUserResult(reply){
|
||||
if(reply)
|
||||
{
|
||||
$('#wiz_hue_usrstate').html("");
|
||||
$('#wiz_hue_create_user').toggle(false);
|
||||
get_hue_lights();
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#wiz_hue_usrstate').html($.i18n('wiz_hue_failure_user'));
|
||||
$('#wiz_hue_create_user').toggle(true);
|
||||
}
|
||||
};
|
||||
|
||||
function checkBridgeResult(reply){
|
||||
if(reply)
|
||||
{
|
||||
//abort checking, first reachable result is used
|
||||
$('#wiz_hue_ipstate').html("");
|
||||
$('#ip').val(hueIPs[hueIPsinc].internalipaddress)
|
||||
|
||||
//now check hue user on this bridge
|
||||
$('#usrcont').toggle(true);
|
||||
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
|
||||
}
|
||||
else
|
||||
{
|
||||
//increment and check again
|
||||
if(hueIPs.length-1 > hueIPsinc)
|
||||
{
|
||||
hueIPsinc++;
|
||||
checkHueBridge(checkBridgeResult);
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#usrcont').toggle(false);
|
||||
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function assignHuePos(id, pos, inc)
|
||||
{
|
||||
var i = null;
|
||||
|
||||
if(pos == "top")
|
||||
i = huePosTop;
|
||||
else if(pos == "bottom")
|
||||
i = huePosBottom;
|
||||
else if(pos == "left")
|
||||
i = huePosLeft;
|
||||
else if(pos == "right")
|
||||
i = huePosRight;
|
||||
else
|
||||
i = huePosEntire;
|
||||
|
||||
i.index = inc;
|
||||
return i;
|
||||
}
|
||||
|
||||
function identHueId(id, off)
|
||||
{
|
||||
var on = true;
|
||||
if(off !== true)
|
||||
setTimeout(identHueId,1500,id,true);
|
||||
else
|
||||
on = false;
|
||||
|
||||
$.ajax({
|
||||
url: 'http://'+$('#ip').val()+'/api/'+$('#user').val()+'/lights/'+id+'/state',
|
||||
type: 'PUT',
|
||||
timeout: 2000,
|
||||
data: ' {"on":'+on+', "sat":254, "bri":254,"hue":47000}'
|
||||
})
|
||||
}
|
||||
|
||||
function getHueIPs(){
|
||||
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_searchb'));
|
||||
$.ajax({
|
||||
url: 'https://www.meethue.com/api/nupnp',
|
||||
crossDomain: true,
|
||||
type: 'GET',
|
||||
timeout: 3000
|
||||
})
|
||||
.done( function( data, textStatus, jqXHR ) {
|
||||
if(data.length == 0)
|
||||
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
|
||||
else
|
||||
{
|
||||
hueIPs = data;
|
||||
checkHueBridge(checkBridgeResult);
|
||||
}
|
||||
})
|
||||
.fail( function( jqXHR, textStatus ) {
|
||||
$('#wiz_hue_ipstate').html($.i18n('wiz_hue_failure_ip'));
|
||||
});
|
||||
};
|
||||
|
||||
function beginWizardHue()
|
||||
{
|
||||
//listen for continue
|
||||
$('#wiz_hue_create_user').off().on('click',function() {
|
||||
doWizardHue();
|
||||
//check if ip is empty/reachable/search for bridge
|
||||
if(conf_editor.getEditor("root.specificOptions.output").getValue() == "")
|
||||
getHueIPs();
|
||||
else
|
||||
{
|
||||
var ip = conf_editor.getEditor("root.specificOptions.output").getValue();
|
||||
$('#ip').val(ip);
|
||||
hueIPs.push({internalipaddress : ip});
|
||||
checkHueBridge(checkBridgeResult);
|
||||
|
||||
var usr = conf_editor.getEditor("root.specificOptions.username").getValue();
|
||||
$('#user').val(usr);
|
||||
}
|
||||
|
||||
$('#retry_bridge').off().on('click', function(){
|
||||
hueIPs[0].internalipaddress = $('#ip').val();
|
||||
hueIPsinc = 0;
|
||||
checkHueBridge(checkBridgeResult);
|
||||
});
|
||||
|
||||
$('#retry_usr').off().on('click', function(){
|
||||
checkHueBridge(checkUserResult,$('#user').val() ? $('#user').val() : "newdeveloper");
|
||||
});
|
||||
|
||||
$('#wiz_hue_create_user').off().on('click',function() {
|
||||
createHueUser();
|
||||
});
|
||||
|
||||
$('#btn_wiz_save').off().on("click", function(){
|
||||
var hueLedConfig = [];
|
||||
var finalLightIds = [];
|
||||
|
||||
//create hue led config
|
||||
var incC = 0;
|
||||
for(key in lightIDs)
|
||||
{
|
||||
if($('#hue_'+key).val() != "disabled")
|
||||
{
|
||||
hueLedConfig.push(assignHuePos(key, $('#hue_'+key).val(), incC));
|
||||
finalLightIds.push(parseInt(key));
|
||||
incC++;
|
||||
}
|
||||
}
|
||||
|
||||
serverConfig.leds = hueLedConfig;
|
||||
|
||||
//Adjust gamma, brightness and compensation
|
||||
var c = serverConfig.color.channelAdjustment[0];
|
||||
c.gammaBlue = 1.0;
|
||||
c.gammaRed = 1.0;
|
||||
c.gammaGreen = 1.0;
|
||||
c.brightness = 100;
|
||||
c.brightnessCompensation = 0;
|
||||
|
||||
//device config
|
||||
var d = serverConfig.device;
|
||||
d.output = $('#ip').val();
|
||||
d.lightIds = finalLightIds;
|
||||
d.username = $('#user').val();
|
||||
d.type = "philipshue";
|
||||
d.transitiontime = 1;
|
||||
d.switchOffOnBlack = true;
|
||||
|
||||
//smoothing off
|
||||
serverConfig.smoothing.enable = false;
|
||||
|
||||
requestWriteConfig(serverConfig, true);
|
||||
setTimeout(initRestart,200);
|
||||
});
|
||||
|
||||
$('#btn_wiz_abort').off().on('click', resetWizard);
|
||||
}
|
||||
|
||||
function doWizardHue()
|
||||
function createHueUser()
|
||||
{
|
||||
var connectionRetries = 15;
|
||||
var connectionRetries = 30;
|
||||
var data = {"devicetype":"hyperion#"+Date.now()};
|
||||
var UserInterval = setInterval(function(){
|
||||
$.ajax({
|
||||
@ -580,8 +778,6 @@ $(document).ready( function() {
|
||||
}
|
||||
else
|
||||
{
|
||||
$("#abortConnection").hide();
|
||||
$("#ip_alert").hide();
|
||||
if (typeof r[0].error != 'undefined') {
|
||||
console.log(connectionRetries+": link not pressed");
|
||||
}
|
||||
@ -590,9 +786,7 @@ $(document).ready( function() {
|
||||
$('#wizp2').toggle(true);
|
||||
$('#wizp3').toggle(false);
|
||||
$('#user').val(r[0].success.username);
|
||||
|
||||
$( "#hue_lights" ).empty();
|
||||
get_hue_lights();
|
||||
checkHueBridge(checkUserResult,r[0].success.username);
|
||||
clearInterval(UserInterval);
|
||||
}
|
||||
}
|
||||
@ -601,7 +795,6 @@ $(document).ready( function() {
|
||||
$('#wizp1').toggle(false);
|
||||
$('#wizp2').toggle(true);
|
||||
$('#wizp3').toggle(false);
|
||||
$("#ip_alert").show();
|
||||
clearInterval(UserInterval);
|
||||
}
|
||||
});
|
||||
@ -615,8 +808,34 @@ $(document).ready( function() {
|
||||
processData: false,
|
||||
contentType: 'application/json',
|
||||
success: function(r) {
|
||||
for(var lightid in r){
|
||||
$('#hue_lights').append('<tr><td>ID: '+lightid+'</td><td>Name: '+r[lightid].name+'</td></tr>');
|
||||
if(Object.keys(r).length > 0)
|
||||
{
|
||||
$('#wh_topcontainer').toggle(false);
|
||||
$('#hue_ids_t, #btn_wiz_save').toggle(true);
|
||||
lightIDs = r;
|
||||
|
||||
for(var lightid in r)
|
||||
{
|
||||
$('.lidsb').append(createTableRow([lightid+' ('+r[lightid].name+')', '<select id="hue_'+lightid+'" class="hue_sel_watch form-control"><option value="disabled">'+$.i18n('wiz_hue_ids_disabled')+'</option><option value="top">'+$.i18n('conf_leds_layout_cl_top')+'</option><option value="bottom">'+$.i18n('conf_leds_layout_cl_bottom')+'</option><option value="left">'+$.i18n('conf_leds_layout_cl_left')+'</option><option value="right">'+$.i18n('conf_leds_layout_cl_right')+'</option><option value="entire">'+$.i18n('wiz_hue_ids_entire')+'</option></select>','<button class="btn btn-sm btn-primary" onClick=identHueId('+lightid+')>'+$.i18n('wiz_hue_blinkblue',lightid)+'</button>']));
|
||||
}
|
||||
|
||||
$('.hue_sel_watch').bind("change", function(){
|
||||
var cC = 0;
|
||||
for(key in lightIDs)
|
||||
{
|
||||
if($('#hue_'+key).val() != "disabled")
|
||||
{
|
||||
cC++;
|
||||
}
|
||||
}
|
||||
cC == 0 ? $('#btn_wiz_save').attr("disabled",true) : $('#btn_wiz_save').attr("disabled",false);
|
||||
});
|
||||
|
||||
$('.hue_sel_watch').trigger('change');
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#wizp2_body').html('<h4>'+$.i18n('wiz_hue_noids')+'</h4>')
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -627,9 +846,5 @@ $(document).ready( function() {
|
||||
$('#wizp1').toggle(false);
|
||||
$('#wizp2').toggle(true);
|
||||
$('#wizp3').toggle(false);
|
||||
$("#abortConnection").show();
|
||||
|
||||
}
|
||||
|
||||
$('#btn_wizard_philipshue').off().on('click',startWizardPhilipsHue);
|
||||
});
|
||||
$("#wiz_hue_usrstate").html($.i18n('wiz_hue_failure_connection'));
|
||||
}
|
BIN
assets/webconfig/mstile-144x144.png
Normal file
After Width: | Height: | Size: 24 KiB |
@ -27,13 +27,15 @@
|
||||
/// * [device type specific configuration]
|
||||
/// * 'colorOrder' : The order of the color bytes ('rgb', 'rbg', 'bgr', etc.).
|
||||
/// * 'rewriteTime': in ms. Data is resend to leds, if no new data is available in thistime. 0 means no refresh
|
||||
/// * 'latchTime' : minimum time between led writes. 0 means no limit. default 10 means a rate of max 100Hz write time
|
||||
"device" :
|
||||
{
|
||||
"type" : "file",
|
||||
"output" : "/dev/null",
|
||||
"rate" : 1000000,
|
||||
"colorOrder" : "rgb",
|
||||
"rewriteTime": 0
|
||||
"rewriteTime": 0,
|
||||
"latchTime" : 10
|
||||
},
|
||||
|
||||
/// Color manipulation configuration used to tune the output colors to specific surroundings.
|
||||
@ -49,10 +51,11 @@
|
||||
/// * 'gammaRed'/'gammaGreen'/'gammaBlue' : Gamma value for each channel
|
||||
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
|
||||
/// * 'id' : The unique identifier of the channel adjustments (eg 'device_1')
|
||||
/// * 'backlightThreshold' : Minimum brightness (backlight)
|
||||
/// * 'backlightColored' : backlight with color, instead of white
|
||||
/// * 'brightness' : Between 0.0-0.5 the brightness is linearized (white is as bright as red, is as bright as yellow).
|
||||
/// Between 0.5-1.0 the linearization reduces slowly until it's gone with 1.0 (white is 3x brighter than red, yellow is 2x brighter than red)
|
||||
/// * 'backlightThreshold' : Minimum brightness (backlight)
|
||||
/// * 'backlightColored' : backlight with color, instead of white
|
||||
/// * 'brightness' : overall brightness
|
||||
/// * 'brightnessCompensation' : 100 means brightness differences are compensated (white is as bright as red, is as bright as yellow.
|
||||
/// 0 means white is 3x brighter than red, yellow is 2x brighter than red
|
||||
"color" :
|
||||
{
|
||||
"imageToLedMappingType" : "multicolor_mean",
|
||||
@ -72,9 +75,10 @@
|
||||
"gammaRed" : 1.5,
|
||||
"gammaGreen" : 1.5,
|
||||
"gammaBlue" : 1.5,
|
||||
"backlightThreshold" : 0.0,
|
||||
"backlightThreshold" : 0,
|
||||
"backlightColored" : false,
|
||||
"brightness" : 0.5
|
||||
"brightness" : 100,
|
||||
"brightnessCompensation" : 80
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -114,6 +118,7 @@
|
||||
/// * cropRight : Cropping from the right [default=0]
|
||||
/// * cropTop : Cropping from the top [default=0]
|
||||
/// * cropBottom : Cropping from the bottom [default=0]
|
||||
/// * signalDetection : enable/disable signal detection [default=true]
|
||||
/// * redSignalThreshold : Signal threshold for the red channel between 0.0 and 1.0 [default=0.0]
|
||||
/// * greenSignalThreshold : Signal threshold for the green channel between 0.0 and 1.0 [default=0.0]
|
||||
/// * blueSignalThreshold : Signal threshold for the blue channel between 0.0 and 1.0 [default=0.0]
|
||||
@ -142,6 +147,7 @@
|
||||
"redSignalThreshold" : 0.0,
|
||||
"greenSignalThreshold" : 0.0,
|
||||
"blueSignalThreshold" : 0.0,
|
||||
"signalDetection" : true,
|
||||
"signalDetectionVerticalOffsetMin" : 0.25,
|
||||
"signalDetectionHorizontalOffsetMin" : 0.25,
|
||||
"signalDetectionVerticalOffsetMax" : 0.75,
|
||||
@ -186,7 +192,7 @@
|
||||
|
||||
/// The black border configuration, contains the following items:
|
||||
/// * enable : true if the detector should be activated
|
||||
/// * threshold : Value below which a pixel is regarded as black (value between 0.0 and 1.0)
|
||||
/// * threshold : Value below which a pixel is regarded as black (value between 0 and 100 [%])
|
||||
/// * unknownFrameCnt : Number of frames without any detection before the border is set to 0 (default 600)
|
||||
/// * borderFrameCnt : Number of frames before a consistent detected border gets set (default 50)
|
||||
/// * maxInconsistentCnt : Number of inconsistent frames that are ignored before a new border gets a chance to proof consistency
|
||||
@ -195,7 +201,7 @@
|
||||
"blackborderdetector" :
|
||||
{
|
||||
"enable" : true,
|
||||
"threshold" : 0.05,
|
||||
"threshold" : 5,
|
||||
"unknownFrameCnt" : 600,
|
||||
"borderFrameCnt" : 50,
|
||||
"maxInconsistentCnt" : 10,
|
||||
@ -288,19 +294,19 @@
|
||||
/// The configuration of the boblight server which enables the boblight remote interface
|
||||
/// * enable : Enable or disable the boblight server (true/false)
|
||||
/// * port : Port at which the boblight server is started
|
||||
/// * priority : Priority of the boblight server (Default=200) HINT: lower value result in HIGHER priority!
|
||||
/// * priority : Priority of the boblight server (Default=201) HINT: lower value result in HIGHER priority!
|
||||
"boblightServer" :
|
||||
{
|
||||
"enable" : false,
|
||||
"port" : 19333,
|
||||
"priority" : 200
|
||||
"priority" : 201
|
||||
},
|
||||
|
||||
/// The configuration of the udp listener
|
||||
/// * enable : Enable or disable the udp listener (true/false)
|
||||
/// * address : The listener address, pre configured is multicast which listen also to unicast ip addresses at the same time. If emtpy, multicast is disabled and it also accepts unicast from all IPs
|
||||
/// * port : Port at which the udp listener starts
|
||||
/// * priority : Priority of the udp listener server (Default=190)
|
||||
/// * priority : Priority of the udp listener server (Default=200)
|
||||
/// * timeout : The timeout sets the timelimit for a "soft" off of the udp listener, if no packages are received (for example to switch to a gabber or InitialEffect - background-effect)
|
||||
/// * shared : If true, the udp listener is shared across all hyperion instances (if using more than one (forwarder))
|
||||
"udpListener" :
|
||||
@ -308,7 +314,7 @@
|
||||
"enable" : false,
|
||||
"address" : "239.255.28.01",
|
||||
"port" : 2801,
|
||||
"priority" : 190,
|
||||
"priority" : 200,
|
||||
"timeout" : 10000,
|
||||
"shared" : false
|
||||
},
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"general" :
|
||||
{
|
||||
"name" : "MyHyperionConfig",
|
||||
"name" : "My Hyperion Config",
|
||||
"showOptHelp" : true,
|
||||
"configVersion" : 2
|
||||
},
|
||||
@ -16,7 +16,8 @@
|
||||
"output" : "/dev/null",
|
||||
"rate" : 1000000,
|
||||
"colorOrder" : "rgb",
|
||||
"rewriteTime": 5000
|
||||
"rewriteTime": 5000,
|
||||
"latchTime" : 10
|
||||
},
|
||||
|
||||
"color" :
|
||||
@ -38,9 +39,10 @@
|
||||
"gammaRed" : 1.5,
|
||||
"gammaGreen" : 1.5,
|
||||
"gammaBlue" : 1.5,
|
||||
"backlightThreshold" : 0.0,
|
||||
"backlightThreshold" : 0,
|
||||
"backlightColored" : false,
|
||||
"brightness" : 0.75
|
||||
"brightness" : 100,
|
||||
"brightnessCompensation" : 100
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -76,6 +78,7 @@
|
||||
"redSignalThreshold" : 0.0,
|
||||
"greenSignalThreshold" : 0.0,
|
||||
"blueSignalThreshold" : 0.0,
|
||||
"signalDetection" : true,
|
||||
"signalDetectionVerticalOffsetMin" : 0.25,
|
||||
"signalDetectionHorizontalOffsetMin" : 0.25,
|
||||
"signalDetectionVerticalOffsetMax" : 0.75,
|
||||
@ -104,7 +107,7 @@
|
||||
"blackborderdetector" :
|
||||
{
|
||||
"enable" : true,
|
||||
"threshold" : 0.05,
|
||||
"threshold" : 5,
|
||||
"unknownFrameCnt" : 600,
|
||||
"borderFrameCnt" : 50,
|
||||
"maxInconsistentCnt" : 10,
|
||||
@ -164,7 +167,7 @@
|
||||
{
|
||||
"enable" : false,
|
||||
"port" : 19333,
|
||||
"priority" : 200
|
||||
"priority" : 201
|
||||
},
|
||||
|
||||
"udpListener" :
|
||||
@ -172,7 +175,7 @@
|
||||
"enable" : false,
|
||||
"address" : "239.255.28.01",
|
||||
"port" : 2801,
|
||||
"priority" : 190,
|
||||
"priority" : 200,
|
||||
"timeout" : 10000,
|
||||
"shared" : false
|
||||
},
|
||||
|
15
effects/breath.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name" : "Breath",
|
||||
"script" : "fade.py",
|
||||
"args" :
|
||||
{
|
||||
"color-end": [ 255, 255, 255 ],
|
||||
"color-start": [ 50, 50, 50 ],
|
||||
"fade-in-time" : 3000,
|
||||
"fade-out-time" : 1000,
|
||||
"color-start-time" : 50,
|
||||
"color-end-time" : 250,
|
||||
"repeat-count" : 0,
|
||||
"maintain-end-color" : true
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
"script" : "candle.py",
|
||||
"args" :
|
||||
{
|
||||
"sleepTime" : 0.15,
|
||||
"sleepTime" : 0.20,
|
||||
"brightness" : 100,
|
||||
"color" : [ 255, 138, 0 ],
|
||||
"candles" : "all"
|
||||
|
@ -3,8 +3,13 @@
|
||||
"script" : "fade.py",
|
||||
"args" :
|
||||
{
|
||||
"fade-time" : 5.0,
|
||||
"color-start" : [ 136, 97, 7 ],
|
||||
"color-end" : [ 238, 173, 47 ]
|
||||
"color-end" : [ 238, 173, 47 ],
|
||||
"fade-in-time" : 5000,
|
||||
"fade-out-time" : 0,
|
||||
"color-start-time" : 0,
|
||||
"color-end-time" : 0,
|
||||
"repeat-count" : 1,
|
||||
"maintain-end-color" : true
|
||||
}
|
||||
}
|
||||
|
@ -3,8 +3,13 @@
|
||||
"script" : "fade.py",
|
||||
"args" :
|
||||
{
|
||||
"fade-time" : 5.0,
|
||||
"color-start" : [ 238, 173, 47 ],
|
||||
"color-end" : [ 136, 97, 7 ]
|
||||
"color-start" : [ 136, 97, 7 ],
|
||||
"color-end" : [ 238, 173, 47 ],
|
||||
"fade-in-time" : 0,
|
||||
"fade-out-time" : 5000,
|
||||
"color-start-time" : 0,
|
||||
"color-end-time" : 0,
|
||||
"repeat-count" : 1,
|
||||
"maintain-end-color" : true
|
||||
}
|
||||
}
|
||||
|
@ -1,27 +1,92 @@
|
||||
import hyperion, time
|
||||
|
||||
# Get the parameters
|
||||
fadeTime = float(hyperion.args.get('fade-time', 5.0))
|
||||
colorStart = hyperion.args.get('color-start', (255,174,11))
|
||||
colorEnd = hyperion.args.get('color-end', (100,100,100))
|
||||
fadeInTime = float(hyperion.args.get('fade-in-time', 2000)) / 1000.0
|
||||
fadeOutTime = float(hyperion.args.get('fade-out-time', 2000)) / 1000.0
|
||||
colorStart = hyperion.args.get('color-start', (255,174,11))
|
||||
colorEnd = hyperion.args.get('color-end', (0,0,0))
|
||||
colorStartTime = float(hyperion.args.get('color-start-time', 1000)) / 1000
|
||||
colorEndTime = float(hyperion.args.get('color-end-time', 1000)) / 1000
|
||||
repeat = hyperion.args.get('repeat-count', 0)
|
||||
maintainEndCol = hyperion.args.get('maintain-end-color', True)
|
||||
minStepTime = float(hyperion.latchTime)/1000.0
|
||||
currentR = currentG = currentB = 0
|
||||
|
||||
# create color table for fading from start to end color
|
||||
steps = float(abs(max((colorEnd[0] - colorStart[0]),max((colorEnd[1] - colorStart[1]),(colorEnd[2] - colorStart[2])))))
|
||||
color_step = (
|
||||
(colorEnd[0] - colorStart[0]) / 256.0,
|
||||
(colorEnd[1] - colorStart[1]) / 256.0,
|
||||
(colorEnd[2] - colorStart[2]) / 256.0
|
||||
(colorEnd[0] - colorStart[0]) / steps,
|
||||
(colorEnd[1] - colorStart[1]) / steps,
|
||||
(colorEnd[2] - colorStart[2]) / steps
|
||||
)
|
||||
|
||||
# fade color
|
||||
calcChannel = lambda i: min(max(int(colorStart[i] + color_step[i]*step),0),255)
|
||||
for step in range(256):
|
||||
if hyperion.abort():
|
||||
break
|
||||
calcChannel = lambda i: min(max(int(round(colorStart[i] + color_step[i]*step)),0), colorEnd[i] if colorStart[i] < colorEnd[i] else colorStart[i])
|
||||
colors = []
|
||||
for step in range(int(steps)+1):
|
||||
colors.append( (calcChannel(0),calcChannel(1),calcChannel(2)) )
|
||||
|
||||
hyperion.setColor( calcChannel(0),calcChannel(1),calcChannel(2) )
|
||||
time.sleep( fadeTime / 256 )
|
||||
# calculate timings
|
||||
if fadeInTime>0:
|
||||
incrementIn = max(1,int(round(steps / (fadeInTime / minStepTime) )))
|
||||
sleepTimeIn = fadeInTime / (steps / incrementIn)
|
||||
else:
|
||||
incrementIn = sleepTimeIn = 1
|
||||
|
||||
if fadeOutTime>0:
|
||||
incrementOut = max(1,int(round(steps / (fadeOutTime / minStepTime) )))
|
||||
sleepTimeOut = fadeOutTime / (steps / incrementOut)
|
||||
else:
|
||||
incrementOut = sleepTimeOut = 1
|
||||
|
||||
# maintain color until effect end
|
||||
hyperion.setColor(colorEnd[0],colorEnd[1],colorEnd[2])
|
||||
def setColor(r,g,b):
|
||||
global currentR,currentG,currentB
|
||||
|
||||
currentR = r
|
||||
currentG = g
|
||||
currentB = b
|
||||
hyperion.setColor(r,g,b)
|
||||
|
||||
# loop
|
||||
repeatCounter = 1
|
||||
while not hyperion.abort():
|
||||
time.sleep(1)
|
||||
# fade in
|
||||
if fadeInTime > 0:
|
||||
setColor( colors[0][0],colors[0][1],colors[0][2] )
|
||||
for step in range(0,int(steps)+1,incrementIn):
|
||||
if hyperion.abort(): break
|
||||
setColor( colors[step][0],colors[step][1],colors[step][2] )
|
||||
time.sleep(sleepTimeIn)
|
||||
|
||||
# end color
|
||||
t = 0.0
|
||||
while t<colorStartTime and not hyperion.abort():
|
||||
setColor( colors[int(steps)][0],colors[int(steps)][1],colors[int(steps)][2] )
|
||||
time.sleep(minStepTime)
|
||||
t += minStepTime
|
||||
|
||||
# fade out
|
||||
if fadeOutTime > 0:
|
||||
setColor( colors[int(steps)][0],colors[int(steps)][1],colors[int(steps)][2] )
|
||||
for step in range(int(steps),-1,-incrementOut):
|
||||
if hyperion.abort(): break
|
||||
setColor( colors[step][0],colors[step][1],colors[step][2] )
|
||||
time.sleep(sleepTimeOut)
|
||||
|
||||
# start color
|
||||
t = 0.0
|
||||
while t<colorEndTime and not hyperion.abort():
|
||||
setColor( colors[0][0],colors[0][1],colors[0][2] )
|
||||
time.sleep(minStepTime)
|
||||
t += minStepTime
|
||||
|
||||
# repeat
|
||||
if repeat > 0 and repeatCounter >= repeat : break
|
||||
repeatCounter += 1
|
||||
|
||||
time.sleep(0.5)
|
||||
|
||||
# maintain end color until effect end
|
||||
while not hyperion.abort() and maintainEndCol:
|
||||
hyperion.setColor( currentR, currentG, currentB )
|
||||
time.sleep(1)
|
||||
|
||||
|
@ -51,4 +51,4 @@ while not hyperion.abort():
|
||||
hyperion.imageCanonicalGradient(centerX, centerY, angleS, colorsSecond)
|
||||
|
||||
hyperion.imageShow()
|
||||
time.sleep(0.01 )
|
||||
time.sleep(0.5 )
|
||||
|
16
effects/notify-blue.json
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"name" : "Notify blue",
|
||||
"script" : "fade.py",
|
||||
"args" :
|
||||
{
|
||||
"color-start": [ 0, 0, 50 ],
|
||||
"color-end": [ 0, 0, 255 ],
|
||||
"fade-in-time" : 200,
|
||||
"fade-out-time" : 100,
|
||||
"color-start-time" : 40,
|
||||
"color-end-time" : 150,
|
||||
"repeat-count" : 3,
|
||||
"maintain-end-color" : false
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,6 @@
|
||||
"args" :
|
||||
{
|
||||
"margin-pos" : 2.0,
|
||||
"rotationTime" : 8
|
||||
"rotationTime" : 4
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,15 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import hyperion, time, colorsys
|
||||
from random import randint
|
||||
|
||||
#get args
|
||||
rotationTime = int(hyperion.args.get('rotationTime', 8))
|
||||
marginPos = float(hyperion.args.get('margin-pos', 1.5))
|
||||
rotationTime = float(hyperion.args.get('rotationTime', 4))
|
||||
marginPos = float(hyperion.args.get('margin-pos', 2))
|
||||
|
||||
# define pacman
|
||||
pacman = bytearray((255, 255, 0))
|
||||
|
||||
# define ghosts
|
||||
redGuy = bytearray((255, 0, 0))
|
||||
redGuy = bytearray((255, 0, 0))
|
||||
pinkGuy = bytearray((255, 184, 255))
|
||||
blueGuy = bytearray((0, 255, 255))
|
||||
slowGuy = bytearray((255, 184, 81))
|
||||
@ -20,10 +18,10 @@ light = bytearray((255, 184, 174))
|
||||
background = bytearray((0, 0, 0))
|
||||
|
||||
#helper
|
||||
posPac = 1
|
||||
diffPac = 6*marginPos
|
||||
diffGuys = 3*marginPos
|
||||
sleepTime = rotationTime/ledCount
|
||||
posPac = 1
|
||||
diffPac = 6*marginPos
|
||||
diffGuys = 3*marginPos
|
||||
sleepTime = max(0.02,rotationTime/hyperion.ledCount)
|
||||
|
||||
posPinkGuy = posPac + diffPac
|
||||
posBlueGuy = posPinkGuy + diffGuys
|
||||
@ -89,7 +87,8 @@ while not hyperion.abort():
|
||||
shiftLED(ledData, increment, hyperion.ledCount - random, s)
|
||||
|
||||
# chase mode
|
||||
shift = 3*(hyperion.ledCount - random)
|
||||
ledData=ledDataChase[shift:]+ledDataChase[:shift]
|
||||
shift = 3*(hyperion.ledCount - random)
|
||||
ledData = ledDataChase[shift:]+ledDataChase[:shift]
|
||||
shiftLED(ledData, -increment, 2*hyperion.ledCount-random)
|
||||
time.sleep(sleepTime)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import hyperion, time
|
||||
import hyperion, time, math
|
||||
|
||||
# Get the parameters
|
||||
rotationTime = float(hyperion.args.get('rotation-time', 3.0))
|
||||
@ -6,12 +6,18 @@ reverse = bool(hyperion.args.get('reverse', False))
|
||||
centerX = float(hyperion.args.get('center_x', 0.5))
|
||||
centerY = float(hyperion.args.get('center_y', 0.5))
|
||||
|
||||
minStepTime = float(hyperion.latchTime)/1000.0
|
||||
sleepTime = max(0.1, rotationTime) / 360
|
||||
angle = 0
|
||||
centerX = int(round(float(hyperion.imageWidth)*centerX))
|
||||
centerY = int(round(float(hyperion.imageHeight)*centerY))
|
||||
increment = -1 if reverse else 1
|
||||
|
||||
# adapt sleeptime to hardware
|
||||
if minStepTime > sleepTime:
|
||||
increment *= int(math.ceil(minStepTime / sleepTime))
|
||||
sleepTime = minStepTime
|
||||
|
||||
# table of stop colors for rainbow gradient, first is the position, next rgb, all values 0-255
|
||||
rainbowColors = bytearray([
|
||||
0 ,255,0 ,0, 255,
|
||||
|
@ -3,7 +3,7 @@
|
||||
"script" : "random.py",
|
||||
"args" :
|
||||
{
|
||||
"speed" : 1.0,
|
||||
"speed" : 750,
|
||||
"saturation" : 1.0
|
||||
}
|
||||
}
|
||||
|
@ -1,21 +1,46 @@
|
||||
import hyperion, time, colorsys, random
|
||||
import hyperion, time, colorsys, random, math
|
||||
|
||||
# get args
|
||||
sleepTime = float(hyperion.args.get('speed', 1.0))
|
||||
sleepTime = float(hyperion.args.get('speed', 1.0))/1000.0
|
||||
saturation = float(hyperion.args.get('saturation', 1.0))
|
||||
ledData = bytearray()
|
||||
ledDataBuf = bytearray()
|
||||
color_step = []
|
||||
minStepTime= float(hyperion.latchTime)/1000.0
|
||||
fadeSteps = min(256.0, math.floor(sleepTime/minStepTime))
|
||||
|
||||
# Initialize the led data
|
||||
for i in range(hyperion.ledCount):
|
||||
ledData += bytearray((0,0,0))
|
||||
ledDataBuf += bytearray((0,0,0))
|
||||
color_step.append((0.0,0.0,0.0))
|
||||
|
||||
# Start the write data loop
|
||||
while not hyperion.abort():
|
||||
hyperion.setColor(ledData)
|
||||
for i in range(len(ledData)):
|
||||
ledDataBuf[i] = ledData[i]
|
||||
|
||||
for i in range(hyperion.ledCount):
|
||||
if random.randrange(10) == 1:
|
||||
rgb = colorsys.hsv_to_rgb(random.random(), saturation, random.random())
|
||||
ledData[i*3 ] = int(255*rgb[0])
|
||||
ledData[i*3+1] = int(255*rgb[1])
|
||||
ledData[i*3+2] = int(255*rgb[2])
|
||||
time.sleep(sleepTime)
|
||||
|
||||
color_step[i] = (
|
||||
(ledData[i*3 ]-ledDataBuf[i*3 ])/fadeSteps,
|
||||
(ledData[i*3+1]-ledDataBuf[i*3+1])/fadeSteps,
|
||||
(ledData[i*3+2]-ledDataBuf[i*3+2])/fadeSteps)
|
||||
else:
|
||||
color_step[i] = (0.0,0.0,0.0)
|
||||
|
||||
for step in range(int(fadeSteps)):
|
||||
for i in range(hyperion.ledCount):
|
||||
ledDataBuf[i*3 ] = min(max(int(ledDataBuf[i*3 ] + color_step[i][0]*float(step)),0),ledData[i*3 ])
|
||||
ledDataBuf[i*3+1] = min(max(int(ledDataBuf[i*3+1] + color_step[i][1]*float(step)),0),ledData[i*3+1])
|
||||
ledDataBuf[i*3+2] = min(max(int(ledDataBuf[i*3+2] + color_step[i][2]*float(step)),0),ledData[i*3+2])
|
||||
|
||||
hyperion.setColor(ledDataBuf)
|
||||
time.sleep(sleepTime/fadeSteps)
|
||||
hyperion.setColor(ledData)
|
||||
|
||||
|
@ -4,14 +4,6 @@
|
||||
"title":"edt_eff_fade_header_title",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"fade-time": {
|
||||
"type": "number",
|
||||
"title":"edt_eff_fadetime_title",
|
||||
"default": 5.0,
|
||||
"minimum" : 0.1,
|
||||
"append" : "edt_append_s",
|
||||
"propertyOrder" : 1
|
||||
},
|
||||
"color-start": {
|
||||
"type": "array",
|
||||
"title":"edt_eff_colorstart_title",
|
||||
@ -25,8 +17,24 @@
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3,
|
||||
"propertyOrder" : 1
|
||||
},
|
||||
"color-start-time": {
|
||||
"type": "integer",
|
||||
"title":"edt_eff_colorstarttime_title",
|
||||
"default": 1000,
|
||||
"minimum" : 0,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 2
|
||||
},
|
||||
"fade-in-time": {
|
||||
"type": "integer",
|
||||
"title":"edt_eff_fadeintime_title",
|
||||
"default": 2000,
|
||||
"minimum" : 0,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 3
|
||||
},
|
||||
"color-end": {
|
||||
"type": "array",
|
||||
"title":"edt_eff_colorend_title",
|
||||
@ -39,8 +47,36 @@
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3,
|
||||
"propertyOrder" : 3
|
||||
}
|
||||
"propertyOrder" : 4
|
||||
},
|
||||
"color-end-time": {
|
||||
"type": "integer",
|
||||
"title":"edt_eff_colorendtime_title",
|
||||
"default": 1000,
|
||||
"minimum" : 0,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 5
|
||||
},
|
||||
"fade-out-time": {
|
||||
"type": "integer",
|
||||
"title":"edt_eff_fadeouttime_title",
|
||||
"default": 2000,
|
||||
"minimum" : 0,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 6
|
||||
},
|
||||
"repeat-count": {
|
||||
"type": "integer",
|
||||
"title":"edt_eff_repeatcount_title",
|
||||
"default": 0,
|
||||
"propertyOrder" : 7
|
||||
},
|
||||
"maintain-end-color": {
|
||||
"type": "boolean",
|
||||
"title":"edt_eff_maintain_end_color_title",
|
||||
"default": true,
|
||||
"propertyOrder" : 8
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
||||
|
@ -7,8 +7,9 @@
|
||||
"speed": {
|
||||
"type": "number",
|
||||
"title":"edt_eff_speed_title",
|
||||
"default": 1.0,
|
||||
"minimum" : 0.0,
|
||||
"default": 1000,
|
||||
"minimum" : 10,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 1
|
||||
},
|
||||
"saturation": {
|
||||
|
@ -1,31 +0,0 @@
|
||||
{
|
||||
"type":"object",
|
||||
"script" : "strobe.py",
|
||||
"title":"edt_eff_storbe_header_title",
|
||||
"required":true,
|
||||
"properties":{
|
||||
"color": {
|
||||
"type": "array",
|
||||
"title":"edt_eff_color_title",
|
||||
"format":"colorpicker",
|
||||
"default": [255,0,0],
|
||||
"items" : {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3,
|
||||
"propertyOrder" : 1
|
||||
},
|
||||
"frequency": {
|
||||
"type": "number",
|
||||
"title":"edt_eff_frequency_title",
|
||||
"default": 10.0,
|
||||
"minimum" : 0.1,
|
||||
"append" : "edt_append_hz",
|
||||
"propertyOrder" : 2
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
}
|
@ -33,10 +33,11 @@
|
||||
"propertyOrder" : 4
|
||||
},
|
||||
"speed": {
|
||||
"type": "number",
|
||||
"type": "integer",
|
||||
"title":"edt_eff_speed_title",
|
||||
"default": 1.0,
|
||||
"minimum" : 0.1,
|
||||
"default": 100,
|
||||
"minimum" : 10,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 5
|
||||
},
|
||||
"random": {
|
||||
|
@ -5,11 +5,47 @@
|
||||
"required":true,
|
||||
"properties":{
|
||||
"sleepTime": {
|
||||
"type": "number",
|
||||
"type": "integer",
|
||||
"title":"edt_eff_sleeptime_title",
|
||||
"default": 1.0,
|
||||
"minimum" : 0.1,
|
||||
"default": 1000,
|
||||
"minimum" : 100,
|
||||
"append" : "edt_append_ms",
|
||||
"propertyOrder" : 1
|
||||
},
|
||||
"length": {
|
||||
"type": "integer",
|
||||
"title":"edt_eff_length_title",
|
||||
"default": 1,
|
||||
"minimum" : 1,
|
||||
"propertyOrder" : 2
|
||||
},
|
||||
"color1": {
|
||||
"type": "array",
|
||||
"title":"edt_eff_color_title",
|
||||
"format":"colorpicker",
|
||||
"default": [255,255,255],
|
||||
"items" : {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3,
|
||||
"propertyOrder" : 3
|
||||
},
|
||||
"color2": {
|
||||
"type": "array",
|
||||
"title":"edt_eff_color_title",
|
||||
"format":"colorpicker",
|
||||
"default": [255,0,0],
|
||||
"items" : {
|
||||
"type": "integer",
|
||||
"minimum": 0,
|
||||
"maximum": 255
|
||||
},
|
||||
"minItems": 3,
|
||||
"maxItems": 3,
|
||||
"propertyOrder" : 4
|
||||
}
|
||||
},
|
||||
"additionalProperties": false
|
||||
|
@ -1,9 +0,0 @@
|
||||
{
|
||||
"name" : "Strobe blue",
|
||||
"script" : "strobe.py",
|
||||
"args" :
|
||||
{
|
||||
"color" : [ 0, 0, 255 ],
|
||||
"frequency" : 5.0
|
||||
}
|
||||
}
|
15
effects/strobe-red.json
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"name" : "Strobe red",
|
||||
"script" : "fade.py",
|
||||
"args" :
|
||||
{
|
||||
"color-start": [ 255, 0, 0 ],
|
||||
"color-end": [ 0, 0, 0 ],
|
||||
"fade-in-time" : 100,
|
||||
"fade-out-time" : 100,
|
||||
"color-start-time" : 100,
|
||||
"color-end-time" : 100,
|
||||
"repeat-count" : 0,
|
||||
"maintain-end-color" : true
|
||||
}
|
||||
}
|
@ -1,9 +1,15 @@
|
||||
{
|
||||
"name" : "Strobe white",
|
||||
"script" : "strobe.py",
|
||||
"script" : "fade.py",
|
||||
"args" :
|
||||
{
|
||||
"color" : [ 255, 255, 255 ],
|
||||
"frequency" : 5.0
|
||||
"color-start": [ 255, 255, 255 ],
|
||||
"color-end": [ 0, 0, 0 ],
|
||||
"fade-in-time" : 0,
|
||||
"fade-out-time" : 100,
|
||||
"color-start-time" : 50,
|
||||
"color-end-time" : 10,
|
||||
"repeat-count" : 0,
|
||||
"maintain-end-color" : true
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
import hyperion, time
|
||||
|
||||
# Get the rotation time
|
||||
color = hyperion.args.get('color', (255,255,255))
|
||||
frequency = float(hyperion.args.get('frequency', 10.0))
|
||||
|
||||
# Check parameters
|
||||
frequency = min(100.0, frequency)
|
||||
|
||||
# Compute the strobe interval
|
||||
sleepTime = 0.5 / frequency
|
||||
|
||||
# Start the write data loop
|
||||
while not hyperion.abort():
|
||||
hyperion.setColor(0, 0, 0)
|
||||
time.sleep(sleepTime)
|
||||
hyperion.setColor(color[0], color[1], color[2])
|
||||
time.sleep(sleepTime)
|
@ -1,25 +1,25 @@
|
||||
import hyperion
|
||||
import time
|
||||
import colorsys
|
||||
import random
|
||||
import hyperion, time, random, math
|
||||
|
||||
# Initialize the led data
|
||||
ledData = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
ledData += bytearray((0,0,0))
|
||||
|
||||
sleepTime = float(hyperion.args.get('speed', 1.0)) * 0.004
|
||||
sleepTime = float(hyperion.args.get('speed', 1.0)) * 0.004
|
||||
minStepTime = float(hyperion.latchTime)/1000.0
|
||||
factor = 1 if sleepTime > minStepTime else int(math.ceil(minStepTime/sleepTime))
|
||||
|
||||
runners = [
|
||||
{ "i":0, "pos":0, "c":0, "step":9 , "lvl":255},
|
||||
{ "i":1, "pos":0, "c":0, "step":8 , "lvl":255},
|
||||
{ "i":2, "pos":0, "c":0, "step":7 , "lvl":255},
|
||||
{ "i":0, "pos":0, "c":0, "step":6 , "lvl":100},
|
||||
{ "i":1, "pos":0, "c":0, "step":5 , "lvl":100},
|
||||
{ "i":2, "pos":0, "c":0, "step":4, "lvl":100},
|
||||
{ "i":0, "pos":0, "c":0, "step":9, "lvl":255},
|
||||
{ "i":1, "pos":0, "c":0, "step":8, "lvl":255},
|
||||
{ "i":2, "pos":0, "c":0, "step":7, "lvl":255},
|
||||
{ "i":0, "pos":0, "c":0, "step":6, "lvl":100},
|
||||
{ "i":1, "pos":0, "c":0, "step":5, "lvl":100},
|
||||
{ "i":2, "pos":0, "c":0, "step":4, "lvl":100},
|
||||
]
|
||||
|
||||
# Start the write data loop
|
||||
i = 0
|
||||
while not hyperion.abort():
|
||||
for r in runners:
|
||||
if r["c"] == 0:
|
||||
@ -30,5 +30,9 @@ while not hyperion.abort():
|
||||
else:
|
||||
r["c"] -= 1
|
||||
|
||||
hyperion.setColor(ledData)
|
||||
i += 1
|
||||
if i % factor == 0:
|
||||
hyperion.setColor(ledData)
|
||||
i = 0
|
||||
|
||||
time.sleep(sleepTime)
|
||||
|
@ -7,7 +7,7 @@
|
||||
"max_len" : 7,
|
||||
"height" : 8,
|
||||
"trails": 3,
|
||||
"speed" : 1.0,
|
||||
"speed" : 30,
|
||||
"random" : false,
|
||||
"color" : [255, 255, 255]
|
||||
}
|
||||
|
@ -7,93 +7,91 @@ min_len = int(hyperion.args.get('min_len', 3))
|
||||
max_len = int(hyperion.args.get('max_len', 3))
|
||||
height = int(hyperion.args.get('height', 8))
|
||||
trails = int(hyperion.args.get('int', 8))
|
||||
sleepTime = float(hyperion.args.get('speed', 1.0)) * 0.01
|
||||
sleepTime = float(hyperion.args.get('speed', 1)) / 1000.0
|
||||
color = list(hyperion.args.get('color', (255,255,255)))
|
||||
randomise = bool(hyperion.args.get('random', False))
|
||||
whidth = hyperion.ledCount / height
|
||||
|
||||
class trail:
|
||||
def __init__(self):
|
||||
return
|
||||
def __init__(self):
|
||||
return
|
||||
|
||||
def start(self, x, y, step, color, _len, _h):
|
||||
self.pos = 0.0
|
||||
self.step = step
|
||||
self.h = _h
|
||||
self.x = x
|
||||
self.data = []
|
||||
brigtness = color[2]
|
||||
step_brigtness = color[2] / _len
|
||||
for i in range(0, _len):
|
||||
rgb = colorsys.hsv_to_rgb(color[0], color[1], brigtness)
|
||||
self.data.insert(0, (int(255*rgb[0]), int(255*rgb[1]), int(255*rgb[2])))
|
||||
brigtness -= step_brigtness
|
||||
def start(self, x, y, step, color, _len, _h):
|
||||
self.pos = 0.0
|
||||
self.step = step
|
||||
self.h = _h
|
||||
self.x = x
|
||||
self.data = []
|
||||
brigtness = color[2]
|
||||
step_brigtness = color[2] / _len
|
||||
for i in range(0, _len):
|
||||
rgb = colorsys.hsv_to_rgb(color[0], color[1], brigtness)
|
||||
self.data.insert(0, (int(255*rgb[0]), int(255*rgb[1]), int(255*rgb[2])))
|
||||
brigtness -= step_brigtness
|
||||
|
||||
self.data.extend([(0,0,0)]*(_h-y))
|
||||
if len(self.data) < _h:
|
||||
for i in range (_h-len(self.data)):
|
||||
self.data.insert(0, (0,0,0))
|
||||
self.data.extend([(0,0,0)]*(_h-y))
|
||||
if len(self.data) < _h:
|
||||
for i in range (_h-len(self.data)):
|
||||
self.data.insert(0, (0,0,0))
|
||||
|
||||
def getdata(self):
|
||||
self.pos += self.step
|
||||
if self.pos > 1.0:
|
||||
self.pos = 0.0
|
||||
self.data.pop()
|
||||
self.data.insert(0, (0,0,0))
|
||||
return self.x, self.data[-self.h:], all(x == self.data[0] for x in self.data)
|
||||
def getdata(self):
|
||||
self.pos += self.step
|
||||
if self.pos > 1.0:
|
||||
self.pos = 0.0
|
||||
self.data.pop()
|
||||
self.data.insert(0, (0,0,0))
|
||||
return self.x, self.data[-self.h:], all(x == self.data[0] for x in self.data)
|
||||
|
||||
tr = []
|
||||
|
||||
for i in range(trails):
|
||||
r = {
|
||||
'exec': trail()
|
||||
}
|
||||
r = {'exec': trail()}
|
||||
|
||||
if randomise:
|
||||
col = (random.uniform(0.1, 1.0), random.uniform(0.1, 1.0), random.uniform(0.1, 1.0))
|
||||
else:
|
||||
col = colorsys.rgb_to_hsv(color[0]/255.0, color[1]/255.0, color[2]/255.0)
|
||||
if randomise:
|
||||
col = (random.uniform(0.1, 1.0), random.uniform(0.1, 1.0), random.uniform(0.1, 1.0))
|
||||
else:
|
||||
col = colorsys.rgb_to_hsv(color[0]/255.0, color[1]/255.0, color[2]/255.0)
|
||||
|
||||
r['exec'].start(
|
||||
random.randint(0, whidth),
|
||||
random.randint(0, height),
|
||||
random.uniform(0.2, 0.8),
|
||||
col,
|
||||
random.randint(min_len, max_len),
|
||||
height
|
||||
)
|
||||
tr.append(r)
|
||||
r['exec'].start(
|
||||
random.randint(0, whidth),
|
||||
random.randint(0, height),
|
||||
random.uniform(0.2, 0.8),
|
||||
col,
|
||||
random.randint(min_len, max_len),
|
||||
height
|
||||
)
|
||||
tr.append(r)
|
||||
|
||||
# Start the write data loop
|
||||
while not hyperion.abort():
|
||||
ledData = bytearray()
|
||||
ledData = bytearray()
|
||||
|
||||
for r in tr:
|
||||
r['x'], r['data'], c = r['exec'].getdata()
|
||||
if c:
|
||||
if randomise:
|
||||
col = (random.uniform(0.1, 1.0), random.uniform(0.1, 1.0), random.uniform(0.1, 1.0))
|
||||
else:
|
||||
col = colorsys.rgb_to_hsv(color[0]/255.0, color[1]/255.0, color[2]/255.0)
|
||||
for r in tr:
|
||||
r['x'], r['data'], c = r['exec'].getdata()
|
||||
if c:
|
||||
if randomise:
|
||||
col = (random.uniform(0.1, 1.0), random.uniform(0.1, 1.0), random.uniform(0.1, 1.0))
|
||||
else:
|
||||
col = colorsys.rgb_to_hsv(color[0]/255.0, color[1]/255.0, color[2]/255.0)
|
||||
|
||||
r['exec'].start(
|
||||
random.randint(0, whidth),
|
||||
random.randint(0, height),
|
||||
random.uniform(0.2, 0.8),
|
||||
col,
|
||||
random.randint(min_len, max_len),
|
||||
height
|
||||
)
|
||||
r['exec'].start(
|
||||
random.randint(0, whidth),
|
||||
random.randint(0, height),
|
||||
random.uniform(0.2, 0.8),
|
||||
col,
|
||||
random.randint(min_len, max_len),
|
||||
height
|
||||
)
|
||||
|
||||
for y in range(0, height):
|
||||
for x in range(0, whidth):
|
||||
for r in tr:
|
||||
if x == r['x']:
|
||||
led = bytearray(r['data'][y])
|
||||
break
|
||||
led = bytearray((0,0,0))
|
||||
ledData += led
|
||||
for y in range(0, height):
|
||||
for x in range(0, whidth):
|
||||
for r in tr:
|
||||
if x == r['x']:
|
||||
led = bytearray(r['data'][y])
|
||||
break
|
||||
led = bytearray((0,0,0))
|
||||
ledData += led
|
||||
|
||||
hyperion.setImage(whidth,height,ledData)
|
||||
time.sleep(sleepTime)
|
||||
hyperion.setImage(whidth,height,ledData)
|
||||
time.sleep(sleepTime)
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
"max_len" : 6,
|
||||
"height" : 8,
|
||||
"trails": 16,
|
||||
"speed" : 8.0,
|
||||
"speed" : 50,
|
||||
"random" : true,
|
||||
"color" : [255, 255, 255]
|
||||
}
|
||||
|
@ -3,6 +3,9 @@
|
||||
"script" : "x-mas.py",
|
||||
"args" :
|
||||
{
|
||||
"sleepTime" : 0.75
|
||||
"sleepTime" : 750,
|
||||
"color1" : [255,255,255],
|
||||
"color2" : [255,0,0],
|
||||
"length" : 1
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +1,30 @@
|
||||
import hyperion, time, colorsys
|
||||
|
||||
# Get the parameters
|
||||
sleepTime = float(hyperion.args.get('sleepTime', 1.0))
|
||||
sleepTime = float(hyperion.args.get('sleepTime', 1000))/1000.0
|
||||
length = hyperion.args.get('length', 1)
|
||||
color1 = hyperion.args.get('color1', (255,255,255))
|
||||
color2 = hyperion.args.get('color2', (255,0,0))
|
||||
|
||||
# Initialize the led data
|
||||
i = 0
|
||||
ledDataOdd = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
if i%2 == 0:
|
||||
ledDataOdd += bytearray((int(255), int(0), int(0)))
|
||||
else:
|
||||
ledDataOdd += bytearray((int(255), int(255), int(255)))
|
||||
|
||||
ledDataEven = bytearray()
|
||||
for i in range(hyperion.ledCount):
|
||||
if i%2 == 0:
|
||||
ledDataEven += bytearray((int(255), int(255), int(255)))
|
||||
else:
|
||||
ledDataEven += bytearray((int(255), int(0), int(0)))
|
||||
while i < hyperion.ledCount:
|
||||
for l in range(length):
|
||||
if i<hyperion.ledCount:
|
||||
ledDataOdd += bytearray((int(color1[0]), int(color1[1]), int(color1[2])))
|
||||
i += 1
|
||||
|
||||
for l in range(length):
|
||||
if i<hyperion.ledCount:
|
||||
ledDataOdd += bytearray((int(color2[0]), int(color2[1]), int(color2[2])))
|
||||
i += 1
|
||||
|
||||
ledDataEven = ledDataOdd[3*length:] + ledDataOdd[0:3*length]
|
||||
|
||||
# Start the write data loop
|
||||
while not hyperion.abort():
|
||||
hyperion.setColor(ledDataOdd)
|
||||
time.sleep(sleepTime)
|
||||
hyperion.setColor(ledDataEven)
|
||||
time.sleep(sleepTime)
|
||||
time.sleep(sleepTime)
|
||||
|
@ -116,7 +116,7 @@ namespace hyperion
|
||||
unsigned _blurRemoveCnt;
|
||||
|
||||
/// The border detection mode
|
||||
const std::string _detectionMode;
|
||||
const QString _detectionMode;
|
||||
|
||||
/// The blackborder detector
|
||||
BlackBorderDetector _detector;
|
||||
|
@ -87,5 +87,5 @@ private:
|
||||
/// state of connection
|
||||
bool _isActive;
|
||||
|
||||
uint16_t _port;
|
||||
uint16_t _port;
|
||||
};
|
||||
|
@ -5,14 +5,14 @@ Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
@ -35,24 +35,35 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
class BonjourRecord
|
||||
{
|
||||
public:
|
||||
BonjourRecord() {}
|
||||
BonjourRecord(const QString &name, const QString ®Type, const QString &domain)
|
||||
: serviceName(name), registeredType(regType), replyDomain(domain)
|
||||
{}
|
||||
BonjourRecord(const char *name, const char *regType, const char *domain)
|
||||
{
|
||||
serviceName = QString::fromUtf8(name);
|
||||
registeredType = QString::fromUtf8(regType);
|
||||
replyDomain = QString::fromUtf8(domain);
|
||||
}
|
||||
QString serviceName;
|
||||
QString registeredType;
|
||||
QString replyDomain;
|
||||
bool operator==(const BonjourRecord &other) const {
|
||||
return serviceName == other.serviceName
|
||||
&& registeredType == other.registeredType
|
||||
&& replyDomain == other.replyDomain;
|
||||
}
|
||||
BonjourRecord() : port(-1) {}
|
||||
BonjourRecord(const QString &name, const QString ®Type, const QString &domain)
|
||||
: serviceName(name)
|
||||
, registeredType(regType)
|
||||
, replyDomain(domain)
|
||||
, port(-1)
|
||||
{}
|
||||
|
||||
BonjourRecord(const char *name, const char *regType, const char *domain)
|
||||
: serviceName(QString::fromUtf8(name))
|
||||
, registeredType(QString::fromUtf8(regType))
|
||||
, replyDomain(QString::fromUtf8(domain))
|
||||
, port(-1)
|
||||
{
|
||||
}
|
||||
|
||||
QString serviceName;
|
||||
QString registeredType;
|
||||
QString replyDomain;
|
||||
QString hostName;
|
||||
QString address;
|
||||
int port;
|
||||
|
||||
bool operator==(const BonjourRecord &other) const
|
||||
{
|
||||
return serviceName == other.serviceName
|
||||
&& registeredType == other.registeredType
|
||||
&& replyDomain == other.replyDomain;
|
||||
}
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(BonjourRecord)
|
||||
|
65
include/bonjour/bonjourservicebrowser.h
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
Copyright (c) 2007, Trenton Schulz
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef BONJOURSERVICEBROWSER_H
|
||||
#define BONJOURSERVICEBROWSER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <dns_sd.h>
|
||||
#include "bonjour/bonjourrecord.h"
|
||||
|
||||
|
||||
class QSocketNotifier;
|
||||
class BonjourServiceBrowser : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BonjourServiceBrowser(QObject *parent = 0);
|
||||
~BonjourServiceBrowser();
|
||||
void browseForServiceType(const QString &serviceType);
|
||||
inline QList<BonjourRecord> currentRecords() const { return bonjourRecords; }
|
||||
inline QString serviceType() const { return browsingType; }
|
||||
|
||||
signals:
|
||||
void currentBonjourRecordsChanged(const QList<BonjourRecord> &list);
|
||||
void error(DNSServiceErrorType err);
|
||||
|
||||
private slots:
|
||||
void bonjourSocketReadyRead();
|
||||
|
||||
private:
|
||||
static void DNSSD_API bonjourBrowseReply(DNSServiceRef , DNSServiceFlags flags, quint32,
|
||||
DNSServiceErrorType errorCode, const char *serviceName,
|
||||
const char *regType, const char *replyDomain, void *context);
|
||||
DNSServiceRef dnssref;
|
||||
QSocketNotifier *bonjourSocket;
|
||||
QList<BonjourRecord> bonjourRecords;
|
||||
QString browsingType;
|
||||
};
|
||||
|
||||
#endif // BONJOURSERVICEBROWSER_H
|
69
include/bonjour/bonjourserviceresolver.h
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
Copyright (c) 2007, Trenton Schulz
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. The name of the author may not be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef BONJOURSERVICERESOLVER_H
|
||||
#define BONJOURSERVICERESOLVER_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
|
||||
|
||||
#include <dns_sd.h>
|
||||
|
||||
class QSocketNotifier;
|
||||
class QHostInfo;
|
||||
class BonjourRecord;
|
||||
|
||||
class BonjourServiceResolver : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
BonjourServiceResolver(QObject *parent);
|
||||
~BonjourServiceResolver();
|
||||
|
||||
bool resolveBonjourRecord(const BonjourRecord &record);
|
||||
|
||||
signals:
|
||||
void bonjourRecordResolved(const QHostInfo &hostInfo, int port);
|
||||
void error(DNSServiceErrorType error);
|
||||
|
||||
private slots:
|
||||
void bonjourSocketReadyRead();
|
||||
void cleanupResolve();
|
||||
void finishConnect(const QHostInfo &hostInfo);
|
||||
|
||||
private:
|
||||
static void DNSSD_API bonjourResolveReply(DNSServiceRef sdRef, DNSServiceFlags flags,
|
||||
quint32 interfaceIndex, DNSServiceErrorType errorCode,
|
||||
const char *fullName, const char *hosttarget, quint16 port,
|
||||
quint16 txtLen, const char *txtRecord, void *context);
|
||||
DNSServiceRef dnssref;
|
||||
QSocketNotifier *bonjourSocket;
|
||||
int bonjourPort;
|
||||
};
|
||||
|
||||
#endif // BONJOURSERVICERESOLVER_H
|
@ -1,5 +1,4 @@
|
||||
#ifndef HYPERION_OPTION_H
|
||||
#define HYPERION_OPTION_H
|
||||
#pragma once
|
||||
|
||||
#include <QCommandLineOption>
|
||||
#include <QCommandLineParser>
|
||||
@ -13,38 +12,30 @@ class Parser;
|
||||
* regular QCommandLineOption it is _not_ idempotent! */
|
||||
class Option: public QCommandLineOption
|
||||
{
|
||||
protected:
|
||||
QString _error;
|
||||
public:
|
||||
Option(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString::null,
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: QCommandLineOption(name, description, valueName, defaultValue)
|
||||
{}
|
||||
Option(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString::null,
|
||||
const QString &defaultValue = QString()
|
||||
)
|
||||
: QCommandLineOption(names, description, valueName, defaultValue)
|
||||
{}
|
||||
Option(const QCommandLineOption &other)
|
||||
: QCommandLineOption(other)
|
||||
{}
|
||||
Option(const QString &name,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString::null,
|
||||
const QString &defaultValue = QString()
|
||||
);
|
||||
|
||||
virtual bool validate(Parser &parser, QString &value);
|
||||
QString name()
|
||||
{ return this->names().last();}
|
||||
QString getError()
|
||||
{ return this->_error; }
|
||||
Option(const QStringList &names,
|
||||
const QString &description = QString(),
|
||||
const QString &valueName = QString::null,
|
||||
const QString &defaultValue = QString()
|
||||
);
|
||||
|
||||
Option(const QCommandLineOption &other);
|
||||
|
||||
virtual bool validate(Parser &parser, QString &value);
|
||||
QString name();
|
||||
QString getError();
|
||||
QString value(Parser &parser);
|
||||
std::string getStdString(Parser &parser);
|
||||
std::wstring getStdWString(Parser &parser);
|
||||
const char* getCString(Parser &parser);
|
||||
const char* getCString(Parser &parser);
|
||||
|
||||
protected:
|
||||
QString _error;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif //HYPERION_OPTION_H
|
||||
|
@ -45,13 +45,10 @@ public:
|
||||
|
||||
public slots:
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
int runEffect(const QString &effectName, int priority, int timeout = -1)
|
||||
{
|
||||
return runEffect(effectName, QJsonObject(), priority, timeout);
|
||||
};
|
||||
int runEffect(const QString &effectName, int priority, int timeout = -1, const QString &origin="System");
|
||||
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
int runEffect(const QString &effectName, const QJsonObject & args, int priority, int timeout = -1, QString pythonScript = "");
|
||||
int runEffect(const QString &effectName, const QJsonObject & args, int priority, int timeout = -1, const QString &pythonScript = "", const QString &origin = "System");
|
||||
|
||||
/// Clear any effect running on the provided channel
|
||||
void channelCleared(int priority);
|
||||
@ -68,7 +65,7 @@ private:
|
||||
bool loadEffectSchema(const QString & path, const QString & effectSchemaFile, EffectSchema &effectSchema);
|
||||
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
int runEffectScript(const QString &script, const QString &name, const QJsonObject & args, int priority, int timeout = -1);
|
||||
int runEffectScript(const QString &script, const QString &name, const QJsonObject & args, int priority, int timeout = -1, const QString & origin="System");
|
||||
|
||||
private:
|
||||
Hyperion * _hyperion;
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
/// @param[in] width The width of the captured screenshot
|
||||
/// @param[in] height The heigth of the captured screenshot
|
||||
///
|
||||
FramebufferFrameGrabber(const std::string & device, const unsigned width, const unsigned height);
|
||||
FramebufferFrameGrabber(const QString & device, const unsigned width, const unsigned height);
|
||||
~FramebufferFrameGrabber();
|
||||
|
||||
///
|
||||
@ -47,7 +47,7 @@ private:
|
||||
unsigned char * _fbp;
|
||||
|
||||
/// Framebuffer device e.g. /dev/fb0
|
||||
const std::string _fbDevice;
|
||||
const QString _fbDevice;
|
||||
|
||||
/// With of the captured snapshot [pixels]
|
||||
const unsigned _width;
|
||||
|
@ -28,7 +28,7 @@ public:
|
||||
/// @param[in] grabHeight The height of the grabbed images [pixels]
|
||||
/// @param[in] updateRate_Hz The image grab rate [Hz]
|
||||
///
|
||||
FramebufferWrapper(const std::string & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
|
||||
FramebufferWrapper(const QString & device, const unsigned grabWidth, const unsigned grabHeight, const unsigned updateRate_Hz, const int priority);
|
||||
|
||||
///
|
||||
/// Destructor of this framebuffer frame grabber. Releases any claimed resources.
|
||||
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// stl includes
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
@ -29,7 +28,7 @@ class V4L2Grabber : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
V4L2Grabber(const std::string & device,
|
||||
V4L2Grabber(const QString & device,
|
||||
int input,
|
||||
VideoStandard videoStandard, PixelFormat pixelFormat,
|
||||
int width,
|
||||
@ -41,6 +40,7 @@ public:
|
||||
virtual ~V4L2Grabber();
|
||||
|
||||
QRectF getSignalDetectionOffset();
|
||||
bool getSignalDetectionEnabled();
|
||||
|
||||
public slots:
|
||||
void setCropping(int cropLeft,
|
||||
@ -62,6 +62,8 @@ public slots:
|
||||
double verticalMax,
|
||||
double horizontalMax);
|
||||
|
||||
void setSignalDetectionEnable(bool enable);
|
||||
|
||||
bool start();
|
||||
|
||||
void stop();
|
||||
@ -103,9 +105,9 @@ private:
|
||||
|
||||
int xioctl(int request, void *arg);
|
||||
|
||||
void throw_exception(const std::string &error);
|
||||
void throw_exception(const QString &error);
|
||||
|
||||
void throw_errno_exception(const std::string &error);
|
||||
void throw_errno_exception(const QString &error);
|
||||
|
||||
private:
|
||||
enum io_method {
|
||||
@ -120,8 +122,8 @@ private:
|
||||
};
|
||||
|
||||
private:
|
||||
std::string _deviceName;
|
||||
std::map<std::string,std::string> _v4lDevices;
|
||||
QString _deviceName;
|
||||
std::map<QString,QString> _v4lDevices;
|
||||
int _input;
|
||||
VideoStandard _videoStandard;
|
||||
io_method _ioMethod;
|
||||
@ -134,13 +136,19 @@ private:
|
||||
int _lineLength;
|
||||
int _frameByteSize;
|
||||
int _frameDecimation;
|
||||
int _noSignalCounterThreshold;
|
||||
|
||||
// signal detection
|
||||
int _noSignalCounterThreshold;
|
||||
ColorRgb _noSignalThresholdColor;
|
||||
bool _signalDetectionEnabled;
|
||||
bool _noSignalDetected;
|
||||
int _noSignalCounter;
|
||||
double _x_frac_min;
|
||||
double _y_frac_min;
|
||||
double _x_frac_max;
|
||||
double _y_frac_max;
|
||||
|
||||
int _currentFrame;
|
||||
int _noSignalCounter;
|
||||
|
||||
QSocketNotifier * _streamNotifier;
|
||||
|
||||
ImageResampler _imageResampler;
|
||||
@ -149,10 +157,5 @@ private:
|
||||
bool _initialized;
|
||||
bool _deviceAutoDiscoverEnabled;
|
||||
|
||||
bool _noSignalDetected;
|
||||
double _x_frac_min;
|
||||
double _y_frac_min;
|
||||
double _x_frac_max;
|
||||
double _y_frac_max;
|
||||
|
||||
};
|
||||
|
@ -13,7 +13,7 @@ class V4L2Wrapper : public GrabberWrapper
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
V4L2Wrapper(const std::string & device,
|
||||
V4L2Wrapper(const QString & device,
|
||||
int input,
|
||||
VideoStandard videoStandard,
|
||||
PixelFormat pixelFormat,
|
||||
@ -27,6 +27,8 @@ public:
|
||||
const int priority);
|
||||
virtual ~V4L2Wrapper();
|
||||
|
||||
bool getSignalDetectionEnable();
|
||||
|
||||
public slots:
|
||||
bool start();
|
||||
void stop();
|
||||
@ -34,6 +36,7 @@ public slots:
|
||||
void setCropping(int cropLeft, int cropRight, int cropTop, int cropBottom);
|
||||
void setSignalDetectionOffset(double verticalMin, double horizontalMin, double verticalMax, double horizontalMax);
|
||||
void set3D(VideoMode mode);
|
||||
void setSignalDetectionEnable(bool enable);
|
||||
|
||||
// signals:
|
||||
// void emitColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms);
|
||||
|
@ -1,8 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
/**
|
||||
* Enumeration of the possible video standards the grabber can be set to
|
||||
*/
|
||||
@ -12,10 +9,10 @@ enum VideoStandard {
|
||||
VIDEOSTANDARD_NO_CHANGE
|
||||
};
|
||||
|
||||
inline VideoStandard parseVideoStandard(std::string videoStandard)
|
||||
inline VideoStandard parseVideoStandard(QString videoStandard)
|
||||
{
|
||||
// convert to lower case
|
||||
std::transform(videoStandard.begin(), videoStandard.end(), videoStandard.begin(), ::tolower);
|
||||
videoStandard = videoStandard.toLower();
|
||||
|
||||
if (videoStandard == "pal")
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
// STL includes
|
||||
#include <string>
|
||||
#include <QString>
|
||||
|
||||
// Utils includes
|
||||
#include <utils/RgbChannelAdjustment.h>
|
||||
@ -12,7 +12,7 @@ class ColorAdjustment
|
||||
public:
|
||||
|
||||
/// Unique identifier for this color transform
|
||||
std::string _id;
|
||||
QString _id;
|
||||
|
||||
/// The BLACK (RGB-Channel) adjustment
|
||||
RgbChannelAdjustment _rgbBlackAdjustment;
|
||||
|
@ -2,7 +2,6 @@
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <string>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
|
@ -2,11 +2,12 @@
|
||||
|
||||
// stl includes
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <QMap>
|
||||
|
||||
// QT includes
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <QTimer>
|
||||
#include <QSize>
|
||||
#include <QJsonObject>
|
||||
@ -33,6 +34,8 @@
|
||||
|
||||
// KodiVideoChecker includes
|
||||
#include <kodivideochecker/KODIVideoChecker.h>
|
||||
#include <bonjour/bonjourservicebrowser.h>
|
||||
#include <bonjour/bonjourserviceresolver.h>
|
||||
|
||||
// Forward class declaration
|
||||
class LedDevice;
|
||||
@ -52,8 +55,8 @@ class Hyperion : public QObject
|
||||
public:
|
||||
/// Type definition of the info structure used by the priority muxer
|
||||
typedef PriorityMuxer::InputInfo InputInfo;
|
||||
typedef std::map<std::string,int> PriorityRegister;
|
||||
|
||||
typedef QMap<QString,int> PriorityRegister;
|
||||
typedef QMap<QString,BonjourRecord> BonjourRegister;
|
||||
///
|
||||
/// RGB-Color channel enumeration
|
||||
///
|
||||
@ -128,16 +131,17 @@ public:
|
||||
|
||||
/// get filename of configfile
|
||||
/// @return the current config filename
|
||||
std::string getConfigFileName() { return _configFile.toStdString(); };
|
||||
QString getConfigFileName() { return _configFile; };
|
||||
|
||||
/// register a input source to a priority channel
|
||||
/// @param name uniq name of input source
|
||||
/// @param origin External setter
|
||||
/// @param priority priority channel
|
||||
void registerPriority(const std::string name, const int priority);
|
||||
void registerPriority(const QString &name, const int priority);
|
||||
|
||||
/// unregister a input source to a priority channel
|
||||
/// @param name uniq name of input source
|
||||
void unRegisterPriority(const std::string name);
|
||||
void unRegisterPriority(const QString &name);
|
||||
|
||||
/// gets current priority register
|
||||
/// @return the priority register
|
||||
@ -175,6 +179,8 @@ public:
|
||||
|
||||
int getConfigVersionId() { return _configVersionId; };
|
||||
|
||||
int getLatchTime() const;
|
||||
|
||||
public slots:
|
||||
///
|
||||
/// Writes a single color to all the leds for the given time and priority
|
||||
@ -191,8 +197,10 @@ public slots:
|
||||
/// @param[in] priority The priority of the written colors
|
||||
/// @param[in] ledColors The colors to write to the leds
|
||||
/// @param[in] timeout_ms The time the leds are set to the given colors [ms]
|
||||
/// @param[in] component The current component
|
||||
/// @param[in] origin Who set it
|
||||
///
|
||||
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID);
|
||||
void setColors(int priority, const std::vector<ColorRgb> &ledColors, const int timeout_ms, bool clearEffects = true, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System");
|
||||
|
||||
///
|
||||
/// Writes the given colors to all leds for the given time and priority
|
||||
@ -207,13 +215,13 @@ public slots:
|
||||
/// Returns the list with unique adjustment identifiers
|
||||
/// @return The list with adjustment identifiers
|
||||
///
|
||||
const std::vector<std::string> & getAdjustmentIds() const;
|
||||
const QStringList & getAdjustmentIds() const;
|
||||
|
||||
///
|
||||
/// Returns the ColorAdjustment with the given identifier
|
||||
/// @return The adjustment with the given identifier (or nullptr if the identifier does not exist)
|
||||
///
|
||||
ColorAdjustment * getAdjustment(const std::string& id);
|
||||
ColorAdjustment * getAdjustment(const QString& id);
|
||||
|
||||
///
|
||||
/// Returns MessageForwarder Object
|
||||
@ -241,18 +249,22 @@ public slots:
|
||||
/// @param effectName Name of the effec to run
|
||||
/// @param priority The priority channel of the effect
|
||||
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
|
||||
int setEffect(const QString & effectName, int priority, int timeout = -1);
|
||||
int setEffect(const QString & effectName, int priority, int timeout = -1, const QString & origin="System");
|
||||
|
||||
/// Run the specified effect on the given priority channel and optionally specify a timeout
|
||||
/// @param effectName Name of the effec to run
|
||||
/// @param args arguments of the effect script
|
||||
/// @param priority The priority channel of the effect
|
||||
/// @param timeout The timeout of the effect (after the timout, the effect will be cleared)
|
||||
int setEffect(const QString & effectName, const QJsonObject & args, int priority, int timeout = -1, QString pythonScript = "");
|
||||
int setEffect(const QString & effectName, const QJsonObject & args, int priority,
|
||||
int timeout = -1, const QString & pythonScript = "", const QString & origin="System");
|
||||
|
||||
/// sets the methode how image is maped to leds
|
||||
void setLedMappingType(int mappingType);
|
||||
|
||||
///
|
||||
Hyperion::BonjourRegister getHyperionSessions();
|
||||
|
||||
public:
|
||||
static Hyperion *_hyperion;
|
||||
|
||||
@ -298,6 +310,10 @@ private slots:
|
||||
///
|
||||
void update();
|
||||
|
||||
void currentBonjourRecordsChanged(const QList<BonjourRecord> &list);
|
||||
void bonjourRecordResolved(const QHostInfo &hostInfo, int port);
|
||||
void bonjourResolve();
|
||||
|
||||
private:
|
||||
|
||||
///
|
||||
@ -340,6 +356,7 @@ private:
|
||||
|
||||
/// The timer for handling priority channel timeouts
|
||||
QTimer _timer;
|
||||
QTimer _timerBonjourResolver;
|
||||
|
||||
/// buffer for leds
|
||||
std::vector<ColorRgb> _ledBuffer;
|
||||
@ -369,5 +386,9 @@ private:
|
||||
|
||||
int _configVersionId;
|
||||
|
||||
hyperion::Components _prevCompId;
|
||||
hyperion::Components _prevCompId;
|
||||
BonjourServiceBrowser _bonjourBrowser;
|
||||
BonjourServiceResolver _bonjourResolver;
|
||||
BonjourRegister _hyperionSessions;
|
||||
QString _bonjourCurrentServiceToResolve;
|
||||
};
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
// STL includes
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Local includes
|
||||
|
@ -25,8 +25,8 @@ public:
|
||||
MessageForwarder();
|
||||
~MessageForwarder();
|
||||
|
||||
void addJsonSlave(std::string slave);
|
||||
void addProtoSlave(std::string slave);
|
||||
void addJsonSlave(QString slave);
|
||||
void addProtoSlave(QString slave);
|
||||
|
||||
bool protoForwardingEnabled();
|
||||
bool jsonForwardingEnabled();
|
||||
|
@ -33,7 +33,10 @@ public:
|
||||
int64_t timeoutTime_ms;
|
||||
/// The colors for each led of the channel
|
||||
std::vector<ColorRgb> ledColors;
|
||||
/// The component
|
||||
hyperion::Components componentId;
|
||||
/// Who set it
|
||||
QString origin;
|
||||
};
|
||||
|
||||
/// The lowest possible priority, which is used when no priority channels are active
|
||||
@ -90,8 +93,10 @@ public:
|
||||
/// @param[in] priority The priority of the channel
|
||||
/// @param[in] ledColors The led colors of the priority channel
|
||||
/// @param[in] timeoutTime_ms The absolute timeout time of the channel
|
||||
/// @param[in] component The component of the channel
|
||||
/// @param[in] origin Who set the channel
|
||||
///
|
||||
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID);
|
||||
void setInput(const int priority, const std::vector<ColorRgb>& ledColors, const int64_t timeoutTime_ms=-1, hyperion::Components component=hyperion::COMP_INVALID, const QString origin="System");
|
||||
|
||||
///
|
||||
/// Clears the specified priority channel
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
// system includes
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
// QT includes
|
||||
#include <QTimer>
|
||||
|