From 225b4be09de364f32ca79f9876adfc74b52af9fa Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 3 Jun 2023 21:11:55 -0500 Subject: [PATCH 1/5] Update README.md --- apps/ohmcalc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ohmcalc/README.md b/apps/ohmcalc/README.md index f45b8e977..a890e590a 100644 --- a/apps/ohmcalc/README.md +++ b/apps/ohmcalc/README.md @@ -7,7 +7,7 @@ This is a simple and intuitive Ohm's Law Calculator application designed for the * __Select the Electrical Measurement:__ On the main menu, select the electrical measurement that you wish to calculate (Voltage, Current, Resistance, or Power). * __Enter Known Values:__ You will then be prompted to enter the known values. The application will present a menu listing the remaining electrical measurements. Select one and you will be taken to a numeric input screen. Repeat this step for the second known value. * __View Results:__ Once the two known values have been entered, the application will automatically calculate and display the value of the selected electrical measurement. The Results menu will show the calculated value, the unit of measurement, and the formula used for calculation. -* __Navigation:__ Whether you're deep in calculations or perusing the results, the 'Back' button is always available to help you step back through the app. In case you'd like to start afresh from the Results menu, just tap on 'Main Menu'. +* __Navigation:__ Even when you're deeply involved in entering calculations or examining the results, the power to navigate the app remains in your hands. While the 'Back' button is present in most scenarios, it isn't available in the Results menu and the Input screen. However, you can always return to the beginning by selecting 'Main Menu' from the Results menu. And if you're on the numeric Input screen, simply hold down the 'Clear' button to navigate back. ## Compatibility From ad0b24a597ce51a60ed358cc471db7bc5445f37e Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 3 Jun 2023 22:22:00 -0500 Subject: [PATCH 2/5] Update app.js - Adds haptics to Input screen and long press "C" to go back --- apps/ohmcalc/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/ohmcalc/app.js b/apps/ohmcalc/app.js index 4a3d97e8c..61ab4a0be 100644 --- a/apps/ohmcalc/app.js +++ b/apps/ohmcalc/app.js @@ -50,6 +50,7 @@ let handleEnter; let showVariableSelectionMenu; let showInputMenu; let resultsMenu; +let mainMenu; // Setup the layout for input buttons let layout = new Layout({ @@ -59,7 +60,7 @@ let layout = new Layout({ { type: "h", c: "123".split("").map(i => ({ type: "btn", font: "6x8:3", label: i, cb: () => { handleButtonPress(i); }, fillx: 1, filly: 1 })) }, { type: "h", c: "456".split("").map(i => ({ type: "btn", font: "6x8:3", label: i, cb: () => { handleButtonPress(i); }, fillx: 1, filly: 1 })) }, { type: "h", c: "789".split("").map(i => ({ type: "btn", font: "6x8:3", label: i, cb: () => { handleButtonPress(i); }, fillx: 1, filly: 1 })) }, - { type: "h", c: ".0C".split("").map(i => ({ type: "btn", font: "6x8:3", label: i, cb: () => { handleButtonPress(i); }, fillx: 1, filly: 1 })) }, + { type: "h", c: ".0C".split("").map(i => ({ type: "btn", font: "6x8:3", label: i, cb: () => { handleButtonPress(i); }, cbl: i === "C" ? () => { E.showMenu(mainMenu); Bangle.buzz(20); } : undefined, fillx: 1, filly: 1 })) }, { type: "h", c: [{ type: "btn", font: "6x8:2", label: "Enter", cb: () => { handleEnter(); }, fillx: 1, filly: 1 }] } ] }, { lazy: false }); @@ -109,6 +110,7 @@ function setValue(newStr) { // Function to handle the press of a button and append its value to the current input function handleButtonPress(value) { + Bangle.buzz(20); if (invalidInput) { return; // Don't allow input if an invalid input error message is displayed } @@ -165,7 +167,7 @@ function calculateValue(calculatedVariable, variableValues) { // Main function to initialize the application and setup the main menu (function () { - let mainMenu = { + mainMenu = { '': { 'title': 'Ohm\'s Law Calc' }, '< Back': () => Bangle.showClock() }; From dcf3a33a29181b59e8c0b24956dbff8538902f95 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 3 Jun 2023 22:22:42 -0500 Subject: [PATCH 3/5] Update ChangeLog --- apps/ohmcalc/ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/ohmcalc/ChangeLog b/apps/ohmcalc/ChangeLog index 68790afee..af752b896 100644 --- a/apps/ohmcalc/ChangeLog +++ b/apps/ohmcalc/ChangeLog @@ -1,2 +1,3 @@ 0.01: New App! 0.02: New Results menu item to show the formula and values used. +0.03: Adds haptics to Input screen and long press "C" to go back. From a0fcef0b92a1511ecd58db5055756fbb6efa49e7 Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 3 Jun 2023 22:22:57 -0500 Subject: [PATCH 4/5] Update metadata.json --- apps/ohmcalc/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ohmcalc/metadata.json b/apps/ohmcalc/metadata.json index 1272b9f91..de81ec6d7 100644 --- a/apps/ohmcalc/metadata.json +++ b/apps/ohmcalc/metadata.json @@ -2,7 +2,7 @@ "id": "ohmcalc", "name": "Ohm's Law Calculator", "shortName": "Ohm's Law Calc", - "version": "0.02", + "version": "0.03", "description": "A smart and simple calculator for Ohm's Law calculations, designed specifically for Bangle.js 2 smartwatches. Handles voltage, current, resistance, and power calculations with smart logic to prevent invalid inputs.", "icon": "app.png", "type": "app", From 02a5f81a0efbbade9cfcdf39875224052893b9ee Mon Sep 17 00:00:00 2001 From: stweedo <108593831+stweedo@users.noreply.github.com> Date: Sat, 3 Jun 2023 22:24:45 -0500 Subject: [PATCH 5/5] Update README.md --- apps/ohmcalc/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/ohmcalc/README.md b/apps/ohmcalc/README.md index a890e590a..3add03736 100644 --- a/apps/ohmcalc/README.md +++ b/apps/ohmcalc/README.md @@ -7,7 +7,7 @@ This is a simple and intuitive Ohm's Law Calculator application designed for the * __Select the Electrical Measurement:__ On the main menu, select the electrical measurement that you wish to calculate (Voltage, Current, Resistance, or Power). * __Enter Known Values:__ You will then be prompted to enter the known values. The application will present a menu listing the remaining electrical measurements. Select one and you will be taken to a numeric input screen. Repeat this step for the second known value. * __View Results:__ Once the two known values have been entered, the application will automatically calculate and display the value of the selected electrical measurement. The Results menu will show the calculated value, the unit of measurement, and the formula used for calculation. -* __Navigation:__ Even when you're deeply involved in entering calculations or examining the results, the power to navigate the app remains in your hands. While the 'Back' button is present in most scenarios, it isn't available in the Results menu and the Input screen. However, you can always return to the beginning by selecting 'Main Menu' from the Results menu. And if you're on the numeric Input screen, simply hold down the 'Clear' button to navigate back. +* __Navigation:__ Whether you're deep in calculations or perusing the results, the power to navigate the app remains in your hands. While the 'Back' button is present in most scenarios, it isn't available in the Results menu and the Input screen. However, you can always return to the beginning by selecting 'Main Menu' from the Results menu. And if you're on the numeric Input screen, simply hold down the 'Clear' button to navigate back. ## Compatibility