// Runtime emits are passed along as VM emits.
this.runtime.on(Runtime.SCRIPT_GLOW_ON, glowData => {
this.emit(Runtime.SCRIPT_GLOW_ON, glowData);
});
this.runtime.on(Runtime.SCRIPT_GLOW_OFF, glowData => {
this.emit(Runtime.SCRIPT_GLOW_OFF, glowData);
});
this.runtime.on(Runtime.BLOCK_GLOW_ON, glowData => {
this.emit(Runtime.BLOCK_GLOW_ON, glowData);
});
this.runtime.on(Runtime.BLOCK_GLOW_OFF, glowData => {
this.emit(Runtime.BLOCK_GLOW_OFF, glowData);
});
this.runtime.on(Runtime.PROJECT_START, () => {
this.emit(Runtime.PROJECT_START);
});
this.runtime.on(Runtime.PROJECT_RUN_START, () => {
this.emit(Runtime.PROJECT_RUN_START);
});
this.runtime.on(Runtime.PROJECT_RUN_STOP, () => {
this.emit(Runtime.PROJECT_RUN_STOP);
});
this.runtime.on(Runtime.PROJECT_CHANGED, () => {
this.emit(Runtime.PROJECT_CHANGED);
});
this.runtime.on(Runtime.VISUAL_REPORT, visualReport => {
this.emit(Runtime.VISUAL_REPORT, visualReport);
});
this.runtime.on(Runtime.TARGETS_UPDATE, emitProjectChanged => {
this.emitTargetsUpdate(emitProjectChanged);
});
this.runtime.on(Runtime.MONITORS_UPDATE, monitorList => {
this.emit(Runtime.MONITORS_UPDATE, monitorList);
});
this.runtime.on(Runtime.BLOCK_DRAG_UPDATE, areBlocksOverGui => {
this.emit(Runtime.BLOCK_DRAG_UPDATE, areBlocksOverGui);
});
this.runtime.on(Runtime.BLOCK_DRAG_END, (blocks, topBlockId) => {
this.emit(Runtime.BLOCK_DRAG_END, blocks, topBlockId);
});
this.runtime.on(Runtime.EXTENSION_ADDED, categoryInfo => {
this.emit(Runtime.EXTENSION_ADDED, categoryInfo);
});
this.runtime.on(Runtime.EXTENSION_FIELD_ADDED, (fieldName, fieldImplementation) => {
this.emit(Runtime.EXTENSION_FIELD_ADDED, fieldName, fieldImplementation);
});
this.runtime.on(Runtime.BLOCKSINFO_UPDATE, categoryInfo => {
this.emit(Runtime.BLOCKSINFO_UPDATE, categoryInfo);
});
this.runtime.on(Runtime.BLOCKS_NEED_UPDATE, () => {
this.emitWorkspaceUpdate();
});
this.runtime.on(Runtime.TOOLBOX_EXTENSIONS_NEED_UPDATE, () => {
this.extensionManager.refreshBlocks();
});
this.runtime.on(Runtime.PERIPHERAL_LIST_UPDATE, info => {
this.emit(Runtime.PERIPHERAL_LIST_UPDATE, info);
});
this.runtime.on(Runtime.PERIPHERAL_CONNECTED, () =>
this.emit(Runtime.PERIPHERAL_CONNECTED)
);
this.runtime.on(Runtime.PERIPHERAL_REQUEST_ERROR, () =>
this.emit(Runtime.PERIPHERAL_REQUEST_ERROR)
);
this.runtime.on(Runtime.PERIPHERAL_DISCONNECTED, () =>
this.emit(Runtime.PERIPHERAL_DISCONNECTED)
);
this.runtime.on(Runtime.PERIPHERAL_CONNECTION_LOST_ERROR, data =>
this.emit(Runtime.PERIPHERAL_CONNECTION_LOST_ERROR, data)
);
this.runtime.on(Runtime.PERIPHERAL_SCAN_TIMEOUT, () =>
this.emit(Runtime.PERIPHERAL_SCAN_TIMEOUT)
);
this.runtime.on(Runtime.MIC_LISTENING, listening => {
this.emit(Runtime.MIC_LISTENING, listening);
});
this.runtime.on(Runtime.RUNTIME_STARTED, () => {
this.emit(Runtime.RUNTIME_STARTED);
});
this.runtime.on(Runtime.HAS_CLOUD_DATA_UPDATE, hasCloudData => {
this.emit(Runtime.HAS_CLOUD_DATA_UPDATE, hasCloudData);
});
网友评论