Compare commits
6 Commits
f0b900027a
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 073dfc7274 | |||
| d45abc9595 | |||
| 2e124db4cb | |||
| c2d09342a1 | |||
| 0ef9e3c6c5 | |||
| 80a826a77f |
+9
-3
@@ -1,14 +1,19 @@
|
||||
{
|
||||
"name": "civic-segments",
|
||||
"author": "RandyTheSilly",
|
||||
"version": "1.0.0",
|
||||
"version": "1.0.1",
|
||||
"keywords": [
|
||||
"honda",
|
||||
"civic",
|
||||
"segment",
|
||||
"display",
|
||||
"led",
|
||||
"speedometer"
|
||||
"speedometer",
|
||||
"car",
|
||||
"replica"
|
||||
],
|
||||
"capabilities": [
|
||||
"configurable"
|
||||
],
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
@@ -20,7 +25,8 @@
|
||||
"sdkVersion": "3",
|
||||
"enableMultiJS": true,
|
||||
"targetPlatforms": [
|
||||
"emery"
|
||||
"emery",
|
||||
"gabbro"
|
||||
],
|
||||
"watchapp": {
|
||||
"watchface": true
|
||||
|
||||
+9
-1
@@ -17,7 +17,11 @@ static Layer *s_fuel_mg_layer;
|
||||
static Layer *s_fuel_layer;
|
||||
static const uint8_t s_x_r = (PBL_DISPLAY_WIDTH / 2) + 2;
|
||||
static const uint8_t s_x_l = (s_x_r - 2 * (69 / 2)) - 5;
|
||||
static const GRect s_digit_grects[4] = {GRect(s_x_l, 2, 69, 110), GRect(s_x_r, 2, 69, 110), GRect(s_x_l, 116, 69, 110), GRect(s_x_r, 116, 69, 110)}; // emery
|
||||
#if PBL_DISPLAY_WIDTH == 200
|
||||
static const GRect s_digit_grects[4] = {GRect(s_x_l, 2, 69, 110), GRect(s_x_r, 2, 69, 110), GRect(s_x_l, 116, 69, 110), GRect(s_x_r, 116, 69, 110)};
|
||||
#else
|
||||
static const GRect s_digit_grects[4] = {GRect(s_x_l, 18, 69, 110), GRect(s_x_r, 18, 69, 110), GRect(s_x_l, 132, 69, 110), GRect(s_x_r, 132, 69, 110)};
|
||||
#endif
|
||||
static const uint8_t s_temp_guage_x_pos = 6;
|
||||
static const uint16_t s_fuel_guage_x_pos = PBL_DISPLAY_WIDTH - 23;
|
||||
|
||||
@@ -625,7 +629,11 @@ static void init() {
|
||||
if (persist_exists(STORAGE_KEY_SETTINGS)) {
|
||||
persist_read_data(STORAGE_KEY_SETTINGS, &settings, sizeof(settings));
|
||||
} else {
|
||||
#if PBL_RECT
|
||||
settings.EnablePeek = true;
|
||||
#else
|
||||
settings.EnablePeek = false;
|
||||
#endif
|
||||
settings.TrackBTStatus = false;
|
||||
settings.ShowDigitsMG = false;
|
||||
settings.UseCustomLED = false;
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ module.exports = [
|
||||
"messageKey": "CLAY_TRACK_BT_STATUS",
|
||||
"defaultValue": false,
|
||||
"label": "BT disconnect indicator",
|
||||
"description": "Change the color of the digits to the configured warning color when the connection to the phone is lost."
|
||||
"description": "Change the color of the hour digits to the configured warning color when the app connection is lost."
|
||||
},
|
||||
{
|
||||
"type": "slider",
|
||||
|
||||
+16
-3
@@ -2,13 +2,26 @@ function weatherFailure() {
|
||||
Pebble.sendAppMessage({ PKJS_TEMP_BAR_COUNT: -1 });
|
||||
}
|
||||
|
||||
var xhrRequest = function (url, type, callback) {
|
||||
var xhrRequest = function (url, type, callback, retries) {
|
||||
if (retries === undefined) {
|
||||
retries = 2;
|
||||
}
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.timeout = 7500;
|
||||
xhr.onload = function () {
|
||||
if (xhr.status === 200) {
|
||||
switch (xhr.status) {
|
||||
case 200:
|
||||
callback(this.responseText);
|
||||
} else {
|
||||
break;
|
||||
case 503:
|
||||
if (retries > 0) {
|
||||
setTimeout(function () {
|
||||
xhrRequest(url, type, callback, retries - 1);
|
||||
}, 5000);
|
||||
break;
|
||||
}
|
||||
// fallthrough
|
||||
default:
|
||||
weatherFailure();
|
||||
}
|
||||
};
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 176 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 831 B |
Binary file not shown.
|
After Width: | Height: | Size: 890 B |
Binary file not shown.
|
After Width: | Height: | Size: 878 B |
@@ -1,42 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from subprocess import run
|
||||
|
||||
from bdfparser import Font
|
||||
from PIL import Image
|
||||
|
||||
font = Font("civic-segments.bdf")
|
||||
print(
|
||||
f"This font's global size is "
|
||||
f"{font.headers['fbbx']} x {font.headers['fbby']} (pixel), "
|
||||
f"it contains {len(font)} glyphs."
|
||||
)
|
||||
chars_to_export = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]
|
||||
for char_str in chars_to_export:
|
||||
char = font.glyph(char_str)
|
||||
bitmap = char.draw()
|
||||
im = Image.frombytes(
|
||||
"RGBA",
|
||||
(bitmap.width(), bitmap.height()),
|
||||
bitmap.tobytes(
|
||||
"RGBA",
|
||||
bytesdict={
|
||||
0: b"\x00\x00\x00\x00", # transparent background
|
||||
1: b"\xff\xff\xff\xff", # white glyph
|
||||
},
|
||||
),
|
||||
)
|
||||
output_path = f"../resources/{char_str}.png"
|
||||
im.save(output_path, "PNG")
|
||||
run(
|
||||
[
|
||||
"zopflipng",
|
||||
"-y",
|
||||
"--iterations=500",
|
||||
"--filters=01234mepb",
|
||||
"--lossy_8bit",
|
||||
"--lossy_transparent",
|
||||
output_path,
|
||||
output_path,
|
||||
]
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user