Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Glucocalc — Glucose/HbA1c Calculator (iOS + macOS)

A SwiftUI calculator that estimates HbA1c and average blood glucose using the 2008 ADAG Study Group formulas, plus glucose/HbA1c unit conversions.

Runs on iPhone, iPad, and macOS. The iPad window opens small and is freely resizable; the macOS app is a native SwiftUI port sharing the same codebase.

Features

  • Keypad-driven input: 7 8 9 C / 4 5 6 ⌫ / 1 2 3 = / 0 ., with = computing, C clearing (zeros input + results), backspacing
  • Calculate eAG (from HbA1c) and Calculate HbA1c (from eAG) modes
  • UK (IFCC) switch converts the current input to the other unit system on the fly (mg/dl ↔ mmol/L, % ↔ mmol/mol) and recomputes results
  • Results always show both units (mg/dl + mmol/L, or % + mmol/mol)
  • Display: three label/value rows, all values 0 initially and after C
  • Help sheet with usage, terminology, formulas, and contact info

Math (2008 ADAG Study Group)

  • eAG = 28.7 × A1c − 46.7 (mg/dl); mmol/L = /18
  • A1c = (eAG + 46.7) / 28.7 (%); IFCC = 10.93 × A1c − 23.50 (mmol/mol)
  • NGSP = 0.09148 × IFCC + 2.152; mmol/L ↔ mg/dl: ×18 / ÷18

Build

Project generated by xcodegen from project.yml — run xcodegen generate after adding/removing source files. Two targets share Glucocalc/ sources: iOS (Glucocalc) and macOS (GlucocalcMac, macOS 14+).

iOS — device

./build.sh            # build + install + launch (default: jphone)
./build.sh opad       # or specify a device

Requires Xcode 26.6 and a development team for device deployment.

iOS — simulator (no runtime installed)

xcodegen generate
xcodebuild -project Glucocalc.xcodeproj -target Glucocalc -sdk iphonesimulator -configuration Debug build
# product: build/Debug-iphonesimulator/Glucocalc.app

macOS

xcodegen generate
xcodebuild -project Glucocalc.xcodeproj -scheme GlucocalcMac -destination 'platform=macOS' build
open build/.../Glucocalc.app

License

GPL-3.0 — see LICENSE.

About

Glucocalc — Glucose/HbA1c calculator (SwiftUI, iOS + macOS)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages