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.
What's inside Crank Storyboard
- 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.
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.hinitialization 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.
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.
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 viagst-launch, thegstreamer-backendmedia service is recommended for Storyboard applications because it provides essential Media Control features such as Pause, Resume, and Seek.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.
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
sbenginecommand options.
Use the Canvas render extension for custom drawing
The Canvas render extension provides a drawing surface that integrates with the Storyboard Lua Canvas API. To interact with the canvas in Lua, use thegre.get_canvasfunction, passing the canvas name defined in the extension's configuration.Understand Lua string indexing and usage in Storyboard
In Storyboard's Lua environment, the
stringtype 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
stringlibrary 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__indexpoints to the string table.local s = "Hello" -- Object-oriented style local b = s:byte(1) -- Library style local b2 = string.byte(s, 1)Enable Storyboard performance logging
Performance logging captures fine-grained execution information about engine operations. To enable this functionality, go to the Storyboard Simulator Configurations and enable the logger (.plog file).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 bemapargs. - Object methods: Use the colon notation (e.g.,
parent.child.grandchild:func). The first parameter isself(the object instance) and the second parameter ismapargs.
In the Storyboard editor, selecting the ADVANCED entry opens the Advanced Lua Callback Function Wizard to select a specific Lua Object instance and method.
- Table functions: Use the dot notation (e.g.,
Render 3D models using the 3D Model extension
The 3D model render extension allows rendering of 3D models into a control. It requires themodel3dplugin to be loaded and is only compatible with OpenGL or OpenGL ES 2.0 based render managers. Currently, only Wavefront Object (.obj) format models are supported.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, thegre.lostfocusevent is dispatched first, followed by thegre.gotfocusevent. Both events are targeted at the respective control that lost or received focus.