commit
451b51d781
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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:__ 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
|
||||
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in New Issue