On the smart mug, there are many Apps running concurrently. This package supports process management, app context switch, device (Display and Touchpanel) management, Job management, notification, and default setting (similar as screen saver).
- Led Screen: Only the main process of the front end app can access led screen and display image, only JPG and BMP files are supported now.
- Touch Panel: Deliver the touch event only to the front end app.
- App Switch: Create a process for each App, different Apps execute on different process not thread, determine which app is the front end app, save and restore context for App switch.
- Notification: 1) Some Apps can register notification, when a new message comes, a notification will be displayed if the App is not the front end app at that time; 2) Signals from linux OS, voice recogonition engine, motion sensor engine and other can trigger notification in order to launch an App immediately.
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/app_manager_mug_client/node_modules/node-canvas-lib:$HOME/app_manager_mug_client/main/highLevelAPI/linux-convert
- node $HOME/app_manager_mug_client/main/main.js
var io = require('../../main/highLevelAPI/io.js');
io.disp_N(['a.png', 'b.png'], 2, 100);
var sys = require('../../main/highLevelAPI/sys.js');
sys.newApp('a.js');
io.touchPanel.on('touchEvent', function(e, x, y, id) {
console.log(e);
});
io.touchPanel.on('gesture', function(gesture) {
console.log(gesture);
});
io.text2Img(text, color, function(image) {
var animation = [];
for (var i=0; i<image.numberOfImg; i++) {
animation.concat(image['img'+i]);
}
io.disp_raw_N(animation, image.numberOfImg, 100);
});
sys.registerNotification(icon, app)
For more details, please reference main/highLevelAPI/io.js and main/highLevelAPI/sys.js.
- main: app and resource manager, the mini OS
- app: all Apps running on the smart mug
- config.json: mug configuration
- img2json.js: a tool to convert images to media.json
- Chao Zhang ([email protected])