Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1e95d57139 |
@@ -1,9 +1,2 @@
|
|||||||
REACT_APP_COMPILER_URL=https://compiler.sensebox.de
|
REACT_APP_COMPILER_URL=https://compiler.sensebox.de
|
||||||
REACT_APP_BOARD=sensebox-mcu
|
REACT_APP_BOARD=sensebox-mcu
|
||||||
REACT_APP_BLOCKLY_API=https://api.blockly.sensebox.de
|
|
||||||
|
|
||||||
REACT_APP_MYBADGES=https://mybadges.org
|
|
||||||
REACT_APP_MYBADGES_API=https://mybadges.org/api/v1
|
|
||||||
|
|
||||||
# in days
|
|
||||||
REACT_APP_SHARE_LINK_EXPIRES=30
|
|
||||||
|
|||||||
@@ -1,93 +0,0 @@
|
|||||||
# Blockly 2020
|
|
||||||
|
|
||||||
(aktuelles Preview unter: https://deploy-preview-37--blockly-react.netlify.app/)
|
|
||||||
|
|
||||||
In den letzten Wochen haben wir eine komplett neue Lern- und Programmierumgebung für die senseBox geschaffen. Die Basis bildet hierbei weiterhin Google Blockly und das Frontend wird über React realisiert. Fast alle Blöcke wurden bereits aus der alten Version in die neue Version migriert.
|
|
||||||
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Blockly Core
|
|
||||||
Nachdem die bisherige Version, die unter [blockly.sensebox.de](https://blockly.sensebox.de) verfügbar ist, auf einen Google Blockly Core von 2016 aufbaut, wurde es Zeit ein großes Update durchzuführen. Durch den neuen Blockly Core lassen sich auch andere Renderer der Blöcke verwenden. In den Einstellungen kannst du zwischen den zwei Renderern Geras und Zelos auswählen. Geras ist der klassische Blockly Renderer während Zelos vor allem für Touchoberfläche optimiert worden ist.
|
|
||||||
|
|
||||||
### Typed Variablen
|
|
||||||
|
|
||||||
Neue Variablen werden nun direkt mit einem bestimmten Datentyp angelegt. Ein einfacher Check überprüft ob der zurückgegeben Typ eines Blockes mit dem der Variablen kompatibel ist.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### Funktionen (funktioniert aktuell nicht!)
|
|
||||||
|
|
||||||
Funktionen mit Rückgabe Wert und Eingabeparametern können angelegt werden. Durch die Verwendung von Funktionen lassen sich auch komplexere Programme übersichtlicher darstellen und bearbeiten. Beim Anlegen einer Funktion kann über das Zahnrad weitere Eingabeparameter hinzuefügt werden.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### GPS
|
|
||||||
|
|
||||||
Der Code für das GPS Modul wurde neu aufgebaut und ermöglicht es deutlich schneller einen GPS Fix zu bekommen. Zusätzlich lassen sich bald! die Koordinaten in zwei verschiedenen Formaten zurückgebenlassen. Zum einen als Kommazahl zum anderen als Zahl ohne nachkommastellen
|
|
||||||
|
|
||||||
### MQTT
|
|
||||||
Zwei einfache Blöcke ermöglichen es nun die Daten über MQTT an einen Broker zu versenden. Zwei Broker sind bereits "vorprogrammiert" (Adafruit IO und DIOTY). Natürlich können auch eigene Broker verwendet werden. Falls ihr gute freie Broker kennt, die wir hinzufügen sollten meldet euch einfach bei uns.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### TTN Mapper
|
|
||||||
Bisher war es möglich einen "kleinen" TTN Mapper zu bauen, der die Daten als Cayenne Payload versendet hat. Es gibt nun einen Block der es direkt ermöglicht einen vollständigen TTN Mapper zu Programmieren, der die Daten auch auf [TTNMapper](https://ttnmapper.org/) veröffentlichen kann.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## Fronted
|
|
||||||
|
|
||||||
In der Oberfläche gibt es einige Neuigkeiten. Ziel ist es Blockly für die senseBox zu einer vollständigen Lern- und Programmierumgebung weiterzuentwickeln.
|
|
||||||
|
|
||||||
Die Codeanzeige ist standardmäßig ausgeblendet kann aber einfach durch eine Klick auf das `</>` Icon hinzugefügt werden.
|
|
||||||
|
|
||||||
### Login mit openSenseMap/senseBox Account
|
|
||||||
|
|
||||||
Im Menü unter Login könnt ihr euch mit eurem openSenseMap Account anmelden. Sobald ihr angemeldet seid habt ihr die Möglichkeit Projekte online zu speichern.
|
|
||||||
Sobald der Login mit dem openSenseMap Account erfolgreich war lassen sich die bereits registrierten senseBox unter Account einsehen.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
Im Block zum senden an die openSenseMap müssen dann auch keine IDs mehr ausgewählt werden sondern die registrierten senseBox können einfach aus dem Dropdown Menü ausgewählt werden.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Speichern von Projekten
|
|
||||||
|
|
||||||
Nach dem Login über den openSenseMap Account lassen sich Projekte online speichern und wieder abrufen
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### Tutorials
|
|
||||||
|
|
||||||
Es gibt jetzt Tutorials! Eine reihe von verschiedenen Tutorials zeigt dir die ersten Schritte in der Programmierung mit Blockly. (Inhalte werden noch ausgebaut)
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
### Gallery
|
|
||||||
|
|
||||||
In der Gallery finden sich Beispiele mit verschiedenen Programmen. Die Beispiele können direkt in Blockly geöffnet werden, um Änderungen vorzunehmen oder das Programm direkt auf deine senseBox zu übertragen.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### Teilen von Programmen
|
|
||||||
|
|
||||||
Über den Share Button kann ein Link zum Teilen der aktuellen Blöcke erstellt werden. Wann immer du dein Projekt mit anderen Teilen willst musst du nicht mehr eine XML Datei erstellen und verschicken sondern kannst einen Link erstellen, der direkt zu deinem Programm führt. Beachte, dass vor dem Teilen von Blöcken sämtliche sensiblen Daten, wie zum Beispiel Passwörter, Netzwerknamen, Lora oder openSenseMap Keys entfernt werden sollten. Die Links zum teilen von Programmen laufen nach 30 Tagen ab.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
## Fehler
|
|
||||||
|
|
||||||
Falls ihr Fehler findet legt bitte ein Issue in folgendem Repository an: https://github.com/sensebox/React-Ardublockly/issues
|
|
||||||
|
|
||||||
@@ -2,18 +2,18 @@
|
|||||||
|
|
||||||
# React Ardublockly
|
# React Ardublockly
|
||||||
|
|
||||||
This repository contains the source code and documentation of [sensebox-ardublockly](https://sensebox-ardublockly.netlify.app/).
|
This repository contains the source code and documentation of [sensebox-ardublockly](https://sensebox-ardublockly.netlify.app/) :rocket:.
|
||||||
|
|
||||||
This project was created with [Create React App](https://github.com/facebook/create-react-app) and represents the continuation or improvement of [blockly.sensebox.de](https://blockly.sensebox.de/ardublockly/?lang=de&board=sensebox-mcu).
|
This project was created with [Create React App](https://github.com/facebook/create-react-app) and represents the continuation or improvement of [blockly.sensebox.de](https://blockly.sensebox.de/ardublockly/?lang=de&board=sensebox-mcu).
|
||||||
|
|
||||||
|
|
||||||
## Getting Started
|
## Getting Started
|
||||||
|
|
||||||
1. [Download](https://github.com/sensebox/React-Ardublockly/archive/master.zip) or clone the GitHub Repository ``git clone https://github.com/sensebox/React-Ardublockly`` and checkout to branch ``master``.
|
1. [Download](https://github.com/sensebox/React-Ardublockly/archive/bachelor.zip) or clone the GitHub Repository ``git clone https://github.com/sensebox/React-Ardublockly`` and checkout to branch ``bachelor``.
|
||||||
|
|
||||||
2. install [Node.js v10.xx](https://nodejs.org/en/) on your local machine
|
2. install [Node.js v10.xx](https://nodejs.org/en/) on your local machine
|
||||||
|
|
||||||
3. open shell and navigate inside folder ``React-Ardublockly``
|
3. open shell and navigate inside folder ``React-Ardublockly`` or rather ``Quellcode``
|
||||||
* run ``npm install``
|
* run ``npm install``
|
||||||
* run ``npm start``
|
* run ``npm start``
|
||||||
4. open [localhost:3000](http://localhost:3000)
|
4. open [localhost:3000](http://localhost:3000)
|
||||||
@@ -22,7 +22,7 @@ This project was created with [Create React App](https://github.com/facebook/cre
|
|||||||
Ensure that line 14 in [store.js](https://github.com/sensebox/React-Ardublockly/blob/master/src/store.js#L14) is commented out or otherwise you have installed [Redux DevTools Extension](http://extension.remotedev.io/).
|
Ensure that line 14 in [store.js](https://github.com/sensebox/React-Ardublockly/blob/master/src/store.js#L14) is commented out or otherwise you have installed [Redux DevTools Extension](http://extension.remotedev.io/).
|
||||||
|
|
||||||
## Demo
|
## Demo
|
||||||
A demo of the current status of the master branch can be accessed via [sensebox-ardublockly.netlify.app](https://sensebox-ardublockly.netlify.app/) :rocket:.
|
A demo of the current status of the bachelor branch can be accessed via [sensebox-ardublockly.netlify.app](https://sensebox-ardublockly.netlify.app/) :rocket:.
|
||||||
* [Home](https://sensebox-ardublockly.netlify.app/)
|
* [Home](https://sensebox-ardublockly.netlify.app/)
|
||||||
* [Tutorial Overview](https://sensebox-ardublockly.netlify.app/tutorial)
|
* [Tutorial Overview](https://sensebox-ardublockly.netlify.app/tutorial)
|
||||||
* [Tutorial-Builder](https://sensebox-ardublockly.netlify.app/tutorial/builder)
|
* [Tutorial-Builder](https://sensebox-ardublockly.netlify.app/tutorial/builder)
|
||||||
|
|||||||
@@ -5,38 +5,28 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@blockly/block-plus-minus": "^2.0.10",
|
"@blockly/block-plus-minus": "^2.0.10",
|
||||||
"@blockly/field-slider": "^2.1.1",
|
"@blockly/field-slider": "^2.1.1",
|
||||||
"@blockly/plugin-typed-variable-modal": "^3.1.15",
|
"@blockly/plugin-typed-variable-modal": "^3.1.1",
|
||||||
"@fortawesome/fontawesome-svg-core": "^1.2.30",
|
"@fortawesome/fontawesome-svg-core": "^1.2.30",
|
||||||
"@fortawesome/free-solid-svg-icons": "^5.14.0",
|
"@fortawesome/free-solid-svg-icons": "^5.14.0",
|
||||||
"@fortawesome/react-fontawesome": "^0.1.11",
|
"@fortawesome/react-fontawesome": "^0.1.11",
|
||||||
"@material-ui/core": "^4.11.0",
|
"@material-ui/core": "^4.11.0",
|
||||||
"@sentry/react": "^6.0.0",
|
|
||||||
"@sentry/tracing": "^6.0.0",
|
|
||||||
"@testing-library/jest-dom": "^4.2.4",
|
"@testing-library/jest-dom": "^4.2.4",
|
||||||
"@testing-library/react": "^9.5.0",
|
"@testing-library/react": "^9.5.0",
|
||||||
"@testing-library/user-event": "^7.2.1",
|
"@testing-library/user-event": "^7.2.1",
|
||||||
"axios": "^0.21.0",
|
"blockly": "^3.20200924.0",
|
||||||
"blockly": "^5.20210325.1",
|
|
||||||
"file-saver": "^2.0.2",
|
"file-saver": "^2.0.2",
|
||||||
"mnemonic-id": "^3.2.7",
|
|
||||||
"moment": "^2.28.0",
|
"moment": "^2.28.0",
|
||||||
"prismjs": "^1.23.0",
|
"prismjs": "^1.20.0",
|
||||||
"react": "^16.13.1",
|
"react": "^16.13.1",
|
||||||
"react-cookie-consent": "^5.2.0",
|
|
||||||
"react-dom": "^16.13.1",
|
"react-dom": "^16.13.1",
|
||||||
"react-markdown": "^5.0.2",
|
|
||||||
"react-redux": "^7.2.0",
|
"react-redux": "^7.2.0",
|
||||||
"react-router-dom": "^5.2.0",
|
"react-router-dom": "^5.2.0",
|
||||||
"react-scripts": "^4.0.3",
|
"react-scripts": "3.4.1",
|
||||||
"reactour": "^1.18.0",
|
|
||||||
"redux": "^4.0.5",
|
"redux": "^4.0.5",
|
||||||
"redux-thunk": "^2.3.0",
|
"redux-thunk": "^2.3.0"
|
||||||
"styled-components": "^4.4.1",
|
|
||||||
"uuid": "^8.3.1"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-scripts start",
|
||||||
"dev": "set \"REACT_APP_BLOCKLY_API=http://localhost:8080\" && set \"REACT_APP_MYBADGES_API=http://localhost:3001/api/v1\"&& npm start",
|
|
||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 199 KiB |
|
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 381 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 239 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 319 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 274 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 85 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 96 KiB |
|
Before Width: | Height: | Size: 84 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 286 KiB |
|
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 218 KiB |
|
Before Width: | Height: | Size: 163 KiB After Width: | Height: | Size: 641 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 253 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 47 KiB |
@@ -5,47 +5,3 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
padding-bottom: 60px; /* height of your footer + 30px*/
|
padding-bottom: 60px; /* height of your footer + 30px*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.tutorial img{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
max-height: 40vH;
|
|
||||||
max-width: 100%;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.news img{
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
max-height: 40vH;
|
|
||||||
max-width: 100%;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tutorial blockquote{
|
|
||||||
background: #f9f9f9;
|
|
||||||
border-left: 10px solid#4EAF47;
|
|
||||||
margin: 1.5em 10px;
|
|
||||||
padding: 0.5em 10px;
|
|
||||||
quotes: "\201C""\201D""\2018""\2019";
|
|
||||||
}
|
|
||||||
blockquote:before {
|
|
||||||
color:#4EAF47;
|
|
||||||
content: open-quote;
|
|
||||||
font-size: 4em;
|
|
||||||
line-height: 0.1em;
|
|
||||||
margin-right: 0.25em;
|
|
||||||
vertical-align: -0.4em;
|
|
||||||
}
|
|
||||||
blockquote p {
|
|
||||||
display: inline;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overlay {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
import React, { Component } from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import { BrowserRouter as Router } from 'react-router-dom';
|
import { BrowserRouter as Router } from 'react-router-dom';
|
||||||
import { createBrowserHistory } from "history";
|
import { createBrowserHistory } from "history";
|
||||||
|
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import { loadUser } from './actions/authActions';
|
|
||||||
|
|
||||||
import './App.css';
|
import './App.css';
|
||||||
|
|
||||||
import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
import { ThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
import Content from './components/Content';
|
import Navbar from './components/Navbar';
|
||||||
|
import Footer from './components/Footer';
|
||||||
|
import Routes from './components/Routes';
|
||||||
|
|
||||||
const theme = createMuiTheme({
|
const theme = createMuiTheme({
|
||||||
palette: {
|
palette: {
|
||||||
@@ -21,31 +22,27 @@ const theme = createMuiTheme({
|
|||||||
},
|
},
|
||||||
secondary: {
|
secondary: {
|
||||||
main: '#DDDDDD'
|
main: '#DDDDDD'
|
||||||
},
|
|
||||||
button: {
|
|
||||||
compile: '#e27136'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
class App extends Component {
|
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
store.dispatch(loadUser());
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
|
||||||
const customHistory = createBrowserHistory();
|
const customHistory = createBrowserHistory();
|
||||||
|
|
||||||
|
|
||||||
|
function App() {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<Provider store={store}>
|
<Provider store={store}>
|
||||||
<Router history={customHistory}>
|
<Router history={customHistory}>
|
||||||
<Content />
|
<div className="wrapper">
|
||||||
|
<Navbar />
|
||||||
|
<Routes />
|
||||||
|
<Footer />
|
||||||
|
</div>
|
||||||
</Router>
|
</Router>
|
||||||
</Provider>
|
</Provider>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
export default App;
|
export default App;
|
||||||
|
|||||||
@@ -1,294 +0,0 @@
|
|||||||
import { MYBADGES_CONNECT, MYBADGES_DISCONNECT, GET_STATUS, USER_LOADED, USER_LOADING, AUTH_ERROR, LOGIN_SUCCESS, LOGIN_FAIL, LOGOUT_SUCCESS, LOGOUT_FAIL, REFRESH_TOKEN_SUCCESS } from '../actions/types';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
|
||||||
import { returnErrors, returnSuccess } from './messageActions';
|
|
||||||
import { setLanguage } from './generalActions';
|
|
||||||
|
|
||||||
// Check token & load user
|
|
||||||
export const loadUser = () => (dispatch) => {
|
|
||||||
// user loading
|
|
||||||
dispatch({
|
|
||||||
type: USER_LOADING
|
|
||||||
});
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
dispatch({
|
|
||||||
type: GET_STATUS,
|
|
||||||
payload: res.data.user.status
|
|
||||||
});
|
|
||||||
dispatch(setLanguage(res.data.user.language));
|
|
||||||
dispatch({
|
|
||||||
type: USER_LOADED,
|
|
||||||
payload: res.data.user
|
|
||||||
});
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
if(err.response){
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status));
|
|
||||||
}
|
|
||||||
var status = [];
|
|
||||||
if (window.localStorage.getItem('status')) {
|
|
||||||
status = JSON.parse(window.localStorage.getItem('status'));
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: GET_STATUS,
|
|
||||||
payload: status
|
|
||||||
});
|
|
||||||
dispatch({
|
|
||||||
type: AUTH_ERROR
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.get(`${process.env.REACT_APP_BLOCKLY_API}/user`, config, dispatch(authInterceptor()))
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
err.config.error(err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
var logoutTimerId;
|
|
||||||
const timeToLogout = 14.9*60*1000; // nearly 15 minutes corresponding to the API
|
|
||||||
|
|
||||||
// Login user
|
|
||||||
export const login = ({ email, password }) => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: USER_LOADING
|
|
||||||
});
|
|
||||||
// Headers
|
|
||||||
const config = {
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/json'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Request Body
|
|
||||||
const body = JSON.stringify({ email, password });
|
|
||||||
axios.post(`${process.env.REACT_APP_BLOCKLY_API}/user`, body, config)
|
|
||||||
.then(res => {
|
|
||||||
// Logout automatically if refreshToken "expired"
|
|
||||||
const logoutTimer = () => setTimeout(
|
|
||||||
() => dispatch(logout()),
|
|
||||||
timeToLogout
|
|
||||||
);
|
|
||||||
logoutTimerId = logoutTimer();
|
|
||||||
dispatch(setLanguage(res.data.user.language));
|
|
||||||
dispatch({
|
|
||||||
type: LOGIN_SUCCESS,
|
|
||||||
payload: res.data
|
|
||||||
});
|
|
||||||
dispatch({
|
|
||||||
type: GET_STATUS,
|
|
||||||
payload: res.data.user.status
|
|
||||||
});
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'LOGIN_SUCCESS'));
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'LOGIN_FAIL'));
|
|
||||||
dispatch({
|
|
||||||
type: LOGIN_FAIL
|
|
||||||
});
|
|
||||||
var status = [];
|
|
||||||
if (window.localStorage.getItem('status')) {
|
|
||||||
status = JSON.parse(window.localStorage.getItem('status'));
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: GET_STATUS,
|
|
||||||
payload: status
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Connect to MyBadges-Account
|
|
||||||
export const connectMyBadges = ({ username, password }) => (dispatch, getState) => {
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var user = getState().auth.user;
|
|
||||||
user.badge = res.data.account;
|
|
||||||
user.badges = res.data.badges;
|
|
||||||
dispatch({
|
|
||||||
type: MYBADGES_CONNECT,
|
|
||||||
payload: user
|
|
||||||
});
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'MYBADGES_CONNECT_SUCCESS'));
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'MYBADGES_CONNECT_FAIL'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
// Request Body
|
|
||||||
const body = JSON.stringify({ username, password });
|
|
||||||
axios.post(`${process.env.REACT_APP_BLOCKLY_API}/user/badge`, body, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if(err.response && err.response.status !== 401){
|
|
||||||
err.config.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// Disconnect MyBadges-Account
|
|
||||||
export const disconnectMyBadges = () => (dispatch, getState) => {
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var user = getState().auth.user;
|
|
||||||
user.badge = null;
|
|
||||||
user.badges = null;
|
|
||||||
dispatch({
|
|
||||||
type: MYBADGES_DISCONNECT,
|
|
||||||
payload: user
|
|
||||||
});
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'MYBADGES_DISCONNECT_SUCCESS'));
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'MYBADGES_DISCONNECT_FAIL'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.put(`${process.env.REACT_APP_BLOCKLY_API}/user/badge`, {}, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if(err.response && err.response.status !== 401){
|
|
||||||
err.config.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Logout User
|
|
||||||
export const logout = () => (dispatch) => {
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
dispatch({
|
|
||||||
type: LOGOUT_SUCCESS
|
|
||||||
});
|
|
||||||
var status = [];
|
|
||||||
if (window.localStorage.getItem('status')) {
|
|
||||||
status = JSON.parse(window.localStorage.getItem('status'));
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: GET_STATUS,
|
|
||||||
payload: status
|
|
||||||
});
|
|
||||||
var locale = 'en_US';
|
|
||||||
if (window.localStorage.getItem('locale')) {
|
|
||||||
locale = window.localStorage.getItem('locale');
|
|
||||||
}
|
|
||||||
else if (navigator.language === 'de-DE'){
|
|
||||||
locale = 'de_DE';
|
|
||||||
}
|
|
||||||
dispatch(setLanguage(locale));
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'LOGOUT_SUCCESS'));
|
|
||||||
clearTimeout(logoutTimerId);
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'LOGOUT_FAIL'));
|
|
||||||
dispatch({
|
|
||||||
type: LOGOUT_FAIL
|
|
||||||
});
|
|
||||||
var status = [];
|
|
||||||
if (window.localStorage.getItem('status')) {
|
|
||||||
status = JSON.parse(window.localStorage.getItem('status'));
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: GET_STATUS,
|
|
||||||
payload: status
|
|
||||||
});
|
|
||||||
clearTimeout(logoutTimerId);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.post('https://api.opensensemap.org/users/sign-out', {}, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if(err.response && err.response.status !== 401){
|
|
||||||
err.config.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export const authInterceptor = () => (dispatch, getState) => {
|
|
||||||
// Add a request interceptor
|
|
||||||
axios.interceptors.request.use(
|
|
||||||
config => {
|
|
||||||
config.headers['Content-Type'] = 'application/json';
|
|
||||||
const token = getState().auth.token;
|
|
||||||
if (token) {
|
|
||||||
config.headers['Authorization'] = `Bearer ${token}`;
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Add a response interceptor
|
|
||||||
axios.interceptors.response.use(
|
|
||||||
response => {
|
|
||||||
// request was successfull
|
|
||||||
return response;
|
|
||||||
},
|
|
||||||
error => {
|
|
||||||
const originalRequest = error.config;
|
|
||||||
const refreshToken = getState().auth.refreshToken;
|
|
||||||
if(refreshToken){
|
|
||||||
// try to refresh the token failed
|
|
||||||
if (error.response.status === 401 && originalRequest._retry) {
|
|
||||||
// router.push('/login');
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
// token was not valid and 1st try to refresh the token
|
|
||||||
if (error.response.status === 401 && !originalRequest._retry) {
|
|
||||||
originalRequest._retry = true;
|
|
||||||
const refreshToken = getState().auth.refreshToken;
|
|
||||||
// request to refresh the token, in request-body is the refreshToken
|
|
||||||
axios.post('https://api.opensensemap.org/users/refresh-auth', {"token": refreshToken})
|
|
||||||
.then(res => {
|
|
||||||
if (res.status === 200) {
|
|
||||||
clearTimeout(logoutTimerId);
|
|
||||||
const logoutTimer = () => setTimeout(
|
|
||||||
() => dispatch(logout()),
|
|
||||||
timeToLogout
|
|
||||||
);
|
|
||||||
logoutTimerId = logoutTimer();
|
|
||||||
dispatch({
|
|
||||||
type: REFRESH_TOKEN_SUCCESS,
|
|
||||||
payload: res.data
|
|
||||||
});
|
|
||||||
axios.defaults.headers.common['Authorization'] = 'Bearer ' + getState().auth.token;
|
|
||||||
// request was successfull, new request with the old parameters and the refreshed token
|
|
||||||
return axios(originalRequest)
|
|
||||||
.then(res => {
|
|
||||||
originalRequest.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
originalRequest.error(err);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return Promise.reject(error);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
// request failed, token could not be refreshed
|
|
||||||
if(err.response){
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status));
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: AUTH_ERROR
|
|
||||||
});
|
|
||||||
return Promise.reject(error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// request status was unequal to 401, no possibility to refresh the token
|
|
||||||
return Promise.reject(error);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { VISIT, LANGUAGE, RENDERER, STATISTICS } from './types';
|
import { VISIT } from './types';
|
||||||
|
|
||||||
|
|
||||||
export const visitPage = () => (dispatch) => {
|
export const visitPage = () => (dispatch) => {
|
||||||
@@ -6,27 +6,3 @@ export const visitPage = () => (dispatch) => {
|
|||||||
type: VISIT
|
type: VISIT
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setLanguage = (language) => (dispatch, getState) => {
|
|
||||||
if(!getState().auth.progress && !getState().auth.isAuthenticated){
|
|
||||||
window.localStorage.setItem('locale', language);
|
|
||||||
}
|
|
||||||
dispatch({
|
|
||||||
type: LANGUAGE,
|
|
||||||
payload: language
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const setRenderer = (renderer) => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: RENDERER,
|
|
||||||
payload: renderer
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const setStatistics = (showStatistics) => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: STATISTICS,
|
|
||||||
payload: showStatistics
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
import { GET_ERRORS, CLEAR_MESSAGES, GET_SUCCESS } from './types';
|
|
||||||
|
|
||||||
// RETURN Errors
|
|
||||||
export const returnErrors = (msg, status, id = null) => {
|
|
||||||
return {
|
|
||||||
type: GET_ERRORS,
|
|
||||||
payload: {
|
|
||||||
msg: msg,
|
|
||||||
status: status,
|
|
||||||
id: id
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// RETURN Success
|
|
||||||
export const returnSuccess = (msg, status, id = null) => {
|
|
||||||
return {
|
|
||||||
type: GET_SUCCESS,
|
|
||||||
payload: {
|
|
||||||
msg: msg,
|
|
||||||
status: status,
|
|
||||||
id: id
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
// CLEAR_MESSAGES
|
|
||||||
export const clearMessages = () => {
|
|
||||||
return {
|
|
||||||
type: CLEAR_MESSAGES
|
|
||||||
};
|
|
||||||
};
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
import { PROJECT_PROGRESS, GET_PROJECT, GET_PROJECTS, PROJECT_TYPE, PROJECT_DESCRIPTION } from './types';
|
|
||||||
|
|
||||||
import axios from 'axios';
|
|
||||||
import { returnErrors, returnSuccess } from './messageActions';
|
|
||||||
|
|
||||||
export const setType = (type) => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: PROJECT_TYPE,
|
|
||||||
payload: type
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const setDescription = (description) => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: PROJECT_DESCRIPTION,
|
|
||||||
payload: description
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getProject = (type, id) => (dispatch) => {
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
dispatch(setType(type));
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var data = type === 'share' ? 'content' : type;
|
|
||||||
var project = res.data[data];
|
|
||||||
if (project) {
|
|
||||||
dispatch({
|
|
||||||
type: GET_PROJECT,
|
|
||||||
payload: project
|
|
||||||
});
|
|
||||||
dispatch({
|
|
||||||
type: PROJECT_DESCRIPTION,
|
|
||||||
payload: project.description
|
|
||||||
});
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'GET_PROJECT_SUCCESS'));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
dispatch(returnErrors(res.data.message, res.status, 'PROJECT_EMPTY'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
if (err.response) {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'GET_PROJECT_FAIL'));
|
|
||||||
}
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.get(`${process.env.REACT_APP_BLOCKLY_API}/${type}/${id}`, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
err.config.error(err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getProjects = (type) => (dispatch) => {
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var data = type === 'project' ? 'projects' : 'galleries';
|
|
||||||
var projects = res.data[data];
|
|
||||||
dispatch({
|
|
||||||
type: GET_PROJECTS,
|
|
||||||
payload: projects
|
|
||||||
});
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status));
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
if (err.response) {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'GET_PROJECTS_FAIL'));
|
|
||||||
}
|
|
||||||
dispatch({ type: PROJECT_PROGRESS });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.get(`${process.env.REACT_APP_BLOCKLY_API}/${type}`, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
err.config.error(err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateProject = (type, id) => (dispatch, getState) => {
|
|
||||||
var workspace = getState().workspace;
|
|
||||||
var body = {
|
|
||||||
xml: workspace.code.xml,
|
|
||||||
title: workspace.name
|
|
||||||
};
|
|
||||||
var project = getState().project;
|
|
||||||
if (type === 'gallery') {
|
|
||||||
body.description = project.description;
|
|
||||||
}
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var project = res.data[type];
|
|
||||||
var projects = getState().project.projects;
|
|
||||||
var index = projects.findIndex(res => res._id === project._id);
|
|
||||||
projects[index] = project;
|
|
||||||
dispatch({
|
|
||||||
type: GET_PROJECTS,
|
|
||||||
payload: projects
|
|
||||||
});
|
|
||||||
if (type === 'project') {
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'PROJECT_UPDATE_SUCCESS'));
|
|
||||||
} else {
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'GALLERY_UPDATE_SUCCESS'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
if (err.response) {
|
|
||||||
if (type === 'project') {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'PROJECT_UPDATE_FAIL'));
|
|
||||||
} else {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'GALLERY_UPDATE_FAIL'));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.put(`${process.env.REACT_APP_BLOCKLY_API}/${type}/${id}`, body, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
err.config.error(err);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deleteProject = (type, id) => (dispatch, getState) => {
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var projects = getState().project.projects;
|
|
||||||
var index = projects.findIndex(res => res._id === id);
|
|
||||||
projects.splice(index, 1)
|
|
||||||
dispatch({
|
|
||||||
type: GET_PROJECTS,
|
|
||||||
payload: projects
|
|
||||||
});
|
|
||||||
if (type === 'project') {
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'PROJECT_DELETE_SUCCESS'));
|
|
||||||
} else {
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'GALLERY_DELETE_SUCCESS'));
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'PROJECT_DELETE_FAIL'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.delete(`${process.env.REACT_APP_BLOCKLY_API}/${type}/${id}`, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if (err.response && err.response.status !== 401) {
|
|
||||||
err.config.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export const shareProject = (title, type, id) => (dispatch, getState) => {
|
|
||||||
var body = {
|
|
||||||
title: title
|
|
||||||
};
|
|
||||||
if (type === 'project') {
|
|
||||||
body.projectId = id;
|
|
||||||
} else {
|
|
||||||
body.xml = getState().workspace.code.xml;
|
|
||||||
}
|
|
||||||
axios.post(`${process.env.REACT_APP_BLOCKLY_API}/share`, body)
|
|
||||||
.then(res => {
|
|
||||||
var shareContent = res.data.content;
|
|
||||||
if (body.projectId) {
|
|
||||||
var projects = getState().project.projects;
|
|
||||||
var index = projects.findIndex(res => res._id === id);
|
|
||||||
projects[index].shared = shareContent.expiresAt;
|
|
||||||
dispatch({
|
|
||||||
type: GET_PROJECTS,
|
|
||||||
payload: projects
|
|
||||||
});
|
|
||||||
}
|
|
||||||
dispatch(returnSuccess(res.data.message, shareContent._id, 'SHARE_SUCCESS'));
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if (err.response) {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'SHARE_FAIL'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export const resetProject = () => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: GET_PROJECTS,
|
|
||||||
payload: []
|
|
||||||
});
|
|
||||||
dispatch(setType(''));
|
|
||||||
dispatch(setDescription(''));
|
|
||||||
};
|
|
||||||
@@ -1,152 +1,6 @@
|
|||||||
import { MYBADGES_DISCONNECT, TUTORIAL_PROGRESS, GET_TUTORIAL, GET_TUTORIALS, TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_STEP } from './types';
|
import { TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_ID, TUTORIAL_STEP } from './types';
|
||||||
|
|
||||||
import axios from 'axios';
|
import tutorials from '../data/tutorials';
|
||||||
import { returnErrors, returnSuccess } from './messageActions';
|
|
||||||
|
|
||||||
export const tutorialProgress = () => (dispatch) => {
|
|
||||||
dispatch({type: TUTORIAL_PROGRESS});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export const getTutorial = (id) => (dispatch, getState) => {
|
|
||||||
axios.get(`${process.env.REACT_APP_BLOCKLY_API}/tutorial/${id}`)
|
|
||||||
.then(res => {
|
|
||||||
var tutorial = res.data.tutorial;
|
|
||||||
existingTutorial(tutorial, getState().tutorial.status).then(status => {
|
|
||||||
dispatch({
|
|
||||||
type: TUTORIAL_SUCCESS,
|
|
||||||
payload: status
|
|
||||||
});
|
|
||||||
dispatch(updateStatus(status));
|
|
||||||
dispatch({
|
|
||||||
type: GET_TUTORIAL,
|
|
||||||
payload: tutorial
|
|
||||||
});
|
|
||||||
dispatch({type: TUTORIAL_PROGRESS});
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status));
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if (err.response) {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'GET_TUTORIAL_FAIL'));
|
|
||||||
}
|
|
||||||
dispatch({ type: TUTORIAL_PROGRESS });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const getTutorials = () => (dispatch, getState) => {
|
|
||||||
axios.get(`${process.env.REACT_APP_BLOCKLY_API}/tutorial`)
|
|
||||||
.then(res => {
|
|
||||||
var tutorials = res.data.tutorials;
|
|
||||||
console.log(tutorials);
|
|
||||||
existingTutorials(tutorials, getState().tutorial.status).then(status => {
|
|
||||||
dispatch({
|
|
||||||
type: TUTORIAL_SUCCESS,
|
|
||||||
payload: status
|
|
||||||
});
|
|
||||||
console.log('zwei');
|
|
||||||
dispatch(updateStatus(status));
|
|
||||||
dispatch({
|
|
||||||
type: GET_TUTORIALS,
|
|
||||||
payload: tutorials
|
|
||||||
});
|
|
||||||
dispatch({ type: TUTORIAL_PROGRESS });
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status));
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if (err.response) {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'GET_TUTORIALS_FAIL'));
|
|
||||||
}
|
|
||||||
dispatch({ type: TUTORIAL_PROGRESS });
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const assigneBadge = (id) => (dispatch, getState) => {
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var badge = res.data.badge;
|
|
||||||
var user = getState().auth.user;
|
|
||||||
user.badges.push(badge._id);
|
|
||||||
dispatch({
|
|
||||||
type: MYBADGES_DISCONNECT,
|
|
||||||
payload: user
|
|
||||||
});
|
|
||||||
dispatch(returnSuccess(badge, res.status, 'ASSIGNE_BADGE_SUCCESS'));
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'ASSIGNE_BADGE_FAIL'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.put(`${process.env.REACT_APP_BLOCKLY_API}/user/badge/${id}`, {}, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if(err.response && err.response.status !== 401){
|
|
||||||
err.config.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const updateStatus = (status) => (dispatch, getState) => {
|
|
||||||
if(getState().auth.isAuthenticated){
|
|
||||||
// update user account in database - sync with redux store
|
|
||||||
axios.put(`${process.env.REACT_APP_BLOCKLY_API}/user/status`, {status: status})
|
|
||||||
.then(res => {
|
|
||||||
// dispatch(returnSuccess(badge, res.status, 'UPDATE_STATUS_SUCCESS'));
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if(err.response){
|
|
||||||
// dispatch(returnErrors(err.response.data.message, err.response.status, 'UPDATE_STATUS_FAIL'));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
// update locale storage - sync with redux store
|
|
||||||
window.localStorage.setItem('status', JSON.stringify(status));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const deleteTutorial = (id) => (dispatch, getState) => {
|
|
||||||
var tutorial = getState().tutorial;
|
|
||||||
var id = getState().builder.id;
|
|
||||||
const config = {
|
|
||||||
success: res => {
|
|
||||||
var tutorials = tutorial.tutorials;
|
|
||||||
var index = tutorials.findIndex(res => res._id === id);
|
|
||||||
tutorials.splice(index, 1)
|
|
||||||
dispatch({
|
|
||||||
type: GET_TUTORIALS,
|
|
||||||
payload: tutorials
|
|
||||||
});
|
|
||||||
dispatch(returnSuccess(res.data.message, res.status, 'TUTORIAL_DELETE_SUCCESS'));
|
|
||||||
},
|
|
||||||
error: err => {
|
|
||||||
dispatch(returnErrors(err.response.data.message, err.response.status, 'TUTORIAL_DELETE_FAIL'));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
axios.delete(`${process.env.REACT_APP_BLOCKLY_API}/tutorial/${id}`, config)
|
|
||||||
.then(res => {
|
|
||||||
res.config.success(res);
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
if(err.response && err.response.status !== 401){
|
|
||||||
err.config.error(err);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
export const resetTutorial = () => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: GET_TUTORIALS,
|
|
||||||
payload: []
|
|
||||||
});
|
|
||||||
dispatch({
|
|
||||||
type: TUTORIAL_STEP,
|
|
||||||
payload: 0
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const tutorialChange = () => (dispatch) => {
|
export const tutorialChange = () => (dispatch) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
@@ -156,9 +10,9 @@ export const tutorialChange = () => (dispatch) => {
|
|||||||
|
|
||||||
export const tutorialCheck = (status, step) => (dispatch, getState) => {
|
export const tutorialCheck = (status, step) => (dispatch, getState) => {
|
||||||
var tutorialsStatus = getState().tutorial.status;
|
var tutorialsStatus = getState().tutorial.status;
|
||||||
var id = getState().tutorial.tutorials[0]._id;
|
var id = getState().tutorial.currentId;
|
||||||
var tutorialsStatusIndex = tutorialsStatus.findIndex(tutorialStatus => tutorialStatus._id === id);
|
var tutorialsStatusIndex = tutorialsStatus.findIndex(tutorialStatus => tutorialStatus.id === id);
|
||||||
var tasksIndex = tutorialsStatus[tutorialsStatusIndex].tasks.findIndex(task => task._id === step._id);
|
var tasksIndex = tutorialsStatus[tutorialsStatusIndex].tasks.findIndex(task => task.id === step.id);
|
||||||
tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex] = {
|
tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex] = {
|
||||||
...tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex],
|
...tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex],
|
||||||
type: status
|
type: status
|
||||||
@@ -167,22 +21,18 @@ export const tutorialCheck = (status, step) => (dispatch, getState) => {
|
|||||||
type: status === 'success' ? TUTORIAL_SUCCESS : TUTORIAL_ERROR,
|
type: status === 'success' ? TUTORIAL_SUCCESS : TUTORIAL_ERROR,
|
||||||
payload: tutorialsStatus
|
payload: tutorialsStatus
|
||||||
});
|
});
|
||||||
console.log('drei');
|
|
||||||
dispatch(updateStatus(tutorialsStatus));
|
|
||||||
dispatch(tutorialChange());
|
dispatch(tutorialChange());
|
||||||
dispatch(returnSuccess('', '', 'TUTORIAL_CHECK_SUCCESS'));
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const storeTutorialXml = (code) => (dispatch, getState) => {
|
export const storeTutorialXml = (code) => (dispatch, getState) => {
|
||||||
var tutorial = getState().tutorial.tutorials[0];
|
var id = getState().tutorial.currentId;
|
||||||
if (tutorial) {
|
if (id !== null) {
|
||||||
var id = tutorial._id;
|
|
||||||
var activeStep = getState().tutorial.activeStep;
|
var activeStep = getState().tutorial.activeStep;
|
||||||
var steps = tutorial.steps;
|
var steps = tutorials.filter(tutorial => tutorial.id === id)[0].steps;
|
||||||
if (steps && steps[activeStep].type === 'task') {
|
if (steps[activeStep].type === 'task') {
|
||||||
var tutorialsStatus = getState().tutorial.status;
|
var tutorialsStatus = getState().tutorial.status;
|
||||||
var tutorialsStatusIndex = tutorialsStatus.findIndex(tutorialStatus => tutorialStatus._id === id);
|
var tutorialsStatusIndex = tutorialsStatus.findIndex(tutorialStatus => tutorialStatus.id === id);
|
||||||
var tasksIndex = tutorialsStatus[tutorialsStatusIndex].tasks.findIndex(task => task._id === steps[activeStep]._id);
|
var tasksIndex = tutorialsStatus[tutorialsStatusIndex].tasks.findIndex(task => task.id === steps[activeStep].id);
|
||||||
tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex] = {
|
tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex] = {
|
||||||
...tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex],
|
...tutorialsStatus[tutorialsStatusIndex].tasks[tasksIndex],
|
||||||
xml: code
|
xml: code
|
||||||
@@ -191,58 +41,21 @@ export const storeTutorialXml = (code) => (dispatch, getState) => {
|
|||||||
type: TUTORIAL_XML,
|
type: TUTORIAL_XML,
|
||||||
payload: tutorialsStatus
|
payload: tutorialsStatus
|
||||||
});
|
});
|
||||||
dispatch(updateStatus(tutorialsStatus));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const tutorialId = (id) => (dispatch) => {
|
||||||
|
dispatch({
|
||||||
|
type: TUTORIAL_ID,
|
||||||
|
payload: id
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
export const tutorialStep = (step) => (dispatch) => {
|
export const tutorialStep = (step) => (dispatch) => {
|
||||||
dispatch({
|
dispatch({
|
||||||
type: TUTORIAL_STEP,
|
type: TUTORIAL_STEP,
|
||||||
payload: step
|
payload: step
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const existingTutorials = (tutorials, status) => new Promise(function (resolve, reject) {
|
|
||||||
var newstatus;
|
|
||||||
new Promise(function (resolve, reject) {
|
|
||||||
var existingTutorialIds = tutorials.map((tutorial, i) => {
|
|
||||||
existingTutorial(tutorial, status).then(status => {
|
|
||||||
newstatus = status;
|
|
||||||
});
|
|
||||||
return tutorial._id;
|
|
||||||
});
|
|
||||||
resolve(existingTutorialIds)
|
|
||||||
}).then(existingTutorialIds => {
|
|
||||||
// deleting old tutorials which do not longer exist
|
|
||||||
if (existingTutorialIds.length > 0) {
|
|
||||||
status = newstatus.filter(status => existingTutorialIds.indexOf(status._id) > -1);
|
|
||||||
}
|
|
||||||
resolve(status);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const existingTutorial = (tutorial, status) => new Promise(function(resolve, reject){
|
|
||||||
var tutorialsId = tutorial._id;
|
|
||||||
var statusIndex = status.findIndex(status => status._id === tutorialsId);
|
|
||||||
if (statusIndex > -1) {
|
|
||||||
var tasks = tutorial.steps.filter(step => step.type === 'task');
|
|
||||||
var existingTaskIds = tasks.map((task, j) => {
|
|
||||||
var tasksId = task._id;
|
|
||||||
if (status[statusIndex].tasks.findIndex(task => task._id === tasksId) === -1) {
|
|
||||||
// task does not exist
|
|
||||||
status[statusIndex].tasks.push({ _id: tasksId });
|
|
||||||
}
|
|
||||||
return tasksId;
|
|
||||||
});
|
|
||||||
// deleting old tasks which do not longer exist
|
|
||||||
if (existingTaskIds.length > 0) {
|
|
||||||
status[statusIndex].tasks = status[statusIndex].tasks.filter(task => existingTaskIds.indexOf(task._id) > -1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
status.push({ _id: tutorialsId, tasks: tutorial.steps.filter(step => step.type === 'task').map(task => { return { _id: task._id }; }) });
|
|
||||||
}
|
|
||||||
resolve(status);
|
|
||||||
});
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { PROGRESS, JSON_STRING, BUILDER_CHANGE, BUILDER_ERROR, BUILDER_TITLE, BUILDER_ID, BUILDER_BADGE, BUILDER_ADD_STEP, BUILDER_DELETE_STEP, BUILDER_CHANGE_STEP, BUILDER_CHANGE_ORDER, BUILDER_DELETE_PROPERTY } from './types';
|
import { PROGRESS, JSON_STRING, BUILDER_CHANGE, BUILDER_ERROR, BUILDER_TITLE, BUILDER_ID, BUILDER_ADD_STEP, BUILDER_DELETE_STEP, BUILDER_CHANGE_STEP, BUILDER_CHANGE_ORDER, BUILDER_DELETE_PROPERTY } from './types';
|
||||||
|
|
||||||
import data from '../data/hardware.json';
|
import data from '../data/hardware.json';
|
||||||
|
|
||||||
@@ -39,14 +39,6 @@ export const tutorialId = (id) => (dispatch) => {
|
|||||||
dispatch(changeTutorialBuilder());
|
dispatch(changeTutorialBuilder());
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tutorialBadge = (badge) => (dispatch) => {
|
|
||||||
dispatch({
|
|
||||||
type: BUILDER_BADGE,
|
|
||||||
payload: badge
|
|
||||||
});
|
|
||||||
dispatch(changeTutorialBuilder());
|
|
||||||
};
|
|
||||||
|
|
||||||
export const addStep = (index) => (dispatch, getState) => {
|
export const addStep = (index) => (dispatch, getState) => {
|
||||||
var steps = getState().builder.steps;
|
var steps = getState().builder.steps;
|
||||||
var step = {
|
var step = {
|
||||||
@@ -188,19 +180,16 @@ export const setSubmitError = () => (dispatch, getState) => {
|
|||||||
// if(builder.id === undefined || builder.id === ''){
|
// if(builder.id === undefined || builder.id === ''){
|
||||||
// dispatch(setError(undefined, 'id'));
|
// dispatch(setError(undefined, 'id'));
|
||||||
// }
|
// }
|
||||||
if (builder.title === '') {
|
if (builder.id === undefined || builder.title === '') {
|
||||||
dispatch(setError(undefined, 'title'));
|
dispatch(setError(undefined, 'title'));
|
||||||
}
|
}
|
||||||
if (builder.title === null) {
|
|
||||||
dispatch(setError(undefined, 'badge'));
|
|
||||||
}
|
|
||||||
var type = builder.steps.map((step, i) => {
|
var type = builder.steps.map((step, i) => {
|
||||||
// media and xml are directly checked for errors in their components and
|
// media and xml are directly checked for errors in their components and
|
||||||
// therefore do not have to be checked again
|
// therefore do not have to be checked again
|
||||||
step.id = i + 1;
|
step.id = i + 1;
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
if (step.requirements && step.requirements.length > 0) {
|
if (step.requirements && step.requirements.length > 0) {
|
||||||
var requirements = step.requirements.filter(requirement => /^[0-9a-fA-F]{24}$/.test(requirement));
|
var requirements = step.requirements.filter(requirement => typeof (requirement) === 'number');
|
||||||
if (requirements.length < step.requirements.length) {
|
if (requirements.length < step.requirements.length) {
|
||||||
dispatch(changeContent(requirements, i, 'requirements'));
|
dispatch(changeContent(requirements, i, 'requirements'));
|
||||||
}
|
}
|
||||||
@@ -233,7 +222,7 @@ export const setSubmitError = () => (dispatch, getState) => {
|
|||||||
export const checkError = () => (dispatch, getState) => {
|
export const checkError = () => (dispatch, getState) => {
|
||||||
dispatch(setSubmitError());
|
dispatch(setSubmitError());
|
||||||
var error = getState().builder.error;
|
var error = getState().builder.error;
|
||||||
if (error.id || error.title || error.badge ||error.type) {
|
if (error.id || error.title || error.type) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
for (var i = 0; i < error.steps.length; i++) {
|
for (var i = 0; i < error.steps.length; i++) {
|
||||||
@@ -254,9 +243,10 @@ export const progress = (inProgress) => (dispatch) => {
|
|||||||
export const resetTutorial = () => (dispatch, getState) => {
|
export const resetTutorial = () => (dispatch, getState) => {
|
||||||
dispatch(jsonString(''));
|
dispatch(jsonString(''));
|
||||||
dispatch(tutorialTitle(''));
|
dispatch(tutorialTitle(''));
|
||||||
dispatch(tutorialBadge(undefined));
|
dispatch(tutorialId(''));
|
||||||
var steps = [
|
var steps = [
|
||||||
{
|
{
|
||||||
|
id: 1,
|
||||||
type: 'instruction',
|
type: 'instruction',
|
||||||
headline: '',
|
headline: '',
|
||||||
text: '',
|
text: '',
|
||||||
@@ -284,7 +274,7 @@ export const readJSON = (json) => (dispatch, getState) => {
|
|||||||
// accept only valid attributes
|
// accept only valid attributes
|
||||||
var steps = json.steps.map((step, i) => {
|
var steps = json.steps.map((step, i) => {
|
||||||
var object = {
|
var object = {
|
||||||
_id: step._id,
|
id: step.id,
|
||||||
type: step.type,
|
type: step.type,
|
||||||
headline: step.headline,
|
headline: step.headline,
|
||||||
text: step.text
|
text: step.text
|
||||||
@@ -308,7 +298,7 @@ export const readJSON = (json) => (dispatch, getState) => {
|
|||||||
return object;
|
return object;
|
||||||
});
|
});
|
||||||
dispatch(tutorialTitle(json.title));
|
dispatch(tutorialTitle(json.title));
|
||||||
dispatch(tutorialBadge(json.badge));
|
dispatch(tutorialId(json.id));
|
||||||
dispatch(tutorialSteps(steps));
|
dispatch(tutorialSteps(steps));
|
||||||
dispatch(setSubmitError());
|
dispatch(setSubmitError());
|
||||||
dispatch(progress(false));
|
dispatch(progress(false));
|
||||||
|
|||||||
@@ -1,16 +1,3 @@
|
|||||||
// authentication
|
|
||||||
export const USER_LOADING = 'USER_LOADING';
|
|
||||||
export const USER_LOADED = 'USER_LOADED';
|
|
||||||
export const AUTH_ERROR = 'AUTH_ERROR';
|
|
||||||
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
|
|
||||||
export const LOGIN_FAIL = 'LOGIN_FAIL';
|
|
||||||
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS';
|
|
||||||
export const LOGOUT_FAIL = 'LOGOUT_FAIL';
|
|
||||||
export const REFRESH_TOKEN_FAIL = 'REFRESH_TOKEN_FAIL';
|
|
||||||
export const REFRESH_TOKEN_SUCCESS = 'REFRESH_TOKEN_SUCCESS';
|
|
||||||
export const MYBADGES_CONNECT = 'MYBADGES_CONNECT';
|
|
||||||
export const MYBADGES_DISCONNECT = 'MYBADGES_DISCONNECT';
|
|
||||||
|
|
||||||
export const NEW_CODE = 'NEW_CODE';
|
export const NEW_CODE = 'NEW_CODE';
|
||||||
export const CHANGE_WORKSPACE = 'CHANGE_WORKSPACE';
|
export const CHANGE_WORKSPACE = 'CHANGE_WORKSPACE';
|
||||||
export const CREATE_BLOCK = 'CREATE_BLOCK';
|
export const CREATE_BLOCK = 'CREATE_BLOCK';
|
||||||
@@ -20,10 +7,7 @@ export const DELETE_BLOCK = 'DELETE_BLOCK';
|
|||||||
export const CLEAR_STATS = 'CLEAR_STATS';
|
export const CLEAR_STATS = 'CLEAR_STATS';
|
||||||
export const NAME = 'NAME';
|
export const NAME = 'NAME';
|
||||||
|
|
||||||
export const TUTORIAL_PROGRESS = 'TUTORIAL_PROGRESS';
|
|
||||||
export const GET_TUTORIAL = 'GET_TUTORIAL';
|
|
||||||
export const GET_TUTORIALS = 'GET_TUTORIALS';
|
|
||||||
export const GET_STATUS = 'GET_STATUS';
|
|
||||||
export const TUTORIAL_SUCCESS = 'TUTORIAL_SUCCESS';
|
export const TUTORIAL_SUCCESS = 'TUTORIAL_SUCCESS';
|
||||||
export const TUTORIAL_ERROR = 'TUTORIAL_ERROR';
|
export const TUTORIAL_ERROR = 'TUTORIAL_ERROR';
|
||||||
export const TUTORIAL_CHANGE = 'TUTORIAL_CHANGE';
|
export const TUTORIAL_CHANGE = 'TUTORIAL_CHANGE';
|
||||||
@@ -35,7 +19,6 @@ export const JSON_STRING = 'JSON_STRING';
|
|||||||
|
|
||||||
export const BUILDER_CHANGE = 'BUILDER_CHANGE';
|
export const BUILDER_CHANGE = 'BUILDER_CHANGE';
|
||||||
export const BUILDER_TITLE = 'BUILDER_TITLE';
|
export const BUILDER_TITLE = 'BUILDER_TITLE';
|
||||||
export const BUILDER_BADGE = 'BUILDER_BADGE';
|
|
||||||
export const BUILDER_ID = 'BUILDER_ID';
|
export const BUILDER_ID = 'BUILDER_ID';
|
||||||
export const BUILDER_ADD_STEP = 'BUILDER_ADD_STEP';
|
export const BUILDER_ADD_STEP = 'BUILDER_ADD_STEP';
|
||||||
export const BUILDER_DELETE_STEP = 'BUILDER_DELETE_STEP';
|
export const BUILDER_DELETE_STEP = 'BUILDER_DELETE_STEP';
|
||||||
@@ -47,19 +30,3 @@ export const PROGRESS = 'PROGRESS';
|
|||||||
|
|
||||||
|
|
||||||
export const VISIT = 'VISIT';
|
export const VISIT = 'VISIT';
|
||||||
export const LANGUAGE = 'LANGUAGE';
|
|
||||||
export const RENDERER = 'RENDERER';
|
|
||||||
export const STATISTICS = 'STATISTICS';
|
|
||||||
|
|
||||||
// messages
|
|
||||||
export const GET_ERRORS = 'GET_ERRORS';
|
|
||||||
export const GET_SUCCESS = 'GET_SUCCESS';
|
|
||||||
export const CLEAR_MESSAGES = 'CLEAR_MESSAGES';
|
|
||||||
|
|
||||||
|
|
||||||
// projects: share, gallery, project
|
|
||||||
export const PROJECT_PROGRESS = 'PROJECT_PROGRESS';
|
|
||||||
export const GET_PROJECT = 'GET_PROJECT';
|
|
||||||
export const GET_PROJECTS = 'GET_PROJECTS';
|
|
||||||
export const PROJECT_TYPE = 'PROJECT_TYPE';
|
|
||||||
export const PROJECT_DESCRIPTION = 'PROJECT_DESCRIPTION';
|
|
||||||
|
|||||||
@@ -16,17 +16,6 @@ export const onChangeCode = () => (dispatch, getState) => {
|
|||||||
code.arduino = Blockly.Arduino.workspaceToCode(workspace);
|
code.arduino = Blockly.Arduino.workspaceToCode(workspace);
|
||||||
var xmlDom = Blockly.Xml.workspaceToDom(workspace);
|
var xmlDom = Blockly.Xml.workspaceToDom(workspace);
|
||||||
code.xml = Blockly.Xml.domToPrettyText(xmlDom);
|
code.xml = Blockly.Xml.domToPrettyText(xmlDom);
|
||||||
var selectedBlock = Blockly.selected
|
|
||||||
console.log(selectedBlock)
|
|
||||||
if (selectedBlock !== null) {
|
|
||||||
code.helpurl = selectedBlock.helpUrl
|
|
||||||
code.tooltip = selectedBlock.tooltip
|
|
||||||
} else if (selectedBlock === null) {
|
|
||||||
code.tooltip = Blockly.Msg.tooltip_hint
|
|
||||||
code.helpurl = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: NEW_CODE,
|
type: NEW_CODE,
|
||||||
payload: code
|
payload: code
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
import React, { Component } from 'react';
|
|
||||||
|
|
||||||
import { withStyles } from '@material-ui/core/styles';
|
|
||||||
import { fade } from '@material-ui/core/styles/colorManipulator';
|
|
||||||
|
|
||||||
import Typography from '@material-ui/core/Typography';
|
|
||||||
|
|
||||||
const styles = (theme) => ({
|
|
||||||
alert: {
|
|
||||||
marginBottom: '20px',
|
|
||||||
border: `1px solid ${theme.palette.primary.main}`,
|
|
||||||
padding: '10px 20px',
|
|
||||||
borderRadius: '4px',
|
|
||||||
background: fade(theme.palette.primary.main, 0.3),
|
|
||||||
color: 'rgb(70,70,70)'
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
export class Alert extends Component {
|
|
||||||
|
|
||||||
render(){
|
|
||||||
return(
|
|
||||||
<div className={this.props.classes.alert}>
|
|
||||||
<Typography>
|
|
||||||
{this.props.children}
|
|
||||||
</Typography>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
export default withStyles(styles, { withTheme: true })(Alert);
|
|
||||||
@@ -24,12 +24,14 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
import Blockly from 'blockly/core';
|
import Blockly from 'blockly/core';
|
||||||
|
import locale from 'blockly/msg/en';
|
||||||
import 'blockly/blocks';
|
import 'blockly/blocks';
|
||||||
import Toolbox from './toolbox/Toolbox';
|
import Toolbox from './toolbox/Toolbox';
|
||||||
|
|
||||||
import { Card } from '@material-ui/core';
|
import { Card } from '@material-ui/core';
|
||||||
|
|
||||||
|
|
||||||
|
Blockly.setLocale(locale);
|
||||||
|
|
||||||
class BlocklyComponent extends React.Component {
|
class BlocklyComponent extends React.Component {
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class BlocklySvg extends Component {
|
|||||||
var css = '<defs><style type="text/css" xmlns="http://www.w3.org/1999/xhtml"><![CDATA[' + cssContent + ']]></style></defs>';
|
var css = '<defs><style type="text/css" xmlns="http://www.w3.org/1999/xhtml"><![CDATA[' + cssContent + ']]></style></defs>';
|
||||||
var bbox = document.getElementsByClassName("blocklyBlockCanvas")[0].getBBox();
|
var bbox = document.getElementsByClassName("blocklyBlockCanvas")[0].getBBox();
|
||||||
var content = new XMLSerializer().serializeToString(canvas);
|
var content = new XMLSerializer().serializeToString(canvas);
|
||||||
|
|
||||||
var xml = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
var xml = `<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
width="${bbox.width}" height="${bbox.height}" viewBox="${bbox.x} ${bbox.y} ${bbox.width} ${bbox.height}">
|
width="${bbox.width}" height="${bbox.height}" viewBox="${bbox.x} ${bbox.y} ${bbox.width} ${bbox.height}">
|
||||||
${css}">${content}</svg>`;
|
${css}">${content}</svg>`;
|
||||||
@@ -64,7 +65,7 @@ class BlocklySvg extends Component {
|
|||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{display: 'inline-flex', justifyContent: 'center', transform: 'scale(0.8) translate(0, calc(100% * -0.2 / 2))'}}
|
style={{display: 'flex', justifyContent: 'center', transform: 'scale(0.8) translate(0, calc(100% * -0.2 / 2))'}}
|
||||||
dangerouslySetInnerHTML={{ __html: this.state.svg }}
|
dangerouslySetInnerHTML={{ __html: this.state.svg }}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,22 +2,23 @@ import React, { Component } from 'react';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { onChangeWorkspace, clearStats } from '../../actions/workspaceActions';
|
import { onChangeWorkspace, clearStats } from '../../actions/workspaceActions';
|
||||||
|
// import * as De from 'blockly/msg/de';
|
||||||
|
import {De} from './msg/de';
|
||||||
import BlocklyComponent from './BlocklyComponent';
|
import BlocklyComponent from './BlocklyComponent';
|
||||||
import BlocklySvg from './BlocklySvg';
|
import BlocklySvg from './BlocklySvg';
|
||||||
|
|
||||||
import * as Blockly from 'blockly/core';
|
import * as Blockly from 'blockly/core';
|
||||||
import './blocks/index';
|
import './blocks/index';
|
||||||
import './generator/index';
|
import './generator/index';
|
||||||
|
|
||||||
import { initialXml } from './initialXml.js';
|
import { initialXml } from './initialXml.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class BlocklyWindow extends Component {
|
class BlocklyWindow extends Component {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.simpleWorkspace = React.createRef();
|
this.simpleWorkspace = React.createRef();
|
||||||
|
Blockly.setLocale(De);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
@@ -45,17 +46,7 @@ class BlocklyWindow extends Component {
|
|||||||
if (!xml) xml = initialXml;
|
if (!xml) xml = initialXml;
|
||||||
Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(xml), workspace);
|
Blockly.Xml.domToWorkspace(Blockly.Xml.textToDom(xml), workspace);
|
||||||
}
|
}
|
||||||
if (props.language !== this.props.language) {
|
|
||||||
// change language
|
|
||||||
if (!xml) xml = initialXml;
|
|
||||||
var xmlDom = Blockly.Xml.textToDom(xml);
|
|
||||||
Blockly.Xml.clearWorkspaceAndLoadFromXml(xmlDom, workspace);
|
|
||||||
// var toolbox = workspace.getToolbox();
|
|
||||||
// console.log(toolbox);
|
|
||||||
// workspace.updateToolbox(toolbox.toolboxDef_);
|
|
||||||
}
|
|
||||||
Blockly.svgResize(workspace);
|
Blockly.svgResize(workspace);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
@@ -65,7 +56,7 @@ class BlocklyWindow extends Component {
|
|||||||
style={this.props.svg ? { height: 0 } : this.props.blocklyCSS}
|
style={this.props.svg ? { height: 0 } : this.props.blocklyCSS}
|
||||||
readOnly={this.props.readOnly !== undefined ? this.props.readOnly : false}
|
readOnly={this.props.readOnly !== undefined ? this.props.readOnly : false}
|
||||||
trashcan={this.props.trashcan !== undefined ? this.props.trashcan : true}
|
trashcan={this.props.trashcan !== undefined ? this.props.trashcan : true}
|
||||||
renderer={this.props.renderer}
|
renderer='geras'
|
||||||
zoom={{ // https://developers.google.com/blockly/guides/configure/web/zoom
|
zoom={{ // https://developers.google.com/blockly/guides/configure/web/zoom
|
||||||
controls: this.props.zoomControls !== undefined ? this.props.zoomControls : true,
|
controls: this.props.zoomControls !== undefined ? this.props.zoomControls : true,
|
||||||
wheel: false,
|
wheel: false,
|
||||||
@@ -99,14 +90,8 @@ class BlocklyWindow extends Component {
|
|||||||
|
|
||||||
BlocklyWindow.propTypes = {
|
BlocklyWindow.propTypes = {
|
||||||
onChangeWorkspace: PropTypes.func.isRequired,
|
onChangeWorkspace: PropTypes.func.isRequired,
|
||||||
clearStats: PropTypes.func.isRequired,
|
clearStats: PropTypes.func.isRequired
|
||||||
renderer: PropTypes.string.isRequired,
|
|
||||||
language: PropTypes.string.isRequired
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const mapStateToProps = state => ({
|
|
||||||
renderer: state.general.renderer,
|
|
||||||
language: state.general.language
|
|
||||||
});
|
|
||||||
|
|
||||||
export default connect(mapStateToProps, { onChangeWorkspace, clearStats })(BlocklyWindow);
|
export default connect(null, { onChangeWorkspace, clearStats })(BlocklyWindow);
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import './sensebox-display';
|
|||||||
import './sensebox-lora';
|
import './sensebox-lora';
|
||||||
import './sensebox-led';
|
import './sensebox-led';
|
||||||
import './sensebox-sd';
|
import './sensebox-sd';
|
||||||
import './mqtt';
|
|
||||||
import './text';
|
import './text';
|
||||||
import './io';
|
import './io';
|
||||||
import './audio';
|
import './audio';
|
||||||
@@ -18,7 +17,5 @@ import './map';
|
|||||||
import './procedures';
|
import './procedures';
|
||||||
import './time';
|
import './time';
|
||||||
import './variables';
|
import './variables';
|
||||||
import './lists';
|
|
||||||
import './webserver';
|
|
||||||
|
|
||||||
import '../helpers/types'
|
import '../helpers/types'
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
import Blockly, { FieldDropdown } from 'blockly/core'
|
|
||||||
import * as Types from '../helpers/types'
|
|
||||||
import { getColour } from '../helpers/colour';
|
|
||||||
|
|
||||||
Blockly.Blocks['lists_create_empty'] = {
|
|
||||||
/**
|
|
||||||
* Elapsed time in milliseconds block definition
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setHelpUrl('http://arduino.cc/en/Reference/Millis');
|
|
||||||
this.setColour(getColour().arrays);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("create List with")
|
|
||||||
this.appendValueInput('NUMBER');
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("Items of Type")
|
|
||||||
.appendField(new FieldDropdown(Types.VARIABLE_TYPES), 'type');
|
|
||||||
this.setOutput(true, Types.ARRAY.typeId);
|
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['array_getIndex'] = {
|
|
||||||
/**
|
|
||||||
* Elapsed time in milliseconds block definition
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setHelpUrl('http://arduino.cc/en/Reference/Millis');
|
|
||||||
this.setColour(getColour().arrays);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(new Blockly.FieldVariable(
|
|
||||||
'X',
|
|
||||||
null,
|
|
||||||
['Array'],
|
|
||||||
'Array'
|
|
||||||
), 'FIELDNAME');
|
|
||||||
this.setOutput(true, Types.ARRAY.typeId);
|
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['lists_length'] = {
|
|
||||||
/**
|
|
||||||
* Elapsed time in milliseconds block definition
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setHelpUrl('http://arduino.cc/en/Reference/Millis');
|
|
||||||
this.setColour(getColour().arrays);
|
|
||||||
this.appendValueInput('ARRAY')
|
|
||||||
.appendField('length of')
|
|
||||||
.setCheck(Types.ARRAY.compatibleTypes);
|
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
@@ -1,462 +1,276 @@
|
|||||||
import Blockly from "blockly/core";
|
import Blockly from 'blockly/core';
|
||||||
import { getColour } from "../helpers/colour";
|
import { getColour } from '../helpers/colour';
|
||||||
import * as Types from "../helpers/types";
|
import * as Types from '../helpers/types';
|
||||||
import { getCompatibleTypes } from "../helpers/types";
|
import { getCompatibleTypes } from '../helpers/types';
|
||||||
|
|
||||||
Blockly.Blocks["controls_if"] = {
|
|
||||||
/**
|
|
||||||
* Block for if/elseif/else condition.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setHelpUrl(Blockly.Msg.CONTROLS_IF_HELPURL);
|
|
||||||
this.setColour(getColour().logic);
|
|
||||||
this.appendValueInput("IF0")
|
|
||||||
.setCheck(Types.getCompatibleTypes("boolean"))
|
|
||||||
.appendField(Blockly.Msg.CONTROLS_IF_MSG_IF);
|
|
||||||
this.appendStatementInput("DO0").appendField(
|
|
||||||
Blockly.Msg.CONTROLS_IF_MSG_THEN
|
|
||||||
);
|
|
||||||
this.setPreviousStatement(true);
|
|
||||||
this.setNextStatement(true);
|
|
||||||
this.setMutator(
|
|
||||||
new Blockly.Mutator(["controls_if_elseif", "controls_if_else"])
|
|
||||||
);
|
|
||||||
// Assign 'this' to a variable for use in the tooltip closure below.
|
|
||||||
var thisBlock = this;
|
|
||||||
this.setTooltip(function () {
|
|
||||||
if (!thisBlock.elseifCount_ && !thisBlock.elseCount_) {
|
|
||||||
return Blockly.Msg.CONTROLS_IF_TOOLTIP_1;
|
|
||||||
} else if (!thisBlock.elseifCount_ && thisBlock.elseCount_) {
|
|
||||||
return Blockly.Msg.CONTROLS_IF_TOOLTIP_2;
|
|
||||||
} else if (thisBlock.elseifCount_ && !thisBlock.elseCount_) {
|
|
||||||
return Blockly.Msg.CONTROLS_IF_TOOLTIP_3;
|
|
||||||
} else if (thisBlock.elseifCount_ && thisBlock.elseCount_) {
|
|
||||||
return Blockly.Msg.CONTROLS_IF_TOOLTIP_4;
|
|
||||||
}
|
|
||||||
return "";
|
|
||||||
});
|
|
||||||
this.elseifCount_ = 0;
|
|
||||||
this.elseCount_ = 0;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Create XML to represent the number of else-if and else inputs.
|
|
||||||
* @return {Element} XML storage element.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
mutationToDom: function () {
|
|
||||||
if (!this.elseifCount_ && !this.elseCount_) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var container = document.createElement("mutation");
|
|
||||||
if (this.elseifCount_) {
|
|
||||||
container.setAttribute("elseif", this.elseifCount_);
|
|
||||||
}
|
|
||||||
if (this.elseCount_) {
|
|
||||||
container.setAttribute("else", 1);
|
|
||||||
}
|
|
||||||
return container;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Parse XML to restore the else-if and else inputs.
|
|
||||||
* @param {!Element} xmlElement XML storage element.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
domToMutation: function (xmlElement) {
|
|
||||||
this.elseifCount_ = parseInt(xmlElement.getAttribute("elseif"), 10) || 0;
|
|
||||||
this.elseCount_ = parseInt(xmlElement.getAttribute("else"), 10) || 0;
|
|
||||||
this.updateShape_();
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Populate the mutator's dialog with this block's components.
|
|
||||||
* @param {!Blockly.Workspace} workspace Mutator's workspace.
|
|
||||||
* @return {!Blockly.Block} Root block in mutator.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
decompose: function (workspace) {
|
|
||||||
var containerBlock = workspace.newBlock("controls_if_if");
|
|
||||||
containerBlock.initSvg();
|
|
||||||
var connection = containerBlock.nextConnection;
|
|
||||||
for (var i = 1; i <= this.elseifCount_; i++) {
|
|
||||||
var elseifBlock = workspace.newBlock("controls_if_elseif");
|
|
||||||
elseifBlock.initSvg();
|
|
||||||
connection.connect(elseifBlock.previousConnection);
|
|
||||||
connection = elseifBlock.nextConnection;
|
|
||||||
}
|
|
||||||
if (this.elseCount_) {
|
|
||||||
var elseBlock = workspace.newBlock("controls_if_else");
|
|
||||||
elseBlock.initSvg();
|
|
||||||
connection.connect(elseBlock.previousConnection);
|
|
||||||
}
|
|
||||||
return containerBlock;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Reconfigure this block based on the mutator dialog's components.
|
|
||||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
compose: function (containerBlock) {
|
|
||||||
var clauseBlock = containerBlock.nextConnection.targetBlock();
|
|
||||||
// Count number of inputs.
|
|
||||||
this.elseifCount_ = 0;
|
|
||||||
this.elseCount_ = 0;
|
|
||||||
var valueConnections = [null];
|
|
||||||
var statementConnections = [null];
|
|
||||||
var elseStatementConnection = null;
|
|
||||||
while (clauseBlock) {
|
|
||||||
switch (clauseBlock.type) {
|
|
||||||
case "controls_if_elseif":
|
|
||||||
this.elseifCount_++;
|
|
||||||
valueConnections.push(clauseBlock.valueConnection_);
|
|
||||||
statementConnections.push(clauseBlock.statementConnection_);
|
|
||||||
break;
|
|
||||||
case "controls_if_else":
|
|
||||||
this.elseCount_++;
|
|
||||||
elseStatementConnection = clauseBlock.statementConnection_;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error("Unknown block type.");
|
|
||||||
}
|
|
||||||
clauseBlock =
|
|
||||||
clauseBlock.nextConnection && clauseBlock.nextConnection.targetBlock();
|
|
||||||
}
|
|
||||||
this.updateShape_();
|
|
||||||
// Reconnect any child blocks.
|
|
||||||
for (var i = 1; i <= this.elseifCount_; i++) {
|
|
||||||
Blockly.Mutator.reconnect(valueConnections[i], this, "IF" + i);
|
|
||||||
Blockly.Mutator.reconnect(statementConnections[i], this, "DO" + i);
|
|
||||||
}
|
|
||||||
Blockly.Mutator.reconnect(elseStatementConnection, this, "ELSE");
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Store pointers to any connected child blocks.
|
|
||||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
saveConnections: function (containerBlock) {
|
|
||||||
var clauseBlock = containerBlock.nextConnection.targetBlock();
|
|
||||||
var i = 1;
|
|
||||||
var inputDo;
|
|
||||||
while (clauseBlock) {
|
|
||||||
switch (clauseBlock.type) {
|
|
||||||
case "controls_if_elseif":
|
|
||||||
var inputIf = this.getInput("IF" + i);
|
|
||||||
inputDo = this.getInput("DO" + i);
|
|
||||||
clauseBlock.valueConnection_ =
|
|
||||||
inputIf && inputIf.connection.targetConnection;
|
|
||||||
clauseBlock.statementConnection_ =
|
|
||||||
inputDo && inputDo.connection.targetConnection;
|
|
||||||
i++;
|
|
||||||
break;
|
|
||||||
case "controls_if_else":
|
|
||||||
inputDo = this.getInput("ELSE");
|
|
||||||
clauseBlock.statementConnection_ =
|
|
||||||
inputDo && inputDo.connection.targetConnection;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error("Unknown block type.");
|
|
||||||
}
|
|
||||||
clauseBlock =
|
|
||||||
clauseBlock.nextConnection && clauseBlock.nextConnection.targetBlock();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Modify this block to have the correct number of inputs.
|
|
||||||
* @private
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
updateShape_: function () {
|
|
||||||
// Delete everything.
|
|
||||||
if (this.getInput("ELSE")) {
|
|
||||||
this.removeInput("ELSE");
|
|
||||||
}
|
|
||||||
var j = 1;
|
|
||||||
while (this.getInput("IF" + j)) {
|
|
||||||
this.removeInput("IF" + j);
|
|
||||||
this.removeInput("DO" + j);
|
|
||||||
j++;
|
|
||||||
}
|
|
||||||
// Rebuild block.
|
|
||||||
for (var i = 1; i <= this.elseifCount_; i++) {
|
|
||||||
this.appendValueInput("IF" + i)
|
|
||||||
.setCheck(Types.getCompatibleTypes("boolean"))
|
|
||||||
.appendField(Blockly.Msg.CONTROLS_IF_MSG_ELSEIF);
|
|
||||||
this.appendStatementInput("DO" + i).appendField(
|
|
||||||
Blockly.Msg.CONTROLS_IF_MSG_THEN
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (this.elseCount_) {
|
|
||||||
this.appendStatementInput("ELSE").appendField(
|
|
||||||
Blockly.Msg.CONTROLS_IF_MSG_ELSE
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks["controls_if_if"] = {
|
Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
||||||
/**
|
|
||||||
* Mutator block for if container.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().logic);
|
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.CONTROLS_IF_IF_TITLE_IF);
|
|
||||||
this.setNextStatement(true);
|
|
||||||
this.setTooltip(Blockly.Msg.CONTROLS_IF_IF_TOOLTIP);
|
|
||||||
this.contextMenu = false;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks["controls_if_elseif"] = {
|
|
||||||
/**
|
|
||||||
* Mutator bolck for else-if condition.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().logic);
|
|
||||||
this.appendDummyInput().appendField(
|
|
||||||
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF
|
|
||||||
);
|
|
||||||
this.setPreviousStatement(true);
|
|
||||||
this.setNextStatement(true);
|
|
||||||
this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP);
|
|
||||||
this.contextMenu = false;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks["controls_if_else"] = {
|
|
||||||
/**
|
|
||||||
* Mutator block for else condition.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().logic);
|
|
||||||
this.appendDummyInput().appendField(
|
|
||||||
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE
|
|
||||||
);
|
|
||||||
this.setPreviousStatement(true);
|
|
||||||
this.setTooltip(Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP);
|
|
||||||
this.contextMenu = false;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.defineBlocksWithJsonArray([
|
|
||||||
// BEGIN JSON EXTRACT
|
|
||||||
// Block for boolean data type: true and false.
|
// Block for boolean data type: true and false.
|
||||||
{
|
{
|
||||||
type: "logic_boolean",
|
"type": "logic_boolean",
|
||||||
message0: "%1",
|
"message0": "%1",
|
||||||
args0: [
|
"args0": [
|
||||||
{
|
{
|
||||||
type: "field_dropdown",
|
"type": "field_dropdown",
|
||||||
name: "BOOL",
|
"name": "BOOL",
|
||||||
options: [
|
"options": [
|
||||||
["%{BKY_LOGIC_BOOLEAN_TRUE}", "TRUE"],
|
["%{BKY_LOGIC_BOOLEAN_TRUE}", "TRUE"],
|
||||||
["%{BKY_LOGIC_BOOLEAN_FALSE}", "FALSE"],
|
["%{BKY_LOGIC_BOOLEAN_FALSE}", "FALSE"]
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
|
"output": Types.BOOLEAN.typeName,
|
||||||
|
"style": "logic_blocks",
|
||||||
|
"tooltip": "%{BKY_LOGIC_BOOLEAN_TOOLTIP}",
|
||||||
|
"helpUrl": "%{BKY_LOGIC_BOOLEAN_HELPURL}"
|
||||||
},
|
},
|
||||||
],
|
// Block for if/elseif/else condition.
|
||||||
output: Types.BOOLEAN.typeName,
|
|
||||||
style: "logic_blocks",
|
|
||||||
tooltip: "%{BKY_LOGIC_BOOLEAN_TOOLTIP}",
|
|
||||||
helpUrl: "%{BKY_LOGIC_BOOLEAN_HELPURL}",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
type: "controls_ifelse",
|
"type": "controls_if",
|
||||||
message0: "%{BKY_CONTROLS_IF_MSG_IF} %1",
|
"message0": "%{BKY_CONTROLS_IF_MSG_IF} %1",
|
||||||
args0: [
|
"args0": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "IF0",
|
"name": "IF0",
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
"check": Types.getCompatibleTypes('boolean')
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
message1: "%{BKY_CONTROLS_IF_MSG_THEN} %1",
|
"message1": "%{BKY_CONTROLS_IF_MSG_THEN} %1",
|
||||||
args1: [
|
"args1": [
|
||||||
{
|
{
|
||||||
type: "input_statement",
|
"type": "input_statement",
|
||||||
name: "DO0",
|
"name": "DO0"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
message2: "%{BKY_CONTROLS_IF_MSG_ELSE} %1",
|
"previousStatement": null,
|
||||||
args2: [
|
"nextStatement": null,
|
||||||
|
"style": "logic_blocks",
|
||||||
|
"helpUrl": "%{BKY_CONTROLS_IF_HELPURL}",
|
||||||
|
"mutator": "controls_if_mutator",
|
||||||
|
"extensions": ["controls_if_tooltip"]
|
||||||
|
},
|
||||||
|
// If/else block that does not use a mutator.
|
||||||
{
|
{
|
||||||
type: "input_statement",
|
"type": "controls_ifelse",
|
||||||
name: "ELSE",
|
"message0": "%{BKY_CONTROLS_IF_MSG_IF} %1",
|
||||||
},
|
"args0": [
|
||||||
|
{
|
||||||
|
"type": "input_value",
|
||||||
|
"name": "IF0",
|
||||||
|
"check": Types.getCompatibleTypes('boolean')
|
||||||
|
}
|
||||||
],
|
],
|
||||||
previousStatement: null,
|
"message1": "%{BKY_CONTROLS_IF_MSG_THEN} %1",
|
||||||
nextStatement: null,
|
"args1": [
|
||||||
style: "logic_blocks",
|
{
|
||||||
tooltip: "%{BKYCONTROLS_IF_TOOLTIP_2}",
|
"type": "input_statement",
|
||||||
helpUrl: "%{BKY_CONTROLS_IF_HELPURL}",
|
"name": "DO0"
|
||||||
extensions: ["controls_if_tooltip"],
|
}
|
||||||
|
],
|
||||||
|
"message2": "%{BKY_CONTROLS_IF_MSG_ELSE} %1",
|
||||||
|
"args2": [
|
||||||
|
{
|
||||||
|
"type": "input_statement",
|
||||||
|
"name": "ELSE"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"previousStatement": null,
|
||||||
|
"nextStatement": null,
|
||||||
|
"style": "logic_blocks",
|
||||||
|
"tooltip": "%{BKYCONTROLS_IF_TOOLTIP_2}",
|
||||||
|
"helpUrl": "%{BKY_CONTROLS_IF_HELPURL}",
|
||||||
|
"extensions": ["controls_if_tooltip"]
|
||||||
},
|
},
|
||||||
// Block for comparison operator.
|
// Block for comparison operator.
|
||||||
{
|
{
|
||||||
type: "logic_compare",
|
"type": "logic_compare",
|
||||||
message0: "%1 %2 %3",
|
"message0": "%1 %2 %3",
|
||||||
args0: [
|
"args0": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "A",
|
"name": "A"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "field_dropdown",
|
"type": "field_dropdown",
|
||||||
name: "OP",
|
"name": "OP",
|
||||||
options: [
|
"options": [
|
||||||
["=", "EQ"],
|
["=", "EQ"],
|
||||||
["\u2260", "NEQ"],
|
["\u2260", "NEQ"],
|
||||||
["\u200F<", "LT"],
|
["\u200F<", "LT"],
|
||||||
["\u200F\u2264", "LTE"],
|
["\u200F\u2264", "LTE"],
|
||||||
["\u200F>", "GT"],
|
["\u200F>", "GT"],
|
||||||
["\u200F\u2265", "GTE"],
|
["\u200F\u2265", "GTE"]
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "B",
|
"name": "B"
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
inputsInline: true,
|
"inputsInline": true,
|
||||||
output: Types.BOOLEAN.typeName,
|
"output": Types.BOOLEAN.typeName,
|
||||||
style: "logic_blocks",
|
"style": "logic_blocks",
|
||||||
helpUrl: "%{BKY_LOGIC_COMPARE_HELPURL}",
|
"helpUrl": "%{BKY_LOGIC_COMPARE_HELPURL}",
|
||||||
extensions: ["logic_compare", "logic_op_tooltip"],
|
"extensions": ["logic_compare", "logic_op_tooltip"]
|
||||||
},
|
},
|
||||||
// Block for logical operations: 'and', 'or'.
|
// Block for logical operations: 'and', 'or'.
|
||||||
{
|
{
|
||||||
type: "logic_operation",
|
"type": "logic_operation",
|
||||||
message0: "%1 %2 %3",
|
"message0": "%1 %2 %3",
|
||||||
args0: [
|
"args0": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "A",
|
"name": "A",
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
"check": Types.getCompatibleTypes('boolean')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "field_dropdown",
|
"type": "field_dropdown",
|
||||||
name: "OP",
|
"name": "OP",
|
||||||
options: [
|
"options": [
|
||||||
["%{BKY_LOGIC_OPERATION_AND}", "AND"],
|
["%{BKY_LOGIC_OPERATION_AND}", "AND"],
|
||||||
["%{BKY_LOGIC_OPERATION_OR}", "OR"],
|
["%{BKY_LOGIC_OPERATION_OR}", "OR"]
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "B",
|
"name": "B",
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
"check": Types.getCompatibleTypes('boolean')
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
inputsInline: true,
|
"inputsInline": true,
|
||||||
output: Types.BOOLEAN.typeName,
|
"output": Types.BOOLEAN.typeName,
|
||||||
style: "logic_blocks",
|
"style": "logic_blocks",
|
||||||
helpUrl: "%{BKY_LOGIC_OPERATION_HELPURL}",
|
"helpUrl": "%{BKY_LOGIC_OPERATION_HELPURL}",
|
||||||
extensions: ["logic_op_tooltip"],
|
"extensions": ["logic_op_tooltip"]
|
||||||
},
|
},
|
||||||
// Block for negation.
|
// Block for negation.
|
||||||
{
|
{
|
||||||
type: "logic_negate",
|
"type": "logic_negate",
|
||||||
message0: "%{BKY_LOGIC_NEGATE_TITLE}",
|
"message0": "%{BKY_LOGIC_NEGATE_TITLE}",
|
||||||
args0: [
|
"args0": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "BOOL",
|
"name": "BOOL",
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
"check": Types.getCompatibleTypes('boolean'),
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
output: Types.BOOLEAN.typeName,
|
"output": Types.BOOLEAN.typeName,
|
||||||
style: "logic_blocks",
|
"style": "logic_blocks",
|
||||||
tooltip: "%{BKY_LOGIC_NEGATE_TOOLTIP}",
|
"tooltip": "%{BKY_LOGIC_NEGATE_TOOLTIP}",
|
||||||
helpUrl: "%{BKY_LOGIC_NEGATE_HELPURL}",
|
"helpUrl": "%{BKY_LOGIC_NEGATE_HELPURL}"
|
||||||
},
|
},
|
||||||
// Block for null data type.
|
// Block for null data type.
|
||||||
{
|
{
|
||||||
type: "logic_null",
|
"type": "logic_null",
|
||||||
message0: "%{BKY_LOGIC_NULL}",
|
"message0": "%{BKY_LOGIC_NULL}",
|
||||||
output: null,
|
"output": null,
|
||||||
style: "logic_blocks",
|
"style": "logic_blocks",
|
||||||
tooltip: "%{BKY_LOGIC_NULL_TOOLTIP}",
|
"tooltip": "%{BKY_LOGIC_NULL_TOOLTIP}",
|
||||||
helpUrl: "%{BKY_LOGIC_NULL_HELPURL}",
|
"helpUrl": "%{BKY_LOGIC_NULL_HELPURL}"
|
||||||
},
|
},
|
||||||
// Block for ternary operator.
|
// Block for ternary operator.
|
||||||
{
|
{
|
||||||
type: "logic_ternary",
|
"type": "logic_ternary",
|
||||||
message0: "%{BKY_LOGIC_TERNARY_CONDITION} %1",
|
"message0": "%{BKY_LOGIC_TERNARY_CONDITION} %1",
|
||||||
args0: [
|
"args0": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "IF",
|
"name": "IF",
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
"check": Types.getCompatibleTypes('boolean'),
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
message1: "%{BKY_LOGIC_TERNARY_IF_TRUE} %1",
|
"message1": "%{BKY_LOGIC_TERNARY_IF_TRUE} %1",
|
||||||
args1: [
|
"args1": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "THEN",
|
"name": "THEN"
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
}
|
||||||
},
|
|
||||||
],
|
],
|
||||||
message2: "%{BKY_LOGIC_TERNARY_IF_FALSE} %1",
|
"message2": "%{BKY_LOGIC_TERNARY_IF_FALSE} %1",
|
||||||
args2: [
|
"args2": [
|
||||||
{
|
{
|
||||||
type: "input_value",
|
"type": "input_value",
|
||||||
name: "ELSE",
|
"name": "ELSE"
|
||||||
check: Types.getCompatibleTypes("boolean"),
|
}
|
||||||
},
|
|
||||||
],
|
],
|
||||||
output: null,
|
"output": null,
|
||||||
style: "logic_blocks",
|
"style": "logic_blocks",
|
||||||
tooltip: "%{BKY_LOGIC_TERNARY_TOOLTIP}",
|
"tooltip": "%{BKY_LOGIC_TERNARY_TOOLTIP}",
|
||||||
helpUrl: "%{BKY_LOGIC_TERNARY_HELPURL}",
|
"helpUrl": "%{BKY_LOGIC_TERNARY_HELPURL}",
|
||||||
extensions: ["logic_ternary"],
|
"extensions": ["logic_ternary"]
|
||||||
},
|
}
|
||||||
]); // END JSON EXTRACT (Do not delete this comment.)
|
]); // END JSON EXTRACT (Do not delete this comment.)
|
||||||
|
|
||||||
Blockly.Blocks["logic_compare"] = {
|
Blockly.defineBlocksWithJsonArray([ // Mutator blocks. Do not extract.
|
||||||
|
// Block representing the if statement in the controls_if mutator.
|
||||||
|
{
|
||||||
|
"type": "controls_if_if",
|
||||||
|
"message0": "%{BKY_CONTROLS_IF_IF_TITLE_IF}",
|
||||||
|
"nextStatement": null,
|
||||||
|
"enableContextMenu": false,
|
||||||
|
"style": "logic_blocks",
|
||||||
|
"tooltip": "%{BKY_CONTROLS_IF_IF_TOOLTIP}"
|
||||||
|
},
|
||||||
|
// Block representing the else-if statement in the controls_if mutator.
|
||||||
|
{
|
||||||
|
"type": "controls_if_elseif",
|
||||||
|
"message0": "%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",
|
||||||
|
"previousStatement": null,
|
||||||
|
"nextStatement": null,
|
||||||
|
"enableContextMenu": false,
|
||||||
|
"style": "logic_blocks",
|
||||||
|
"tooltip": "%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"
|
||||||
|
},
|
||||||
|
// Block representing the else statement in the controls_if mutator.
|
||||||
|
{
|
||||||
|
"type": "controls_if_else",
|
||||||
|
"message0": "%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",
|
||||||
|
"previousStatement": null,
|
||||||
|
"enableContextMenu": false,
|
||||||
|
"style": "logic_blocks",
|
||||||
|
"tooltip": "%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
Blockly.Blocks['logic_compare'] = {
|
||||||
/**
|
/**
|
||||||
* Block for comparison operator.
|
* Block for comparison operator.
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
var OPERATORS = this.RTL
|
var OPERATORS = this.RTL ? [
|
||||||
? [
|
['=', 'EQ'],
|
||||||
["=", "EQ"],
|
['\u2260', 'NEQ'],
|
||||||
["\u2260", "NEQ"],
|
['>', 'LT'],
|
||||||
[">", "LT"],
|
['\u2265', 'LTE'],
|
||||||
["\u2265", "LTE"],
|
['<', 'GT'],
|
||||||
["<", "GT"],
|
['\u2264', 'GTE']
|
||||||
["\u2264", "GTE"],
|
] : [
|
||||||
]
|
['=', 'EQ'],
|
||||||
: [
|
['\u2260', 'NEQ'],
|
||||||
["=", "EQ"],
|
['<', 'LT'],
|
||||||
["\u2260", "NEQ"],
|
['\u2264', 'LTE'],
|
||||||
["<", "LT"],
|
['>', 'GT'],
|
||||||
["\u2264", "LTE"],
|
['\u2265', 'GTE']
|
||||||
[">", "GT"],
|
|
||||||
["\u2265", "GTE"],
|
|
||||||
];
|
];
|
||||||
this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL);
|
this.setHelpUrl(Blockly.Msg.LOGIC_COMPARE_HELPURL);
|
||||||
this.setColour(getColour().logic);
|
this.setColour(getColour().logic);
|
||||||
this.setOutput(true, Types.BOOLEAN.typeName);
|
this.setOutput(true, Types.BOOLEAN.typeName);
|
||||||
this.appendValueInput("A");
|
this.appendValueInput('A');
|
||||||
this.appendValueInput("B").appendField(
|
this.appendValueInput('B')
|
||||||
new Blockly.FieldDropdown(OPERATORS),
|
.appendField(new Blockly.FieldDropdown(OPERATORS), 'OP');
|
||||||
"OP"
|
|
||||||
);
|
|
||||||
this.setInputsInline(true);
|
this.setInputsInline(true);
|
||||||
// Assign 'this' to a variable for use in the tooltip closure below.
|
// Assign 'this' to a variable for use in the tooltip closure below.
|
||||||
var thisBlock = this;
|
var thisBlock = this;
|
||||||
this.setTooltip(function () {
|
this.setTooltip(function () {
|
||||||
var op = thisBlock.getFieldValue("OP");
|
var op = thisBlock.getFieldValue('OP');
|
||||||
var TOOLTIPS = {
|
var TOOLTIPS = {
|
||||||
EQ: Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ,
|
'EQ': Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ,
|
||||||
NEQ: Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,
|
'NEQ': Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ,
|
||||||
LT: Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT,
|
'LT': Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT,
|
||||||
LTE: Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE,
|
'LTE': Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE,
|
||||||
GT: Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT,
|
'GT': Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT,
|
||||||
GTE: Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE,
|
'GTE': Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE
|
||||||
};
|
};
|
||||||
return TOOLTIPS[op];
|
return TOOLTIPS[op];
|
||||||
});
|
});
|
||||||
@@ -468,44 +282,37 @@ Blockly.Blocks["logic_compare"] = {
|
|||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
var blockA = this.getInputTargetBlock("A");
|
var blockA = this.getInputTargetBlock('A');
|
||||||
console.log(blockA);
|
var blockB = this.getInputTargetBlock('B');
|
||||||
var blockB = this.getInputTargetBlock("B");
|
|
||||||
if (blockA === null && blockB === null) {
|
if (blockA === null && blockB === null) {
|
||||||
this.getInput("A").setCheck(null);
|
this.getInput('A').setCheck(null);
|
||||||
this.getInput("B").setCheck(null);
|
this.getInput('B').setCheck(null);
|
||||||
}
|
}
|
||||||
if (blockA !== null && blockB === null) {
|
if (blockA !== null && blockB === null) {
|
||||||
this.getInput("A").setCheck(
|
this.getInput('A').setCheck(getCompatibleTypes(blockA.outputConnection.check_[0]));
|
||||||
getCompatibleTypes(blockA.outputConnection.check_[0])
|
this.getInput('B').setCheck(getCompatibleTypes(blockA.outputConnection.check_[0]));
|
||||||
);
|
|
||||||
this.getInput("B").setCheck(
|
|
||||||
getCompatibleTypes(blockA.outputConnection.check_[0])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if (blockB !== null && blockA === null) {
|
if (blockB !== null && blockA === null) {
|
||||||
this.getInput("B").setCheck(
|
this.getInput('B').setCheck(getCompatibleTypes(blockB.outputConnection.check_[0]));
|
||||||
getCompatibleTypes(blockB.outputConnection.check_[0])
|
this.getInput('A').setCheck(getCompatibleTypes(blockB.outputConnection.check_[0]));
|
||||||
);
|
}
|
||||||
this.getInput("A").setCheck(
|
|
||||||
getCompatibleTypes(blockB.outputConnection.check_[0])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["switch_case"] = {
|
|
||||||
|
Blockly.Blocks['switch_case'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(getColour().logic);
|
this.setColour(getColour().logic);
|
||||||
this.setPreviousStatement(true);
|
this.setPreviousStatement(true);
|
||||||
this.setTooltip(Blockly.Msg.cases_tooltip);
|
|
||||||
this.setNextStatement(true);
|
this.setNextStatement(true);
|
||||||
this.appendValueInput("CONDITION").appendField(Blockly.Msg.cases_switch);
|
this.appendValueInput('CONDITION')
|
||||||
this.appendValueInput("CASECONDITION0").appendField(
|
.appendField(Blockly.Msg.cases_switch);
|
||||||
Blockly.Msg.cases_condition
|
this.appendValueInput('CASECONDITION0')
|
||||||
);
|
.appendField(Blockly.Msg.cases_condition);
|
||||||
this.appendStatementInput("CASE0").appendField(Blockly.Msg.cases_do);
|
this.appendStatementInput('CASE0')
|
||||||
this.setMutator(new Blockly.Mutator(["case_incaseof", "case_default"]));
|
.appendField(Blockly.Msg.cases_do);
|
||||||
|
this.setMutator(new Blockly.Mutator(['case_incaseof', 'case_default']));
|
||||||
|
this.setTooltip('Does something if the condition is true. If there isn\'t a matching case the default function will be executed.');
|
||||||
this.caseCount_ = 0;
|
this.caseCount_ = 0;
|
||||||
this.defaultCount_ = 0;
|
this.defaultCount_ = 0;
|
||||||
},
|
},
|
||||||
@@ -514,42 +321,43 @@ Blockly.Blocks["switch_case"] = {
|
|||||||
if (!this.caseCount_ && !this.defaultCount_) {
|
if (!this.caseCount_ && !this.defaultCount_) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
var container = document.createElement("mutation");
|
var container = document.createElement('mutation');
|
||||||
if (this.caseCount_) {
|
if (this.caseCount_) {
|
||||||
container.setAttribute("case", this.caseCount_);
|
container.setAttribute('case', this.caseCount_);
|
||||||
}
|
}
|
||||||
if (this.defaultCount_) {
|
if (this.defaultCount_) {
|
||||||
container.setAttribute("default", 1);
|
container.setAttribute('default', 1);
|
||||||
}
|
}
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
|
|
||||||
domToMutation: function (xmlElement) {
|
domToMutation: function (xmlElement) {
|
||||||
this.caseCount_ = parseInt(xmlElement.getAttribute("case"), 10);
|
this.caseCount_ = parseInt(xmlElement.getAttribute('case'), 10);
|
||||||
this.defaultCount_ = parseInt(xmlElement.getAttribute("default"), 10);
|
this.defaultCount_ = parseInt(xmlElement.getAttribute('default'), 10);
|
||||||
for (var x = 0; x <= this.caseCount_; x++) {
|
for (var x = 0; x <= this.caseCount_; x++) {
|
||||||
this.appendValueInput("CASECONDITION" + x).appendField(
|
this.appendValueInput('CASECONDITION' + x)
|
||||||
Blockly.Msg.cases_condition
|
.appendField(Blockly.Msg.cases_condition);
|
||||||
);
|
this.appendStatementInput('CASE' + x)
|
||||||
this.appendStatementInput("CASE" + x).appendField(Blockly.Msg.cases_do);
|
.appendField(Blockly.Msg.cases_do);
|
||||||
}
|
}
|
||||||
if (this.defaultCount_) {
|
if (this.defaultCount_) {
|
||||||
this.appendStatementInput("ONDEFAULT").appendField("default");
|
this.appendStatementInput('ONDEFAULT')
|
||||||
|
.appendField('default');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
decompose: function (workspace) {
|
decompose: function (workspace) {
|
||||||
var containerBlock = workspace.newBlock("control_case");
|
var containerBlock = workspace.newBlock('control_case');
|
||||||
containerBlock.initSvg();
|
containerBlock.initSvg();
|
||||||
var connection = containerBlock.getInput("STACK").connection;
|
var connection = containerBlock.getInput('STACK').connection;
|
||||||
for (var x = 1; x <= this.caseCount_; x++) {
|
for (var x = 1; x <= this.caseCount_; x++) {
|
||||||
var caseBlock = workspace.newBlock("case_incaseof");
|
var caseBlock = workspace.newBlock('case_incaseof');
|
||||||
caseBlock.initSvg();
|
caseBlock.initSvg();
|
||||||
connection.connect(caseBlock.previousConnection);
|
connection.connect(caseBlock.previousConnection);
|
||||||
connection = caseBlock.nextConnection;
|
connection = caseBlock.nextConnection;
|
||||||
}
|
}
|
||||||
if (this.defaultCount_) {
|
if (this.defaultCount_) {
|
||||||
var defaultBlock = Blockly.Block.obtain(workspace, "case_default");
|
var defaultBlock = Blockly.Block.obtain(workspace, 'case_default');
|
||||||
defaultBlock.initSvg();
|
defaultBlock.initSvg();
|
||||||
connection.connect(defaultBlock.previousConnection);
|
connection.connect(defaultBlock.previousConnection);
|
||||||
}
|
}
|
||||||
@@ -559,25 +367,23 @@ Blockly.Blocks["switch_case"] = {
|
|||||||
compose: function (containerBlock) {
|
compose: function (containerBlock) {
|
||||||
//Disconnect all input blocks and remove all inputs.
|
//Disconnect all input blocks and remove all inputs.
|
||||||
if (this.defaultCount_) {
|
if (this.defaultCount_) {
|
||||||
this.removeInput("ONDEFAULT");
|
this.removeInput('ONDEFAULT');
|
||||||
}
|
}
|
||||||
this.defaultCount_ = 0;
|
this.defaultCount_ = 0;
|
||||||
for (var x = this.caseCount_; x > 0; x--) {
|
for (var x = this.caseCount_; x > 0; x--) {
|
||||||
this.removeInput("CASECONDITION" + x);
|
this.removeInput('CASECONDITION' + x);
|
||||||
this.removeInput("CASE" + x);
|
this.removeInput('CASE' + x);
|
||||||
}
|
}
|
||||||
this.caseCount_ = 0;
|
this.caseCount_ = 0;
|
||||||
var caseBlock = containerBlock.getInputTargetBlock("STACK");
|
var caseBlock = containerBlock.getInputTargetBlock('STACK');
|
||||||
while (caseBlock) {
|
while (caseBlock) {
|
||||||
switch (caseBlock.type) {
|
switch (caseBlock.type) {
|
||||||
case "case_incaseof":
|
case 'case_incaseof':
|
||||||
this.caseCount_++;
|
this.caseCount_++;
|
||||||
var caseconditionInput = this.appendValueInput(
|
var caseconditionInput = this.appendValueInput('CASECONDITION' + this.caseCount_)
|
||||||
"CASECONDITION" + this.caseCount_
|
.appendField(Blockly.Msg.cases_condition);
|
||||||
).appendField(Blockly.Msg.cases_condition);
|
var caseInput = this.appendStatementInput('CASE' + this.caseCount_)
|
||||||
var caseInput = this.appendStatementInput(
|
.appendField(Blockly.Msg.cases_do);
|
||||||
"CASE" + this.caseCount_
|
|
||||||
).appendField(Blockly.Msg.cases_do);
|
|
||||||
if (caseBlock.valueConnection_) {
|
if (caseBlock.valueConnection_) {
|
||||||
caseconditionInput.connection.connect(caseBlock.valueConnection_);
|
caseconditionInput.connection.connect(caseBlock.valueConnection_);
|
||||||
}
|
}
|
||||||
@@ -585,82 +391,78 @@ Blockly.Blocks["switch_case"] = {
|
|||||||
caseInput.connection.connect(caseBlock.statementConnection_);
|
caseInput.connection.connect(caseBlock.statementConnection_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "case_default":
|
case 'case_default':
|
||||||
this.defaultCount_++;
|
this.defaultCount_++;
|
||||||
var defaultInput = this.appendStatementInput("ONDEFAULT").appendField(
|
var defaultInput = this.appendStatementInput('ONDEFAULT')
|
||||||
"default"
|
.appendField('default');
|
||||||
);
|
|
||||||
if (caseBlock.statementConnection_) {
|
if (caseBlock.statementConnection_) {
|
||||||
defaultInput.connection.connect(caseBlock.statementConnection_);
|
defaultInput.connection.connect(caseBlock.statementConnection_);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error("Unknown block type.");
|
throw new Error('Unknown block type.');
|
||||||
}
|
}
|
||||||
caseBlock =
|
caseBlock = caseBlock.nextConnection &&
|
||||||
caseBlock.nextConnection && caseBlock.nextConnection.targetBlock();
|
caseBlock.nextConnection.targetBlock();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
saveConnections: function (containerBlock) {
|
saveConnections: function (containerBlock) {
|
||||||
var caseBlock = containerBlock.getInputTargetBlock("STACK");
|
var caseBlock = containerBlock.getInputTargetBlock('STACK');
|
||||||
var x = 1;
|
var x = 1;
|
||||||
while (caseBlock) {
|
while (caseBlock) {
|
||||||
switch (caseBlock.type) {
|
switch (caseBlock.type) {
|
||||||
case "case_incaseof":
|
case 'case_incaseof':
|
||||||
var caseconditionInput = this.getInput("CASECONDITION" + x);
|
var caseconditionInput = this.getInput('CASECONDITION' + x);
|
||||||
var caseInput = this.getInput("CASE" + x);
|
var caseInput = this.getInput('CASE' + x);
|
||||||
caseBlock.valueConnection_ =
|
caseBlock.valueConnection_ = caseconditionInput && caseconditionInput.connection.targetConnection;
|
||||||
caseconditionInput &&
|
caseBlock.statementConnection_ = caseInput && caseInput.connection.targetConnection;
|
||||||
caseconditionInput.connection.targetConnection;
|
|
||||||
caseBlock.statementConnection_ =
|
|
||||||
caseInput && caseInput.connection.targetConnection;
|
|
||||||
x++;
|
x++;
|
||||||
break;
|
break;
|
||||||
case "case_default":
|
case 'case_default':
|
||||||
var defaultInput = this.getInput("ONDEFAULT");
|
var defaultInput = this.getInput('ONDEFAULT');
|
||||||
caseBlock.satementConnection_ =
|
caseBlock.satementConnection_ = defaultInput && defaultInput.connection.targetConnection;
|
||||||
defaultInput && defaultInput.connection.targetConnection;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Error("Unknown block type");
|
throw new Error('Unknown block type');
|
||||||
|
}
|
||||||
|
caseBlock = caseBlock.nextConnection &&
|
||||||
|
caseBlock.nextConnection.targetBlock();
|
||||||
}
|
}
|
||||||
caseBlock =
|
|
||||||
caseBlock.nextConnection && caseBlock.nextConnection.targetBlock();
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["control_case"] = {
|
Blockly.Blocks['control_case'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(getColour().logic);
|
this.setColour(getColour().logic);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.cases_switch);
|
this.appendDummyInput()
|
||||||
this.appendStatementInput("STACK");
|
.appendField(Blockly.Msg.cases_switch);
|
||||||
this.setTooltip("--Placeholder--");
|
this.appendStatementInput('STACK');
|
||||||
|
this.setTooltip('--Placeholder--');
|
||||||
this.contextMenu = false;
|
this.contextMenu = false;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["case_incaseof"] = {
|
Blockly.Blocks['case_incaseof'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(getColour().logic);
|
this.setColour(getColour().logic);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.cases_add);
|
this.appendDummyInput()
|
||||||
|
.appendField(Blockly.Msg.cases_add);
|
||||||
this.setPreviousStatement(true);
|
this.setPreviousStatement(true);
|
||||||
this.setNextStatement(true);
|
this.setNextStatement(true);
|
||||||
this.setTooltip("--Placeholder--");
|
this.setTooltip('--Placeholder--');
|
||||||
this.contextMenu = false;
|
this.contextMenu = false;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["case_default"] = {
|
Blockly.Blocks['case_default'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(getColour().logic);
|
this.setColour(getColour().logic);
|
||||||
this.appendValueInput("default").appendField("default");
|
this.appendValueInput('default')
|
||||||
|
.appendField('default');
|
||||||
this.setPreviousStatement(true);
|
this.setPreviousStatement(true);
|
||||||
this.setNextStatement(false);
|
this.setNextStatement(false);
|
||||||
this.setTooltip(
|
this.setTooltip('This function will run if there aren\'t any matching cases.');
|
||||||
"This function will run if there aren't any matching cases."
|
|
||||||
);
|
|
||||||
this.contextMenu = false;
|
this.contextMenu = false;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import Blockly from 'blockly';
|
import Blockly from 'blockly';
|
||||||
import { getColour } from '../helpers/colour';
|
import { getColour } from '../helpers/colour';
|
||||||
import { getCompatibleTypes } from '../helpers/types'
|
import { getCompatibleTypes } from '../helpers/types'
|
||||||
import * as Types from '../helpers/types';
|
|
||||||
|
|
||||||
Blockly.Blocks['controls_whileUntil'] = {
|
Blockly.Blocks['controls_whileUntil'] = {
|
||||||
/**
|
/**
|
||||||
@@ -47,7 +47,6 @@ Blockly.Blocks['controls_for'] = {
|
|||||||
{
|
{
|
||||||
"type": "field_variable",
|
"type": "field_variable",
|
||||||
"name": "VAR",
|
"name": "VAR",
|
||||||
"defaultType": Types.NUMBER.typeName,
|
|
||||||
"variable": null
|
"variable": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -98,7 +97,6 @@ Blockly.Blocks['controls_forEach'] = {
|
|||||||
{
|
{
|
||||||
"type": "field_variable",
|
"type": "field_variable",
|
||||||
"name": "VAR",
|
"name": "VAR",
|
||||||
"defaultType": Types.NUMBER.typeName,
|
|
||||||
"variable": null
|
"variable": null
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -287,8 +287,7 @@ Blockly.Blocks['math_change'] = {
|
|||||||
{
|
{
|
||||||
"type": "field_variable",
|
"type": "field_variable",
|
||||||
"name": "VAR",
|
"name": "VAR",
|
||||||
"defaultType": Types.NUMBER.typeName,
|
"variable": Blockly.Msg.MATH_CHANGE_TITLE_ITEM
|
||||||
"variable": null
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "input_value",
|
"type": "input_value",
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
import * as Blockly from 'blockly/core';
|
|
||||||
import { getColour } from '../helpers/colour';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* MQTT Blocks
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_mqtt_setup"] = {
|
|
||||||
init: function () {
|
|
||||||
|
|
||||||
//this.setTooltip(Blockly.Msg.senseBox_wifi_);
|
|
||||||
this.setHelpUrl('');
|
|
||||||
this.setColour(getColour().mqtt);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_mqtt_init)
|
|
||||||
.appendField(new Blockly.FieldDropdown([["Adafruit IO", 'adafruitio'], ["DIOTY", 'dioty'], ["Other Service", 'custom']]), "service");
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField(Blockly.Msg.senseBox_mqtt_server)
|
|
||||||
.appendField(new Blockly.FieldTextInput("Server"), "server");
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField(Blockly.Msg.senseBox_mqtt_port)
|
|
||||||
.appendField(new Blockly.FieldTextInput("Port"), "port");
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField(Blockly.Msg.senseBox_mqtt_username)
|
|
||||||
.appendField(new Blockly.FieldTextInput("Username"), "username");
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField(Blockly.Msg.senseBox_mqtt_password, "passwordmsg")
|
|
||||||
.appendField(new Blockly.FieldTextInput("Password"), "password");
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_mqtt_init_tooltip);
|
|
||||||
},
|
|
||||||
onchange: function (e) {
|
|
||||||
let service = this.getFieldValue('service');
|
|
||||||
switch (service) {
|
|
||||||
case 'adafruitio':
|
|
||||||
this.getField('server').setValue("io.adafruit.com");
|
|
||||||
this.getField('port').setValue("1883");
|
|
||||||
this.getField('passwordmsg').setValue("Adafruit IO Key");
|
|
||||||
break;
|
|
||||||
case 'dioty':
|
|
||||||
this.getField('server').setValue("mqtt.dioty.co");
|
|
||||||
this.getField('port').setValue("1883");
|
|
||||||
this.getField('passwordmsg').setValue(Blockly.Msg.senseBox_mqtt_password);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "custom":
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_mqtt_publish"] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().mqtt);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_mqtt_publish);
|
|
||||||
this.appendValueInput('value')
|
|
||||||
.setCheck(null)
|
|
||||||
.appendField('Feed/Topic')
|
|
||||||
.appendField(new Blockly.FieldTextInput('Name'), 'publishfeed');
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_mqtt_publish_tooltip);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_mqtt_subscribe"] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().mqtt);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.sensebox_mqtt_subscribe);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(new Blockly.FieldTextInput('Feedname'), 'subscribefeed');
|
|
||||||
this.setOutput(true, null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -11,8 +11,8 @@ Blockly.Blocks['sensebox_display_beginDisplay'] = {
|
|||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_beginDisplay_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_display_beginDisplay_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -23,8 +23,8 @@ Blockly.Blocks['sensebox_display_clearDisplay'] = {
|
|||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_clearDisplay_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_display_clearDisplay_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,56 +50,10 @@ Blockly.Blocks['sensebox_display_printDisplay'] = {
|
|||||||
.setCheck(null);
|
.setCheck(null);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
let variableName = this.getField('COLOR');
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
console.log(variableName.getValue());
|
||||||
},
|
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tip);
|
||||||
/**
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
* Called whenever anything on the workspace changes.
|
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
onchange: function (e) {
|
|
||||||
var legal = false;
|
|
||||||
// Is the block nested in a loop?
|
|
||||||
var block = this;
|
|
||||||
do {
|
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
|
||||||
legal = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
block = block.getSurroundParent();
|
|
||||||
} while (block);
|
|
||||||
if (legal) {
|
|
||||||
this.setWarningText(null);
|
|
||||||
} else {
|
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LOOP_TYPES: ['sensebox_display_show'],
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_display_fastPrint'] = {
|
|
||||||
init: function (block) {
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_show);
|
|
||||||
this.appendValueInput("Title1", 'Title1')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_title);
|
|
||||||
this.appendValueInput("Value1", 'Value1')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_value);
|
|
||||||
this.appendValueInput("Dimension1", 'Dimension1')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_dimension);
|
|
||||||
this.appendValueInput("Title2", 'Title2')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_title);
|
|
||||||
this.appendValueInput("Value2", 'Value2')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_value);
|
|
||||||
this.appendValueInput("Dimension2", 'Dimension2')
|
|
||||||
.appendField(Blockly.Msg.senseBox_display_fastPrint_dimension);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.sensebox_display_fastPrint_tooltip);
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
@@ -159,8 +113,8 @@ Blockly.Blocks['sensebox_display_plotDisplay'] = {
|
|||||||
.setCheck(null);
|
.setCheck(null);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl);
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
@@ -220,8 +174,6 @@ Blockly.Blocks['sensebox_display_fillCircle'] = {
|
|||||||
.appendField(Blockly.Msg.senseBox_display_filled)
|
.appendField(Blockly.Msg.senseBox_display_filled)
|
||||||
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
||||||
this.setInputsInline(false);
|
this.setInputsInline(false);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_fillCircle_tooltip)
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl)
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
},
|
},
|
||||||
@@ -272,8 +224,6 @@ Blockly.Blocks['sensebox_display_drawRectangle'] = {
|
|||||||
.appendField(Blockly.Msg.senseBox_display_filled)
|
.appendField(Blockly.Msg.senseBox_display_filled)
|
||||||
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
.appendField(new Blockly.FieldCheckbox("TRUE"), "FILL");
|
||||||
this.setInputsInline(false);
|
this.setInputsInline(false);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_drawRectangle_tooltip)
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl)
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import * as Blockly from 'blockly';
|
import * as Blockly from 'blockly';
|
||||||
|
import { FieldSlider } from '@blockly/field-slider';
|
||||||
import { getColour } from '../helpers/colour'
|
import { getColour } from '../helpers/colour'
|
||||||
import { selectedBoard } from '../helpers/board'
|
import { selectedBoard } from '../helpers/board'
|
||||||
import * as Types from '../helpers/types'
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_led'] = {
|
Blockly.Blocks['sensebox_led'] = {
|
||||||
@@ -15,7 +16,7 @@ Blockly.Blocks['sensebox_led'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_on, "HIGH"], [Blockly.Msg.senseBox_off, "LOW"]]), "STAT");
|
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_on, "HIGH"], [Blockly.Msg.senseBox_off, "LOW"]]), "STAT");
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_led_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_led_tip);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -26,155 +27,18 @@ Blockly.Blocks['sensebox_rgb_led'] = {
|
|||||||
.appendField(Blockly.Msg.senseBox_rgb_led)
|
.appendField(Blockly.Msg.senseBox_rgb_led)
|
||||||
.appendField("Pin:")
|
.appendField("Pin:")
|
||||||
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPins), "PIN");
|
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPins), "PIN");
|
||||||
|
this.appendDummyInput()
|
||||||
this.appendValueInput("COLOR", 'Number')
|
.appendField(Blockly.Msg.COLOUR_RGB_RED)//Blockly.Msg.senseBox_basic_red
|
||||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led_color)
|
.appendField(new FieldSlider(255, 0, 255), "RED");
|
||||||
.setCheck("Colour");
|
this.appendDummyInput()
|
||||||
// this.appendValueInput("RED", 'Number')
|
.appendField(Blockly.Msg.COLOUR_RGB_GREEN)//Blockly.Msg.senseBox_basic_green
|
||||||
// .appendField(Blockly.Msg.COLOUR_RGB_RED);//Blockly.Msg.senseBox_basic_red
|
.appendField(new FieldSlider(255, 0, 255), "GREEN");
|
||||||
// this.appendValueInput("GREEN", 'Number')
|
this.appendDummyInput()
|
||||||
// .appendField(Blockly.Msg.COLOUR_RGB_GREEN);//Blockly.Msg.senseBox_basic_green
|
.appendField(Blockly.Msg.COLOUR_RGB_BLUE)//Blockly.Msg.senseBox_basic_green
|
||||||
// this.appendValueInput("BLUE", 'Number')
|
.appendField(new FieldSlider(255, 0, 255), "BLUE");
|
||||||
// .appendField(Blockly.Msg.COLOUR_RGB_BLUE);
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_rgb_led_tip);
|
this.setTooltip(Blockly.Msg.senseBox_rgb_led_tip);
|
||||||
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_ws2818_led_init'] = {
|
|
||||||
init: function () {
|
|
||||||
|
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_ultrasonic_port_A, '1'],
|
|
||||||
[Blockly.Msg.senseBox_ultrasonic_port_B, '3'], [Blockly.Msg.senseBox_ultrasonic_port_C, '5']];
|
|
||||||
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led_init)
|
|
||||||
.appendField("Port:")
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
|
||||||
this.appendValueInput("BRIGHTNESS", "brightness")
|
|
||||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_brightness));
|
|
||||||
this.appendValueInput("NUMBER", "number")
|
|
||||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_number));
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_ws2818_rgb_led_init_tooltip);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_ws2818_led'] = {
|
|
||||||
init: function () {
|
|
||||||
|
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_ultrasonic_port_A, '1'],
|
|
||||||
[Blockly.Msg.senseBox_ultrasonic_port_B, '3'], [Blockly.Msg.senseBox_ultrasonic_port_C, '5']];
|
|
||||||
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led)
|
|
||||||
.appendField("Port:")
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
|
||||||
this.appendValueInput("POSITION", "position")
|
|
||||||
.appendField((Blockly.Msg.senseBox_ws2818_rgb_led_position));
|
|
||||||
this.appendValueInput("COLOR", 'Number')
|
|
||||||
.appendField(Blockly.Msg.senseBox_ws2818_rgb_led_color)
|
|
||||||
.setCheck("Colour");
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_ws2818_rgb_led_tooltip);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.defineBlocksWithJsonArray([ // BEGIN JSON EXTRACT
|
|
||||||
// Block for colour picker.
|
|
||||||
{
|
|
||||||
"type": "colour_picker",
|
|
||||||
"message0": "%1",
|
|
||||||
"args0": [
|
|
||||||
{
|
|
||||||
"type": "field_colour",
|
|
||||||
"name": "COLOUR",
|
|
||||||
"colour": "#ff0000"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"output": "Colour",
|
|
||||||
"helpUrl": "%{BKY_COLOUR_PICKER_HELPURL}",
|
|
||||||
"colour": getColour().sensebox,
|
|
||||||
"tooltip": "%{BKY_COLOUR_PICKER_TOOLTIP}",
|
|
||||||
"extensions": ["parent_tooltip_when_inline"]
|
|
||||||
},
|
|
||||||
|
|
||||||
// Block for random colour.
|
|
||||||
{
|
|
||||||
"type": "colour_random",
|
|
||||||
"message0": "%{BKY_COLOUR_RANDOM_TITLE}",
|
|
||||||
"output": "Colour",
|
|
||||||
"helpUrl": "%{BKY_COLOUR_RANDOM_HELPURL}",
|
|
||||||
"colour": getColour().sensebox,
|
|
||||||
"tooltip": "%{BKY_COLOUR_RANDOM_TOOLTIP}"
|
|
||||||
},
|
|
||||||
|
|
||||||
// Block for composing a colour from RGB components.
|
|
||||||
{
|
|
||||||
"type": "colour_rgb",
|
|
||||||
"message0": "%{BKY_COLOUR_RGB_TITLE} %{BKY_COLOUR_RGB_RED} %1 %{BKY_COLOUR_RGB_GREEN} %2 %{BKY_COLOUR_RGB_BLUE} %3",
|
|
||||||
"args0": [
|
|
||||||
{
|
|
||||||
"type": "input_value",
|
|
||||||
"name": "RED",
|
|
||||||
"check": Types.getCompatibleTypes('int'),
|
|
||||||
"align": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "input_value",
|
|
||||||
"name": "GREEN",
|
|
||||||
"check": Types.getCompatibleTypes('int'),
|
|
||||||
"align": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "input_value",
|
|
||||||
"name": "BLUE",
|
|
||||||
"check": Types.getCompatibleTypes('int'),
|
|
||||||
"align": "RIGHT"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"output": "Colour",
|
|
||||||
"helpUrl": "%{BKY_COLOUR_RGB_HELPURL}",
|
|
||||||
"colour": getColour().sensebox,
|
|
||||||
"tooltip": "%{BKY_COLOUR_RGB_TOOLTIP}"
|
|
||||||
},
|
|
||||||
|
|
||||||
// Block for blending two colours together.
|
|
||||||
{
|
|
||||||
"type": "colour_blend",
|
|
||||||
"message0": "%{BKY_COLOUR_BLEND_TITLE} %{BKY_COLOUR_BLEND_COLOUR1} " +
|
|
||||||
"%1 %{BKY_COLOUR_BLEND_COLOUR2} %2 %{BKY_COLOUR_BLEND_RATIO} %3",
|
|
||||||
"args0": [
|
|
||||||
{
|
|
||||||
"type": "input_value",
|
|
||||||
"name": "COLOUR1",
|
|
||||||
"check": "Colour",
|
|
||||||
"align": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "input_value",
|
|
||||||
"name": "COLOUR2",
|
|
||||||
"check": "Colour",
|
|
||||||
"align": "RIGHT"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "input_value",
|
|
||||||
"name": "RATIO",
|
|
||||||
"check": "Number",
|
|
||||||
"align": "RIGHT"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"output": "Colour",
|
|
||||||
"helpUrl": "%{BKY_COLOUR_BLEND_HELPURL}",
|
|
||||||
"style": "colour_blocks",
|
|
||||||
"tooltip": "%{BKY_COLOUR_BLEND_TOOLTIP}"
|
|
||||||
}
|
|
||||||
]); // END JSON EXTRACT (Do not delete this comment.)
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ import { getColour } from '../helpers/colour';
|
|||||||
|
|
||||||
Blockly.Blocks['sensebox_lora_initialize_otaa'] = {
|
Blockly.Blocks['sensebox_lora_initialize_otaa'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_LoRa_init_otaa_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_LoRa_init_otaa_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_LoRa_init_helpurl);
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField("Initialize LoRa (OTAA)");
|
.appendField("Initialize LoRa (OTAA)");
|
||||||
|
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField(Blockly.Msg.senseBox_LoRa_device_id)
|
.appendField(Blockly.Msg.senseBox_LoRa_device_id)
|
||||||
@@ -36,8 +37,8 @@ Blockly.Blocks['sensebox_lora_initialize_otaa'] = {
|
|||||||
|
|
||||||
Blockly.Blocks['sensebox_lora_initialize_abp'] = {
|
Blockly.Blocks['sensebox_lora_initialize_abp'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_LoRa_init_abp_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_LoRa_init_abp_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_LoRa_init_helpurl);
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField("Initialize LoRa (ABP)");
|
.appendField("Initialize LoRa (ABP)");
|
||||||
@@ -67,7 +68,7 @@ Blockly.Blocks['sensebox_lora_initialize_abp'] = {
|
|||||||
|
|
||||||
Blockly.Blocks['sensebox_lora_message_send'] = {
|
Blockly.Blocks['sensebox_lora_message_send'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_LoRa_message_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_LoRa_message_tip);
|
||||||
this.setHelpUrl('');
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendStatementInput('DO')
|
this.appendStatementInput('DO')
|
||||||
@@ -118,38 +119,6 @@ Blockly.Blocks['sensebox_send_lora_sensor_value'] = {
|
|||||||
LOOP_TYPES: ['sensebox_lora_message_send'],
|
LOOP_TYPES: ['sensebox_lora_message_send'],
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_lora_ttn_mapper'] = {
|
|
||||||
init: function (block) {
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("TTN Mapper");
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_RIGHT)
|
|
||||||
.appendField("Fix Type Limit")
|
|
||||||
.appendField(new Blockly.FieldDropdown([["0", "0"], ["1", "1"], ["2", "2"], ["3", "3"]].reverse()), "dropdown");
|
|
||||||
// reverse() because i want 3 be be at first and i'm to lazy to write the array again
|
|
||||||
this.appendValueInput('Latitude')
|
|
||||||
.appendField(Blockly.Msg.senseBox_gps_lat)
|
|
||||||
.setCheck(null);
|
|
||||||
this.appendValueInput('Longitude')
|
|
||||||
.appendField(Blockly.Msg.senseBox_gps_lng)
|
|
||||||
.setCheck(null);
|
|
||||||
this.appendValueInput('Altitude')
|
|
||||||
.appendField(Blockly.Msg.senseBox_gps_alt)
|
|
||||||
.setCheck(null);
|
|
||||||
this.appendValueInput('pDOP')
|
|
||||||
.appendField('pDOP')
|
|
||||||
.setCheck(null);
|
|
||||||
this.appendValueInput('Fix Type')
|
|
||||||
.appendField('Fix Type')
|
|
||||||
.setCheck(null);
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tip);
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_lora_cayenne_send'] = {
|
Blockly.Blocks['sensebox_lora_cayenne_send'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_LoRa_cayenne_tip);
|
this.setTooltip(Blockly.Msg.senseBox_LoRa_cayenne_tip);
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
import * as Blockly from 'blockly/core';
|
import * as Blockly from 'blockly/core';
|
||||||
import { getColour } from '../helpers/colour';
|
import { getColour } from '../helpers/colour';
|
||||||
|
|
||||||
import store from '../../../store';
|
|
||||||
|
|
||||||
var boxes = store.getState().auth.user ? store.getState().auth.user.boxes : null;
|
|
||||||
store.subscribe(() => {
|
|
||||||
boxes = store.getState().auth.user ? store.getState().auth.user.boxes : null;
|
|
||||||
});
|
|
||||||
var selectedBox = '';
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_osem_connection'] = {
|
Blockly.Blocks['sensebox_osem_connection'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
@@ -24,25 +16,10 @@ Blockly.Blocks['sensebox_osem_connection'] = {
|
|||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField(Blockly.Msg.senseBox_osem_exposure)
|
.appendField(Blockly.Msg.senseBox_osem_exposure)
|
||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_osem_stationary, 'Stationary'], [Blockly.Msg.senseBox_osem_mobile, 'Mobile']]), "type");
|
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_osem_stationary, 'Stationary'], [Blockly.Msg.senseBox_osem_mobile, 'Mobile']]), "type");
|
||||||
if (!boxes) {
|
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField("senseBox ID")
|
.appendField("senseBox ID")
|
||||||
.appendField(new Blockly.FieldTextInput("senseBox ID"), "BoxID");
|
.appendField(new Blockly.FieldTextInput("senseBox ID"), "BoxID");
|
||||||
} else {
|
|
||||||
var dropdown = []
|
|
||||||
for (var i = 0; i < boxes.length; i++) {
|
|
||||||
dropdown.push([boxes[i].name, boxes[i]._id])
|
|
||||||
}
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField("senseBox ID")
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdown), 'BoxID');
|
|
||||||
}
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField(Blockly.Msg.senseBox_osem_access_token)
|
|
||||||
.appendField(new Blockly.FieldTextInput("access_token"), "access_token");
|
|
||||||
this.appendStatementInput('DO')
|
this.appendStatementInput('DO')
|
||||||
.appendField(Blockly.Msg.senseBox_sensor)
|
.appendField(Blockly.Msg.senseBox_sensor)
|
||||||
.setCheck(null);
|
.setCheck(null);
|
||||||
@@ -51,40 +28,9 @@ Blockly.Blocks['sensebox_osem_connection'] = {
|
|||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
|
|
||||||
var legal = false;
|
//Blockly.Blocks.sensebox.getDescendants = blocks;
|
||||||
// Is the block nested in a loop?
|
|
||||||
var block = this;
|
|
||||||
do {
|
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
|
||||||
legal = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
block = block.getSurroundParent();
|
|
||||||
} while (block);
|
|
||||||
if (legal) {
|
|
||||||
this.setWarningText(null);
|
|
||||||
} else {
|
|
||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* List of block types that are loops and thus do not need warnings.
|
|
||||||
* To add a new loop type add this to your code:
|
|
||||||
* Blockly.Blocks['controls_flow_statements'].LOOP_TYPES.push('custom_loop');
|
|
||||||
*/
|
|
||||||
selectedBox = this.getFieldValue('BoxID');
|
|
||||||
console.log(selectedBox)
|
|
||||||
if (selectedBox !== '' && boxes) {
|
|
||||||
var accessToken = boxes.find(element => element._id === selectedBox).access_token
|
|
||||||
if (accessToken !== undefined) {
|
|
||||||
this.getField('access_token').setValue(accessToken)
|
|
||||||
} else {
|
|
||||||
this.getField('access_token').setValue('access_token')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mutationToDom: function () {
|
mutationToDom: function () {
|
||||||
var container = document.createElement('mutation');
|
var container = document.createElement('mutation');
|
||||||
var input = this.getFieldValue('type');
|
var input = this.getFieldValue('type');
|
||||||
@@ -124,7 +70,6 @@ Blockly.Blocks['sensebox_osem_connection'] = {
|
|||||||
this.removeInput('timeStamp');
|
this.removeInput('timeStamp');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LOOP_TYPES: ['sensebox_interval_timer']
|
|
||||||
};
|
};
|
||||||
Blockly.Blocks['sensebox_send_to_osem'] = {
|
Blockly.Blocks['sensebox_send_to_osem'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
@@ -133,52 +78,20 @@ Blockly.Blocks['sensebox_send_to_osem'] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_send_to_osem);
|
.appendField(Blockly.Msg.senseBox_send_to_osem);
|
||||||
if (boxes) {
|
|
||||||
this.appendValueInput('Value')
|
this.appendValueInput('Value')
|
||||||
.appendField('Phänomen')
|
.setCheck(null)
|
||||||
.appendField(new Blockly.FieldDropdown(
|
.appendField('Sensor ID')
|
||||||
this.generateOptions), 'SensorID');
|
.appendField(new Blockly.FieldTextInput('Sensor ID'), 'SensorID');
|
||||||
} else {
|
|
||||||
this.appendValueInput('Value')
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField('Phänomen')
|
|
||||||
.appendField(new Blockly.FieldTextInput(
|
|
||||||
'sensorID'), 'SensorID')
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
},
|
},
|
||||||
|
|
||||||
generateOptions: function () {
|
|
||||||
var dropdown = [['', '']];
|
|
||||||
var boxID = selectedBox;
|
|
||||||
if (boxID !== '' && boxes) {
|
|
||||||
|
|
||||||
let box = boxes.find(el => el._id === boxID);
|
|
||||||
if (box !== undefined) {
|
|
||||||
for (var i = 0; i < box.sensors.length; i++) {
|
|
||||||
dropdown.push([box.sensors[i].title, box.sensors[i]._id])
|
|
||||||
}
|
|
||||||
console.log(dropdown)
|
|
||||||
}
|
|
||||||
if (dropdown.length > 1) {
|
|
||||||
var options = dropdown.slice(1)
|
|
||||||
return options
|
|
||||||
} else {
|
|
||||||
return dropdown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return dropdown
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
* Add warning if block is not nested inside a the correct loop.
|
* Add warning if block is not nested inside a the correct loop.
|
||||||
* @param {!Blockly.Events.Abstract} e Change event.
|
* @param {!Blockly.Events.Abstract} e Change event.
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
onchange: function () {
|
onchange: function (e) {
|
||||||
|
|
||||||
var legal = false;
|
var legal = false;
|
||||||
// Is the block nested in a loop?
|
// Is the block nested in a loop?
|
||||||
var block = this;
|
var block = this;
|
||||||
@@ -195,10 +108,5 @@ Blockly.Blocks['sensebox_send_to_osem'] = {
|
|||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
LOOP_TYPES: ['sensebox_osem_connection'],
|
||||||
* List of block types that are loops and thus do not need warnings.
|
|
||||||
* To add a new loop type add this to your code:
|
|
||||||
* Blockly.Blocks['controls_flow_statements'].LOOP_TYPES.push('custom_loop');
|
|
||||||
*/
|
|
||||||
LOOP_TYPES: ['sensebox_osem_connection']
|
|
||||||
};
|
};
|
||||||
@@ -1,80 +1,57 @@
|
|||||||
import * as Blockly from "blockly/core";
|
import * as Blockly from 'blockly/core';
|
||||||
import { getColour } from "../helpers/colour";
|
import { getColour } from '../helpers/colour';
|
||||||
|
|
||||||
var checkFileName = function (filename) {
|
|
||||||
var length = filename.length;
|
|
||||||
if (length > 8) {
|
|
||||||
alert("dateiname sollte kleiner als 8 Zeichen sein");
|
|
||||||
return filename.slice(0, 8);
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_sd_open_file"] = {
|
Blockly.Blocks['sensebox_sd_open_file'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_sd_open_file)
|
.appendField(Blockly.Msg.senseBox_sd_open_file)
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField(
|
.appendField(
|
||||||
new Blockly.FieldTextInput("Data", checkFileName),
|
new Blockly.FieldTextInput('Data.txt'),
|
||||||
"Filename"
|
'Filename');
|
||||||
)
|
this.appendStatementInput('SD')
|
||||||
.appendField(".")
|
.setCheck(null);
|
||||||
.appendField(
|
|
||||||
new Blockly.FieldDropdown([
|
|
||||||
["txt", "txt"],
|
|
||||||
["csv", "csv"],
|
|
||||||
]),
|
|
||||||
"extension"
|
|
||||||
);
|
|
||||||
this.appendStatementInput("SD").setCheck(null);
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sd_open_file_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
||||||
this.setHelpUrl("https://docs.sensebox.de/hardware/bee-sd/");
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_sd_create_file"] = {
|
Blockly.Blocks['sensebox_sd_create_file'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_sd_create_file)
|
.appendField(Blockly.Msg.senseBox_sd_create_file)
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
|
.appendField(Blockly.Msg.senseBox_output_filename)
|
||||||
.appendField(
|
.appendField(
|
||||||
new Blockly.FieldTextInput("Data", checkFileName),
|
new Blockly.FieldTextInput('Data.txt'),
|
||||||
"Filename"
|
'Filename');
|
||||||
)
|
|
||||||
.appendField(".")
|
|
||||||
.appendField(
|
|
||||||
new Blockly.FieldDropdown([
|
|
||||||
["txt", "txt"],
|
|
||||||
["csv", "csv"],
|
|
||||||
]),
|
|
||||||
"extension"
|
|
||||||
);
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sd_create_file_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
||||||
this.setHelpUrl("https://docs.sensebox.de/hardware/bee-sd/");
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_sd_write_file"] = {
|
Blockly.Blocks['sensebox_sd_write_file'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_sd_write_file)
|
.appendField(Blockly.Msg.senseBox_sd_write_file)
|
||||||
.setAlign(Blockly.ALIGN_LEFT);
|
.setAlign(Blockly.ALIGN_LEFT);
|
||||||
this.appendValueInput("DATA").setCheck(null);
|
this.appendValueInput('DATA')
|
||||||
this.appendDummyInput("CheckboxText")
|
.setCheck(null);
|
||||||
|
this.appendDummyInput('CheckboxText')
|
||||||
.appendField(Blockly.Msg.senseBox_output_linebreak)
|
.appendField(Blockly.Msg.senseBox_output_linebreak)
|
||||||
.appendField(new Blockly.FieldCheckbox("TRUE"), "linebreak");
|
.appendField(new Blockly.FieldCheckbox('TRUE'), 'linebreak');
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sd_write_file_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
||||||
this.setHelpUrl("https://docs.sensebox.de/hardware/bee-sd/");
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Called whenever anything on the workspace changes.
|
* Called whenever anything on the workspace changes.
|
||||||
@@ -99,5 +76,5 @@ Blockly.Blocks["sensebox_sd_write_file"] = {
|
|||||||
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
this.setWarningText(Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
LOOP_TYPES: ["sensebox_sd_open_file"],
|
LOOP_TYPES: ['sensebox_sd_open_file'],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ Blockly.Blocks['sensebox_sensor_temp_hum'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_temp, "Temperature"], [Blockly.Msg.senseBox_hum, "Humidity"]]), "NAME");
|
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_temp, "Temperature"], [Blockly.Msg.senseBox_hum, "Humidity"]]), "NAME");
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_temp_hum_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_temp_hum_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_temp_hum_helpurl);
|
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -29,7 +29,6 @@ Blockly.Blocks['sensebox_sensor_temp_hum'] = {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_sensor_uv_light'] = {
|
Blockly.Blocks['sensebox_sensor_uv_light'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
@@ -40,8 +39,8 @@ Blockly.Blocks['sensebox_sensor_uv_light'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_light, "Illuminance"], [Blockly.Msg.senseBox_uv, "UvIntensity"]]), "NAME");
|
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_light, "Illuminance"], [Blockly.Msg.senseBox_uv, "UvIntensity"]]), "NAME");
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_uv_light_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_uv_light_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_uv_light_helpurl);
|
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -63,8 +62,8 @@ Blockly.Blocks['sensebox_sensor_bmx055_accelerometer'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_bmx055_accelerometer_range_2g, "0x3"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_4g, "0x5"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_8g, "0x8"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_16g, "0x0C"]]), "RANGE");
|
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_bmx055_accelerometer_range_2g, "0x3"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_4g, "0x5"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_8g, "0x8"], [Blockly.Msg.senseBox_bmx055_accelerometer_range_16g, "0x0C"]]), "RANGE");
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_bmx055_helpurl);
|
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -85,8 +84,8 @@ Blockly.Blocks['sensebox_sensor_sds011'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_sds011_serial1, "Serial1"], [Blockly.Msg.senseBox_sds011_serial2, "Serial2"]]), "SERIAL");
|
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_sds011_serial1, "Serial1"], [Blockly.Msg.senseBox_sds011_serial2, "Serial2"]]), "SERIAL");
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sds011_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_sds011_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_sds011_helpurl);
|
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/temp_und_luftfeuchte.html');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -111,8 +110,8 @@ Blockly.Blocks['sensebox_sensor_pressure'] = {
|
|||||||
.appendField(dropdown, "NAME");
|
.appendField(dropdown, "NAME");
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_pressure_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_pressure_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_pressure_helpurl);
|
this.setHelpUrl('https://edu.books.sensebox.de/de/projekte/diy_umweltstation/luftdruck.html');
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Parse XML to restore the number of pins available.
|
* Parse XML to restore the number of pins available.
|
||||||
@@ -176,8 +175,7 @@ Blockly.Blocks['sensebox_sensor_bme680_bsec'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "dropdown")
|
.appendField(new Blockly.FieldDropdown(dropdownOptions), "dropdown")
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
this.setOutput(true, Types.DECIMAL.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_bme_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_bme_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_bme680_helpurl)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -211,8 +209,8 @@ Blockly.Blocks['sensebox_sensor_ultrasonic_ranger'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown(
|
.appendField(new Blockly.FieldDropdown(
|
||||||
selectedBoard().digitalPins), 'ultrasonic_echo');
|
selectedBoard().digitalPins), 'ultrasonic_echo');
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
this.setOutput(true, Types.NUMBER.typeName);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_ultrasonic_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_ultrasonic_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_ultrasonic_helpurl);
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Parse XML to restore the number of pins available.
|
* Parse XML to restore the number of pins available.
|
||||||
@@ -276,8 +274,8 @@ Blockly.Blocks['sensebox_sensor_sound'] = {
|
|||||||
.appendField("Pin:")
|
.appendField("Pin:")
|
||||||
.appendField(new Blockly.FieldDropdown(selectedBoard().analogPins), "PIN")
|
.appendField(new Blockly.FieldDropdown(selectedBoard().analogPins), "PIN")
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
this.setOutput(true, Types.NUMBER.typeName);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_sound_helpurl);
|
this.setHelpUrl(Blockly.Msg.senseBox_sound_tip);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_sound_tooltip);
|
this.setTooltip('Dieser Sensor mist den Geräuschpegel.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -297,7 +295,8 @@ Blockly.Blocks['sensebox_button'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPinsButton), "PIN");
|
.appendField(new Blockly.FieldDropdown(selectedBoard().digitalPinsButton), "PIN");
|
||||||
this.setOutput(true, Types.BOOLEAN.typeName);
|
this.setOutput(true, Types.BOOLEAN.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_button_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_button_tip);
|
||||||
|
this.setHelpUrl('https://sensebox.de/books');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -310,7 +309,7 @@ Blockly.Blocks['sensebox_button'] = {
|
|||||||
|
|
||||||
Blockly.Blocks['sensebox_scd30'] = {
|
Blockly.Blocks['sensebox_scd30'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_scd_co2, "CO2"], [Blockly.Msg.senseBox_temp, "temperature"], [Blockly.Msg.senseBox_hum, "humidity"]];
|
var dropdownOptions = [[Blockly.Msg.senseBox_temp, "temperature"], [Blockly.Msg.senseBox_hum, "humidity"], [Blockly.Msg.senseBox_bme_co2, "CO2"]];
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_scd30);
|
.appendField(Blockly.Msg.senseBox_scd30);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
@@ -319,117 +318,6 @@ Blockly.Blocks['sensebox_scd30'] = {
|
|||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "dropdown")
|
.appendField(new Blockly.FieldDropdown(dropdownOptions), "dropdown")
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
this.setOutput(true, Types.NUMBER.typeName);
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_scd_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_bme_tip);
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_scd_helpurl);
|
|
||||||
},
|
|
||||||
onchange: function (e) {
|
|
||||||
var dropdown = this.getFieldValue('dropdown');
|
|
||||||
if (dropdown === 'temperature' || dropdown === 'humidity') {
|
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
|
||||||
} else if (dropdown === 'CO2') {
|
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GPS Module
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_gps'] = {
|
|
||||||
init: function () {
|
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_gps_lat, "latitude"], [Blockly.Msg.senseBox_gps_lng, "longitude"], [Blockly.Msg.senseBox_gps_alt, "altitude"], ["pDOP", "pDOP"], ["Fix Type", "fixType"]];
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("GPS Modul");
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_RIGHT)
|
|
||||||
.appendField(Blockly.Msg.senseBox_value)
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "dropdown")
|
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_gps_tooltip);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Block for Truebner STM50
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_sensor_truebner_smt50'] = {
|
|
||||||
init: function () {
|
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_ultrasonic_port_A, 'A'],
|
|
||||||
[Blockly.Msg.senseBox_ultrasonic_port_B, 'B'], [Blockly.Msg.senseBox_ultrasonic_port_C, 'C']];
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_smt50);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("Port:")
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_value)
|
|
||||||
.appendField(new Blockly.FieldDropdown([[Blockly.Msg.senseBox_temp, "temp"], [Blockly.Msg.senseBox_soil, "soil"]]), 'value')
|
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_smt50_tooltip);
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_smt50_helpurl);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DS18B20 Watertemperature
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_sensor_watertemperature'] = {
|
|
||||||
init: function () {
|
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_ultrasonic_port_A, 'A'],
|
|
||||||
[Blockly.Msg.senseBox_ultrasonic_port_B, 'B'], [Blockly.Msg.senseBox_ultrasonic_port_C, 'C']];
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_watertemperature)
|
|
||||||
.appendField("Port:")
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
|
||||||
this.setOutput(true, Types.NUMBER.typeName);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_watertemperature_tip);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Windspeed
|
|
||||||
* removed for now
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_windspeed'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_windspeed)
|
|
||||||
.appendField("Pin:")
|
|
||||||
.appendField(new Blockly.FieldDropdown(selectedBoard().analogPins), "PIN")
|
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DF Robot Soundsensor
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_soundsensor_dfrobot'] = {
|
|
||||||
init: function () {
|
|
||||||
var dropdownOptions = [[Blockly.Msg.senseBox_ultrasonic_port_A, 'A'],
|
|
||||||
[Blockly.Msg.senseBox_ultrasonic_port_B, 'B'], [Blockly.Msg.senseBox_ultrasonic_port_C, 'C']];
|
|
||||||
this.setColour(getColour().sensebox);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_soundsensor_dfrobot)
|
|
||||||
.appendField("Port:")
|
|
||||||
.appendField(new Blockly.FieldDropdown(dropdownOptions), "Port")
|
|
||||||
this.setOutput(true, Types.DECIMAL.typeName);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_soundsensor_dfrobot_tooltip);
|
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_soundsensor_dfrobot_helpurl)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -12,7 +12,6 @@ Blockly.Blocks["sensebox_telegram"] = {
|
|||||||
.appendField("telegram")
|
.appendField("telegram")
|
||||||
.appendField(new Blockly.FieldTextInput("token"), "telegram_token");
|
.appendField(new Blockly.FieldTextInput("token"), "telegram_token");
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_telegram_init_tooltip);
|
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -25,7 +24,6 @@ Blockly.Blocks["sensebox_telegram_do"] = {
|
|||||||
this.appendStatementInput("telegram_do");
|
this.appendStatementInput("telegram_do");
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_telegram_do_tooltip)
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -38,7 +36,6 @@ Blockly.Blocks["sensebox_telegram_do_on_message"] = {
|
|||||||
.appendField(Blockly.Msg.senseBox_telegram_message)
|
.appendField(Blockly.Msg.senseBox_telegram_message)
|
||||||
.appendField(new Blockly.FieldTextInput("/message"), 'telegram_message');
|
.appendField(new Blockly.FieldTextInput("/message"), 'telegram_message');
|
||||||
this.appendStatementInput("telegram_do_on_message").setCheck(null);
|
this.appendStatementInput("telegram_do_on_message").setCheck(null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_telegram_message_tooltip)
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
}
|
}
|
||||||
@@ -49,10 +46,8 @@ Blockly.Blocks["sensebox_telegram_send"] = {
|
|||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.senseBox_telegram_send);
|
this.appendDummyInput().appendField(Blockly.Msg.senseBox_telegram_send);
|
||||||
this.appendValueInput("telegram_text_to_send").setCheck(null);
|
this.appendValueInput("telegram_text_to_send").setCheck(null);
|
||||||
this.setTooltip(Blockly.Msg.senseBox_telegram_send_tooltip)
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
|
|
||||||
},
|
},
|
||||||
LOOP_TYPES: ["sensebox_telegram_do_on_message"]
|
LOOP_TYPES: ["sensebox_telegram_do_on_message"]
|
||||||
};
|
};
|
||||||
@@ -3,7 +3,7 @@ import { getColour } from '../helpers/colour'
|
|||||||
|
|
||||||
Blockly.Blocks['sensebox_wifi'] = {
|
Blockly.Blocks['sensebox_wifi'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_wifi_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_wifi_tip);
|
||||||
this.setHelpUrl('');
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
@@ -16,7 +16,6 @@ Blockly.Blocks['sensebox_wifi'] = {
|
|||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField(Blockly.Msg.senseBox_output_password)
|
.appendField(Blockly.Msg.senseBox_output_password)
|
||||||
.appendField(new Blockly.FieldTextInput("Password"), "Password");
|
.appendField(new Blockly.FieldTextInput("Password"), "Password");
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_wifi_helpurl)
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
},
|
},
|
||||||
@@ -44,7 +43,7 @@ Blockly.Blocks['sensebox_wifi'] = {
|
|||||||
|
|
||||||
Blockly.Blocks['sensebox_startap'] = {
|
Blockly.Blocks['sensebox_startap'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_wifi_startap_tooltip);
|
this.setTooltip(Blockly.Msg.senseBox_wifi_tip);
|
||||||
this.setHelpUrl('');
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().sensebox);
|
this.setColour(getColour().sensebox);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
@@ -53,7 +52,6 @@ Blockly.Blocks['sensebox_startap'] = {
|
|||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField(Blockly.Msg.senseBox_wifi_ssid)
|
.appendField(Blockly.Msg.senseBox_wifi_ssid)
|
||||||
.appendField(new Blockly.FieldTextInput("SSID"), "SSID");
|
.appendField(new Blockly.FieldTextInput("SSID"), "SSID");
|
||||||
this.setHelpUrl(Blockly.Msg.senseBox_wifi_helpurl)
|
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,75 +8,80 @@
|
|||||||
* The arduino built in functions syntax can be found in
|
* The arduino built in functions syntax can be found in
|
||||||
* http://arduino.cc/en/Reference/HomePage
|
* http://arduino.cc/en/Reference/HomePage
|
||||||
*/
|
*/
|
||||||
import Blockly from "blockly";
|
import Blockly from 'blockly';
|
||||||
import { getColour } from "../helpers/colour";
|
import { getColour } from '../helpers/colour'
|
||||||
import * as Types from "../helpers/types";
|
import * as Types from '../helpers/types'
|
||||||
|
|
||||||
Blockly.Blocks["time_delay"] = {
|
|
||||||
|
Blockly.Blocks['time_delay'] = {
|
||||||
/**
|
/**
|
||||||
* Delay block definition
|
* Delay block definition
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setHelpUrl("http://arduino.cc/en/Reference/Delay");
|
this.setHelpUrl('http://arduino.cc/en/Reference/Delay');
|
||||||
this.setColour(getColour().time);
|
this.setColour(getColour().time);
|
||||||
this.appendValueInput("DELAY_TIME_MILI")
|
this.appendValueInput('DELAY_TIME_MILI')
|
||||||
.setCheck(Types.NUMBER.checkList)
|
.setCheck(Types.NUMBER.checkList)
|
||||||
.appendField(Blockly.Msg.ARD_TIME_DELAY);
|
.appendField(Blockly.Msg.ARD_TIME_DELAY);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MS);
|
this.appendDummyInput()
|
||||||
|
.appendField(Blockly.Msg.ARD_TIME_MS);
|
||||||
this.setInputsInline(true);
|
this.setInputsInline(true);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_DELAY_TIP);
|
this.setTooltip(Blockly.Msg.ARD_TIME_DELAY_TIP);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["time_delaymicros"] = {
|
Blockly.Blocks['time_delaymicros'] = {
|
||||||
/**
|
/**
|
||||||
* delayMicroseconds block definition
|
* delayMicroseconds block definition
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setHelpUrl("http://arduino.cc/en/Reference/DelayMicroseconds");
|
this.setHelpUrl('http://arduino.cc/en/Reference/DelayMicroseconds');
|
||||||
this.setColour(getColour().time);
|
this.setColour(getColour().time);
|
||||||
this.appendValueInput("DELAY_TIME_MICRO")
|
this.appendValueInput('DELAY_TIME_MICRO')
|
||||||
.setCheck(Types.NUMBER.checkList)
|
.setCheck(Types.NUMBER.checkList)
|
||||||
.appendField(Blockly.Msg.ARD_TIME_DELAY);
|
.appendField(Blockly.Msg.ARD_TIME_DELAY);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_DELAY_MICROS);
|
this.appendDummyInput()
|
||||||
|
.appendField(Blockly.Msg.ARD_TIME_DELAY_MICROS);
|
||||||
this.setInputsInline(true);
|
this.setInputsInline(true);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_DELAY_MICRO_TIP);
|
this.setTooltip(Blockly.Msg.ARD_TIME_DELAY_MICRO_TIP);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["time_millis"] = {
|
Blockly.Blocks['time_millis'] = {
|
||||||
/**
|
/**
|
||||||
* Elapsed time in milliseconds block definition
|
* Elapsed time in milliseconds block definition
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setHelpUrl("http://arduino.cc/en/Reference/Millis");
|
this.setHelpUrl('http://arduino.cc/en/Reference/Millis');
|
||||||
this.setColour(getColour().time);
|
this.setColour(getColour().time);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MILLIS);
|
this.appendDummyInput()
|
||||||
|
.appendField(Blockly.Msg.ARD_TIME_MILLIS);
|
||||||
this.setOutput(true, Types.LARGE_NUMBER.typeId);
|
this.setOutput(true, Types.LARGE_NUMBER.typeId);
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
|
this.setTooltip(Blockly.Msg.ARD_TIME_MILLIS_TIP);
|
||||||
},
|
},
|
||||||
/** @return {string} The type of return value for the block, an integer. */
|
/** @return {string} The type of return value for the block, an integer. */
|
||||||
getBlockType: function () {
|
getBlockType: function () {
|
||||||
return Blockly.Types.LARGE_NUMBER;
|
return Blockly.Types.LARGE_NUMBER;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["time_micros"] = {
|
Blockly.Blocks['time_micros'] = {
|
||||||
/**
|
/**
|
||||||
* Elapsed time in microseconds block definition
|
* Elapsed time in microseconds block definition
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setHelpUrl("http://arduino.cc/en/Reference/Micros");
|
this.setHelpUrl('http://arduino.cc/en/Reference/Micros');
|
||||||
this.setColour(getColour().time);
|
this.setColour(getColour().time);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_MICROS);
|
this.appendDummyInput()
|
||||||
|
.appendField(Blockly.Msg.ARD_TIME_MICROS);
|
||||||
this.setOutput(true, Types.LARGE_NUMBER.typeId);
|
this.setOutput(true, Types.LARGE_NUMBER.typeId);
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP);
|
this.setTooltip(Blockly.Msg.ARD_TIME_MICROS_TIP);
|
||||||
},
|
},
|
||||||
@@ -86,40 +91,40 @@ Blockly.Blocks["time_micros"] = {
|
|||||||
*/
|
*/
|
||||||
getBlockType: function () {
|
getBlockType: function () {
|
||||||
return Types.LARGE_NUMBER;
|
return Types.LARGE_NUMBER;
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["infinite_loop"] = {
|
Blockly.Blocks['infinite_loop'] = {
|
||||||
/**
|
/**
|
||||||
* Waits forever, end of program.
|
* Waits forever, end of program.
|
||||||
* @this Blockly.Block
|
* @this Blockly.Block
|
||||||
*/
|
*/
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setHelpUrl("");
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().time);
|
this.setColour(getColour().time);
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.ARD_TIME_INF);
|
this.appendDummyInput()
|
||||||
|
.appendField(Blockly.Msg.ARD_TIME_INF);
|
||||||
this.setInputsInline(true);
|
this.setInputsInline(true);
|
||||||
this.setPreviousStatement(true);
|
this.setPreviousStatement(true);
|
||||||
this.setTooltip(Blockly.Msg.ARD_TIME_INF_TIP);
|
this.setTooltip(Blockly.Msg.ARD_TIME_INF_TIP);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Blocks["sensebox_interval_timer"] = {
|
Blockly.Blocks['sensebox_interval_timer'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setTooltip(Blockly.Msg.senseBox_interval_timer_tip);
|
this.setTooltip(Blockly.Msg.senseBox_interval_timer_tip);
|
||||||
this.setInputsInline(true);
|
this.setInputsInline(true);
|
||||||
this.setHelpUrl("");
|
this.setHelpUrl('');
|
||||||
this.setColour(getColour().time);
|
this.setColour(getColour().time);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_interval_timer)
|
.appendField(Blockly.Msg.senseBox_interval_timer);
|
||||||
.appendField(new Blockly.FieldTextInput("name"), "name");
|
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField(Blockly.Msg.senseBox_interval_time)
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
.setAlign(Blockly.ALIGN_LEFT)
|
||||||
.appendField(new Blockly.FieldTextInput("10000"), "interval")
|
.appendField(new Blockly.FieldTextInput("10000"), "interval")
|
||||||
.appendField(Blockly.Msg.senseBox_interval);
|
.appendField(Blockly.Msg.senseBox_interval);
|
||||||
this.appendStatementInput("DO").setCheck(null);
|
this.appendStatementInput('DO')
|
||||||
|
.setCheck(null);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,43 +1,43 @@
|
|||||||
import Blockly from "blockly/core";
|
import Blockly from 'blockly/core';
|
||||||
import { getColour } from "../helpers/colour";
|
import { getColour } from '../helpers/colour';
|
||||||
import { getCompatibleTypes } from "../helpers/types";
|
import { getCompatibleTypes } from '../helpers/types'
|
||||||
|
|
||||||
Blockly.Blocks["variables_set_dynamic"] = {
|
|
||||||
|
Blockly.Blocks['variables_set_dynamic'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
|
|
||||||
// const type = myVar.type;
|
// const type = myVar.type;
|
||||||
this.setColour(getColour().variables);
|
this.setColour(getColour().variables);
|
||||||
this.setPreviousStatement(true, null);
|
this.setPreviousStatement(true, null);
|
||||||
this.setNextStatement(true, null);
|
this.setNextStatement(true, null);
|
||||||
this.appendValueInput("VALUE")
|
this.appendValueInput('VALUE')
|
||||||
.appendField("set", "set")
|
.appendField('set', 'set')
|
||||||
.appendField("", "type")
|
.appendField('', 'type')
|
||||||
.appendField(new Blockly.FieldVariable("VAR"), "VAR")
|
.appendField(new Blockly.FieldVariable('VAR'), 'VAR')
|
||||||
.appendField("to");
|
.appendField('to');
|
||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
let variableID = this.getFieldValue("VAR");
|
let variableID = this.getFieldValue('VAR');
|
||||||
let variable = Blockly.getMainWorkspace()
|
let variable = Blockly.getMainWorkspace().getVariableMap().getVariableById(variableID)
|
||||||
.getVariableMap()
|
this.getField('type').setValue(variable.type);
|
||||||
.getVariableById(variableID);
|
this.getInput('VALUE').setCheck(getCompatibleTypes(variable.type));
|
||||||
this.getField("type").setValue(variable.type);
|
|
||||||
this.getInput("VALUE").setCheck(getCompatibleTypes(variable.type));
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks["variables_get_dynamic"] = {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Blockly.Blocks['variables_get_dynamic'] = {
|
||||||
init: function () {
|
init: function () {
|
||||||
this.setColour(getColour().variables);
|
this.setColour(getColour().variables);
|
||||||
this.appendDummyInput()
|
this.appendDummyInput()
|
||||||
.appendField("", "type")
|
.appendField('', 'type')
|
||||||
.appendField(new Blockly.FieldVariable("VAR"), "VAR");
|
.appendField(new Blockly.FieldVariable('VAR'), 'VAR');
|
||||||
this.setOutput(true);
|
this.setOutput(true);
|
||||||
},
|
},
|
||||||
onchange: function (e) {
|
onchange: function (e) {
|
||||||
let variableID = this.getFieldValue("VAR");
|
let variableID = this.getFieldValue('VAR');
|
||||||
let variable = Blockly.getMainWorkspace()
|
let variable = Blockly.getMainWorkspace().getVariableMap().getVariableById(variableID)
|
||||||
.getVariableMap()
|
this.getField('type').setValue(variable.type);
|
||||||
.getVariableById(variableID);
|
|
||||||
this.getField("type").setValue(variable.type);
|
}
|
||||||
this.setOutput(true, variable.type);
|
}
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,334 +0,0 @@
|
|||||||
import Blockly from 'blockly/core';
|
|
||||||
import { getColour } from '../helpers/colour';
|
|
||||||
import { getCompatibleTypes } from '../helpers/types'
|
|
||||||
import * as Types from '../helpers/types';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Webserver Blocks By Lucas Steinmann
|
|
||||||
* */
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_initialize_http_server'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_init_http_server_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_init_http_server);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField("Port")
|
|
||||||
.appendField(new Blockly.FieldNumber(80), "Port");
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
},
|
|
||||||
onchange: function (e) {
|
|
||||||
// Is the block nested in a loop?
|
|
||||||
var block = this;
|
|
||||||
do {
|
|
||||||
if (this.LOOP_TYPES.indexOf(block.type) !== -1) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
block = block.getSurroundParent();
|
|
||||||
} while (block);
|
|
||||||
},
|
|
||||||
LOOP_TYPES: ['arduino_functions'],
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_http_on_client_connect'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_on_client_connect_tip);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.senseBox_http_on_client_connect);
|
|
||||||
this.appendStatementInput('ON_CONNECT');
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_http_method'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_method)
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_method_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
},
|
|
||||||
getBlockType: function () {
|
|
||||||
return Blockly.Types.TEXT;
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_http_uri'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_uri)
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_uri_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_http_protocol_version'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_protocol_version)
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_protocol_version_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_ip_address'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_ip_address);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_ip_address_tip);
|
|
||||||
this.setHelpUrl('');
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_http_user_agent'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_user_agent)
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_user_agent_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_generate_html_doc'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_html_document);
|
|
||||||
this.appendValueInput('HEADER')
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.setCheck(getCompatibleTypes('String'))
|
|
||||||
.appendField(Blockly.Msg.senseBox_html_header);
|
|
||||||
this.appendValueInput('BODY')
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.setCheck(getCompatibleTypes('String'))
|
|
||||||
.appendField(Blockly.Msg.senseBox_html_body);
|
|
||||||
this.setInputsInline(false);
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_html_document_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_generate_http_succesful_response'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_success);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_success_l2);
|
|
||||||
this.appendValueInput('CONTENT')
|
|
||||||
.appendField(Blockly.Msg.senseBox_http_success_buildhtml)
|
|
||||||
.setCheck(getCompatibleTypes('String'));
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_success_tip);
|
|
||||||
this.setInputsInline(false);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_generate_http_not_found_response'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput().appendField(Blockly.Msg.senseBox_http_not_found);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_http_not_found_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
this.setPreviousStatement(true, null);
|
|
||||||
this.setNextStatement(true, null);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_general_html_tag'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_html_general_tag_tip);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("<")
|
|
||||||
.appendField(new Blockly.FieldTextInput("Tag"), "TAG")
|
|
||||||
.appendField(">");
|
|
||||||
this.appendValueInput('DO0')
|
|
||||||
.setCheck(getCompatibleTypes('String'));
|
|
||||||
this.setInputsInline(false);
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
this.setPreviousStatement(false);
|
|
||||||
this.setNextStatement(false);
|
|
||||||
this.setMutator(new Blockly.Mutator(['additional_child']));
|
|
||||||
this.additionalChildCount_ = 0;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Create XML to represent the number of else-if and else inputs.
|
|
||||||
* @return {Element} XML storage element.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
mutationToDom: function () {
|
|
||||||
if (!this.additionalChildCount_) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
var container = document.createElement('mutation');
|
|
||||||
if (this.additionalChildCount_) {
|
|
||||||
container.setAttribute('add_child', this.additionalChildCount_);
|
|
||||||
}
|
|
||||||
return container;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Parse XML to restore the else-if and else inputs.
|
|
||||||
* @param {!Element} xmlElement XML storage element.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
domToMutation: function (xmlElement) {
|
|
||||||
this.additionalChildCount_ = parseInt(xmlElement.getAttribute('add_child'), 10) || 0;
|
|
||||||
this.updateShape_();
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Populate the mutator's dialog with this block's components.
|
|
||||||
* @param {!Blockly.Workspace} workspace Mutator's workspace.
|
|
||||||
* @return {!Blockly.Block} Root block in mutator.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
decompose: function (workspace) {
|
|
||||||
var containerBlock = workspace.newBlock('first_child');
|
|
||||||
containerBlock.initSvg();
|
|
||||||
var connection = containerBlock.nextConnection;
|
|
||||||
for (var i = 1; i <= this.additionalChildCount_; i++) {
|
|
||||||
var elseifBlock = workspace.newBlock('additional_child');
|
|
||||||
elseifBlock.initSvg();
|
|
||||||
connection.connect(elseifBlock.previousConnection);
|
|
||||||
connection = elseifBlock.nextConnection;
|
|
||||||
}
|
|
||||||
return containerBlock;
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Reconfigure this block based on the mutator dialog's components.
|
|
||||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
compose: function (containerBlock) {
|
|
||||||
var clauseBlock = containerBlock.nextConnection.targetBlock();
|
|
||||||
// Count number of inputs.
|
|
||||||
this.additionalChildCount_ = 0;
|
|
||||||
var statementConnections = [null];
|
|
||||||
while (clauseBlock) {
|
|
||||||
switch (clauseBlock.type) {
|
|
||||||
case 'additional_child':
|
|
||||||
this.additionalChildCount_++;
|
|
||||||
statementConnections.push(clauseBlock.statementConnection_);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error("Unknown block type.");
|
|
||||||
}
|
|
||||||
clauseBlock = clauseBlock.nextConnection &&
|
|
||||||
clauseBlock.nextConnection.targetBlock();
|
|
||||||
}
|
|
||||||
this.updateShape_();
|
|
||||||
// Reconnect any child blocks.
|
|
||||||
for (var i = 1; i <= this.additionalChildCount_; i++) {
|
|
||||||
Blockly.Mutator.reconnect(statementConnections[i], this, 'DO' + i);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Store pointers to any connected child blocks.
|
|
||||||
* @param {!Blockly.Block} containerBlock Root block in mutator.
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
saveConnections: function (containerBlock) {
|
|
||||||
var clauseBlock = containerBlock.nextConnection.targetBlock();
|
|
||||||
var i = 1;
|
|
||||||
while (clauseBlock) {
|
|
||||||
switch (clauseBlock.type) {
|
|
||||||
case 'additional_child':
|
|
||||||
var inputDo = this.getInput('DO' + i);
|
|
||||||
clauseBlock.statementConnection_ =
|
|
||||||
inputDo && inputDo.connection.targetConnection;
|
|
||||||
i++;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new Error('Unknown block type.');
|
|
||||||
}
|
|
||||||
clauseBlock = clauseBlock.nextConnection &&
|
|
||||||
clauseBlock.nextConnection.targetBlock();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
* Modify this block to have the correct number of inputs.
|
|
||||||
* @private
|
|
||||||
* @this Blockly.Block
|
|
||||||
*/
|
|
||||||
updateShape_: function () {
|
|
||||||
// Delete everything.
|
|
||||||
var i = 1;
|
|
||||||
while (this.getInput('DO' + i)) {
|
|
||||||
this.removeInput('DO' + i);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
// Rebuild block.
|
|
||||||
for (i = 1; i <= this.additionalChildCount_; i++) {
|
|
||||||
this.appendValueInput('DO' + i, Blockly.Arduino.ORDER_NONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Blocks['first_child'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("<Tag>");
|
|
||||||
this.setNextStatement(true);
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_tag_first_mutator_tip);
|
|
||||||
this.contextMenu = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Blocks['additional_child'] = {
|
|
||||||
init: function () {
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField("<Tag>");
|
|
||||||
this.setPreviousStatement(true);
|
|
||||||
this.setInputsInline(true);
|
|
||||||
this.setNextStatement(true);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_tag_optional_mutator_tip);
|
|
||||||
this.contextMenu = false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// Additional Webserver Blocks
|
|
||||||
|
|
||||||
Blockly.Blocks['sensebox_web_readHTML'] = {
|
|
||||||
init: function () {
|
|
||||||
this.appendDummyInput()
|
|
||||||
.appendField(Blockly.Msg.senseBox_sd_web_readHTML)
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT);
|
|
||||||
this.appendDummyInput()
|
|
||||||
.setAlign(Blockly.ALIGN_LEFT)
|
|
||||||
.appendField(Blockly.Msg.sensebox_web_readHTML_filename)
|
|
||||||
.appendField(new Blockly.FieldTextInput("index.txt"), "FILENAME");
|
|
||||||
this.setOutput(true, Types.TEXT.typeName);
|
|
||||||
this.setColour(getColour().webserver);
|
|
||||||
this.setTooltip(Blockly.Msg.senseBox_output_safetosd_tip);
|
|
||||||
this.setHelpUrl('https://sensebox.de/books');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -44,7 +44,7 @@ Blockly['Arduino'].addReservedWords(
|
|||||||
'setup,loop,if,else,for,switch,case,while,' +
|
'setup,loop,if,else,for,switch,case,while,' +
|
||||||
'do,break,continue,return,goto,define,include,' +
|
'do,break,continue,return,goto,define,include,' +
|
||||||
'HIGH,LOW,INPUT,OUTPUT,INPUT_PULLUP,true,false,' +
|
'HIGH,LOW,INPUT,OUTPUT,INPUT_PULLUP,true,false,' +
|
||||||
'interger, constants,floating,point,void,boolean,char,' +
|
'interger, constants,floating,point,void,bookean,char,' +
|
||||||
'unsigned,byte,int,word,long,float,double,string,String,array,' +
|
'unsigned,byte,int,word,long,float,double,string,String,array,' +
|
||||||
'static, volatile,const,sizeof,pinMode,digitalWrite,digitalRead,' +
|
'static, volatile,const,sizeof,pinMode,digitalWrite,digitalRead,' +
|
||||||
'analogReference,analogRead,analogWrite,tone,noTone,shiftOut,shitIn,' +
|
'analogReference,analogRead,analogWrite,tone,noTone,shiftOut,shitIn,' +
|
||||||
@@ -106,9 +106,6 @@ Blockly['Arduino'].init = function (workspace) {
|
|||||||
// creates a list of code to be setup before the setup block
|
// creates a list of code to be setup before the setup block
|
||||||
Blockly['Arduino'].setupCode_ = Object.create(null);
|
Blockly['Arduino'].setupCode_ = Object.create(null);
|
||||||
|
|
||||||
// creates a list of code to be setup before the setup block
|
|
||||||
Blockly['Arduino'].loraSetupCode_ = Object.create(null);
|
|
||||||
|
|
||||||
// creates a list of code for the loop to be runned once
|
// creates a list of code for the loop to be runned once
|
||||||
Blockly['Arduino'].loopCodeOnce_ = Object.create(null)
|
Blockly['Arduino'].loopCodeOnce_ = Object.create(null)
|
||||||
|
|
||||||
@@ -205,7 +202,6 @@ Blockly['Arduino'].finish = function (code) {
|
|||||||
let loopCodeOnce = '';
|
let loopCodeOnce = '';
|
||||||
let setupCode = '';
|
let setupCode = '';
|
||||||
let preSetupCode = '';
|
let preSetupCode = '';
|
||||||
let loraSetupCode = '';
|
|
||||||
let devVariables = '\n';
|
let devVariables = '\n';
|
||||||
|
|
||||||
for (const key in Blockly['Arduino'].libraries_) {
|
for (const key in Blockly['Arduino'].libraries_) {
|
||||||
@@ -237,13 +233,7 @@ Blockly['Arduino'].finish = function (code) {
|
|||||||
for (const key in Blockly['Arduino'].setupCode_) {
|
for (const key in Blockly['Arduino'].setupCode_) {
|
||||||
preSetupCode += Blockly['Arduino'].setupCode_[key] || '';
|
preSetupCode += Blockly['Arduino'].setupCode_[key] || '';
|
||||||
}
|
}
|
||||||
|
setupCode = '\nvoid setup() { \n' + preSetupCode + '\n}\n';
|
||||||
for (const key in Blockly['Arduino'].loraSetupCode_) {
|
|
||||||
loraSetupCode += Blockly['Arduino'].loraSetupCode_[key] || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
setupCode = '\nvoid setup() { \n' + preSetupCode + '\n' + loraSetupCode + '\n}\n';
|
|
||||||
|
|
||||||
let loopCode = '\nvoid loop() { \n' + loopCodeOnce + code + '\n}\n';
|
let loopCode = '\nvoid loop() { \n' + loopCodeOnce + code + '\n}\n';
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import './sensebox-display';
|
|||||||
import './sensebox-lora';
|
import './sensebox-lora';
|
||||||
import './sensebox-led';
|
import './sensebox-led';
|
||||||
import './sensebox-sd';
|
import './sensebox-sd';
|
||||||
import './mqtt';
|
|
||||||
import './logic';
|
import './logic';
|
||||||
import './text';
|
import './text';
|
||||||
import './math';
|
import './math';
|
||||||
@@ -18,7 +17,5 @@ import './audio';
|
|||||||
import './procedures';
|
import './procedures';
|
||||||
import './time';
|
import './time';
|
||||||
import './variables';
|
import './variables';
|
||||||
import './lists';
|
|
||||||
import './webserver';
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
import * as Blockly from 'blockly/core';
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino['lists_create_empty'] = function () {
|
|
||||||
var code = '';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
Blockly.Arduino['array_getIndex'] = function () {
|
|
||||||
var code = '';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino['lists_length'] = function () {
|
|
||||||
var array = Blockly.Arduino.valueToCode(this, 'ARRAY', Blockly.Arduino.ORDER_ATOMIC);
|
|
||||||
var code = `${array}.length`;
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
@@ -74,14 +74,14 @@ Blockly.Arduino['controls_if'] = function (Block) {
|
|||||||
conditionCode +
|
conditionCode +
|
||||||
') {\n' +
|
') {\n' +
|
||||||
branchCode +
|
branchCode +
|
||||||
'}\n';
|
'}';
|
||||||
|
|
||||||
++n;
|
++n;
|
||||||
} while (Block.getInput('IF' + n));
|
} while (Block.getInput('IF' + n));
|
||||||
|
|
||||||
if (Block.getInput('ELSE')) {
|
if (Block.getInput('ELSE')) {
|
||||||
branchCode = Blockly.Arduino.statementToCode(Block, 'ELSE');
|
branchCode = Blockly.Arduino.statementToCode(Block, 'ELSE');
|
||||||
code += ' else {\n' + branchCode + '}\n';
|
code += ' else {\n' + branchCode + '}';
|
||||||
}
|
}
|
||||||
return code + '\n';
|
return code + '\n';
|
||||||
};
|
};
|
||||||
@@ -106,14 +106,14 @@ Blockly.Arduino['controls_ifelse'] = function (Block) {
|
|||||||
conditionCode +
|
conditionCode +
|
||||||
') {\n' +
|
') {\n' +
|
||||||
branchCode +
|
branchCode +
|
||||||
'}\n';
|
'}';
|
||||||
|
|
||||||
++n;
|
++n;
|
||||||
} while (Block.getInput('IF' + n));
|
} while (Block.getInput('IF' + n));
|
||||||
|
|
||||||
if (Block.getInput('ELSE')) {
|
if (Block.getInput('ELSE')) {
|
||||||
branchCode = Blockly.Arduino.statementToCode(Block, 'ELSE');
|
branchCode = Blockly.Arduino.statementToCode(Block, 'ELSE');
|
||||||
code += ' else {\n' + branchCode + '}\n';
|
code += ' else {\n' + branchCode + '}';
|
||||||
}
|
}
|
||||||
return code + '\n';
|
return code + '\n';
|
||||||
}
|
}
|
||||||
@@ -127,6 +127,9 @@ Blockly.Arduino['logic_negate'] = function (Block) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino['switch_case'] = function (block) {
|
Blockly.Arduino['switch_case'] = function (block) {
|
||||||
var n = 0;
|
var n = 0;
|
||||||
var argument = Blockly.Arduino.valueToCode(this, 'CONDITION',
|
var argument = Blockly.Arduino.valueToCode(this, 'CONDITION',
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
import * as Blockly from 'blockly/core';
|
|
||||||
/**
|
|
||||||
* MQTT Blocks
|
|
||||||
*/
|
|
||||||
|
|
||||||
let service;
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_mqtt_setup = function () {
|
|
||||||
var server = this.getFieldValue('server');
|
|
||||||
var port = this.getFieldValue('port');
|
|
||||||
var username = this.getFieldValue('username');
|
|
||||||
var pass = this.getFieldValue('password');
|
|
||||||
service = this.getFieldValue('service');
|
|
||||||
Blockly.Arduino.libraries_['library_senseBoxMCU'] = '#include "SenseBoxMCU.h"';
|
|
||||||
Blockly.Arduino.libraries_['library_adafruitmqtt'] = '#include "Adafruit_MQTT.h"';
|
|
||||||
Blockly.Arduino.libraries_['library_adafruitmqttclient'] = '#include "Adafruit_MQTT_Client.h"';
|
|
||||||
Blockly.Arduino.definitions_['mqtt_server'] = '#define SERVER "' + server + '"';
|
|
||||||
Blockly.Arduino.definitions_['mqtt_port'] = '#define SERVERPORT ' + port + '';
|
|
||||||
Blockly.Arduino.definitions_['mqtt_username'] = '#define USERNAME "' + username + '"';
|
|
||||||
Blockly.Arduino.definitions_['mqtt_pass'] = '#define PASS "' + pass + '"';
|
|
||||||
Blockly.Arduino.definitions_['wifi_client'] = 'WiFiClient client;';
|
|
||||||
Blockly.Arduino.definitions_['mqtt_client'] = 'Adafruit_MQTT_Client mqtt(&client, SERVER, SERVERPORT, USERNAME, PASS);'
|
|
||||||
var code = '';
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_mqtt_publish = function (block) {
|
|
||||||
var feedname = this.getFieldValue('publishfeed');
|
|
||||||
var res = feedname.split("/");
|
|
||||||
var feed_client = res[res.length - 1];
|
|
||||||
var value = Blockly.Arduino.valueToCode(this, 'value', Blockly.Arduino.ORDER_ATOMIC) || '"No Block connected"';
|
|
||||||
|
|
||||||
switch (service) {
|
|
||||||
case 'adafruitio':
|
|
||||||
Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, USERNAME "/feeds/' + feedname + '");'
|
|
||||||
break;
|
|
||||||
case 'dioty':
|
|
||||||
Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, "/"USERNAME"/' + feedname + '");'
|
|
||||||
break;
|
|
||||||
case 'custom':
|
|
||||||
Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, "' + feedname + '");'
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Publish ' + feed_client + ' = Adafruit_MQTT_Publish(&mqtt, USERNAME "/feeds/' + feedname + '");'
|
|
||||||
Blockly.Arduino.codeFunctions_['mqtt_connect_function'] = `// Function to connect and reconnect as necessary to the MQTT server.
|
|
||||||
// Should be called in the loop function and it will take care if connecting.
|
|
||||||
void MQTT_connect() {
|
|
||||||
int8_t ret;
|
|
||||||
// Stop if already connected.
|
|
||||||
if (mqtt.connected()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
while ((ret = mqtt.connect()) != 0) { // connect will return 0 for connected
|
|
||||||
mqtt.disconnect();
|
|
||||||
delay(5000); // wait 5 seconds
|
|
||||||
}
|
|
||||||
}`;
|
|
||||||
Blockly.Arduino.loopCodeOnce_['mqtt_connect'] = 'MQTT_connect();';
|
|
||||||
var code = '' + feed_client + '.publish(' + value + ');';
|
|
||||||
return code
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_mqtt_subscribe = function (block) {
|
|
||||||
var feedname = this.getFieldValue('subscribefeed');
|
|
||||||
var x = 5, feed_client;
|
|
||||||
feed_client = feedname.substr(feedname.length - x, x);
|
|
||||||
Blockly.Arduino.definitions_['mqtt_' + feed_client + ''] = 'Adafruit_MQTT_Subscribe ' + feed_client + '= Adafruit_MQTT_Subscribe(&mqtt,' + feedname + ');';
|
|
||||||
Blockly.Arduino.codeFunctions_['mqtt_' + feed_client + 'callbackFunction'] = `void ` + feed_client + `Callback (double x){
|
|
||||||
Serial.println(x);
|
|
||||||
}`;
|
|
||||||
Blockly.Arduino.setupCode_['mqtt_' + feed_client + '_callback'] = '' + feed_client + '.setCallback(' + feed_client + 'Callback);';
|
|
||||||
Blockly.Arduino.setupCode_['mqtt_' + feed_client + '_subscribe'] = 'mqtt.subscribe(&' + feed_client + ');';
|
|
||||||
Blockly.Arduino.loopCodeOnce_['mqtt_processPackages'] = 'mqtt.processPackets(10);';
|
|
||||||
var code = '';
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
@@ -28,101 +28,3 @@ Blockly.Arduino['arduino_functions'] = function (block) {
|
|||||||
//var loopcode = Blockly.Arduino.scrub_(block, loopBranch); No comment block
|
//var loopcode = Blockly.Arduino.scrub_(block, loopBranch); No comment block
|
||||||
return loopBranch;
|
return loopBranch;
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Arduino['procedures_defreturn'] = function (block) {
|
|
||||||
// Define a procedure with a return value.
|
|
||||||
const funcName = Blockly.Arduino.variableDB_.getName(
|
|
||||||
block.getFieldValue('NAME'),
|
|
||||||
Blockly.Procedures.NAME_TYPE
|
|
||||||
);
|
|
||||||
const branch = Blockly.Arduino.statementToCode(block, 'STACK');
|
|
||||||
const returnType = block.getFieldValue('RETURN TYPE') || 'void';
|
|
||||||
|
|
||||||
let returnValue =
|
|
||||||
Blockly.Arduino.valueToCode(block, 'RETURN', Blockly.Arduino.ORDER_NONE) ||
|
|
||||||
'';
|
|
||||||
if (returnValue) {
|
|
||||||
returnValue = Blockly.Arduino.INDENT + 'return ' + returnValue + ';\n';
|
|
||||||
}
|
|
||||||
const args = [];
|
|
||||||
for (let i = 0; i < block.argumentVarModels_.length; i++) {
|
|
||||||
args[i] =
|
|
||||||
translateType(block.argumentVarModels_[i].type) +
|
|
||||||
' ' +
|
|
||||||
block.argumentVarModels_[i].name;
|
|
||||||
}
|
|
||||||
let code =
|
|
||||||
translateType(returnType) +
|
|
||||||
' ' +
|
|
||||||
funcName +
|
|
||||||
'(' +
|
|
||||||
args.join(', ') +
|
|
||||||
') {\n' +
|
|
||||||
branch +
|
|
||||||
returnValue +
|
|
||||||
'}';
|
|
||||||
code = Blockly.Arduino.scrub_(block, code);
|
|
||||||
// Add % so as not to collide with helper functions in definitions list.
|
|
||||||
Blockly.Arduino.functionNames_['%' + funcName] = code;
|
|
||||||
return null;
|
|
||||||
};
|
|
||||||
|
|
||||||
function translateType(type) {
|
|
||||||
console.log(type);
|
|
||||||
switch (type) {
|
|
||||||
|
|
||||||
case 'int':
|
|
||||||
return 'int';
|
|
||||||
case 'String':
|
|
||||||
return 'String';
|
|
||||||
case 'void':
|
|
||||||
return 'void';
|
|
||||||
case 'boolean':
|
|
||||||
return 'boolean';
|
|
||||||
case 'float':
|
|
||||||
return 'float'
|
|
||||||
default:
|
|
||||||
throw new Error('Invalid Parameter Type');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Blockly.Arduino['procedures_defnoreturn'] =
|
|
||||||
Blockly.Arduino['procedures_defreturn'];
|
|
||||||
|
|
||||||
Blockly.Arduino['procedures_callreturn'] = function (block) {
|
|
||||||
// Call a procedure with a return value.
|
|
||||||
const funcName = Blockly.Arduino.variableDB_.getName(
|
|
||||||
block.getFieldValue('NAME'),
|
|
||||||
Blockly.Procedures.NAME_TYPE
|
|
||||||
);
|
|
||||||
const args = [];
|
|
||||||
for (let i = 0; i < block.arguments_.length; i++) {
|
|
||||||
args[i] =
|
|
||||||
Blockly.Arduino.valueToCode(
|
|
||||||
block,
|
|
||||||
'ARG' + i,
|
|
||||||
Blockly.Arduino.ORDER_COMMA
|
|
||||||
) || 'null';
|
|
||||||
}
|
|
||||||
const code = funcName + '(' + args.join(', ') + ')';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino['procedures_callnoreturn'] = function (block) {
|
|
||||||
// Call a procedure with no return value.
|
|
||||||
const funcName = Blockly.Arduino.variableDB_.getName(
|
|
||||||
block.getFieldValue('NAME'),
|
|
||||||
Blockly.Procedures.NAME_TYPE
|
|
||||||
);
|
|
||||||
const args = [];
|
|
||||||
for (let i = 0; i < block.arguments_.length; i++) {
|
|
||||||
args[i] =
|
|
||||||
Blockly.Arduino.valueToCode(
|
|
||||||
block,
|
|
||||||
'ARG' + i,
|
|
||||||
Blockly.Arduino.ORDER_COMMA
|
|
||||||
) || 'null';
|
|
||||||
}
|
|
||||||
|
|
||||||
return funcName + '(' + args.join(', ') + ');\n';
|
|
||||||
};
|
|
||||||
@@ -19,10 +19,10 @@ Blockly.Arduino.sensebox_display_clearDisplay = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_display_printDisplay = function () {
|
Blockly.Arduino.sensebox_display_printDisplay = function () {
|
||||||
var x = this.getFieldValue('X');
|
var x = Blockly.Arduino.valueToCode(this, 'X', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||||
var y = this.getFieldValue('Y');
|
var y = Blockly.Arduino.valueToCode(this, 'Y', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
||||||
var printDisplay = Blockly.Arduino.valueToCode(this, 'printDisplay', Blockly.Arduino.ORDER_ATOMIC) || '"Keine Eingabe"';
|
var printDisplay = Blockly.Arduino.valueToCode(this, 'printDisplay', Blockly.Arduino.ORDER_ATOMIC) || '"Keine Eingabe"';
|
||||||
var size = this.getFieldValue('SIZE');
|
var size = Blockly.Arduino.valueToCode(this, 'SIZE', Blockly.Arduino.ORDER_ATOMIC) || '1'
|
||||||
var color = this.getFieldValue('COLOR');
|
var color = this.getFieldValue('COLOR');
|
||||||
var code = 'display.setCursor(' + x + ',' + y + ');\n';
|
var code = 'display.setCursor(' + x + ',' + y + ');\n';
|
||||||
code += 'display.setTextSize(' + size + ');\n';
|
code += 'display.setTextSize(' + size + ');\n';
|
||||||
@@ -31,42 +31,6 @@ Blockly.Arduino.sensebox_display_printDisplay = function () {
|
|||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_display_fastPrint = function () {
|
|
||||||
var title1 = Blockly.Arduino.valueToCode(this, 'Title1', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
|
||||||
var value1 = Blockly.Arduino.valueToCode(this, 'Value1', Blockly.Arduino.ORDER_ATOMIC);
|
|
||||||
var dimension1 = Blockly.Arduino.valueToCode(this, 'Dimension1', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
|
||||||
var title2 = Blockly.Arduino.valueToCode(this, 'Title2', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
|
||||||
var value2 = Blockly.Arduino.valueToCode(this, 'Value2', Blockly.Arduino.ORDER_ATOMIC);
|
|
||||||
var dimension2 = Blockly.Arduino.valueToCode(this, 'Dimension2', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
|
||||||
Blockly.Arduino.codeFunctions_['sensebox_fastPrint'] = `
|
|
||||||
void printOnDisplay(String title1, String measurement1, String unit1, String title2, String measurement2, String unit2) {
|
|
||||||
|
|
||||||
display.setCursor(0, 0);
|
|
||||||
display.setTextSize(1);
|
|
||||||
display.setTextColor(WHITE, BLACK);
|
|
||||||
display.println(title1);
|
|
||||||
display.setCursor(0, 10);
|
|
||||||
display.setTextSize(2);
|
|
||||||
display.print(measurement1);
|
|
||||||
display.print(" ");
|
|
||||||
display.setTextSize(1);
|
|
||||||
display.println(unit1);
|
|
||||||
display.setCursor(0, 30);
|
|
||||||
display.setTextSize(1);
|
|
||||||
display.println(title2);
|
|
||||||
display.setCursor(0, 40);
|
|
||||||
display.setTextSize(2);
|
|
||||||
display.print(measurement2);
|
|
||||||
display.print(" ");
|
|
||||||
display.setTextSize(1);
|
|
||||||
display.println(unit2);
|
|
||||||
}
|
|
||||||
`
|
|
||||||
var code = ` printOnDisplay(${title1}, String(${value1}), ${dimension1}, ${title2}, String(${value2}), ${dimension2});\n`;
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_display_show = function (block) {
|
Blockly.Arduino.sensebox_display_show = function (block) {
|
||||||
var show = Blockly.Arduino.statementToCode(block, 'SHOW');
|
var show = Blockly.Arduino.statementToCode(block, 'SHOW');
|
||||||
var code = '';
|
var code = '';
|
||||||
|
|||||||
@@ -10,58 +10,13 @@ Blockly.Arduino.sensebox_led = function () {
|
|||||||
|
|
||||||
Blockly.Arduino.sensebox_rgb_led = function () {
|
Blockly.Arduino.sensebox_rgb_led = function () {
|
||||||
var dropdown_pin = this.getFieldValue('PIN');
|
var dropdown_pin = this.getFieldValue('PIN');
|
||||||
var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
var red = this.getFieldValue('RED') || '0'
|
||||||
|
var green = this.getFieldValue('GREEN') || '0'
|
||||||
|
var blue = this.getFieldValue('BLUE') || '0'
|
||||||
Blockly.Arduino.libraries_['define_rgb_led' + dropdown_pin] = '#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_' + dropdown_pin + ' = Adafruit_NeoPixel(1,' + dropdown_pin + ',NEO_RGB + NEO_KHZ800);\n';
|
Blockly.Arduino.libraries_['define_rgb_led' + dropdown_pin] = '#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_' + dropdown_pin + ' = Adafruit_NeoPixel(1,' + dropdown_pin + ',NEO_RGB + NEO_KHZ800);\n';
|
||||||
Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();';
|
Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();';
|
||||||
var code = 'rgb_led_' + dropdown_pin + '.setPixelColor(0,rgb_led_' + dropdown_pin + '.Color(' + color + '));\n';
|
|
||||||
|
var code = 'rgb_led_' + dropdown_pin + '.setPixelColor(0,rgb_led_' + dropdown_pin + '.Color(' + red + ',' + green + ',' + blue + '));\n';
|
||||||
code += 'rgb_led_' + dropdown_pin + '.show();';
|
code += 'rgb_led_' + dropdown_pin + '.show();';
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_ws2818_led_init = function () {
|
|
||||||
var dropdown_pin = this.getFieldValue('Port');
|
|
||||||
var numPixel = Blockly.Arduino.valueToCode(this, 'NUMBER', Blockly.Arduino.ORDER_ATOMIC) || '1';
|
|
||||||
var brightness = Blockly.Arduino.valueToCode(this, 'BRIGHTNESS', Blockly.Arduino.ORDER_ATOMIC) || '50'
|
|
||||||
Blockly.Arduino.definitions_['define_rgb_led' + dropdown_pin] = `#include <Adafruit_NeoPixel.h>\n Adafruit_NeoPixel rgb_led_${dropdown_pin}= Adafruit_NeoPixel(${numPixel}, ${dropdown_pin},NEO_GRB + NEO_KHZ800);\n`;
|
|
||||||
Blockly.Arduino.setupCode_['setup_rgb_led' + dropdown_pin] = 'rgb_led_' + dropdown_pin + '.begin();\n';
|
|
||||||
Blockly.Arduino.setupCode_['setup_rgb_led_brightness' + dropdown_pin] = `rgb_led_${dropdown_pin}.setBrightness(${brightness});\n`;
|
|
||||||
return '';
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_ws2818_led = function () {
|
|
||||||
var dropdown_pin = this.getFieldValue('Port');
|
|
||||||
var position = Blockly.Arduino.valueToCode(this, 'POSITION', Blockly.Arduino.ORDER_ATOMIC) || '0';
|
|
||||||
var color = Blockly.Arduino.valueToCode(this, 'COLOR', Blockly.Arduino.ORDER_ATOMIC) || '0'
|
|
||||||
console.log(color)
|
|
||||||
var code = `rgb_led_${dropdown_pin}.setPixelColor(${position},rgb_led_${dropdown_pin}.Color(${color}));\nrgb_led_${dropdown_pin}.show();\n`;
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
function hexToRgb(hex) {
|
|
||||||
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
||||||
return result ? {
|
|
||||||
r: parseInt(result[1], 16),
|
|
||||||
g: parseInt(result[2], 16),
|
|
||||||
b: parseInt(result[3], 16)
|
|
||||||
} : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Blockly.Arduino['colour_picker'] = function (block) {
|
|
||||||
const rgb = hexToRgb(block.getFieldValue('COLOUR'));
|
|
||||||
|
|
||||||
return [rgb.r + ', ' + rgb.g + ', ' + rgb.b, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino['colour_random'] = function (block) {
|
|
||||||
return ['random(0, 255), random(0, 255), random(0, 255)', Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino['colour_rgb'] = function (block) {
|
|
||||||
const red = Blockly.Arduino.valueToCode(block, 'RED', Blockly.Arduino.ORDER_ATOMIC);
|
|
||||||
const green = Blockly.Arduino.valueToCode(block, 'GREEN', Blockly.Arduino.ORDER_ATOMIC);
|
|
||||||
const blue = Blockly.Arduino.valueToCode(block, 'BLUE', Blockly.Arduino.ORDER_ATOMIC);
|
|
||||||
|
|
||||||
return [red + ', ' + green + ', ' + blue, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
@@ -120,9 +120,9 @@ Blockly.Arduino.sensebox_lora_initialize_otaa = function (block) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
Blockly.Arduino.loraSetupCode_['initLora'] = 'initLora();\n';
|
Blockly.Arduino.setupCode_['initLora'] = 'initLora();';
|
||||||
Blockly.Arduino.setupCode_['serial.begin'] = 'Serial.begin(9600);\ndelay(1000);\n';
|
Blockly.Arduino.setupCode_['serial.begin'] = 'Serial.begin(9600);';
|
||||||
var code = '';
|
var code = ''
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -195,60 +195,6 @@ Blockly.Arduino.sensebox_lora_cayenne_send = function (block) {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_lora_ttn_mapper = function (block) {
|
|
||||||
var latitude = Blockly.Arduino.valueToCode(this, 'Latitude', Blockly.Arduino.ORDER_ATOMIC)
|
|
||||||
var longitude = Blockly.Arduino.valueToCode(this, 'Longitude', Blockly.Arduino.ORDER_ATOMIC)
|
|
||||||
var altitude = Blockly.Arduino.valueToCode(this, 'Altitude', Blockly.Arduino.ORDER_ATOMIC)
|
|
||||||
var pDOP = Blockly.Arduino.valueToCode(this, 'pDOP', Blockly.Arduino.ORDER_ATOMIC)
|
|
||||||
var fixType = Blockly.Arduino.valueToCode(this, 'Fix Type', Blockly.Arduino.ORDER_ATOMIC)
|
|
||||||
var fixTypeLimit = this.getFieldValue('dropdown');
|
|
||||||
Blockly.Arduino.functionNames_['functions_do_send'] = `
|
|
||||||
void do_send(osjob_t* j){
|
|
||||||
// Check if there is not a current TX/RX job running
|
|
||||||
if (LMIC.opmode & OP_TXRXPEND) {
|
|
||||||
Serial.println(F("OP_TXRXPEND, not sending"));
|
|
||||||
} else {
|
|
||||||
|
|
||||||
int fixType = ${fixType};
|
|
||||||
if (fixType >= ${fixTypeLimit}) { // we have a 3D fix
|
|
||||||
int32_t latitude = ${latitude}; // in degrees * 10^-7
|
|
||||||
int32_t longitude = ${longitude}; // in degrees * 10^-7
|
|
||||||
int32_t altitude = ${altitude} / 100; // in dm above mean sea level
|
|
||||||
uint16_t pDOP = ${pDOP}; // positional dillution of precision
|
|
||||||
|
|
||||||
uint8_t data[12];
|
|
||||||
|
|
||||||
data[0] = latitude;
|
|
||||||
data[1] = latitude >> 8;
|
|
||||||
data[2] = latitude >> 16;
|
|
||||||
data[3] = latitude >> 24;
|
|
||||||
|
|
||||||
data[4] = longitude;
|
|
||||||
data[5] = longitude >> 8;
|
|
||||||
data[6] = longitude >> 16;
|
|
||||||
data[7] = longitude >> 24;
|
|
||||||
|
|
||||||
data[8] = altitude;
|
|
||||||
data[9] = altitude >> 8;
|
|
||||||
|
|
||||||
data[10] = pDOP;
|
|
||||||
data[11] = pDOP >> 8;
|
|
||||||
|
|
||||||
|
|
||||||
// Prepare upstream data transmission at the next possible time.
|
|
||||||
LMIC_setTxData2(1, data, sizeof(data), 0);
|
|
||||||
Serial.println(F("Packet queued"));
|
|
||||||
} else {
|
|
||||||
// wait for better fix type
|
|
||||||
os_setTimedCallback(&sendjob, os_getTime() + sec2osticks(TX_INTERVAL), do_send);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Next TX is scheduled after TX_COMPLETE event.
|
|
||||||
}`;
|
|
||||||
Blockly.Arduino.loopCodeOnce_['os_runloop'] = 'os_runloop_once();'
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_lora_initialize_abp = function (block) {
|
Blockly.Arduino.sensebox_lora_initialize_abp = function (block) {
|
||||||
var nwskey = this.getFieldValue('NWSKEY');
|
var nwskey = this.getFieldValue('NWSKEY');
|
||||||
var appskey = this.getFieldValue('APPSKEY');
|
var appskey = this.getFieldValue('APPSKEY');
|
||||||
@@ -426,8 +372,8 @@ Blockly.Arduino.sensebox_lora_initialize_abp = function (block) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
Blockly.Arduino.loraSetupCode_['initLora'] = 'initLora();\n';
|
Blockly.Arduino.setupCode_['initLora'] = 'initLora();';
|
||||||
Blockly.Arduino.setupCode_['serial.begin'] = 'Serial.begin(9600);\ndelay(1000);\n';
|
Blockly.Arduino.setupCode_['serial.begin'] = 'Serial.begin(9600);';
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,20 +18,17 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
|
|||||||
var box_id = this.getFieldValue('BoxID');
|
var box_id = this.getFieldValue('BoxID');
|
||||||
var host = this.getFieldValue('host');
|
var host = this.getFieldValue('host');
|
||||||
var branch = Blockly.Arduino.statementToCode(Block, 'DO');
|
var branch = Blockly.Arduino.statementToCode(Block, 'DO');
|
||||||
var access_token = this.getFieldValue('access_token');
|
//var blocks = Blockly.Block.getDescendants;
|
||||||
var blocks = this.getDescendants();
|
|
||||||
var type = this.getFieldValue('type');
|
var type = this.getFieldValue('type');
|
||||||
var ssl = this.getFieldValue('SSL');
|
var ssl = this.getFieldValue('SSL');
|
||||||
var port = 0;
|
var port = 0;
|
||||||
var count = 0;
|
var count = 0;
|
||||||
if (blocks !== undefined) {
|
// for (var i = 0; i < blocks.length; i++) {
|
||||||
for (var i = 0; i < blocks.length; i++) {
|
// if (blocks[i].type === 'sensebox_send_to_osem') {
|
||||||
if (blocks[i].type === 'sensebox_send_to_osem') {
|
// count++;
|
||||||
count++;
|
|
||||||
|
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
var num_sensors = count;
|
var num_sensors = count;
|
||||||
Blockly.Arduino.libraries_['library_senseBoxMCU'] = '#include "SenseBoxMCU.h"';
|
Blockly.Arduino.libraries_['library_senseBoxMCU'] = '#include "SenseBoxMCU.h"';
|
||||||
Blockly.Arduino.definitions_['num_sensors'] = 'static const uint8_t NUM_SENSORS = ' + num_sensors + ';'
|
Blockly.Arduino.definitions_['num_sensors'] = 'static const uint8_t NUM_SENSORS = ' + num_sensors + ';'
|
||||||
@@ -87,7 +84,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
|
|||||||
if (connected == true) {
|
if (connected == true) {
|
||||||
// construct the HTTP POST request:
|
// construct the HTTP POST request:
|
||||||
sprintf_P(buffer,
|
sprintf_P(buffer,
|
||||||
PSTR("POST /boxes/%s/data HTTP/1.1\\nAuthorization: ${access_token}\\nHost: %s\\nContent-Type: "
|
PSTR("POST /boxes/%s/data HTTP/1.1\\nHost: %s\\nContent-Type: "
|
||||||
"text/csv\\nConnection: close\\nContent-Length: %i\\n\\n"),
|
"text/csv\\nConnection: close\\nContent-Length: %i\\n\\n"),
|
||||||
SENSEBOX_ID, server, num_measurements * lengthMultiplikator);
|
SENSEBOX_ID, server, num_measurements * lengthMultiplikator);
|
||||||
// send the HTTP POST request:
|
// send the HTTP POST request:
|
||||||
@@ -147,7 +144,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) {
|
|||||||
if (connected == true) {
|
if (connected == true) {
|
||||||
// construct the HTTP POST request:
|
// construct the HTTP POST request:
|
||||||
sprintf_P(buffer,
|
sprintf_P(buffer,
|
||||||
PSTR("POST /boxes/%s/data HTTP/1.1\\nAuthorization: ${access_token}\\nHost: %s\\nContent-Type: "
|
PSTR("POST /boxes/%s/data HTTP/1.1\\nHost: %s\\nContent-Type: "
|
||||||
"text/csv\\nConnection: close\\nContent-Length: %i\\n\\n"),
|
"text/csv\\nConnection: close\\nContent-Length: %i\\n\\n"),
|
||||||
SENSEBOX_ID, server, num_measurements * lengthMultiplikator);
|
SENSEBOX_ID, server, num_measurements * lengthMultiplikator);
|
||||||
// send the HTTP POST request:
|
// send the HTTP POST request:
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import Blockly from "blockly";
|
import Blockly from 'blockly';
|
||||||
|
|
||||||
|
|
||||||
/* SD-Card Blocks using the Standard SD Library*/
|
/* SD-Card Blocks using the Standard SD Library*/
|
||||||
/**
|
/**
|
||||||
@@ -9,49 +10,45 @@ import Blockly from "blockly";
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_sd_create_file = function (block) {
|
Blockly.Arduino.sensebox_sd_create_file = function (block) {
|
||||||
var filename = this.getFieldValue("Filename");
|
var filename = this.getFieldValue('Filename');
|
||||||
var extension = this.getFieldValue("extension");
|
var res = filename.slice(0, 4);
|
||||||
var newFileName = filename.concat(".", extension);
|
Blockly.Arduino.libraries_['library_spi'] = '#include <SPI.h>';
|
||||||
Blockly.Arduino.libraries_["library_spi"] = "#include <SPI.h>";
|
Blockly.Arduino.libraries_['library_sd'] = '#include <SD.h>';
|
||||||
Blockly.Arduino.libraries_["library_sd"] = "#include <SD.h>";
|
Blockly.Arduino.definitions_['define_' + res] = 'File dataFile' + res + ';';
|
||||||
Blockly.Arduino.definitions_["define_" + filename] = `File ${filename};`;
|
Blockly.Arduino.setupCode_['sensebox_sd'] = 'SD.begin(28);';
|
||||||
Blockly.Arduino.setupCode_["sensebox_sd"] = "SD.begin(28);\n";
|
Blockly.Arduino.setupCode_['sensebox_sd' + filename] = 'dataFile' + res + ' = SD.open("' + filename + '", FILE_WRITE);\ndataFile' + res + '.close();\n';
|
||||||
Blockly.Arduino.setupCode_[
|
var code = '';
|
||||||
"sensebox_sd" + filename
|
|
||||||
] = `${filename} = SD.open("${newFileName}", FILE_WRITE);\n${filename}.close();\n`;
|
|
||||||
var code = "";
|
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_sd_open_file = function (block) {
|
Blockly.Arduino.sensebox_sd_open_file = function (block) {
|
||||||
var filename = this.getFieldValue("Filename");
|
var filename = this.getFieldValue('Filename');
|
||||||
var extension = this.getFieldValue("extension");
|
var res = filename.slice(0, 4);
|
||||||
var newFileName = filename.concat(".", extension);
|
var branch = Blockly.Arduino.statementToCode(block, 'SD');
|
||||||
var branch = Blockly.Arduino.statementToCode(block, "SD");
|
var code = 'dataFile' + res + ' = SD.open("' + filename + '", FILE_WRITE);\n'
|
||||||
var code = `${filename} = SD.open("${newFileName}", FILE_WRITE);\n`;
|
|
||||||
code += branch;
|
code += branch;
|
||||||
code += `${filename}.close();\n`;
|
code += 'dataFile' + res + '.close();\n'
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_sd_write_file = function (block) {
|
Blockly.Arduino.sensebox_sd_write_file = function (block) {
|
||||||
if (this.parentBlock_ != null) {
|
if (this.parentBlock_ != null) {
|
||||||
var filename = this.getSurroundParent().getFieldValue("Filename");
|
var filename = this.getSurroundParent().getFieldValue('Filename');
|
||||||
}
|
}
|
||||||
var branch =
|
var res = filename.slice(0, 4);
|
||||||
Blockly.Arduino.valueToCode(this, "DATA", Blockly.Arduino.ORDER_ATOMIC) ||
|
var text = Blockly.Arduino.valueToCode(this, 'DATA', Blockly.Arduino.ORDER_ATOMIC) || '"Keine Eingabe"';
|
||||||
'"Keine Eingabe"';
|
var linebreak = this.getFieldValue('linebreak');
|
||||||
var linebreak = this.getFieldValue("linebreak");
|
|
||||||
if (linebreak === "TRUE") {
|
if (linebreak === "TRUE") {
|
||||||
linebreak = "ln";
|
linebreak = "ln";
|
||||||
} else {
|
} else {
|
||||||
linebreak = "";
|
linebreak = "";
|
||||||
}
|
}
|
||||||
var code = "";
|
var code = '';
|
||||||
if (branch === "gps.getLongitude()" || branch === "gps.getLatitude()") {
|
if (text === "gps.getLongitude()" || text === "gps.getLatitude()") {
|
||||||
code = `${filename}.print${linebreak}(${branch},5);\n`;
|
code = 'dataFile' + res + '.print' + linebreak + '(' + text + ',5);\n'
|
||||||
} else {
|
}
|
||||||
code = `${filename}.print${linebreak}(${branch});\n`;
|
else {
|
||||||
|
code = 'dataFile' + res + '.print' + linebreak + '(' + text + ');\n'
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -28,23 +28,15 @@ Blockly.Arduino.sensebox_sensor_uv_light = function () {
|
|||||||
Blockly.Arduino.setupCode_['sensebox_sensor_uv_light'] = 'veml.begin();'
|
Blockly.Arduino.setupCode_['sensebox_sensor_uv_light'] = 'veml.begin();'
|
||||||
code = 'veml.get' + dropdown_name + '()';
|
code = 'veml.get' + dropdown_name + '()';
|
||||||
}
|
}
|
||||||
// if (dropdown_name === 'Illuminance') {
|
|
||||||
// Blockly.Arduino.definitions_['define_tsl'] = 'TSL45315 tsl;'
|
|
||||||
// Blockly.Arduino.setupCode_['sensebox_sensor_illuminance'] = 'tsl.begin();'
|
|
||||||
// code = 'tsl.get' + dropdown_name + '()';
|
|
||||||
// }
|
|
||||||
if (dropdown_name === 'Illuminance') {
|
if (dropdown_name === 'Illuminance') {
|
||||||
Blockly.Arduino.definitions_['define_lightsensor'] = 'Lightsensor lightsensor;'
|
Blockly.Arduino.definitions_['define_tsl'] = 'TSL45315 tsl;'
|
||||||
Blockly.Arduino.setupCode_['sensebox_sensor_illuminance'] = 'lightsensor.begin();'
|
Blockly.Arduino.setupCode_['sensebox_sensor_illuminance'] = 'tsl.begin();'
|
||||||
code = 'lightsensor.get' + dropdown_name + '()';
|
code = 'tsl.get' + dropdown_name + '()';
|
||||||
}
|
}
|
||||||
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* BMX055 Accelerometer
|
* BMX055 Accelerometer
|
||||||
*
|
*
|
||||||
@@ -271,22 +263,32 @@ Blockly.Arduino.sensebox_scd30 = function () {
|
|||||||
Blockly.Arduino.libraries_['scd30_library'] = '#include "SparkFun_SCD30_Arduino_Library.h"'
|
Blockly.Arduino.libraries_['scd30_library'] = '#include "SparkFun_SCD30_Arduino_Library.h"'
|
||||||
Blockly.Arduino.libraries_['library_senseBoxMCU'] = '#include "SenseBoxMCU.h"';
|
Blockly.Arduino.libraries_['library_senseBoxMCU'] = '#include "SenseBoxMCU.h"';
|
||||||
Blockly.Arduino.definitions_['SCD30'] = 'SCD30 airSensor;';
|
Blockly.Arduino.definitions_['SCD30'] = 'SCD30 airSensor;';
|
||||||
|
Blockly.Arduino.variables_['scd30_temp'] = 'float scd30_temp;';
|
||||||
|
Blockly.Arduino.variables_['scd30_humi'] = 'float scd30_humi;';
|
||||||
|
Blockly.Arduino.variables_['scd30_co2'] = 'float scd30_co2;';
|
||||||
Blockly.Arduino.setupCode_['init_scd30'] = ` Wire.begin();
|
Blockly.Arduino.setupCode_['init_scd30'] = ` Wire.begin();
|
||||||
if (airSensor.begin() == false)
|
if (airSensor.begin() == false)
|
||||||
{
|
{
|
||||||
|
Serial.println("Air sensor not detected. Please check wiring. Freezing...");
|
||||||
while (1)
|
while (1)
|
||||||
;
|
;
|
||||||
}`;
|
}`;
|
||||||
|
Blockly.Arduino.loopCodeOnce_['scd30_getData'] = `if (airSensor.dataAvailable())
|
||||||
|
{
|
||||||
|
scd30_co2 = airSensor.getCO2();
|
||||||
|
scd30_temp = airSensor.getTemperature();
|
||||||
|
scd30_humi = airSensor.getHumidity();
|
||||||
|
}`
|
||||||
var code = '';
|
var code = '';
|
||||||
switch (dropdown) {
|
switch (dropdown) {
|
||||||
case 'temperature':
|
case 'temperature':
|
||||||
code = 'airSensor.getTemperature()';
|
code = 'scd30_temp';
|
||||||
break;
|
break;
|
||||||
case 'humidity':
|
case 'humidity':
|
||||||
code = 'airSensor.getHumiditiy()';
|
code = 'scd30_humi';
|
||||||
break;
|
break;
|
||||||
case 'CO2':
|
case 'CO2':
|
||||||
code = 'airSensor.getCO2()';
|
code = 'scd30_co2';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
code = ''
|
code = ''
|
||||||
@@ -294,177 +296,3 @@ Blockly.Arduino.sensebox_scd30 = function () {
|
|||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* GPS Module
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_gps = function () {
|
|
||||||
var dropdown = this.getFieldValue('dropdown');
|
|
||||||
Blockly.Arduino.libraries_['gps_library'] = '#include <SparkFun_u-blox_GNSS_Arduino_Library.h>'
|
|
||||||
Blockly.Arduino.libraries_['library_wire'] = '#include <Wire.h>';
|
|
||||||
Blockly.Arduino.libraries_['library_senseBoxMCU'] = '#include "SenseBoxMCU.h"';
|
|
||||||
Blockly.Arduino.definitions_['GPS'] = 'SFE_UBLOX_GNSS myGNSS;';
|
|
||||||
Blockly.Arduino.setupCode_['init_gps'] = ` Wire.begin();
|
|
||||||
|
|
||||||
if (myGNSS.begin() == false) //Connect to the Ublox module using Wire port
|
|
||||||
{
|
|
||||||
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
|
|
||||||
while (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
myGNSS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
|
|
||||||
myGNSS.saveConfiguration(); //Save the current settings to flash and BBR`;
|
|
||||||
var code = '';
|
|
||||||
switch (dropdown) {
|
|
||||||
case 'latitude':
|
|
||||||
code = 'myGNSS.getLatitude()';
|
|
||||||
break;
|
|
||||||
case 'longitude':
|
|
||||||
code = 'myGNSS.getLongitude()';
|
|
||||||
break;
|
|
||||||
case 'altitude':
|
|
||||||
code = 'myGNSS.getAltitudeMSL()';
|
|
||||||
break;
|
|
||||||
case 'pDOP':
|
|
||||||
code = 'myGNSS.getPDOP()';
|
|
||||||
break;
|
|
||||||
case 'fixType':
|
|
||||||
code = 'myGNSS.getFixType()';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
code = ''
|
|
||||||
}
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Block for Truebner STM50
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_sensor_truebner_smt50 = function () {
|
|
||||||
var dropdown_port = this.getFieldValue('Port')
|
|
||||||
var dropdown_value = this.getFieldValue('value');
|
|
||||||
var dropdown_pin = 1;
|
|
||||||
var code = '';
|
|
||||||
if (dropdown_value === 'temp') {
|
|
||||||
if (dropdown_port === 'A') {
|
|
||||||
dropdown_pin = 1;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'B') {
|
|
||||||
dropdown_pin = 3;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'C') {
|
|
||||||
dropdown_pin = 5;
|
|
||||||
}
|
|
||||||
Blockly.Arduino.codeFunctions_['sensebox_smt50_temp'] = 'float getSMT50Temperature(int analogPin){\n int sensorValue = analogRead(analogPin);\n float voltage = sensorValue * (3.3 / 1024.0);\n return (voltage - 0.5) * 100;\n}';
|
|
||||||
code = 'getSMT50Temperature(' + dropdown_pin + ')';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
else if (dropdown_value === 'soil') {
|
|
||||||
if (dropdown_port === 'A') {
|
|
||||||
dropdown_pin = 2;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'B') {
|
|
||||||
dropdown_pin = 4;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'C') {
|
|
||||||
dropdown_pin = 6;
|
|
||||||
}
|
|
||||||
Blockly.Arduino.codeFunctions_['sensebox_smt50_soil'] = 'float getSMT50Moisture(int analogPin){\n int sensorValue = analogRead(analogPin);\n float voltage = sensorValue * (3.3 / 1024.0);\n return (voltage * 50) / 3;\n}';
|
|
||||||
code = 'getSMT50Moisture(' + dropdown_pin + ')';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DS18B20 Watertemperature
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_sensor_watertemperature = function () {
|
|
||||||
|
|
||||||
var dropdown_port = this.getFieldValue('Port');
|
|
||||||
var dropdown_pin = 1;
|
|
||||||
if (dropdown_port === 'A') {
|
|
||||||
dropdown_pin = 1;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'B') {
|
|
||||||
dropdown_pin = 3;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'C') {
|
|
||||||
dropdown_pin = 5;
|
|
||||||
}
|
|
||||||
Blockly.Arduino.libraries_['library_oneWire'] = '#include "OneWire.h"';
|
|
||||||
Blockly.Arduino.libraries_['library_oneDallasTemperature'] = '#include "DallasTemperature.h"';
|
|
||||||
Blockly.Arduino.definitions_['define_OneWire'] = '#define ONE_WIRE_BUS ' + dropdown_pin + '\nOneWire oneWire(ONE_WIRE_BUS);\nDallasTemperature sensors(&oneWire);';
|
|
||||||
Blockly.Arduino.setupCode_['sensebox_oneWireSetup'] = 'sensors.begin();';
|
|
||||||
Blockly.Arduino.codeFunctions_['sensebox_requestTemp'] = 'float getWaterTemp(){\nsensors.requestTemperatures();\nsensors.getTempCByIndex(0);\n}';
|
|
||||||
var code = 'getWaterTemp()';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Windspeed
|
|
||||||
* remove for now
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_windspeed = function () {
|
|
||||||
var dropdown_pin = this.getFieldValue('PIN');
|
|
||||||
Blockly.Arduino.codeFunctions_['windspeed'] = `
|
|
||||||
float getWindspeed(){
|
|
||||||
float voltageWind = analogRead(`+ dropdown_pin + `) * (3.3 / 1024.0);
|
|
||||||
float windspeed = 0.0;
|
|
||||||
if (voltageWind >= 0.018){
|
|
||||||
float poly1 = pow(voltageWind, 3);
|
|
||||||
poly1 = 17.0359801998299 * poly1;
|
|
||||||
float poly2 = pow(voltageWind, 2);
|
|
||||||
poly2 = 47.9908168343362 * poly2;
|
|
||||||
float poly3 = 122.899677524413 * voltageWind;
|
|
||||||
float poly4 = 0.657504127272728;
|
|
||||||
windspeed = poly1 - poly2 + poly3 - poly4;
|
|
||||||
windspeed = windspeed * 0.2777777777777778; //conversion in m/s
|
|
||||||
}
|
|
||||||
return windspeed;
|
|
||||||
}`
|
|
||||||
var code = 'getWindspeed()';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* DF Robot Soundsensor
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_soundsensor_dfrobot = function () {
|
|
||||||
var dropdown_port = this.getFieldValue('Port');
|
|
||||||
var dropdown_pin = 1;
|
|
||||||
if (dropdown_port === 'A') {
|
|
||||||
dropdown_pin = 1;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'B') {
|
|
||||||
dropdown_pin = 3;
|
|
||||||
}
|
|
||||||
if (dropdown_port === 'C') {
|
|
||||||
dropdown_pin = 5;
|
|
||||||
}
|
|
||||||
Blockly.Arduino.codeFunctions_['soundsensor'] = `
|
|
||||||
float getSoundValue(){
|
|
||||||
float v = analogRead(`+ dropdown_pin + `) * (3.3 / 1024.0);
|
|
||||||
float decibel = v * 50;
|
|
||||||
return decibel;
|
|
||||||
}`
|
|
||||||
var code = 'getSoundValue()';
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import Blockly from "blockly";
|
import Blockly from 'blockly';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @license Licensed under the Apache License, Version 2.0 (the "License"):
|
* @license Licensed under the Apache License, Version 2.0 (the "License"):
|
||||||
@@ -16,14 +16,10 @@ import Blockly from "blockly";
|
|||||||
* @param {!Blockly.Block} block Block to generate the code from.
|
* @param {!Blockly.Block} block Block to generate the code from.
|
||||||
* @return {string} Completed code.
|
* @return {string} Completed code.
|
||||||
*/
|
*/
|
||||||
Blockly.Arduino["time_delay"] = function (block) {
|
Blockly.Arduino['time_delay'] = function (block) {
|
||||||
var delayTime =
|
var delayTime = Blockly.Arduino.valueToCode(
|
||||||
Blockly.Arduino.valueToCode(
|
block, 'DELAY_TIME_MILI', Blockly.Arduino.ORDER_ATOMIC) || '0';
|
||||||
block,
|
var code = 'delay(' + delayTime + ');\n';
|
||||||
"DELAY_TIME_MILI",
|
|
||||||
Blockly.Arduino.ORDER_ATOMIC
|
|
||||||
) || "0";
|
|
||||||
var code = "delay(" + delayTime + ");\n";
|
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -33,14 +29,10 @@ Blockly.Arduino["time_delay"] = function (block) {
|
|||||||
* @param {!Blockly.Block} block Block to generate the code from.
|
* @param {!Blockly.Block} block Block to generate the code from.
|
||||||
* @return {string} Completed code.
|
* @return {string} Completed code.
|
||||||
*/
|
*/
|
||||||
Blockly.Arduino["time_delaymicros"] = function (block) {
|
Blockly.Arduino['time_delaymicros'] = function (block) {
|
||||||
var delayTimeMs =
|
var delayTimeMs = Blockly.Arduino.valueToCode(
|
||||||
Blockly.Arduino.valueToCode(
|
block, 'DELAY_TIME_MICRO', Blockly.Arduino.ORDER_ATOMIC) || '0';
|
||||||
block,
|
var code = 'delayMicroseconds(' + delayTimeMs + ');\n';
|
||||||
"DELAY_TIME_MICRO",
|
|
||||||
Blockly.Arduino.ORDER_ATOMIC
|
|
||||||
) || "0";
|
|
||||||
var code = "delayMicroseconds(" + delayTimeMs + ");\n";
|
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,8 +42,8 @@ Blockly.Arduino["time_delaymicros"] = function (block) {
|
|||||||
* @param {!Blockly.Block} block Block to generate the code from.
|
* @param {!Blockly.Block} block Block to generate the code from.
|
||||||
* @return {array} Completed code with order of operation.
|
* @return {array} Completed code with order of operation.
|
||||||
*/
|
*/
|
||||||
Blockly.Arduino["time_millis"] = function (block) {
|
Blockly.Arduino['time_millis'] = function (block) {
|
||||||
var code = "millis()";
|
var code = 'millis()';
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -61,8 +53,8 @@ Blockly.Arduino["time_millis"] = function (block) {
|
|||||||
* @param {!Blockly.Block} block Block to generate the code from.
|
* @param {!Blockly.Block} block Block to generate the code from.
|
||||||
* @return {array} Completed code with order of operation.
|
* @return {array} Completed code with order of operation.
|
||||||
*/
|
*/
|
||||||
Blockly.Arduino["time_micros"] = function (block) {
|
Blockly.Arduino['time_micros'] = function (block) {
|
||||||
var code = "micros()";
|
var code = 'micros()';
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -72,22 +64,17 @@ Blockly.Arduino["time_micros"] = function (block) {
|
|||||||
* @param {!Blockly.Block} block Block to generate the code from.
|
* @param {!Blockly.Block} block Block to generate the code from.
|
||||||
* @return {string} Completed code.
|
* @return {string} Completed code.
|
||||||
*/
|
*/
|
||||||
Blockly.Arduino["infinite_loop"] = function (block) {
|
Blockly.Arduino['infinite_loop'] = function (block) {
|
||||||
return "while(true);\n";
|
return 'while(true);\n';
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_interval_timer = function (block) {
|
Blockly.Arduino.sensebox_interval_timer = function (block) {
|
||||||
var intervalTime = this.getFieldValue("interval");
|
var interval = this.getFieldValue('interval');
|
||||||
var intervalName = this.getFieldValue("name");
|
Blockly.Arduino.variables_['define_interval_variables'] = 'const long interval = ' + interval + ';\nlong time_start = 0;\nlong time_actual = 0;';
|
||||||
Blockly.Arduino.variables_[`define_interval_variables${intervalName}`] = `
|
var branch = Blockly.Arduino.statementToCode(block, 'DO');
|
||||||
const long interval${intervalName} = ${intervalTime};
|
var code = 'time_start = millis();\n';
|
||||||
long time_start${intervalName} = 0;
|
code += 'if (time_start > time_actual + interval) {\n time_actual = millis();\n'
|
||||||
long time_actual${intervalName} = 0;`;
|
|
||||||
var branch = Blockly.Arduino.statementToCode(block, "DO");
|
|
||||||
var code = `time_start${intervalName} = millis();\n`;
|
|
||||||
code += `
|
|
||||||
if (time_start${intervalName} > time_actual${intervalName} + interval${intervalName}) {\n time_actual${intervalName} = millis();\n`;
|
|
||||||
code += branch;
|
code += branch;
|
||||||
code += "}\n";
|
code += '}\n'
|
||||||
return code;
|
return code;
|
||||||
};
|
};
|
||||||
@@ -14,28 +14,9 @@ const setVariableFunction = function (defaultValue) {
|
|||||||
|
|
||||||
const allVars = Blockly.getMainWorkspace().getVariableMap().getAllVariables();
|
const allVars = Blockly.getMainWorkspace().getVariableMap().getAllVariables();
|
||||||
const myVar = allVars.filter(v => v.name === variableName)[0]
|
const myVar = allVars.filter(v => v.name === variableName)[0]
|
||||||
var code = ''
|
|
||||||
|
|
||||||
switch (myVar.type) {
|
|
||||||
default:
|
|
||||||
Blockly.Arduino.variables_[myVar + myVar.type] = myVar.type + " " + myVar.name + ';\n';
|
Blockly.Arduino.variables_[myVar + myVar.type] = myVar.type + " " + myVar.name + ';\n';
|
||||||
code = variableName + ' = ' + (variableValue || defaultValue) + ';\n';
|
return variableName + ' = ' + (variableValue || defaultValue) + ';\n';
|
||||||
break;
|
|
||||||
case 'Array':
|
|
||||||
var arrayType;
|
|
||||||
var number;
|
|
||||||
|
|
||||||
if (this.getChildren().length > 0) {
|
|
||||||
if (this.getChildren()[0].type === 'lists_create_empty') {
|
|
||||||
|
|
||||||
arrayType = this.getChildren()[0].getFieldValue('type');
|
|
||||||
number = Blockly.Arduino.valueToCode(this.getChildren()[0], 'NUMBER', Blockly['Arduino'].ORDER_ATOMIC);
|
|
||||||
Blockly.Arduino.variables_[myVar + myVar.type] = `${arrayType} ${myVar.name} [${number}];\n`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return code;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -44,8 +25,8 @@ const getVariableFunction = function (block) {
|
|||||||
block.getFieldValue('VAR'),
|
block.getFieldValue('VAR'),
|
||||||
Blockly.Variables.NAME_TYPE
|
Blockly.Variables.NAME_TYPE
|
||||||
);
|
);
|
||||||
var code = variableName;
|
|
||||||
return [code, Blockly['Arduino'].ORDER_ATOMIC];
|
return [variableName, Blockly['Arduino'].ORDER_ATOMIC];
|
||||||
};
|
};
|
||||||
|
|
||||||
Blockly['Arduino']['variables_set_dynamic'] = setVariableFunction()
|
Blockly['Arduino']['variables_set_dynamic'] = setVariableFunction()
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
import Blockly from "blockly";
|
|
||||||
/**
|
|
||||||
* Webserver Blocks by Lucas Steinmann
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_initialize_http_server = function (block) {
|
|
||||||
var box_id = this.getFieldValue("Port");
|
|
||||||
Blockly.Arduino.libraries_["library_senseBoxMCU"] =
|
|
||||||
'#include "SenseBoxMCU.h"';
|
|
||||||
Blockly.Arduino.codeFunctions_["define_wifi_server"] =
|
|
||||||
"WiFiServer server(" + box_id + ");";
|
|
||||||
Blockly.Arduino.setupCode_["sensebox_wifi_server_beging"] = "server.begin();";
|
|
||||||
return "";
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_http_on_client_connect = function (block) {
|
|
||||||
var onConnect = Blockly.Arduino.statementToCode(block, "ON_CONNECT");
|
|
||||||
var code = "";
|
|
||||||
code += "WiFiClient client = server.available();\n";
|
|
||||||
code += "if (client && client.available()) {\n";
|
|
||||||
code += " String request_string = listenClient(client);\n";
|
|
||||||
code += " Request request;\n";
|
|
||||||
code += " if (parseRequestSafe(request_string, request)) {\n";
|
|
||||||
code += onConnect;
|
|
||||||
code += " }\n";
|
|
||||||
code += " delay(1);\n";
|
|
||||||
code += " client.stop();\n";
|
|
||||||
code += " delay(1);\n";
|
|
||||||
code += "}\n";
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_http_method = function (block) {
|
|
||||||
var code = "request.method";
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_http_uri = function (block) {
|
|
||||||
var code = "request.uri";
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_http_protocol_version = function (block) {
|
|
||||||
var code = "request.protocol_version";
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_http_user_agent = function (block) {
|
|
||||||
var code = "request.user_agent";
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_generate_html_doc = function (block) {
|
|
||||||
var header =
|
|
||||||
Blockly.Arduino.valueToCode(block, "HEADER", Blockly.Arduino.ORDER_NONE) ||
|
|
||||||
'""';
|
|
||||||
var body =
|
|
||||||
Blockly.Arduino.valueToCode(block, "BODY", Blockly.Arduino.ORDER_NONE) ||
|
|
||||||
'""';
|
|
||||||
var code = "buildHTML(" + header + ", " + body + ")";
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_generate_http_succesful_response = function (block) {
|
|
||||||
var content =
|
|
||||||
Blockly.Arduino.valueToCode(block, "CONTENT", Blockly.Arduino.ORDER_NONE) ||
|
|
||||||
'""';
|
|
||||||
var code =
|
|
||||||
"client.println(buildSuccessfulResponse(request, " + content + "));\n";
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_generate_http_not_found_response = function (block) {
|
|
||||||
var code = "client.println(buildNotFoundResponse(request));\n";
|
|
||||||
return code;
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_ip_address = function (block) {
|
|
||||||
var code = "b->getIpAddress()";
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_general_html_tag = function (block) {
|
|
||||||
var tag = this.getFieldValue("TAG");
|
|
||||||
var code = 'buildTag("' + tag + '",';
|
|
||||||
var n = 0;
|
|
||||||
var branch = Blockly.Arduino.valueToCode(
|
|
||||||
block,
|
|
||||||
"DO" + n,
|
|
||||||
Blockly.Arduino.ORDER_NONE
|
|
||||||
);
|
|
||||||
if (branch.length > 0) {
|
|
||||||
code += "\n " + branch;
|
|
||||||
} else {
|
|
||||||
code += '""';
|
|
||||||
}
|
|
||||||
for (n = 1; n <= block.additionalChildCount_; n++) {
|
|
||||||
branch = Blockly.Arduino.valueToCode(
|
|
||||||
block,
|
|
||||||
"DO" + n,
|
|
||||||
Blockly.Arduino.ORDER_NONE
|
|
||||||
);
|
|
||||||
code += " +" + branch;
|
|
||||||
}
|
|
||||||
return [code + ")", Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
|
|
||||||
Blockly.Arduino.sensebox_web_readHTML = function (block) {
|
|
||||||
var filename = this.getFieldValue("FILENAME");
|
|
||||||
Blockly.Arduino.libraries_["library_spi"] = "#include <SPI.h>";
|
|
||||||
Blockly.Arduino.libraries_["library_sd"] = "#include <SD.h>";
|
|
||||||
Blockly.Arduino.codeFunctions_["define_sd" + filename] = "File webFile;";
|
|
||||||
Blockly.Arduino.setupCode_["sensebox_sd"] = "SD.begin(28);";
|
|
||||||
Blockly.Arduino.codeFunctions_["generateHTML"] = `
|
|
||||||
String generateHTML(){
|
|
||||||
webFile = SD.open("${filename}", FILE_READ);
|
|
||||||
String finalString ="";
|
|
||||||
while (webFile.available())
|
|
||||||
{
|
|
||||||
finalString+=(char)webFile.read();
|
|
||||||
}
|
|
||||||
return finalString;
|
|
||||||
}`;
|
|
||||||
var code = `generateHTML()`;
|
|
||||||
return [code, Blockly.Arduino.ORDER_ATOMIC];
|
|
||||||
};
|
|
||||||
@@ -10,9 +10,6 @@ const colours = {
|
|||||||
text: 160,
|
text: 160,
|
||||||
variables: 330,
|
variables: 330,
|
||||||
audio: 250,
|
audio: 250,
|
||||||
arrays: 33,
|
|
||||||
mqtt: 90,
|
|
||||||
webserver: 40
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,110 +8,101 @@
|
|||||||
* types.
|
* types.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** Single character. */
|
/** Single character. */
|
||||||
export const CHARACTER = {
|
export const CHARACTER = {
|
||||||
typeId: "Character",
|
typeId: 'Character',
|
||||||
typeName: "char",
|
typeName: 'char',
|
||||||
typeMsgName: "ARD_TYPE_CHAR",
|
typeMsgName: 'ARD_TYPE_CHAR',
|
||||||
};
|
}
|
||||||
|
|
||||||
export const BOOLEAN = {
|
export const BOOLEAN = {
|
||||||
typeId: "Boolean",
|
typeId: 'Boolean',
|
||||||
typeName: "boolean",
|
typeName: 'boolean',
|
||||||
typeMsgName: "ARD_TYPE_BOOL",
|
typeMsgName: 'ARD_TYPE_BOOL',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Text string. */
|
/** Text string. */
|
||||||
export const TEXT = {
|
export const TEXT = {
|
||||||
typeId: "Text",
|
typeId: 'Text',
|
||||||
typeName: "String",
|
typeName: 'String',
|
||||||
typeMsgName: "ARD_TYPE_TEXT",
|
typeMsgName: 'ARD_TYPE_TEXT',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Short integer number. */
|
/** Short integer number. */
|
||||||
export const SHORT_NUMBER = {
|
export const SHORT_NUMBER = {
|
||||||
typeId: "Short_Number",
|
typeId: 'Short_Number',
|
||||||
typeName: "int",
|
typeName: 'int',
|
||||||
typeMsgName: "ARD_TYPE_SHORT",
|
typeMsgName: 'ARD_TYPE_SHORT',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Integer number. */
|
/** Integer number. */
|
||||||
export const NUMBER = {
|
export const NUMBER = {
|
||||||
typeId: "Number",
|
typeId: 'Number',
|
||||||
typeName: "int",
|
typeName: 'int',
|
||||||
typeMsgName: "ARD_TYPE_NUMBER",
|
typeMsgName: 'ARD_TYPE_NUMBER',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Large integer number. */
|
/** Large integer number. */
|
||||||
export const LARGE_NUMBER = {
|
export const LARGE_NUMBER = {
|
||||||
typeId: "Large Number",
|
typeId: 'Large Number',
|
||||||
typeName: "long",
|
typeName: 'long',
|
||||||
typeMsgName: "ARD_TYPE_LONG",
|
typeMsgName: 'ARD_TYPE_LONG',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Decimal/floating point number. */
|
/** Decimal/floating point number. */
|
||||||
export const DECIMAL = {
|
export const DECIMAL = {
|
||||||
typeId: "Decimal",
|
typeId: 'Decimal',
|
||||||
typeName: "float",
|
typeName: 'float',
|
||||||
typeMsgName: "ARD_TYPE_DECIMAL",
|
typeMsgName: 'ARD_TYPE_DECIMAL',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Array/List of items. */
|
/** Array/List of items. */
|
||||||
export const ARRAY = {
|
export const ARRAY = {
|
||||||
typeId: "Array",
|
typeId: 'Array',
|
||||||
typeName: "Array",
|
typeName: 'array',
|
||||||
typeMsgName: "ARD_TYPE_ARRAY",
|
typeMsgName: 'ARD_TYPE_ARRAY',
|
||||||
compatibleTypes: [],
|
compatibleTypes: []
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Null indicate there is no type. */
|
/** Null indicate there is no type. */
|
||||||
export const NULL = {
|
export const NULL = {
|
||||||
typeId: "Null",
|
typeId: 'Null',
|
||||||
typeName: "void",
|
typeName: 'void',
|
||||||
typeMsgName: "ARD_TYPE_NULL",
|
typeMsgName: 'ARD_TYPE_NULL',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Type not defined, or not yet defined. */
|
/** Type not defined, or not yet defined. */
|
||||||
export const UNDEF = {
|
export const UNDEF = {
|
||||||
typeId: "Undefined",
|
typeId: 'Undefined',
|
||||||
typeName: "undef",
|
typeName: 'undef',
|
||||||
typeMsgName: "ARD_TYPE_UNDEF",
|
typeMsgName: 'ARD_TYPE_UNDEF',
|
||||||
};
|
}
|
||||||
|
|
||||||
/** Set when no child block (meant to define the variable type) is connected. */
|
/** Set when no child block (meant to define the variable type) is connected. */
|
||||||
export const CHILD_BLOCK_MISSING = {
|
export const CHILD_BLOCK_MISSING = {
|
||||||
typeId: "ChildBlockMissing",
|
typeId: 'ChildBlockMissing',
|
||||||
typeMsgName: "ARD_TYPE_CHILDBLOCKMISSING",
|
typeMsgName: 'ARD_TYPE_CHILDBLOCKMISSING',
|
||||||
compatibleTypes: [],
|
compatibleTypes: []
|
||||||
};
|
}
|
||||||
|
|
||||||
const compatibleTypes = {
|
const compatibleTypes = {
|
||||||
Array: ["Array"],
|
boolean: ['boolean'],
|
||||||
boolean: ["boolean"],
|
int: ['int'],
|
||||||
int: ["int", "long", "double", "float"],
|
char: ['char'],
|
||||||
char: ["char"],
|
String: ['String'],
|
||||||
String: ["String"],
|
void: ['void'],
|
||||||
void: ["void"],
|
long: ['int', 'long'],
|
||||||
long: ["int", "long"],
|
double: ['int', 'long', 'double'],
|
||||||
double: ["int", "long", "double"],
|
float: ['int', 'long', 'double', 'float']
|
||||||
float: ["int", "long", "double", "float"],
|
|
||||||
null: ["null"],
|
}
|
||||||
};
|
|
||||||
|
|
||||||
export const getCompatibleTypes = (type) => {
|
export const getCompatibleTypes = (type) => {
|
||||||
return compatibleTypes[type];
|
return compatibleTypes[type];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const VARIABLE_TYPES = [
|
export const VARIABLE_TYPES = [['SHORT_NUMBER', 'char'], ['NUMBER', 'int'], ['DECIMAL', 'long'], ['TEXT', 'String'], ['CHARACTER', 'char'], ['BOOLEAN', 'boolean'], ['NULL', 'void'], ['UNDEF', 'undefined']];
|
||||||
["SHORT_NUMBER", "char"],
|
|
||||||
["NUMBER", "int"],
|
|
||||||
["DECIMAL", "long"],
|
|
||||||
["TEXT", "String"],
|
|
||||||
["CHARACTER", "char"],
|
|
||||||
["BOOLEAN", "boolean"],
|
|
||||||
["NULL", "void"],
|
|
||||||
["UNDEF", "undefined"],
|
|
||||||
];
|
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * Some Types have circular dependencies on their compatibilities, so add them
|
// * Some Types have circular dependencies on their compatibilities, so add them
|
||||||
@@ -240,3 +231,7 @@ export const VARIABLE_TYPES = [
|
|||||||
// }
|
// }
|
||||||
// return Blockly.Types.NULL;
|
// return Blockly.Types.NULL;
|
||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,777 @@
|
|||||||
|
// import * as Blockly from 'blockly/core';
|
||||||
|
|
||||||
import { AUDIO } from './de/audio';
|
// https://developers.google.com/blockly/guides/configure/web/translations
|
||||||
import { FAQ } from './de/faq';
|
|
||||||
import { IO } from './de/io';
|
|
||||||
import { LOGIC } from './de/logic';
|
|
||||||
import { LOOPS } from './de/loops';
|
|
||||||
import { MATH } from './de/math';
|
|
||||||
import { MQTT } from './de/mqtt';
|
|
||||||
import { DISPLAY } from './de/sensebox-display';
|
|
||||||
import { LED } from './de/sensebox-led';
|
|
||||||
import { LORA } from './de/sensebox-lora';
|
|
||||||
import { OSEM } from './de/sensebox-osem';
|
|
||||||
import { SD } from './de/sensebox-sd';
|
|
||||||
import { SENSORS } from './de/sensebox-sensors';
|
|
||||||
import { TELEGRAM } from './de/sensebox-telegram';
|
|
||||||
import { WEB } from './de/sensebox-web';
|
|
||||||
import { TEXT } from './de/text';
|
|
||||||
import { TIME } from './de/time';
|
|
||||||
import { TOURS } from './de/tours';
|
|
||||||
import { TRANSLATIONS } from './de/translations';
|
|
||||||
import { UI } from './de/ui';
|
|
||||||
import { VARIABLES } from './de/variables';
|
|
||||||
import { WEBSERVER } from './de/webserver';
|
|
||||||
|
|
||||||
export const De = {
|
const Blockly = {};
|
||||||
...AUDIO,
|
Blockly.Msg = {};
|
||||||
...FAQ,
|
|
||||||
...IO,
|
Blockly.Msg.ADD_COMMENT = "Kommentar hinzufügen";
|
||||||
...LOGIC,
|
Blockly.Msg.AUTH = "Bitte autorisiere diese App zum Aktivieren der Speicherung deiner Arbeit und zum Teilen.";
|
||||||
...LOOPS,
|
Blockly.Msg.CHANGE_VALUE_TITLE = "Wert ändern:";
|
||||||
...MATH,
|
Blockly.Msg.CHAT = "Chatte mit unserem Mitarbeiter durch Eingeben von Text in diesen Kasten!";
|
||||||
...MQTT,
|
Blockly.Msg.CLEAN_UP = "Blöcke aufräumen";
|
||||||
...DISPLAY,
|
Blockly.Msg.COLLAPSE_ALL = "Alle Blöcke zusammenfalten";
|
||||||
...LED,
|
Blockly.Msg.COLLAPSE_BLOCK = "Block zusammenfalten";
|
||||||
...LORA,
|
Blockly.Msg.COLOUR_BLEND_COLOUR1 = "Farbe 1";
|
||||||
...OSEM,
|
Blockly.Msg.COLOUR_BLEND_COLOUR2 = "mit Farbe 2";
|
||||||
...SD,
|
Blockly.Msg.COLOUR_BLEND_HELPURL = "http://meyerweb.com/eric/tools/color-blend/";
|
||||||
...SENSORS,
|
Blockly.Msg.COLOUR_BLEND_RATIO = "im Verhältnis";
|
||||||
...TELEGRAM,
|
Blockly.Msg.COLOUR_BLEND_TITLE = "mische";
|
||||||
...WEB,
|
Blockly.Msg.COLOUR_BLEND_TOOLTIP = "Vermische 2 Farben mit konfigurierbaren Farbverhältnis (0.0 - 1.0).";
|
||||||
...TEXT,
|
Blockly.Msg.COLOUR_PICKER_HELPURL = "https://de.wikipedia.org/wiki/Farbe";
|
||||||
...TIME,
|
Blockly.Msg.COLOUR_PICKER_TOOLTIP = "Wähle eine Farbe aus der Palette.";
|
||||||
...TOURS,
|
Blockly.Msg.COLOUR_RANDOM_HELPURL = "http://randomcolour.com"; // untranslated
|
||||||
...TRANSLATIONS,
|
Blockly.Msg.COLOUR_RANDOM_TITLE = "zufällige Farbe";
|
||||||
...UI,
|
Blockly.Msg.COLOUR_RANDOM_TOOLTIP = "Wähle eine Farbe nach dem Zufallsprinzip.";
|
||||||
...VARIABLES,
|
Blockly.Msg.COLOUR_RGB_BLUE = "blau";
|
||||||
...WEBSERVER
|
Blockly.Msg.COLOUR_RGB_GREEN = "grün";
|
||||||
}
|
Blockly.Msg.COLOUR_RGB_HELPURL = "https://de.wikipedia.org/wiki/RGB-Farbraum";
|
||||||
|
Blockly.Msg.COLOUR_RGB_RED = "rot";
|
||||||
|
Blockly.Msg.COLOUR_RGB_TITLE = "Farbe mit";
|
||||||
|
Blockly.Msg.COLOUR_RGB_TOOLTIP = "Erstelle eine Farbe mit selbst definierten Rot-, Grün- und Blauwerten. Alle Werte müssen zwischen 0 und 100 liegen.";
|
||||||
|
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_HELPURL = "https://de.wikipedia.org/wiki/Kontrollstruktur";
|
||||||
|
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK = "Die Schleife abbrechen";
|
||||||
|
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE = "mit der nächsten Iteration der Schleife fortfahren";
|
||||||
|
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK = "Die umgebende Schleife beenden.";
|
||||||
|
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE = "Diese Anweisung abbrechen und mit dem nächsten Schleifendurchlauf fortfahren.";
|
||||||
|
Blockly.Msg.CONTROLS_FLOW_STATEMENTS_WARNING = "Warnung: Dieser Block sollte nur in einer Schleife verwendet werden.";
|
||||||
|
Blockly.Msg.CONTROLS_FOREACH_HELPURL = "https://de.wikipedia.org/wiki/For-Schleife";
|
||||||
|
Blockly.Msg.CONTROLS_FOREACH_TITLE = "Für Wert %1 aus der Liste %2";
|
||||||
|
Blockly.Msg.CONTROLS_FOREACH_TOOLTIP = "Führe eine Anweisung für jeden Wert in der Liste aus und setzte dabei die Variable \"%1\" auf den aktuellen Listenwert.";
|
||||||
|
Blockly.Msg.CONTROLS_FOR_HELPURL = "https://de.wikipedia.org/wiki/For-Schleife";
|
||||||
|
Blockly.Msg.CONTROLS_FOR_TITLE = "Zähle %1 von %2 bis %3 mit %4";
|
||||||
|
Blockly.Msg.CONTROLS_FOR_TOOLTIP = "Zähle die Variable \"%1\" von einem Startwert bis zu einem Zielwert und führe für jeden Wert eine Anweisung aus.";
|
||||||
|
Blockly.Msg.CONTROLS_IF_ELSEIF_TOOLTIP = "Eine weitere Bedingung hinzufügen.";
|
||||||
|
Blockly.Msg.CONTROLS_IF_ELSE_TOOLTIP = "Eine sonst-Bedingung hinzufügen, führt eine Anweisung aus, falls keine Bedingung zutrifft.";
|
||||||
|
Blockly.Msg.CONTROLS_IF_HELPURL = "https://github.com/google/blockly/wiki/IfElse"; // untranslated
|
||||||
|
Blockly.Msg.CONTROLS_IF_IF_TOOLTIP = "Hinzufügen, entfernen oder sortieren von Sektionen";
|
||||||
|
Blockly.Msg.CONTROLS_IF_MSG_ELSE = "sonst";
|
||||||
|
Blockly.Msg.CONTROLS_IF_MSG_ELSEIF = "sonst wenn";
|
||||||
|
Blockly.Msg.CONTROLS_IF_MSG_IF = "wenn";
|
||||||
|
Blockly.Msg.CONTROLS_IF_TOOLTIP_1 = "Wenn eine Bedingung wahr (true) ist, dann führe eine Anweisung aus.";
|
||||||
|
Blockly.Msg.CONTROLS_IF_TOOLTIP_2 = "Wenn eine Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Ansonsten führe die zweite Anweisung aus.";
|
||||||
|
Blockly.Msg.CONTROLS_IF_TOOLTIP_3 = "Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus.";
|
||||||
|
Blockly.Msg.CONTROLS_IF_TOOLTIP_4 = "Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus. Falls keine der beiden Bedingungen wahr (true) ist, dann führe die dritte Anweisung aus.";
|
||||||
|
Blockly.Msg.CONTROLS_REPEAT_HELPURL = "https://de.wikipedia.org/wiki/For-Schleife";
|
||||||
|
Blockly.Msg.CONTROLS_REPEAT_INPUT_DO = "mache";
|
||||||
|
Blockly.Msg.CONTROLS_REPEAT_TITLE = "Wiederhole %1 mal";
|
||||||
|
Blockly.Msg.CONTROLS_REPEAT_TOOLTIP = "Eine Anweisung mehrfach ausführen.";
|
||||||
|
Blockly.Msg.CONTROLS_WHILEUNTIL_HELPURL = "https://de.wikipedia.org/wiki/Schleife_%28Programmierung%29";
|
||||||
|
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_UNTIL = "Wiederhole bis";
|
||||||
|
Blockly.Msg.CONTROLS_WHILEUNTIL_OPERATOR_WHILE = "Wiederhole solange";
|
||||||
|
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL = "Führe die Anweisung solange aus wie die Bedingung falsch (false) ist.";
|
||||||
|
Blockly.Msg.CONTROLS_WHILEUNTIL_TOOLTIP_WHILE = "Führe die Anweisung solange aus wie die Bedingung wahr (true) ist.";
|
||||||
|
Blockly.Msg.DELETE_ALL_BLOCKS = "Alle %1 Bausteine löschen?";
|
||||||
|
Blockly.Msg.DELETE_BLOCK = "Block löschen";
|
||||||
|
Blockly.Msg.DELETE_X_BLOCKS = "Block %1 löschen";
|
||||||
|
Blockly.Msg.DISABLE_BLOCK = "Block deaktivieren";
|
||||||
|
Blockly.Msg.DUPLICATE_BLOCK = "Kopieren";
|
||||||
|
Blockly.Msg.ENABLE_BLOCK = "Block aktivieren";
|
||||||
|
Blockly.Msg.EXPAND_ALL = "Alle Blöcke entfalten";
|
||||||
|
Blockly.Msg.EXPAND_BLOCK = "Block entfalten";
|
||||||
|
Blockly.Msg.EXTERNAL_INPUTS = "externe Eingänge";
|
||||||
|
Blockly.Msg.HELP = "Hilfe";
|
||||||
|
Blockly.Msg.INLINE_INPUTS = "interne Eingänge";
|
||||||
|
Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
|
||||||
|
Blockly.Msg.LISTS_CREATE_EMPTY_TITLE = "Erzeuge eine leere Liste";
|
||||||
|
Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP = "Erzeugt eine leere Liste ohne Inhalt.";
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TITLE_ADD = "Liste";
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_CONTAINER_TOOLTIP = "Hinzufügen, entfernen und sortieren von Elementen.";
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_HELPURL = "https://github.com/google/blockly/wiki/Lists#create-list-with";
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_INPUT_WITH = "Erzeuge Liste mit";
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TOOLTIP = "Ein Element zur Liste hinzufügen.";
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_TOOLTIP = "Erzeugt eine List mit konfigurierten Elementen.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_FIRST = "erstes";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_FROM_END = "#tes von hinten";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_FROM_START = "#tes";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_GET = "nimm";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_GET_REMOVE = "nimm und entferne";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_LAST = "letztes";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_RANDOM = "zufälliges";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_REMOVE = "entferne";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TAIL = "";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST = "Extrahiere das erste Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_END = "Extrahiere das #1te Element aus Ende der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM_START = "Extrahiere das #1te Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST = "Extrahiere das letzte Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM = "Extrahiere ein zufälliges Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST = "Extrahiere und entfernt das erste Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_END = "Extrahiere und entfernt das #1te Element aus Ende der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM_START = "Extrahiere und entfernt das #1te Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST = "Extrahiere und entfernt das letzte Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM = "Extrahiere und entfernt ein zufälliges Element aus der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST = "Entfernt das erste Element von der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_END = "Entfernt das #1te Element von Ende der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM_START = "Entfernt das #1te Element von der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST = "Entfernt das letzte Element von der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM = "Entfernt ein zufälliges Element von der Liste.";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_END = "bis zu # von hinten";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_END_FROM_START = "bis zu #";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_END_LAST = "bis zum Ende";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_START_FIRST = "erhalte Unterliste vom Anfang";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_END = "erhalte Unterliste von # von hinten";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_START_FROM_START = "erhalte Unterliste von #";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_TAIL = "";
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_TOOLTIP = "Erstellt eine Kopie mit dem angegebenen Abschnitt der Liste.";
|
||||||
|
Blockly.Msg.LISTS_INDEX_OF_FIRST = "suche erstes Auftreten von";
|
||||||
|
Blockly.Msg.LISTS_INDEX_OF_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.LISTS_INDEX_OF_LAST = "suche letztes Auftreten von";
|
||||||
|
Blockly.Msg.LISTS_INDEX_OF_TOOLTIP = "Sucht die Position (index) eines Elementes in der Liste. Gibt 0 zurück, falls kein Element gefunden wurde.";
|
||||||
|
Blockly.Msg.LISTS_INLIST = "von der Liste";
|
||||||
|
Blockly.Msg.LISTS_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated
|
||||||
|
Blockly.Msg.LISTS_ISEMPTY_TITLE = "%1 ist leer?";
|
||||||
|
Blockly.Msg.LISTS_ISEMPTY_TOOLTIP = "Ist wahr (true), wenn die Liste leer ist.";
|
||||||
|
Blockly.Msg.LISTS_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated
|
||||||
|
Blockly.Msg.LISTS_LENGTH_TITLE = "Länge von %1";
|
||||||
|
Blockly.Msg.LISTS_LENGTH_TOOLTIP = "Die Anzahl von Elementen in der Liste.";
|
||||||
|
Blockly.Msg.LISTS_REPEAT_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.LISTS_REPEAT_TITLE = "Erzeuge Liste mit Element %1 wiederhole es %2 mal";
|
||||||
|
Blockly.Msg.LISTS_REPEAT_TOOLTIP = "Erzeugt eine Liste mit einer variablen Anzahl von Elementen";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_INPUT_TO = "ein";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_INSERT = "füge";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_SET = "setze";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST = "Fügt das Element an den Anfang der Liste an.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_END = "Fügt das Element an der angegebenen Position in der Liste ein. #1 ist das letzte Element.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM_START = "Fügt das Element an der angegebenen Position in der Liste ein. #1 ist die erste Element.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST = "Fügt das Element ans Ende der Liste an.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM = "Fügt das Element zufällig in die Liste ein.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST = "Setzt das erste Element in der Liste.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_END = "Setzt das Element an der angegebenen Position in der Liste. #1 ist das letzte Element.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM_START = "Setzte das Element an der angegebenen Position in der Liste. #1 ist das erste Element.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST = "Setzt das letzte Element in der Liste.";
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM = "Setzt ein zufälliges Element in der Liste.";
|
||||||
|
Blockly.Msg.LISTS_SORT_HELPURL = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
|
||||||
|
Blockly.Msg.LISTS_SORT_ORDER_ASCENDING = "aufsteigend";
|
||||||
|
Blockly.Msg.LISTS_SORT_ORDER_DESCENDING = "absteigend";
|
||||||
|
Blockly.Msg.LISTS_SORT_TITLE = "%1 %2 %3 sortieren";
|
||||||
|
Blockly.Msg.LISTS_SORT_TOOLTIP = "Eine Kopie einer Liste sortieren.";
|
||||||
|
Blockly.Msg.LISTS_SORT_TYPE_IGNORECASE = "alphabetisch, Schreibung ignorieren";
|
||||||
|
Blockly.Msg.LISTS_SORT_TYPE_NUMERIC = "numerisch";
|
||||||
|
Blockly.Msg.LISTS_SORT_TYPE_TEXT = "alphabetisch";
|
||||||
|
Blockly.Msg.LISTS_SPLIT_HELPURL = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";
|
||||||
|
Blockly.Msg.LISTS_SPLIT_LIST_FROM_TEXT = "Liste aus Text erstellen";
|
||||||
|
Blockly.Msg.LISTS_SPLIT_TEXT_FROM_LIST = "Text aus Liste erstellen";
|
||||||
|
Blockly.Msg.LISTS_SPLIT_TOOLTIP_JOIN = "Liste mit Texten in einen Text vereinen, getrennt durch ein Trennzeichen.";
|
||||||
|
Blockly.Msg.LISTS_SPLIT_TOOLTIP_SPLIT = "Text in eine Liste mit Texten aufteilen, unterbrochen bei jedem Trennzeichen.";
|
||||||
|
Blockly.Msg.LISTS_SPLIT_WITH_DELIMITER = "mit Trennzeichen";
|
||||||
|
Blockly.Msg.LOGIC_BOOLEAN_FALSE = "falsch";
|
||||||
|
Blockly.Msg.LOGIC_BOOLEAN_HELPURL = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated
|
||||||
|
Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP = "Ist entweder wahr (true) oder falsch (false)";
|
||||||
|
Blockly.Msg.LOGIC_BOOLEAN_TRUE = "wahr";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_HELPURL = "https://de.wikipedia.org/wiki/Vergleich_%28Zahlen%29";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_EQ = "Ist wahr (true), wenn beide Werte gleich sind.";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GT = "Ist wahr (true), wenn der erste Wert größer als der zweite Wert ist.";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_GTE = "Ist wahr (true), wenn der erste Wert größer als oder gleich groß wie der zweite Wert ist.";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LT = "Ist wahr (true), wenn der erste Wert kleiner als der zweite Wert ist.";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_LTE = "Ist wahr (true), wenn der erste Wert kleiner als oder gleich groß wie der zweite Wert ist.";
|
||||||
|
Blockly.Msg.LOGIC_COMPARE_TOOLTIP_NEQ = "Ist wahr (true), wenn beide Werte unterschiedlich sind.";
|
||||||
|
Blockly.Msg.LOGIC_NEGATE_HELPURL = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated
|
||||||
|
Blockly.Msg.LOGIC_NEGATE_TITLE = "nicht %1";
|
||||||
|
Blockly.Msg.LOGIC_NEGATE_TOOLTIP = "Ist wahr (true), wenn der Eingabewert falsch (false) ist. Ist falsch (false), wenn der Eingabewert wahr (true) ist.";
|
||||||
|
Blockly.Msg.LOGIC_NULL = "null";
|
||||||
|
Blockly.Msg.LOGIC_NULL_HELPURL = "https://de.wikipedia.org/wiki/Nullwert";
|
||||||
|
Blockly.Msg.LOGIC_NULL_TOOLTIP = "Ist NULL.";
|
||||||
|
Blockly.Msg.LOGIC_OPERATION_AND = "und";
|
||||||
|
Blockly.Msg.LOGIC_OPERATION_HELPURL = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated
|
||||||
|
Blockly.Msg.LOGIC_OPERATION_OR = "oder";
|
||||||
|
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_AND = "Ist wahr (true), wenn beide Werte wahr (true) sind.";
|
||||||
|
Blockly.Msg.LOGIC_OPERATION_TOOLTIP_OR = "Ist wahr (true), wenn einer der beiden Werte wahr (true) ist.";
|
||||||
|
Blockly.Msg.LOGIC_TERNARY_CONDITION = "teste";
|
||||||
|
Blockly.Msg.LOGIC_TERNARY_HELPURL = "https://de.wikipedia.org/wiki/%3F:#Auswahloperator";
|
||||||
|
Blockly.Msg.LOGIC_TERNARY_IF_FALSE = "wenn falsch";
|
||||||
|
Blockly.Msg.LOGIC_TERNARY_IF_TRUE = "wenn wahr";
|
||||||
|
Blockly.Msg.LOGIC_TERNARY_TOOLTIP = "Überprüft eine Bedingung \"teste\". Wenn die Bedingung wahr ist, wird der \"wenn wahr\" Wert zurückgegeben, andernfalls der \"wenn falsch\" Wert";
|
||||||
|
Blockly.Msg.MATH_ADDITION_SYMBOL = "+"; // untranslated
|
||||||
|
Blockly.Msg.MATH_ARITHMETIC_HELPURL = "https://de.wikipedia.org/wiki/Grundrechenart";
|
||||||
|
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_ADD = "Ist die Summe zweier Werte.";
|
||||||
|
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_DIVIDE = "Ist der Quotient zweier Werte.";
|
||||||
|
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MINUS = "Ist die Differenz zweier Werte.";
|
||||||
|
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_MULTIPLY = "Ist das Produkt zweier Werte.";
|
||||||
|
Blockly.Msg.MATH_ARITHMETIC_TOOLTIP_POWER = "Ist der erste Wert potenziert mit dem zweiten Wert.";
|
||||||
|
Blockly.Msg.MATH_CHANGE_HELPURL = "https://de.wikipedia.org/wiki/Inkrement_und_Dekrement";
|
||||||
|
Blockly.Msg.MATH_CHANGE_TITLE = "erhöhe %1 um %2";
|
||||||
|
Blockly.Msg.MATH_CHANGE_TOOLTIP = "Addiert einen Wert zur Variable \"%1\" hinzu.";
|
||||||
|
Blockly.Msg.MATH_CONSTANT_HELPURL = "https://de.wikipedia.org/wiki/Mathematische_Konstante";
|
||||||
|
Blockly.Msg.MATH_CONSTANT_TOOLTIP = "Mathematische Konstanten wie: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…) oder ∞ (unendlich).";
|
||||||
|
Blockly.Msg.MATH_CONSTRAIN_HELPURL = "https://en.wikipedia.org/wiki/Clamping_%28graphics%29"; // untranslated
|
||||||
|
Blockly.Msg.MATH_CONSTRAIN_TITLE = "begrenze %1 von %2 bis %3";
|
||||||
|
Blockly.Msg.MATH_CONSTRAIN_TOOLTIP = "Begrenzt den Wertebereich auf den \"von\"-Wert bis einschließlich zum \"bis\"-Wert. (inklusiv)";
|
||||||
|
Blockly.Msg.MATH_DIVISION_SYMBOL = "÷"; // untranslated
|
||||||
|
Blockly.Msg.MATH_IS_DIVISIBLE_BY = "ist teilbar durch";
|
||||||
|
Blockly.Msg.MATH_IS_EVEN = "ist gerade";
|
||||||
|
Blockly.Msg.MATH_IS_NEGATIVE = "ist negativ";
|
||||||
|
Blockly.Msg.MATH_IS_ODD = "ist ungerade";
|
||||||
|
Blockly.Msg.MATH_IS_POSITIVE = "ist positiv";
|
||||||
|
Blockly.Msg.MATH_IS_PRIME = "ist eine Primzahl";
|
||||||
|
Blockly.Msg.MATH_IS_TOOLTIP = "Überprüft ob eine Zahl gerade, ungerade, eine Primzahl, ganzzahlig, positiv, negativ oder durch eine zweite Zahl teilbar ist. Gibt wahr (true) oder falsch (false) zurück.";
|
||||||
|
Blockly.Msg.MATH_IS_WHOLE = "ist eine ganze Zahl";
|
||||||
|
Blockly.Msg.MATH_MODULO_HELPURL = "https://de.wikipedia.org/wiki/Modulo";
|
||||||
|
Blockly.Msg.MATH_MODULO_TITLE = "Rest von %1 ÷ %2";
|
||||||
|
Blockly.Msg.MATH_MODULO_TOOLTIP = "Der Rest nach einer Division.";
|
||||||
|
Blockly.Msg.MATH_MULTIPLICATION_SYMBOL = "×";
|
||||||
|
Blockly.Msg.MATH_NUMBER_HELPURL = "https://de.wikipedia.org/wiki/Zahl";
|
||||||
|
Blockly.Msg.MATH_NUMBER_TOOLTIP = "Eine Zahl.";
|
||||||
|
Blockly.Msg.MATH_ONLIST_HELPURL = "http://www.sysplus.ch/einstieg.php?links=menu&seite=4125&grad=Crash&prog=Excel";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_AVERAGE = "Mittelwert einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_MAX = "Maximalwert einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_MEDIAN = "Median einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_MIN = "Minimalwert einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_MODE = "am häufigsten in Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_RANDOM = "Zufallswert einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_STD_DEV = "Standardabweichung einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_OPERATOR_SUM = "Summe einer Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_AVERAGE = "Ist der Durchschnittswert aller Werte in einer Liste.";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_MAX = "Ist der größte Wert in einer Liste.";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_MEDIAN = "Ist der Median aller Werte in einer Liste.";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_MIN = "Ist der kleinste Wert in einer Liste.";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_MODE = "Findet den am häufigsten vorkommenden Wert in einer Liste. Falls kein Wert öfter vorkommt als alle anderen, wird die originale Liste zurückgeben";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_RANDOM = "Gebe einen zufälligen Wert aus der Liste zurück.";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_STD_DEV = "Ist die standardisierte Standardabweichung aller Werte in der Liste";
|
||||||
|
Blockly.Msg.MATH_ONLIST_TOOLTIP_SUM = "Ist die Summe aller Werte in einer Liste.";
|
||||||
|
Blockly.Msg.MATH_POWER_SYMBOL = "^";
|
||||||
|
Blockly.Msg.MATH_RANDOM_FLOAT_HELPURL = "https://de.wikipedia.org/wiki/Zufallszahlen";
|
||||||
|
Blockly.Msg.MATH_RANDOM_FLOAT_TITLE_RANDOM = "Zufallszahl (0.0 -1.0)";
|
||||||
|
Blockly.Msg.MATH_RANDOM_FLOAT_TOOLTIP = "Erzeuge eine Zufallszahl zwischen 0.0 (inklusiv) und 1.0 (exklusiv).";
|
||||||
|
Blockly.Msg.MATH_RANDOM_INT_HELPURL = "https://de.wikipedia.org/wiki/Zufallszahlen";
|
||||||
|
Blockly.Msg.MATH_RANDOM_INT_TITLE = "ganzzahliger Zufallswert zwischen %1 bis %2";
|
||||||
|
Blockly.Msg.MATH_RANDOM_INT_TOOLTIP = "Erzeuge einen ganzzahligen Zufallswert zwischen zwei Werten (inklusiv).";
|
||||||
|
Blockly.Msg.MATH_ROUND_HELPURL = "https://de.wikipedia.org/wiki/Runden";
|
||||||
|
Blockly.Msg.MATH_ROUND_OPERATOR_ROUND = "runden";
|
||||||
|
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN = "abrunden";
|
||||||
|
Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP = "aufrunden";
|
||||||
|
Blockly.Msg.MATH_ROUND_TOOLTIP = "Eine Zahl auf- oder abrunden.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_HELPURL = "https://de.wikipedia.org/wiki/Quadratwurzel";
|
||||||
|
Blockly.Msg.MATH_SINGLE_OP_ABSOLUTE = "Absolutwert";
|
||||||
|
Blockly.Msg.MATH_SINGLE_OP_ROOT = "Quadratwurzel";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_ABS = "Ist der Absolutwert eines Wertes.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_EXP = "Ist Wert der Exponentialfunktion eines Wertes.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_LN = "Ist der natürliche Logarithmus eines Wertes.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_LOG10 = "Ist der dekadische Logarithmus eines Wertes.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_NEG = "Negiert einen Wert.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_POW10 = "Rechnet 10 hoch Eingabewert.";
|
||||||
|
Blockly.Msg.MATH_SINGLE_TOOLTIP_ROOT = "Ist die Quadratwurzel eines Wertes.";
|
||||||
|
Blockly.Msg.MATH_SUBTRACTION_SYMBOL = "-";
|
||||||
|
Blockly.Msg.MATH_TRIG_ACOS = "acos";
|
||||||
|
Blockly.Msg.MATH_TRIG_ASIN = "asin";
|
||||||
|
Blockly.Msg.MATH_TRIG_ATAN = "atan";
|
||||||
|
Blockly.Msg.MATH_TRIG_COS = "cos";
|
||||||
|
Blockly.Msg.MATH_TRIG_HELPURL = "https://de.wikipedia.org/wiki/Trigonometrie";
|
||||||
|
Blockly.Msg.MATH_TRIG_SIN = "sin";
|
||||||
|
Blockly.Msg.MATH_TRIG_TAN = "tan";
|
||||||
|
Blockly.Msg.MATH_TRIG_TOOLTIP_ACOS = "Ist der Arkuskosinus des Eingabewertes.";
|
||||||
|
Blockly.Msg.MATH_TRIG_TOOLTIP_ASIN = "Ist der Arkussinus des Eingabewertes.";
|
||||||
|
Blockly.Msg.MATH_TRIG_TOOLTIP_ATAN = "Ist der Arkustangens des Eingabewertes.";
|
||||||
|
Blockly.Msg.MATH_TRIG_TOOLTIP_COS = "Ist der Kosinus des Winkels.";
|
||||||
|
Blockly.Msg.MATH_TRIG_TOOLTIP_SIN = "Ist der Sinus des Winkels.";
|
||||||
|
Blockly.Msg.MATH_TRIG_TOOLTIP_TAN = "Ist der Tangens des Winkels.";
|
||||||
|
Blockly.Msg.ME = "Ich";
|
||||||
|
Blockly.Msg.NEW_VARIABLE = "Neue Variable...";
|
||||||
|
Blockly.Msg.NEW_VARIABLE_TITLE = "Name der neuen Variable:";
|
||||||
|
Blockly.Msg.ORDINAL_NUMBER_SUFFIX = "";
|
||||||
|
Blockly.Msg.PROCEDURES_ALLOW_STATEMENTS = "Aussagen erlauben";
|
||||||
|
Blockly.Msg.PROCEDURES_BEFORE_PARAMS = "mit:";
|
||||||
|
Blockly.Msg.PROCEDURES_CALLNORETURN_HELPURL = "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29";
|
||||||
|
Blockly.Msg.PROCEDURES_CALLNORETURN_TOOLTIP = "Rufe einen Funktionsblock ohne Rückgabewert auf.";
|
||||||
|
Blockly.Msg.PROCEDURES_CALLRETURN_HELPURL = "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29";
|
||||||
|
Blockly.Msg.PROCEDURES_CALLRETURN_TOOLTIP = "Rufe einen Funktionsblock mit Rückgabewert auf.";
|
||||||
|
Blockly.Msg.PROCEDURES_CALL_BEFORE_PARAMS = "mit:";
|
||||||
|
Blockly.Msg.PROCEDURES_CREATE_DO = "Erzeuge \"Aufruf %1\"";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT = "Beschreibe diese Funktion …";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFNORETURN_DO = "";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL = "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE = "Funktionsblock";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE = "zu";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFNORETURN_TOOLTIP = "Ein Funktionsblock ohne Rückgabewert.";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL = "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_RETURN = "gebe zurück";
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_TOOLTIP = "Ein Funktionsblock mit Rückgabewert.";
|
||||||
|
Blockly.Msg.PROCEDURES_DEF_DUPLICATE_WARNING = "Warnung: dieser Funktionsblock hat zwei gleich benannte Parameter.";
|
||||||
|
Blockly.Msg.PROCEDURES_HIGHLIGHT_DEF = "Markiere Funktionsblock";
|
||||||
|
Blockly.Msg.PROCEDURES_IFRETURN_HELPURL = "http://c2.com/cgi/wiki?GuardClause";
|
||||||
|
Blockly.Msg.PROCEDURES_IFRETURN_TOOLTIP = "Wenn der erste Wert wahr (true) ist, Gebe den zweiten Wert zurück.";
|
||||||
|
Blockly.Msg.PROCEDURES_IFRETURN_WARNING = "Warnung: Dieser Block darf nur innerhalb eines Funktionsblock genutzt werden.";
|
||||||
|
Blockly.Msg.PROCEDURES_MUTATORARG_TITLE = "Variable:";
|
||||||
|
Blockly.Msg.PROCEDURES_MUTATORARG_TOOLTIP = "Eine Eingabe zur Funktion hinzufügen.";
|
||||||
|
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TITLE = "Parameter";
|
||||||
|
Blockly.Msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP = "Die Eingaben zu dieser Funktion hinzufügen, entfernen oder neu anordnen.";
|
||||||
|
Blockly.Msg.REDO = "Wiederholen";
|
||||||
|
Blockly.Msg.REMOVE_COMMENT = "Kommentar entfernen";
|
||||||
|
Blockly.Msg.RENAME_VARIABLE = "Variable umbenennen...";
|
||||||
|
Blockly.Msg.RENAME_VARIABLE_TITLE = "Alle \"%1\" Variablen umbenennen in:";
|
||||||
|
Blockly.Msg.TEXT_APPEND_APPENDTEXT = "Text anhängen";
|
||||||
|
Blockly.Msg.TEXT_APPEND_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_APPEND_TO = "An";
|
||||||
|
Blockly.Msg.TEXT_APPEND_TOOLTIP = "Text an die Variable \"%1\" anhängen.";
|
||||||
|
Blockly.Msg.TEXT_CHANGECASE_HELPURL = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE = "umwandeln in kleinbuchstaben";
|
||||||
|
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_TITLECASE = "umwandeln in Substantive";
|
||||||
|
Blockly.Msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE = "umwandeln in GROSSBUCHSTABEN";
|
||||||
|
Blockly.Msg.TEXT_CHANGECASE_TOOLTIP = "Wandelt Schreibweise von Texten um, in Großbuchstaben, Kleinbuchstaben oder den ersten Buchstaben jedes Wortes groß und die anderen klein.";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_FIRST = "Nehme ersten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_FROM_END = "Nehme #ten Buchstaben von hinten";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_FROM_START = "Nehme #ten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_INPUT_INTEXT = "vom Text";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_LAST = "Nehme letzten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_RANDOM = "Nehme zufälligen Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_TAIL = "";
|
||||||
|
Blockly.Msg.TEXT_CHARAT_TOOLTIP = "Extrahiere einen Buchstaben von einer spezifizierten Position.";
|
||||||
|
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TOOLTIP = "Ein Element zum Text hinzufügen.";
|
||||||
|
Blockly.Msg.TEXT_CREATE_JOIN_TITLE_JOIN = "verbinden";
|
||||||
|
Blockly.Msg.TEXT_CREATE_JOIN_TOOLTIP = "Hinzufügen, entfernen und sortieren von Elementen.";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_END = "bis zum #ten Buchstaben von hinten";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_END_FROM_START = "bis zum #ten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_END_LAST = "bis zum letzten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT = "in Text";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_START_FIRST = "vom ersten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_END = "vom #ten Buchstaben von hinten";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_START_FROM_START = "vom #ten Buchstaben";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_TAIL = "";
|
||||||
|
Blockly.Msg.TEXT_GET_SUBSTRING_TOOLTIP = "Gibt den angegebenen Textabschnitt zurück.";
|
||||||
|
Blockly.Msg.TEXT_INDEXOF_HELPURL = "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm";
|
||||||
|
Blockly.Msg.TEXT_INDEXOF_INPUT_INTEXT = "im Text";
|
||||||
|
Blockly.Msg.TEXT_INDEXOF_OPERATOR_FIRST = "Suche erstes Auftreten des Begriffs";
|
||||||
|
Blockly.Msg.TEXT_INDEXOF_OPERATOR_LAST = "Suche letztes Auftreten des Begriffs";
|
||||||
|
Blockly.Msg.TEXT_INDEXOF_TAIL = "";
|
||||||
|
Blockly.Msg.TEXT_INDEXOF_TOOLTIP = "Findet das erste / letzte Auftreten eines Suchbegriffs in einem Text. Gibt die Position des Begriffs oder 0 zurück.";
|
||||||
|
Blockly.Msg.TEXT_ISEMPTY_HELPURL = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_ISEMPTY_TITLE = "%1 ist leer?";
|
||||||
|
Blockly.Msg.TEXT_ISEMPTY_TOOLTIP = "Ist wahr (true), wenn der Text keine Zeichen enthält ist.";
|
||||||
|
Blockly.Msg.TEXT_JOIN_HELPURL = "";
|
||||||
|
Blockly.Msg.TEXT_JOIN_TITLE_CREATEWITH = "Erstelle Text aus";
|
||||||
|
Blockly.Msg.TEXT_JOIN_TOOLTIP = "Erstellt einen Text durch das Verbinden von mehreren Textelementen.";
|
||||||
|
Blockly.Msg.TEXT_LENGTH_HELPURL = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_LENGTH_TITLE = "Länge %1";
|
||||||
|
Blockly.Msg.TEXT_LENGTH_TOOLTIP = "Die Anzahl von Zeichen in einem Text. (inkl. Leerzeichen)";
|
||||||
|
Blockly.Msg.TEXT_PRINT_HELPURL = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_PRINT_TITLE = "Ausgabe %1";
|
||||||
|
Blockly.Msg.TEXT_PRINT_TOOLTIP = "Gib den Inhalt einer Variable aus.";
|
||||||
|
Blockly.Msg.TEXT_PROMPT_HELPURL = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_PROMPT_TOOLTIP_NUMBER = "Fragt den Benutzer nach einer Zahl.";
|
||||||
|
Blockly.Msg.TEXT_PROMPT_TOOLTIP_TEXT = "Fragt den Benutzer nach einem Text.";
|
||||||
|
Blockly.Msg.TEXT_PROMPT_TYPE_NUMBER = "Fragt nach Zahl mit Hinweis";
|
||||||
|
Blockly.Msg.TEXT_PROMPT_TYPE_TEXT = "Fragt nach Text mit Hinweis";
|
||||||
|
Blockly.Msg.TEXT_TEXT_HELPURL = "https://de.wikipedia.org/wiki/Zeichenkette";
|
||||||
|
Blockly.Msg.TEXT_TEXT_TOOLTIP = "Ein Buchstabe, Text oder Satz.";
|
||||||
|
Blockly.Msg.TEXT_TRIM_HELPURL = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated
|
||||||
|
Blockly.Msg.TEXT_TRIM_OPERATOR_BOTH = "entferne Leerzeichen vom Anfang und vom Ende (links und rechts)";
|
||||||
|
Blockly.Msg.TEXT_TRIM_OPERATOR_LEFT = "entferne Leerzeichen vom Anfang (links)";
|
||||||
|
Blockly.Msg.TEXT_TRIM_OPERATOR_RIGHT = "entferne Leerzeichen vom Ende (rechts)";
|
||||||
|
Blockly.Msg.TEXT_TRIM_TOOLTIP = "Entfernt Leerzeichen vom Anfang und / oder Ende eines Textes.";
|
||||||
|
Blockly.Msg.TODAY = "Heute";
|
||||||
|
Blockly.Msg.UNDO = "Rückgängig";
|
||||||
|
Blockly.Msg.VARIABLES_DEFAULT_NAME = "Element";
|
||||||
|
Blockly.Msg.VARIABLES_GET_CREATE_SET = "Erzeuge \"Schreibe %1\"";
|
||||||
|
Blockly.Msg.VARIABLES_GET_HELPURL = "https://de.wikipedia.org/wiki/Variable_%28Programmierung%29";
|
||||||
|
Blockly.Msg.VARIABLES_GET_TOOLTIP = "Gibt den Wert der Variable zurück.";
|
||||||
|
Blockly.Msg.VARIABLES_SET = "Schreibe %1 %2";
|
||||||
|
Blockly.Msg.VARIABLES_SET_CREATE_GET = "Erzeuge \"Lese %1\"";
|
||||||
|
Blockly.Msg.VARIABLES_SET_HELPURL = "https://de.wikipedia.org/wiki/Variable_%28Programmierung%29";
|
||||||
|
Blockly.Msg.VARIABLES_SET_TOOLTIP = "Setzt den Wert einer Variable.";
|
||||||
|
Blockly.Msg.MATH_CHANGE_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_TITLE = Blockly.Msg.PROCEDURES_DEFNORETURN_TITLE;
|
||||||
|
Blockly.Msg.CONTROLS_IF_IF_TITLE_IF = Blockly.Msg.CONTROLS_IF_MSG_IF;
|
||||||
|
Blockly.Msg.CONTROLS_WHILEUNTIL_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||||
|
Blockly.Msg.CONTROLS_IF_MSG_THEN = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||||
|
Blockly.Msg.CONTROLS_IF_ELSE_TITLE_ELSE = Blockly.Msg.CONTROLS_IF_MSG_ELSE;
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE = Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE;
|
||||||
|
Blockly.Msg.LISTS_GET_SUBLIST_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_DO = Blockly.Msg.PROCEDURES_DEFNORETURN_DO;
|
||||||
|
Blockly.Msg.CONTROLS_IF_ELSEIF_TITLE_ELSEIF = Blockly.Msg.CONTROLS_IF_MSG_ELSEIF;
|
||||||
|
Blockly.Msg.LISTS_GET_INDEX_HELPURL = Blockly.Msg.LISTS_INDEX_OF_HELPURL;
|
||||||
|
Blockly.Msg.CONTROLS_FOREACH_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||||
|
Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||||
|
Blockly.Msg.CONTROLS_FOR_INPUT_DO = Blockly.Msg.CONTROLS_REPEAT_INPUT_DO;
|
||||||
|
Blockly.Msg.LISTS_CREATE_WITH_ITEM_TITLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||||
|
Blockly.Msg.TEXT_APPEND_VARIABLE = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||||
|
Blockly.Msg.TEXT_CREATE_JOIN_ITEM_TITLE_ITEM = Blockly.Msg.VARIABLES_DEFAULT_NAME;
|
||||||
|
Blockly.Msg.LISTS_INDEX_OF_INPUT_IN_LIST = Blockly.Msg.LISTS_INLIST;
|
||||||
|
Blockly.Msg.PROCEDURES_DEFRETURN_COMMENT = Blockly.Msg.PROCEDURES_DEFNORETURN_COMMENT;
|
||||||
|
|
||||||
|
// Ardublockly strings
|
||||||
|
Blockly.Msg.ARD_ANALOGREAD = "lese analogen Pin#";
|
||||||
|
Blockly.Msg.ARD_ANALOGREAD_TIP = "Gibt einen Wert zwischen 0 und 1024 zurüch";
|
||||||
|
Blockly.Msg.ARD_ANALOGWRITE = "setzte analogen Pin#";
|
||||||
|
Blockly.Msg.ARD_ANALOGWRITE_TIP = "Schreibe analogen Wert zwischen 0 und 255 an einen spezifischen PWM Port";
|
||||||
|
Blockly.Msg.ARD_BUILTIN_LED = "eingebaute LED";
|
||||||
|
Blockly.Msg.ARD_BUILTIN_LED_TIP = "Schaltet die interne LED An oder Aus";
|
||||||
|
Blockly.Msg.ARD_COMPONENT_WARN1 = "A %1 configuration block with the same %2 name must be added to use this block!";
|
||||||
|
Blockly.Msg.ARD_DEFINE = "Definiere";
|
||||||
|
Blockly.Msg.ARD_DIGITALREAD = "lesen digitalen Pin#";
|
||||||
|
Blockly.Msg.ARD_DIGITALREAD_TIP = "Lese Wert an digitalen Pin: HIGH(1) oder LOW(0)";
|
||||||
|
Blockly.Msg.ARD_DIGITALWRITE = "setzte digitalen Pin#";
|
||||||
|
Blockly.Msg.ARD_DIGITALWRITE_TIP = "Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port";
|
||||||
|
Blockly.Msg.ARD_FUN_RUN_LOOP = "Endlosschleife()";
|
||||||
|
Blockly.Msg.ARD_FUN_RUN_SETUP = "Setup()";
|
||||||
|
Blockly.Msg.ARD_FUN_RUN_TIP = "Definiert die setup() und loop() Funktionen";
|
||||||
|
Blockly.Msg.ARD_HIGH = "HIGH";
|
||||||
|
Blockly.Msg.ARD_HIGHLOW_TIP = "Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.";
|
||||||
|
Blockly.Msg.ARD_LOW = "LOW";
|
||||||
|
Blockly.Msg.ARD_MAP = "Verteile Wert";
|
||||||
|
Blockly.Msg.ARD_MAP_FROMMIN = "von Minimum";
|
||||||
|
Blockly.Msg.ARD_MAP_FROMMAX = "bis maximum";
|
||||||
|
Blockly.Msg.ARD_MAP_TOMIN = "auf Minimum";
|
||||||
|
Blockly.Msg.ARD_MAP_TOMAX = "bis Maximum";
|
||||||
|
Blockly.Msg.ARD_MAP_TIP = "Verteilt Werte zwischen [0-1024] zu andere.";
|
||||||
|
Blockly.Msg.ARD_MAP_VAL = "Wert zu [0-";
|
||||||
|
Blockly.Msg.ARD_NOTONE = "Schalte Ton aus an Pin";
|
||||||
|
Blockly.Msg.ARD_NOTONE_PIN = "keinen Ton an Pin";
|
||||||
|
Blockly.Msg.ARD_NOTONE_PIN_TIP = "Stoppe die Tonerzeugung an Pin";
|
||||||
|
Blockly.Msg.ARD_NOTONE_TIP = "Schaltet den Ton am ausgewählten Pin aus";
|
||||||
|
Blockly.Msg.ARD_PIN_WARN1 = "Pin %1 wird benötigt für %2 als Pin %3. Bereitsgenutzt als %4.";
|
||||||
|
Blockly.Msg.ARD_PULSETIMEOUT_TIP = "Misst die Laufzeit eines Impulses am ausgewählten Pin, wenn die Zeit ist in Microsekunden.";
|
||||||
|
Blockly.Msg.ARD_PULSE_READ = "Misst %1 Impuls an Pin #%2";
|
||||||
|
Blockly.Msg.ARD_PULSE_READ_TIMEOUT = "Misst %1 Impuls an Pin #%2 (Unterbrechung nach %3 μs)";
|
||||||
|
Blockly.Msg.ARD_PULSE_TIP = "Misst die Zeit eines Impulses an dem ausgewählten Pin.";
|
||||||
|
Blockly.Msg.ARD_SERIAL_BPS = "bps";
|
||||||
|
Blockly.Msg.ARD_SERIAL_PRINT = "schreibe";
|
||||||
|
Blockly.Msg.ARD_SERIAL_PRINT_NEWLINE = "neue Zeile hinzufügen";
|
||||||
|
Blockly.Msg.ARD_SERIAL_PRINT_TIP = "Prints data to the console/serial port as human-readable ASCII text."; // untranslated
|
||||||
|
Blockly.Msg.ARD_SERIAL_PRINT_WARN = "A setup block for %1 must be added to the workspace to use this block!"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SERIAL_SETUP = "Setup";
|
||||||
|
Blockly.Msg.ARD_SERIAL_SETUP_TIP = "Selects the speed for a specific Serial peripheral"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SERIAL_SPEED = ": Übertragungsgeschwindigkeit zu";
|
||||||
|
Blockly.Msg.ARD_SERVO_READ = "liest SERVO an PIN#";
|
||||||
|
Blockly.Msg.ARD_SERVO_READ_TIP = "Liest den Winkel des Servomotors aus";
|
||||||
|
Blockly.Msg.ARD_SERVO_WRITE = "setzt SERVO an Pin";
|
||||||
|
Blockly.Msg.ARD_SERVO_WRITE_DEG_180 = "Winkel (0~180)";
|
||||||
|
Blockly.Msg.ARD_SERVO_WRITE_TIP = "Set a Servo to an specified angle"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SERVO_WRITE_TO = ""; // untranslated
|
||||||
|
Blockly.Msg.ARD_SETTONE = "Spiele Ton an Pin"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP = "Setup";
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_CONF = "Konfiguration:";
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_DIVIDE = "clock divide"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_LSBFIRST = "LSBFIRST"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_MODE = "SPI mode (idle - edge)"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_MODE0 = "0 (LOW - Fallend)";
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_MODE1 = "1 (LOW - Steigend)";
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_MODE2 = "2 (HIGH - Fallend)";
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_MODE3 = "3 (HIGH - Steigend)";
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_MSBFIRST = "MSBFIRST"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_SHIFT = "data shift"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_SETUP_TIP = "Configures the SPI peripheral."; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANSRETURN_TIP = "Send a SPI message to an specified slave device and get data back."; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANS_NONE = "none"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANS_SLAVE = "to slave pin"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANS_TIP = "Send a SPI message to an specified slave device."; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANS_VAL = "transfer"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANS_WARN1 = "A setup block for %1 must be added to the workspace to use this block!"; // untranslated
|
||||||
|
Blockly.Msg.ARD_SPI_TRANS_WARN2 = "Old pin value %1 is no longer available."; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_COMPONENT = "stepper"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_DEFAULT_NAME = "MyStepper"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_FOUR_PINS = "4"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_MOTOR = "stepper motor:"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_NUMBER_OF_PINS = "Number of pins"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_PIN1 = "pin1#"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_PIN2 = "pin2#"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_PIN3 = "pin3#"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_PIN4 = "pin4#"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_REVOLVS = "how many steps per revolution"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_SETUP = "Setup stepper motor"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_SETUP_TIP = "Configures a stepper motor pinout and other settings."; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_SPEED = "set speed (rpm) to"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_STEP = "move stepper"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_STEPS = "steps"; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_STEP_TIP = "Turns the stepper motor a specific number of steps."; // untranslated
|
||||||
|
Blockly.Msg.ARD_STEPPER_TWO_PINS = "2"; // untranslated
|
||||||
|
Blockly.Msg.ARD_TIME_DELAY = "Warte";
|
||||||
|
Blockly.Msg.ARD_TIME_DELAY_MICROS = "Mikrosekunden";
|
||||||
|
Blockly.Msg.ARD_TIME_DELAY_MICRO_TIP = "Warte eine spezifischen Zeit in Microsekunden";
|
||||||
|
Blockly.Msg.ARD_TIME_DELAY_TIP = "Warte spezifische Zeit in Millisekunden";
|
||||||
|
Blockly.Msg.ARD_TIME_INF = "Warte für immer (Beende Programm)";
|
||||||
|
Blockly.Msg.ARD_TIME_INF_TIP = "Stoppt das Programm.";
|
||||||
|
Blockly.Msg.ARD_TIME_MICROS = "Bereits vergangen Zeit (Mikrosekunden)";
|
||||||
|
Blockly.Msg.ARD_TIME_MICROS_TIP = "Gibt eine Zahl in Microsekunden zurück, die der Zeitdauer des Aktuellen Programms entspricht. Muss als positiven Integer gespeichert werden"; // untranslated
|
||||||
|
Blockly.Msg.ARD_TIME_MILLIS = "Bereits vergangen Zeit (Millisekunden)";
|
||||||
|
Blockly.Msg.ARD_TIME_MILLIS_TIP = "Gibt eine Zahl in Millisekunden zurück, die der Zeitdauer des Aktuellen Programms entspricht. Muss als positiven Integer gespeichert werden"; // untranslated
|
||||||
|
Blockly.Msg.ARD_TIME_MS = "Millisekunden";
|
||||||
|
Blockly.Msg.ARD_TONEFREQ = "mit Frequenz";
|
||||||
|
Blockly.Msg.ARD_TONE_FREQ = "Frequenz";
|
||||||
|
Blockly.Msg.ARD_TONE_PIN = "Ton PIN#";
|
||||||
|
Blockly.Msg.ARD_TONE_PIN_TIP = "Erzeugt einen Ton an Pin";
|
||||||
|
Blockly.Msg.ARD_TONE_TIP = "Erzeugt einen Ton an Pin mit einer spezifischen Frequenz zwischen 31 - 65535";
|
||||||
|
Blockly.Msg.ARD_TONE_WARNING = "Frequenz muss zwischen 31 - 65535 liegen";
|
||||||
|
Blockly.Msg.ARD_TYPE_ARRAY = "Array";
|
||||||
|
Blockly.Msg.ARD_TYPE_BOOL = "Boolean";
|
||||||
|
Blockly.Msg.ARD_TYPE_CHAR = "Zeichen";
|
||||||
|
Blockly.Msg.ARD_TYPE_CHILDBLOCKMISSING = "ChildBlockMissing"; // untranslated
|
||||||
|
Blockly.Msg.ARD_TYPE_DECIMAL = "Dezimalzahl";
|
||||||
|
Blockly.Msg.ARD_TYPE_LONG = "große Zahl";
|
||||||
|
Blockly.Msg.ARD_TYPE_NULL = "Null";
|
||||||
|
Blockly.Msg.ARD_TYPE_NUMBER = "Zahl";
|
||||||
|
Blockly.Msg.ARD_TYPE_SHORT = "kurze Zahl";
|
||||||
|
Blockly.Msg.ARD_TYPE_TEXT = "Text";
|
||||||
|
Blockly.Msg.ARD_TYPE_UNDEF = "Undefiniert";
|
||||||
|
Blockly.Msg.ARD_VAR_AS = "als";
|
||||||
|
Blockly.Msg.ARD_VAR_AS_TIP = "Wert einem spezififischen Datentyp zuordnen";
|
||||||
|
Blockly.Msg.ARD_WRITE_TO = "zu";
|
||||||
|
Blockly.Msg.NEW_INSTANCE = "Neue Instanz...";
|
||||||
|
Blockly.Msg.NEW_INSTANCE_TITLE = "Neue Instanz mit Name:";
|
||||||
|
Blockly.Msg.RENAME_INSTANCE = "Instanz umbenennen...";
|
||||||
|
Blockly.Msg.RENAME_INSTANCE_TITLE = "Benenne alle '%1' Instanzen zu:";
|
||||||
|
|
||||||
|
/*senseBox Blockly Translations*/
|
||||||
|
|
||||||
|
Blockly.Msg.senseBox_basic_blue = "Blau";
|
||||||
|
Blockly.Msg.senseBox_basic_green = "Grün";
|
||||||
|
Blockly.Msg.senseBox_basic_red = "Rot";
|
||||||
|
Blockly.Msg.senseBox_basic_state = "Status";
|
||||||
|
Blockly.Msg.senseBox_off = "Aus";
|
||||||
|
Blockly.Msg.senseBox_on = "Ein";
|
||||||
|
Blockly.Msg.senseBox_sensor = "Sensoren"
|
||||||
|
Blockly.Msg.senseBox_output_filename = "Daten";
|
||||||
|
Blockly.Msg.senseBox_output_format = "Format:";
|
||||||
|
Blockly.Msg.senseBox_sd_create_file = "Erstelle Datei auf SD-Karte";
|
||||||
|
Blockly.Msg.senseBox_sd_write_file = " Schreibe Daten auf SD-Karte";
|
||||||
|
Blockly.Msg.senseBox_sd_open_file = "Öffne eine Datei auf der SD-Karte";
|
||||||
|
Blockly.Msg.sensebox_sd_filename = "Daten";
|
||||||
|
Blockly.Msg.senseBox_SD_COMPONENT = "SD-Block";
|
||||||
|
Blockly.Msg.senseBox_sd_decimals = "Dezimalen";
|
||||||
|
Blockly.Msg.senseBox_output_linebreak = "Zeilenumbruch";
|
||||||
|
Blockly.Msg.senseBox_output_networkid = "NetzwerkID";
|
||||||
|
Blockly.Msg.senseBox_output_password = "Passwort";
|
||||||
|
Blockly.Msg.senseBox_output_safetosd = "Auf SD Karte speichern";
|
||||||
|
Blockly.Msg.senseBox_output_safetosd_tip = "Speichert Messwerte auf SD Karte"
|
||||||
|
Blockly.Msg.senseBox_output_serialprint = "Auf Kommandozeile ausgeben";
|
||||||
|
Blockly.Msg.senseBox_serial_tip = "Gibt Messwerte oder Daten auf dem Seriellen Monitor der Arduino IDE aus. Praktisch um ohne Display zu arbeiten";
|
||||||
|
Blockly.Msg.senseBox_output_timestamp = "Zeitstempel";
|
||||||
|
Blockly.Msg.senseBox_button = "Button";
|
||||||
|
Blockly.Msg.senseBox_button_tip = "Liest den Zustand des Buttons";
|
||||||
|
Blockly.Msg.senseBox_led = "LED an digitalen";
|
||||||
|
Blockly.Msg.senseBox_led_tip = "Einfache LED. Beim Anschluss sollte immer ein Vorwiderstand verwendet werden";
|
||||||
|
Blockly.Msg.senseBox_piezo = "Piezo an digital";
|
||||||
|
Blockly.Msg.senseBox_piezo_tip = "Piezo an digital PIN. Beim Anschluss sollte immer ein Vorwiderstand verwendet werden";
|
||||||
|
Blockly.Msg.senseBox_foto = "Fotowiderstand";
|
||||||
|
Blockly.Msg.senseBox_foto_tip = "Fotowiderstand";
|
||||||
|
Blockly.Msg.senseBox_hum = "Luftfeuchtigkeit in %";
|
||||||
|
Blockly.Msg.senseBox_hum_tip = "Luftfeuchtigkeit";
|
||||||
|
Blockly.Msg.senseBox_ir = "Infrarot Abstandssensor";
|
||||||
|
Blockly.Msg.senseBox_ir_tip = "Infrarot Abstandssensor";
|
||||||
|
Blockly.Msg.senseBox_lux = "Helligkeitssensor";
|
||||||
|
Blockly.Msg.senseBox_lux_tip = "Helligkeitssensor";
|
||||||
|
Blockly.Msg.senseBox_poti = "Potenziometer";
|
||||||
|
Blockly.Msg.senseBox_poti_tip = "Potenziometer";
|
||||||
|
Blockly.Msg.senseBox_pressure_sensor = "Luftdruck-/Temperatursensor (BMP280)";
|
||||||
|
Blockly.Msg.senseBox_pressure = "Luftdruck in Pa";
|
||||||
|
Blockly.Msg.senseBox_pressure_dimension = "Luftdruck in Pa";
|
||||||
|
Blockly.Msg.senseBox_pressure_tip = "Luftdrucksensor";
|
||||||
|
Blockly.Msg.senseBox_pressure_referencePressure = "Luftdruck auf NN";
|
||||||
|
Blockly.Msg.senseBox_pressure_referencePressure_dim = "hPa";
|
||||||
|
Blockly.Msg.senseBox_sound = "Mikrofon";
|
||||||
|
Blockly.Msg.senseBox_sound_tip = "Gibt den Messwert des Mikrofons in Volt zurück";
|
||||||
|
Blockly.Msg.senseBox_rgb_led = "RGB-LED"
|
||||||
|
Blockly.Msg.senseBox_rgb_led_tip = "RGB-LED benötigt einen digitalen Pin und eine Stromkreis ";
|
||||||
|
Blockly.Msg.senseBox_temp = "Temperatur in °C";
|
||||||
|
Blockly.Msg.senseBox_temp_hum = "Temperatur-/Luftfeuchtigkeitssensor (HDC1080)";
|
||||||
|
Blockly.Msg.senseBox_temp_hum_tip = "Sensor misst Temperatur und Luftfeuchtigkeit";
|
||||||
|
Blockly.Msg.senseBox_ultrasonic = "Ultraschall-Abstandssensor an Port";
|
||||||
|
Blockly.Msg.senseBox_ultrasonic_port_A = "A";
|
||||||
|
Blockly.Msg.senseBox_ultrasonic_port_B = "B";
|
||||||
|
Blockly.Msg.senseBox_ultrasonic_port_C = "C";
|
||||||
|
Blockly.Msg.senseBox_ultrasonic_tip = "Misst die Distanz mithilfe von Ultraschall in cm";
|
||||||
|
Blockly.Msg.senseBox_value = "Messwert:";
|
||||||
|
Blockly.Msg.senseBox_uv_light = "Helligkeit-/UV-Sensor";
|
||||||
|
Blockly.Msg.senseBox_uv_light_tip = "Sensor misst UV-Licht oder die Helligkeit";
|
||||||
|
Blockly.Msg.senseBox_uv = "UV-Intensität in µW/cm²";
|
||||||
|
Blockly.Msg.senseBox_light = "Beleuchtungsstärke in Lux";
|
||||||
|
Blockly.Msg.senseBox_bmx055_compass = "Lage Sensor";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer = "Beschleunigungssensor";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_range = "Messbereich";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_range_2g = "2g";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_range_4g = "4g";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_range_8g = "8g";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_range_16g = "16g";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_direction = "Richtung";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_direction_x = "X-Achse";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_direction_y = "Y-Achse";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_direction_z = "Z-Achse";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_direction_total = "Gesamt";
|
||||||
|
Blockly.Msg.senseBox_bmx055_gyroscope = "Lage Sensor";
|
||||||
|
Blockly.Msg.senseBox_bmx055_accelerometer_tip = "Lage Sensor";
|
||||||
|
Blockly.Msg.senseBox_bmx055_compass_tip = "Lage Sensor";
|
||||||
|
Blockly.Msg.senseBox_bmx055_gyroscope_tip = "Lage Sensor";
|
||||||
|
Blockly.Msg.senseBox_bmx055_x = "X-Richtung";
|
||||||
|
Blockly.Msg.senseBox_bmx055_y = "Y-Richtung";
|
||||||
|
Blockly.Msg.senseBox_wifi_connect = "Verbinde mit WLAN";
|
||||||
|
Blockly.Msg.senseBox_wifi_ssid = "Netzwerkname";
|
||||||
|
Blockly.Msg.senseBox_wifi_tip = "stellt eine WLAN verbindung her";
|
||||||
|
Blockly.Msg.senseBox_wifi_startap = "Initialisiere WLAN Access Point";
|
||||||
|
Blockly.Msg.senseBox_osem_connection_tip = "stellt eine WLAN verbindung her";
|
||||||
|
Blockly.Msg.senseBox_send_to_osem_tip = "sende Messwert an";
|
||||||
|
Blockly.Msg.senseBox_send_to_osem = "Sende Messwert an die openSenseMap";
|
||||||
|
Blockly.Msg.senseBox_osem_connection = "Verbinde mit openSenseMap:";
|
||||||
|
Blockly.Msg.senseBox_osem_host = "opensensemap.org";
|
||||||
|
Blockly.Msg.senseBox_osem_host_workshop = "workshop.opensensemap.org";
|
||||||
|
Blockly.Msg.senseBox_osem_connection = "Verbinde mit openSenseMap";
|
||||||
|
Blockly.Msg.senseBox_osem_exposure = "Typ";
|
||||||
|
Blockly.Msg.senseBox_osem_stationary = "Stationär";
|
||||||
|
Blockly.Msg.senseBox_osem_mobile = "Mobil";
|
||||||
|
Blockly.Msg.senseBox_sds011 = "Feinstaubsensor";
|
||||||
|
Blockly.Msg.senseBox_sds011_dimension = "in µg/m³ an";
|
||||||
|
Blockly.Msg.senseBox_sds011_pm25 = "PM2.5";
|
||||||
|
Blockly.Msg.senseBox_sds011_pm10 = "PM10";
|
||||||
|
Blockly.Msg.senseBox_sds011_tip = "Misst die Feinstaubbelastung";
|
||||||
|
Blockly.Msg.senseBox_sds011_serial1 = "Serial1";
|
||||||
|
Blockly.Msg.senseBox_sds011_serial2 = "Serial2";
|
||||||
|
/*Display*/
|
||||||
|
Blockly.Msg.senseBox_display_beginDisplay = "Display initialisieren";
|
||||||
|
Blockly.Msg.senseBox_display_clearDisplay_tip = "Starten die Ausgabe auf dem Display";
|
||||||
|
Blockly.Msg.senseBox_display_clearDisplay = "Display löschen";
|
||||||
|
Blockly.Msg.senseBox_display_clearDisplay_tip = "Löscht den Inhalt des Displays";
|
||||||
|
Blockly.Msg.senseBox_display_printDisplay = "Schreibe Text/Zahl";
|
||||||
|
Blockly.Msg.senseBox_display_printDisplay_tip = "zeigt Wert auf dem Display an.";
|
||||||
|
Blockly.Msg.senseBox_display_printDisplay_x = "x-Koordinate";
|
||||||
|
Blockly.Msg.senseBox_display_printDisplay_y = "y-Koordinate";
|
||||||
|
Blockly.Msg.senseBox_display_printDisplay_value = "Wert";
|
||||||
|
Blockly.Msg.senseBox_display_setSize = "Schriftgröße";
|
||||||
|
Blockly.Msg.senseBox_display_setSize_tip = "Ändere die Schriftgröße auf einen Wert zwischen 1 und 10.";
|
||||||
|
Blockly.Msg.senseBox_display_color = "Schriftfarbe";
|
||||||
|
Blockly.Msg.senseBox_display_white = "Weiß";
|
||||||
|
Blockly.Msg.senseBox_display_black = "Schwarz";
|
||||||
|
Blockly.Msg.sensebox_display_show = "Zeige auf dem Display";
|
||||||
|
Blockly.Msg.sensebox_display_show_tip = "Zeigt den Nachfolgenden Inhalt auf dem Bildschirm";
|
||||||
|
Blockly.Msg.senseBox_dipslay_plotTitle = "Titel";
|
||||||
|
Blockly.Msg.senseBox_display_plotDisplay = "Zeichne Diagramm";
|
||||||
|
Blockly.Msg.senseBox_display_plotXLabel = "X-Achsen Beschriftung";
|
||||||
|
Blockly.Msg.senseBox_display_plotYLabel = "Y-Achsen Beschriftung";
|
||||||
|
Blockly.Msg.senseBox_display_plotXRange1 = "X-Wertebereich Anfang";
|
||||||
|
Blockly.Msg.senseBox_display_plotXRange2 = "X-Wertebereich Ende";
|
||||||
|
Blockly.Msg.senseBox_display_plotYRange1 = "Y-Wertebereich Anfang";
|
||||||
|
Blockly.Msg.senseBox_display_plotYRange2 = "Y-Wertebereich Ende";
|
||||||
|
Blockly.Msg.senseBox_display_plotXTick = "X-Linienabstand";
|
||||||
|
Blockly.Msg.senseBox_display_plotYTick = "Y-Linienabstand";
|
||||||
|
Blockly.Msg.senseBox_display_plotTimeFrame = "Zeitabschnitt";
|
||||||
|
Blockly.Msg.sensebox_display_fillCircle = "Zeichne Punkt";
|
||||||
|
Blockly.Msg.sensebox_display_fillCircle_radius = "Radius";
|
||||||
|
Blockly.Msg.sensebox_display_drawRectangle = "Zeichne Rechteck";
|
||||||
|
Blockly.Msg.sensebox_display_drawRectangle_width = "Breite";
|
||||||
|
Blockly.Msg.sensebox_display_drawRectangle_height = "Höhe";
|
||||||
|
Blockly.Msg.senseBox_display_filled = "Ausgefüllt"
|
||||||
|
// GPS
|
||||||
|
Blockly.Msg.senseBox_gps_getValues = "GPS Modul";
|
||||||
|
Blockly.Msg.senseBox_gps_getValues_tip = "ruft das GPS Signal ab";
|
||||||
|
Blockly.Msg.senseBox_gps_lat = "Breitengrad";
|
||||||
|
Blockly.Msg.senseBox_gps_lng = "Längengrad";
|
||||||
|
Blockly.Msg.senseBox_gps_alt = "Höhe über NN in m";
|
||||||
|
Blockly.Msg.senseBox_gps_speed = "Geschwindigkeit in km/h";
|
||||||
|
Blockly.Msg.senseBox_gps_date = "Datum";
|
||||||
|
Blockly.Msg.senseBox_gps_time = "Uhrzeit";
|
||||||
|
Blockly.Msg.senseBox_gps_timeStamp = "Zeitstempel (RFC 3339)";
|
||||||
|
// openSenseMap
|
||||||
|
Blockly.Msg.senseBox_send_mobile_to_osem = "Sende Messwert und Standort an die openSenseMap";
|
||||||
|
Blockly.Msg.senseBox_send_mobile_to_osem_tip = "Sende Messwert und Standort an die openSenseMap";
|
||||||
|
Blockly.Msg.senseBox_interval_timer = "Messintervall";
|
||||||
|
Blockly.Msg.senseBox_interval = "ms"
|
||||||
|
Blockly.Msg.senseBox_interval_timer_tip = "Intervall";
|
||||||
|
Blockly.Msg.senseBox_soil = "Bodenfeuchte";
|
||||||
|
Blockly.Msg.senseBox_watertemperature = "Wassertemperatur"
|
||||||
|
// Cases
|
||||||
|
Blockly.Msg.cases_do = "Führe aus";
|
||||||
|
Blockly.Msg.cases_condition = "Fall (Variable) = ";
|
||||||
|
Blockly.Msg.cases_switch = "Variable";
|
||||||
|
Blockly.Msg.cases_add = "Fall";
|
||||||
|
//Button
|
||||||
|
Blockly.Msg.senseBox_button_isPressed = "ist gedrückt";
|
||||||
|
Blockly.Msg.senseBox_button_switch = "als Schalter";
|
||||||
|
Blockly.Msg.senseBox_button_wasPressed = "wurde gedrückt";
|
||||||
|
//Webserver
|
||||||
|
Blockly.Msg.senseBox_ip_address = "IP-Adresse";
|
||||||
|
Blockly.Msg.senseBox_ip_address_tip = "Gibt die IP-Adresse als Zeichenkette zurück.";
|
||||||
|
Blockly.Msg.senseBox_init_http_server_tip = "Initialisiert einen http-Server auf dem angegebenen Port";
|
||||||
|
Blockly.Msg.senseBox_init_http_server = "HTTP-Server initialisieren";
|
||||||
|
Blockly.Msg.senseBox_http_on_client_connect = "Wenn Client verbunden ist:";
|
||||||
|
Blockly.Msg.senseBox_http_on_client_connect_tip = "Überprüft, ob ein Client verbunden ist und führt in diesem Fall die angegebene Anweisung aus";
|
||||||
|
Blockly.Msg.senseBox_http_method = "Methode";
|
||||||
|
Blockly.Msg.senseBox_http_method_tip = "Methode des aktuellen HTTP-Requests";
|
||||||
|
Blockly.Msg.senseBox_http_uri = "URI";
|
||||||
|
Blockly.Msg.senseBox_http_uri_tip = "URI der angeforderten Ressource der aktuellen HTTP-Anfrage";
|
||||||
|
Blockly.Msg.senseBox_http_user_agent = "User-Agent";
|
||||||
|
Blockly.Msg.senseBox_http_user_agent_tip = "Der Benutzer-Agent sendet zusammen mit der aktuellen HTTP-Anfrage";
|
||||||
|
Blockly.Msg.senseBox_http_protocol_version = "HTTP Version";
|
||||||
|
Blockly.Msg.senseBox_http_protocol_version_tip = "The HTTP Version of the current HTTP request";
|
||||||
|
Blockly.Msg.senseBox_http_success_tip = "Senden einer erfolgreichen HTTP-Antwort mit Inhalt";
|
||||||
|
Blockly.Msg.senseBox_http_not_found_tip = "Senden einer vordefinierten 404 HTTP-Antwort.";
|
||||||
|
Blockly.Msg.senseBox_http_success = "Erfolgreiche";
|
||||||
|
Blockly.Msg.senseBox_http_success_l2 = "HTTP-Antwort";
|
||||||
|
Blockly.Msg.senseBox_http_success_buildhtml = "HTML:"
|
||||||
|
Blockly.Msg.senseBox_http_not_found = "404 Fehler";
|
||||||
|
Blockly.Msg.senseBox_html_document = "HTML";
|
||||||
|
Blockly.Msg.senseBox_html_header = "<head>";
|
||||||
|
Blockly.Msg.senseBox_html_header_end = "</head>";
|
||||||
|
Blockly.Msg.senseBox_html_body = "<body>";
|
||||||
|
Blockly.Msg.senseBox_html_body_end = "</body>";
|
||||||
|
Blockly.Msg.senseBox_html_general_tag_tip = "Ein allgemeiner HTML-Tag-Baustein.";
|
||||||
|
Blockly.Msg.senseBox_html_document_tip = "Ein Block zum Erzeugen eines HTML-Dokuments...";
|
||||||
|
Blockly.Msg.senseBox_tag_first_mutator_tip = "Mögliche Erweiterungen zu diesem Block...";
|
||||||
|
Blockly.Msg.senseBox_tag_optional_mutator_tip = "Mehr Tags zum Block hinzufügen";
|
||||||
|
Blockly.Msg.senseBox_sd_web_readHTML = "Lese HTML von SD Karte";
|
||||||
|
Blockly.Msg.sensebox_web_readHTML_filename = "Datei:";
|
||||||
|
Blockly.Msg.senseBox_bme680 = "Umweltsensor (BME680)";
|
||||||
|
Blockly.Msg.senseBox_bme680_tip = "Gibt Messwerte des BME680 zurück";
|
||||||
|
Blockly.Msg.senseBox_bme680_warning = "Achtung. Gas (VOC) kann nicht gleichzeitig mit anderen Parametern gemessen werden"
|
||||||
|
Blockly.Msg.senseBox_gas = "Gas (VOC)";
|
||||||
|
Blockly.Msg.sensebox_soil_smt50 = "Bodenfeuchte/-temperatur (SMT50)";
|
||||||
|
// LoRa
|
||||||
|
Blockly.Msg.senseBox_LoRa_connect = "Zu TTN senden";
|
||||||
|
Blockly.Msg.senseBox_LoRa_device_id = "Device EUI (lsb)";
|
||||||
|
Blockly.Msg.senseBox_LoRa_app_id = "Application EUI (lsb)";
|
||||||
|
Blockly.Msg.senseBox_LoRa_app_key = "App Key (msb)";
|
||||||
|
Blockly.Msg.senseBox_LoRa_nwskey_id = "Network Session Key (msb)";
|
||||||
|
Blockly.Msg.senseBox_LoRa_appskey_id = "App Session Key (msb)";
|
||||||
|
Blockly.Msg.senseBox_LoRa_devaddr_id = "Device Adress";
|
||||||
|
Blockly.Msg.senseBox_LoRa_interval = "Intervall in Minuten"
|
||||||
|
Blockly.Msg.senseBox_measurement = "Messung";
|
||||||
|
Blockly.Msg.senseBox_measurements = "Messungen";
|
||||||
|
|
||||||
|
Blockly.Msg.senseBox_LoRa_send_message = "Sende als Lora Nachricht";
|
||||||
|
Blockly.Msg.senseBox_LoRa_send_cayenne = "Sende als Cayenne Nachricht";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_temperature = "Temperatur";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_channel = "Kanal";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_humidity = "Luftfeuchtigkeit"
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_pressure = "Luftdruck";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_luminosity = "Helligkeit";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_analog = "Analoger Wert";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_x = "X Wert";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_y = "Y Wert";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_z = "Z Wert";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_lat = "Breitengrad";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_lng = "Längengrad";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_alt = "Höhe";
|
||||||
|
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_tip = "Sende Daten als Cayenne Payload Format"
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_gps_tip = "Sende GPS";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_temperature_tip = "Sendet Temperaturwert mit einer Nachkommastelle";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_pressure_tip = "Sendet Luftdruck mit einer Nachkommastelle";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_luminosity_tip = "Sendet Helligkeitswert";
|
||||||
|
Blockly.Msg.senseBox_LoRa_cayenne_analog_tip = "Sendet einen Dezimalwert mit einer Nachkommastelle";
|
||||||
|
|
||||||
|
Blockly.Msg.senseBox_LoRa_message_tip = "Sende eine Nachricht über LoRa";
|
||||||
|
Blockly.Msg.senseBox_LoRa_sensor_tip = "Sende eine Sensorwert mit einer bestimmten Anzahl an Bytes";
|
||||||
|
Blockly.Msg.senseBox_LoRa_init_abp_tip = "Initialisiere die LoRa übertragung. Kopiere die ID's im lsb Format";
|
||||||
|
Blockly.Msg.senseBox_LoRa_init_otaa_tip = "Initialisiere die LoRa übertragung. Kopiere die ID's im lsb Format";
|
||||||
|
|
||||||
|
//BME680
|
||||||
|
Blockly.Msg.senseBox_bme680 = "Umweltsensor (BME680)";
|
||||||
|
Blockly.Msg.senseBox_bme_iaq = "Innenraumluftqualität (IAQ)";
|
||||||
|
Blockly.Msg.senseBox_bme_iaq_accuracy = "Kalibrierungswert";
|
||||||
|
Blockly.Msg.senseBox_bme_co2 = "CO2 Äquivalent";
|
||||||
|
Blockly.Msg.senseBox_bme_breatheVocEquivalent = "Atemluft VOC Äquivalent";
|
||||||
|
Blockly.Msg.senseBox_bme_tip = "Gibt Messwerte des BME680 zurück";
|
||||||
|
|
||||||
|
Blockly.Msg.senseBox_gas = "Gas (VOC)";
|
||||||
|
Blockly.Msg.sensebox_soil_stm50 = "Bodenfeuchte/-temperatur (SMT50)";
|
||||||
|
//Telegram
|
||||||
|
Blockly.Msg.senseBox_telegram_init = "Telegram Bot initialisieren"
|
||||||
|
Blockly.Msg.senseBox_telegram_token = "Token"
|
||||||
|
Blockly.Msg.senseBox_telegram_do = "Telegram mache"
|
||||||
|
Blockly.Msg.senseBox_telegram_do_on_message = "bei Nachricht"
|
||||||
|
Blockly.Msg.senseBox_telegram_message = "Nachricht"
|
||||||
|
Blockly.Msg.senseBox_telegram_send = "Sende Nachricht"
|
||||||
|
|
||||||
|
Blockly.Msg.senseBox_scd30 = "CO2 Sensor (Sensirion SCD30)";
|
||||||
|
|
||||||
|
export const De = Blockly.Msg;
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
export const AUDIO = {
|
|
||||||
ARD_TONEFREQ: "mit Frequenz",
|
|
||||||
ARD_TONE_FREQ: "Frequenz",
|
|
||||||
ARD_TONE_PIN: "Ton PIN#",
|
|
||||||
ARD_TONE_PIN_TIP: "Erzeugt einen Ton an Pin",
|
|
||||||
ARD_TONE_TIP: "Erzeugt einen Ton an Pin mit einer spezifischen Frequenz zwischen 31 - 65535 Hz",
|
|
||||||
ARD_TONE_WARNING: "Frequenz muss zwischen 31 - 65535 liegen",
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
export const FAQ = {
|
|
||||||
/**
|
|
||||||
* FAQ
|
|
||||||
*/
|
|
||||||
|
|
||||||
faq_q1_question: `Wie kann ich mein Programm auf die senseBox kopieren?`,
|
|
||||||
faq_q1_answer: `Um Programme auf die senseBox zu kopieren wird diese mit dem Micro USB Kabel an den Computer angeschlossen. Mache anschließend auf der senseBox MCU einen Doppelklick auf den roten Reset Button. Die senseBox wird nun als Wechseldatenträger an deinem Computer erkannt und die zuvor erstellen Programm können per Drag & Drop kopiert werden. Nach jeder Änderung des Programmcodes muss das Programm neu kompiliert und übertragen werden
|
|
||||||
#### Lernmodus der MCU aktivieren
|
|
||||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/jzlOJ7Zuqqw" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
|
|
||||||
|
|
||||||
#### Kopieren von Programmen unter MacOS
|
|
||||||
Das Kopieren der Programme unter MacOS funktioniert nicht über den Finder, es gibt es aber dennoch zwei verschiedene Möglichkeiten die Programme zu kopieren:
|
|
||||||
- [senseBox Kopiertool](https://sensebox.de/docs/senseBox_Sketch_Uploader_DE.zip)
|
|
||||||
- [muCommander](https://www.mucommander.com/)
|
|
||||||
`,
|
|
||||||
|
|
||||||
faq_q2_question: `Mit welcher senseBox ist die Programmierumgebung kompatibel?`,
|
|
||||||
faq_q2_answer: `
|
|
||||||
Grundsätzlich kann die Programmierumgebung mit jeder senseBox mit senseBox MCU verwendet werden.
|
|
||||||
`,
|
|
||||||
|
|
||||||
|
|
||||||
faq_q3_question: `Ich habe einen Fehler gefunden oder etwas funktioniert nicht. Wo kann ich diesen melden?`,
|
|
||||||
faq_q3_answer: `
|
|
||||||
Am besten legst du dazu ein Issue auf [Github](https://github.com/sensebox/React-Ardublockly/issues) an. Alternativ kannst du uns auch eine Email an info(at)sensebox.de senden
|
|
||||||
`,
|
|
||||||
}
|
|
||||||
@@ -1,108 +0,0 @@
|
|||||||
|
|
||||||
export const IO = {
|
|
||||||
|
|
||||||
ARD_ANALOGREAD: "lese analogen Pin#",
|
|
||||||
ARD_ANALOGREAD_TIP: "Gibt einen Wert zwischen 0 und 1024 zurüch",
|
|
||||||
ARD_ANALOGWRITE: "setzte analogen Pin#",
|
|
||||||
ARD_ANALOGWRITE_TIP: "Schreibe analogen Wert zwischen 0 und 255 an einen spezifischen PWM Port",
|
|
||||||
ARD_BUILTIN_LED: "eingebaute LED",
|
|
||||||
ARD_BUILTIN_LED_TIP: "Schaltet die interne LED An oder Aus",
|
|
||||||
ARD_COMPONENT_WARN1: "A %1 configuration block with the same %2 name must be added to use this block!",
|
|
||||||
ARD_DEFINE: "Definiere",
|
|
||||||
ARD_DIGITALREAD: "lesen digitalen Pin#",
|
|
||||||
ARD_DIGITALREAD_TIP: "Lese Wert an digitalen Pin: HIGH(1) oder LOW(0)",
|
|
||||||
ARD_DIGITALWRITE: "setzte digitalen Pin#",
|
|
||||||
ARD_DIGITALWRITE_TIP: "Schreibe digitalen Wert HIGH (1) oder LOW(0) an spezifischen Port",
|
|
||||||
ARD_FUN_RUN_LOOP: "Endlosschleife()",
|
|
||||||
ARD_FUN_RUN_SETUP: "Setup()",
|
|
||||||
ARD_FUN_RUN_TIP: "Definiert die setup() und loop() Funktionen. Die setup()-Funktion wird beim starten **einmal** ausgeführt. Anschließend wir die loop()-Funktion in einer **Endlosschleife** ausgeführt. Füge in die Setup()-Funktion Blöcke ein, um z.B. das Display zu initalisieren, eine Verbindung zum WiFi-Netzwerk herzustellen oder um die LoRa Verbindung zu initialsieren.",
|
|
||||||
ARD_HIGH: "HIGH",
|
|
||||||
ARD_HIGHLOW_TIP: "Setzt einen Status auf HIGH oder LOWSet a pin state logic High or Low.",
|
|
||||||
ARD_LOW: "LOW",
|
|
||||||
ARD_MAP: "Verteile Wert",
|
|
||||||
ARD_MAP_FROMMIN: "von Minimum",
|
|
||||||
ARD_MAP_FROMMAX: "bis maximum",
|
|
||||||
ARD_MAP_TOMIN: "auf Minimum",
|
|
||||||
ARD_MAP_TOMAX: "bis Maximum",
|
|
||||||
ARD_MAP_TIP: "Verteilt Werte zwischen [0-1024] zu andere.",
|
|
||||||
ARD_MAP_VAL: "Wert zu [0-",
|
|
||||||
ARD_NOTONE: "Schalte Ton aus an Pin",
|
|
||||||
ARD_NOTONE_PIN: "keinen Ton an Pin",
|
|
||||||
ARD_NOTONE_PIN_TIP: "Stoppe die Tonerzeugung an Pin",
|
|
||||||
ARD_NOTONE_TIP: "Schaltet den Ton am ausgewählten Pin aus",
|
|
||||||
ARD_PIN_WARN1: "Pin %1 wird benötigt für %2 als Pin %3. Bereitsgenutzt als %4.",
|
|
||||||
ARD_PULSETIMEOUT_TIP: "Misst die Laufzeit eines Impulses am ausgewählten Pin, wenn die Zeit ist in Microsekunden.",
|
|
||||||
ARD_PULSE_READ: "Misst %1 Impuls an Pin #%2",
|
|
||||||
ARD_PULSE_READ_TIMEOUT: "Misst %1 Impuls an Pin #%2 (Unterbrechung nach %3 μs)",
|
|
||||||
ARD_PULSE_TIP: "Misst die Zeit eines Impulses an dem ausgewählten Pin.",
|
|
||||||
ARD_SERIAL_BPS: "bps",
|
|
||||||
ARD_SERIAL_PRINT: "schreibe",
|
|
||||||
ARD_SERIAL_PRINT_NEWLINE: "neue Zeile hinzufügen",
|
|
||||||
ARD_SERIAL_PRINT_TIP: "Prints data to the console/serial port as human-readable ASCII text.", // untranslated
|
|
||||||
ARD_SERIAL_PRINT_WARN: "A setup block for %1 must be added to the workspace to use this block!", // untranslated
|
|
||||||
ARD_SERIAL_SETUP: "Setup",
|
|
||||||
ARD_SERIAL_SETUP_TIP: "Selects the speed for a specific Serial peripheral", // untranslated
|
|
||||||
ARD_SERIAL_SPEED: ": Übertragungsgeschwindigkeit zu",
|
|
||||||
ARD_SERVO_READ: "liest SERVO an PIN#",
|
|
||||||
ARD_SERVO_READ_TIP: "Liest den Winkel des Servomotors aus",
|
|
||||||
ARD_SERVO_WRITE: "setzt SERVO an Pin",
|
|
||||||
ARD_SERVO_WRITE_DEG_180: "Winkel (0~180)",
|
|
||||||
ARD_SERVO_WRITE_TIP: "Set a Servo to an specified angle", // untranslated
|
|
||||||
ARD_SERVO_WRITE_TO: "", // untranslated
|
|
||||||
ARD_SETTONE: "Spiele Ton an Pin", // untranslated
|
|
||||||
ARD_SPI_SETUP: "Setup",
|
|
||||||
ARD_SPI_SETUP_CONF: "Konfiguration:",
|
|
||||||
ARD_SPI_SETUP_DIVIDE: "clock divide", // untranslated
|
|
||||||
ARD_SPI_SETUP_LSBFIRST: "LSBFIRST", // untranslated
|
|
||||||
ARD_SPI_SETUP_MODE: "SPI mode (idle - edge)", // untranslated
|
|
||||||
ARD_SPI_SETUP_MODE0: "0 (LOW - Fallend)",
|
|
||||||
ARD_SPI_SETUP_MODE1: "1 (LOW - Steigend)",
|
|
||||||
ARD_SPI_SETUP_MODE2: "2 (HIGH - Fallend)",
|
|
||||||
ARD_SPI_SETUP_MODE3: "3 (HIGH - Steigend)",
|
|
||||||
ARD_SPI_SETUP_MSBFIRST: "MSBFIRST", // untranslated
|
|
||||||
ARD_SPI_SETUP_SHIFT: "data shift", // untranslated
|
|
||||||
ARD_SPI_SETUP_TIP: "Configures the SPI peripheral.", // untranslated
|
|
||||||
ARD_SPI_TRANSRETURN_TIP: "Send a SPI message to an specified slave device and get data back.", // untranslated
|
|
||||||
ARD_SPI_TRANS_NONE: "none", // untranslated
|
|
||||||
ARD_SPI_TRANS_SLAVE: "to slave pin", // untranslated
|
|
||||||
ARD_SPI_TRANS_TIP: "Send a SPI message to an specified slave device.", // untranslated
|
|
||||||
ARD_SPI_TRANS_VAL: "transfer", // untranslated
|
|
||||||
ARD_SPI_TRANS_WARN1: "A setup block for %1 must be added to the workspace to use this block!", // untranslated
|
|
||||||
ARD_SPI_TRANS_WARN2: "Old pin value %1 is no longer available.", // untranslated
|
|
||||||
ARD_STEPPER_COMPONENT: "stepper", // untranslated
|
|
||||||
ARD_STEPPER_DEFAULT_NAME: "MyStepper", // untranslated
|
|
||||||
ARD_STEPPER_FOUR_PINS: "4", // untranslated
|
|
||||||
ARD_STEPPER_MOTOR: "stepper motor:", // untranslated
|
|
||||||
ARD_STEPPER_NUMBER_OF_PINS: "Number of pins", // untranslated
|
|
||||||
ARD_STEPPER_PIN1: "pin1#", // untranslated
|
|
||||||
ARD_STEPPER_PIN2: "pin2#", // untranslated
|
|
||||||
ARD_STEPPER_PIN3: "pin3#", // untranslated
|
|
||||||
ARD_STEPPER_PIN4: "pin4#", // untranslated
|
|
||||||
ARD_STEPPER_REVOLVS: "how many steps per revolution", // untranslated
|
|
||||||
ARD_STEPPER_SETUP: "Setup stepper motor", // untranslated
|
|
||||||
ARD_STEPPER_SETUP_TIP: "Configures a stepper motor pinout and other settings.", // untranslated
|
|
||||||
ARD_STEPPER_SPEED: "set speed (rpm) to", // untranslated
|
|
||||||
ARD_STEPPER_STEP: "move stepper", // untranslated
|
|
||||||
ARD_STEPPER_STEPS: "steps", // untranslated
|
|
||||||
ARD_STEPPER_STEP_TIP: "Turns the stepper motor a specific number of steps.", // untranslated
|
|
||||||
ARD_STEPPER_TWO_PINS: "2", // untranslated
|
|
||||||
ARD_TYPE_ARRAY: "Array",
|
|
||||||
ARD_TYPE_BOOL: "Boolean",
|
|
||||||
ARD_TYPE_CHAR: "Zeichen",
|
|
||||||
ARD_TYPE_CHILDBLOCKMISSING: "ChildBlockMissing", // untranslated
|
|
||||||
ARD_TYPE_DECIMAL: "Dezimalzahl",
|
|
||||||
ARD_TYPE_LONG: "große Zahl",
|
|
||||||
ARD_TYPE_NULL: "Null",
|
|
||||||
ARD_TYPE_NUMBER: "Zahl",
|
|
||||||
ARD_TYPE_SHORT: "kurze Zahl",
|
|
||||||
ARD_TYPE_TEXT: "Text",
|
|
||||||
ARD_TYPE_UNDEF: "Undefiniert",
|
|
||||||
ARD_VAR_AS: "als",
|
|
||||||
ARD_VAR_AS_TIP: "Wert einem spezififischen Datentyp zuordnen",
|
|
||||||
ARD_WRITE_TO: "zu",
|
|
||||||
NEW_INSTANCE: "Neue Instanz...",
|
|
||||||
NEW_INSTANCE_TITLE: "Neue Instanz mit Name:",
|
|
||||||
RENAME_INSTANCE: "Instanz umbenennen...",
|
|
||||||
RENAME_INSTANCE_TITLE: "Benenne alle '%1' Instanzen zu:",
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
export const LOGIC = {
|
|
||||||
|
|
||||||
CONTROLS_IF_ELSEIF_TOOLTIP: "Eine weitere Bedingung hinzufügen.",
|
|
||||||
CONTROLS_IF_ELSE_TOOLTIP: "Eine sonst-Bedingung hinzufügen, führt eine Anweisung aus, falls keine Bedingung zutrifft.",
|
|
||||||
CONTROLS_IF_HELPURL: "https://github.com/google/blockly/wiki/IfElse", // untranslated
|
|
||||||
CONTROLS_IF_IF_TOOLTIP: "Hinzufügen, entfernen oder sortieren von Sektionen",
|
|
||||||
CONTROLS_IF_MSG_ELSE: "sonst",
|
|
||||||
CONTROLS_IF_MSG_ELSEIF: "sonst wenn",
|
|
||||||
CONTROLS_IF_MSG_IF: "wenn",
|
|
||||||
CONTROLS_IF_TOOLTIP_1: "Wenn eine Bedingung wahr (true) ist, dann führe eine Anweisung aus.",
|
|
||||||
CONTROLS_IF_TOOLTIP_2: "Wenn eine Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Ansonsten führe die zweite Anweisung aus.",
|
|
||||||
CONTROLS_IF_TOOLTIP_3: "Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus.",
|
|
||||||
CONTROLS_IF_TOOLTIP_4: "Wenn die erste Bedingung wahr (true) ist, dann führe die erste Anweisung aus. Oder wenn die zweite Bedingung wahr (true) ist, dann führe die zweite Anweisung aus. Falls keine der beiden Bedingungen wahr (true) ist, dann führe die dritte Anweisung aus.",
|
|
||||||
LOGIC_BOOLEAN_HELPURL: "https://github.com/google/blockly/wiki/Logic#values", // untranslated
|
|
||||||
LOGIC_BOOLEAN_TOOLTIP: "Ist entweder wahr (true) oder falsch (false)",
|
|
||||||
LOGIC_BOOLEAN_TRUE: "wahr",
|
|
||||||
LOGIC_COMPARE_HELPURL: "https://de.wikipedia.org/wiki/Vergleich_%28Zahlen%29",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_EQ: "Ist wahr (true), wenn beide Werte gleich sind.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_GT: "Ist wahr (true), wenn der erste Wert größer als der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_GTE: "Ist wahr (true), wenn der erste Wert größer als oder gleich groß wie der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_LT: "Ist wahr (true), wenn der erste Wert kleiner als der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_LTE: "Ist wahr (true), wenn der erste Wert kleiner als oder gleich groß wie der zweite Wert ist.",
|
|
||||||
LOGIC_COMPARE_TOOLTIP_NEQ: "Ist wahr (true), wenn beide Werte unterschiedlich sind.",
|
|
||||||
LOGIC_NEGATE_HELPURL: "https://github.com/google/blockly/wiki/Logic#not", // untranslated
|
|
||||||
LOGIC_NEGATE_TITLE: "nicht %1",
|
|
||||||
LOGIC_NEGATE_TOOLTIP: "Ist wahr (true), wenn der Eingabewert falsch (false) ist. Ist falsch (false), wenn der Eingabewert wahr (true) ist.",
|
|
||||||
LOGIC_NULL: "null",
|
|
||||||
LOGIC_NULL_HELPURL: "https://de.wikipedia.org/wiki/Nullwert",
|
|
||||||
LOGIC_NULL_TOOLTIP: "Ist NULL.",
|
|
||||||
LOGIC_OPERATION_AND: "und",
|
|
||||||
LOGIC_OPERATION_HELPURL: "https://github.com/google/blockly/wiki/Logic#logical-operations", // untranslated
|
|
||||||
LOGIC_OPERATION_OR: "oder",
|
|
||||||
LOGIC_OPERATION_TOOLTIP_AND: "Ist wahr (true), wenn beide Werte wahr (true) sind.",
|
|
||||||
LOGIC_OPERATION_TOOLTIP_OR: "Ist wahr (true), wenn einer der beiden Werte wahr (true) ist.",
|
|
||||||
LOGIC_TERNARY_CONDITION: "teste",
|
|
||||||
LOGIC_TERNARY_HELPURL: "https://de.wikipedia.org/wiki/%3F:#Auswahloperator",
|
|
||||||
LOGIC_TERNARY_IF_FALSE: "wenn falsch",
|
|
||||||
LOGIC_TERNARY_IF_TRUE: "wenn wahr",
|
|
||||||
LOGIC_TERNARY_TOOLTIP: "Überprüft eine Bedingung \"teste\". Wenn die Bedingung wahr ist, wird der \"wenn wahr\" Wert zurückgegeben, andernfalls der \"wenn falsch\" Wert",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Cases
|
|
||||||
*/
|
|
||||||
cases_do: "Führe aus",
|
|
||||||
cases_condition: "Fall (Variable): ",
|
|
||||||
cases_switch: "Variable",
|
|
||||||
cases_add: "Fall",
|
|
||||||
cases_tooltip: "Führt den entsprechenden Fall aus, wenn die Überprüfung der Variable TRUE ergibt. Über das Zahnrad kannst du weitere Fälle hinzufügen. Über den 'Default' fall kannst du bestimmen, was passieren soll wenn keiner der vorher definierten Fälle eingetreten ist.",
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
export const LOOPS = {
|
|
||||||
CONTROLS_FLOW_STATEMENTS_HELPURL: "https://de.wikipedia.org/wiki/Kontrollstruktur",
|
|
||||||
CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK: "Die Schleife abbrechen",
|
|
||||||
CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE: "mit der nächsten Iteration der Schleife fortfahren",
|
|
||||||
CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK: "Die umgebende Schleife beenden.",
|
|
||||||
CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE: "Diese Anweisung abbrechen und mit dem nächsten Schleifendurchlauf fortfahren.",
|
|
||||||
CONTROLS_FLOW_STATEMENTS_WARNING: "Warnung: Dieser Block sollte nur in einer Schleife verwendet werden.",
|
|
||||||
CONTROLS_FOREACH_HELPURL: "https://de.wikipedia.org/wiki/For-Schleife",
|
|
||||||
CONTROLS_FOREACH_TITLE: "Für Wert %1 aus der Liste %2",
|
|
||||||
CONTROLS_FOREACH_TOOLTIP: "Führe eine Anweisung für jeden Wert in der Liste aus und setzte dabei die Variable \"%1\" auf den aktuellen Listenwert.",
|
|
||||||
CONTROLS_FOR_HELPURL: "https://de.wikipedia.org/wiki/For-Schleife",
|
|
||||||
CONTROLS_FOR_TITLE: "Zähle %1 von %2 bis %3 mit %4",
|
|
||||||
CONTROLS_FOR_TOOLTIP: "Zähle die Variable \"%1\" von einem Startwert bis zu einem Zielwert und führe für jeden Wert eine Anweisung aus.",
|
|
||||||
|
|
||||||
CONTROLS_REPEAT_HELPURL: "https://de.wikipedia.org/wiki/For-Schleife",
|
|
||||||
CONTROLS_REPEAT_INPUT_DO: "mache",
|
|
||||||
CONTROLS_REPEAT_TITLE: "Wiederhole %1 mal",
|
|
||||||
CONTROLS_REPEAT_TOOLTIP: "Eine Anweisung mehrfach ausführen.",
|
|
||||||
CONTROLS_WHILEUNTIL_HELPURL: "https://de.wikipedia.org/wiki/Schleife_%28Programmierung%29",
|
|
||||||
CONTROLS_WHILEUNTIL_OPERATOR_UNTIL: "Wiederhole bis",
|
|
||||||
CONTROLS_WHILEUNTIL_OPERATOR_WHILE: "Wiederhole solange",
|
|
||||||
CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL: "Führe die Anweisung solange aus wie die Bedingung falsch (false) ist.",
|
|
||||||
CONTROLS_WHILEUNTIL_TOOLTIP_WHILE: "Führe die Anweisung solange aus wie die Bedingung wahr (true) ist.",
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
|
|
||||||
export const MATH = {
|
|
||||||
MATH_ADDITION_SYMBOL: "+", // untranslated
|
|
||||||
MATH_ARITHMETIC_HELPURL: "https://de.wikipedia.org/wiki/Grundrechenart",
|
|
||||||
MATH_ARITHMETIC_TOOLTIP_ADD: "Ist die Summe zweier Werte.",
|
|
||||||
MATH_ARITHMETIC_TOOLTIP_DIVIDE: "Ist der Quotient zweier Werte.",
|
|
||||||
MATH_ARITHMETIC_TOOLTIP_MINUS: "Ist die Differenz zweier Werte.",
|
|
||||||
MATH_ARITHMETIC_TOOLTIP_MULTIPLY: "Ist das Produkt zweier Werte.",
|
|
||||||
MATH_ARITHMETIC_TOOLTIP_POWER: "Ist der erste Wert potenziert mit dem zweiten Wert.",
|
|
||||||
MATH_CHANGE_HELPURL: "https://de.wikipedia.org/wiki/Inkrement_und_Dekrement",
|
|
||||||
MATH_CHANGE_TITLE: "erhöhe %1 um %2",
|
|
||||||
MATH_CHANGE_TOOLTIP: "Addiert einen Wert zur Variable \"%1\" hinzu.",
|
|
||||||
MATH_CONSTANT_HELPURL: "https://de.wikipedia.org/wiki/Mathematische_Konstante",
|
|
||||||
MATH_CONSTANT_TOOLTIP: "Mathematische Konstanten wie: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…) oder ∞ (unendlich).",
|
|
||||||
MATH_CONSTRAIN_HELPURL: "https://en.wikipedia.org/wiki/Clamping_%28graphics%29", // untranslated
|
|
||||||
MATH_CONSTRAIN_TITLE: "begrenze %1 von %2 bis %3",
|
|
||||||
MATH_CONSTRAIN_TOOLTIP: "Begrenzt den Wertebereich auf den \"von\"-Wert bis einschließlich zum \"bis\"-Wert. (inklusiv)",
|
|
||||||
MATH_DIVISION_SYMBOL: "÷", // untranslated
|
|
||||||
MATH_IS_DIVISIBLE_BY: "ist teilbar durch",
|
|
||||||
MATH_IS_EVEN: "ist gerade",
|
|
||||||
MATH_IS_NEGATIVE: "ist negativ",
|
|
||||||
MATH_IS_ODD: "ist ungerade",
|
|
||||||
MATH_IS_POSITIVE: "ist positiv",
|
|
||||||
MATH_IS_PRIME: "ist eine Primzahl",
|
|
||||||
MATH_IS_TOOLTIP: "Überprüft ob eine Zahl gerade, ungerade, eine Primzahl, ganzzahlig, positiv, negativ oder durch eine zweite Zahl teilbar ist. Gibt wahr (true) oder falsch (false) zurück.",
|
|
||||||
MATH_IS_WHOLE: "ist eine ganze Zahl",
|
|
||||||
MATH_MODULO_HELPURL: "https://de.wikipedia.org/wiki/Modulo",
|
|
||||||
MATH_MODULO_TITLE: "Rest von %1 ÷ %2",
|
|
||||||
MATH_MODULO_TOOLTIP: "Der Rest nach einer Division.",
|
|
||||||
MATH_MULTIPLICATION_SYMBOL: "×",
|
|
||||||
MATH_NUMBER_HELPURL: "https://de.wikipedia.org/wiki/Zahl",
|
|
||||||
MATH_NUMBER_TOOLTIP: "Eine Zahl.",
|
|
||||||
MATH_ONLIST_HELPURL: "http://www.sysplus.ch/einstieg.php?links:menu&seite:4125&grad:Crash&prog:Excel",
|
|
||||||
MATH_ONLIST_OPERATOR_AVERAGE: "Mittelwert einer Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_MAX: "Maximalwert einer Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_MEDIAN: "Median einer Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_MIN: "Minimalwert einer Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_MODE: "am häufigsten in Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_RANDOM: "Zufallswert einer Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_STD_DEV: "Standardabweichung einer Liste",
|
|
||||||
MATH_ONLIST_OPERATOR_SUM: "Summe einer Liste",
|
|
||||||
MATH_ONLIST_TOOLTIP_AVERAGE: "Ist der Durchschnittswert aller Werte in einer Liste.",
|
|
||||||
MATH_ONLIST_TOOLTIP_MAX: "Ist der größte Wert in einer Liste.",
|
|
||||||
MATH_ONLIST_TOOLTIP_MEDIAN: "Ist der Median aller Werte in einer Liste.",
|
|
||||||
MATH_ONLIST_TOOLTIP_MIN: "Ist der kleinste Wert in einer Liste.",
|
|
||||||
MATH_ONLIST_TOOLTIP_MODE: "Findet den am häufigsten vorkommenden Wert in einer Liste. Falls kein Wert öfter vorkommt als alle anderen, wird die originale Liste zurückgeben",
|
|
||||||
MATH_ONLIST_TOOLTIP_RANDOM: "Gebe einen zufälligen Wert aus der Liste zurück.",
|
|
||||||
MATH_ONLIST_TOOLTIP_STD_DEV: "Ist die standardisierte Standardabweichung aller Werte in der Liste",
|
|
||||||
MATH_ONLIST_TOOLTIP_SUM: "Ist die Summe aller Werte in einer Liste.",
|
|
||||||
MATH_POWER_SYMBOL: "^",
|
|
||||||
MATH_RANDOM_FLOAT_HELPURL: "https://de.wikipedia.org/wiki/Zufallszahlen",
|
|
||||||
MATH_RANDOM_FLOAT_TITLE_RANDOM: "Zufallszahl (0.0 -1.0)",
|
|
||||||
MATH_RANDOM_FLOAT_TOOLTIP: "Erzeuge eine Zufallszahl zwischen 0.0 (inklusiv) und 1.0 (exklusiv).",
|
|
||||||
MATH_RANDOM_INT_HELPURL: "https://de.wikipedia.org/wiki/Zufallszahlen",
|
|
||||||
MATH_RANDOM_INT_TITLE: "ganzzahliger Zufallswert zwischen %1 bis %2",
|
|
||||||
MATH_RANDOM_INT_TOOLTIP: "Erzeuge einen ganzzahligen Zufallswert zwischen zwei Werten (inklusiv).",
|
|
||||||
MATH_ROUND_HELPURL: "https://de.wikipedia.org/wiki/Runden",
|
|
||||||
MATH_ROUND_OPERATOR_ROUND: "runden",
|
|
||||||
MATH_ROUND_OPERATOR_ROUNDDOWN: "abrunden",
|
|
||||||
MATH_ROUND_OPERATOR_ROUNDUP: "aufrunden",
|
|
||||||
MATH_ROUND_TOOLTIP: "Eine Zahl auf- oder abrunden.",
|
|
||||||
MATH_SINGLE_HELPURL: "https://de.wikipedia.org/wiki/Quadratwurzel",
|
|
||||||
MATH_SINGLE_OP_ABSOLUTE: "Absolutwert",
|
|
||||||
MATH_SINGLE_OP_ROOT: "Quadratwurzel",
|
|
||||||
MATH_SINGLE_TOOLTIP_ABS: "Ist der Absolutwert eines Wertes.",
|
|
||||||
MATH_SINGLE_TOOLTIP_EXP: "Ist Wert der Exponentialfunktion eines Wertes.",
|
|
||||||
MATH_SINGLE_TOOLTIP_LN: "Ist der natürliche Logarithmus eines Wertes.",
|
|
||||||
MATH_SINGLE_TOOLTIP_LOG10: "Ist der dekadische Logarithmus eines Wertes.",
|
|
||||||
MATH_SINGLE_TOOLTIP_NEG: "Negiert einen Wert.",
|
|
||||||
MATH_SINGLE_TOOLTIP_POW10: "Rechnet 10 hoch Eingabewert.",
|
|
||||||
MATH_SINGLE_TOOLTIP_ROOT: "Ist die Quadratwurzel eines Wertes.",
|
|
||||||
MATH_SUBTRACTION_SYMBOL: "-",
|
|
||||||
MATH_TRIG_ACOS: "acos",
|
|
||||||
MATH_TRIG_ASIN: "asin",
|
|
||||||
MATH_TRIG_ATAN: "atan",
|
|
||||||
MATH_TRIG_COS: "cos",
|
|
||||||
MATH_TRIG_HELPURL: "https://de.wikipedia.org/wiki/Trigonometrie",
|
|
||||||
MATH_TRIG_SIN: "sin",
|
|
||||||
MATH_TRIG_TAN: "tan",
|
|
||||||
MATH_TRIG_TOOLTIP_ACOS: "Ist der Arkuskosinus des Eingabewertes.",
|
|
||||||
MATH_TRIG_TOOLTIP_ASIN: "Ist der Arkussinus des Eingabewertes.",
|
|
||||||
MATH_TRIG_TOOLTIP_ATAN: "Ist der Arkustangens des Eingabewertes.",
|
|
||||||
MATH_TRIG_TOOLTIP_COS: "Ist der Kosinus des Winkels.",
|
|
||||||
MATH_TRIG_TOOLTIP_SIN: "Ist der Sinus des Winkels.",
|
|
||||||
MATH_TRIG_TOOLTIP_TAN: "Ist der Tangens des Winkels.",
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
|
|
||||||
export const MQTT = {
|
|
||||||
/**
|
|
||||||
* MQTT
|
|
||||||
*/
|
|
||||||
senseBox_mqtt_init: "Verbinde mit MQTT Broker",
|
|
||||||
senseBox_mqtt_server: "Server",
|
|
||||||
senseBox_mqtt_port: "Port",
|
|
||||||
senseBox_mqtt_username: "Benutzername",
|
|
||||||
senseBox_mqtt_password: "Passwort",
|
|
||||||
sensebox_mqtt_subscribe: "Subscribe to Feed",
|
|
||||||
senseBox_mqtt_publish: "Sende an Feed/Topic",
|
|
||||||
senseBox_mqtt_init_tooltip: "Initialisiere die Verbindung zu dem MQTT Broker. Verwende diesen Block innerhalb der setup()-Funktion und stelle zuerst eine Verbindung mit dem Wlan Netzwerk her.",
|
|
||||||
senseBox_mqtt_publish_tooltip: "Sende etwas an ein 'Topic' deines MQTT Brokers.",
|
|
||||||
}
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
|
|
||||||
export const DISPLAY = {
|
|
||||||
/**
|
|
||||||
* Display
|
|
||||||
*/
|
|
||||||
|
|
||||||
senseBox_display_beginDisplay: "Display initialisieren",
|
|
||||||
senseBox_display_beginDisplay_tooltip: `Initialisiert das Display. Dieser Block muss im Setup() verwendet werden.
|
|
||||||
|
|
||||||
**Anschluss:** I2C
|
|
||||||
`,
|
|
||||||
senseBox_display_clearDisplay_tooltip: "Löscht die Anzeige auf dem Display. Sollte immer zu Begin oder am Ende der Endlosschleife aufgerufen werden.",
|
|
||||||
senseBox_display_clearDisplay: "Display löschen",
|
|
||||||
senseBox_display_printDisplay: "Schreibe Text/Zahl",
|
|
||||||
senseBox_display_printDisplay_tooltip: "Zeigt eine Zahl/Text auf dem Display an. Über die X- und Y-Koordinaten kann die Position auf dem Display bestimmt werden. Die Schriftgröße lässt sich in ganzzahligen Werten zwischen 1 und 4 einstellen. Das Display hat eine Auflösung von 128x64 Pixeln (X- und Y-Achse)",
|
|
||||||
senseBox_display_printDisplay_x: "x-Koordinate",
|
|
||||||
senseBox_display_printDisplay_y: "y-Koordinate",
|
|
||||||
senseBox_display_printDisplay_value: "Wert",
|
|
||||||
senseBox_display_setSize: "Schriftgröße",
|
|
||||||
senseBox_display_setSize_tip: "Ändere die Schriftgröße auf einen Wert zwischen 1 und 10.",
|
|
||||||
senseBox_display_color: "Schriftfarbe",
|
|
||||||
senseBox_display_white: "Weiß",
|
|
||||||
senseBox_display_black: "Schwarz",
|
|
||||||
sensebox_display_show: "Zeige auf dem Display",
|
|
||||||
sensebox_display_show_tip: "Zeigt den Nachfolgenden Inhalt auf dem Bildschirm",
|
|
||||||
senseBox_dipslay_plotTitle: "Titel",
|
|
||||||
senseBox_display_plotDisplay: "Zeichne Diagramm",
|
|
||||||
senseBox_display_plotXLabel: "X-Achsen Beschriftung",
|
|
||||||
senseBox_display_plotYLabel: "Y-Achsen Beschriftung",
|
|
||||||
senseBox_display_plotXRange1: "X-Wertebereich Anfang",
|
|
||||||
senseBox_display_plotXRange2: "X-Wertebereich Ende",
|
|
||||||
senseBox_display_plotYRange1: "Y-Wertebereich Anfang",
|
|
||||||
senseBox_display_plotYRange2: "Y-Wertebereich Ende",
|
|
||||||
senseBox_display_plotXTick: "X-Linienabstand",
|
|
||||||
senseBox_display_plotYTick: "Y-Linienabstand",
|
|
||||||
senseBox_display_plotTimeFrame: "Zeitabschnitt",
|
|
||||||
sensebox_display_fillCircle: "Zeichne Punkt",
|
|
||||||
sensebox_display_fillCircle_radius: "Radius",
|
|
||||||
senseBox_display_fillCircle_tooltip: "Mit diesem Block kann ein Punkt auf dem Display angezeigt werden. Über die Koordinaten kannst du den Punkt auf dem Display platzieren und mithilfe des Radius die Größe bestimmen.",
|
|
||||||
sensebox_display_drawRectangle: "Zeichne Rechteck",
|
|
||||||
sensebox_display_drawRectangle_width: "Breite",
|
|
||||||
sensebox_display_drawRectangle_height: "Höhe",
|
|
||||||
senseBox_display_drawRectangle_tooltip: "Dieser Block zeichnet ein Rechteck auf das Display. Mit den X- und Y-Koordinaten wird die Position der oberen linken Ecke des Rechtecks auf dem Display bestimmt. Die Höhe und Breite wird in Pixeln angegeben und mit der Checkbox 'Ausgefüllt' kann ausgewählt werden ob das Rechteck ausgefüllt oder nur als Rahmen angezeigt wird.",
|
|
||||||
senseBox_display_filled: "Ausgefüllt",
|
|
||||||
senseBox_display_fastPrint_show: "Zeige Messwerte",
|
|
||||||
senseBox_display_fastPrint_title: "Titel",
|
|
||||||
senseBox_display_fastPrint_value: "Messwert",
|
|
||||||
senseBox_display_fastPrint_dimension: "Einheit",
|
|
||||||
sensebox_display_fastPrint_tooltip: "Zeigt zwei Messwerte auf dem Display an. Wähle eine Überschrift für jeden Messwert und gib die Einheit an.",
|
|
||||||
senseBox_display_helpurl: "https://docs.sensebox.de/blockly/blockly-display/"
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
export const LED = {
|
|
||||||
/**
|
|
||||||
* WS2818 RGB LED
|
|
||||||
*/
|
|
||||||
senseBox_ws2818_rgb_led: "Setze RGB-LED an",
|
|
||||||
senseBox_ws2818_rgb_led_init: "RGB LED (WS2818) initialisieren",
|
|
||||||
senseBox_ws2818_rgb_led_position: "Position",
|
|
||||||
senseBox_ws2818_rgb_led_brightness: "Helligkeit",
|
|
||||||
senseBox_ws2818_rgb_led_tooltip: "Verändere mit diesem Block die Farbe deiner RGB-LED. Verbinde einen Block für die Farbe. Wenn mehrere RGB-LEDs miteinander verkettet werden kannst du über die Position bestimmen welche LED angesteuert wird. ",
|
|
||||||
senseBox_ws2818_rgb_led_init_tooltip: "Schließe die RGB-LED an einen der drei **digital/analog Ports** an. Wenn mehrere RGB-LEDs miteinander verkettet werden kannst du über die Position bestimmen welche LED angesteuert wird. ",
|
|
||||||
senseBox_ws2818_rgb_led_color: "Farbe",
|
|
||||||
senseBox_ws2818_rgb_led_number: "Anzahl",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Color
|
|
||||||
*/
|
|
||||||
|
|
||||||
COLOUR_BLEND_COLOUR1: "Farbe 1",
|
|
||||||
COLOUR_BLEND_COLOUR2: "mit Farbe 2",
|
|
||||||
COLOUR_BLEND_HELPURL: "http://meyerweb.com/eric/tools/color-blend/",
|
|
||||||
COLOUR_BLEND_RATIO: "im Verhältnis",
|
|
||||||
COLOUR_BLEND_TITLE: "mische",
|
|
||||||
COLOUR_BLEND_TOOLTIP: "Vermische 2 Farben mit konfigurierbaren Farbverhältnis (0.0 - 1.0).",
|
|
||||||
COLOUR_PICKER_HELPURL: "https://de.wikipedia.org/wiki/Farbe",
|
|
||||||
COLOUR_PICKER_TOOLTIP: "Wähle eine Farbe aus der Palette. Die Farbe wird automatisch in RGB-Werte konvertiert.",
|
|
||||||
COLOUR_RANDOM_HELPURL: "http://randomcolour.com", // untranslated
|
|
||||||
COLOUR_RANDOM_TITLE: "zufällige Farbe",
|
|
||||||
COLOUR_RANDOM_TOOLTIP: "Erstelle eine Farbe nach dem Zufallsprinzip.",
|
|
||||||
COLOUR_RGB_BLUE: "blau",
|
|
||||||
COLOUR_RGB_GREEN: "grün",
|
|
||||||
COLOUR_RGB_HELPURL: "https://de.wikipedia.org/wiki/RGB-Farbraum",
|
|
||||||
COLOUR_RGB_RED: "rot",
|
|
||||||
COLOUR_RGB_TITLE: "Farbe mit",
|
|
||||||
COLOUR_RGB_TOOLTIP: "Erstelle eine Farbe mit selbst definierten Rot-, Grün- und Blauwerten. Alle Werte müssen zwischen 0 und 255 liegen. 0 ist hierbei die geringte Intensität der Farbe 255 die höchste.",
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
export const LORA = {
|
|
||||||
/*
|
|
||||||
* LoRa Blöcke
|
|
||||||
*/
|
|
||||||
|
|
||||||
senseBox_LoRa_connect: "Zu TTN senden",
|
|
||||||
senseBox_LoRa_device_id: "Device EUI (lsb)",
|
|
||||||
senseBox_LoRa_app_id: "Application EUI (lsb)",
|
|
||||||
senseBox_LoRa_app_key: "App Key (msb)",
|
|
||||||
senseBox_LoRa_nwskey_id: "Network Session Key (msb)",
|
|
||||||
senseBox_LoRa_appskey_id: "App Session Key (msb)",
|
|
||||||
senseBox_LoRa_devaddr_id: "Device Adress",
|
|
||||||
senseBox_LoRa_interval: "Intervall in Minuten",
|
|
||||||
senseBox_measurement: "Messung",
|
|
||||||
senseBox_measurements: "Messungen",
|
|
||||||
|
|
||||||
senseBox_LoRa_send_message: "Sende als Lora Nachricht",
|
|
||||||
senseBox_LoRa_send_cayenne: "Sende als Cayenne Nachricht",
|
|
||||||
senseBox_LoRa_cayenne_temperature: "Temperatur",
|
|
||||||
senseBox_LoRa_cayenne_channel: "Kanal",
|
|
||||||
senseBox_LoRa_cayenne_humidity: "Luftfeuchtigkeit",
|
|
||||||
senseBox_LoRa_cayenne_pressure: "Luftdruck",
|
|
||||||
senseBox_LoRa_cayenne_luminosity: "Helligkeit",
|
|
||||||
senseBox_LoRa_cayenne_analog: "Analoger Wert",
|
|
||||||
senseBox_LoRa_cayenne_x: "X Wert",
|
|
||||||
senseBox_LoRa_cayenne_y: "Y Wert",
|
|
||||||
senseBox_LoRa_cayenne_z: "Z Wert",
|
|
||||||
senseBox_LoRa_cayenne_lat: "Breitengrad",
|
|
||||||
senseBox_LoRa_cayenne_lng: "Längengrad",
|
|
||||||
senseBox_LoRa_cayenne_alt: "Höhe",
|
|
||||||
|
|
||||||
senseBox_LoRa_cayenne_tip: "Sende Daten als Cayenne Payload Format",
|
|
||||||
senseBox_LoRa_cayenne_gps_tip: "Sende GPS",
|
|
||||||
senseBox_LoRa_cayenne_temperature_tip: "Sendet Temperaturwert mit einer Nachkommastelle",
|
|
||||||
senseBox_LoRa_cayenne_pressure_tip: "Sendet Luftdruck mit einer Nachkommastelle",
|
|
||||||
senseBox_LoRa_cayenne_luminosity_tip: "Sendet Helligkeitswert",
|
|
||||||
senseBox_LoRa_cayenne_analog_tip: "Sendet einen Dezimalwert mit einer Nachkommastelle",
|
|
||||||
|
|
||||||
senseBox_LoRa_message_tooltip: "Sende eine Nachricht über LoRa",
|
|
||||||
senseBox_LoRa_sensor_tip: "Sende einen Sensorwert mit einer bestimmten Anzahl an Bytes",
|
|
||||||
senseBox_LoRa_init_abp_tooltip: "Initialisiere die LoRa übertragung. Die Aktivierung erfolgt über ABP. Registriere eine Application auf [thethingsnetwork](https://thethingsnetwork.com) und kopiere den **Network Session Key** und den **App Session Key** im **msb Format** und die **Device ID** im **hex Format**.",
|
|
||||||
senseBox_LoRa_init_helpurl: "https://docs.sensebox.de/blockly/blockly-web-lora/",
|
|
||||||
senseBox_LoRa_init_otaa_tooltip: "Initialisiere die LoRa übertragung. Die Aktivierung erfolgt über OTAA. Registriere eine Application auf [thethingsnetwork](https://thethingsnetwork.com) und kopiere die **DEVICE EUI** und die **Application EUI** im **lsb Format** den **App Key** im **msb Format**.",
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
export const OSEM = {
|
|
||||||
/**
|
|
||||||
* openSenseMap
|
|
||||||
*/
|
|
||||||
senseBox_osem_connection_tip: "stellt eine WLAN verbindung her",
|
|
||||||
senseBox_send_to_osem_tip: "sende Messwert an",
|
|
||||||
senseBox_send_to_osem: "Sende Messwert an die openSenseMap",
|
|
||||||
senseBox_osem_connection: "Verbinde mit openSenseMap:",
|
|
||||||
senseBox_osem_host: "opensensemap.org",
|
|
||||||
senseBox_osem_host_workshop: "workshop.opensensemap.org",
|
|
||||||
senseBox_osem_exposure: "Typ",
|
|
||||||
senseBox_osem_stationary: "Stationär",
|
|
||||||
senseBox_osem_mobile: "Mobil",
|
|
||||||
senseBox_osem_access_token: "API Schlüssel",
|
|
||||||
senseBox_send_mobile_to_osem: "Sende Messwert und Standort an die openSenseMap",
|
|
||||||
senseBox_send_mobile_to_osem_tip: "Sende Messwert und Standort an die openSenseMap",
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
export const SD = {
|
|
||||||
/**
|
|
||||||
* SD-Block
|
|
||||||
*/
|
|
||||||
senseBox_sd_create_file: "Erstelle Datei auf SD-Karte",
|
|
||||||
senseBox_sd_write_file: "Schreibe Daten auf SD-Karte",
|
|
||||||
senseBox_sd_open_file: "Öffne Datei auf der SD-Karte",
|
|
||||||
senseBox_sd_create_file_tooltip:
|
|
||||||
"Erstellt eine Datei auf der Karte. Stecke das SD-Bee auf den Steckplatz **XBEE2**. Die **maximale** Länge des Dateinamen sind **8 Zeichen**. Die Datei sollte zuerst im *Setup()* erstellt werden",
|
|
||||||
senseBox_sd_write_file_tooptip:
|
|
||||||
"Schreibe Daten auf die SD-Karte. Beachte, dass die Datei zuerst geöffnet werden muss.",
|
|
||||||
senseBox_sd_open_file_tooltip:
|
|
||||||
"Öffne die Datei auf der SD-Karte, um Dateien zu speichern. Am Ende der Schleife wird die Datei automatisch wieder geschlossen.",
|
|
||||||
sensebox_sd_filename: "Daten",
|
|
||||||
senseBox_sd_decimals: "Dezimalen",
|
|
||||||
};
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
export const SENSORS = {
|
|
||||||
/**
|
|
||||||
* Sensors
|
|
||||||
* ---------------------------------------------------
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BMP280
|
|
||||||
*/
|
|
||||||
senseBox_pressure_sensor: "Luftdruck-/Temperatursensor (BMP280)",
|
|
||||||
senseBox_pressure: "Luftdruck in Pa",
|
|
||||||
senseBox_pressure_dimension: "Luftdruck in Pa",
|
|
||||||
senseBox_pressure_tip: "Schließe den Sensor an einen der 5 **I2C-Anschlüsse** an. Der Sensor gibt dir den Messwert für den Luftdruck in Pa. Um die korrekte Höhe über NN zu berechnen benötigt der Sensor einen aktuellen Referenzwert.",
|
|
||||||
senseBox_pressure_referencePressure: "Luftdruck auf NN",
|
|
||||||
senseBox_pressure_referencePressure_dim: "hPa",
|
|
||||||
senseBox_pressure_helpurl: "",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mikro
|
|
||||||
*/
|
|
||||||
senseBox_sound: "Mikrofon",
|
|
||||||
senseBox_sound_tip: "Schließe den Sensor über das Breadbord an einen der 3 **analog/digital** Ports an. Gibt den Messwert des Mikrofons in Volt zurück",
|
|
||||||
senseBox_sound_helpurl: "https://docs.sensebox.de/hardware/sensoren-mikro/",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Temperature and Humidity Sensor (HDC1080)
|
|
||||||
*/
|
|
||||||
senseBox_temp: "Temperatur in °C",
|
|
||||||
senseBox_temp_hum: "Temperatur-/Luftfeuchtigkeitssensor (HDC1080)",
|
|
||||||
senseBox_temp_hum_tooltip: "Dieser Block gibt dir die Messwerte des Temperatur- und Luftfeuchtigkeitssensor zurück. Schließe den Sensor an einen der 5 I2C Anschlüsse an. Messwert wird mit 2 Nachkommastellen ausgegeben.",
|
|
||||||
senseBox_temp_hum_helpurl: "https://docs.sensebox.de/hardware/sensoren-temperatur-luftfeuchte/",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Ultraschalldistanzsensor
|
|
||||||
*/
|
|
||||||
|
|
||||||
senseBox_ultrasonic: "Ultraschall-Abstandssensor an Port",
|
|
||||||
senseBox_ultrasonic_trigger: "Trigger",
|
|
||||||
senseBox_ultrasonic_echo: "Echo",
|
|
||||||
senseBox_ultrasonic_port_A: "A",
|
|
||||||
senseBox_ultrasonic_port_B: "B",
|
|
||||||
senseBox_ultrasonic_port_C: "C",
|
|
||||||
senseBox_ultrasonic_tooltip: `Misst die Distanz mithilfe von Ultraschall in cm. Schließe den Sensor an einen der drei Digital/Analog Ports an:
|
|
||||||
|
|
||||||
- Trigger: Grünes Kabel
|
|
||||||
- Echo: gelbes Kabel`,
|
|
||||||
senseBox_ultrasonic_helpurl: "https://docs.sensebox.de/hardware/sensoren-distanz/",
|
|
||||||
/**
|
|
||||||
* UV and Lightsensor
|
|
||||||
*/
|
|
||||||
senseBox_value: "Messwert:",
|
|
||||||
senseBox_uv_light: "Helligkeit-/UV-Sensor",
|
|
||||||
senseBox_uv_light_tooltip: "Sensor misst UV-Licht oder die Helligkeit. Die Helligkeit wird als **Ganzezahl** in Lux ausgegeben. Die UV-Intensität als **Kommazahl** in µW/cm².",
|
|
||||||
senseBox_uv: "UV-Intensität in µW/cm²",
|
|
||||||
senseBox_light: "Beleuchtungsstärke in Lux",
|
|
||||||
senseBox_uv_light_helpurl: "https://docs.sensebox.de/hardware/sensoren-helligkeit-uv/",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BMX055
|
|
||||||
*/
|
|
||||||
|
|
||||||
senseBox_bmx055_compass: "Lage Sensor",
|
|
||||||
senseBox_bmx055_accelerometer: "Beschleunigungssensor",
|
|
||||||
senseBox_bmx055_accelerometer_range: "Messbereich",
|
|
||||||
senseBox_bmx055_accelerometer_range_2g: "2g",
|
|
||||||
senseBox_bmx055_accelerometer_range_4g: "4g",
|
|
||||||
senseBox_bmx055_accelerometer_range_8g: "8g",
|
|
||||||
senseBox_bmx055_accelerometer_range_16g: "16g",
|
|
||||||
senseBox_bmx055_accelerometer_direction: "Richtung",
|
|
||||||
senseBox_bmx055_accelerometer_direction_x: "X-Achse",
|
|
||||||
senseBox_bmx055_accelerometer_direction_y: "Y-Achse",
|
|
||||||
senseBox_bmx055_accelerometer_direction_z: "Z-Achse",
|
|
||||||
senseBox_bmx055_accelerometer_direction_total: "Gesamt",
|
|
||||||
senseBox_bmx055_gyroscope: "Lage Sensor",
|
|
||||||
senseBox_bmx055_accelerometer_tip: "Lage Sensor",
|
|
||||||
senseBox_bmx055_compass_tip: "Lage Sensor",
|
|
||||||
senseBox_bmx055_gyroscope_tip: "Lage Sensor",
|
|
||||||
senseBox_bmx055_x: "X-Richtung",
|
|
||||||
senseBox_bmx055_y: "Y-Richtung",
|
|
||||||
senseBox_bmx055_accelerometer_tooltip: `Dieser Block gibt dir den Messwert des Beschleunigungssensors der direkt auf der senseBox MCU aufgelötet ist. Im Dropdown Menü kannst du die Richtung und den Messbereich auswählen.`,
|
|
||||||
senseBox_bmx055_helpurl: "",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* GPS
|
|
||||||
*/
|
|
||||||
senseBox_gps_getValues: "GPS Modul",
|
|
||||||
senseBox_gps_lat: "Breitengrad",
|
|
||||||
senseBox_gps_lng: "Längengrad",
|
|
||||||
senseBox_gps_alt: "Höhe über NN in m",
|
|
||||||
senseBox_gps_speed: "Geschwindigkeit in km/h",
|
|
||||||
senseBox_gps_date: "Datum",
|
|
||||||
senseBox_gps_time: "Uhrzeit",
|
|
||||||
senseBox_gps_timeStamp: "Zeitstempel (RFC 3339)",
|
|
||||||
senseBox_gps_tooltip: `Liest das GPS Modul aus und gibt dir die Standortinformationen. Längen- und Breitengrad werden als Kommazahl mit 6 Nachkommastellen ausgegeben.
|
|
||||||
**Anschluss: I2C**
|
|
||||||
|
|
||||||
**Beachte:** Das GPS Modul benöigt beim ersten Verwenden relativ lange (ca. 5-10 Minuten) bis es deinen Standort gefunden hat!
|
|
||||||
`,
|
|
||||||
senseBox_gps_helpurl: "https://docs.sensebox.de/hardware/sensoren-gps/",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Windspeed
|
|
||||||
*/
|
|
||||||
senseBox_windspeed: "Windgeschwindigkeitssensor",
|
|
||||||
senseBox_windspeed_tooltip: "",
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Soundsensor
|
|
||||||
*/
|
|
||||||
senseBox_soundsensor_dfrobot: "Soundsensor (DF Robot)",
|
|
||||||
senseBox_soundsensor_dfrobot_tooltip: "Schließe den Sensor an einen der 3 **digital/analog Ports** an. Der Sensor gibt dir den Messwert in dB mit einer Nachkommastelle",
|
|
||||||
senseBox_soundsensor_dfrobot_helpurl: "https://docs.sensebox.de/hardware/sensoren-lautstaerke/",
|
|
||||||
/*
|
|
||||||
* BME680
|
|
||||||
*/
|
|
||||||
|
|
||||||
senseBox_bme680: "Umweltsensor (BME680)",
|
|
||||||
senseBox_bme_iaq: "Innenraumluftqualität (IAQ)",
|
|
||||||
senseBox_bme_iaq_accuracy: "Kalibrierungswert",
|
|
||||||
senseBox_bme_co2: "CO2 Äquivalent",
|
|
||||||
senseBox_bme_breatheVocEquivalent: "Atemluft VOC Äquivalent",
|
|
||||||
senseBox_bme_tooltip: `Schließe den Umweltsensor an einen der 5 **I2C-Anschlüsse** an. **Beachte:** Der Sensor benöigt eine gewisse Zeit zum kalibrieren.
|
|
||||||
Den Status der Kalibrierung kann über den Kalibrierungswert abgelesen werden. Er ist entweder 0, 1, 2 oder 3 und sagt folgendes aus:
|
|
||||||
|
|
||||||
- IAQ Accuracy : 0 heißt Sensor wird stabilisiert (dauert ca. 25 Minuten) oder dass es eine Zeitüberschreitung gab,
|
|
||||||
- IAQ Accuracy : 1 heißt Wert ist ungenau,
|
|
||||||
- IAQ Accuracy : 2 heißt Sensor wird kalibriert,
|
|
||||||
- IAQ Accuracy : 3 heißt Sensor erfolgreich kalibriert.
|
|
||||||
|
|
||||||
Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt verwendet werden.`,
|
|
||||||
senseBox_bme680_helpurl: "https://docs.sensebox.de/hardware/sensoren-umweltsensor/",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Truebner SMT50
|
|
||||||
*/
|
|
||||||
senseBox_smt50: "Bodenfeuchte/-temperatur (SMT50)",
|
|
||||||
senseBox_smt50_helpurl: "https://docs.sensebox.de/hardware/sensoren-truebner/",
|
|
||||||
senseBox_smt50_tooltip: "Schließe den Bodenfeuchtigkeit- und Temperatursensor an einen der 3 digital/analog Ports an und wähle den Port im Block aus. Der Sensor gibt die Bodentemperatur in °C und die Bodenfeuchtigkeit in % aus.",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* SCD30 CO2 Sensor
|
|
||||||
*/
|
|
||||||
senseBox_scd30: "CO2 Sensor (Sensirion SCD30)",
|
|
||||||
senseBox_scd_tooltip: "Schließe den Sensor an einen der 5 **I2C-Anschlüsse** an. Der Sensor gibt dir den Messwert für die CO2-Konzentration in ppm. Der Temperaturmesswert kann aufgrund der Messung direkt am Sensor um einige Grad vom realen Wert abweichen.",
|
|
||||||
senseBox_scd_co2: "CO2 in ppm",
|
|
||||||
senseBox_scd_helpurl: "https://docs.sensebox.de/hardware/sensoren-co2/",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Feinstaubsensor (SDS011)
|
|
||||||
*/
|
|
||||||
|
|
||||||
senseBox_sds011: "Feinstaubsensor",
|
|
||||||
senseBox_sds011_dimension: "in µg/m³ an",
|
|
||||||
senseBox_sds011_pm25: "PM2.5",
|
|
||||||
senseBox_sds011_pm10: "PM10",
|
|
||||||
senseBox_sds011_tooltip: "Dieser Block gibt dir den Messwert des Feinstaubsensor. Schließe den Feinstaubsensor an einen der 2 **Serial/UART** Anschlüssen an. Im Dropdown Menü zwischen PM2.5 und PM10 auswählen. Der Messwert wird dir als **Kommazahl** in µg/m3",
|
|
||||||
senseBox_sds011_serial1: "Serial1",
|
|
||||||
senseBox_sds011_serial2: "Serial2",
|
|
||||||
senseBox_sds011_helpurl: "https://docs.sensebox.de/hardware/sensoren-feinstaub/",
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Button
|
|
||||||
*/
|
|
||||||
senseBox_button: "Button",
|
|
||||||
senseBox_button_isPressed: "ist gedrückt",
|
|
||||||
senseBox_button_switch: "als Schalter",
|
|
||||||
senseBox_button_wasPressed: "wurde gedrückt",
|
|
||||||
senseBox_button_tooltip: `Dieser Block gibt dir den Status des angeschlossenen Buttons. Im Dropdown Menü können verschiedene Modi für den Button ausgewählt werden. Angesteuert können entweder der on Board Button oder ein Button, der an einen der 6 digitalen Pins angeschlossen ist. verschiedene Modi:
|
|
||||||
- "ist gedrückt": Mit diesem Modus kannst du abfragen ob der Block gerade gedrückt wird. Du erhältst entweder den Wert TRUE oder FALSE.
|
|
||||||
- "wurde gedrückt": Mit diesem Modus kannst du abfragen ob der Block gedrückt wurde. Erst wenn der Knopf gedrückt und wieder losgelassen wurde erhältst du TRUE zurück
|
|
||||||
- "als Schalter": Wenn du diesen Block verwendest kannst du den Knopf wie ein Lichtschalter verwenden. Der Status wird gespeichert bis der Button erneut gedrückt wird`,
|
|
||||||
senseBox_button_helpurl: "",
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
export const TELEGRAM = {
|
|
||||||
/*
|
|
||||||
* Telegram
|
|
||||||
*/
|
|
||||||
senseBox_telegram_init: "Telegram Bot initialisieren",
|
|
||||||
senseBox_telegram_token: "Token",
|
|
||||||
senseBox_telegram_do: "Telegram mache",
|
|
||||||
senseBox_telegram_do_tooltip: "Füge in diese Schleife die Blöcke ein, die dein Telegram Bot ausführen soll. Beachte hierbei, dass du Aktionen bei einer bestimmten Nachricht ausführen lassen kannst oder auch selbst eine Nachricht versenden werden kann.",
|
|
||||||
senseBox_telegram_do_on_message: "bei Nachricht",
|
|
||||||
senseBox_telegram_message: "Nachricht",
|
|
||||||
senseBox_telegram_message_tooltip: "Führe eine Aktion aus, wenn der Telegram eine *Nachricht* empfangen hat.",
|
|
||||||
senseBox_telegram_send: "Sende Nachricht",
|
|
||||||
senseBox_telegram_send_tooltip: "Dein Telgram Bot sendet dir eine Nachricht auf dein Handy. Die Nachricht kann zum Beispiel ein Alarm oder auch ein Messwert sein",
|
|
||||||
senseBox_telegram_init_tooltip: "Initialisiere den Telegram Bot. Verwende diesen Block in der **Setup()-Schleife**. Den Token kannst du dir über den Telegram erstellen.",
|
|
||||||
senseBox_telegram_helpurl: "https://sensebox.de/projects/de/2019-12-15-telegram-blockly",
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
export const WEB = {
|
|
||||||
/**
|
|
||||||
* WiFi
|
|
||||||
*/
|
|
||||||
senseBox_wifi_connect: "Verbinde mit WLAN",
|
|
||||||
senseBox_wifi_ssid: "Netzwerkname",
|
|
||||||
senseBox_wifi_tooltip: "Stellt eine Verbindung mit einem WLAN-Netzwerk her. Möchtest du dich mit einem ungesicheren Netzwerk (z.B. Freifunk) verbinden lösche das Feld Passwort. Das WiFi-Bee muss auf den Steckplatz **XBEE1** aufgesteckt werden.",
|
|
||||||
senseBox_wifi_startap: "Initialisiere WLAN Access Point",
|
|
||||||
senseBox_wifi_startap_tooltip: "Erstellt einen WiFi-Accesspoint zu dem du dich verbinden kannst. Beachte, dass immer nur 1 Gerät gleichzeitig verbunden werden kann.",
|
|
||||||
senseBox_wifi_helpurl: "https://docs.sensebox.de/blockly/blockly-web-wifi/",
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
export const TEXT = {
|
|
||||||
|
|
||||||
TEXT_APPEND_APPENDTEXT: "Text anhängen",
|
|
||||||
TEXT_APPEND_HELPURL: "https://github.com/google/blockly/wiki/Text#text-modification", // untranslated
|
|
||||||
TEXT_APPEND_TO: "An",
|
|
||||||
TEXT_APPEND_TOOLTIP: "Text an die Variable \"%1\" anhängen.",
|
|
||||||
TEXT_CHANGECASE_HELPURL: "https://github.com/google/blockly/wiki/Text#adjusting-text-case", // untranslated
|
|
||||||
TEXT_CHANGECASE_OPERATOR_LOWERCASE: "umwandeln in kleinbuchstaben",
|
|
||||||
TEXT_CHANGECASE_OPERATOR_TITLECASE: "umwandeln in Substantive",
|
|
||||||
TEXT_CHANGECASE_OPERATOR_UPPERCASE: "umwandeln in GROSSBUCHSTABEN",
|
|
||||||
TEXT_CHANGECASE_TOOLTIP: "Wandelt Schreibweise von Texten um, in Großbuchstaben, Kleinbuchstaben oder den ersten Buchstaben jedes Wortes groß und die anderen klein.",
|
|
||||||
TEXT_CHARAT_FIRST: "Nehme ersten Buchstaben",
|
|
||||||
TEXT_CHARAT_FROM_END: "Nehme #ten Buchstaben von hinten",
|
|
||||||
TEXT_CHARAT_FROM_START: "Nehme #ten Buchstaben",
|
|
||||||
TEXT_CHARAT_HELPURL: "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic:%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm",
|
|
||||||
TEXT_CHARAT_INPUT_INTEXT: "vom Text",
|
|
||||||
TEXT_CHARAT_LAST: "Nehme letzten Buchstaben",
|
|
||||||
TEXT_CHARAT_RANDOM: "Nehme zufälligen Buchstaben",
|
|
||||||
TEXT_CHARAT_TAIL: "",
|
|
||||||
TEXT_CHARAT_TOOLTIP: "Extrahiere einen Buchstaben von einer spezifizierten Position.",
|
|
||||||
TEXT_CREATE_JOIN_ITEM_TOOLTIP: "Ein Element zum Text hinzufügen.",
|
|
||||||
TEXT_CREATE_JOIN_TITLE_JOIN: "verbinden",
|
|
||||||
TEXT_CREATE_JOIN_TOOLTIP: "Hinzufügen, entfernen und sortieren von Elementen.",
|
|
||||||
TEXT_GET_SUBSTRING_END_FROM_END: "bis zum #ten Buchstaben von hinten",
|
|
||||||
TEXT_GET_SUBSTRING_END_FROM_START: "bis zum #ten Buchstaben",
|
|
||||||
TEXT_GET_SUBSTRING_END_LAST: "bis zum letzten Buchstaben",
|
|
||||||
TEXT_GET_SUBSTRING_HELPURL: "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic:%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm",
|
|
||||||
TEXT_GET_SUBSTRING_INPUT_IN_TEXT: "in Text",
|
|
||||||
TEXT_GET_SUBSTRING_START_FIRST: "vom ersten Buchstaben",
|
|
||||||
TEXT_GET_SUBSTRING_START_FROM_END: "vom #ten Buchstaben von hinten",
|
|
||||||
TEXT_GET_SUBSTRING_START_FROM_START: "vom #ten Buchstaben",
|
|
||||||
TEXT_GET_SUBSTRING_TAIL: "",
|
|
||||||
TEXT_GET_SUBSTRING_TOOLTIP: "Gibt den angegebenen Textabschnitt zurück.",
|
|
||||||
TEXT_INDEXOF_HELPURL: "http://publib.boulder.ibm.com/infocenter/lnxpcomp/v8v101/index.jsp?topic:%2Fcom.ibm.xlcpp8l.doc%2Flanguage%2Fref%2Farsubex.htm",
|
|
||||||
TEXT_INDEXOF_INPUT_INTEXT: "im Text",
|
|
||||||
TEXT_INDEXOF_OPERATOR_FIRST: "Suche erstes Auftreten des Begriffs",
|
|
||||||
TEXT_INDEXOF_OPERATOR_LAST: "Suche letztes Auftreten des Begriffs",
|
|
||||||
TEXT_INDEXOF_TAIL: "",
|
|
||||||
TEXT_INDEXOF_TOOLTIP: "Findet das erste / letzte Auftreten eines Suchbegriffs in einem Text. Gibt die Position des Begriffs oder 0 zurück.",
|
|
||||||
TEXT_ISEMPTY_HELPURL: "https://github.com/google/blockly/wiki/Text#checking-for-empty-text", // untranslated
|
|
||||||
TEXT_ISEMPTY_TITLE: "%1 ist leer?",
|
|
||||||
TEXT_ISEMPTY_TOOLTIP: "Ist wahr (true), wenn der Text keine Zeichen enthält ist.",
|
|
||||||
TEXT_JOIN_HELPURL: "",
|
|
||||||
TEXT_JOIN_TITLE_CREATEWITH: "Erstelle Text aus",
|
|
||||||
TEXT_JOIN_TOOLTIP: "Erstellt einen Text durch das Verbinden von mehreren Textelementen.",
|
|
||||||
TEXT_LENGTH_HELPURL: "https://github.com/google/blockly/wiki/Text#text-modification", // untranslated
|
|
||||||
TEXT_LENGTH_TITLE: "Länge %1",
|
|
||||||
TEXT_LENGTH_TOOLTIP: "Die Anzahl von Zeichen in einem Text. (inkl. Leerzeichen)",
|
|
||||||
TEXT_PRINT_HELPURL: "https://github.com/google/blockly/wiki/Text#printing-text", // untranslated
|
|
||||||
TEXT_PRINT_TITLE: "Ausgabe %1",
|
|
||||||
TEXT_PRINT_TOOLTIP: "Gib den Inhalt einer Variable aus.",
|
|
||||||
TEXT_PROMPT_HELPURL: "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user", // untranslated
|
|
||||||
TEXT_PROMPT_TOOLTIP_NUMBER: "Fragt den Benutzer nach einer Zahl.",
|
|
||||||
TEXT_PROMPT_TOOLTIP_TEXT: "Fragt den Benutzer nach einem Text.",
|
|
||||||
TEXT_PROMPT_TYPE_NUMBER: "Fragt nach Zahl mit Hinweis",
|
|
||||||
TEXT_PROMPT_TYPE_TEXT: "Fragt nach Text mit Hinweis",
|
|
||||||
TEXT_TEXT_HELPURL: "https://de.wikipedia.org/wiki/Zeichenkette",
|
|
||||||
TEXT_TEXT_TOOLTIP: "Ein Buchstabe, Text oder Satz.",
|
|
||||||
TEXT_TRIM_HELPURL: "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces", // untranslated
|
|
||||||
TEXT_TRIM_OPERATOR_BOTH: "entferne Leerzeichen vom Anfang und vom Ende (links und rechts)",
|
|
||||||
TEXT_TRIM_OPERATOR_LEFT: "entferne Leerzeichen vom Anfang (links)",
|
|
||||||
TEXT_TRIM_OPERATOR_RIGHT: "entferne Leerzeichen vom Ende (rechts)",
|
|
||||||
TEXT_TRIM_TOOLTIP: "Entfernt Leerzeichen vom Anfang und / oder Ende eines Textes.",
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
export const TIME = {
|
|
||||||
/**
|
|
||||||
* Interval Block
|
|
||||||
*/
|
|
||||||
senseBox_interval_timer: "Intervall:",
|
|
||||||
senseBox_interval: "ms",
|
|
||||||
senseBox_interval_timer_tip: "Intervall",
|
|
||||||
senseBox_interval_time: "Zeit: ",
|
|
||||||
ARD_TIME_DELAY: "Warte",
|
|
||||||
ARD_TIME_DELAY_MICROS: "Mikrosekunden",
|
|
||||||
ARD_TIME_DELAY_MICRO_TIP: "Warte eine spezifischen Zeit in Microsekunden",
|
|
||||||
ARD_TIME_DELAY_TIP: "Warte spezifische Zeit in Millisekunden",
|
|
||||||
ARD_TIME_INF: "Warte für immer (Beende Programm)",
|
|
||||||
ARD_TIME_INF_TIP: "Stoppt das Programm.",
|
|
||||||
ARD_TIME_MICROS: "Bereits vergangen Zeit (Mikrosekunden)",
|
|
||||||
ARD_TIME_MICROS_TIP:
|
|
||||||
"Gibt eine Zahl in Microsekunden zurück, die der Zeitdauer des Aktuellen Programms entspricht. Muss als positiven Integer gespeichert werden", // untranslated
|
|
||||||
ARD_TIME_MILLIS: "Bereits vergangen Zeit (Millisekunden)",
|
|
||||||
ARD_TIME_MILLIS_TIP:
|
|
||||||
"Gibt eine Zahl in Millisekunden zurück, die der Zeitdauer des Aktuellen Programms entspricht. Muss als positiven Integer gespeichert werden", // untranslated
|
|
||||||
ARD_TIME_MS: "Millisekunden",
|
|
||||||
};
|
|
||||||