Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
diana-ghindaoanu committed Nov 21, 2019
2 parents a293b50 + 8357836 commit bf15431
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 45 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
@@ -1,14 +1,18 @@
## Wyliodrin STUDIO 2.1.1-beta
* **added** Adafruit LCD visual programming blocks
* **added** folder template for opcua model
* **Added** Raspberry Pi 1 and Zero emulator (QEMU)
* **Added** Raspberry Pi Simulator (NodeJS only)
* **added** Raspberry Pi 1 and Zero emulator (QEMU)
* **added** Raspberry Pi Simulator (NodeJS only)
* **fixed** device buttons not showing up for websocket (requires studio-supervisor update)
* **fixed** multiple instance popup appearing multiple times
* **fixed** gutter background color in electron
* **fixed** image error from RPK simulator
* **fixed** display of extra brace at device os version
* **fixed** monaco editor workers build in the plugin folder
* **fixed** project tree display
* **fixed** MIMEMultipart import for social email block
* **fixed** use only lowercase session id (issue #3)
* **fixed** websocket server link for electron (use https://beta.wyliodrin.server/socket/remote)
* **update** electron to version 7
* **update** serialport to version 8
* **update** new color for opcua model folder
Expand Down
10 changes: 1 addition & 9 deletions LICENSE
@@ -1,11 +1,3 @@
This license is for private, non profit and educational use.

Please consider contacting us at office@wyliodrin.com if you plan to use it in a
commercial software. This license allows you to write/distribute/sell an application
written in Wyliodrin STUDIO.
It does not allow you to sell Wyliodrin STUDIO or any derived products.


Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -194,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2019 Wyliodrin SRL

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
5 changes: 1 addition & 4 deletions README.md
Expand Up @@ -118,7 +118,4 @@ Wyliodrin is a trademark of Wyliodrin SRL. All rights reserved.

## License

Apache 2.0 for private, non profit and educational use.

Please consider contacting us at office@wyliodrin.com if you plan to use it in a commercial software.
This license allows you to write/distribute/sell an applications written in Wyliodrin STUDIO. If does not allow you to sell Wyliodrin STUDIO or any derived products.
Apache 2.0
39 changes: 12 additions & 27 deletions source/plugins/device.simulator.raspberrypi/index.js
Expand Up @@ -8,7 +8,6 @@ let simulator = {
let workspace = null;

import _ from 'lodash';
import { EventEmitter } from 'events';
import RaspberrypiSimulator from './views/RaspberrypiSimulator.vue';
import JSInterpreter from './JSInterpreter/interpreter.js';
import JSInterpreterLibrary from './JSInterpreter/interpreter_library.js';
Expand All @@ -22,9 +21,7 @@ let device_simulator_raspberrypi = {
* @param {Object} device The 'device' object in the platform
*/
connect(device) {
console.log('check already connected');
if (simulator.connected === false) {
console.log('check object');
if (_.isObject(device)) {
process.nextTick(() => {
device.status = 'CONNECTED';
Expand All @@ -42,9 +39,7 @@ let device_simulator_raspberrypi = {
* @param {Object} device The 'device' object in the platform
*/
disconnect(device) {
console.log('check already disconnected');
if (simulator.connected === true) {
console.log('check object');
if (_.isObject(device)) {
device.status = 'DISCONNECTED';
workspace.updateDevice(device);
Expand All @@ -53,16 +48,6 @@ let device_simulator_raspberrypi = {
return true;
}
}
},

/**
* Register a device in order to be updated
* @param {Object} device The 'device' object in the platform
* @param {Function} fn The function to be executed for the update
*/
registerForUpdate(device, fn) {
deviceEvents.on('update:' + device.id, fn);
return() => deviceEvents.removeListener('update:' + device.id, fn);
}
};

Expand All @@ -78,17 +63,17 @@ export default function setup(options, imports, register) {

// Register a new device: 'RaspberryPi simulator'
workspace.updateDevices([{
id: 'raspberrypi_simulator',
name: 'RaspberryPi',
priority: workspace.DEVICE_PRIORITY_SIMULATOR,
address: 'raspberrypi_simulator',
board: 'raspberrypi_simulator',
properties: {
isRunning: false
},
placeholder: true,
icon: 'plugins/device.simulator.raspberrypi/data/img/icons/icon-raspberrypi.png'
}
id: 'raspberrypi_simulator',
name: 'RaspberryPi',
priority: workspace.DEVICE_PRIORITY_SIMULATOR,
address: 'raspberrypi_simulator',
board: 'raspberrypi_simulator',
properties: {
isRunning: false
},
placeholder: true,
icon: 'plugins/device.simulator.raspberrypi/data/img/icons/icon-raspberrypi.png'
}
]);

// The code that should be executed in case of run button pressing
Expand All @@ -113,7 +98,7 @@ export default function setup(options, imports, register) {
// Create the object constructors for each library and
// append them to the users code
let librariesToLoad =
`var libraries = {};\n\n` +
'var libraries = {};\n\n' +
onoff +
lcd +
`function require (name) {
Expand Down
1 change: 1 addition & 0 deletions source/plugins/device.simulator.raspberrypi/projects.json
@@ -0,0 +1 @@
["test3Leds.svg", "test5Leds.svg", "testLcd.svg", "testLcdAnd2ButtonsAnd2Leds.svg", "testLcdAndButton.svg", "testLed.svg", "testLedAndButton.svg"]
Expand Up @@ -93,7 +93,7 @@ export default {
// Load the tutorials list of projects
this.svgGenericPath = generic_raspberrypi.svgGenericPath;
let svgList = await this.studio.filesystem.readdir('./source' + this.svgGenericPath.substr(1));
let svgList = require ('../projects.json');
let projectsList = [];
for (let i = 0; i < svgList.length; i ++) {
Expand Down
1 change: 1 addition & 0 deletions source/plugins/device.wyapp.websocket/index.js
Expand Up @@ -119,6 +119,7 @@ export function setup (options, imports, register)

workspace.registerMenuItem('DEVICE_WYAPP_WEBSOCKET_SET_USER_ID', 90, async () => {
let settoken = await workspace.showPrompt ('DEVICE_WYAPP_WEBSOCKET_SET_USER_ID_TITLE', 'DEVICE_WYAPP_WEBSOCKET_SET_USER_ID_TEXT', token);
if (settoken && validator.isUUID (settoken)) settoken = settoken.toLowerCase ();
if (settoken && token !== settoken)
{
if (validator.isUUID (settoken))
Expand Down
4 changes: 3 additions & 1 deletion source/plugins/device.wyapp.websocket/views/DeviceSetup.vue
Expand Up @@ -28,7 +28,9 @@ export default {
computed: {
json ()
{
return JSON.stringify ({token: this.token, id: this.value.trim (), server: window.location.href+'socket/remote'}, null, 2);
let server = window.location.href;
if (server.startsWith('file://')) server = 'https://beta.wyliodrin.studio/';
return JSON.stringify ({token: this.token, id: this.value.trim (), server: server+'socket/remote'}, null, 2);
},
nameValid ()
{
Expand Down
Expand Up @@ -12,7 +12,7 @@ module.exports = function (blockly) {

Blockly.Python.mail = function () {
if (!Blockly.Python.definitions_['import_mail']) {
Blockly.Python.definitions_['import_mail'] = 'from email.MIMEMultipart import MIMEMultipart\nfrom email.mime.image import MIMEImage\nfrom email.mime.base import MIMEBase\nfrom email.mime.audio import MIMEAudio\nfrom email import encoders\nfrom email.MIMEText import MIMEText\nimport smtplib\nimport mimetypes\n';
Blockly.Python.definitions_['import_mail'] = 'email.mime.multipart import MIMEMultipart\nfrom email.mime.image import MIMEImage\nfrom email.mime.base import MIMEBase\nfrom email.mime.audio import MIMEAudio\nfrom email import encoders\nfrom email.MIMEText import MIMEText\nimport smtplib\nimport mimetypes\n';
}
}

Expand Down
48 changes: 48 additions & 0 deletions source/plugins/statistics/index.js
Expand Up @@ -205,6 +205,54 @@ export function setup(options, imports, register) {
});
});

imports.hooks.addPreHook('emulator', 'stopEmulator', (emulator) => {
Countly.add_event({
'key': 'StopEmulator',
'segmentation': {
'version': imports.workspace.version,
'type': emulator.type,
'username': token,
'locale': app_language
}
});
});

imports.hooks.addPreHook('emulator', 'runEmulator', (imageRunning) => {
Countly.add_event({
'key': 'RunEmulator',
'segmentation': {
'version': imports.workspace.version,
'type': imageRunning.type,
'username': token,
'locale': app_language
}
});
});

imports.hooks.addPreHook('emulator', 'startEmulator', (emulator) => {
Countly.add_event({
'key': 'StartEmulator',
'segmentation': {
'version': imports.workspace.version,
'type': emulator.type,
'username': token,
'locale': app_language
}
});
});

imports.hooks.addPreHook('emulator', 'downloadImage', (image) => {
Countly.add_event({
'key': 'DownloadImage',
'segmentation': {
'version': imports.workspace.version,
'type': image.type,
'username': token,
'locale': app_language
}
});
});

imports.hooks.addPreHook('projects', 'selectCurrentProject', (projectInfo) => {
// if (args[1]) {
// let projectInfo = args[0];
Expand Down

0 comments on commit bf15431

Please sign in to comment.