Compare commits
	
		
			1 Commits
		
	
	
		
			master
			...
			dev/update
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 328b9a141f | 
| @ -1,41 +0,0 @@ | |||||||
| name: Build and push image |  | ||||||
| on: |  | ||||||
|   push: |  | ||||||
|     branches: |  | ||||||
|       - master |  | ||||||
| jobs: |  | ||||||
|   build: |  | ||||||
|     runs-on: ubuntu-latest |  | ||||||
|     container: |  | ||||||
|       image: catthehacker/ubuntu:act-latest |  | ||||||
|     #defaults: |  | ||||||
|     #  run: |  | ||||||
|     #    working-directory: /repo |  | ||||||
|     steps: |  | ||||||
|       - name: Checkout |  | ||||||
|         uses: actions/checkout@v3 |  | ||||||
|         with: |  | ||||||
|           fetch-depth: 0 # all history for all branches and tags |  | ||||||
| 
 |  | ||||||
|       - name: Login to  gitea.simonzeyer.de Repo |  | ||||||
|         uses: docker/login-action@v2 |  | ||||||
|         with: |  | ||||||
|           registry: gitea.simonzeyer.de |  | ||||||
|           username: ${{ secrets.DOCKER_REPO_USER }} |  | ||||||
|           password: ${{ secrets.DOCKER_REPO_PASSWD }} |  | ||||||
| 
 |  | ||||||
|       - name: Get Meta |  | ||||||
|         id: meta |  | ||||||
|         run: | |  | ||||||
|           echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT |  | ||||||
|           echo REPO_VERSION=$(git describe --always | sed 's/^v//') >> $GITHUB_OUTPUT           |  | ||||||
|       - name: Build and push |  | ||||||
|         uses: docker/build-push-action@v4 |  | ||||||
|         env: |  | ||||||
|           ACTIONS_RUNTIME_TOKEN: '' # See https://gitea.com/gitea/act_runner/issues/119 |  | ||||||
|         with: |  | ||||||
|           context: . |  | ||||||
|           file: ./Dockerfile      |  | ||||||
|           push: true |  | ||||||
|           tags: | |  | ||||||
|             gitea.simonzeyer.de/schuelerlabor-cleverlab/smarti:${{ steps.meta.outputs.REPO_VERSION }} |  | ||||||
							
								
								
									
										38
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										38
									
								
								.github/ISSUE_TEMPLATE/bug_report.md
									
									
									
									
										vendored
									
									
								
							| @ -1,38 +0,0 @@ | |||||||
| --- |  | ||||||
| name: Bug report |  | ||||||
| about: Create a report to help us improve |  | ||||||
| title: '' |  | ||||||
| labels: '' |  | ||||||
| assignees: '' |  | ||||||
| 
 |  | ||||||
| --- |  | ||||||
| 
 |  | ||||||
| **Describe the bug** |  | ||||||
| A clear and concise description of what the bug is. |  | ||||||
| 
 |  | ||||||
| **To Reproduce** |  | ||||||
| Steps to reproduce the behavior: |  | ||||||
| 1. Go to '...' |  | ||||||
| 2. Click on '....' |  | ||||||
| 3. Scroll down to '....' |  | ||||||
| 4. See error |  | ||||||
| 
 |  | ||||||
| **Expected behavior** |  | ||||||
| A clear and concise description of what you expected to happen. |  | ||||||
| 
 |  | ||||||
| **Screenshots** |  | ||||||
| If applicable, add screenshots to help explain your problem. |  | ||||||
| 
 |  | ||||||
| **Desktop (please complete the following information):** |  | ||||||
|  - OS: [e.g. iOS] |  | ||||||
|  - Browser [e.g. chrome, safari] |  | ||||||
|  - Version [e.g. 22] |  | ||||||
| 
 |  | ||||||
| **Smartphone (please complete the following information):** |  | ||||||
|  - Device: [e.g. iPhone6] |  | ||||||
|  - OS: [e.g. iOS8.1] |  | ||||||
|  - Browser [e.g. stock browser, safari] |  | ||||||
|  - Version [e.g. 22] |  | ||||||
| 
 |  | ||||||
| **Additional context** |  | ||||||
| Add any other context about the problem here. |  | ||||||
							
								
								
									
										20
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										20
									
								
								.github/ISSUE_TEMPLATE/feature_request.md
									
									
									
									
										vendored
									
									
								
							| @ -1,20 +0,0 @@ | |||||||
| --- |  | ||||||
| name: Feature request |  | ||||||
| about: Suggest an idea for this project |  | ||||||
| title: '' |  | ||||||
| labels: '' |  | ||||||
| assignees: '' |  | ||||||
| 
 |  | ||||||
| --- |  | ||||||
| 
 |  | ||||||
| **Is your feature request related to a problem? Please describe.** |  | ||||||
| A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] |  | ||||||
| 
 |  | ||||||
| **Describe the solution you'd like** |  | ||||||
| A clear and concise description of what you want to happen. |  | ||||||
| 
 |  | ||||||
| **Describe alternatives you've considered** |  | ||||||
| A clear and concise description of any alternative solutions or features you've considered. |  | ||||||
| 
 |  | ||||||
| **Additional context** |  | ||||||
| Add any other context or screenshots about the feature request here. |  | ||||||
							
								
								
									
										14
									
								
								.github/ISSUE_TEMPLATE/short-issue.md
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										14
									
								
								.github/ISSUE_TEMPLATE/short-issue.md
									
									
									
									
										vendored
									
									
								
							| @ -1,14 +0,0 @@ | |||||||
| --- |  | ||||||
| name: Short Issue |  | ||||||
| about: Template for Short Issues |  | ||||||
| title: '' |  | ||||||
| labels: '' |  | ||||||
| assignees: '' |  | ||||||
| 
 |  | ||||||
| --- |  | ||||||
| 
 |  | ||||||
| ### Current behaviour |  | ||||||
| Describe the current behaviour |  | ||||||
| 
 |  | ||||||
| ### Expected behaviour |  | ||||||
| Describe how it is supposed to work |  | ||||||
							
								
								
									
										12
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Dockerfile
									
									
									
									
									
								
							| @ -1,12 +0,0 @@ | |||||||
| # specify the node base image with your desired version node:<version> |  | ||||||
| FROM node:16 as build |  | ||||||
| WORKDIR /app |  | ||||||
| copy ./ /app |  | ||||||
| RUN npm install  --verbose |  | ||||||
| RUN npm run build  --verbose |  | ||||||
| 
 |  | ||||||
| FROM nginx:alpine |  | ||||||
| COPY --from=build /app/build/ /usr/share/nginx/html |  | ||||||
| RUN chmod 755 /usr/share/nginx/html/ -R |  | ||||||
| EXPOSE 80 |  | ||||||
| ENTRYPOINT ["sh", "-c", "cd /usr/share/nginx/html/ && nginx -g 'daemon off;'"] |  | ||||||
| @ -1,11 +0,0 @@ | |||||||
| # docker-compose.yml |  | ||||||
| services: |  | ||||||
|   smarti:  |  | ||||||
|     mem_limit: 2048m |  | ||||||
|     mem_reservation: 128M |  | ||||||
|     cpus: 2 |  | ||||||
|     build: |  | ||||||
|       dockerfile: Dockerfile |  | ||||||
|     ports: |  | ||||||
|     - "80" |  | ||||||
|        |  | ||||||
							
								
								
									
										36
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										36
									
								
								package.json
									
									
									
									
									
								
							| @ -3,27 +3,23 @@ | |||||||
