UI/GFX improvements

This commit is contained in:
Ewoud
2023-03-27 20:41:53 +02:00
parent 9b25b6d8c6
commit 5991aa8624
5 changed files with 2244 additions and 2258 deletions

View File

@@ -1306,26 +1306,26 @@ function drawSegmentView() {
} // for each segment
if (gId("segcont").children.length > 0) { //Only show this if more then one segment
if (gId("segcont").children.length > 1) { //Only show this if more then one segment
gId("MD").innerHTML = "total W*H=LC: " + maxWidth + " x " + maxHeight + " = " + maxWidth * maxHeight;
}
gId("MD").style.display = gId("segcont").children.length > 0?"inline":"none"
gId("MD").style.display = gId("segcont").children.length > 1?"inline":"none"
function post() {
for (let p=0; p<gId("segcont").children.length; p++) {
if (!initSegmentVars(p)) break;
if (gId("segcont").children.length>1) { //only show number if more than one segment
if (gId("segcont").children.length>1) { //only show number and name if more than one segment
ctx.font = '40px Arial';
ctx.fillStyle = "orange";
ctx.fillText(p, topLeftX + pw/2*ppL - 10, topLeftY + ph/2*ppL + 10);
//show name of fx
ctx.font = '20px Arial';
ctx.fillStyle = "white";
var name = eJson.find((o)=>{return o.id==fx}).name;
ctx.fillText(name, topLeftX+10, topLeftY + ph*ppL - 10);
}
//show name of fx
ctx.font = '20px Arial';
ctx.fillStyle = "white";
var name = eJson.find((o)=>{return o.id==fx}).name;
ctx.fillText(name, topLeftX+10, topLeftY + ph*ppL - 10);
}
}

View File

@@ -24,9 +24,9 @@ function peek(c, setOff=false) {
if (leds[0] != 76 || leds[1] != 2 || !ctx) return; //'L', set in ws.cpp
let mW = leds[2]; // matrix width
let mH = leds[3]; // matrix height
let pPL = Math.min(c.width / mW, (c.height-10) / mH); // pixels per LED (width of circle) WLEDMM -10 for prompts
let pPL = Math.min(c.width / mW, c.height / mH); // pixels per LED (width of circle)
let lOf = Math.floor((c.width - pPL*mW)/2); //left offeset (to center matrix)
var i = 6;
var i = 4; //same offset as in ws.cpp
ctx.clearRect(0, 0, c.width, c.height); //WLEDMM
function colorAmp(color) {
if (color == 0) return 0;
@@ -39,10 +39,6 @@ function peek(c, setOff=false) {
ctx.fill();
i+=3;
}
//WLEDMM show preset and playlist id
ctx.fillStyle = `rgb(255,255,255)`;
if (leds[4] != 0) ctx.fillText("preset " + leds[4].toString(), lOf, mH*pPL+10);
if (leds[5] != 255) ctx.fillText("playlist " + leds[5].toString(), lOf + 70, mH*pPL+10);
}
} catch (err) {
console.error("Peek WS error:",err);

View File

@@ -310,49 +310,44 @@ const uint8_t PAGE_liveviewws2D[] PROGMEM = {
// Autogenerated from wled00/data/peek.js, do not edit!!
const uint16_t PAGE_peekJs_length = 644;
const uint16_t PAGE_peekJs_length = 575;
const uint8_t PAGE_peekJs[] PROGMEM = {
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x13, 0x75, 0x53, 0xdb, 0x6e, 0xdb, 0x30,
0x0c, 0xfd, 0x95, 0x54, 0x18, 0x52, 0x29, 0x56, 0x15, 0xc7, 0x6d, 0xda, 0xc1, 0xae, 0x17, 0x6c,
0x43, 0x1f, 0x06, 0xec, 0x12, 0x2c, 0x1d, 0xfa, 0x50, 0x04, 0xa8, 0x62, 0xd3, 0x89, 0x57, 0x55,
0x0a, 0x64, 0xe5, 0x62, 0xb8, 0xfe, 0xf7, 0x51, 0xb9, 0xac, 0xdd, 0xb0, 0x3d, 0xd8, 0x26, 0xc5,
0x73, 0x48, 0x1e, 0x8a, 0x2e, 0x56, 0x3a, 0x73, 0xa5, 0xd1, 0x9d, 0x25, 0xc0, 0x23, 0x75, 0x1c,
0xd2, 0x93, 0x01, 0x6b, 0xd6, 0xd2, 0x76, 0x6c, 0xea, 0xc4, 0x1c, 0xdc, 0x47, 0xa3, 0x1d, 0x6c,
0x1d, 0x25, 0x51, 0x4e, 0x58, 0x52, 0x16, 0xd4, 0xee, 0xc3, 0x26, 0x71, 0xb6, 0x6e, 0x4c, 0xea,
0xcc, 0x52, 0x6c, 0x4a, 0x9d, 0x9b, 0x8d, 0xd8, 0x54, 0x6d, 0x26, 0x5d, 0xb6, 0xa0, 0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, 0x25, 0x1c, 0x58, 0xd7, 0xb9, 0xe3, 0x63, 0x27, 0x3c, 0xa8, 0xa2,
0x99, 0xa1, 0x42, 0x08, 0xeb, 0xbc, 0x86, 0xc5, 0xcc, 0xe5, 0x77, 0x80, 0xe2, 0xc7, 0xf4, 0xea,
0xfb, 0xc4, 0x89, 0x1a, 0x6c, 0x41, 0x49, 0x7b, 0x62, 0xb6, 0x27, 0x29, 0xfa, 0x0d, 0x74, 0x84,
0xa5, 0xd4, 0x1d, 0x36, 0xfb, 0x8c, 0xa5, 0x94, 0x54, 0x88, 0xeb, 0x3a, 0x0d, 0x07, 0xf1, 0x78,
0x51, 0xc6, 0x85, 0x39, 0xc2, 0x4f, 0x8b, 0xb5, 0x77, 0xe8, 0x72, 0x67, 0x26, 0x64, 0x57, 0xd7,
0x24, 0x0d, 0x92, 0xb0, 0x98, 0xa4, 0xc3, 0x21, 0x89, 0x0b, 0x97, 0x6f, 0x56, 0x60, 0xf1, 0x05,
0x5c, 0xb9, 0x1a, 0x63, 0x32, 0xec, 0x31, 0x4c, 0x38, 0xeb, 0xd6, 0x60, 0x25, 0x65, 0xf2, 0x63,
0xfb, 0xcf, 0x39, 0x3a, 0xee, 0xc4, 0x42, 0x5b, 0xe5, 0x9b, 0x5f, 0xcd, 0x1a, 0x24, 0x51, 0xfd,
0x91, 0x2d, 0x0e, 0xa7, 0x49, 0x38, 0x4e, 0x7a, 0x66, 0x2b, 0xb7, 0x85, 0xab, 0x6d, 0xe8, 0xf1,
0x55, 0xd7, 0x08, 0x16, 0xc2, 0x3f, 0xac, 0xa0, 0xae, 0xd5, 0x12, 0x08, 0xb7, 0x2c, 0x75, 0x42,
0x15, 0xc5, 0xff, 0xe3, 0x5d, 0xf7, 0x17, 0x51, 0xe6, 0x9d, 0x18, 0x65, 0x03, 0x00, 0x00
};

File diff suppressed because it is too large Load Diff

View File

@@ -165,7 +165,7 @@ bool sendLiveLedsWs(uint32_t wsClient)
const size_t MAX_LIVE_LEDS_WS = 1024U; //WLEDMM use 4096 as max matrix size
#endif
size_t n = ((used -1)/MAX_LIVE_LEDS_WS) +1; //only serve every n'th LED if count over MAX_LIVE_LEDS_WS
size_t pos = (strip.isMatrix ? 6 : 2); // start of data WLEDMM 6 instead of 4
size_t pos = (strip.isMatrix ? 4 : 2);
size_t bufSize = pos + (used/n)*3;
size_t skipLines = 0;
@@ -179,8 +179,6 @@ bool sendLiveLedsWs(uint32_t wsClient)
buffer[1] = 2; //version
buffer[2] = Segment::maxWidth;
buffer[3] = Segment::maxHeight;
buffer[4] = currentPreset; //WLEDMM
buffer[5] = currentPlaylist; //WLEDMM
if (Segment::maxWidth * Segment::maxHeight > MAX_LIVE_LEDS_WS*4) {
buffer[2] = Segment::maxWidth/4;
buffer[3] = Segment::maxHeight/4;