Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9974f42
add: page for sensebox basic
Sep 3, 2025
ec2e1c7
add: blockly view for pseudocode
Sep 3, 2025
c20aa9e
add: basic theme
Sep 4, 2025
36efb82
build(deps): bump @fortawesome/react-fontawesome from 0.2.3 to 0.2.6
dependabot[bot] Aug 25, 2025
38c4edd
build(deps-dev): bump vite from 6.3.5 to 7.1.3
dependabot[bot] Aug 25, 2025
ba04a02
build(deps): bump react-cookie-consent from 7.6.0 to 9.0.0
dependabot[bot] Aug 25, 2025
9bbef73
build(deps-dev): bump cypress from 14.5.3 to 15.1.0
dependabot[bot] Sep 8, 2025
60ee9ee
build(deps): bump blockly from 12.2.0 to 12.3.0
dependabot[bot] Sep 8, 2025
612932f
build(deps): bump markdown-it from 12.3.2 to 14.1.0
dependabot[bot] Sep 9, 2025
d606bdf
modernize: blockly main components
Sep 11, 2025
df53dfc
remove some unused code blocks
Sep 11, 2025
ba0a6a8
remove unused blocks
Sep 11, 2025
933f831
feat: changed the 3rd step of compilation dialog
Sep 10, 2025
3151257
fix: remove testing env
Sep 10, 2025
79b63ff
feat: add filename to dialog
Sep 11, 2025
982c7b6
revert: testing env
Sep 11, 2025
941b4e2
Merge branch 'development' into add/basic
Thiemann96 Sep 11, 2025
cafdcdf
fix: import error
Sep 11, 2025
5deff3f
feat: different toolbox is loaded on /basic
Sep 11, 2025
22d03c8
remove: excessive stylesheets
Sep 11, 2025
bb67999
Merge remote-tracking branch 'origin/development' into add/basic
Sep 12, 2025
ce6d7be
style: some toolbox style for basic
Sep 12, 2025
fca3549
add: new connect wizzard
Sep 12, 2025
af721a9
styles: styles for basic page
Sep 12, 2025
daa98f7
styles: toolbox width
Sep 16, 2025
d4b785d
styles: some styling issues on basic page
Sep 16, 2025
d600955
add: finish connect wizzard
Sep 16, 2025
57a8c4a
fix: onconnect
Sep 16, 2025
15398a9
styes: updtaed icons
Sep 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#4EAF47" />
<link rel="apple-touch-icon" href="/logo192.png" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css"
/>
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
Expand Down
Binary file added public/media/blockly/blueLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/media/blockly/led_blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/media/blockly/led_off.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/media/blockly/led_red.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/media/blockly/led_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/media/blockly/redLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/media/blockly/yellowLed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ td {
align-items: center;
}

:root {
--url: url("./data/mcu_opacity.png");
}

