Skip to content

Commit 74502b4

Browse files
committed
Added some documentation
1 parent 34ca329 commit 74502b4

5 files changed

Lines changed: 11 additions & 13 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ It comes with the hardware schematics, production files and the Megahub firmware
5050
- **Cost-effective**: Based on affordable ESP32 hardware
5151
- **Visual Programming**: Blockly support makes it accessible for all skill levels
5252

53-
## Hardware Photos
53+
## WebUI Screenshots
5454

55-
![Ordered PCB prototype](docs/pcb_iteration1.jpg)
55+
![Project Management](docs/screenshot_ide.jpg)
5656

57-
![Assembled prototype](docs/prototype_iteration1.jpg)
57+
![Example Project](docs/screenshot_project.jpg)
5858

59-
## WebUI Screenshots
59+
## Hardware Photos
6060

61-
_Screenshots of the WebUI in action will be added here_
61+
![Assembled prototype](docs/prototype_iteration1.jpg)
6262

6363
## Getting Started
6464

docs/prototype_iteration1.jpg

154 KB
Loading

docs/screenshot_ide.png

226 KB
Loading

docs/screenshot_prioject.png

440 KB
Loading

frontend/src/project.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,10 @@ document.getElementById("stop").addEventListener("click", () => {
8686
const STRORAGE_KEY = 'blockly_robot_workspace';
8787

8888
// Workspace als XML speichern
89-
function saveToLocalStorage(key) {
89+
function saveWorkspace() {
9090
try {
9191
const xmlText = blocklyEditor.generateXML();
9292

93-
localStorage.setItem(key, xmlText);
94-
console.log('Workspace saved to localStorage, sending backup to backend');
95-
9693
if (!import.meta.env.DEV) {
9794
// Write model to backend
9895
fetch("model.xml", {
@@ -118,6 +115,9 @@ function saveToLocalStorage(key) {
118115
.then((response) => {
119116
console.log("Got response from backend : " + JSON.stringify(response));
120117
});
118+
} else {
119+
localStorage.setItem(STRORAGE_KEY, xmlText);
120+
console.log('Workspace saved to localStorage, sending backup to backend');
121121
}
122122

123123
return true;
@@ -127,7 +127,6 @@ function saveToLocalStorage(key) {
127127
}
128128
};
129129

130-
// Workspace aus LocalStorage laden
131130
function loadFromLocalStorage(key) {
132131
try {
133132
console.info("Trying to load from localStorage");
@@ -157,7 +156,7 @@ document.addEventListener('DOMContentLoaded', () => {
157156

158157
// Enable autp save every 10 seconds
159158
setInterval(() => {
160-
saveToLocalStorage(STRORAGE_KEY);
159+
saveWorkspace();
161160
}, 10000);
162161

163162
portstatus.initialize();
@@ -168,8 +167,7 @@ document.addEventListener('DOMContentLoaded', () => {
168167
.then((response) => response.text())
169168
.then((text) => {
170169
if (!blocklyEditor.loadXML(text)) {
171-
// Load last known workspace version
172-
loadFromLocalStorage(STRORAGE_KEY);
170+
console.log("Error loading workspace! Blockly failed to parse?");
173171
}
174172
})
175173
.catch((error) => {

0 commit comments

Comments
 (0)