|   "version": "1.0.0", |   "version": "1.0.0", | ||||||
|   "private": true, |   "private": true, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "@blockly/block-plus-minus": "^4.0.4", |     "@blockly/block-plus-minus": "^3.0.5", | ||||||
|     "@blockly/field-grid-dropdown": "^2.0.4", |     "@blockly/field-grid-dropdown": "^1.0.31", | ||||||
|     "@blockly/field-slider": "4.0.4", |     "@blockly/field-slider": "^3.0.5", | ||||||
|     "@blockly/plugin-scroll-options": "^3.0.5", |     "@blockly/plugin-scroll-options": "^2.0.5", | ||||||
|     "@blockly/plugin-typed-variable-modal": "^5.0.6", |     "@blockly/plugin-typed-variable-modal": "^4.0.5", | ||||||
|     "@blockly/workspace-backpack": "^3.0.4", |     "@blockly/workspace-backpack": "^2.0.12", | ||||||
|     "@blockly/zoom-to-fit": "^3.0.4", |     "@blockly/zoom-to-fit": "^2.0.14", | ||||||
|     "@emotion/react": "^11.10.5", |     "@fortawesome/fontawesome-svg-core": "^1.2.36", | ||||||
|     "@emotion/styled": "^11.10.5", |     "@fortawesome/free-solid-svg-icons": "^5.15.4", | ||||||
|     "@fortawesome/fontawesome-svg-core": "^6.2.1", |     "@fortawesome/react-fontawesome": "^0.1.19", | ||||||
|     "@fortawesome/free-solid-svg-icons": "^6.2.1", |     "@material-ui/core": "^4.12.4", | ||||||
|     "@fortawesome/react-fontawesome": "^0.2.0", |  | ||||||
|     "@monaco-editor/react": "^4.3.1", |     "@monaco-editor/react": "^4.3.1", | ||||||
|     "@mui/lab": "^5.0.0-alpha.110", |  | ||||||
|     "@mui/material": "^5.10.16", |  | ||||||
|     "@mui/styles": "^5.10.16", |  | ||||||
|     "@testing-library/jest-dom": "^5.16.1", |     "@testing-library/jest-dom": "^5.16.1", | ||||||
|     "@testing-library/react": "^12.1.2", |     "@testing-library/react": "^12.1.2", | ||||||
|     "@testing-library/user-event": "^7.2.1", |     "@testing-library/user-event": "^7.2.1", | ||||||
|     "axios": "^0.22.0", |     "axios": "^0.22.0", | ||||||
|     "blockly": "^9.2.0", |     "blockly": "^8.0.3", | ||||||
|     "file-saver": "^2.0.5", |     "file-saver": "^2.0.5", | ||||||
|     "markdown-it": "^12.3.2", |     "markdown-it": "^12.3.2", | ||||||
|     "mnemonic-id": "^3.2.7", |     "mnemonic-id": "^3.2.7", | ||||||
| @ -39,13 +35,12 @@ | |||||||
|     "react-rating-stars-component": "^2.2.0", |     "react-rating-stars-component": "^2.2.0", | ||||||
|     "react-redux": "^7.2.9", |     "react-redux": "^7.2.9", | ||||||
|     "react-router-dom": "^5.3.3", |     "react-router-dom": "^5.3.3", | ||||||
|     "react-scripts": "^5.0.1", |     "react-scripts": "^5.0.0", | ||||||
|     "react-share": "^4.4.0", |     "react-share": "^4.4.0", | ||||||
|     "react-spinners": "^0.13.3", |     "react-spinners": "^0.13.3", | ||||||
|     "reactour": "^1.18.7", |     "reactour": "^1.18.7", | ||||||
|     "redux": "^4.2.0", |     "redux": "^4.2.0", | ||||||
|     "redux-thunk": "^2.4.1", |     "redux-thunk": "^2.4.1", | ||||||
|     "rehype-raw": "^6.1.1", |  | ||||||
|     "remark-gemoji": "^7.0.1", |     "remark-gemoji": "^7.0.1", | ||||||
|     "remark-gfm": "^3.0.1", |     "remark-gfm": "^3.0.1", | ||||||
|     "styled-components": "^4.4.1", |     "styled-components": "^4.4.1", | ||||||
| @ -70,8 +65,5 @@ | |||||||
|     ">0.2%", |     ">0.2%", | ||||||
|     "not dead", |     "not dead", | ||||||
|     "not op_mini all" |     "not op_mini all" | ||||||
|   ], |   ] | ||||||
|   "devDependencies": { |  | ||||||
|     "@babel/plugin-proposal-private-property-in-object": "7.21.11" |  | ||||||
|   } |  | ||||||
| } | } | ||||||
|  | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 122 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 777 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 728 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 77 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 79 KiB | 
| @ -53,7 +53,7 @@ td { | |||||||
|   padding-top: 12px; |   padding-top: 12px; | ||||||
|   padding-bottom: 12px; |   padding-bottom: 12px; | ||||||
|   text-align: left; |   text-align: left; | ||||||
|   border-color: #4eaf47; |   background-color: #4eaf47; | ||||||
|   color: white; |   color: white; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										18
									
								
								src/App.js
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								src/App.js
									
									
									
									
									
								
							| @ -9,7 +9,7 @@ import { loadUser } from "./actions/authActions"; | |||||||
| 
 | 
 | ||||||
| import "./App.css"; | import "./App.css"; | ||||||
| 
 | 
 | ||||||
| import { ThemeProvider, StyledEngineProvider, createTheme } from "@mui/material/styles"; | import { ThemeProvider, createTheme } from "@material-ui/core/styles"; | ||||||
| 
 | 
 | ||||||
| import Content from "./components/Content"; | import Content from "./components/Content"; | ||||||
| 
 | 
 | ||||||
| @ -36,15 +36,13 @@ class App extends Component { | |||||||
|   render() { |   render() { | ||||||
|     const customHistory = createBrowserHistory(); |     const customHistory = createBrowserHistory(); | ||||||
|     return ( |     return ( | ||||||
|       <StyledEngineProvider injectFirst> |       <ThemeProvider theme={theme}> | ||||||
|         <ThemeProvider theme={theme}> |         <Provider store={store}> | ||||||
|           <Provider store={store}> |           <Router history={customHistory}> | ||||||
|             <Router history={customHistory}> |             <Content /> | ||||||
|               <Content /> |           </Router> | ||||||
|             </Router> |         </Provider> | ||||||
|           </Provider> |       </ThemeProvider> | ||||||
|         </ThemeProvider> |  | ||||||
|       </StyledEngineProvider> |  | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,15 +1,10 @@ | |||||||
| import { | import { | ||||||
|   BOARD, |     BOARD, | ||||||
| } from "./types"; |   } from "./types"; | ||||||
| import mini_opacity from "../data/mini_opacity.png" |  | ||||||
| import mcu_opacity from "../data/mcu_opacity.png" |  | ||||||
| 
 | 
 | ||||||
| export const setBoard = (board) => (dispatch) => { | export const setBoard = (board) => (dispatch) => { | ||||||
|   window.sessionStorage.setItem("board", board); |     dispatch({ | ||||||
|   const root = document.querySelector(':root'); |       type: BOARD, | ||||||
|   root.style.setProperty('--url', `url(${board === "mcu" ? mcu_opacity : mini_opacity})`); |       payload: board, | ||||||
|   dispatch({ |     }); | ||||||
|     type: BOARD, |   }; | ||||||
|     payload: board, |  | ||||||
|   }); |  | ||||||
| }; |  | ||||||
| @ -1,18 +0,0 @@ | |||||||
| import axios from 'axios' |  | ||||||
| 
 |  | ||||||
| const fetchSensorWikiSuccess = sensors => ({ |  | ||||||
|     type: 'FETCH_SENSORWIKI_SUCCESS', |  | ||||||
|     payload: { sensors } |  | ||||||
| }) |  | ||||||
| 
 |  | ||||||
| export const fetchSensors =  () => { |  | ||||||
|     return async dispatch => { |  | ||||||
|         try { |  | ||||||
|             let sensors = await axios.get('https://api.sensors.wiki/sensors/all') |  | ||||||
|             dispatch(fetchSensorWikiSuccess(sensors.data)) |  | ||||||
|         } |  | ||||||
|         catch(e){ |  | ||||||
|             console.log(e) |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @ -16,19 +16,13 @@ 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.getSelected(); |   var selectedBlock = Blockly.selected | ||||||
|   if (selectedBlock !== null) { |   if (selectedBlock !== null) { | ||||||
|     code.helpurl = selectedBlock.helpUrl |     code.helpurl = selectedBlock.helpUrl | ||||||
|     code.tooltip = selectedBlock.tooltip |     code.tooltip = selectedBlock.tooltip | ||||||
|     if (selectedBlock.data) { |  | ||||||
|       code.data = selectedBlock.data |  | ||||||
|     } else { |  | ||||||
|       code.data = null |  | ||||||
|     } |  | ||||||
|   } else if (selectedBlock === null) { |   } else if (selectedBlock === null) { | ||||||
|     code.tooltip = Blockly.Msg.tooltip_hint |     code.tooltip = Blockly.Msg.tooltip_hint | ||||||
|     code.helpurl = '' |     code.helpurl = '' | ||||||
|     code.data = null |  | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,9 +1,9 @@ | |||||||
| import React, { Component } from "react"; | import React, { Component } from "react"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import { alpha } from "@mui/material/styles"; | import { alpha } from "@material-ui/core/styles"; | ||||||
| 
 | 
 | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   alert: { |   alert: { | ||||||
|  | |||||||
| @ -27,7 +27,7 @@ import Blockly from "blockly/core"; | |||||||
| import "blockly/blocks"; | import "blockly/blocks"; | ||||||
| import Toolbox from "./toolbox/Toolbox"; | import Toolbox from "./toolbox/Toolbox"; | ||||||
| 
 | 
 | ||||||
| import { Card } from "@mui/material"; | import { Card } from "@material-ui/core"; | ||||||
| import { | import { | ||||||
|   ScrollOptions, |   ScrollOptions, | ||||||
|   ScrollBlockDragger, |   ScrollBlockDragger, | ||||||
|  | |||||||
| @ -45,7 +45,6 @@ class BlocklyWindow extends Component { | |||||||
|     const workspace = Blockly.getMainWorkspace(); |     const workspace = Blockly.getMainWorkspace(); | ||||||
|     var xml = this.props.initialXml; |     var xml = this.props.initialXml; | ||||||
|     if (props.selectedBoard !== this.props.selectedBoard) { |     if (props.selectedBoard !== this.props.selectedBoard) { | ||||||
|        xml = localStorage.getItem("autoSaveXML"); |  | ||||||
|       // change board
 |       // change board
 | ||||||
|       if(!xml) xml = initialXml; |       if(!xml) xml = initialXml; | ||||||
|       var xmlDom = Blockly.Xml.textToDom(xml); |       var xmlDom = Blockly.Xml.textToDom(xml); | ||||||
| @ -63,7 +62,6 @@ class BlocklyWindow extends Component { | |||||||
|     } |     } | ||||||
|     if (props.language !== this.props.language) { |     if (props.language !== this.props.language) { | ||||||
|       // change language
 |       // change language
 | ||||||
|        xml = localStorage.getItem("autoSaveXML"); |  | ||||||
|       if (!xml) xml = initialXml; |       if (!xml) xml = initialXml; | ||||||
|        xmlDom = Blockly.Xml.textToDom(xml); |        xmlDom = Blockly.Xml.textToDom(xml); | ||||||
|       Blockly.Xml.clearWorkspaceAndLoadFromXml(xmlDom, workspace); |       Blockly.Xml.clearWorkspaceAndLoadFromXml(xmlDom, workspace); | ||||||
|  | |||||||
| @ -1,88 +0,0 @@ | |||||||
| import Blockly from "blockly"; |  | ||||||
| import { getColour } from "../helpers/colour"; |  | ||||||
| import * as Types from "../helpers/types"; |  | ||||||
| import { selectedBoard } from "../helpers/board"; |  | ||||||
| import { FieldGridDropdown } from "@blockly/field-grid-dropdown"; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * DS18B20 Temperatursonde |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| Blockly.Blocks["CleVerLab_dummy1"] = { |  | ||||||
|  init: function () { |  | ||||||
|     this.setColour(getColour().cleverlab); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|         .appendField("tut nichts") |  | ||||||
|     this.setOutput(true, Types.NUMBER.typeName); |  | ||||||
|     this.data = {name: "empty"}; |  | ||||||
| }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["CleVerLab_temperature"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setColour(getColour().cleverlab); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|       .appendField("Temperatur") |  | ||||||
|       .appendField("Digital Port:") |  | ||||||
|       .appendField(new Blockly.FieldDropdown(selectedBoard().digitalPorts), "DigitalPin"); |  | ||||||
|     this.setOutput(true, Types.NUMBER.typeName); |  | ||||||
|     this.data = {name: "ds18b20"}; |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| /** |  | ||||||
|  * PH Wert |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| Blockly.Blocks["CleVerLab_pH"] = { |  | ||||||
|   init: function () { |  | ||||||
| 
 |  | ||||||
|     this.setColour(getColour().cleverlab); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|       .appendField("pH Wert") |  | ||||||
|       .appendField("Digital Port:") |  | ||||||
|       .appendField(new Blockly.FieldDropdown(selectedBoard().digitalPins), "DigitalPin"); |  | ||||||
|     this.setOutput(true, Types.NUMBER.typeName); |  | ||||||
|     this.data = {name: "phoderso"}; |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| Blockly.Blocks["CleVerLab_cali1"] = { |  | ||||||
|     init: function () { |  | ||||||
|         this.appendDummyInput() |  | ||||||
|             .appendField("Kalibriere pH Sensor"); |  | ||||||
|         this.appendValueInput("VAR1", "Number") |  | ||||||
|             .appendField("Referenzlösung pH 4.00 =") |  | ||||||
|             .setAlign(Blockly.ALIGN_RIGHT); |  | ||||||
|         this.appendValueInput("VAR2", "Number2") |  | ||||||
|             .appendField("Referenzlösung pH 7.00 =") |  | ||||||
|             .setAlign(Blockly.ALIGN_RIGHT); |  | ||||||
|         this.setPreviousStatement(true, null); |  | ||||||
|         this.setNextStatement(true, null); |  | ||||||
|         this.setColour(getColour().cleverlab); |  | ||||||
|         this.setOutput(true, Types.NUMBER.typeName); |  | ||||||
|         this.data = {name: "dsasda"}; |  | ||||||
|     }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * Pump |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| Blockly.Blocks['CleVerLab_pump'] = { |  | ||||||
|   init: function() { |  | ||||||
|     this.setColour(getColour().cleverlab); |  | ||||||
|         var dropdown = new Blockly.FieldDropdown([ |  | ||||||
|           [ 'START','HIGH'], |  | ||||||
|           [ 'STOPP','LOW'] |  | ||||||
|         ]); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|         .appendField(dropdown, "Mode") |  | ||||||
|         .appendField(" Pumpe ") |  | ||||||
|         .appendField(new Blockly.FieldDropdown(selectedBoard().digitalPins), "DigitalPin"); |  | ||||||
|     this.setPreviousStatement(true, null); |  | ||||||
|     this.setNextStatement(true, null); |  | ||||||
|     //this.setOutput(true, "Number");
 |  | ||||||
|     this.setTooltip(''); |  | ||||||
|     this.setHelpUrl(''); |  | ||||||
|   } |  | ||||||
| }; |  | ||||||
| @ -10,7 +10,6 @@ import "./sensebox-motors"; | |||||||
| import "./sensebox-lora"; | import "./sensebox-lora"; | ||||||
| import "./sensebox-led"; | import "./sensebox-led"; | ||||||
| import "./sensebox-rtc"; | import "./sensebox-rtc"; | ||||||
| import "./sensebox-ntp"; |  | ||||||
| import "./sensebox-ble"; | import "./sensebox-ble"; | ||||||
| import "./sensebox-sd"; | import "./sensebox-sd"; | ||||||
| import "./mqtt"; | import "./mqtt"; | ||||||
| @ -26,6 +25,5 @@ import "./variables"; | |||||||
| import "./lists"; | import "./lists"; | ||||||
| import "./watchdog"; | import "./watchdog"; | ||||||
| import "./webserver"; | import "./webserver"; | ||||||
| import "./CleVerLab" |  | ||||||
| 
 | 
 | ||||||
| import "../helpers/types"; | import "../helpers/types"; | ||||||
|  | |||||||
| @ -1,42 +0,0 @@ | |||||||
| import * as Blockly from "blockly"; |  | ||||||
| import { getColour } from "../helpers/colour"; |  | ||||||
| import * as Types from "../helpers/types"; |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_ntp_init"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_ntp_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.sensebox_ntp_init); |  | ||||||
|     this.setPreviousStatement(true); |  | ||||||
|     this.setNextStatement(true); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_ntp_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_ntp_get"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_ntp_get_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|       .appendField(Blockly.Msg.sensebox_ntp_get) |  | ||||||
|       .appendField( |  | ||||||
|         new Blockly.FieldDropdown([ |  | ||||||
|           [Blockly.Msg.sensebox_ntp_epochTime, "getEpochTime"], |  | ||||||
|           [Blockly.Msg.sensebox_ntp_formattedTimeStamp, "getFormattedTime"], |  | ||||||
|         ]), |  | ||||||
|         "dropdown" |  | ||||||
|       ); |  | ||||||
|     this.setOutput(true, Types.LARGE_NUMBER.typeName); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_rtc_get_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_ntp_get_timestamp"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_rtc_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.sensebox_rtc_get_timestamp); |  | ||||||
|     this.setOutput(true); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_rtc_get_timestamp_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| @ -76,67 +76,3 @@ Blockly.Blocks["sensebox_rtc_get_timestamp"] = { | |||||||
|     this.setTooltip(Blockly.Msg.sensebox_rtc_get_timestamp_tooltip); |     this.setTooltip(Blockly.Msg.sensebox_rtc_get_timestamp_tooltip); | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  *  Internal RTC |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_internal_rtc_init"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_internal_rtc_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.sensebox_internal_rtc_init); |  | ||||||
|     this.setPreviousStatement(true); |  | ||||||
|     this.setNextStatement(true); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_internal_rtc_init_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_internal_rtc_set"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_rtc_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendValueInput("time").appendField( |  | ||||||
|       Blockly.Msg.sensebox_internal_rtc_set |  | ||||||
|     ); |  | ||||||
|     this.setPreviousStatement(true); |  | ||||||
|     this.setNextStatement(true); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_internal_rtc_set_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_internal_rtc_get"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_rtc_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|       .appendField(Blockly.Msg.sensebox_internal_rtc_get) |  | ||||||
|       .appendField( |  | ||||||
|         new Blockly.FieldDropdown([ |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_epoch, "Epoch"], |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_year, "Year"], |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_month, "Month"], |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_day, "Day"], |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_hour, "Hours"], |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_minutes, "Minutes"], |  | ||||||
|           [Blockly.Msg.sensebox_internal_rtc_seconds, "Seconds"], |  | ||||||
|         ]), |  | ||||||
|         "dropdown" |  | ||||||
|       ); |  | ||||||
|     this.setOutput(true, Types.LARGE_NUMBER.typeName); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_internal_rtc_get_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Blocks["sensebox_internal_rtc_get_timestamp"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.setHelpUrl(Blockly.Msg.sensebox_internal_rtc_helpurl); |  | ||||||
|     this.setColour(getColour().time); |  | ||||||
|     this.appendDummyInput().appendField( |  | ||||||
|       Blockly.Msg.sensebox_internal_rtc_get_timestamp |  | ||||||
|     ); |  | ||||||
|     this.setOutput(true); |  | ||||||
|     this.setTooltip(Blockly.Msg.sensebox_internal_rtc_get_timestamp_tooltip); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
|  | |||||||
| @ -26,7 +26,6 @@ Blockly.Blocks["sensebox_sensor_temp_hum"] = { | |||||||
|     this.setColour(getColour().sensebox); |     this.setColour(getColour().sensebox); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_temp_hum_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_temp_hum_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_temp_hum_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_temp_hum_helpurl); | ||||||
|     this.data = {name: "hdc1080", connection: "I2C"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -52,7 +51,6 @@ Blockly.Blocks["sensebox_sensor_uv_light"] = { | |||||||
|     this.setColour(getColour().sensebox); |     this.setColour(getColour().sensebox); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_uv_light_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_uv_light_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_uv_light_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_uv_light_helpurl); | ||||||
|     this.data = {name: "veml6070"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -93,7 +91,6 @@ Blockly.Blocks["sensebox_sensor_bmx055_accelerometer"] = { | |||||||
|     this.setColour(getColour().sensebox); |     this.setColour(getColour().sensebox); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_bmx055_accelerometer_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_bmx055_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_bmx055_helpurl); | ||||||
|     this.data = {name: "bmx055"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -118,14 +115,13 @@ Blockly.Blocks["sensebox_sensor_sds011"] = { | |||||||
|       .appendField(Blockly.Msg.senseBox_sds011_dimension) |       .appendField(Blockly.Msg.senseBox_sds011_dimension) | ||||||
|       .appendField( |       .appendField( | ||||||
|         new Blockly.FieldDropdown( |         new Blockly.FieldDropdown( | ||||||
|           selectedBoard().serialSensors), |           selectedBoard().serial), | ||||||
|         "SERIAL" |         "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_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_sds011_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_sds011_helpurl); | ||||||
|     this.data = {name: "sds011"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -159,7 +155,6 @@ Blockly.Blocks["sensebox_sensor_pressure"] = { | |||||||
|     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_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_pressure_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_pressure_helpurl); | ||||||
|     this.data = {name: "bmp280"}; |  | ||||||
|     this.getField("NAME").setValidator( |     this.getField("NAME").setValidator( | ||||||
|       function (val) { |       function (val) { | ||||||
|         this.updateShape_(val === "Altitude"); |         this.updateShape_(val === "Altitude"); | ||||||
| @ -191,7 +186,7 @@ Blockly.Blocks["sensebox_sensor_bme680_bsec"] = { | |||||||
|     var dropdownOptions = [ |     var dropdownOptions = [ | ||||||
|       [Blockly.Msg.senseBox_temp, "temperature"], |       [Blockly.Msg.senseBox_temp, "temperature"], | ||||||
|       [Blockly.Msg.senseBox_hum, "humidity"], |       [Blockly.Msg.senseBox_hum, "humidity"], | ||||||
|       [Blockly.Msg.senseBox_bme_pressure, "pressure"], |       [Blockly.Msg.senseBox_pressure, "pressure"], | ||||||
|       [Blockly.Msg.senseBox_bme_iaq, "IAQ"], |       [Blockly.Msg.senseBox_bme_iaq, "IAQ"], | ||||||
|       [Blockly.Msg.senseBox_bme_iaq_accuracy, "IAQAccuracy"], |       [Blockly.Msg.senseBox_bme_iaq_accuracy, "IAQAccuracy"], | ||||||
|       [Blockly.Msg.senseBox_bme_co2, "CO2"], |       [Blockly.Msg.senseBox_bme_co2, "CO2"], | ||||||
| @ -206,7 +201,6 @@ Blockly.Blocks["sensebox_sensor_bme680_bsec"] = { | |||||||
|     this.setColour(getColour().sensebox); |     this.setColour(getColour().sensebox); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_bme_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_bme_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_bme680_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_bme680_helpurl); | ||||||
|     this.data = {name: "bme680"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -218,7 +212,12 @@ Blockly.Blocks["sensebox_sensor_bme680_bsec"] = { | |||||||
| 
 | 
 | ||||||
| Blockly.Blocks["sensebox_sensor_ultrasonic_ranger"] = { | Blockly.Blocks["sensebox_sensor_ultrasonic_ranger"] = { | ||||||
|   init: function () { |   init: function () { | ||||||
|     var dropdown = new FieldGridDropdown(selectedBoard().digitalPorts, function (option) { |     var dropdownOptions = [ | ||||||
|  |       [Blockly.Msg.senseBox_ultrasonic_port_A, "A"], | ||||||
|  |       [Blockly.Msg.senseBox_ultrasonic_port_B, "B"], | ||||||
|  |       [Blockly.Msg.senseBox_ultrasonic_port_C, "C"], | ||||||
|  |     ]; | ||||||
|  |     var dropdown = new FieldGridDropdown(dropdownOptions, function (option) { | ||||||
|       var input = option === "A" || option === "B" || option === "C"; |       var input = option === "A" || option === "B" || option === "C"; | ||||||
|       this.sourceBlock_.updateShape_(input); |       this.sourceBlock_.updateShape_(input); | ||||||
|     }); |     }); | ||||||
| @ -246,7 +245,6 @@ Blockly.Blocks["sensebox_sensor_ultrasonic_ranger"] = { | |||||||
|     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_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_ultrasonic_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_ultrasonic_helpurl); | ||||||
|     this.data = {name: "hc-sr04"}; |  | ||||||
|   }, |   }, | ||||||
|   /** |   /** | ||||||
|    * Parse XML to restore the number of pins available. |    * Parse XML to restore the number of pins available. | ||||||
| @ -331,7 +329,6 @@ Blockly.Blocks["sensebox_button"] = { | |||||||
|           [Blockly.Msg.senseBox_button_isPressed, "isPressed"], |           [Blockly.Msg.senseBox_button_isPressed, "isPressed"], | ||||||
|           [Blockly.Msg.senseBox_button_wasPressed, "wasPressed"], |           [Blockly.Msg.senseBox_button_wasPressed, "wasPressed"], | ||||||
|           [Blockly.Msg.senseBox_button_longPress, "longPress"], |           [Blockly.Msg.senseBox_button_longPress, "longPress"], | ||||||
|           [Blockly.Msg.senseBox_button_switch,"toggleButton"] |  | ||||||
|         ]), |         ]), | ||||||
|         "FUNCTION" |         "FUNCTION" | ||||||
|       ) |       ) | ||||||
| @ -385,7 +382,6 @@ Blockly.Blocks["sensebox_scd30"] = { | |||||||
|     this.setColour(getColour().sensebox); |     this.setColour(getColour().sensebox); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_scd_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_scd_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_scd_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_scd_helpurl); | ||||||
|     this.data = {name: "scd30"}; |  | ||||||
|   }, |   }, | ||||||
|   onchange: function (e) { |   onchange: function (e) { | ||||||
|     var dropdown = this.getFieldValue("dropdown"); |     var dropdown = this.getFieldValue("dropdown"); | ||||||
| @ -430,11 +426,16 @@ Blockly.Blocks["sensebox_gps"] = { | |||||||
| 
 | 
 | ||||||
| Blockly.Blocks["sensebox_sensor_truebner_smt50"] = { | Blockly.Blocks["sensebox_sensor_truebner_smt50"] = { | ||||||
|   init: function () { |   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.setColour(getColour().sensebox); | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.senseBox_smt50); |     this.appendDummyInput().appendField(Blockly.Msg.senseBox_smt50); | ||||||
|     this.appendDummyInput() |     this.appendDummyInput() | ||||||
|       .appendField("Port:") |       .appendField("Port:") | ||||||
|       .appendField(new Blockly.FieldDropdown(selectedBoard().digitalPorts), "Port"); |       .appendField(new Blockly.FieldDropdown(dropdownOptions), "Port"); | ||||||
|     this.appendDummyInput() |     this.appendDummyInput() | ||||||
|       .appendField(Blockly.Msg.senseBox_value) |       .appendField(Blockly.Msg.senseBox_value) | ||||||
|       .appendField( |       .appendField( | ||||||
| @ -447,7 +448,6 @@ Blockly.Blocks["sensebox_sensor_truebner_smt50"] = { | |||||||
|     this.setOutput(true, Types.NUMBER.typeName); |     this.setOutput(true, Types.NUMBER.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_smt50_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_smt50_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_smt50_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_smt50_helpurl); | ||||||
|     this.data = {name: "smt50"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -458,15 +458,18 @@ Blockly.Blocks["sensebox_sensor_truebner_smt50"] = { | |||||||
| 
 | 
 | ||||||
| Blockly.Blocks["sensebox_sensor_watertemperature"] = { | Blockly.Blocks["sensebox_sensor_watertemperature"] = { | ||||||
|   init: function () { |   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.setColour(getColour().sensebox); | ||||||
|     this.appendDummyInput() |     this.appendDummyInput() | ||||||
|       .appendField(Blockly.Msg.senseBox_watertemperature) |       .appendField(Blockly.Msg.senseBox_watertemperature) | ||||||
|       .appendField("Port:") |       .appendField("Port:") | ||||||
|       .appendField(new Blockly.FieldDropdown(selectedBoard().digitalPorts), "Port"); |       .appendField(new Blockly.FieldDropdown(dropdownOptions), "Port"); | ||||||
|     this.setOutput(true, Types.NUMBER.typeName); |     this.setOutput(true, Types.NUMBER.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_watertemperature_tip); |     this.setTooltip(Blockly.Msg.senseBox_watertemperature_tip); | ||||||
|     this.data = {name: "ds18b20"}; |  | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -493,11 +496,16 @@ Blockly.Blocks['sensebox_windspeed'] = { | |||||||
| 
 | 
 | ||||||
| Blockly.Blocks["sensebox_soundsensor_dfrobot"] = { | Blockly.Blocks["sensebox_soundsensor_dfrobot"] = { | ||||||
|   init: function () { |   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.setColour(getColour().sensebox); | ||||||
|     this.appendDummyInput() |     this.appendDummyInput() | ||||||
|       .appendField(Blockly.Msg.senseBox_soundsensor_dfrobot) |       .appendField(Blockly.Msg.senseBox_soundsensor_dfrobot) | ||||||
|       .appendField("Port:") |       .appendField("Port:") | ||||||
|       .appendField(new Blockly.FieldDropdown(selectedBoard().digitalPorts), "Port"); |       .appendField(new Blockly.FieldDropdown(dropdownOptions), "Port"); | ||||||
|     this.setOutput(true, Types.DECIMAL.typeName); |     this.setOutput(true, Types.DECIMAL.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_soundsensor_dfrobot_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_soundsensor_dfrobot_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_soundsensor_dfrobot_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_soundsensor_dfrobot_helpurl); | ||||||
| @ -534,7 +542,6 @@ Blockly.Blocks["sensebox_sensor_dps310"] = { | |||||||
|     this.setOutput(true, Types.DECIMAL.typeName); |     this.setOutput(true, Types.DECIMAL.typeName); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_sensor_dps310_tooltip); |     this.setTooltip(Blockly.Msg.senseBox_sensor_dps310_tooltip); | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_sensor_dps310_helpurl); |     this.setHelpUrl(Blockly.Msg.senseBox_sensor_dps310_helpurl); | ||||||
|     this.data = {name: "dps310"}; |  | ||||||
|     this.getField("NAME").setValidator( |     this.getField("NAME").setValidator( | ||||||
|       function (val) { |       function (val) { | ||||||
|         this.updateShape_(val === "Altitude"); |         this.updateShape_(val === "Altitude"); | ||||||
| @ -555,31 +562,3 @@ Blockly.Blocks["sensebox_sensor_dps310"] = { | |||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * Sensirion SPS30 Fine Particular Matter Sensor |  | ||||||
|  * added 02.12.2022  |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
|  Blockly.Blocks["sensebox_sensor_sps30"] = { |  | ||||||
|   init: function () { |  | ||||||
|     this.appendDummyInput().appendField(Blockly.Msg.senseBox_sps30); |  | ||||||
|     this.appendDummyInput() |  | ||||||
|       .setAlign(Blockly.ALIGN_LEFT) |  | ||||||
|       .appendField(Blockly.Msg.senseBox_value) |  | ||||||
|       .appendField( |  | ||||||
|         new Blockly.FieldDropdown([ |  | ||||||
|           [Blockly.Msg.senseBox_sps30_1p0, "1p0"], |  | ||||||
|           [Blockly.Msg.senseBox_sps30_2p5, "2p5"], |  | ||||||
|           [Blockly.Msg.senseBox_sps30_4p0, "4p0"], |  | ||||||
|           [Blockly.Msg.senseBox_sps30_10p0, "10p0"], |  | ||||||
|         ]), |  | ||||||
|         "value" |  | ||||||
|       ) |  | ||||||
|       .appendField(Blockly.Msg.senseBox_sps30_dimension); |  | ||||||
|     this.setOutput(true, Types.DECIMAL.typeName); |  | ||||||
|     this.setColour(getColour().sensebox); |  | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_sps30_tooltip); |  | ||||||
|     this.setHelpUrl(Blockly.Msg.senseBox_sps30_helpurl); |  | ||||||
|   }, |  | ||||||
| }; |  | ||||||
| @ -9,10 +9,10 @@ Blockly.Blocks["variables_set_dynamic"] = { | |||||||
|     this.setPreviousStatement(true, null); |     this.setPreviousStatement(true, null); | ||||||
|     this.setNextStatement(true, null); |     this.setNextStatement(true, null); | ||||||
|     this.appendValueInput("VALUE") |     this.appendValueInput("VALUE") | ||||||
|       .appendField(Blockly.Msg.variables_set, Blockly.Msg.variables_set) |       .appendField("set", "set") | ||||||
|       .appendField("", "type") |       .appendField("", "type") | ||||||
|       .appendField(new Blockly.FieldVariable("VAR"), "VAR") |       .appendField(new Blockly.FieldVariable("VAR"), "VAR") | ||||||
|       .appendField(Blockly.Msg.variables_to); |       .appendField("to"); | ||||||
|   }, |   }, | ||||||
|   onchange: function (e) { |   onchange: function (e) { | ||||||
|     let variableID = this.getFieldValue("VAR"); |     let variableID = this.getFieldValue("VAR"); | ||||||
|  | |||||||
| @ -1,61 +0,0 @@ | |||||||
| import Blockly from "blockly"; |  | ||||||
| 
 |  | ||||||
|  /** |  | ||||||
|   * starte/stoppe Pumpe |  | ||||||
|   * |  | ||||||
|   */ |  | ||||||
| Blockly.Arduino.CleVerLab_pump = function (block) { |  | ||||||
|     var pin = block.getFieldValue('DigitalPin'); |  | ||||||
|     var state = block.getFieldValue("Mode"); |  | ||||||
|     Blockly['Arduino'].setupCode_['pinMode'] = 'pinMode(' + pin + ', OUTPUT);'; |  | ||||||
|     var code = 'digitalWrite(' + pin + ', ' + state + ');\n'; |  | ||||||
|     return code; |  | ||||||
| }; |  | ||||||
| /** |  | ||||||
|  * PH wert |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| Blockly.Arduino.CleVerLab_temperature = function () { |  | ||||||
|   var dropdown_pin = this.getFieldValue("DigitalPort"); |  | ||||||
|   Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; |  | ||||||
|   Blockly.Arduino.libraries_["library_oneWire"] = |  | ||||||
|     "#include <OneWire.h> // http://librarymanager/All#OneWire"; |  | ||||||
|   Blockly.Arduino.libraries_["library_oneDallasTemperature"] = |  | ||||||
|     "#include <DallasTemperature.h> // http://librarymanager/All#DallasTemperature"; |  | ||||||
|   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]; |  | ||||||
| }; |  | ||||||
| Blockly.Arduino.CleVerLab_pH = function () { |  | ||||||
|    var dropdown_pin = this.getFieldValue("DigitalPin"); |  | ||||||
|    Blockly.Arduino.definitions_["define_pHgetter"] = |  | ||||||
|      "#define SensorPin " + dropdown_pin +"\n#define samplingInterval 20\n#define printInterval 800\n#define ArrayLenth  40    //times of collection\nint pHArray[ArrayLenth];   //Store the average value of the sensor feedback\nint pHArrayIndex=0;\nfloat slope = 1.00;\nfloat b =0.00;"; |  | ||||||
|    Blockly.Arduino.codeFunctions_["sensebox_requestpH"] = |  | ||||||
|      "float getpH(){\nstatic unsigned long samplingTime = millis();\nstatic unsigned long printTime = millis();\nstatic float pHValue,voltage;\n//nif(millis()-samplingTime > samplingInterval){\n//pHArray[pHArrayIndex++]=analogRead(SensorPin);\nfor (int i = 1; i <= 10; i += 1) {\nvoltage = voltage + analogRead(SensorPin);\n}\n voltage = (voltage / 10)*5.0/1024; \nsamplingTime=millis();\n\nreturn pHValue = 3.5*voltage*slope+b;\n}\n"; |  | ||||||
|     Blockly.Arduino.codeFunctions_["avergearraypH"] = |  | ||||||
|         "double avergearray(int* arr, int number) {\n int i;\n int max, min;\n double avg;\n long amount = 0;\n if (number <= 0) {\n return 0;\n }\n if (number < 5) {\n for (i = 0; i < number; i++) {\n amount += arr[i];\n }\n avg = amount / number;\n return avg;\n }\n else {\n if (arr[0] < arr[1]) {\n min = arr[0];\n max = arr[1];\n }\n else {\n min = arr[1];\n max = arr[0];\n }\n for (i = 2; i < number; i++) {\n if (arr[i] < min) {\n amount += min;\n min = arr[i];\n }\n else {\n if (arr[i] > max) {\n amount += max;\n max = arr[i];\n }\n else {\n amount += arr[i];\n }\n }\n }\n avg = (double)amount / (number - 2);\n }\n return avg;\n}"; |  | ||||||
|    var code = "getpH()"; |  | ||||||
|    return [code, Blockly.Arduino.ORDER_ATOMIC]; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.CleVerLab_cali1 = function () { |  | ||||||
|    var var1 = Blockly.Arduino.valueToCode(this, 'VAR1', Blockly.Arduino.ORDER_ATOMIC) || "4.00"; |  | ||||||
|    var var2 = Blockly.Arduino.valueToCode(this, 'VAR2', Blockly.Arduino.ORDER_ATOMIC) || "7.00"; |  | ||||||
|    //var var1 = this.getFieldValue("VAR1");
 |  | ||||||
|    //var var2 = this.getFieldValue("VAR2");
 |  | ||||||
|    Blockly.Arduino.definitions_["define_pHKali"] = "#define pH4 4.00\n#define pH7 7.00\nfloat pH4is = "+ var1+";\nfloat pH7is = "+ var2 +";"; |  | ||||||
|    Blockly.Arduino.setupCode_["asdsadsa"] ="slope = (2.00-(4.00/3.50))/(pH7is/3.50 - pH4is/3.50);\n b = 7 - (pH7is * slope);"; |  | ||||||
|    var code = "0"; |  | ||||||
|    return [code, Blockly.Arduino.ORDER_ATOMIC]; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| @ -10,7 +10,6 @@ import "./sensebox-lora"; | |||||||
| import "./sensebox-led"; | import "./sensebox-led"; | ||||||
| import "./sensebox"; | import "./sensebox"; | ||||||
| import "./sensebox-rtc"; | import "./sensebox-rtc"; | ||||||
| import "./sensebox-ntp"; |  | ||||||
| import "./sensebox-ble"; | import "./sensebox-ble"; | ||||||
| import "./sensebox-sd"; | import "./sensebox-sd"; | ||||||
| import "./mqtt"; | import "./mqtt"; | ||||||
| @ -27,4 +26,3 @@ import "./variables"; | |||||||
| import "./lists"; | import "./lists"; | ||||||
| import "./watchdog"; | import "./watchdog"; | ||||||
| import "./webserver"; | import "./webserver"; | ||||||
| import "./CleVerLab" |  | ||||||
| @ -275,15 +275,10 @@ Blockly.Arduino["math_change"] = function (block) { | |||||||
|       "DELTA", |       "DELTA", | ||||||
|       Blockly.Arduino.ORDER_ADDITIVE |       Blockly.Arduino.ORDER_ADDITIVE | ||||||
|     ) || "0"; |     ) || "0"; | ||||||
|   var id = block.getFieldValue("VAR") |   var varName = Blockly.Arduino.nameDB_.getName( | ||||||
|   const varName = Blockly.Variables.getVariable( |     block.getFieldValue("VAR"), | ||||||
|       Blockly.getMainWorkspace(), |     Blockly.Variables.NAME_TYPE | ||||||
|       id |   ); | ||||||
|     ).name; |  | ||||||
|   // var varName = Blockly.Arduino.nameDB_.getName(
 |  | ||||||
|   //   block.getFieldValue("VAR"),
 |  | ||||||
|   //   Blockly.Variables.NAME_TYPE
 |  | ||||||
|   // );
 |  | ||||||
|   return varName + " += " + argument0 + ";\n"; |   return varName + " += " + argument0 + ";\n"; | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,19 +0,0 @@ | |||||||
| import Blockly from "blockly"; |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_ntp_init = function () { |  | ||||||
|   Blockly.Arduino.libraries_["WiFiUdp"] = `#include <WiFiUdp.h>`; |  | ||||||
|   Blockly.Arduino.libraries_["NTPClient"] = `#include <NTPClient.h>`; |  | ||||||
|   Blockly.Arduino.definitions_["WiFiUDP"] = `WiFiUDP ntpUDP;`; |  | ||||||
|   Blockly.Arduino.definitions_["NTPClient"] = `NTPClient timeClient(ntpUDP);`; |  | ||||||
|   Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; |  | ||||||
|   Blockly.Arduino.setupCode_["timeclient.begin"] = `timeClient.begin();`; |  | ||||||
|   Blockly.Arduino.setupCode_["timeclient.update"] = `timeClient.update();`; |  | ||||||
|   var code = ``; |  | ||||||
|   return code; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_ntp_get = function () { |  | ||||||
|   var format = this.getFieldValue("dropdown"); |  | ||||||
|   var code = `timeClient.${format}()`; |  | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |  | ||||||
| }; |  | ||||||
| @ -94,46 +94,3 @@ uint8_t sec, min, hour, day, month; | |||||||
|   var code = `getTimeStamp()`; |   var code = `getTimeStamp()`; | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |   return [code, Blockly.Arduino.ORDER_ATOMIC]; | ||||||
| }; | }; | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_internal_rtc_init = function () { |  | ||||||
|   Blockly.Arduino.libraries_["RTClib"] = `#include <RTCZero.h>`; |  | ||||||
|   Blockly.Arduino.definitions_["RTC"] = `RTCZero rtc;`; |  | ||||||
|   Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; |  | ||||||
|   Blockly.Arduino.setupCode_["rtc.begin"] = `rtc.begin();`; |  | ||||||
|   return ""; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_internal_rtc_set = function () { |  | ||||||
|   var branch = |  | ||||||
|     Blockly.Arduino.valueToCode(this, "time", Blockly.Arduino.ORDER_ATOMIC) || |  | ||||||
|     "0"; |  | ||||||
|   Blockly.Arduino.setupCode_["rtc.setEpoch"] = `rtc.setEpoch(${branch});`; |  | ||||||
|   var code = ``; |  | ||||||
|   return code; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_internal_rtc_get = function () { |  | ||||||
|   var dropdown = this.getFieldValue("dropdown"); |  | ||||||
|   var code = `rtc.get${dropdown}()`; |  | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_internal_rtc_get_timestamp = function () { |  | ||||||
|   Blockly.Arduino.variables_["rtc_timestamp"] = `char timestamp[20];`; |  | ||||||
|   Blockly.Arduino.codeFunctions_["getTimeStamp"] = ` |  | ||||||
| char* getTimeStamp() { |  | ||||||
| uint8_t sec, min, hour, day, month; |  | ||||||
|  uint16_t year; |  | ||||||
| sec = rtc.getSeconds(); |  | ||||||
| min = rtc.getMinutes(); |  | ||||||
| hour = rtc.getHours(); |  | ||||||
| day = rtc.getDay(); |  | ||||||
| month = rtc.getMonth(); |  | ||||||
| year = rtc.getYear(); |  | ||||||
|  sprintf(timestamp, "%02d-%02d-%02dT%02d:%02d:%02dZ", year, month, day, hour, min, sec); |  | ||||||
|  return timestamp; |  | ||||||
|  } |  | ||||||
|   `;
 |  | ||||||
|   var code = `getTimeStamp()`; |  | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |  | ||||||
| }; |  | ||||||
|  | |||||||
| @ -399,7 +399,6 @@ Blockly.Arduino.sensebox_button = function () { | |||||||
|   Blockly.Arduino.libraries_[ |   Blockly.Arduino.libraries_[ | ||||||
|     "library_jcButtons" |     "library_jcButtons" | ||||||
|   ] = `#include <JC_Button.h> // http://librarymanager/All#JC_Button`; |   ] = `#include <JC_Button.h> // http://librarymanager/All#JC_Button`; | ||||||
| 
 |  | ||||||
|   Blockly.Arduino.definitions_["define_button" + dropdown_pin + ""] = |   Blockly.Arduino.definitions_["define_button" + dropdown_pin + ""] = | ||||||
|     "Button button_" + dropdown_pin + "(" + dropdown_pin + ");"; |     "Button button_" + dropdown_pin + "(" + dropdown_pin + ");"; | ||||||
|   Blockly.Arduino.setupCode_["setup_button" + dropdown_pin + ""] = |   Blockly.Arduino.setupCode_["setup_button" + dropdown_pin + ""] = | ||||||
| @ -414,10 +413,6 @@ Blockly.Arduino.sensebox_button = function () { | |||||||
|   } else if (dropown_function === "longPress") { |   } else if (dropown_function === "longPress") { | ||||||
|     var time = this.getFieldValue("time"); |     var time = this.getFieldValue("time"); | ||||||
|     code = "button_" + dropdown_pin + ".pressedFor(" + time + ")"; |     code = "button_" + dropdown_pin + ".pressedFor(" + time + ")"; | ||||||
|   } else if (dropown_function === "toggleButton") { |  | ||||||
|     code = "button_" + dropdown_pin + ".toggleState()"; |  | ||||||
|     Blockly.Arduino.definitions_["define_button" + dropdown_pin + ""] = |  | ||||||
|     "ToggleButton button_" + dropdown_pin + "(" + dropdown_pin + ");"; |  | ||||||
|   } |   } | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |   return [code, Blockly.Arduino.ORDER_ATOMIC]; | ||||||
| }; | }; | ||||||
| @ -434,13 +429,11 @@ Blockly.Arduino.sensebox_scd30 = function () { | |||||||
|     "#include <SparkFun_SCD30_Arduino_Library.h> // http://librarymanager/All#SparkFun_SCD30_Arduino_Library"; |     "#include <SparkFun_SCD30_Arduino_Library.h> // http://librarymanager/All#SparkFun_SCD30_Arduino_Library"; | ||||||
|   Blockly.Arduino.definitions_["SCD30"] = "SCD30 airSensor;"; |   Blockly.Arduino.definitions_["SCD30"] = "SCD30 airSensor;"; | ||||||
|   Blockly.Arduino.setupCode_["init_scd30"] = ` Wire.begin();
 |   Blockly.Arduino.setupCode_["init_scd30"] = ` Wire.begin();
 | ||||||
| if (airSensor.begin() == false) |   if (airSensor.begin() == false) | ||||||
| { |   { | ||||||
|   while (1) |     while (1) | ||||||
|     ; |       ; | ||||||
| }`;
 |   }`;
 | ||||||
|   Blockly.Arduino.setupCode_["scd30_staleData"] = |  | ||||||
|     "airSensor.useStaleData(true);"; |  | ||||||
|   var code = ""; |   var code = ""; | ||||||
|   switch (dropdown) { |   switch (dropdown) { | ||||||
|     case "temperature": |     case "temperature": | ||||||
| @ -699,57 +692,3 @@ Blockly.Arduino.sensebox_sensor_dps310 = function () { | |||||||
|   } |   } | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |   return [code, Blockly.Arduino.ORDER_ATOMIC]; | ||||||
| }; | }; | ||||||
| 
 |  | ||||||
| /** |  | ||||||
|  * Sensirion SPS30 Fine Particlar Matter |  | ||||||
|  * |  | ||||||
|  */ |  | ||||||
| 
 |  | ||||||
| Blockly.Arduino.sensebox_sensor_sps30 = function () { |  | ||||||
|   var dropdown_name = this.getFieldValue("value"); |  | ||||||
|   Blockly.Arduino.libraries_["library_senseBoxIO"] = "#include <senseBoxIO.h>"; |  | ||||||
|   Blockly.Arduino.libraries_[ |  | ||||||
|     "sps30" |  | ||||||
|   ] = `#include <sps30.h> // http://librarymanager/All#`; |  | ||||||
|   Blockly.Arduino.variables_["sps30_measurement"] = |  | ||||||
|     "struct sps30_measurement m;"; |  | ||||||
|   Blockly.Arduino.variables_["sps30_auto_clean_days"] = |  | ||||||
|     "uint32_t auto_clean_days = 4;"; |  | ||||||
|   Blockly.Arduino.variables_["sps30_interval_intervalsps"] = |  | ||||||
|     "const long intervalsps = 1000;"; |  | ||||||
|   Blockly.Arduino.variables_["sps30_time_startsps"] = |  | ||||||
|     "unsigned long time_startsps = 0;"; |  | ||||||
|   Blockly.Arduino.variables_["sps30_time_actualsps"] = |  | ||||||
|     "unsigned long time_actualsps = 0;"; |  | ||||||
|   Blockly.Arduino.codeFunctions_["sps30_getData"] = ` |  | ||||||
| void getSPS30Data(){ |  | ||||||
| 
 |  | ||||||
| uint16_t data_ready; |  | ||||||
| int16_t ret; |  | ||||||
|        |  | ||||||
| do { |  | ||||||
|     ret = sps30_read_data_ready(&data_ready); |  | ||||||
|     if (ret < 0) {  |  | ||||||
|     } else if (!data_ready)  {} |  | ||||||
|     else |  | ||||||
|         break; |  | ||||||
|         delay(100); /* retry in 100ms */ |  | ||||||
|     } while (1); |  | ||||||
|     ret = sps30_read_measurement(&m);  |  | ||||||
| } |  | ||||||
|   `;
 |  | ||||||
| 
 |  | ||||||
|   Blockly.Arduino.setupCode_["sps30_begin"] = "sensirion_i2c_init();"; |  | ||||||
|   Blockly.Arduino.setupCode_["sps30_setFanCleaningInterval"] = |  | ||||||
|     "sps30_set_fan_auto_cleaning_interval_days(auto_clean_days);"; |  | ||||||
|   Blockly.Arduino.setupCode_["sps30_startMeasurement"] = |  | ||||||
|     "sps30_start_measurement();"; |  | ||||||
|   Blockly.Arduino.loopCodeOnce_["getSPS30Data();"] = ` |  | ||||||
| time_startsps = millis(); |  | ||||||
| if (time_startsps > time_actualsps + intervalsps) { |  | ||||||
|   time_actualsps = millis(); |  | ||||||
|   getSPS30Data(); |  | ||||||
| }`;
 |  | ||||||
|   var code = `m.mc_${dropdown_name}`; |  | ||||||
|   return [code, Blockly.Arduino.ORDER_ATOMIC]; |  | ||||||
| }; |  | ||||||
|  | |||||||
| @ -13,11 +13,6 @@ const sensebox_mcu = { | |||||||
|     ["C5", "5"], |     ["C5", "5"], | ||||||
|     ["C6", "6"], |     ["C6", "6"], | ||||||
|   ], |   ], | ||||||
|   digitalPorts: [ |  | ||||||
|     ["A", "A"], |  | ||||||
|     ["B", "B"], |  | ||||||
|     ["C", "C"], |  | ||||||
|   ], |  | ||||||
|   digitalPinsLED: [ |   digitalPinsLED: [ | ||||||
|     ["BUILTIN_1", "7"], |     ["BUILTIN_1", "7"], | ||||||
|     ["BUILTIN_2", "8"], |     ["BUILTIN_2", "8"], | ||||||
| @ -51,13 +46,9 @@ const sensebox_mcu = { | |||||||
|     ["C6", "6"], |     ["C6", "6"], | ||||||
|   ], |   ], | ||||||
|   serial: [ |   serial: [ | ||||||
|     ["SerialUSB", "SerialUSB"], |     ["serial", "SerialUSB"], | ||||||
|     ["Serial1", "Serial1"], |     ["serial_1", "Serial1"], | ||||||
|     ["Serial2", "Serial2"], |     ["serial_2", "Serial2"], | ||||||
|   ], |  | ||||||
|   serialSensors: [ |  | ||||||
|     ["Serial1", "Serial1"], |  | ||||||
|     ["Serial2", "Serial2"], |  | ||||||
|   ], |   ], | ||||||
|   serialPins: { |   serialPins: { | ||||||
|     SerialUSB: [ |     SerialUSB: [ | ||||||
| @ -148,9 +139,6 @@ const sensebox_mini = { | |||||||
|     ["IO1", "1"], |     ["IO1", "1"], | ||||||
|     ["IO2", "2"], |     ["IO2", "2"], | ||||||
|   ], |   ], | ||||||
|   digitalPorts: [ |  | ||||||
|     ["IO1-2", "A"], |  | ||||||
|   ], |  | ||||||
|   digitalPinsLED: [ |   digitalPinsLED: [ | ||||||
|     ["BUILTIN_1", "7"], |     ["BUILTIN_1", "7"], | ||||||
|     ["BUILTIN_2", "8"], |     ["BUILTIN_2", "8"], | ||||||
| @ -159,7 +147,8 @@ const sensebox_mini = { | |||||||
|   ], |   ], | ||||||
|   digitalPinsRGB: [ |   digitalPinsRGB: [ | ||||||
|     ["on Board", "6"], |     ["on Board", "6"], | ||||||
|     ["IO1-2", "1"], |     ["IO1", "1"], | ||||||
|  |     ["IO2", "2"], | ||||||
|   ], |   ], | ||||||
|   digitalPinsButton: [ |   digitalPinsButton: [ | ||||||
|     ["on Board", "0"], |     ["on Board", "0"], | ||||||
| @ -172,11 +161,8 @@ const sensebox_mini = { | |||||||
|     ["IO2", "2"], |     ["IO2", "2"], | ||||||
|   ], |   ], | ||||||
|   serial: [ |   serial: [ | ||||||
|     ["SerialUSB", "SerialUSB"], |     ["serial", "SerialUSB"], | ||||||
|     ["Serial1", "Serial1"], |     ["serial_1", "Serial1"], | ||||||
|   ], |  | ||||||
|   serialSensors: [ |  | ||||||
|     ["Serial1", "Serial1"], |  | ||||||
|   ], |   ], | ||||||
|   serialPins: { |   serialPins: { | ||||||
|     SerialUSB: [ |     SerialUSB: [ | ||||||
|  | |||||||
| @ -15,7 +15,6 @@ const colours = { | |||||||
|   webserver: 40, |   webserver: 40, | ||||||
|   phyphox: 25, |   phyphox: 25, | ||||||
|   motors: 190, |   motors: 190, | ||||||
|   cleverlab: 185 , |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export const getColour = () => { | export const getColour = () => { | ||||||
|  | |||||||
| @ -13,8 +13,6 @@ const maxInstances = { | |||||||
|   sensebox_lora_initialize_otaa: 1, |   sensebox_lora_initialize_otaa: 1, | ||||||
|   sensebox_lora_initialize_abp: 1, |   sensebox_lora_initialize_abp: 1, | ||||||
|   sensebox_phyphox_init: 1, |   sensebox_phyphox_init: 1, | ||||||
|   sensebox_phyphox_experiment: 1, |  | ||||||
|   sensebox_phyphox_experiment_send: 1, |  | ||||||
|   sensebox_ethernet: 1, |   sensebox_ethernet: 1, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -21,51 +21,39 @@ | |||||||
|  * @author samelh@google.com (Sam El-Husseini) |  * @author samelh@google.com (Sam El-Husseini) | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| import React from "react"; |  import React from 'react'; | ||||||
| import BlocklyComponent from "./BlocklyComponent"; | import BlocklyComponent from './BlocklyComponent'; | ||||||
| 
 | 
 | ||||||
| export default BlocklyComponent; | export default BlocklyComponent; | ||||||
| 
 | 
 | ||||||
| const Block = (p) => { | const Block = (p) => { | ||||||
|   const { children, ...props } = p; |     const { children, ...props } = p; | ||||||
|   props.is = "blockly"; |     props.is = "blockly"; | ||||||
|   return React.createElement("block", props, children); |     return React.createElement("block", props, children); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const Category = (p) => { | const Category = (p) => { | ||||||
|   const { children, ...props } = p; |     const { children, ...props } = p; | ||||||
|   props.is = "blockly"; |     props.is = "blockly"; | ||||||
|   return React.createElement("category", props, children); |     return React.createElement("category", props, children); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const Value = (p) => { | const Value = (p) => { | ||||||
|   const { children, ...props } = p; |     const { children, ...props } = p; | ||||||
|   props.is = "blockly"; |     props.is = "blockly"; | ||||||
|   return React.createElement("value", props, children); |     return React.createElement("value", props, children); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const Field = (p) => { | const Field = (p) => { | ||||||
|   const { children, ...props } = p; |     const { children, ...props } = p; | ||||||
|   props.is = "blockly"; |     props.is = "blockly"; | ||||||
|   return React.createElement("field", props, children); |     return React.createElement("field", props, children); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const Shadow = (p) => { | const Shadow = (p) => { | ||||||
|   const { children, ...props } = p; |     const { children, ...props } = p; | ||||||
|   props.is = "blockly"; |     props.is = "blockly"; | ||||||
|   return React.createElement("shadow", props, children); |     return React.createElement("shadow", props, children); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const Sep = (p) => { | export { Block, Category, Value, Field, Shadow } | ||||||
|   const { children, ...props } = p; |  | ||||||
|   props.is = "blockly"; |  | ||||||
|   return React.createElement("sep", props, children); |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| const Label = (p) => { |  | ||||||
|   const { children, ...props } = p; |  | ||||||
|   props.is = "blockly"; |  | ||||||
|   return React.createElement("label", props, children); |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| export { Block, Category, Value, Field, Shadow, Sep, Label }; |  | ||||||
| @ -12,7 +12,6 @@ import { LED } from "./de/sensebox-led"; | |||||||
| import { LORA } from "./de/sensebox-lora"; | import { LORA } from "./de/sensebox-lora"; | ||||||
| import { OSEM } from "./de/sensebox-osem"; | import { OSEM } from "./de/sensebox-osem"; | ||||||
| import { RTC } from "./de/sensebox-rtc"; | import { RTC } from "./de/sensebox-rtc"; | ||||||
| import { NTP } from "./de/sensebox-ntp"; |  | ||||||
| import { SD } from "./de/sensebox-sd"; | import { SD } from "./de/sensebox-sd"; | ||||||
| import { SENSORS } from "./de/sensebox-sensors"; | import { SENSORS } from "./de/sensebox-sensors"; | ||||||
| import { SENSEBOX } from "./de/sensebox"; | import { SENSEBOX } from "./de/sensebox"; | ||||||
| @ -41,7 +40,6 @@ export const De = { | |||||||
|   ...LORA, |   ...LORA, | ||||||
|   ...OSEM, |   ...OSEM, | ||||||
|   ...RTC, |   ...RTC, | ||||||
|   ...NTP, |  | ||||||
|   ...SD, |   ...SD, | ||||||
|   ...SENSORS, |   ...SENSORS, | ||||||
|   ...SENSEBOX, |   ...SENSEBOX, | ||||||
|  | |||||||
| @ -1,11 +0,0 @@ | |||||||
| export const NTP = { |  | ||||||
|   sensebox_ntp_init: "Initialisiere NTP", |  | ||||||
|   sensebox_ntp_init_tooltip: "Initialisiere den NTP Server.", |  | ||||||
|   sensebox_ntp_get: "Hole Zeit von NTP Server: ", |  | ||||||
|   sensebox_ntp_get_timestamp_tooltip: |  | ||||||
|     "Gibt dir einen in ISO 8601 formatierten Zeitstempel zurück. Bsp: 2021-12-24T18:21Z", |  | ||||||
|   sensebox_ntp_get_tooltip: |  | ||||||
|     "Gibt dir den ausgewählten Wert zurück. Unix Zeit entspricht der Anzahl der Sekunden seit dem 1.1.1970", |  | ||||||
|   sensebox_ntp_epochTime: "Unix Zeit", |  | ||||||
|   sensebox_ntp_formattedTimeStamp: "Zeitstempel (hh:mm:ss)", |  | ||||||
| }; |  | ||||||
| @ -1,14 +1,14 @@ | |||||||
| export const RTC = { | export const RTC = { | ||||||
|   sensebox_rtc_init: "Initialisiere externe RTC", |   sensebox_rtc_init: "Initialisiere RTC", | ||||||
|   sensebox_rtc_init_tooltip: |   sensebox_rtc_init_tooltip: | ||||||
|     "Initialisiere die RTC. Schließe diese an einen der 5 I2C/Wire Anschlüsse an und lege die Batterie ein. Bevor du die Uhrzeit auslesen kannst muss diese zunächst einmal gesetzt werden. Dieser Schritt muss normalerweise nur einmalig durchgeführt werden.", |     "Initialisiere die RTC. Schließe diese an einen der 5 I2C/Wire Anschlüsse an und lege die Batterie ein. Bevor du die Uhrzeit auslesen kannst muss diese zunächst einmal gesetzt werden. Dieser Schritt muss normalerweise nur einmalig durchgeführt werden.", | ||||||
|   sensebox_rtc_set: "Setze Uhrzeit/Datum der externen RTC", |   sensebox_rtc_set: "Setze Uhrzeit/Datum der RTC", | ||||||
|   sensebox_rtc_set_tooltip: |   sensebox_rtc_set_tooltip: | ||||||
|     "Stellt die Uhrzeit der RTC ein. Beachte, dass du diesen Block im Setup ausführst.", |     "Stellt die Uhrzeit der RTC ein. Beachte, dass du diesen Block im Setup ausführst.", | ||||||
|   sensebox_rtc_get_timestamp: "Zeitstempel externe RTC (RFC 3339)", |   sensebox_rtc_get_timestamp: "Zeitstempel (RFC 3339)", | ||||||
|   sensebox_rtc_get_timestamp_tooltip: |   sensebox_rtc_get_timestamp_tooltip: | ||||||
|     "Gibt dir einen in ISO 8601 formatierten Zeitstempel zurück. Bsp: 2021-12-24T18:21Z", |     "Gibt dir einen in ISO 8601 formatierten Zeitstempel zurück. Bsp: 2021-12-24T18:21Z", | ||||||
|   sensebox_rtc_get: "Wert (externe RTC): ", |   sensebox_rtc_get: "Wert: ", | ||||||
|   sensebox_rtc_get_tooltip: "Gibt dir den ausgewählten Wert zurück.", |   sensebox_rtc_get_tooltip: "Gibt dir den ausgewählten Wert zurück.", | ||||||
|   sensebox_rtc_second: "Sekunden", |   sensebox_rtc_second: "Sekunden", | ||||||
|   sensebox_rtc_minutes: "Minuten", |   sensebox_rtc_minutes: "Minuten", | ||||||
| @ -16,22 +16,4 @@ export const RTC = { | |||||||
|   sensebox_rtc_day: "Tag", |   sensebox_rtc_day: "Tag", | ||||||
|   sensebox_rtc_month: "Monat", |   sensebox_rtc_month: "Monat", | ||||||
|   sensebox_rtc_year: "Jahr", |   sensebox_rtc_year: "Jahr", | ||||||
|   sensebox_internal_rtc_init: "Initialisiere interne RTC", |  | ||||||
|   sensebox_internal_rtc_init_tooltip: |  | ||||||
|     "Initialisieren der internen RTC. Diese RTC ist nicht batteriegepuffert und wird bei jedem Einschaltvorgang zurückgesetzt", |  | ||||||
|   sensebox_internal_rtc_set: "Setze interne RTC Zeit/Datum (Unix Time)", |  | ||||||
|   sensebox_internal_rtc_set_tooltip: |  | ||||||
|     "Setzt die Zeit der internen RTC. Führe den Block einmalig im Setup aus und setzte die Uhrzeit über die Unix Zeit.", |  | ||||||
|   sensebox_internal_rtc_get: "Wert (interne RTC): ", |  | ||||||
|   sensebox_internal_rtc_get_timestamp: "Zeitstempel interne RTC (RFC 3339)", |  | ||||||
|   sensebox_internal_rtc_get_timestamp_tooltip: |  | ||||||
|     "Returns a timestamp formatted in ISO 8601. Ex: 2021-12-24T18:21Z", |  | ||||||
|   sensebox_internal_rtc_get_tooltip: "Gibt den ausgewählten Wert zurück", |  | ||||||
|   sensebox_internal_rtc_epoch: "Unix Zeit", |  | ||||||
|   sensebox_internal_rtc_year: "Jahr", |  | ||||||
|   sensebox_internal_rtc_month: "Monat", |  | ||||||
|   sensebox_internal_rtc_day: "Tag", |  | ||||||
|   sensebox_internal_rtc_hour: "Stunde", |  | ||||||
|   sensebox_internal_rtc_minutes: "Minute", |  | ||||||
|   sensebox_internal_rtc_seconds: "Sekunde", |  | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -140,7 +140,6 @@ Wenn die maximale Distanz überschritten wird, wird ein Wert von **O** ausgegebe | |||||||
|   senseBox_bme_iaq: "Innenraumluftqualität (IAQ)", |   senseBox_bme_iaq: "Innenraumluftqualität (IAQ)", | ||||||
|   senseBox_bme_iaq_accuracy: "Kalibrierungswert", |   senseBox_bme_iaq_accuracy: "Kalibrierungswert", | ||||||
|   senseBox_bme_co2: "CO2 Äquivalent", |   senseBox_bme_co2: "CO2 Äquivalent", | ||||||
|   senseBox_bme_pressure: "Luftdruck in Pa", |  | ||||||
|   senseBox_bme_breatheVocEquivalent: "Atemluft VOC Ä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. 
 |   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: | Den Status der Kalibrierung kann über den Kalibrierungswert abgelesen werden. Er ist entweder 0, 1, 2 oder 3 und sagt folgendes aus: | ||||||
| @ -176,7 +175,7 @@ Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt ver | |||||||
|    * Feinstaubsensor (SDS011) |    * Feinstaubsensor (SDS011) | ||||||
|    */ |    */ | ||||||
| 
 | 
 | ||||||
|   senseBox_sds011: "Feinstaubsensor SDS011", |   senseBox_sds011: "Feinstaubsensor", | ||||||
|   senseBox_sds011_dimension: "in µg/m³ an", |   senseBox_sds011_dimension: "in µg/m³ an", | ||||||
|   senseBox_sds011_pm25: "PM2.5", |   senseBox_sds011_pm25: "PM2.5", | ||||||
|   senseBox_sds011_pm10: "PM10", |   senseBox_sds011_pm10: "PM10", | ||||||
| @ -201,23 +200,4 @@ Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt ver | |||||||
| - "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 | - "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`,
 | - "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: "", |   senseBox_button_helpurl: "", | ||||||
| 
 | }; | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|   /** |  | ||||||
|    * Feinstaubsensor Sensirion SPS30 |  | ||||||
|    */ |  | ||||||
| 
 |  | ||||||
|    senseBox_sps30: "Feinstaubsensor Sensirion SPS30", |  | ||||||
|    senseBox_sps30_dimension: "in µg/m³", |  | ||||||
|    senseBox_sps30_1p0: "PM1.0", |  | ||||||
|    senseBox_sps30_2p5: "PM2.5", |  | ||||||
|    senseBox_sps30_4p0: "PM4.0", |  | ||||||
|    senseBox_sps30_10p0: "PM10", |  | ||||||
|    senseBox_sps30_tooltip:"Dieser Block gibt dir den Messwert des Sensirion SPS30 Feinstaubsensor. Schließe den Feinstaubsensor an einen der 5 **I2C** Anschlüssen an. Im Dropdown Menü zwischen PM1.0, PM2.5, PM4.0 und PM10 auswählen. Der Messwert wird dir als **Kommazahl** in µg/m3", |  | ||||||
|     senseBox_sps30_helpurl: |  | ||||||
|      "https://docs.sensebox.de/hardware/sensoren-feinstaub/", |  | ||||||
|   |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     }; |  | ||||||
|  | |||||||
| @ -8,27 +8,21 @@ export const UI = { | |||||||
|   toolbox_math: "Mathematik", |   toolbox_math: "Mathematik", | ||||||
|   toolbox_io: "Eingang/Ausgang", |   toolbox_io: "Eingang/Ausgang", | ||||||
|   toolbox_time: "Zeit", |   toolbox_time: "Zeit", | ||||||
|   toolbox_rtc: "RTC", |  | ||||||
|   toolbox_ntp: "NTP", |  | ||||||
|   toolbox_functions: "Funktionen", |   toolbox_functions: "Funktionen", | ||||||
|   toolbox_variables: "Variablen", |   toolbox_variables: "Variablen", | ||||||
|   toolbox_serial: "Seriell", |   toolbox_serial: "Seriell", | ||||||
|   toolbox_advanced: "Erweitert", |   toolbox_advanced: "Erweitert", | ||||||
|   toolbox_motors: "Motoren", |   toolbox_motors: "Motoren", | ||||||
|   toolbox_label_externalRTC: "Externe RTC", |  | ||||||
|   toolbox_label_internalRTC: "Interne RTC", |  | ||||||
|   variable_NUMBER: "Zahl (int)", |   variable_NUMBER: "Zahl (int)", | ||||||
|   variable_SHORT_NUMBER: "char", |   variable_SHORT_NUMBER: "char", | ||||||
|   variable_LONG: "große Zahl (long)", |   variable_LONG: "große Zahl (long)", | ||||||
|   variable_DECIMAL: "Kommazahl (float)", |   variable_DECIMAL: "Kommazahl (float)", | ||||||
|   variables_TEXT: "Text (string)", |   variables_TEXT: "Text (string)", | ||||||
|   variables_ARRAY: "Array (array)", |   variables_ARRAY: "Array (array)", | ||||||
|   variables_CHARACTER: "Buchstabe (char)", |   variables_CHARACTER: "char (char)", | ||||||
|   variables_BOOLEAN: "Boolean (boolean)", |   variables_BOOLEAN: "Boolean (boolean)", | ||||||
|   variables_NULL: "void (void)", |   variables_NULL: "void (void)", | ||||||
|   variables_UNDEF: "undefined", |   variables_UNDEF: "undefined", | ||||||
|   variables_set: "Schreibe", |  | ||||||
|   variables_to: "", |  | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * Tooltips |    * Tooltips | ||||||
| @ -156,7 +150,6 @@ export const UI = { | |||||||
|   button_next: "nächster Schritt", |   button_next: "nächster Schritt", | ||||||
|   button_tutorial_overview: "Tutorial Übersicht", |   button_tutorial_overview: "Tutorial Übersicht", | ||||||
|   button_login: "Anmelden", |   button_login: "Anmelden", | ||||||
|   button_createVariable: "Typisierte Variable erstellen", |  | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * |    * | ||||||
| @ -316,18 +309,7 @@ export const UI = { | |||||||
|    * Device Selction |    * Device Selction | ||||||
|    *  */ |    *  */ | ||||||
|   deviceselection_head: "Welches Board benutzt du?", |   deviceselection_head: "Welches Board benutzt du?", | ||||||
|   deviceselection_keep_selection: |   deviceselection_keep_selection: "Speichere meine Auswahl fürs nächste Mal (Du kannst das Board später in den Einstellungen wechseln)", | ||||||
|     "Speichere meine Auswahl fürs nächste Mal (Du kannst das Board später in den Einstellungen wechseln)", |  | ||||||
|   deviceselection_footnote: "Hier kommst du zur alten Blockly Version für den ", |   deviceselection_footnote: "Hier kommst du zur alten Blockly Version für den ", | ||||||
|   deviceselection_footnote_02: "oder die", |   deviceselection_footnote_02: "oder die" | ||||||
| 
 |  | ||||||
|   /** |  | ||||||
|    * Sensor Markdown Information |  | ||||||
|    */ |  | ||||||
|   sensorinfo_info: "Informationen zum Sensor", |  | ||||||
|   sensorinfo_description: "Beschreibung", |  | ||||||
|   sensorinfo_measurable_phenos: "Messbare Phänomene", |  | ||||||
|   sensorinfo_manufacturer: "Hersteller", |  | ||||||
|   sensorinfo_lifetime: "Lebensdauer", |  | ||||||
|   sensorinfo_explanation: "Diese Informationen wurden aus [sensors.wiki](https://sensors.wiki) entnommen. Für weitere Informationen besuchen Sie den Abschnitt über diesen Sensor " |  | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -13,7 +13,6 @@ import { LED } from "./en/sensebox-led"; | |||||||
| import { LORA } from "./en/sensebox-lora"; | import { LORA } from "./en/sensebox-lora"; | ||||||
| import { OSEM } from "./en/sensebox-osem"; | import { OSEM } from "./en/sensebox-osem"; | ||||||
| import { RTC } from "./en/sensebox-rtc"; | import { RTC } from "./en/sensebox-rtc"; | ||||||
| import { NTP } from "./en/sensebox-ntp"; |  | ||||||
| import { SD } from "./en/sensebox-sd"; | import { SD } from "./en/sensebox-sd"; | ||||||
| import { SENSORS } from "./en/sensebox-sensors"; | import { SENSORS } from "./en/sensebox-sensors"; | ||||||
| import { TELEGRAM } from "./en/sensebox-telegram"; | import { TELEGRAM } from "./en/sensebox-telegram"; | ||||||
| @ -41,7 +40,6 @@ export const En = { | |||||||
|   ...LORA, |   ...LORA, | ||||||
|   ...OSEM, |   ...OSEM, | ||||||
|   ...RTC, |   ...RTC, | ||||||
|   ...NTP, |  | ||||||
|   ...SD, |   ...SD, | ||||||
|   ...SENSORS, |   ...SENSORS, | ||||||
|   ...SENSEBOX, |   ...SENSEBOX, | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| export const CLEVERLAB = { |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| @ -1,10 +0,0 @@ | |||||||
| export const NTP = { |  | ||||||
|   sensebox_ntp_init: "Initialise NTP", |  | ||||||
|   sensebox_ntp_init_tooltip: |  | ||||||
|     "Initialisiere die RTC. Schließe diese an einen der 5 I2C/Wire Anschlüsse an und lege die Batterie ein. Bevor du die Uhrzeit auslesen kannst muss diese zunächst einmal gesetzt werden. Dieser Schritt muss normalerweise nur einmalig durchgeführt werden.", |  | ||||||
|   sensebox_ntp_get: "Get time from NTP Server: ", |  | ||||||
|   sensebox_ntp_get_tooltip: |  | ||||||
|     "Gibt dir den ausgewählten Wert zurück. Unix Zeit entspricht der Anzahl der Sekunden seit dem 1.1.1970", |  | ||||||
|   sensebox_ntp_epochTime: "Unix time", |  | ||||||
|   sensebox_ntp_formattedTimeStamp: "Timestamp (hh:mm:ss)", |  | ||||||
| }; |  | ||||||
| @ -1,11 +1,11 @@ | |||||||
| export const RTC = { | export const RTC = { | ||||||
|   sensebox_rtc_init: "Initialise external RTC", |   sensebox_rtc_init: "Initialise RTC", | ||||||
|   sensebox_rtc_init_tooltip: |   sensebox_rtc_init_tooltip: | ||||||
|     "Initialise the RTC. Connect it to one of the 5 I2C/Wire connections and insert the battery. Before you can read out the time, it must first be set. This step usually only needs to be done once.", |     "Initialise the RTC. Connect it to one of the 5 I2C/Wire connections and insert the battery. Before you can read out the time, it must first be set. This step usually only needs to be done once.", | ||||||
|   sensebox_rtc_set: "Set RTC time/date:", |   sensebox_rtc_set: "Set RTC time/date:", | ||||||
|   sensebox_rtc_set_tooltip: |   sensebox_rtc_set_tooltip: | ||||||
|     "Sets the time of the RTC. Note that you execute this block in the setup.", |     "Sets the time of the RTC. Note that you execute this block in the setup.", | ||||||
|   sensebox_rtc_get_timestamp: "Timestamp external RTC (RFC 3339)", |   sensebox_rtc_get_timestamp: "Get timestamp", | ||||||
|   sensebox_rtc_get_timestamp_tooltip: |   sensebox_rtc_get_timestamp_tooltip: | ||||||
|     "Returns a timestamp formatted in ISO 8601. Ex: 2021-12-24T18:21Z", |     "Returns a timestamp formatted in ISO 8601. Ex: 2021-12-24T18:21Z", | ||||||
|   sensebox_rtc_get_tooltip: "Returns the selected value", |   sensebox_rtc_get_tooltip: "Returns the selected value", | ||||||
| @ -17,22 +17,4 @@ export const RTC = { | |||||||
|   sensebox_rtc_day: "day", |   sensebox_rtc_day: "day", | ||||||
|   sensebox_rtc_month: "month", |   sensebox_rtc_month: "month", | ||||||
|   sensebox_rtc_year: "year", |   sensebox_rtc_year: "year", | ||||||
|   sensebox_internal_rtc_init: "Initialise internal RTC", |  | ||||||
|   sensebox_internal_rtc_init_tooltip: |  | ||||||
|     "Initialise the internal RTC. This RTC is not battery backed and will be reset on every power cycle.", |  | ||||||
|   sensebox_internal_rtc_set: "Set internal RTC time/date:", |  | ||||||
|   sensebox_internal_rtc_set_tooltip: |  | ||||||
|     "Sets the time of the internal RTC. Note that you execute this block in the setup.", |  | ||||||
|   sensebox_internal_rtc_get: "Get: ", |  | ||||||
|   sensebox_internal_rtc_get_timestamp: "Timestamp internal RTC (RFC 3339)", |  | ||||||
|   sensebox_internal_rtc_get_timestamp_tooltip: |  | ||||||
|     "Returns a timestamp formatted in ISO 8601. Ex: 2021-12-24T18:21Z", |  | ||||||
|   sensebox_internal_rtc_get_tooltip: "Returns the selected value", |  | ||||||
|   sensebox_internal_rtc_epoch: "Unix Time", |  | ||||||
|   sensebox_internal_rtc_year: "year", |  | ||||||
|   sensebox_internal_rtc_month: "month", |  | ||||||
|   sensebox_internal_rtc_day: "day", |  | ||||||
|   sensebox_internal_rtc_hour: "hour", |  | ||||||
|   sensebox_internal_rtc_minutes: "minutes", |  | ||||||
|   sensebox_internal_rtc_seconds: "seconds", |  | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -141,7 +141,6 @@ If the max distance is reached the a value of **O** will be returned`, | |||||||
|   senseBox_bme680: "Environmental sensor (BME680)", |   senseBox_bme680: "Environmental sensor (BME680)", | ||||||
|   senseBox_bme_iaq: "Indoor Air Quality (IAQ)", |   senseBox_bme_iaq: "Indoor Air Quality (IAQ)", | ||||||
|   senseBox_bme_iaq_accuracy: "Calibration Value", |   senseBox_bme_iaq_accuracy: "Calibration Value", | ||||||
|   senseBox_bme_pressure: "Airpressure in Pa", |  | ||||||
|   senseBox_bme_co2: "CO2 Equivalent", |   senseBox_bme_co2: "CO2 Equivalent", | ||||||
|   senseBox_bme_breatheVocEquivalent: "Breathe VOC Equivalent", |   senseBox_bme_breatheVocEquivalent: "Breathe VOC Equivalent", | ||||||
|   senseBox_bme_tooltip: `Connect the environmental sensor to one of the 5 **I2C ports**. **Note:** The sensor needs some time to calibrate. 
 |   senseBox_bme_tooltip: `Connect the environmental sensor to one of the 5 **I2C ports**. **Note:** The sensor needs some time to calibrate. 
 | ||||||
| @ -206,23 +205,4 @@ The measured values for temperature, humidity and air pressure can be used direc | |||||||
|    * |    * | ||||||
|    */ |    */ | ||||||
|   senseBox_watertemperature: "Water Temperature", |   senseBox_watertemperature: "Water Temperature", | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|     /** |  | ||||||
|    * Feinstaubsensor Sensirion SPS30 |  | ||||||
|    */ |  | ||||||
| 
 |  | ||||||
|      senseBox_sps30: "Particulate Matter Sensor (Sensirion SPS30)", |  | ||||||
|      senseBox_sps30_dimension: "in µg/m³", |  | ||||||
|      senseBox_sps30_1p0: "PM1.0", |  | ||||||
|      senseBox_sps30_2p5: "PM2.5", |  | ||||||
|      senseBox_sps30_4p0: "PM4.0", |  | ||||||
|      senseBox_sps30_10p0: "PM10", |  | ||||||
|      senseBox_sps30_tooltip: |  | ||||||
|      "This block gives you the measured value of the Sensirion SPS30 fine dust sensor. Connect the fine dust sensor to one of the 5 **I2C** connectors. Select between PM1.0, PM2.5, PM4.0 and PM10 in the dropdown menu. The measured value will be displayed as **decimal** in µg/m3", |  | ||||||
|      senseBox_sps30_helpurl: |  | ||||||
|        "https://docs.sensebox.de/hardware/sensoren-feinstaub/", |  | ||||||
|     |  | ||||||
|    |  | ||||||
| 
 |  | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -8,27 +8,21 @@ export const UI = { | |||||||
|   toolbox_math: "Math", |   toolbox_math: "Math", | ||||||
|   toolbox_io: "Input/Output", |   toolbox_io: "Input/Output", | ||||||
|   toolbox_time: "Time", |   toolbox_time: "Time", | ||||||
|   toolbox_rtc: "RTC", |  | ||||||
|   toolbox_ntp: "NTP", |  | ||||||
|   toolbox_functions: "Functions", |   toolbox_functions: "Functions", | ||||||
|   toolbox_variables: "Variables", |   toolbox_variables: "Variables", | ||||||
|   toolbox_serial: "Serial", |   toolbox_serial: "Serial", | ||||||
|   toolbox_advanced: "Erweitert", |   toolbox_advanced: "Erweitert", | ||||||
|   toolbox_motors: "Motors", |   toolbox_motors: "Motors", | ||||||
|   toolbox_label_externalRTC: "External RTC", |  | ||||||
|   toolbox_label_internalRTC: "Internal RTC", |  | ||||||
|   variable_NUMBER: "Number (int)", |   variable_NUMBER: "Number (int)", | ||||||
|   variable_SHORT_NUMBER: "char", |   variable_SHORT_NUMBER: "char", | ||||||
|   variable_LONG: "Big number (long)", |   variable_LONG: " Zahl (long)", | ||||||
|   variable_DECIMAL: "Decimal (float)", |   variable_DECIMAL: "Decimal (float)", | ||||||
|   variables_TEXT: "Text (string)", |   variables_TEXT: "Text (string)", | ||||||
|   variables_ARRAY: "Array (array)", |   variables_ARRAY: "Array (array)", | ||||||
|   variables_CHARACTER: "Character (char)", |   variables_CHARACTER: "char (char)", | ||||||
|   variables_BOOLEAN: "Boolean (boolean)", |   variables_BOOLEAN: "Boolean (boolean)", | ||||||
|   variables_NULL: "void (void)", |   variables_NULL: "void (void)", | ||||||
|   variables_UNDEF: "undefined", |   variables_UNDEF: "undefined", | ||||||
|   variables_set: "set", |  | ||||||
|   variables_to: "to", |  | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * Tooltips |    * Tooltips | ||||||
| @ -151,7 +145,6 @@ export const UI = { | |||||||
|   button_next: "Next step", |   button_next: "Next step", | ||||||
|   button_tutorial_overview: "Tutorial overview", |   button_tutorial_overview: "Tutorial overview", | ||||||
|   button_login: "Login", |   button_login: "Login", | ||||||
|   button_createVariable: "Create Typed Variable", |  | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
|    * |    * | ||||||
| @ -307,24 +300,13 @@ export const UI = { | |||||||
|   codeeditor_compile_progress: |   codeeditor_compile_progress: | ||||||
|     "Your code will now be compiled and then downloaded to your computer", |     "Your code will now be compiled and then downloaded to your computer", | ||||||
| 
 | 
 | ||||||
|   /** |       /** | ||||||
|   * Device Selection |    * Device Selction | ||||||
|   * */  |    *  */ | ||||||
| 
 |  | ||||||
|   deviceselection_head: "Which board are you using?", |   deviceselection_head: "Which board are you using?", | ||||||
|   deviceselection_keep_selection: |   deviceselection_keep_selection: "Save my choice (You can change the board later in the settings)", | ||||||
|     "Save my choice (You can change the board later in the settings)", |   deviceselection_footnote: "Here you can access the old blockly Version for the", | ||||||
|   deviceselection_footnote: |  | ||||||
|     "Here you can access the old blockly Version for the", |  | ||||||
|   deviceselection_footnote_02: "or the", |   deviceselection_footnote_02: "or the", | ||||||
| 
 | 
 | ||||||
|   /** | 
 | ||||||
|    * Sensor Markdown Information |  | ||||||
|    * */ |  | ||||||
|   sensorinfo_info: "Informationen regarding the Sensor", |  | ||||||
|   sensorinfo_description: "Description", |  | ||||||
|   sensorinfo_measurable_phenos: "Measurable Phenomena", |  | ||||||
|   sensorinfo_manufacturer: "Manufacturer", |  | ||||||
|   sensorinfo_lifetime: "Lifetime", |  | ||||||
|   sensorinfo_explanation: "This information was fetched from [sensors.wiki](https://sensors.wiki). For more information visit the section on this sensor ", |  | ||||||
| }; | }; | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| import React from "react"; | import React from "react"; | ||||||
| import { Block, Value, Field, Shadow, Category, Sep, Label } from "../"; | import { Block, Value, Field, Shadow, Category } from "../"; | ||||||
| import { getColour } from "../helpers/colour"; | import { getColour } from "../helpers/colour"; | ||||||
| import "@blockly/block-plus-minus"; | import "@blockly/block-plus-minus"; | ||||||
| import { TypedVariableModal } from "@blockly/plugin-typed-variable-modal"; | import { TypedVariableModal } from "@blockly/plugin-typed-variable-modal"; | ||||||
| @ -16,6 +16,7 @@ class Toolbox extends React.Component { | |||||||
|       this.props.workspace, |       this.props.workspace, | ||||||
|       "callbackName", |       "callbackName", | ||||||
|       [ |       [ | ||||||
|  |         [`${Blockly.Msg.variable_SHORT_NUMBER}`, "char"], | ||||||
|         [`${Blockly.Msg.variable_NUMBER}`, "int"], |         [`${Blockly.Msg.variable_NUMBER}`, "int"], | ||||||
|         [`${Blockly.Msg.variable_LONG}`, "long"], |         [`${Blockly.Msg.variable_LONG}`, "long"], | ||||||
|         [`${Blockly.Msg.variable_DECIMAL}`, "float"], |         [`${Blockly.Msg.variable_DECIMAL}`, "float"], | ||||||
| @ -32,7 +33,7 @@ class Toolbox extends React.Component { | |||||||
| 
 | 
 | ||||||
|     // Add your button and give it a callback name.
 |     // Add your button and give it a callback name.
 | ||||||
|     const button = document.createElement("button"); |     const button = document.createElement("button"); | ||||||
|     button.setAttribute("text", Blockly.Msg.button_createVariable); |     button.setAttribute("text", "Create Typed Variable"); | ||||||
|     button.setAttribute("callbackKey", "callbackName"); |     button.setAttribute("callbackKey", "callbackName"); | ||||||
| 
 | 
 | ||||||
|     xmlList.push(button); |     xmlList.push(button); | ||||||
| @ -40,7 +41,6 @@ class Toolbox extends React.Component { | |||||||
|     // This gets all the variables that the user creates and adds them to the
 |     // This gets all the variables that the user creates and adds them to the
 | ||||||
|     // flyout.
 |     // flyout.
 | ||||||
|     const blockList = Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace); |     const blockList = Blockly.VariablesDynamic.flyoutCategoryBlocks(workspace); | ||||||
|     console.log(blockList); |  | ||||||
|     xmlList = xmlList.concat(blockList); |     xmlList = xmlList.concat(blockList); | ||||||
|     return xmlList; |     return xmlList; | ||||||
|   } |   } | ||||||
| @ -61,7 +61,6 @@ class Toolbox extends React.Component { | |||||||
|           <Block type="sensebox_sensor_uv_light" /> |           <Block type="sensebox_sensor_uv_light" /> | ||||||
|           <Block type="sensebox_sensor_bmx055_accelerometer" /> |           <Block type="sensebox_sensor_bmx055_accelerometer" /> | ||||||
|           <Block type="sensebox_sensor_sds011" /> |           <Block type="sensebox_sensor_sds011" /> | ||||||
|           <Block type="sensebox_sensor_sps30" /> |  | ||||||
|           <Block type="sensebox_sensor_pressure" /> |           <Block type="sensebox_sensor_pressure" /> | ||||||
|           <Block type="sensebox_sensor_dps310" /> |           <Block type="sensebox_sensor_dps310" /> | ||||||
|           <Block type="sensebox_sensor_bme680_bsec" /> |           <Block type="sensebox_sensor_bme680_bsec" /> | ||||||
| @ -503,63 +502,42 @@ class Toolbox extends React.Component { | |||||||
|           <Block type="time_micros"></Block> |           <Block type="time_micros"></Block> | ||||||
|           <Block type="infinite_loop"></Block> |           <Block type="infinite_loop"></Block> | ||||||
|           <Block type="sensebox_interval_timer"></Block> |           <Block type="sensebox_interval_timer"></Block> | ||||||
|           <Category |           <Block type="sensebox_rtc_init"></Block> | ||||||
|             id="time" |           <Block type="sensebox_rtc_set"> | ||||||
|             name={Blockly.Msg.toolbox_rtc} |             <Value name="second"> | ||||||
|             colour={getColour().time} |               <Block type="math_number"> | ||||||
|           > |                 <Field name="NUM">00</Field> | ||||||
|             <Label text={Blockly.Msg.toolbox_label_externalRTC}></Label> |               </Block> | ||||||
|             <Block type="sensebox_rtc_init"></Block> |             </Value> | ||||||
|             <Block type="sensebox_rtc_set"> |             <Value name="minutes"> | ||||||
|               <Value name="second"> |               <Block type="math_number"> | ||||||
|                 <Block type="math_number"> |                 <Field name="NUM">00</Field> | ||||||
|                   <Field name="NUM">00</Field> |               </Block> | ||||||
|                 </Block> |             </Value> | ||||||
|               </Value> |             <Value name="hour"> | ||||||
|               <Value name="minutes"> |               <Block type="math_number"> | ||||||
|                 <Block type="math_number"> |                 <Field name="NUM">00</Field> | ||||||
|                   <Field name="NUM">00</Field> |               </Block> | ||||||
|                 </Block> |             </Value> | ||||||
|               </Value> |             <Value name="day"> | ||||||
|               <Value name="hour"> |               <Block type="math_number"> | ||||||
|                 <Block type="math_number"> |                 <Field name="NUM">01</Field> | ||||||
|                   <Field name="NUM">00</Field> |               </Block> | ||||||
|                 </Block> |             </Value> | ||||||
|               </Value> |             <Value name="month"> | ||||||
|               <Value name="day"> |               <Block type="math_number"> | ||||||
|                 <Block type="math_number"> |                 <Field name="NUM">01</Field> | ||||||
|                   <Field name="NUM">01</Field> |               </Block> | ||||||
|                 </Block> |             </Value> | ||||||
|               </Value> |             <Value name="year"> | ||||||
|               <Value name="month"> |               <Block type="math_number"> | ||||||
|                 <Block type="math_number"> |                 <Field name="NUM">1970</Field> | ||||||
|                   <Field name="NUM">01</Field> |               </Block> | ||||||
|                 </Block> |             </Value> | ||||||
|               </Value> |           </Block> | ||||||
|               <Value name="year"> |           {/* <Block type="sensebox_rtc_set_ntp"></Block> */} | ||||||
|                 <Block type="math_number"> |           <Block type="sensebox_rtc_get"></Block> | ||||||
|                   <Field name="NUM">1970</Field> |           <Block type="sensebox_rtc_get_timestamp"></Block> | ||||||
|                 </Block> |  | ||||||
|               </Value> |  | ||||||
|             </Block> |  | ||||||
|             {/* <Block type="sensebox_rtc_set_ntp"></Block> */} |  | ||||||
|             <Block type="sensebox_rtc_get"></Block> |  | ||||||
|             <Block type="sensebox_rtc_get_timestamp"></Block> |  | ||||||
|             <Sep gap="40"></Sep> |  | ||||||
|             <Label text={Blockly.Msg.toolbox_label_internalRTC}></Label> |  | ||||||
|             <Block type="sensebox_internal_rtc_init"></Block> |  | ||||||
|             <Block type="sensebox_internal_rtc_set"></Block> |  | ||||||
|             <Block type="sensebox_internal_rtc_get"></Block> |  | ||||||
|             <Block type="sensebox_internal_rtc_get_timestamp"></Block> |  | ||||||
|           </Category> |  | ||||||
|           <Category |  | ||||||
|             id="timeUTP" |  | ||||||
|             name={Blockly.Msg.toolbox_ntp} |  | ||||||
|             colour={getColour().time} |  | ||||||
|           > |  | ||||||
|             <Block type="sensebox_ntp_init"></Block> |  | ||||||
|             <Block type="sensebox_ntp_get"></Block> |  | ||||||
|           </Category> |  | ||||||
|         </Category> |         </Category> | ||||||
|         <Category |         <Category | ||||||
|           id="math" |           id="math" | ||||||
| @ -633,11 +611,7 @@ class Toolbox extends React.Component { | |||||||
|           colour={getColour().procedures} |           colour={getColour().procedures} | ||||||
|           custom="PROCEDURE" |           custom="PROCEDURE" | ||||||
|         ></Category> |         ></Category> | ||||||
|         <Category name="CleVerLab" colour={getColour().cleverlab}> |         <sep></sep> | ||||||
|            <Block type="CleVerLab_pH" /> |  | ||||||
|            <Block type="CleVerLab_pump" /> |  | ||||||
|            <Block type="CleVerLab_cali1" /> |  | ||||||
|         </Category> |  | ||||||
|         <Category name={Blockly.Msg.toolbox_advanced} colour={getColour().io}> |         <Category name={Blockly.Msg.toolbox_advanced} colour={getColour().io}> | ||||||
|           <Category |           <Category | ||||||
|             name={Blockly.Msg.toolbox_serial} |             name={Blockly.Msg.toolbox_serial} | ||||||
| @ -669,19 +643,16 @@ class Toolbox extends React.Component { | |||||||
|               </Value> |               </Value> | ||||||
|             </Block> |             </Block> | ||||||
|           </Category> |           </Category> | ||||||
|           <Category |           <Category name={Blockly.Msg.toolbox_motors} colour={getColour().motors}> | ||||||
|             name={Blockly.Msg.toolbox_motors} |           <Block type="sensebox_motors_beginServoMotor" /> | ||||||
|             colour={getColour().motors} |           <Block type="sensebox_motors_moveServoMotor"> | ||||||
|           > |             <Value name="degrees"> | ||||||
|             <Block type="sensebox_motors_beginServoMotor" /> |               <Block type="math_number"> | ||||||
|             <Block type="sensebox_motors_moveServoMotor"> |                 <Field name="NUM">90</Field> | ||||||
|               <Value name="degrees"> |               </Block> | ||||||
|                 <Block type="math_number"> |             </Value> | ||||||
|                   <Field name="NUM">90</Field> |           </Block> | ||||||
|                 </Block> |           {/* <Block type="sensebox_motors_I2CMotorBoard_begin" /> | ||||||
|               </Value> |  | ||||||
|             </Block> |  | ||||||
|             {/* <Block type="sensebox_motors_I2CMotorBoard_begin" /> |  | ||||||
|           <Block type="sensebox_motors_I2CMotorBoard_moveDCMotor"> |           <Block type="sensebox_motors_I2CMotorBoard_moveDCMotor"> | ||||||
|             <Value name="speed"> |             <Value name="speed"> | ||||||
|               <Block type="math_number"> |               <Block type="math_number"> | ||||||
| @ -698,7 +669,7 @@ class Toolbox extends React.Component { | |||||||
|               </Block> |               </Block> | ||||||
|             </Value> |             </Value> | ||||||
|           </Block> */} |           </Block> */} | ||||||
|           </Category> |         </Category> | ||||||
|           <Category name="Watchdog" colour={getColour().io}> |           <Category name="Watchdog" colour={getColour().io}> | ||||||
|             <Block type="watchdog_enable"></Block> |             <Block type="watchdog_enable"></Block> | ||||||
|             <Block type="watchdog_reset"></Block> |             <Block type="watchdog_reset"></Block> | ||||||
|  | |||||||
| @ -3,9 +3,9 @@ import React, { Component } from 'react'; | |||||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||||
| import clsx from 'clsx'; | import clsx from 'clsx'; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from '@material-ui/core/styles'; | ||||||
| import MaterialUIBreadcrumbs from '@mui/material/Breadcrumbs'; | import MaterialUIBreadcrumbs from '@material-ui/core/Breadcrumbs'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| 
 | 
 | ||||||
| import { faHome } from "@fortawesome/free-solid-svg-icons"; | import { faHome } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| @ -30,7 +30,7 @@ class Breadcrumbs extends Component { | |||||||
|       this.props.content && this.props.content.length > 0 ? |       this.props.content && this.props.content.length > 0 ? | ||||||
|         <MaterialUIBreadcrumbs separator="›" style={{marginBottom: '20px'}}> |         <MaterialUIBreadcrumbs separator="›" style={{marginBottom: '20px'}}> | ||||||
|           <Link to={'/'} style={{textDecoration: 'none'}}> |           <Link to={'/'} style={{textDecoration: 'none'}}> | ||||||
|             <FontAwesomeIcon className={clsx(this.props.classes.home, this.props.classes.hover)} icon={faHome}  size="xs"/> |             <FontAwesomeIcon className={clsx(this.props.classes.home, this.props.classes.hover)} icon={faHome} size="xs"/> | ||||||
|           </Link> |           </Link> | ||||||
|           {this.props.content.splice(0, this.props.content.length-1).map((content, i) => ( |           {this.props.content.splice(0, this.props.content.length-1).map((content, i) => ( | ||||||
|             <Link to={content.link} style={{textDecoration: 'none'}} key={i}> |             <Link to={content.link} style={{textDecoration: 'none'}} key={i}> | ||||||
|  | |||||||
| @ -2,16 +2,15 @@ import React from "react"; | |||||||
| import { useState, useRef } from "react"; | import { useState, useRef } from "react"; | ||||||
| import { default as MonacoEditor } from "@monaco-editor/react"; | import { default as MonacoEditor } from "@monaco-editor/react"; | ||||||
| import { withRouter } from "react-router-dom"; | import { withRouter } from "react-router-dom"; | ||||||
| import { Button, Grid } from "@mui/material"; | import { Button, Grid } from "@material-ui/core"; | ||||||
| import Blockly from "blockly/core"; | import Blockly from "blockly/core"; | ||||||
| import Divider from "@mui/material/Divider"; | import Divider from "@material-ui/core/Divider"; | ||||||
| import { saveAs } from "file-saver"; | import { saveAs } from "file-saver"; | ||||||
| import Drawer from "@mui/material/Drawer"; | import Drawer from "@material-ui/core/Drawer"; | ||||||
| import Sidebar from "./Sidebar"; | import Sidebar from "./Sidebar"; | ||||||
| import Dialog from "../Dialog"; | import Dialog from "../Dialog"; | ||||||
| import SaveIcon from "./SaveIcon"; | import SaveIcon from "./SaveIcon"; | ||||||
| import store from "../../store"; | import store from "../../store"; | ||||||
| import DeviceSelection from "../DeviceSelection"; |  | ||||||
| 
 | 
 | ||||||
| const CodeEditor = (props) => { | const CodeEditor = (props) => { | ||||||
|   //const [filehandle, setFileHandle] = useState();
 |   //const [filehandle, setFileHandle] = useState();
 | ||||||
| @ -193,7 +192,6 @@ void loop() { | |||||||
|             }} |             }} | ||||||
|           /> |           /> | ||||||
|         </Grid> |         </Grid> | ||||||
|         <DeviceSelection /> |  | ||||||
|         <Grid item lg={4} md={4}> |         <Grid item lg={4} md={4}> | ||||||
|           <Button |           <Button | ||||||
|             style={{ padding: "1rem", margin: "1rem" }} |             style={{ padding: "1rem", margin: "1rem" }} | ||||||
|  | |||||||
| @ -5,19 +5,19 @@ import { workspaceName } from "../../actions/workspaceActions"; | |||||||
| 
 | 
 | ||||||
| import { detectWhitespacesAndReturnReadableResult } from "../../helpers/whitespace"; | import { detectWhitespacesAndReturnReadableResult } from "../../helpers/whitespace"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| import Backdrop from "@mui/material/Backdrop"; | import Backdrop from "@material-ui/core/Backdrop"; | ||||||
| import CircularProgress from "@mui/material/CircularProgress"; | import CircularProgress from "@material-ui/core/CircularProgress"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import Divider from "@mui/material/Divider"; | import Divider from "@material-ui/core/Divider"; | ||||||
| import { faClipboardCheck } from "@fortawesome/free-solid-svg-icons"; | import { faClipboardCheck } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import * as Blockly from "blockly/core"; | import * as Blockly from "blockly/core"; | ||||||
| import Copy from "../copy.svg"; | import Copy from "../copy.svg"; | ||||||
| 
 | 
 | ||||||
| import MuiDrawer from "@mui/material/Drawer"; | import MuiDrawer from "@material-ui/core/Drawer"; | ||||||
| import Dialog from "../Dialog"; | import Dialog from "../Dialog"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
| @ -188,8 +188,8 @@ class Compile extends Component { | |||||||
|             <IconButton |             <IconButton | ||||||
|               className={`compileBlocks ${this.props.classes.iconButton}`} |               className={`compileBlocks ${this.props.classes.iconButton}`} | ||||||
|               onClick={() => this.compile()} |               onClick={() => this.compile()} | ||||||
|               size="large"> |             > | ||||||
|               <FontAwesomeIcon icon={faClipboardCheck} size="xs"  /> |               <FontAwesomeIcon icon={faClipboardCheck} size="xs" /> | ||||||
|             </IconButton> |             </IconButton> | ||||||
|           </Tooltip> |           </Tooltip> | ||||||
|         ) : ( |         ) : ( | ||||||
| @ -201,7 +201,6 @@ class Compile extends Component { | |||||||
|           > |           > | ||||||
|             <FontAwesomeIcon |             <FontAwesomeIcon | ||||||
|               icon={faClipboardCheck} |               icon={faClipboardCheck} | ||||||
|                |  | ||||||
|               style={{ marginRight: "5px" }} |               style={{ marginRight: "5px" }} | ||||||
|             />{" "} |             />{" "} | ||||||
|             Kompilieren |             Kompilieren | ||||||
| @ -302,7 +301,6 @@ class Compile extends Component { | |||||||
|               > |               > | ||||||
|                 <FontAwesomeIcon |                 <FontAwesomeIcon | ||||||
|                   icon={faClipboardCheck} |                   icon={faClipboardCheck} | ||||||
|                    |  | ||||||
|                   style={{ marginRight: "5px" }} |                   style={{ marginRight: "5px" }} | ||||||
|                 />{" "} |                 />{" "} | ||||||
|                 Starte Übertragung |                 Starte Übertragung | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import { faCircleNotch, faSave } from "@fortawesome/free-solid-svg-icons"; | import { faCircleNotch, faSave } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import React from "react"; | import React from "react"; | ||||||
| 
 | 
 | ||||||
| const SaveIcon = ({ loading }) => ( | const SaveIcon = ({ loading }) => ( | ||||||
| @ -17,7 +17,6 @@ const SaveIcon = ({ loading }) => ( | |||||||
|         <FontAwesomeIcon |         <FontAwesomeIcon | ||||||
|           style={{ position: "absolute" }} |           style={{ position: "absolute" }} | ||||||
|           icon={faCircleNotch} |           icon={faCircleNotch} | ||||||
|            |  | ||||||
|           spin={true} |           spin={true} | ||||||
|           size="2x" |           size="2x" | ||||||
|           color="grey" |           color="grey" | ||||||
| @ -31,7 +30,6 @@ const SaveIcon = ({ loading }) => ( | |||||||
|           transform: "translate(-50%,-50%)", |           transform: "translate(-50%,-50%)", | ||||||
|         }} |         }} | ||||||
|         icon={faSave} |         icon={faSave} | ||||||
|          |  | ||||||
|         color={loading ? "grey" : "green"} |         color={loading ? "grey" : "green"} | ||||||
|         size={loading ? "1x" : "lg"} |         size={loading ? "1x" : "lg"} | ||||||
|       /> |       /> | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| import { useState } from "react"; | import { useState } from "react"; | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| 
 | 
 | ||||||
| const SerialMonitor = () => { | const SerialMonitor = () => { | ||||||
|   const [serialPortContent, setSerialPortContent] = useState([]); |   const [serialPortContent, setSerialPortContent] = useState([]); | ||||||
|  | |||||||
| @ -1,13 +1,13 @@ | |||||||
| import React from "react"; | import React from "react"; | ||||||
| import Blockly from "blockly"; | import Blockly from "blockly"; | ||||||
| import { useSelector } from "react-redux"; | import { useSelector } from "react-redux"; | ||||||
| import Accordion from "@mui/material/Accordion"; | import Accordion from "@material-ui/core/Accordion"; | ||||||
| import AccordionSummary from "@mui/material/AccordionSummary"; | import AccordionSummary from "@material-ui/core/AccordionSummary"; | ||||||
| import AccordionDetails from "@mui/material/AccordionDetails"; | import AccordionDetails from "@material-ui/core/AccordionDetails"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import { LibraryVersions } from "../../data/versions.js"; | import { LibraryVersions } from "../../data/versions.js"; | ||||||
| import { useMonaco } from "@monaco-editor/react"; | import { useMonaco } from "@monaco-editor/react"; | ||||||
| import { Button } from "@mui/material"; | import { Button } from "@material-ui/core"; | ||||||
| import SerialMonitor from "./SerialMonitor.js"; | import SerialMonitor from "./SerialMonitor.js"; | ||||||
| import axios from "axios"; | import axios from "axios"; | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2,17 +2,15 @@ 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 withStyles from '@mui/styles/withStyles'; | import withWidth from "@material-ui/core/withWidth"; | ||||||
| import MuiAccordion from "@mui/material/Accordion"; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import MuiAccordionSummary from "@mui/material/AccordionSummary"; | import MuiAccordion from "@material-ui/core/Accordion"; | ||||||
| import MuiAccordionDetails from "@mui/material/AccordionDetails"; | import MuiAccordionSummary from "@material-ui/core/AccordionSummary"; | ||||||
| import { Card } from "@mui/material"; | import MuiAccordionDetails from "@material-ui/core/AccordionDetails"; | ||||||
|  | import { Card } from "@material-ui/core"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import { default as MonacoEditor } from "@monaco-editor/react"; | import { default as MonacoEditor } from "@monaco-editor/react"; | ||||||
| 
 | 
 | ||||||
| // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
 |  | ||||||
| const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />; |  | ||||||
| 
 |  | ||||||
| const Accordion = withStyles((theme) => ({ | const Accordion = withStyles((theme) => ({ | ||||||
|   root: { |   root: { | ||||||
|     border: `1px solid ${theme.palette.secondary.main}`, |     border: `1px solid ${theme.palette.secondary.main}`, | ||||||
|  | |||||||
| @ -3,10 +3,12 @@ import PropTypes from "prop-types"; | |||||||
| import { connect } from "react-redux"; | import { connect } from "react-redux"; | ||||||
| import Dialog from "./Dialog"; | import Dialog from "./Dialog"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import { IconButton, Grid, Avatar, Typography } from "@mui/material"; | import { IconButton, Grid, Avatar, Typography } from "@material-ui/core"; | ||||||
| import { setBoard } from "../actions/boardAction"; | import { setBoard } from "../actions/boardAction"; | ||||||
|  | import mini_opacity from "../data/mini_opacity.png" | ||||||
|  | import mcu_opacity from "../data/mcu_opacity.png" | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   link: { |   link: { | ||||||
| @ -27,29 +29,30 @@ class DeviceSeclection extends Component { | |||||||
|   constructor(props) { |   constructor(props) { | ||||||
|     super(props); |     super(props); | ||||||
|     this.state = { |     this.state = { | ||||||
|       open: props.selectedBoard ? false : true, |       open: this.props.selectedBoard !== "" ? false : true, | ||||||
|       selectedBoard: "", |       selectedBoard : this.props.selectedBoard, | ||||||
|       saveSettings: false, |       saveSettings: false, | ||||||
| 
 | 
 | ||||||
|     }; |     }; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   toggleDialog = () => { |   toggleDialog = () => { | ||||||
|  |      | ||||||
|     this.props.setBoard(this.state.selectedBoard) |     this.props.setBoard(this.state.selectedBoard) | ||||||
|  | 
 | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   onChange = (e) => { |  | ||||||
|     if (e.target.checked) { |  | ||||||
|       this.setState({ saveSettings: true }); |  | ||||||
|     } else { |  | ||||||
|       this.setState({ saveSettings: false }); |  | ||||||
|     } |  | ||||||
|   }; |  | ||||||
| 
 | 
 | ||||||
|   onclick = (e, value) => { |   onclick = (e, value) => { | ||||||
|     this.setState({ selectedBoard: value }) |     console.log(e, value) | ||||||
|  |     const root = document.querySelector(':root'); | ||||||
|  |     root.style.setProperty('--url', `url(${value === "mcu" ? mcu_opacity : mini_opacity })`); | ||||||
|  |     this.setState({selectedBoard: value}) | ||||||
|     this.props.setBoard(value) |     this.props.setBoard(value) | ||||||
|     this.setState({ open: !this.state }); |     this.setState({ open: !this.state }); | ||||||
|  |     | ||||||
|  | 
 | ||||||
|  |     | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
| @ -62,24 +65,25 @@ class DeviceSeclection extends Component { | |||||||
|         title={Blockly.Msg.deviceselection_head} |         title={Blockly.Msg.deviceselection_head} | ||||||
|         content={""} |         content={""} | ||||||
|         onClick={this.toggleDialog} |         onClick={this.toggleDialog} | ||||||
|         disabled={this.state.selectedBoard === ""} |         disabled={this.state.selectedBoard===""} | ||||||
|       > |       > | ||||||
|         <div> |         <div> | ||||||
|           <Grid container spacing={2} style={{ textAlign: "center" }}> |           <Grid container spacing={2} style={{  textAlign : "center" }}> | ||||||
|             <Grid item xs={6}> |             <Grid item xs={6}> | ||||||
|               <IconButton onClick={(e) => this.onclick(e, "mcu")} size="large"> |             <IconButton onClick={(e) => this.onclick(e, "mcu")}> | ||||||
|                 <Avatar |               <Avatar | ||||||
|                   alt="Sensebox MCU" |                 alt="Sensebox MCU" | ||||||
|                   src="/media/hardware/senseboxmcu.png" |                 src="/media/hardware/senseboxmcu.png" | ||||||
|                   style={{ |                 style={{ | ||||||
|                     border: this.state.selectedBoard === "mcu" ? 'medium solid DeepSkyBlue' : "0.1px solid lightgray", |                   border: this.state.selectedBoard === "mcu" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray", | ||||||
|                     width: "20vw", |                   width:"20vw", | ||||||
|                     height: "20vw" |                   height: "20vw" | ||||||
|                   }} |                }} | ||||||
|                 /> |               /> | ||||||
|               </IconButton> |               </IconButton> | ||||||
|               <p>senseBox MCU</p> |               <p>senseBox MCU</p> | ||||||
|             </Grid> |             </Grid> | ||||||
|  | 
 | ||||||
|             {/* <Grid item xs={4}> |             {/* <Grid item xs={4}> | ||||||
|             <IconButton onClick={(e) => this.onclick(e, "esp")}> |             <IconButton onClick={(e) => this.onclick(e, "esp")}> | ||||||
|               <Avatar |               <Avatar | ||||||
| @ -89,22 +93,22 @@ class DeviceSeclection extends Component { | |||||||
|                   border: this.state.selectedBoard == "esp" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray", |                   border: this.state.selectedBoard == "esp" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray", | ||||||
|                   width:"20vw", |                   width:"20vw", | ||||||
|                   height: "20vw" |                   height: "20vw" | ||||||
|               }} |                }} | ||||||
|               /> |               /> | ||||||
|               </IconButton> |               </IconButton> | ||||||
|               <p>Sensebox ESP</p> |               <p>Sensebox ESP</p> | ||||||
|             </Grid> */} |             </Grid> */} | ||||||
|             <Grid item xs={6}> |             <Grid item xs={6}> | ||||||
|               <IconButton onClick={(e) => this.onclick(e, "mini")} size="large"> |               <IconButton onClick={(e) => this.onclick(e, "mini")}> | ||||||
|                 <Avatar |               <Avatar | ||||||
|                   alt="Sensebox Mini" |                 alt="Sensebox Mini" | ||||||
|                   src="/media/hardware/senseboxmcumini.png" |                 src="/media/hardware/senseboxmcumini.png" | ||||||
|                   style={{ |                  style={{ | ||||||
|                     border: this.state.selectedBoard === "mini" ? 'medium solid DeepSkyBlue' : "0.1px solid lightgray", |                   border: this.state.selectedBoard === "mini" ? 'medium solid DeepSkyBlue': "0.1px solid lightgray", | ||||||
|                     width: "20vw", |                   width:"20vw", | ||||||
|                     height: "20vw" |                   height: "20vw" | ||||||
|                   }} |                }} | ||||||
|                 /> |               /> | ||||||
|               </IconButton> |               </IconButton> | ||||||
|               <p>senseBox MCU:mini</p> |               <p>senseBox MCU:mini</p> | ||||||
|             </Grid> |             </Grid> | ||||||
| @ -129,5 +133,5 @@ const mapStateToProps = (state) => ({ | |||||||
| 
 | 
 | ||||||
| export default connect( | export default connect( | ||||||
|   mapStateToProps, |   mapStateToProps, | ||||||
|   { setBoard } |   {setBoard} | ||||||
| )(withStyles(styles, { withTheme: true })(DeviceSeclection)); | )(withStyles(styles, { withTheme: true })(DeviceSeclection)); | ||||||
|  | |||||||
| @ -1,10 +1,10 @@ | |||||||
| import React, { Component } from 'react'; | import React, { Component } from 'react'; | ||||||
| 
 | 
 | ||||||
| import Button from '@mui/material/Button'; | import Button from '@material-ui/core/Button'; | ||||||
| import DialogTitle from '@mui/material/DialogTitle'; | import DialogTitle from '@material-ui/core/DialogTitle'; | ||||||
| import DialogContent from '@mui/material/DialogContent'; | import DialogContent from '@material-ui/core/DialogContent'; | ||||||
| import DialogActions from '@mui/material/DialogActions'; | import DialogActions from '@material-ui/core/DialogActions'; | ||||||
| import MaterialUIDialog from '@mui/material/Dialog'; | import MaterialUIDialog from '@material-ui/core/Dialog'; | ||||||
| 
 | 
 | ||||||
| class Dialog extends Component { | class Dialog extends Component { | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -4,15 +4,14 @@ import Breadcrumbs from "./Breadcrumbs"; | |||||||
| 
 | 
 | ||||||
| import { withRouter } from "react-router-dom"; | import { withRouter } from "react-router-dom"; | ||||||
| 
 | 
 | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import ReactMarkdown from "react-markdown"; | import ReactMarkdown from "react-markdown"; | ||||||
| import rehypeRaw from "rehype-raw"; | import Container from "@material-ui/core/Container"; | ||||||
| import Container from "@mui/material/Container"; | import ExpansionPanel from "@material-ui/core/ExpansionPanel"; | ||||||
| import Accordion from "@mui/material/Accordion"; | import ExpansionPanelSummary from "@material-ui/core/ExpansionPanelSummary"; | ||||||
| import AccordionSummary from "@mui/material/AccordionSummary"; | import ExpansionPanelDetails from "@material-ui/core/ExpansionPanelDetails"; | ||||||
| import AccordionDetails from "@mui/material/AccordionDetails"; |  | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import { faChevronDown } from "@fortawesome/free-solid-svg-icons"; | import { faChevronDown } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FaqQuestions } from "../data/faq"; | import { FaqQuestions } from "../data/faq"; | ||||||
| @ -47,26 +46,25 @@ class Faq extends Component { | |||||||
|             <h1>FAQ</h1> |             <h1>FAQ</h1> | ||||||
|             {FaqQuestions().map((object, i) => { |             {FaqQuestions().map((object, i) => { | ||||||
|               return ( |               return ( | ||||||
|                 <Accordion |                 <ExpansionPanel | ||||||
|                   expanded={panel === `panel${i}`} |                   expanded={panel === `panel${i}`} | ||||||
|                   onChange={() => this.handleChange(`panel${i}`)} |                   onChange={() => this.handleChange(`panel${i}`)} | ||||||
|                 > |                 > | ||||||
|                   <AccordionSummary |                   <ExpansionPanelSummary | ||||||
|                     expandIcon={<FontAwesomeIcon icon={faChevronDown} />} |                     expandIcon={<FontAwesomeIcon icon={faChevronDown} />} | ||||||
|                   > |                   > | ||||||
|                     <Typography variant="h6">{object.question}</Typography> |                     <Typography variant="h6">{object.question}</Typography> | ||||||
|                   </AccordionSummary> |                   </ExpansionPanelSummary> | ||||||
|                   <AccordionDetails> |                   <ExpansionPanelDetails> | ||||||
|                     <Typography> |                     <Typography> | ||||||
|                       <ReactMarkdown |                       <ReactMarkdown | ||||||
|                         className="news" |                         className="news" | ||||||
|                         allowDangerousHtml="true" |                         allowDangerousHtml="true" | ||||||
|                         children={object.answer} |                         children={object.answer} | ||||||
|                         rehypePlugins={[rehypeRaw]} |  | ||||||
|                       ></ReactMarkdown> |                       ></ReactMarkdown> | ||||||
|                     </Typography> |                     </Typography> | ||||||
|                   </AccordionDetails> |                   </ExpansionPanelDetails> | ||||||
|                 </Accordion> |                 </ExpansionPanel> | ||||||
|               ); |               ); | ||||||
|             })} |             })} | ||||||
|             {this.props.button ? ( |             {this.props.button ? ( | ||||||
|  | |||||||
| @ -2,7 +2,7 @@ import React, { Component } from 'react'; | |||||||
| 
 | 
 | ||||||
| import { Link } from 'react-router-dom'; | import { Link } from 'react-router-dom'; | ||||||
| 
 | 
 | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| 
 | 
 | ||||||
| class Footer extends Component { | class Footer extends Component { | ||||||
|   render() { |   render() { | ||||||
|  | |||||||
| @ -14,10 +14,10 @@ import TrashcanButtons from "./Workspace/TrashcanButtons"; | |||||||
| // import HintTutorialExists from "./Tutorial/HintTutorialExists";
 | // import HintTutorialExists from "./Tutorial/HintTutorialExists";
 | ||||||
| import DeviceSelection from "./DeviceSelection"; | import DeviceSelection from "./DeviceSelection"; | ||||||
| 
 | 
 | ||||||
| import Grid from "@mui/material/Grid"; | import Grid from "@material-ui/core/Grid"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| 
 | 
 | ||||||
| import { faCode } from "@fortawesome/free-solid-svg-icons"; | import { faCode } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| @ -160,8 +160,8 @@ class Home extends Component { | |||||||
|                   zIndex: 21, |                   zIndex: 21, | ||||||
|                 }} |                 }} | ||||||
|                 onClick={() => this.onChange()} |                 onClick={() => this.onChange()} | ||||||
|                 size="large"> |               > | ||||||
|                 <FontAwesomeIcon icon={faCode}  size="xs" /> |                 <FontAwesomeIcon icon={faCode} size="xs" /> | ||||||
|               </IconButton> |               </IconButton> | ||||||
|             </Tooltip> |             </Tooltip> | ||||||
| 
 | 
 | ||||||
| @ -187,6 +187,7 @@ class Home extends Component { | |||||||
|             </Grid> |             </Grid> | ||||||
|           ) : null} |           ) : null} | ||||||
|         </Grid> |         </Grid> | ||||||
|  |          | ||||||
|         <DeviceSelection /> |         <DeviceSelection /> | ||||||
|         {/* <HintTutorialExists /> */} |         {/* <HintTutorialExists /> */} | ||||||
|         {this.props.platform ? ( |         {this.props.platform ? ( | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| import React, { Component } from "react"; | import React, { Component } from "react"; | ||||||
| import { withRouter } from "react-router-dom"; | import { withRouter } from "react-router-dom"; | ||||||
| import Container from "@mui/material/Container"; | import Container from "@material-ui/core/Container"; | ||||||
| class Impressum extends Component { | class Impressum extends Component { | ||||||
|   render() { |   render() { | ||||||
|     return ( |     return ( | ||||||
|  | |||||||
| @ -5,8 +5,8 @@ import { workspaceChange } from '../actions/workspaceActions'; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from 'blockly/core'; | import * as Blockly from 'blockly/core'; | ||||||
| 
 | 
 | ||||||
| import TextField from '@mui/material/TextField'; | import TextField from '@material-ui/core/TextField'; | ||||||
| import Button from '@mui/material/Button'; | import Button from '@material-ui/core/Button'; | ||||||
| 
 | 
 | ||||||
| class MaxBlocks extends Component { | class MaxBlocks extends Component { | ||||||
| 
 | 
 | ||||||
| @ -28,12 +28,12 @@ class MaxBlocks extends Component { | |||||||
|     return ( |     return ( | ||||||
|       <div style={{display: 'inline', marginLeft: '10px'}}> |       <div style={{display: 'inline', marginLeft: '10px'}}> | ||||||
|         <TextField |         <TextField | ||||||
|           variant="standard" |  | ||||||
|           style={{width: '50px', marginRight: '5px'}} |           style={{width: '50px', marginRight: '5px'}} | ||||||
|           name="max" |           name="max" | ||||||
|           type="number" |           type="number" | ||||||
|           onChange={this.onChange} |           onChange={this.onChange} | ||||||
|           value={this.state.max} /> |           value={this.state.max} | ||||||
|  |         /> | ||||||
|         <Button style={{marginRight: '10px', color: 'white'}} variant="contained" color="primary" onClick={this.setMaxBlocks}> |         <Button style={{marginRight: '10px', color: 'white'}} variant="contained" color="primary" onClick={this.setMaxBlocks}> | ||||||
|           Maximale Blöcke |           Maximale Blöcke | ||||||
|         </Button> |         </Button> | ||||||
|  | |||||||
| @ -8,20 +8,20 @@ import senseboxLogo from "./sensebox_logo.svg"; | |||||||
| 
 | 
 | ||||||
| import { withRouter } from "react-router-dom"; | import { withRouter } from "react-router-dom"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Drawer from "@mui/material/Drawer"; | import Drawer from "@material-ui/core/Drawer"; | ||||||
| import AppBar from "@mui/material/AppBar"; | import AppBar from "@material-ui/core/AppBar"; | ||||||
| import Toolbar from "@mui/material/Toolbar"; | import Toolbar from "@material-ui/core/Toolbar"; | ||||||
| import List from "@mui/material/List"; | import List from "@material-ui/core/List"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import Divider from "@mui/material/Divider"; | import Divider from "@material-ui/core/Divider"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import ListItem from "@mui/material/ListItem"; | import ListItem from "@material-ui/core/ListItem"; | ||||||
| import ListItemIcon from "@mui/material/ListItemIcon"; | import ListItemIcon from "@material-ui/core/ListItemIcon"; | ||||||
| import ListItemText from "@mui/material/ListItemText"; | import ListItemText from "@material-ui/core/ListItemText"; | ||||||
| import LinearProgress from "@mui/material/LinearProgress"; | import LinearProgress from "@material-ui/core/LinearProgress"; | ||||||
| import Tour from "reactour"; | import Tour from "reactour"; | ||||||
| import { Badge } from "@mui/material"; | import { Badge } from "@material-ui/core"; | ||||||
| import { home, assessment } from "./Tour"; | import { home, assessment } from "./Tour"; | ||||||
| import { | import { | ||||||
|   faBars, |   faBars, | ||||||
| @ -37,20 +37,10 @@ import { | |||||||
|   faLightbulb, |   faLightbulb, | ||||||
|   faCode, |   faCode, | ||||||
|   faPuzzlePiece, |   faPuzzlePiece, | ||||||
|   faUser, |  | ||||||
|   faMicrochip, |  | ||||||
|   faEarthEurope, |  | ||||||
|   faEarthAmericas, |  | ||||||
|   faCaretDown |  | ||||||
| } from "@fortawesome/free-solid-svg-icons"; | } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import MenuItem from '@mui/material/MenuItem' |  | ||||||
| import Menu from '@mui/material/Menu' |  | ||||||
| import { setLanguage } from "../actions/generalActions"; |  | ||||||
| import { setBoard } from "../actions/boardAction"; |  | ||||||
| import { Button } from "@mui/material"; |  | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   drawerWidth: { |   drawerWidth: { | ||||||
| @ -70,14 +60,9 @@ const styles = (theme) => ({ | |||||||
| class Navbar extends Component { | class Navbar extends Component { | ||||||
|   constructor(props) { |   constructor(props) { | ||||||
|     super(props); |     super(props); | ||||||
|     this.langRef = React.createRef(); |  | ||||||
|     this.mcuRef = React.createRef(); |  | ||||||
|     this.state = { |     this.state = { | ||||||
|       open: false, |       open: false, | ||||||
|       isTourOpen: false, |       isTourOpen: false, | ||||||
|       anchorElLang: null, |  | ||||||
|       anchorElBoard: null, |  | ||||||
|       anchorElUser: null |  | ||||||
|     }; |     }; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -95,6 +80,7 @@ class Navbar extends Component { | |||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     var isHome = /^\/(\/.*$|$)/g.test(this.props.location.pathname); |     var isHome = /^\/(\/.*$|$)/g.test(this.props.location.pathname); | ||||||
|  |     var isTutorial = /^\/tutorial(\/.*$|$)/g.test(this.props.location.pathname); | ||||||
|     var isAssessment = |     var isAssessment = | ||||||
|       /^\/tutorial\/.{1,}$/g.test(this.props.location.pathname) && |       /^\/tutorial\/.{1,}$/g.test(this.props.location.pathname) && | ||||||
|       !this.props.tutorialIsLoading && |       !this.props.tutorialIsLoading && | ||||||
| @ -130,7 +116,7 @@ class Navbar extends Component { | |||||||
|               onClick={this.toggleDrawer} |               onClick={this.toggleDrawer} | ||||||
|               style={{ margin: "0 10px" }} |               style={{ margin: "0 10px" }} | ||||||
|               className="MenuButton" |               className="MenuButton" | ||||||
|               size="large"> |             > | ||||||
|               <FontAwesomeIcon icon={faBars} /> |               <FontAwesomeIcon icon={faBars} /> | ||||||
|             </IconButton> |             </IconButton> | ||||||
|             <Link to={"/"} style={{ textDecoration: "none", color: "inherit" }}> |             <Link to={"/"} style={{ textDecoration: "none", color: "inherit" }}> | ||||||
| @ -141,226 +127,55 @@ class Navbar extends Component { | |||||||
|             <Link to={"/"} style={{ marginLeft: "10px" }}> |             <Link to={"/"} style={{ marginLeft: "10px" }}> | ||||||
|               <img src={senseboxLogo} alt="senseBox-Logo" width="30" /> |               <img src={senseboxLogo} alt="senseBox-Logo" width="30" /> | ||||||
|             </Link> |             </Link> | ||||||
|             <div style={{ margin: "0 0 0 auto", display: "flex", alignItems: 'center', justifyContent: 'center' }}> |             {isTutorial ? ( | ||||||
|               {isHome ? ( |               <Link | ||||||
|                 <div style={{ display: "flex" }}> |                 to={"/tutorial"} | ||||||
|                   <div style={{ padding: "12px" }}> |                 style={{ | ||||||
|                     <Button |                   textDecoration: "none", | ||||||
|                       style={{ textTransform: 'none', cursor: "pointer", alignItems: "center", alignContent: "center", background: "transparent", color: "inherit", fontWeight: "bold", border: "2px solid white", borderRadius: "25px" }} |                   color: "inherit", | ||||||
|                       ref={this.mcuRef} |                   marginLeft: "10px", | ||||||
|                       onClick={() => { |  | ||||||
|                         this.setState({ anchorElBoard: this.mcuRef.current }) |  | ||||||
|                       }} |  | ||||||
|                       startIcon={<FontAwesomeIcon icon={faMicrochip} />} |  | ||||||
|                       endIcon={<FontAwesomeIcon icon={faCaretDown} />} |  | ||||||
|                       sx={{ display: { xs: "none", sm: "none", md: "flex" } }} |  | ||||||
|                     > |  | ||||||
|                       {this.props.selectedBoard} |  | ||||||
|                     </Button> |  | ||||||
|                     <Menu |  | ||||||
|                       anchorEl={this.state.anchorElBoard} |  | ||||||
|                       anchorOrigin={{ |  | ||||||
|                         vertical: 'bottom', |  | ||||||
|                         horizontal: 'center', |  | ||||||
|                       }} |  | ||||||
|                       keepMounted |  | ||||||
|                       transformOrigin={{ |  | ||||||
|                         vertical: 'top', |  | ||||||
|                         horizontal: 'center', |  | ||||||
|                       }} |  | ||||||
|                       open={Boolean(this.state.anchorElBoard)} |  | ||||||
|                       onClose={() => { |  | ||||||
|                         this.setState({ anchorElBoard: null }); |  | ||||||
|                       }} |  | ||||||
|                     > |  | ||||||
|                       <MenuItem |  | ||||||
|                         value="mcu" |  | ||||||
|                         onClick={(event) => { |  | ||||||
|                           this.props.setBoard(event.currentTarget.getAttribute("value")); |  | ||||||
|                           this.setState({ anchorElBoard: null }); |  | ||||||
|                         }} |  | ||||||
|                       > |  | ||||||
|                         mcu |  | ||||||
|                       </MenuItem> |  | ||||||
|                       <MenuItem |  | ||||||
|                         value="mini" |  | ||||||
|                         onClick={(event) => { |  | ||||||
|                           this.props.setBoard(event.currentTarget.getAttribute("value")); |  | ||||||
|                           this.setState({ anchorElBoard: null }); |  | ||||||
|                         }} |  | ||||||
|                       > |  | ||||||
|                         mini |  | ||||||
|                       </MenuItem> |  | ||||||
|                     </Menu> |  | ||||||
|                   </div> |  | ||||||
|                   <div style={{ padding: "12px" }}> |  | ||||||
|                     { |  | ||||||
|                       this.props.language === "en_US" ? |  | ||||||
|                         ( |  | ||||||
|                           <Button |  | ||||||
|                             style={{ textTransform: 'none', cursor: "pointer", alignItems: "center", alignContent: "center", background: "transparent", color: "inherit", fontWeight: "bold", border: "2px solid white", borderRadius: "25px" }} |  | ||||||
|                             ref={this.langRef} |  | ||||||
|                             onClick={() => { |  | ||||||
|                               this.setState({ anchorElLang: this.langRef.current }) |  | ||||||
|                             }} |  | ||||||
|                             startIcon={<FontAwesomeIcon icon={faEarthAmericas} />} |  | ||||||
|                             endIcon={<FontAwesomeIcon icon={faCaretDown} />} |  | ||||||
|                             sx={{ display: { xs: "none", sm: "none", md: "flex" } }} |  | ||||||
|                           > |  | ||||||
|                             English |  | ||||||
|                           </Button> |  | ||||||
|                         ) : ( |  | ||||||
|                           <Button |  | ||||||
|                             style={{ textTransform: 'none', cursor: "pointer", alignItems: "center", alignContent: "center", background: "transparent", color: "inherit", fontWeight: "bold", border: "2px solid white", borderRadius: "25px" }} |  | ||||||
|                             ref={this.langRef} |  | ||||||
|                             onClick={() => { |  | ||||||
|                               this.setState({ anchorElLang: this.langRef.current }) |  | ||||||
|                             }} |  | ||||||
|                             startIcon={<FontAwesomeIcon icon={faEarthEurope} />} |  | ||||||
|                             endIcon={<FontAwesomeIcon icon={faCaretDown} />} |  | ||||||
|                             sx={{ display: { xs: "none", sm: "none", md: "flex" } }} |  | ||||||
|                           > |  | ||||||
|                             Deutsch |  | ||||||
|                           </Button> |  | ||||||
| 
 |  | ||||||
|                         ) |  | ||||||
|                     } |  | ||||||
|                     <Menu |  | ||||||
|                       anchorEl={this.state.anchorElLang} |  | ||||||
|                       anchorOrigin={{ |  | ||||||
|                         vertical: 'bottom', |  | ||||||
|                         horizontal: 'center', |  | ||||||
|                       }} |  | ||||||
|                       keepMounted |  | ||||||
|                       transformOrigin={{ |  | ||||||
|                         vertical: 'top', |  | ||||||
|                         horizontal: 'center', |  | ||||||
|                       }} |  | ||||||
|                       open={Boolean(this.state.anchorElLang)} |  | ||||||
|                       onClose={() => { |  | ||||||
|                         this.setState({ anchorElLang: null }); |  | ||||||
|                       }} |  | ||||||
|                     > |  | ||||||
|                       <MenuItem |  | ||||||
|                         value="de_DE" |  | ||||||
|                         onClick={(event) => { |  | ||||||
|                           this.props.setLanguage(event.currentTarget.getAttribute("value")); |  | ||||||
|                           this.setState({ anchorElLang: null }); |  | ||||||
|                         }} |  | ||||||
|                       > |  | ||||||
|                         Deutsch |  | ||||||
|                       </MenuItem> |  | ||||||
|                       <MenuItem |  | ||||||
|                         value="en_US" |  | ||||||
|                         onClick={(event) => { |  | ||||||
|                           this.props.setLanguage(event.currentTarget.getAttribute("value")); |  | ||||||
|                           this.setState({ anchorElLang: null }); |  | ||||||
|                         }} |  | ||||||
|                       > |  | ||||||
|                         English |  | ||||||
|                       </MenuItem> |  | ||||||
|                     </Menu> |  | ||||||
|                   </div> |  | ||||||
|                 </div> |  | ||||||
|               ) : (null)} |  | ||||||
|               {isHome ? ( |  | ||||||
|                 <Tooltip title={'Start Tour'} arrow> |  | ||||||
|                   <IconButton |  | ||||||
|                     color="inherit" |  | ||||||
|                     className={`openTour ${this.props.classes.button}`} |  | ||||||
|                     onClick={() => { |  | ||||||
|                       this.openTour(); |  | ||||||
|                     }} |  | ||||||
|                     size="large"> |  | ||||||
|                     <FontAwesomeIcon icon={faQuestionCircle} /> |  | ||||||
|                   </IconButton> |  | ||||||
|                 </Tooltip> |  | ||||||
|               ) : null} |  | ||||||
|               {isAssessment ? ( |  | ||||||
|                 <Tooltip title={'Start tour'} arrow> |  | ||||||
|                   <IconButton |  | ||||||
|                     color="inherit" |  | ||||||
|                     className={`openTour ${this.props.classes.button}`} |  | ||||||
|                     onClick={() => { |  | ||||||
|                       this.openTour(); |  | ||||||
|                     }} |  | ||||||
|                     size="large"> |  | ||||||
|                     <FontAwesomeIcon icon={faQuestionCircle} /> |  | ||||||
|                   </IconButton> |  | ||||||
|                 </Tooltip> |  | ||||||
|               ) : null} |  | ||||||
|               <Tour |  | ||||||
|                 steps={isHome ? home() : assessment()} |  | ||||||
|                 isOpen={this.state.isTourOpen} |  | ||||||
|                 onRequestClose={() => { |  | ||||||
|                   this.closeTour(); |  | ||||||
|                 }} |                 }} | ||||||
|               /> |               > | ||||||
|               {this.props.user ? ( |                 <Typography variant="h6" noWrap> | ||||||
|                 <div> |                   Tutorial | ||||||
|                   <IconButton |                 </Typography> | ||||||
|                     color="inherit" |               </Link> | ||||||
|                     onClick={(event) => { this.setState({ anchorElUser: event.target }) }} |             ) : null} | ||||||
|                     style={{ margin: "0 30px 0 0" }} |             {isHome ? ( | ||||||
|                     size="large" |               <Tooltip title={Blockly.Msg.tooltip_start_tour} arrow> | ||||||
|                   > |                 <IconButton | ||||||
|                     <FontAwesomeIcon icon={faUser} /> |                   color="inherit" | ||||||
|                   </IconButton> |                   className={`openTour ${this.props.classes.button}`} | ||||||
|                   <Menu |                   onClick={() => { | ||||||
|                     anchorEl={this.state.anchorElUser} |                     this.openTour(); | ||||||
|                     anchorOrigin={{ |                   }} | ||||||
|                       vertical: 'bottom', |                   style={{ margin: "0 30px 0 auto" }} | ||||||
|                       horizontal: 'center', |                 > | ||||||
|                     }} |                   <FontAwesomeIcon icon={faQuestionCircle} /> | ||||||
|                     keepMounted |                 </IconButton> | ||||||
|                     transformOrigin={{ |               </Tooltip> | ||||||
|                       vertical: 'top', |             ) : null} | ||||||
|                       horizontal: 'center', |             {isAssessment ? ( | ||||||
|                     }} |               <Tooltip title={Blockly.Msg.tooltip_start_tour} arrow> | ||||||
|                     open={Boolean(this.state.anchorElUser)} |                 <IconButton | ||||||
|                     onClose={() => { this.setState({ anchorElUser: null }); }} |                   color="inherit" | ||||||
|                   > |                   className={`openTour ${this.props.classes.button}`} | ||||||
|                     <div className="" style={{ paddingLeft: "16px", paddingRight: "16px", paddingTop: "16px" }}> |                   onClick={() => { | ||||||
|                       <p style={{ fontWeight: "bold", margin: "0px" }}> |                     this.openTour(); | ||||||
|                         {this.props.user.name} |                   }} | ||||||
|                       </p> |                   style={{ margin: "0 30px 0 auto" }} | ||||||
|                       <p style={{ marginTop: "0px", color: "#696969" }}> |                 > | ||||||
|                         {this.props.user.email} |                   <FontAwesomeIcon icon={faQuestionCircle} /> | ||||||
|                       </p> |                 </IconButton> | ||||||
|                     </div> |               </Tooltip> | ||||||
|                     <hr style={{ borderTop: "3px solid #bbb", marginLeft: "5px", marginRight: "5px" }} /> |             ) : null} | ||||||
|                     <MenuItem> |             <Tour | ||||||
|                       <Link to={"/user"} style={{ textDecoration: 'none', color: "black" }}> |               steps={isHome ? home() : assessment()} | ||||||
|                         {Blockly.Msg.navbar_account} |               isOpen={this.state.isTourOpen} | ||||||
|                       </Link> |               onRequestClose={() => { | ||||||
|                     </MenuItem> |                 this.closeTour(); | ||||||
|                     <MenuItem> |               }} | ||||||
|                       <Link to={"/settings"} style={{ textDecoration: 'none', color: "black" }}> |             /> | ||||||
|                         {Blockly.Msg.navbar_settings} |  | ||||||
|                       </Link> |  | ||||||
|                     </MenuItem> |  | ||||||
|                     <MenuItem |  | ||||||
|                       onClick={() => { |  | ||||||
|                         this.props.logout() |  | ||||||
|                       }} |  | ||||||
|                     > |  | ||||||
|                       {Blockly.Msg.navbar_logout} |  | ||||||
|                     </MenuItem> |  | ||||||
|                   </Menu> |  | ||||||
|                 </div> |  | ||||||
|               ) |  | ||||||
|                 : |  | ||||||
|                 (<Link to={"/user/login"} style={{ textDecoration: 'none', color: "white" }}> |  | ||||||
|                   <IconButton |  | ||||||
|                     color="inherit" |  | ||||||
|                     style={{ margin: "0 30px 0 auto" }} |  | ||||||
|                   > |  | ||||||
|                     <FontAwesomeIcon icon={faUser} /> |  | ||||||
|                   </IconButton> |  | ||||||
|                 </Link> |  | ||||||
|                 ) |  | ||||||
|               } |  | ||||||
|             </div> |  | ||||||
|           </Toolbar> |           </Toolbar> | ||||||
|         </AppBar> |         </AppBar> | ||||||
|         <Drawer |         <Drawer | ||||||
| @ -399,11 +214,11 @@ class Navbar extends Component { | |||||||
|           </div> |           </div> | ||||||
|           <List> |           <List> | ||||||
|             {[ |             {[ | ||||||
|               { |                  { | ||||||
|                 text: Blockly.Msg.navbar_blockly, |                   text: Blockly.Msg.navbar_blockly, | ||||||
|                 icon: faPuzzlePiece, |                   icon: faPuzzlePiece, | ||||||
|                 link: "/", |                   link: "/", | ||||||
|               }, |                 }, | ||||||
|               { |               { | ||||||
|                 text: Blockly.Msg.navbar_tutorials, |                 text: Blockly.Msg.navbar_tutorials, | ||||||
|                 icon: faChalkboardTeacher, |                 icon: faChalkboardTeacher, | ||||||
| @ -452,7 +267,7 @@ class Navbar extends Component { | |||||||
|                         <FontAwesomeIcon icon={item.icon} /> |                         <FontAwesomeIcon icon={item.icon} /> | ||||||
|                       </ListItemIcon> |                       </ListItemIcon> | ||||||
|                       {item.text === "Code Editor" ? ( |                       {item.text === "Code Editor" ? ( | ||||||
|                         <Badge badgeContent={"Experimental"} color="primary" overlap="rectangular"> |                         <Badge badgeContent={"Experimental"} color="primary"> | ||||||
|                           <ListItemText primary={item.text} /> |                           <ListItemText primary={item.text} /> | ||||||
|                         </Badge> |                         </Badge> | ||||||
|                       ) : ( |                       ) : ( | ||||||
| @ -514,9 +329,9 @@ class Navbar extends Component { | |||||||
|                       onClick={ |                       onClick={ | ||||||
|                         item.function |                         item.function | ||||||
|                           ? () => { |                           ? () => { | ||||||
|                             item.function(); |                               item.function(); | ||||||
|                             this.toggleDrawer(); |                               this.toggleDrawer(); | ||||||
|                           } |                             } | ||||||
|                           : this.toggleDrawer |                           : this.toggleDrawer | ||||||
|                       } |                       } | ||||||
|                     > |                     > | ||||||
| @ -554,10 +369,6 @@ Navbar.propTypes = { | |||||||
|   user: PropTypes.object, |   user: PropTypes.object, | ||||||
|   tutorial: PropTypes.object, |   tutorial: PropTypes.object, | ||||||
|   activeStep: PropTypes.number.isRequired, |   activeStep: PropTypes.number.isRequired, | ||||||
|   setLanguage: PropTypes.func.isRequired, |  | ||||||
|   language: PropTypes.string.isRequired, |  | ||||||
|   setBoard: PropTypes.func.isRequired, |  | ||||||
|   selectedBoard: PropTypes.string.isRequired |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const mapStateToProps = (state) => ({ | const mapStateToProps = (state) => ({ | ||||||
| @ -567,10 +378,8 @@ const mapStateToProps = (state) => ({ | |||||||
|   user: state.auth.user, |   user: state.auth.user, | ||||||
|   tutorial: state.tutorial.tutorials[0], |   tutorial: state.tutorial.tutorials[0], | ||||||
|   activeStep: state.tutorial.activeStep, |   activeStep: state.tutorial.activeStep, | ||||||
|   language: state.general.language, |  | ||||||
|   selectedBoard: state.board.board |  | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| export default connect(mapStateToProps, { logout, setLanguage, setBoard })( | export default connect(mapStateToProps, { logout })( | ||||||
|   withStyles(styles, { withTheme: true })(withRouter(Navbar)) |   withStyles(styles, { withTheme: true })(withRouter(Navbar)) | ||||||
| ); | ); | ||||||
|  | |||||||
| @ -4,11 +4,11 @@ import Breadcrumbs from './Breadcrumbs'; | |||||||
| 
 | 
 | ||||||
| import { withRouter } from 'react-router-dom'; | import { withRouter } from 'react-router-dom'; | ||||||
| 
 | 
 | ||||||
| import Button from '@mui/material/Button'; | import Button from '@material-ui/core/Button'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| import * as Blockly from 'blockly' | import * as Blockly from 'blockly' | ||||||
| import ReactMarkdown from 'react-markdown'; | import ReactMarkdown from 'react-markdown'; | ||||||
| import Container from '@mui/material/Container'; | import Container from '@material-ui/core/Container'; | ||||||
| 
 | 
 | ||||||
| const news = ` | const news = ` | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -4,8 +4,8 @@ import Breadcrumbs from './Breadcrumbs'; | |||||||
| 
 | 
 | ||||||
| import { withRouter } from 'react-router-dom'; | import { withRouter } from 'react-router-dom'; | ||||||
| 
 | 
 | ||||||
| import Button from '@mui/material/Button'; | import Button from '@material-ui/core/Button'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| import * as Blockly from 'blockly' | import * as Blockly from 'blockly' | ||||||
| 
 | 
 | ||||||
| class NotFound extends Component { | class NotFound extends Component { | ||||||
|  | |||||||
| @ -1,6 +1,6 @@ | |||||||
| import React, { Component } from 'react'; | import React, { Component } from 'react'; | ||||||
| import { withRouter } from 'react-router-dom'; | import { withRouter } from 'react-router-dom'; | ||||||
| import Container from '@mui/material/Container'; | import Container from '@material-ui/core/Container'; | ||||||
| class Privay extends Component { | class Privay extends Component { | ||||||
|     render() { |     render() { | ||||||
|         return ( |         return ( | ||||||
|  | |||||||
| @ -10,8 +10,8 @@ import { withRouter } from 'react-router-dom'; | |||||||
| import Home from '../Home'; | import Home from '../Home'; | ||||||
| import Breadcrumbs from '../Breadcrumbs'; | import Breadcrumbs from '../Breadcrumbs'; | ||||||
| 
 | 
 | ||||||
| import Backdrop from '@mui/material/Backdrop'; | import Backdrop from '@material-ui/core/Backdrop'; | ||||||
| import CircularProgress from '@mui/material/CircularProgress'; | import CircularProgress from '@material-ui/core/CircularProgress'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class Project extends Component { | class Project extends Component { | ||||||
|  | |||||||
| @ -11,14 +11,13 @@ import BlocklyWindow from "../Blockly/BlocklyWindow"; | |||||||
| import Snackbar from "../Snackbar"; | import Snackbar from "../Snackbar"; | ||||||
| import WorkspaceFunc from "../Workspace/WorkspaceFunc"; | import WorkspaceFunc from "../Workspace/WorkspaceFunc"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Grid from "@mui/material/Grid"; | import Grid from "@material-ui/core/Grid"; | ||||||
| import Paper from "@mui/material/Paper"; | import Paper from "@material-ui/core/Paper"; | ||||||
| import Divider from "@mui/material/Divider"; | import Divider from "@material-ui/core/Divider"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import Backdrop from "@mui/material/Backdrop"; | import Backdrop from "@material-ui/core/Backdrop"; | ||||||
| import CircularProgress from "@mui/material/CircularProgress"; | import CircularProgress from "@material-ui/core/CircularProgress"; | ||||||
| import DeviceSelection from "../DeviceSelection"; |  | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   link: { |   link: { | ||||||
| @ -61,8 +60,9 @@ class ProjectHome extends Component { | |||||||
|         this.setState({ |         this.setState({ | ||||||
|           snackbar: true, |           snackbar: true, | ||||||
|           key: Date.now(), |           key: Date.now(), | ||||||
|           message: `Dein angefragtes ${type === "gallery" ? "Galerie-" : "" |           message: `Dein angefragtes ${ | ||||||
|             }Projekt konnte nicht gefunden werden.`,
 |             type === "gallery" ? "Galerie-" : "" | ||||||
|  |           }Projekt konnte nicht gefunden werden.`,
 | ||||||
|           type: "error", |           type: "error", | ||||||
|         }); |         }); | ||||||
|       } |       } | ||||||
| @ -108,7 +108,6 @@ class ProjectHome extends Component { | |||||||
|         /> |         /> | ||||||
| 
 | 
 | ||||||
|         <h1>{data}</h1> |         <h1>{data}</h1> | ||||||
|         <DeviceSelection /> |  | ||||||
|         {this.props.progress ? ( |         {this.props.progress ? ( | ||||||
|           <Backdrop open invisible> |           <Backdrop open invisible> | ||||||
|             <CircularProgress color="primary" /> |             <CircularProgress color="primary" /> | ||||||
| @ -128,8 +127,9 @@ class ProjectHome extends Component { | |||||||
|                         }} |                         }} | ||||||
|                       > |                       > | ||||||
|                         <Link |                         <Link | ||||||
|                           to={`/${data === "Projekte" ? "project" : "gallery" |                           to={`/${ | ||||||
|                             }/${project._id}`}
 |                             data === "Projekte" ? "project" : "gallery" | ||||||
|  |                           }/${project._id}`}
 | ||||||
|                           style={{ textDecoration: "none", color: "inherit" }} |                           style={{ textDecoration: "none", color: "inherit" }} | ||||||
|                         > |                         > | ||||||
|                           <h3 style={{ marginTop: 0 }}>{project.title}</h3> |                           <h3 style={{ marginTop: 0 }}>{project.title}</h3> | ||||||
| @ -153,7 +153,7 @@ class ProjectHome extends Component { | |||||||
|                           </Typography> |                           </Typography> | ||||||
|                         </Link> |                         </Link> | ||||||
|                         {this.props.user && |                         {this.props.user && | ||||||
|                           this.props.user.email === project.creator ? ( |                         this.props.user.email === project.creator ? ( | ||||||
|                           <div> |                           <div> | ||||||
|                             <Divider |                             <Divider | ||||||
|                               style={{ |                               style={{ | ||||||
|  | |||||||
| @ -1,7 +1,7 @@ | |||||||
| import React, { Component } from "react"; | 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 { visitPage, setPlatform } from "../../actions/generalActions"; | import { visitPage } from "../../actions/generalActions"; | ||||||
| 
 | 
 | ||||||
| import { Route, Switch, withRouter } from "react-router-dom"; | import { Route, Switch, withRouter } from "react-router-dom"; | ||||||
| 
 | 
 | ||||||
| @ -27,24 +27,6 @@ import Faq from "../Faq"; | |||||||
| import CodeEditor from "../CodeEditor/CodeEditor"; | import CodeEditor from "../CodeEditor/CodeEditor"; | ||||||
| 
 | 
 | ||||||
| class Routes extends Component { | class Routes extends Component { | ||||||
| 
 |  | ||||||
|   componentDidMount() { |  | ||||||
|     const { location } = this.props; |  | ||||||
|     const query = new URLSearchParams(location.search, [location.search]); |  | ||||||
|     const mode = query.get('mode'); |  | ||||||
| 
 |  | ||||||
|     if (!this.props.platform && mode) { |  | ||||||
|       switch (mode.toLowerCase()) { |  | ||||||
|         case 'tablet': |  | ||||||
|           this.props.setPlatform(true); |  | ||||||
|           break; |  | ||||||
|         default: |  | ||||||
|           break; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   componentDidUpdate() { |   componentDidUpdate() { | ||||||
|     this.props.visitPage(); |     this.props.visitPage(); | ||||||
|   } |   } | ||||||
| @ -123,12 +105,6 @@ class Routes extends Component { | |||||||
| 
 | 
 | ||||||
| Home.propTypes = { | Home.propTypes = { | ||||||
|   visitPage: PropTypes.func, |   visitPage: PropTypes.func, | ||||||
|   platform: PropTypes.bool.isRequired, |  | ||||||
|   setPlatform: PropTypes.func.isRequired |  | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| const mapStateToProps = (state) => ({ | export default connect(null, { visitPage })(withRouter(Routes)); | ||||||
|   platform: state.general.platform, |  | ||||||
| }); |  | ||||||
| 
 |  | ||||||
| export default connect(mapStateToProps, { visitPage, setPlatform })(withRouter(Routes)); |  | ||||||
|  | |||||||
| @ -1,77 +0,0 @@ | |||||||
| import React from "react"; |  | ||||||
| import Box from "@mui/material/Box"; |  | ||||||
| import Tab from "@mui/material/Tab"; |  | ||||||
| import TabContext from "@mui/lab/TabContext"; |  | ||||||
| import TabList from "@mui/lab/TabList"; |  | ||||||
| import TabPanel from "@mui/lab/TabPanel"; |  | ||||||
| import store from "../store"; |  | ||||||
| import ReactMarkdown from "react-markdown"; |  | ||||||
| import * as Blockly from "blockly"; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| export default function LabTabs() { |  | ||||||
|     const [value, setValue] = React.useState('1'); |  | ||||||
| 
 |  | ||||||
|     const handleChange = (event, newValue) => { |  | ||||||
|         setValue(newValue); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     // get the description in the current language if no lang is give return english or the first one
 |  | ||||||
|     function filterLanguage(options) { |  | ||||||
|         var lang; |  | ||||||
|         if (window.localStorage.getItem("locale")) { |  | ||||||
|             lang = window.localStorage.getItem("locale").split("_")[0]; |  | ||||||
|         } |  | ||||||
|         else { |  | ||||||
|             lang = "en"; |  | ||||||
|         } |  | ||||||
|         for (var i = 0; i < options.length; i++) { |  | ||||||
|             if (options[i].languageCode === lang) { |  | ||||||
|                 return options[i].text; |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         return options[0].text; |  | ||||||
|     } |  | ||||||
|     var currentStore = store.getState(); |  | ||||||
|     // ALL SENSOR DATA FROM WIKI
 |  | ||||||
|     var sensorData = currentStore.sensorwiki; |  | ||||||
|     // NAME OF SELECTED BLOCK
 |  | ||||||
|     var sensorName = currentStore.workspace.code.data.name; |  | ||||||
|     // SEARCH ALL DATA FOR SELECTED BLOCK NAME
 |  | ||||||
|     var sensorInfo = sensorData.find(function (element) { |  | ||||||
|         return element.slug === sensorName; |  | ||||||
|     }); |  | ||||||
|     if (sensorInfo) { |  | ||||||
|         sensorInfo.markdown = "Coming soon..."; |  | ||||||
| 
 |  | ||||||
|         // GET DESCRIPTION OF SELECTED BLOCK
 |  | ||||||
|         sensorInfo.details = `# ${sensorName.toUpperCase()} |  | ||||||
| ${Blockly.Msg.sensorinfo_explanation} [${sensorName.toUpperCase()}](https://sensors.wiki/sensor/detail/${sensorName})
 |  | ||||||
| ## ${Blockly.Msg.sensorinfo_description} |  | ||||||
| ${filterLanguage(sensorInfo.description.item)} |  | ||||||
| ## ${Blockly.Msg.sensorinfo_measurable_phenos} |  | ||||||
| ## ${Blockly.Msg.sensorinfo_manufacturer} |  | ||||||
| ${sensorInfo.manufacturer} |  | ||||||
| ## ${Blockly.Msg.sensorinfo_lifetime} |  | ||||||
| ${sensorInfo.lifePeriod}` |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     return ( |  | ||||||
|         <Box sx={{ width: '100%', typography: 'body1' }}> |  | ||||||
|             <TabContext value={value}> |  | ||||||
|                 <Box sx={{ borderBottom: 1, borderColor: 'divider' }}> |  | ||||||
|                     <TabList onChange={handleChange}> |  | ||||||
|                         <Tab label="Basic Information" value="1" /> |  | ||||||
|                         <Tab label="Details" value="2" /> |  | ||||||
|                     </TabList> |  | ||||||
|                 </Box> |  | ||||||
|                 <TabPanel value="1"> |  | ||||||
|                     {sensorInfo ? <ReactMarkdown>{sensorInfo.markdown}</ReactMarkdown> : "No data available"} |  | ||||||
|                 </TabPanel> |  | ||||||
|                 <TabPanel value="2"> |  | ||||||
|                     {sensorInfo ? <ReactMarkdown>{sensorInfo.details}</ReactMarkdown> : "No data available"} |  | ||||||
|                 </TabPanel> |  | ||||||
|             </TabContext> |  | ||||||
|         </Box> |  | ||||||
|     ); |  | ||||||
| } |  | ||||||
| @ -5,12 +5,12 @@ import { setBoard } from '../../actions/boardAction'; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from 'blockly/core'; | import * as Blockly from 'blockly/core'; | ||||||
| 
 | 
 | ||||||
| import InputLabel from '@mui/material/InputLabel'; | import InputLabel from '@material-ui/core/InputLabel'; | ||||||
| import MenuItem from '@mui/material/MenuItem'; | import MenuItem from '@material-ui/core/MenuItem'; | ||||||
| import FormControl from '@mui/material/FormControl'; | import FormControl from '@material-ui/core/FormControl'; | ||||||
| import Select from '@mui/material/Select'; | import Select from '@material-ui/core/Select'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| 
 | 
 | ||||||
| class DeviceSelector extends Component { | class DeviceSelector extends Component { | ||||||
| 
 | 
 | ||||||
| @ -22,18 +22,18 @@ class DeviceSelector extends Component { | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|   render(){ |   render(){ | ||||||
|     return ( |     return( | ||||||
|       <div> |       <div> | ||||||
|         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_board}</Typography> |         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_board}</Typography> | ||||||
|         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_board_text}</FormHelperText> |         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_board_text}</FormHelperText> | ||||||
|         <FormControl variant="standard"> |         <FormControl> | ||||||
|           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_board}</InputLabel> |           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_board}</InputLabel> | ||||||
|           <Select |           <Select | ||||||
|             variant="standard" |  | ||||||
|             labelId="demo-simple-select-label" |             labelId="demo-simple-select-label" | ||||||
|             id="demo-simple-select" |             id="demo-simple-select" | ||||||
|             value={this.props.selectedBoard} |             value={this.props.selectedBoard} | ||||||
|             onChange={(e) => this.props.setBoard(e.target.value)}> |             onChange={(e) => this.props.setBoard(e.target.value)} | ||||||
|  |           > | ||||||
|             <MenuItem value="mcu">senseBox MCU</MenuItem> |             <MenuItem value="mcu">senseBox MCU</MenuItem> | ||||||
|             <MenuItem value="mini">senseBox MCU mini</MenuItem> |             <MenuItem value="mini">senseBox MCU mini</MenuItem> | ||||||
|           </Select> |           </Select> | ||||||
|  | |||||||
| @ -5,12 +5,12 @@ import { setLanguage } from '../../actions/generalActions'; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from 'blockly/core'; | import * as Blockly from 'blockly/core'; | ||||||
| 
 | 
 | ||||||
| import InputLabel from '@mui/material/InputLabel'; | import InputLabel from '@material-ui/core/InputLabel'; | ||||||
| import MenuItem from '@mui/material/MenuItem'; | import MenuItem from '@material-ui/core/MenuItem'; | ||||||
| import FormControl from '@mui/material/FormControl'; | import FormControl from '@material-ui/core/FormControl'; | ||||||
| import Select from '@mui/material/Select'; | import Select from '@material-ui/core/Select'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| 
 | 
 | ||||||
| class LanguageSelector extends Component { | class LanguageSelector extends Component { | ||||||
| 
 | 
 | ||||||
| @ -25,18 +25,18 @@ class LanguageSelector extends Component { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   render(){ |   render(){ | ||||||
|     return ( |     return( | ||||||
|       <div> |       <div> | ||||||
|         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_language}</Typography> |         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_language}</Typography> | ||||||
|         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_language_text}</FormHelperText> |         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_language_text}</FormHelperText> | ||||||
|         <FormControl variant="standard"> |         <FormControl> | ||||||
|           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_language}</InputLabel> |           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_language}</InputLabel> | ||||||
|           <Select |           <Select | ||||||
|             variant="standard" |  | ||||||
|             labelId="demo-simple-select-label" |             labelId="demo-simple-select-label" | ||||||
|             id="demo-simple-select" |             id="demo-simple-select" | ||||||
|             value={this.props.language} |             value={this.props.language} | ||||||
|             onChange={this.handleChange}> |             onChange={this.handleChange} | ||||||
|  |           > | ||||||
|             <MenuItem value={'de_DE'}>{Blockly.Msg.settings_language_de}</MenuItem> |             <MenuItem value={'de_DE'}>{Blockly.Msg.settings_language_de}</MenuItem> | ||||||
|             <MenuItem value={'en_US'}>{Blockly.Msg.settings_language_en}</MenuItem> |             <MenuItem value={'en_US'}>{Blockly.Msg.settings_language_en}</MenuItem> | ||||||
|           </Select> |           </Select> | ||||||
|  | |||||||
| @ -5,12 +5,12 @@ import { setPlatform } from "../../actions/generalActions"; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from "blockly/core"; | import * as Blockly from "blockly/core"; | ||||||
| 
 | 
 | ||||||
| import InputLabel from "@mui/material/InputLabel"; | import InputLabel from "@material-ui/core/InputLabel"; | ||||||
| import MenuItem from "@mui/material/MenuItem"; | import MenuItem from "@material-ui/core/MenuItem"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import Select from "@mui/material/Select"; | import Select from "@material-ui/core/Select"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import FormHelperText from "@mui/material/FormHelperText"; | import FormHelperText from "@material-ui/core/FormHelperText"; | ||||||
| 
 | 
 | ||||||
| class OtaSelector extends Component { | class OtaSelector extends Component { | ||||||
|   componentDidMount() { |   componentDidMount() { | ||||||
| @ -33,16 +33,16 @@ class OtaSelector extends Component { | |||||||
|             https://sensebox.de/app
 |             https://sensebox.de/app
 | ||||||
|           </a> |           </a> | ||||||
|         </FormHelperText> |         </FormHelperText> | ||||||
|         <FormControl variant="standard"> |         <FormControl> | ||||||
|           <InputLabel id="demo-simple-select-label"> |           <InputLabel id="demo-simple-select-label"> | ||||||
|             {Blockly.Msg.settings_statistics} |             {Blockly.Msg.settings_statistics} | ||||||
|           </InputLabel> |           </InputLabel> | ||||||
|           <Select |           <Select | ||||||
|             variant="standard" |  | ||||||
|             labelId="demo-simple-select-label" |             labelId="demo-simple-select-label" | ||||||
|             id="demo-simple-select" |             id="demo-simple-select" | ||||||
|             value={this.props.platform} |             value={this.props.platform} | ||||||
|             onChange={(e) => this.props.setPlatform(e.target.value)}> |             onChange={(e) => this.props.setPlatform(e.target.value)} | ||||||
|  |           > | ||||||
|             <MenuItem value={true}>{Blockly.Msg.settings_ota_on}</MenuItem> |             <MenuItem value={true}>{Blockly.Msg.settings_ota_on}</MenuItem> | ||||||
|             <MenuItem value={false}>{Blockly.Msg.settings_ota_off}</MenuItem> |             <MenuItem value={false}>{Blockly.Msg.settings_ota_off}</MenuItem> | ||||||
|           </Select> |           </Select> | ||||||
|  | |||||||
| @ -5,12 +5,12 @@ import { setRenderer } from '../../actions/generalActions'; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from 'blockly/core' | import * as Blockly from 'blockly/core' | ||||||
| 
 | 
 | ||||||
| import InputLabel from '@mui/material/InputLabel'; | import InputLabel from '@material-ui/core/InputLabel'; | ||||||
| import MenuItem from '@mui/material/MenuItem'; | import MenuItem from '@material-ui/core/MenuItem'; | ||||||
| import FormControl from '@mui/material/FormControl'; | import FormControl from '@material-ui/core/FormControl'; | ||||||
| import Select from '@mui/material/Select'; | import Select from '@material-ui/core/Select'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class RenderSelector extends Component { | class RenderSelector extends Component { | ||||||
| @ -26,14 +26,14 @@ class RenderSelector extends Component { | |||||||
|       <div> |       <div> | ||||||
|         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_renderer}</Typography> |         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_renderer}</Typography> | ||||||
|         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_renderer_text}</FormHelperText> |         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_renderer_text}</FormHelperText> | ||||||
|         <FormControl variant="standard"> |         <FormControl> | ||||||
|           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_renderer}</InputLabel> |           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_renderer}</InputLabel> | ||||||
|           <Select |           <Select | ||||||
|             variant="standard" |  | ||||||
|             labelId="demo-simple-select-label" |             labelId="demo-simple-select-label" | ||||||
|             id="demo-simple-select" |             id="demo-simple-select" | ||||||
|             value={this.props.renderer} |             value={this.props.renderer} | ||||||
|             onChange={(e) => this.props.setRenderer(e.target.value)}> |             onChange={(e) => this.props.setRenderer(e.target.value)} | ||||||
|  |           > | ||||||
|             <MenuItem value={'geras'}>Geras</MenuItem> |             <MenuItem value={'geras'}>Geras</MenuItem> | ||||||
|             <MenuItem value={'zelos'}>Zelos</MenuItem> |             <MenuItem value={'zelos'}>Zelos</MenuItem> | ||||||
|           </Select> |           </Select> | ||||||
|  | |||||||
| @ -14,8 +14,8 @@ import OtaSelector from "./OtaSelector"; | |||||||
| import SoundsSelector from "./SoundsSelector"; | import SoundsSelector from "./SoundsSelector"; | ||||||
| import DeviceSelector from "./DeviceSelector"; | import DeviceSelector from "./DeviceSelector"; | ||||||
| 
 | 
 | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| import Paper from "@mui/material/Paper"; | import Paper from "@material-ui/core/Paper"; | ||||||
| 
 | 
 | ||||||
| class Settings extends Component { | class Settings extends Component { | ||||||
|   componentDidMount() { |   componentDidMount() { | ||||||
|  | |||||||
| @ -5,12 +5,12 @@ import { setSounds } from "../../actions/generalActions"; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from "blockly/core"; | import * as Blockly from "blockly/core"; | ||||||
| 
 | 
 | ||||||
| import InputLabel from "@mui/material/InputLabel"; | import InputLabel from "@material-ui/core/InputLabel"; | ||||||
| import MenuItem from "@mui/material/MenuItem"; | import MenuItem from "@material-ui/core/MenuItem"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import Select from "@mui/material/Select"; | import Select from "@material-ui/core/Select"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import FormHelperText from "@mui/material/FormHelperText"; | import FormHelperText from "@material-ui/core/FormHelperText"; | ||||||
| 
 | 
 | ||||||
| class SoundsSelector extends Component { | class SoundsSelector extends Component { | ||||||
|   componentDidMount() { |   componentDidMount() { | ||||||
| @ -30,16 +30,16 @@ class SoundsSelector extends Component { | |||||||
|         > |         > | ||||||
|           {Blockly.Msg.settings_sounds_text} |           {Blockly.Msg.settings_sounds_text} | ||||||
|         </FormHelperText> |         </FormHelperText> | ||||||
|         <FormControl variant="standard"> |         <FormControl> | ||||||
|           <InputLabel id="demo-simple-select-label"> |           <InputLabel id="demo-simple-select-label"> | ||||||
|             {Blockly.Msg.settings_sounds} |             {Blockly.Msg.settings_sounds} | ||||||
|           </InputLabel> |           </InputLabel> | ||||||
|           <Select |           <Select | ||||||
|             variant="standard" |  | ||||||
|             labelId="demo-simple-select-label" |             labelId="demo-simple-select-label" | ||||||
|             id="demo-simple-select" |             id="demo-simple-select" | ||||||
|             value={this.props.sounds} |             value={this.props.sounds} | ||||||
|             onChange={(e) => this.props.setSounds(e.target.value)}> |             onChange={(e) => this.props.setSounds(e.target.value)} | ||||||
|  |           > | ||||||
|             <MenuItem value={false}>{Blockly.Msg.settings_ota_off}</MenuItem> |             <MenuItem value={false}>{Blockly.Msg.settings_ota_off}</MenuItem> | ||||||
|             <MenuItem value={true}>{Blockly.Msg.settings_ota_on}</MenuItem> |             <MenuItem value={true}>{Blockly.Msg.settings_ota_on}</MenuItem> | ||||||
|           </Select> |           </Select> | ||||||
|  | |||||||
| @ -5,12 +5,12 @@ import { setStatistics } from '../../actions/generalActions'; | |||||||
| 
 | 
 | ||||||
| import * as Blockly from 'blockly/core' | import * as Blockly from 'blockly/core' | ||||||
| 
 | 
 | ||||||
| import InputLabel from '@mui/material/InputLabel'; | import InputLabel from '@material-ui/core/InputLabel'; | ||||||
| import MenuItem from '@mui/material/MenuItem'; | import MenuItem from '@material-ui/core/MenuItem'; | ||||||
| import FormControl from '@mui/material/FormControl'; | import FormControl from '@material-ui/core/FormControl'; | ||||||
| import Select from '@mui/material/Select'; | import Select from '@material-ui/core/Select'; | ||||||
| import Typography from '@mui/material/Typography'; | import Typography from '@material-ui/core/Typography'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| 
 | 
 | ||||||
| class StatsSelector extends Component { | class StatsSelector extends Component { | ||||||
| 
 | 
 | ||||||
| @ -25,14 +25,14 @@ class StatsSelector extends Component { | |||||||
|       <div> |       <div> | ||||||
|         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_statistics}</Typography> |         <Typography style={{fontWeight: 'bold'}}>{Blockly.Msg.settings_statistics}</Typography> | ||||||
|         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_statistics_text}</FormHelperText> |         <FormHelperText style={{color: 'black', lineHeight: 1.3, marginBottom: '8px'}}>{Blockly.Msg.settings_statistics_text}</FormHelperText> | ||||||
|         <FormControl variant="standard"> |         <FormControl> | ||||||
|           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_statistics}</InputLabel> |           <InputLabel id="demo-simple-select-label">{Blockly.Msg.settings_statistics}</InputLabel> | ||||||
|           <Select |           <Select | ||||||
|             variant="standard" |  | ||||||
|             labelId="demo-simple-select-label" |             labelId="demo-simple-select-label" | ||||||
|             id="demo-simple-select" |             id="demo-simple-select" | ||||||
|             value={this.props.statistics} |             value={this.props.statistics} | ||||||
|             onChange={(e) => this.props.setStatistics(e.target.value)}> |             onChange={(e) => this.props.setStatistics(e.target.value)} | ||||||
|  |           > | ||||||
|             <MenuItem value={true}>{Blockly.Msg.settings_statistics_on}</MenuItem> |             <MenuItem value={true}>{Blockly.Msg.settings_statistics_on}</MenuItem> | ||||||
|             <MenuItem value={false}>{Blockly.Msg.settings_statistics_off}</MenuItem> |             <MenuItem value={false}>{Blockly.Msg.settings_statistics_off}</MenuItem> | ||||||
|           </Select> |           </Select> | ||||||
|  | |||||||
| @ -1,9 +1,9 @@ | |||||||
| import React, { Component } from 'react'; | import React, { Component } from 'react'; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from '@material-ui/core/styles'; | ||||||
| import IconButton from '@mui/material/IconButton'; | import IconButton from '@material-ui/core/IconButton'; | ||||||
| import MaterialUISnackbar from '@mui/material/Snackbar'; | import MaterialUISnackbar from '@material-ui/core/Snackbar'; | ||||||
| import SnackbarContent from '@mui/material/SnackbarContent'; | import SnackbarContent from '@material-ui/core/SnackbarContent'; | ||||||
| 
 | 
 | ||||||
| import { faTimes } from "@fortawesome/free-solid-svg-icons"; | import { faTimes } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| @ -69,8 +69,8 @@ class Snackbar extends Component { | |||||||
|           style={{flexWrap: 'nowrap'}} |           style={{flexWrap: 'nowrap'}} | ||||||
|           className={this.props.type === 'error' ? this.props.classes.error : this.props.classes.success} |           className={this.props.type === 'error' ? this.props.classes.error : this.props.classes.success} | ||||||
|           action={ |           action={ | ||||||
|             <IconButton onClick={this.onClose} style={{color: 'inherit'}} size="large"> |             <IconButton onClick={this.onClose} style={{color: 'inherit'}}> | ||||||
|               <FontAwesomeIcon icon={faTimes} size="xs" /> |               <FontAwesomeIcon icon={faTimes} size="xs"/> | ||||||
|             </IconButton> |             </IconButton> | ||||||
|           } |           } | ||||||
|           message={this.props.message} |           message={this.props.message} | ||||||
|  | |||||||
| @ -1,43 +1,17 @@ | |||||||
| import React, { Component } from "react"; | 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 { Button, Card } from "@mui/material"; | 
 | ||||||
|  | import withWidth from "@material-ui/core/withWidth"; | ||||||
|  | 
 | ||||||
|  | import { Card } from "@material-ui/core"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import CardContent from "@mui/material/CardContent"; | import CardContent from "@material-ui/core/CardContent"; | ||||||
| import Typography from "@mui/material/Typography"; | 
 | ||||||
|  | import Typography from "@material-ui/core/Typography"; | ||||||
| import ReactMarkdown from "react-markdown"; | import ReactMarkdown from "react-markdown"; | ||||||
| import Dialog from "@mui/material/Dialog"; |  | ||||||
| import DialogActions from "@mui/material/DialogActions"; |  | ||||||
| import DialogContent from "@mui/material/DialogContent"; |  | ||||||
| import Slide from "@mui/material/Slide"; |  | ||||||
| import SensorInfo from "./SensorInfo"; |  | ||||||
| import store from "../store"; |  | ||||||
| 
 |  | ||||||
| // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
 |  | ||||||
| const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />; |  | ||||||
| 
 |  | ||||||
| const Transition = React.forwardRef(function Transition(props, ref) { |  | ||||||
|   return <Slide direction="up" ref={ref} {...props} />; |  | ||||||
| }); |  | ||||||
| 
 | 
 | ||||||
| class TooltipViewer extends Component { | class TooltipViewer extends Component { | ||||||
| 
 |  | ||||||
|   constructor(props) { |  | ||||||
|     super(props); |  | ||||||
|     this.inputRef = React.createRef(); |  | ||||||
|     this.state = { |  | ||||||
|       open: false, |  | ||||||
|     }; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   toggleDialog = () => { |  | ||||||
|     this.setState({ open: !this.state }); |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   openDialog = () => { |  | ||||||
|     this.setState({ open: true }); |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   render() { |   render() { | ||||||
|     return ( |     return ( | ||||||
|       <Card |       <Card | ||||||
| @ -55,46 +29,14 @@ class TooltipViewer extends Component { | |||||||
|             {Blockly.Msg.tooltip_viewer} |             {Blockly.Msg.tooltip_viewer} | ||||||
|           </Typography> |           </Typography> | ||||||
| 
 | 
 | ||||||
|           <Typography variant="body2" component="span"> |           <ReactMarkdown linkTarget="_blank"> | ||||||
|             <ReactMarkdown linkTarget="_blank"> |             {this.props.tooltip} | ||||||
|               {this.props.tooltip} |           </ReactMarkdown> | ||||||
|             </ReactMarkdown> | 
 | ||||||
|             {store.getState().workspace.code.data ? ( |           {this.props.helpurl !== "" ? ( | ||||||
|               <Button |             <ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown> | ||||||
|                 label="Mehr" |           ) : null} | ||||||
|                 variant="contained" |  | ||||||
|                 color="primary" |  | ||||||
|                 onClick={() => { |  | ||||||
|                   this.openDialog(); |  | ||||||
|                 }} |  | ||||||
|               > |  | ||||||
|                 Sensor Informationen |  | ||||||
|               </Button> |  | ||||||
|             ) : ( |  | ||||||
|               <ReactMarkdown>{`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`}</ReactMarkdown> |  | ||||||
|             )} |  | ||||||
|           </Typography> |  | ||||||
|         </CardContent> |         </CardContent> | ||||||
|         {store.getState().workspace.code.data ? (<Dialog |  | ||||||
|           open={this.state.open} |  | ||||||
|           TransitionComponent={Transition} |  | ||||||
|           keepMounted |  | ||||||
|           aria-describedby="alert-dialog-slide-description" |  | ||||||
|           onClose={() => { |  | ||||||
|             this.toggleDialog(); |  | ||||||
|           }} |  | ||||||
|           maxWidth={"md"} |  | ||||||
|           fullWidth={true} |  | ||||||
|         > |  | ||||||
|           <DialogContent> |  | ||||||
|             <SensorInfo></SensorInfo> |  | ||||||
|           </DialogContent> |  | ||||||
|           <DialogActions> |  | ||||||
|             <Button onClick={() => { |  | ||||||
|               this.toggleDialog(); |  | ||||||
|             }}>Close</Button> |  | ||||||
|           </DialogActions> |  | ||||||
|         </Dialog>) : (null)} |  | ||||||
|       </Card> |       </Card> | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -6,26 +6,22 @@ import { workspaceName } from "../../actions/workspaceActions"; | |||||||
| import BlocklyWindow from "../Blockly/BlocklyWindow"; | import BlocklyWindow from "../Blockly/BlocklyWindow"; | ||||||
| import WorkspaceFunc from "../Workspace/WorkspaceFunc"; | import WorkspaceFunc from "../Workspace/WorkspaceFunc"; | ||||||
| 
 | 
 | ||||||
| import Grid from "@mui/material/Grid"; | import withWidth, { isWidthDown } from "@material-ui/core/withWidth"; | ||||||
| import Card from "@mui/material/Card"; | import Grid from "@material-ui/core/Grid"; | ||||||
| import Typography from "@mui/material/Typography"; | import Card from "@material-ui/core/Card"; | ||||||
|  | import Typography from "@material-ui/core/Typography"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import { initialXml } from "../Blockly/initialXml"; | import { initialXml } from "../Blockly/initialXml"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import CodeViewer from "../CodeViewer"; | import CodeViewer from "../CodeViewer"; | ||||||
| import TooltipViewer from "../TooltipViewer"; | import TooltipViewer from "../TooltipViewer"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import ReactMarkdown from "react-markdown"; | import ReactMarkdown from "react-markdown"; | ||||||
| import { faCode } from "@fortawesome/free-solid-svg-icons"; | import { faCode } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import remarkGfm from "remark-gfm"; | import remarkGfm from "remark-gfm"; | ||||||
| import remarkGemoji from "remark-gemoji"; | import remarkGemoji from "remark-gemoji"; | ||||||
| import { isWidthDown } from "../../helpers/handleBreakpoints"; |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
 |  | ||||||
| const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />; |  | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   codeOn: { |   codeOn: { | ||||||
| @ -102,10 +98,11 @@ class Assessment extends Component { | |||||||
|               } |               } | ||||||
|             > |             > | ||||||
|               <IconButton |               <IconButton | ||||||
|                 className={`showCode ${this.state.codeOn |                 className={`showCode ${ | ||||||
|  |                   this.state.codeOn | ||||||
|                     ? this.props.classes.codeOn |                     ? this.props.classes.codeOn | ||||||
|                     : this.props.classes.codeOff |                     : this.props.classes.codeOff | ||||||
|                   }`}
 |                 }`}
 | ||||||
|                 style={{ |                 style={{ | ||||||
|                   width: "40px", |                   width: "40px", | ||||||
|                   height: "40px", |                   height: "40px", | ||||||
| @ -115,8 +112,8 @@ class Assessment extends Component { | |||||||
|                   zIndex: 21, |                   zIndex: 21, | ||||||
|                 }} |                 }} | ||||||
|                 onClick={() => this.onChange()} |                 onClick={() => this.onChange()} | ||||||
|                 size="large"> |               > | ||||||
|                 <FontAwesomeIcon icon={faCode}  size="xs" /> |                 <FontAwesomeIcon icon={faCode} size="xs" /> | ||||||
|               </IconButton> |               </IconButton> | ||||||
|             </Tooltip> |             </Tooltip> | ||||||
|             <BlocklyWindow |             <BlocklyWindow | ||||||
|  | |||||||
| @ -15,13 +15,13 @@ import * as Blockly from "blockly/core"; | |||||||
| import { initialXml } from "../../Blockly//initialXml.js"; | import { initialXml } from "../../Blockly//initialXml.js"; | ||||||
| import BlocklyWindow from "../../Blockly/BlocklyWindow"; | import BlocklyWindow from "../../Blockly/BlocklyWindow"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Switch from "@mui/material/Switch"; | import Switch from "@material-ui/core/Switch"; | ||||||
| import FormControlLabel from "@mui/material/FormControlLabel"; | import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||||||
| import FormHelperText from "@mui/material/FormHelperText"; | import FormHelperText from "@material-ui/core/FormHelperText"; | ||||||
| import FormLabel from "@mui/material/FormLabel"; | import FormLabel from "@material-ui/core/FormLabel"; | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| import Grid from "@mui/material/Grid"; | import Grid from "@material-ui/core/Grid"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   errorColor: { |   errorColor: { | ||||||
| @ -139,6 +139,7 @@ class BlocklyExample extends Component { | |||||||
|               <Switch |               <Switch | ||||||
|                 checked={this.state.checked} |                 checked={this.state.checked} | ||||||
|                 onChange={(e) => this.onChange(e.target.checked)} |                 onChange={(e) => this.onChange(e.target.checked)} | ||||||
|  |                 color="primary" | ||||||
|               /> |               /> | ||||||
|             } |             } | ||||||
|           /> |           /> | ||||||
|  | |||||||
| @ -33,19 +33,19 @@ import Snackbar from "../../Snackbar"; | |||||||
| import Public from "./Public"; | import Public from "./Public"; | ||||||
| import Review from "./Review"; | import Review from "./Review"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| import Backdrop from "@mui/material/Backdrop"; | import Backdrop from "@material-ui/core/Backdrop"; | ||||||
| import CircularProgress from "@mui/material/CircularProgress"; | import CircularProgress from "@material-ui/core/CircularProgress"; | ||||||
| import Divider from "@mui/material/Divider"; | import Divider from "@material-ui/core/Divider"; | ||||||
| import FormHelperText from "@mui/material/FormHelperText"; | import FormHelperText from "@material-ui/core/FormHelperText"; | ||||||
| import Radio from "@mui/material/Radio"; | import Radio from "@material-ui/core/Radio"; | ||||||
| import RadioGroup from "@mui/material/RadioGroup"; | import RadioGroup from "@material-ui/core/RadioGroup"; | ||||||
| import FormControlLabel from "@mui/material/FormControlLabel"; | import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||||||
| import InputLabel from "@mui/material/InputLabel"; | import InputLabel from "@material-ui/core/InputLabel"; | ||||||
| import MenuItem from "@mui/material/MenuItem"; | import MenuItem from "@material-ui/core/MenuItem"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import Select from "@mui/material/Select"; | import Select from "@material-ui/core/Select"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
| @ -407,7 +407,7 @@ class Builder extends Component { | |||||||
|           <FormControlLabel |           <FormControlLabel | ||||||
|             style={{ color: "black" }} |             style={{ color: "black" }} | ||||||
|             value="new" |             value="new" | ||||||
|             control={<Radio />} |             control={<Radio color="primary" />} | ||||||
|             label={Blockly.Msg.builder_createNew} |             label={Blockly.Msg.builder_createNew} | ||||||
|             labelPlacement="end" |             labelPlacement="end" | ||||||
|           /> |           /> | ||||||
| @ -417,7 +417,7 @@ class Builder extends Component { | |||||||
|                 style={{ color: "black" }} |                 style={{ color: "black" }} | ||||||
|                 disabled={this.props.index === 0} |                 disabled={this.props.index === 0} | ||||||
|                 value="change" |                 value="change" | ||||||
|                 control={<Radio />} |                 control={<Radio color="primary" />} | ||||||
|                 label={Blockly.Msg.builder_changeExisting} |                 label={Blockly.Msg.builder_changeExisting} | ||||||
|                 labelPlacement="end" |                 labelPlacement="end" | ||||||
|               /> |               /> | ||||||
| @ -425,7 +425,7 @@ class Builder extends Component { | |||||||
|                 style={{ color: "black" }} |                 style={{ color: "black" }} | ||||||
|                 disabled={this.props.index === 0} |                 disabled={this.props.index === 0} | ||||||
|                 value="delete" |                 value="delete" | ||||||
|                 control={<Radio />} |                 control={<Radio color="primary" />} | ||||||
|                 label={Blockly.Msg.builder_deleteExisting} |                 label={Blockly.Msg.builder_deleteExisting} | ||||||
|                 labelPlacement="end" |                 labelPlacement="end" | ||||||
|               /> |               /> | ||||||
| @ -470,12 +470,12 @@ class Builder extends Component { | |||||||
|           <FormControl variant="outlined" style={{ width: "100%" }}> |           <FormControl variant="outlined" style={{ width: "100%" }}> | ||||||
|             <InputLabel id="select-outlined-label">Tutorial</InputLabel> |             <InputLabel id="select-outlined-label">Tutorial</InputLabel> | ||||||
|             <Select |             <Select | ||||||
|               variant="standard" |  | ||||||
|               color="primary" |               color="primary" | ||||||
|               labelId="select-outlined-label" |               labelId="select-outlined-label" | ||||||
|               value={this.props.id} |               value={this.props.id} | ||||||
|               onChange={(e) => this.onChangeId(e.target.value)} |               onChange={(e) => this.onChangeId(e.target.value)} | ||||||
|               label="Tutorial"> |               label="Tutorial" | ||||||
|  |             > | ||||||
|               {filteredTutorials.map((tutorial) => ( |               {filteredTutorials.map((tutorial) => ( | ||||||
|                 <MenuItem value={tutorial._id}> |                 <MenuItem value={tutorial._id}> | ||||||
|                   {tutorial.title}{" "} |                   {tutorial.title}{" "} | ||||||
|  | |||||||
| @ -9,13 +9,13 @@ import { | |||||||
|   deleteError, |   deleteError, | ||||||
| } from "../../../actions/tutorialBuilderActions"; | } from "../../../actions/tutorialBuilderActions"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import ReactStars from "react-rating-stars-component"; | import ReactStars from "react-rating-stars-component"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import FormGroup from "@mui/material/FormGroup"; | import FormGroup from "@material-ui/core/FormGroup"; | ||||||
| import FormControlLabel from "@mui/material/FormControlLabel"; | import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import FormLabel from "@mui/material/FormLabel"; | import FormLabel from "@material-ui/core/FormLabel"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   multiline: { |   multiline: { | ||||||
| @ -55,7 +55,7 @@ class Difficulty extends Component { | |||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     return ( |     return ( | ||||||
|       <FormControl variant="standard" component="fieldset"> |       <FormControl component="fieldset"> | ||||||
|         <FormLabel component="legend"> |         <FormLabel component="legend"> | ||||||
|           {Blockly.Msg.builder_difficulty} |           {Blockly.Msg.builder_difficulty} | ||||||
|         </FormLabel> |         </FormLabel> | ||||||
|  | |||||||
| @ -9,17 +9,14 @@ import { | |||||||
| 
 | 
 | ||||||
| import hardware from "../../../data/hardware.json"; | import hardware from "../../../data/hardware.json"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import ImageList from "@mui/material/ImageList"; | import withWidth, { isWidthDown } from "@material-ui/core/withWidth"; | ||||||
| import ImageListItem from "@mui/material/ImageListItem"; | import ImageList from "@material-ui/core/ImageList"; | ||||||
| import ImageListItemBar from "@mui/material/ImageListItemBar"; | import ImageListItem from "@material-ui/core/ImageListItem"; | ||||||
| import FormHelperText from "@mui/material/FormHelperText"; | import ImageListItemBar from "@material-ui/core/ImageListItemBar"; | ||||||
| import FormLabel from "@mui/material/FormLabel"; | import FormHelperText from "@material-ui/core/FormHelperText"; | ||||||
|  | import FormLabel from "@material-ui/core/FormLabel"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import { isWidthDown } from "../../../helpers/handleBreakpoints"; |  | ||||||
| 
 |  | ||||||
| // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
 |  | ||||||
| const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />; |  | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   multiImageListItem: { |   multiImageListItem: { | ||||||
|  | |||||||
| @ -3,12 +3,12 @@ import PropTypes from 'prop-types'; | |||||||
| import { connect } from 'react-redux'; | import { connect } from 'react-redux'; | ||||||
| import { tutorialId, setError, deleteError } from '../../../actions/tutorialBuilderActions'; | import { tutorialId, setError, deleteError } from '../../../actions/tutorialBuilderActions'; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from '@material-ui/core/styles'; | ||||||
| import Button from '@mui/material/Button'; | import Button from '@material-ui/core/Button'; | ||||||
| import OutlinedInput from '@mui/material/OutlinedInput'; | import OutlinedInput from '@material-ui/core/OutlinedInput'; | ||||||
| import InputLabel from '@mui/material/InputLabel'; | import InputLabel from '@material-ui/core/InputLabel'; | ||||||
| import FormControl from '@mui/material/FormControl'; | import FormControl from '@material-ui/core/FormControl'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| 
 | 
 | ||||||
| import { faPlus, faMinus } from "@fortawesome/free-solid-svg-icons"; | import { faPlus, faMinus } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
|  | |||||||
| @ -8,7 +8,7 @@ import { | |||||||
|   deleteError, |   deleteError, | ||||||
| } from "../../../actions/tutorialBuilderActions"; | } from "../../../actions/tutorialBuilderActions"; | ||||||
| 
 | 
 | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import MarkdownIt from "markdown-it"; | import MarkdownIt from "markdown-it"; | ||||||
| import Editor from "react-markdown-editor-lite"; | import Editor from "react-markdown-editor-lite"; | ||||||
| import "react-markdown-editor-lite/lib/index.css"; | import "react-markdown-editor-lite/lib/index.css"; | ||||||
|  | |||||||
| @ -5,13 +5,13 @@ import { changeContent, deleteProperty, setError, deleteError } from '../../../a | |||||||
| 
 | 
 | ||||||
| import Textfield from './Textfield'; | import Textfield from './Textfield'; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from '@material-ui/core/styles'; | ||||||
| import Switch from '@mui/material/Switch'; | import Switch from '@material-ui/core/Switch'; | ||||||
| import FormControlLabel from '@mui/material/FormControlLabel'; | import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| import Radio from '@mui/material/Radio'; | import Radio from '@material-ui/core/Radio'; | ||||||
| import RadioGroup from '@mui/material/RadioGroup'; | import RadioGroup from '@material-ui/core/RadioGroup'; | ||||||
| import Button from '@mui/material/Button'; | import Button from '@material-ui/core/Button'; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   errorColor: { |   errorColor: { | ||||||
| @ -97,6 +97,7 @@ class Media extends Component { | |||||||
|             <Switch |             <Switch | ||||||
|               checked={this.state.checked} |               checked={this.state.checked} | ||||||
|               onChange={(e) => this.onChangeSwitch(e.target.checked)} |               onChange={(e) => this.onChangeSwitch(e.target.checked)} | ||||||
|  |               color="primary" | ||||||
|             /> |             /> | ||||||
|           } |           } | ||||||
|         /> |         /> | ||||||
| @ -105,13 +106,13 @@ class Media extends Component { | |||||||
|             <RadioGroup row value={this.state.radioValue} onChange={(e) => {this.onChangeRadio(e.target.value);}}> |             <RadioGroup row value={this.state.radioValue} onChange={(e) => {this.onChangeRadio(e.target.value);}}> | ||||||
|               <FormControlLabel style={{color: 'black'}} |               <FormControlLabel style={{color: 'black'}} | ||||||
|                 value="picture" |                 value="picture" | ||||||
|                 control={<Radio />} |                 control={<Radio color="primary" />} | ||||||
|                 label="Bild" |                 label="Bild" | ||||||
|                 labelPlacement="end" |                 labelPlacement="end" | ||||||
|               /> |               /> | ||||||
|               <FormControlLabel style={{color: 'black'}} |               <FormControlLabel style={{color: 'black'}} | ||||||
|                 value="youtube" |                 value="youtube" | ||||||
|                 control={<Radio />} |                 control={<Radio color="primary" />} | ||||||
|                 label="Youtube-Video" |                 label="Youtube-Video" | ||||||
|                 labelPlacement="end" |                 labelPlacement="end" | ||||||
|               /> |               /> | ||||||
|  | |||||||
| @ -9,14 +9,14 @@ import { | |||||||
|   deleteError, |   deleteError, | ||||||
| } from "../../../actions/tutorialBuilderActions"; | } from "../../../actions/tutorialBuilderActions"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| 
 | 
 | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import Checkbox from "@mui/material/Checkbox"; | import Checkbox from "@material-ui/core/Checkbox"; | ||||||
| import FormGroup from "@mui/material/FormGroup"; | import FormGroup from "@material-ui/core/FormGroup"; | ||||||
| import FormControlLabel from "@mui/material/FormControlLabel"; | import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import FormLabel from "@mui/material/FormLabel"; | import FormLabel from "@material-ui/core/FormLabel"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   multiline: { |   multiline: { | ||||||
| @ -52,7 +52,7 @@ class Public extends Component { | |||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     return ( |     return ( | ||||||
|       <FormControl variant="standard" component="fieldset"> |       <FormControl component="fieldset"> | ||||||
|         <FormLabel component="legend"> |         <FormLabel component="legend"> | ||||||
|           {Blockly.Msg.builder_public_head} |           {Blockly.Msg.builder_public_head} | ||||||
|         </FormLabel> |         </FormLabel> | ||||||
| @ -63,6 +63,7 @@ class Public extends Component { | |||||||
|               <Checkbox |               <Checkbox | ||||||
|                 checked={this.props.value} |                 checked={this.props.value} | ||||||
|                 onChange={this.handleChange} |                 onChange={this.handleChange} | ||||||
|  |                 color="primary" | ||||||
|                 name="checkedA" |                 name="checkedA" | ||||||
|                 inputProps={{ "aria-label": "secondary checkbox" }} |                 inputProps={{ "aria-label": "secondary checkbox" }} | ||||||
|               /> |               /> | ||||||
|  | |||||||
| @ -3,12 +3,12 @@ import PropTypes from 'prop-types'; | |||||||
| import { connect } from 'react-redux'; | import { connect } from 'react-redux'; | ||||||
| import { changeContent } from '../../../actions/tutorialBuilderActions'; | import { changeContent } from '../../../actions/tutorialBuilderActions'; | ||||||
| 
 | 
 | ||||||
| import FormGroup from '@mui/material/FormGroup'; | import FormGroup from '@material-ui/core/FormGroup'; | ||||||
| import Checkbox from '@mui/material/Checkbox'; | import Checkbox from '@material-ui/core/Checkbox'; | ||||||
| import FormControlLabel from '@mui/material/FormControlLabel'; | import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||||||
| import FormLabel from '@mui/material/FormLabel'; | import FormLabel from '@material-ui/core/FormLabel'; | ||||||
| import FormHelperText from '@mui/material/FormHelperText'; | import FormHelperText from '@material-ui/core/FormHelperText'; | ||||||
| import FormControl from '@mui/material/FormControl'; | import FormControl from '@material-ui/core/FormControl'; | ||||||
| import * as Blockly from 'blockly' | import * as Blockly from 'blockly' | ||||||
| class Requirements extends Component { | class Requirements extends Component { | ||||||
| 
 | 
 | ||||||
| @ -26,13 +26,11 @@ class Requirements extends Component { | |||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     return ( |     return ( | ||||||
|       <FormControl |       <FormControl style={{ marginBottom: '10px', padding: '18.5px 14px', borderRadius: '25px', border: '1px solid lightgrey', width: 'calc(100% - 28px)' }}> | ||||||
|         variant="standard" |  | ||||||
|         style={{ marginBottom: '10px', padding: '18.5px 14px', borderRadius: '25px', border: '1px solid lightgrey', width: 'calc(100% - 28px)' }}> |  | ||||||
|         <FormLabel style={{ color: 'black' }}>{Blockly.Msg.builder_requirements_head}</FormLabel> |         <FormLabel style={{ color: 'black' }}>{Blockly.Msg.builder_requirements_head}</FormLabel> | ||||||
|         <FormHelperText style={{ marginTop: '5px' }}>{Blockly.Msg.builder_requirements_order}</FormHelperText> |         <FormHelperText style={{ marginTop: '5px' }}>{Blockly.Msg.builder_requirements_order}</FormHelperText> | ||||||
|         <FormGroup> |         <FormGroup> | ||||||
|           {this.props.tutorials.filter(tutorial => tutorial._id !== this.props.id && tutorial.public).map((tutorial, i) => |           {this.props.tutorials.filter(tutorial => tutorial._id !== this.props.id).map((tutorial, i) => | ||||||
|             <FormControlLabel |             <FormControlLabel | ||||||
|               key={i} |               key={i} | ||||||
|               control={ |               control={ | ||||||
| @ -41,6 +39,7 @@ class Requirements extends Component { | |||||||
|                   checked={this.props.value.filter(id => id === tutorial._id).length > 0} |                   checked={this.props.value.filter(id => id === tutorial._id).length > 0} | ||||||
|                   onChange={(e) => this.onChange(e)} |                   onChange={(e) => this.onChange(e)} | ||||||
|                   name="requirements" |                   name="requirements" | ||||||
|  |                   color="primary" | ||||||
|                 /> |                 /> | ||||||
|               } |               } | ||||||
|               label={tutorial.title} |               label={tutorial.title} | ||||||
|  | |||||||
| @ -9,14 +9,14 @@ import { | |||||||
|   deleteError, |   deleteError, | ||||||
| } from "../../../actions/tutorialBuilderActions"; | } from "../../../actions/tutorialBuilderActions"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| 
 | 
 | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import Checkbox from "@mui/material/Checkbox"; | import Checkbox from "@material-ui/core/Checkbox"; | ||||||
| import FormGroup from "@mui/material/FormGroup"; | import FormGroup from "@material-ui/core/FormGroup"; | ||||||
| import FormControlLabel from "@mui/material/FormControlLabel"; | import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import FormLabel from "@mui/material/FormLabel"; | import FormLabel from "@material-ui/core/FormLabel"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   multiline: { |   multiline: { | ||||||
| @ -52,7 +52,7 @@ class Review extends Component { | |||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     return ( |     return ( | ||||||
|       <FormControl variant="standard" component="fieldset"> |       <FormControl component="fieldset"> | ||||||
|         <FormLabel component="legend"> |         <FormLabel component="legend"> | ||||||
|           {Blockly.Msg.builder_review_head} |           {Blockly.Msg.builder_review_head} | ||||||
|         </FormLabel> |         </FormLabel> | ||||||
| @ -64,6 +64,7 @@ class Review extends Component { | |||||||
|               <Checkbox |               <Checkbox | ||||||
|                 checked={this.props.value} |                 checked={this.props.value} | ||||||
|                 onChange={this.handleChange} |                 onChange={this.handleChange} | ||||||
|  |                 color="primary" | ||||||
|                 name="checkedA" |                 name="checkedA" | ||||||
|                 inputProps={{ "aria-label": "secondary checkbox" }} |                 inputProps={{ "aria-label": "secondary checkbox" }} | ||||||
|               /> |               /> | ||||||
|  | |||||||
| @ -15,10 +15,10 @@ import BlocklyExample from "./BlocklyExample"; | |||||||
| import Requirements from "./Requirements"; | import Requirements from "./Requirements"; | ||||||
| import Hardware from "./Hardware"; | import Hardware from "./Hardware"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| 
 | 
 | ||||||
| import { | import { | ||||||
|   faPlus, |   faPlus, | ||||||
| @ -85,8 +85,8 @@ class Step extends Component { | |||||||
|                 className={this.props.classes.button} |                 className={this.props.classes.button} | ||||||
|                 style={index === 0 ? {} : { marginBottom: "5px" }} |                 style={index === 0 ? {} : { marginBottom: "5px" }} | ||||||
|                 onClick={() => this.props.addStep(index + 1)} |                 onClick={() => this.props.addStep(index + 1)} | ||||||
|                 size="large"> |               > | ||||||
|                 <FontAwesomeIcon icon={faPlus}  size="xs" /> |                 <FontAwesomeIcon icon={faPlus} size="xs" /> | ||||||
|               </IconButton> |               </IconButton> | ||||||
|             </Tooltip> |             </Tooltip> | ||||||
|             {index !== 0 ? ( |             {index !== 0 ? ( | ||||||
| @ -100,8 +100,8 @@ class Step extends Component { | |||||||
|                     className={this.props.classes.button} |                     className={this.props.classes.button} | ||||||
|                     style={{ marginBottom: "5px" }} |                     style={{ marginBottom: "5px" }} | ||||||
|                     onClick={() => this.props.changeStepIndex(index, index - 1)} |                     onClick={() => this.props.changeStepIndex(index, index - 1)} | ||||||
|                     size="large"> |                   > | ||||||
|                     <FontAwesomeIcon icon={faAngleDoubleUp}  size="xs" /> |                     <FontAwesomeIcon icon={faAngleDoubleUp} size="xs" /> | ||||||
|                   </IconButton> |                   </IconButton> | ||||||
|                 </Tooltip> |                 </Tooltip> | ||||||
|                 <Tooltip |                 <Tooltip | ||||||
| @ -113,8 +113,8 @@ class Step extends Component { | |||||||
|                     className={this.props.classes.button} |                     className={this.props.classes.button} | ||||||
|                     style={{ marginBottom: "5px" }} |                     style={{ marginBottom: "5px" }} | ||||||
|                     onClick={() => this.props.changeStepIndex(index, index + 1)} |                     onClick={() => this.props.changeStepIndex(index, index + 1)} | ||||||
|                     size="large"> |                   > | ||||||
|                     <FontAwesomeIcon icon={faAngleDoubleDown}  size="xs" /> |                     <FontAwesomeIcon icon={faAngleDoubleDown} size="xs" /> | ||||||
|                   </IconButton> |                   </IconButton> | ||||||
|                 </Tooltip> |                 </Tooltip> | ||||||
|                 <Tooltip title={`Schritt ${index + 1} löschen`} arrow> |                 <Tooltip title={`Schritt ${index + 1} löschen`} arrow> | ||||||
| @ -125,8 +125,8 @@ class Step extends Component { | |||||||
|                       this.props.classes.delete |                       this.props.classes.delete | ||||||
|                     )} |                     )} | ||||||
|                     onClick={() => this.props.removeStep(index)} |                     onClick={() => this.props.removeStep(index)} | ||||||
|                     size="large"> |                   > | ||||||
|                     <FontAwesomeIcon icon={faTrash}  size="xs" /> |                     <FontAwesomeIcon icon={faTrash} size="xs" /> | ||||||
|                   </IconButton> |                   </IconButton> | ||||||
|                 </Tooltip> |                 </Tooltip> | ||||||
|               </div> |               </div> | ||||||
|  | |||||||
| @ -3,9 +3,9 @@ import PropTypes from 'prop-types'; | |||||||
| import { connect } from 'react-redux'; | import { connect } from 'react-redux'; | ||||||
| import { changeContent, deleteProperty, deleteError } from '../../../actions/tutorialBuilderActions'; | import { changeContent, deleteProperty, deleteError } from '../../../actions/tutorialBuilderActions'; | ||||||
| 
 | 
 | ||||||
| import Radio from '@mui/material/Radio'; | import Radio from '@material-ui/core/Radio'; | ||||||
| import RadioGroup from '@mui/material/RadioGroup'; | import RadioGroup from '@material-ui/core/RadioGroup'; | ||||||
| import FormControlLabel from '@mui/material/FormControlLabel'; | import FormControlLabel from '@material-ui/core/FormControlLabel'; | ||||||
| 
 | 
 | ||||||
| class StepType extends Component { | class StepType extends Component { | ||||||
| 
 | 
 | ||||||
| @ -23,14 +23,14 @@ class StepType extends Component { | |||||||
|       <RadioGroup row value={this.props.value === 'task' ? 'task' : 'instruction'} onChange={(e) => this.onChange(e.target.value)}> |       <RadioGroup row value={this.props.value === 'task' ? 'task' : 'instruction'} onChange={(e) => this.onChange(e.target.value)}> | ||||||
|         <FormControlLabel style={{color: 'black'}} |         <FormControlLabel style={{color: 'black'}} | ||||||
|           value="instruction" |           value="instruction" | ||||||
|           control={<Radio />} |           control={<Radio color="primary" />} | ||||||
|           label="Anleitung" |           label="Anleitung" | ||||||
|           labelPlacement="end" |           labelPlacement="end" | ||||||
|         /> |         /> | ||||||
|         <FormControlLabel style={{color: 'black'}} |         <FormControlLabel style={{color: 'black'}} | ||||||
|           disabled={this.props.index === 0} |           disabled={this.props.index === 0} | ||||||
|           value="task" |           value="task" | ||||||
|           control={<Radio />} |           control={<Radio color="primary" />} | ||||||
|           label="Aufgabe" |           label="Aufgabe" | ||||||
|           labelPlacement="end" |           labelPlacement="end" | ||||||
|         /> |         /> | ||||||
|  | |||||||
| @ -9,11 +9,11 @@ import { | |||||||
|   deleteError, |   deleteError, | ||||||
| } from "../../../actions/tutorialBuilderActions"; | } from "../../../actions/tutorialBuilderActions"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import OutlinedInput from "@mui/material/OutlinedInput"; | import OutlinedInput from "@material-ui/core/OutlinedInput"; | ||||||
| import InputLabel from "@mui/material/InputLabel"; | import InputLabel from "@material-ui/core/InputLabel"; | ||||||
| import FormControl from "@mui/material/FormControl"; | import FormControl from "@material-ui/core/FormControl"; | ||||||
| import FormHelperText from "@mui/material/FormHelperText"; | import FormHelperText from "@material-ui/core/FormHelperText"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   multiline: { |   multiline: { | ||||||
|  | |||||||
| @ -4,22 +4,18 @@ import Dialog from "../Dialog"; | |||||||
| 
 | 
 | ||||||
| import hardware from "../../data/hardware.json"; | import hardware from "../../data/hardware.json"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Link from "@mui/material/Link"; | import withWidth, { isWidthDown } from "@material-ui/core/withWidth"; | ||||||
| import Typography from "@mui/material/Typography"; | import Link from "@material-ui/core/Link"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import ImageList from "@mui/material/ImageList"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import ImageListItem from "@mui/material/ImageListItem"; | import ImageList from "@material-ui/core/ImageList"; | ||||||
| import ImageListItemBar from "@mui/material/ImageListItemBar"; | import ImageListItem from "@material-ui/core/ImageListItem"; | ||||||
|  | import ImageListItemBar from "@material-ui/core/ImageListItemBar"; | ||||||
| 
 | 
 | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import { faExpandAlt } from "@fortawesome/free-solid-svg-icons"; | import { faExpandAlt } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import { isWidthDown } from "../../helpers/handleBreakpoints"; |  | ||||||
| 
 |  | ||||||
| // FIXME checkout https://mui.com/components/use-media-query/#migrating-from-withwidth
 |  | ||||||
| const withWidth = () => (WrappedComponent) => (props) => <WrappedComponent {...props} width="xs" />; |  | ||||||
| 
 |  | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   expand: { |   expand: { | ||||||
|     "&:hover": { |     "&:hover": { | ||||||
| @ -55,9 +51,9 @@ class Hardware extends Component { | |||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|   render() { |   render() { | ||||||
|     var cols = isWidthDown("md", window.innerWidth) |     var cols = isWidthDown("md", this.props.width) | ||||||
|       ? isWidthDown("sm", window.innerWidth) |       ? isWidthDown("sm", this.props.width) | ||||||
|         ? isWidthDown("xs", window.innerWidth) |         ? isWidthDown("xs", this.props.width) | ||||||
|           ? 2 |           ? 2 | ||||||
|           : 3 |           : 3 | ||||||
|         : 4 |         : 4 | ||||||
| @ -97,8 +93,8 @@ class Hardware extends Component { | |||||||
|                       className={this.props.classes.expand} |                       className={this.props.classes.expand} | ||||||
|                       aria-label="Vollbild" |                       aria-label="Vollbild" | ||||||
|                       onClick={() => this.handleClickOpen(hardwareInfo)} |                       onClick={() => this.handleClickOpen(hardwareInfo)} | ||||||
|                       size="large"> |                     > | ||||||
|                       <FontAwesomeIcon icon={faExpandAlt}  size="xs" /> |                       <FontAwesomeIcon icon={faExpandAlt} size="xs" /> | ||||||
|                     </IconButton> |                     </IconButton> | ||||||
|                   } |                   } | ||||||
|                 /> |                 /> | ||||||
| @ -128,7 +124,7 @@ class Hardware extends Component { | |||||||
|               target="_blank" |               target="_blank" | ||||||
|               href={this.state.hardwareInfo.url} |               href={this.state.hardwareInfo.url} | ||||||
|               color="primary" |               color="primary" | ||||||
|               underline="hover"> |             > | ||||||
|               {Blockly.Msg.tutorials_hardware_here} |               {Blockly.Msg.tutorials_hardware_here} | ||||||
|             </Link> |             </Link> | ||||||
|             . |             . | ||||||
|  | |||||||
| @ -3,9 +3,9 @@ import PropTypes from "prop-types"; | |||||||
| import { connect } from "react-redux"; | import { connect } from "react-redux"; | ||||||
| import Dialog from "../Dialog"; | import Dialog from "../Dialog"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Checkbox from "@mui/material/Checkbox"; | import Checkbox from "@material-ui/core/Checkbox"; | ||||||
| import FormControlLabel from "@mui/material/FormControlLabel"; | import FormControlLabel from "@material-ui/core/FormControlLabel"; | ||||||
| import * as Blockly from "blockly"; | import * as Blockly from "blockly"; | ||||||
| import ReactMarkdown from "react-markdown"; | import ReactMarkdown from "react-markdown"; | ||||||
| 
 | 
 | ||||||
| @ -78,6 +78,7 @@ class HintTutorialExists extends Component { | |||||||
|               checked={this.state.checked} |               checked={this.state.checked} | ||||||
|               onChange={(e) => this.onChange(e)} |               onChange={(e) => this.onChange(e)} | ||||||
|               name="dialog" |               name="dialog" | ||||||
|  |               color="primary" | ||||||
|             /> |             /> | ||||||
|           } |           } | ||||||
|           label={Blockly.Msg.labels_donotshowagain} |           label={Blockly.Msg.labels_donotshowagain} | ||||||
|  | |||||||
| @ -4,8 +4,8 @@ import Hardware from "./Hardware"; | |||||||
| import Requirement from "./Requirement"; | import Requirement from "./Requirement"; | ||||||
| import BlocklyWindow from "../Blockly/BlocklyWindow"; | import BlocklyWindow from "../Blockly/BlocklyWindow"; | ||||||
| 
 | 
 | ||||||
| import Grid from "@mui/material/Grid"; | import Grid from "@material-ui/core/Grid"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import ReactMarkdown from "react-markdown"; | import ReactMarkdown from "react-markdown"; | ||||||
| import remarkGfm from "remark-gfm"; | import remarkGfm from "remark-gfm"; | ||||||
| import remarkGemoji from "remark-gemoji"; | import remarkGemoji from "remark-gemoji"; | ||||||
|  | |||||||
| @ -4,11 +4,11 @@ import { connect } from "react-redux"; | |||||||
| 
 | 
 | ||||||
| import clsx from "clsx"; | import clsx from "clsx"; | ||||||
| import { withRouter, Link } from "react-router-dom"; | import { withRouter, Link } from "react-router-dom"; | ||||||
| import { alpha } from "@mui/material/styles"; | import { alpha } from "@material-ui/core/styles"; | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import List from "@mui/material/List"; | import List from "@material-ui/core/List"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| 
 | 
 | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons"; | import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons"; | ||||||
| @ -166,7 +166,6 @@ class Requirement extends Component { | |||||||
|                             icon={ |                             icon={ | ||||||
|                               tutorialStatus === "Success" ? faCheck : faTimes |                               tutorialStatus === "Success" ? faCheck : faTimes | ||||||
|                             } |                             } | ||||||
|                              |  | ||||||
|                           /> |                           /> | ||||||
|                         ) : ( |                         ) : ( | ||||||
|                           <Typography |                           <Typography | ||||||
|  | |||||||
| @ -10,10 +10,10 @@ import Dialog from "../Dialog"; | |||||||
| 
 | 
 | ||||||
| import { checkXml } from "../../helpers/compareXml"; | import { checkXml } from "../../helpers/compareXml"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import IconButton from "@mui/material/IconButton"; | import IconButton from "@material-ui/core/IconButton"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| 
 | 
 | ||||||
| import { faClipboardCheck } from "@fortawesome/free-solid-svg-icons"; | import { faClipboardCheck } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| @ -62,8 +62,8 @@ class SolutionCheck extends Component { | |||||||
|             className={`solutionCheck ${this.props.classes.compile}`} |             className={`solutionCheck ${this.props.classes.compile}`} | ||||||
|             style={{ width: "40px", height: "40px", marginRight: "5px" }} |             style={{ width: "40px", height: "40px", marginRight: "5px" }} | ||||||
|             onClick={() => this.check()} |             onClick={() => this.check()} | ||||||
|             size="large"> |           > | ||||||
|             <FontAwesomeIcon icon={faClipboardCheck}  size="xs" /> |             <FontAwesomeIcon icon={faClipboardCheck} size="xs" /> | ||||||
|           </IconButton> |           </IconButton> | ||||||
|         </Tooltip> |         </Tooltip> | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -7,12 +7,12 @@ import { withRouter } from "react-router-dom"; | |||||||
| import clsx from "clsx"; | import clsx from "clsx"; | ||||||
| 
 | 
 | ||||||
| // import tutorials from '../../data/tutorials';
 | // import tutorials from '../../data/tutorials';
 | ||||||
| import { alpha } from "@mui/material/styles"; | import { alpha } from "@material-ui/core/styles"; | ||||||
| 
 | 
 | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Typography from "@mui/material/Typography"; | import Typography from "@material-ui/core/Typography"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| import Button from "@mui/material/Button"; | import Button from "@material-ui/core/Button"; | ||||||
| 
 | 
 | ||||||
| import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons"; | import { faCheck, faTimes } from "@fortawesome/free-solid-svg-icons"; | ||||||
| import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | ||||||
| @ -127,7 +127,6 @@ class StepperHorizontal extends Component { | |||||||
|                   <FontAwesomeIcon |                   <FontAwesomeIcon | ||||||
|                     className={this.props.classes.icon} |                     className={this.props.classes.icon} | ||||||
|                     icon={tutorialStatus === "Success" ? faCheck : faTimes} |                     icon={tutorialStatus === "Success" ? faCheck : faTimes} | ||||||
|                      |  | ||||||
|                   /> |                   /> | ||||||
|                 </div> |                 </div> | ||||||
|               ) : null} |               ) : null} | ||||||
|  | |||||||
| @ -6,12 +6,12 @@ import { tutorialStep } from "../../actions/tutorialActions"; | |||||||
| import { withRouter } from "react-router-dom"; | import { withRouter } from "react-router-dom"; | ||||||
| 
 | 
 | ||||||
| import clsx from "clsx"; | import clsx from "clsx"; | ||||||
| import { alpha } from "@mui/material/styles"; | import { alpha } from "@material-ui/core/styles"; | ||||||
| import withStyles from '@mui/styles/withStyles'; | import { withStyles } from "@material-ui/core/styles"; | ||||||
| import Stepper from "@mui/material/Stepper"; | import Stepper from "@material-ui/core/Stepper"; | ||||||
| import Step from "@mui/material/Step"; | import Step from "@material-ui/core/Step"; | ||||||
| import StepLabel from "@mui/material/StepLabel"; | import StepLabel from "@material-ui/core/StepLabel"; | ||||||
| import Tooltip from "@mui/material/Tooltip"; | import Tooltip from "@material-ui/core/Tooltip"; | ||||||
| 
 | 
 | ||||||
| const styles = (theme) => ({ | const styles = (theme) => ({ | ||||||
|   verticalStepper: { |   verticalStepper: { | ||||||
| @ -23,12 +23,13 @@ const styles = (theme) => ({ | |||||||
|     // borderWidth: '2px',
 |     // borderWidth: '2px',
 | ||||||
|     borderRadius: "50%", |     borderRadius: "50%", | ||||||
|     borderColor: theme.palette.secondary.main, |     borderColor: theme.palette.secondary.main, | ||||||
|     width: "1rem", |     width: "12px", | ||||||
|  |     height: "12px", | ||||||
|     margin: "0 auto", |     margin: "0 auto", | ||||||
|   }, |   }, | ||||||
|   stepIconLarge: { |   stepIconLarge: { | ||||||
|     width: "2rem", |     width: "24px", | ||||||
|     height: "1rem", |     height: "24px", | ||||||
|   }, |   }, | ||||||
|   stepIconLargeSuccess: { |   stepIconLargeSuccess: { | ||||||
|     borderColor: theme.palette.primary.main, |     borderColor: theme.palette.primary.main, | ||||||
|  | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user