How kevinboone/mowf works
Project Type & Purpose
• This is a Garmin Connect IQ watch face application designed for smart watches with OLED displays. Its goal is to display the time, date, battery charge, and (in high power mode) heart rate while minimizing power consumption and reducing screen burn-in.
• Unlike a full-stack application, this project is an embedded application running on wearable hardware. The challenges here focus on battery management and display strategy (switching between low-power and high-power modes).
Analyzing the File Structure
• Top-Level Files:
• .gitignore: Git configuration.
• README.md: Contains project description, design considerations, and build instructions.
• build.sh: Likely a build script that wraps commands.
• manifest.xml, monkey.jungle: Important for Connect IQ build configurations and defining the app’s structure.
• mowf.prg: The final compiled binary installed onto the device.
• Resources Folder:
• Source Folder:
• Contains multiple .mc files (Monkey-C source code):
• App.mc: Likely the entry point for the application.
• DisplayHelper.mc: Provides utility functions for drawing.
• Displayer.mc: Possibly a base module or interface for display behavior.
• HPDisplayer.mc and LPDisplayer.mc: Specialized modules for high power and low power display modes.
• View.mc: Manages the visual layout.
• This structure hints at a separation of concerns with respect to display logic and different power modes.
a. Main Components:
• Build/Compilation Process:
• Build Script (build.sh) invoking the Monkey-C compiler with configuration files (manifest.xml, monkey.jungle) to produce the final binary (mowf.prg).
• Core Application:
• App Component (App.mc) as the main application loop.
• Modules, split into:
‣ HP (High Power) Displayer (HPDisplayer.mc)
‣ LP (Low Power) Displayer (LPDisplayer.mc)
‣ Common Display interfaces/utilities (Displayer.mc and DisplayHelper.mc).
• View (View.mc): Manages layouting of digital watch face components (time, date, battery, heart rate).
• Resources:
• Assets like bitmaps, images, and strings (resources/ directory) are integrated by the display components.
• Hardware/Runtime Environment:
• Garmin Smart Watch with OLED display that runs mowf.prg.
• Optional simulator environment, as noted in the README.
b. Relationships & Interactions:
• The Build Process component uses configuration files and source code to produce a binary.
• The App Component initializes and manages the display mode switching (invoking either high power or low power display routines).
• DisplayHelper and Displayer modules provide abstraction and utilities to simplify drawing operations.
• View gathers data (time, date, battery, heart rate) and instructs the appropriate displayer to render on screen.
• Resources feed into the view and display helpers to supply layout elements, text, and images.
• The compiled binary (mowf.prg) is then installed on the Garmin device, which interacts directly with the hardware (via Connect IQ APIs).
c. Architectural Patterns & Design Principles:
• Separation of concerns: Dividing presentation (View, Display Modules) from application logic (App.mc) and resource management.
• Mode-based behavior: Different strategies for high-power vs. low-power rendering are encapsulated in dedicated modules to minimize code complexity.
• Modularity: Each source file covers specific functionality (helper functions, different display modes), making the system extendable and maintainable.