Crank Storyboard 9.0

website·Indexed 34 days ago

https://docs.cranksoftware.com/

Documentation for Crank Storyboard version 9.0, covering application model hierarchy, event-driven interaction, data binding, and design states. Includes detailed references for standard action definitions, plugin options (such as Lua, trace, and model3d), and managing internal and external application interactions.

Tokens
169.2K
Snippets
720
Records
1.4K
Agent score
55%

What's inside Crank Storyboard

  1. Overview of Storyboard Designer Workbench

    Storyboard Designer is a design and development environment used to create full-screen applications for embedded platforms using the Storyboard Embedded Engine. It is based on the Eclipse framework and integrates with the CDT (C/C++ Development Tools), allowing UI design to happen in parallel with embedded software development. It allows designers to import graphic content (gif, jpeg, png, psd) and bind action behaviors to them based on input events.
  2. Overview of Storyboard CCallbacks

    CCallbacks allow developers to use the Storyboard Engine Public API within C/C++ code to add dynamic application behavior and low-level hardware access (e.g., GPIO, sensors).

    Key Use Cases:

    • MCU Targets: Reduces RAM footprint by removing the overhead of garbage collection and heap usage associated with Lua/JavaScript.
    • MPU Targets (Windows, Linux, QNX): Allows extending applications via external dynamic libraries (.so or .DLL).

    Constraints and Considerations:

    • API Capability: The Public API has slightly less capability than the Lua/JavaScript APIs (e.g., it lacks some dynamic object creation like runtime timers and clone functions).
    • Interoperability: CCallbacks can be mixed with Lua or JavaScript functions, provided the corresponding plugins are enabled in the sbengine_plugins.h initialization table.
    • Simulator Fallback: The desktop simulator automatically falls back to a Lua script function of the same name if a CCallback is not available, facilitating UI testing without target hardware.
  3. Overview of Storyboard Validator

    Storyboard Validator is a testing solution for user interfaces developed in Storyboard. It streamlines the testing process by combining event capture/playback and screen capture capabilities into a single tool, removing the need for developers to manually code a testing framework.

    Key workflows include:

    • Test Recording: Testers create sequences of actions and 'test points'.
    • Test Points: These generate 'test artifacts' via data capture or image capture (screen, rectangle, or fully qualified name/fqn).
    • Reference Artifacts: During recording, generated artifacts are saved as references representing the expected 'correct' result.
    • Playback and Validation: Tests are played back, and new artifacts are compared against the reference artifacts to detect regressions or changes.
    • Updating Expectations: Reference artifacts can be updated via the test result viewer to align with current application changes.
  4. Overview of GStreamer and gstreamer-backend in Storyboard

    GStreamer is an open-source library for audio and video playback, streaming, and mixing used by Storyboard. While base GStreamer can be used via gst-launch, the gstreamer-backend media service is recommended for Storyboard applications because it provides essential Media Control features such as Pause, Resume, and Seek.
  5. Overview of Design States in Storyboard

    Design States are visual representations of a screen in a different state caused by data changes or animations. They allow developers to communicate how a screen changes during application execution and work with content that is not visible by default.

    Constraints:

    • Model elements cannot be added or removed within a Design State; these operations are global. Removing a control removes it from the entire application.
    • Design States are limited to changes that can be made at runtime: modifying internal model object attributes (x, y, width, height, hidden) and changing Storyboard variables.
  6. Overview of Storyboard IO Communication

    Storyboard IO (formerly GREIO) is a platform-independent API for inter-task and inter-process queued message passing, primarily used for external communication with a Storyboard application.

    Key constraints and behaviors:

    • Message Size: The design limit for a message is 2K, with a practical implementation limit of approximately 4K.
    • Channels: Communication occurs over named uni-directional channels.
    • Default Receive Channel: By default, Storyboard applications use a receive channel named after the deployment bundle file (e.g., [bundlename].gapp).
    • Customization: A custom receive channel can be specified via the sbengine command options.
  7. Understand Lua string indexing and usage in Storyboard

    In Storyboard's Lua environment, the string type represents arrays of characters using one-byte character encodings.

    Key indexing rules:

    • Strings are 1-indexed: The first character is at position 1.
    • Negative indices are supported: They index backwards from the end of the string (e.g., the last character is at position -1).

    The string library functions can be called in two ways: as global library functions (e.g., string.byte(s, i)) or in an object-oriented style using the string instance (e.g., s:byte(i)), because the string type has a metatable where __index points to the string table.

    local s = "Hello"
    -- Object-oriented style
    local b = s:byte(1)
    
    -- Library style
    local b2 = string.byte(s, 1)
  8. Use Advanced Lua Callbacks for modular architecture

    Advanced Lua callbacks allow the invocation of functions nested within tables or object methods, provided the top-level variable is global.

    • Table functions: Use the dot notation (e.g., parent.child.grandchild.func). The first parameter must be mapargs.
    • Object methods: Use the colon notation (e.g., parent.child.grandchild:func). The first parameter is self (the object instance) and the second parameter is mapargs.

    In the Storyboard editor, selecting the ADVANCED entry opens the Advanced Lua Callback Function Wizard to select a specific Lua Object instance and method.

  9. Handle control focus changes in Storyboard

    Storyboard generates specific events when control focus changes. These events are only generated if there is a focusable control on the current screen. When focus shifts from one control to another, the gre.lostfocus event is dispatched first, followed by the gre.gotfocus event. Both events are targeted at the respective control that lost or received focus.