How sakamochanq/dms-calculator works
Project Type and Purpose
• This is a small Excel‐VBA “add-in” style tool (a macro library) that you load into an Excel workbook (.xlsm) to perform DMS (degrees-minutes-seconds) arithmetic directly in cells.
• The user installs the VBA module (src/main.vba) via the VBA Editor, then invokes functions like sok_add, sok_sub, sok_sumAll, etc., as native Excel functions.
File Structure Analysis
• Top-level:
• LICENSE, README.md – project metadata
• assets/ – images for documentation (logo, demo GIF)
• docs/ – multi-language README files
• src/main.vba – the single VBA module containing all sok_ functions
• No separate backend/frontend, no database, no web server or external services.
README Insights
• Describes installation steps: clone repo → open VBA Editor → import main.vba → save as macro-enabled workbook → use sok_ functions in cells.
• Core functionality: DMS arithmetic, compass direction, conversion to/from decimal, trig functions on DMS values.
Diagramming the Architecture
a. Main Components
1. User (Excel end-user)
2. Excel Application (host environment)
3. VBA Runtime / VBA Editor
4. DMS-Calculator VBA Module (main.vba)
5. Excel Workbook (macro-enabled .xlsm)
6. Worksheet Cells (input/output)
b. Relationships & Data Flow
• User → Excel UI: enters sok_* formula in a cell.
• Excel Calculation Engine → VBA Runtime: when it encounters sok_* it invokes the VBA module.
• VBA Module (main.vba) → internal DMS logic: parses arguments, performs calculation.
• VBA Module → returns result back to Excel Calculation Engine.
• Excel Calculation Engine → writes result into the output cell.
c. Architectural Patterns & Principles
• Single-module plugin pattern: all logic lives in one VBA module.
• Function-call integration: tight Excel-VBA binding—no network, no external libraries.
• Separation of concerns:
• Excel handles UI & cell storage
• VBA handles computation
d. Key Technologies & Frameworks
• Microsoft Excel (host)
• VBA Runtime (built into Excel)
• Custom VBA code (main.vba)