.blocklySvg {
background-image: var(--url);
background-position: center;
Expand Down
3 changes: 3 additions & 0 deletions src/actions/boardAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export const setBoard = (board) => (dispatch) => {
window.sessionStorage.setItem("board", board);
setBoardHelper(board);
const root = document.querySelector(":root");
if (window.location.pathname === "/basic") {
return;
}
switch (board) {
case "MCU":
root.style.setProperty("--url", `url(${mcu_opacity})`);
Expand Down
1 change: 1 addition & 0 deletions src/actions/workspaceActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const onChangeCode = () => (dispatch, getState) => {
const workspace = Blockly.getMainWorkspace();
var code = getState().workspace.code;
code.arduino = Blockly.Generator.Arduino.workspaceToCode(workspace);
code.basic = Blockly.Generator.Basic.workspaceToCode(workspace);
var xmlDom = Blockly.Xml.workspaceToDom(workspace);
var board = getState().board.board;
xmlDom.setAttribute("board", board);
Expand Down
3 changes: 2 additions & 1 deletion src/components/Blockly/BlocklyComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import PropTypes from "prop-types";

import * as Blockly from "blockly/core";
import "./blocks/index";
import "@/components/Blockly/generator/index";
import "@/components/Blockly/generator/arduino/index";
import "@/components/Blockly/generator/basic/index";

import Toolbox from "./toolbox/Toolbox";
import { reservedWords } from "./helpers/reservedWords";
Expand Down
4 changes: 3 additions & 1 deletion src/components/Blockly/BlocklyWindow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import PropTypes from "prop-types";

import * as Blockly from "blockly/core";
import "./blocks/index";
import "@/components/Blockly/generator/index";
import "@/components/Blockly/generator/basic/index";
import "@/components/Blockly/generator/arduino/index";
import "@/components/Blockly/generator/basic/index";

import { onChangeWorkspace, clearStats } from "../../actions/workspaceActions";
import { ZoomToFitControl } from "@blockly/zoom-to-fit";
Expand Down
169 changes: 169 additions & 0 deletions src/components/Blockly/blocks/basic/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
import * as Blockly from "blockly/core";
import { getColour } from "../../helpers/colour";

Blockly.defineBlocksWithJsonArray([
{
type: "basic_display",
message0: "Zeige auf dem Display %1",
args0: [{ type: "field_input", name: "value", text: "Text" }],
previousStatement: true,
nextStatement: null,
colour: 230,
},
]);

Blockly.defineBlocksWithJsonArray([
{
type: "basic_red",
message0: "%1",
args0: [
{
type: "field_image",
src: "./media/blockly/led_red.png",
width: 50,
height: 50,
alt: "*",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().sensebox,
},
{
type: "basic_yellow",
message0: "%1",
args0: [
{
type: "field_image",
src: "./media/blockly/led_yellow.png",
width: 50,
height: 50,
alt: "*",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().sensebox,
},
{
type: "basic_blue",
message0: "%1",
args0: [
{
type: "field_image",
src: "./media/blockly/led_blue.png",
width: 50,
height: 50,
alt: "*",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().sensebox,
},
{
type: "basic_off",
message0: "%1",
args0: [
{
type: "field_image",
src: "./media/blockly/led_off.png",
width: 50,
height: 50,
alt: "*",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().sensebox,
},
]);

Blockly.defineBlocksWithJsonArray([
{
type: "time_delay_1s",
message0: "%1 %2",
args0: [
{
type: "field_image",
src: "https://cdn-icons-png.flaticon.com/512/31/31048.png",
width: 30,
height: 30,
},
{
type: "field_label",
name: "DELAY_TIME_1S",
text: "1",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().time,
helpUrl: "http://arduino.cc/en/Reference/Delay",
},
{
type: "time_delay_2s",
message0: "%1 %2",
args0: [
{
type: "field_image",
src: "https://cdn-icons-png.flaticon.com/512/31/31048.png",
width: 30,
height: 30,
},
{
type: "field_label",
name: "DELAY_TIME_2S",
text: "2",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().time,
helpUrl: "http://arduino.cc/en/Reference/Delay",
},
{
type: "time_delay_5s",
message0: "%1 %2",
args0: [
{
type: "field_image",
src: "https://cdn-icons-png.flaticon.com/512/31/31048.png",
width: 30,
height: 30,
},
{
type: "field_label",
name: "DELAY_TIME_5S",
text: "5",
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().time,
helpUrl: "http://arduino.cc/en/Reference/Delay",
},
]);

Blockly.defineBlocksWithJsonArray([
{
type: "display_print_basic",
message0: "%1 %2",
args0: [
{
type: "field_image",
src: "https://cdn-icons-png.flaticon.com/512/833/833313.png",
width: 30,
height: 30,
},
{
type: "input_value",
name: "inside",
check: null,
},
],
previousStatement: null,
nextStatement: null,
colour: getColour().sensebox,
},
]);
64 changes: 64 additions & 0 deletions src/components/Blockly/generator/arduino/basic_dummies.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import * as Blockly from "blockly/core";

Blockly.Generator.Arduino.forBlock["basic_display"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["basic_red"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["basic_blue"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["basic_yellow"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["basic_off"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["time_delay_1s"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["time_delay_2s"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["time_delay_5s"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};

Blockly.Generator.Arduino.forBlock["display_print_basic"] = function (
_block,
_generator,
) {
return ""; // nichts generieren
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
// https://developers.google.com/blockly/guides/create-custom-blocks/generating-code

import * as Blockly from "blockly/core";
import { reservedWords } from "../helpers/reservedWords";
import { reservedWords } from "../../helpers/reservedWords";

import store from "../../../store";
import store from "@/store";

var ota = store.getState().general.platform
? store.getState().general.platform
Expand Down Expand Up @@ -92,6 +92,7 @@ Blockly.Generator.Arduino.ORDER_NONE = 99; // (...)
*/
Blockly.Generator.Arduino.init = function (workspace) {
// Create a dictionary of definitions to be printed before the code.

Blockly.Generator.Arduino.libraries_ = Object.create(null);

Blockly.Generator.Arduino.definitions_ = Object.create(null);
Expand Down Expand Up @@ -369,6 +370,7 @@ Blockly.Generator.Arduino.quote_ = function (string) {

Blockly.Generator.Arduino.scrub_ = function (block, code) {
let commentCode = "";

// Only collect comments for blocks that aren't inline.
if (!block.outputConnection || !block.outputConnection.targetConnection) {
// Collect comment for this block.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ import "./lists";
import "./watchdog";
import "./webserver";
import "./fluoroASM";
import "./basic_dummies";
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Blockly from "blockly";
import { selectedBoard } from "../helpers/board";
import { selectedBoard } from "../../helpers/board";

/**
* HDC1080 Temperature and Humidity Sensor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as Blockly from "blockly";
import { selectedBoard } from "../helpers/board";
import { selectedBoard } from "../../helpers/board";

/**
* Solar Charger (SB-041)
Expand Down
Loading
Loading