-
-
-
-
-
-
Not sure if this is related to the new menu, so i put it in a new thread:
Changing colors in settings>system>theme>customize is strange. It seems like selecting colors works, but the display always shows the same color. Just updated from .27 to .32, but the problem is still there.
I just played around with the color menu for a while, then i got a page full of error messages (debug info was "off"). After reboot, it told me storage was corrupted. After a few minutes, i ended up with a factory reset watch. The color menu still does not work. -
-
-
-
Last night, my watch seems to have changed from dark to light theme. However, when i go to settings, the themes seem to have flipped internally.
When i select dark theme, the background is white.
When i select light theme, the background is black.
When i try to change color in the custom theme, i see the selected color in the menu, the watch vibrates when i change it, but the display does not update.
Firmware 2v12.27 -
-
To those using ContourClock: Could you try this version and see if the issue is solved? Thanks!
-
I changed the code to this:
setTimeout(function() { setInterval(draw,60000); }, 60000 - Date.now() % 60000);
I also put this line in draw() to measure the timing error:
g.setFontAlign(0,1).drawString(parseInt(((Date.now()+30000)%60000)-30000)/1000,g.getWidth()/2,24+18);
So far it has never shown more than 0.01s, which is good enough for a clock that updates every minute.
-
-
I played around with the time on my phone, but it didn´t stop the clock.
BTW: Why do all clocks seem to use timeouts instead of intervals to update? I just changedfunction queueDraw() { if (drawTimeout) clearTimeout(drawTimeout); drawTimeout = setTimeout(function() { drawTimeout = undefined; draw(); queueDraw(); }, 60000 - (Date.now() % 60000)); }
to
setInterval(draw,60000);
, which seems to do exactly the same.
-
-
-
-
I really prefer TouchMenu over the default settings page. For some reason though, it messes with my app´s own settings menu. As far as i know, TouchMenu just replaces the built in E.showMenu with some custom functions. My app does not use E.showMenu, but somehow parts of the TouchMenu are still drawn. Here is my settings code:
(function(back) { Bangle.setUI(""); var settings = require('Storage').readJSON("contourclock.json", true) || {}; if (settings.fontIndex==undefined) { settings.fontIndex=0; require('Storage').writeJSON("myapp.json", settings); } savedIndex=settings.fontIndex; setWatch(function() { //save changes and return to settings menu require('Storage').writeJSON("contourclock.json", settings); g.clear(); back(); }, BTN, { repeat:false, edge:'falling' }); Bangle.on('lock', function () { //discard changes and return to clock settings.fontIndex=savedIndex; require('Storage').writeJSON("contourclock.json", settings); g.clear(); load(); }); Bangle.on('swipe', function (direction) { g.clearRect(0,24,g.getWidth()-1,137); var fontName = require('contourclock').drawClock(settings.fontIndex+direction); if (fontName) { settings.fontIndex+=direction; g.clearRect(0,0,g.getWidth()-1,16); g.setFontAlign(0,-1).drawString(fontName,g.getWidth()/2,0); } }); g.reset(); g.clear(); g.setFont("6x8:2x2").setFontAlign(0,-1); g.drawString(require('contourclock').drawClock(settings.fontIndex),g.getWidth()/2,0); g.drawString("Swipe - change",g.getWidth()/2,g.getHeight()-36); g.drawString("BTN - save",g.getWidth()/2,g.getHeight()-18); })
-
-
-
Thanks a lot! One more problem: The drawClock function needs a font module. if i put
require("FontTeletext10x18Ascii").add(Graphics);
in the main clock code, the font is loaded and works in drawClock. The same code does not work in the settings app, i get
Contour Clock settings error: Error: Error: Module FontTeletext10x18Ascii not found
Loading the font in the library does not work either, but does not produce an error message... -
-
Here is a version for filled rectangles. Performance is roughly the same, faster for r<=12, slower for larger radii. Performance is an issue here, on my Bangle2, "bFillRoundedRectangle(10,10,160,160,13);" takes about 85ms. For UI use, i think a LUT for rounded corners would be the best approach. All coordinates needed for a circle covering the complete screen would take up just 52 bytes.
function bFillRoundedRectangle (x1,y1,x2,y2,r) { var f = 1 - r; var ddF_x = 0; var ddF_y = -2 * r; var x = 0; var y = r; g.fillRect(x1+r,y1,x2-r,y2); var cx1=x1+r; var cx2=x2-r; var cy1=y1+r; var cy2=y2-r; while(x < y) { if(f >= 0) { y--; ddF_y += 2; f += ddF_y; } x++; ddF_x += 2; f += ddF_x + 1; g.drawLine(cx1-x,cy1-y,cx1-x,cy2+y); g.drawLine(cx1-y,cy1-x,cx1-y,cy2+x); g.drawLine(cx2+x,cy1-y,cx2+x,cy2+y); g.drawLine(cx2+y,cy1-x,cx2+y,cy2+x); } }
I had a look at the LPM013M126C datasheet, and there is a color inversion mode that would cause exactly this behaviour (mentioned on page 19 of the linked document).
Maybe this is a communication issue? In that case, maybe we should forcibly reset the color inversion flag on every g.reset()