diff --git a/.gitignore b/.gitignore index 273210c..f0c13ca 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ npm-debug.log* yarn-debug.log* yarn-error.log* package-lock.json -package-lock.json + diff --git a/src/components/Blockly/msg/de/ui.js b/src/components/Blockly/msg/de/ui.js index e521766..bd2e96b 100644 --- a/src/components/Blockly/msg/de/ui.js +++ b/src/components/Blockly/msg/de/ui.js @@ -288,4 +288,17 @@ export const UI = { drawer_ideerror_head: "Hoppla da ist was schief gegangen.", drawer_ideerror_text: "Beim kompilieren ist ein Fehler aufgetreten, überprüfe deine Blöcke.", + + /** + * Code Editor + * */ + codeeditor_libraries_head: "Installierte Arduino Libraries", + codeeditor_libraries_text: + "Für die Dokumentation sehen Sie sich die installierten Bibliotheken und deren Beispiele an", + codeeditor_save_code: "Code herunterladen", + codeeditor_open_code: "Code öffnen", + codeeditor_reset_code: "Code zurücksetzen", + codeeditor_blockly_code: "Lade Blockly Code", + codeeditor_compile_progress: + "Dein Code wird nun kompiliert und anschließend auf deinen Computer heruntergeladen", }; diff --git a/src/components/Blockly/msg/en/ui.js b/src/components/Blockly/msg/en/ui.js index 2a70562..fc49196 100644 --- a/src/components/Blockly/msg/en/ui.js +++ b/src/components/Blockly/msg/en/ui.js @@ -283,4 +283,17 @@ export const UI = { */ drawer_ideerror_head: "Oops something went wrong", drawer_ideerror_text: "An error occurred while compiling, check your blocks", + + /** + * Code Editor + * */ + codeeditor_libraries_head: "Installed Arduino Libraries", + codeeditor_libraries_text: + "For documentation, view the installed libraries and their examples", + codeeditor_save_code: "Download code", + codeeditor_open_code: "Open code", + codeeditor_reset_code: "Reset code", + codeeditor_blockly_code: "Load blockly code", + codeeditor_compile_progress: + "Your code will now be compiled and then downloaded to your computer", }; diff --git a/src/components/CodeEditor/CodeEditor.js b/src/components/CodeEditor/CodeEditor.js index ff33ab4..56d701f 100644 --- a/src/components/CodeEditor/CodeEditor.js +++ b/src/components/CodeEditor/CodeEditor.js @@ -177,15 +177,15 @@ void loop() { localStorage.getItem("ArduinoCode") ? localStorage.getItem("ArduinoCode") : ` - #include //needs to be always included +#include //needs to be always included - void setup () { +void setup () { - } +} - void loop() { +void loop() { - }` +}` } value={fileContent} onMount={(editor, monaco) => { @@ -208,7 +208,7 @@ void loop() { color="primary" onClick={() => saveIno()} > - Save Code + {Blockly.Msg.codeeditor_save_code} -
- Dein Code wird nun kompiliert und anschließend auf deinen Computer - heruntergeladen -
+
{Blockly.Msg.codeeditor_compile_progress}
{" "} { const [alert, setAlert] = React.useState(false); - const [examples, setExamples] = React.useState([]); - + //const [examples, setExamples] = React.useState([]); const user = useSelector((state) => state.auth.user); - - const monaco = useMonaco(); - const loadCode = (code) => { - monaco.editor.getModels()[0].setValue(code); - }; + // useEffect(() => { + // axios + // .get("https://coelho.opensensemap.org/items/blocklysamples") + // .then((res) => { + // setExamples(res.data.data); + // }); + // }, []); + //const monaco = useMonaco(); + // const loadCode = (code) => { + // monaco.editor.getModels()[0].setValue(code); + // }; const toggleDialog = () => { setAlert(false); @@ -113,7 +118,7 @@ const Sidebar = () => { aria-controls="panel2a-content" id="panel2a-header" > - Installierte Libraries + {Blockly.Msg.codeeditor_libraries_head} { -

- For Dokumentation take a look at the installed libraries and their - source -

+

{Blockly.Msg.codeeditor_libraries_text}

{LibraryVersions().map((object, i) => { return (

diff --git a/src/data/versions.js b/src/data/versions.js index 77f7651..984ede6 100644 --- a/src/data/versions.js +++ b/src/data/versions.js @@ -1,102 +1,151 @@ export const LibraryVersions = () => { return [ { - version: "1.4.2", - library: "sensebox/SenseBoxMCU-Lib", - link: "https://github.com/sensebox/SenseBoxMCU-Lib", + library: "SSD1306 Plot Library", + link: "https://github.com/sensebox/SSD1306-Plot-Library/", }, { - version: "1.0.12", - library: "sparkfun/SparkFun_SCD30_Arduino_Library", - }, - { version: "1.2.3", library: "adafruit/Adafruit-GFX-Library" }, - { - version: "2.1.2", - library: "adafruit/Adafruit_BME280_Library", + library: "SDS011 Library", + link: "https://github.com/sensebox/SDS011-select-serial/", }, { - version: "2.1.0", - library: "adafruit/Adafruit_BMP280_Library", + library: "RV8523 Arduino Library", + link: "https://github.com/sensebox/RV8523-RTC-Arduino-Library", }, { - version: "1.1.1", - library: "adafruit/Adafruit_BME680", + library: "BMX055_Library", + link: "https://github.com/sensebox/BMX055-Arduino-Library/", }, { - version: "2.0.1", - library: "adafruit/Adafruit_BMP3XX", + library: "LTR329", + link: "https://github.com/sensebox/LTR329-Lightsensor-Arduino-Library/", }, { - version: "2.0.0", - library: "adafruit/Adafruit_HDC1000_Library", + library: "VEML6070", + link: "https://github.com/sensebox/VEML6070-UV-Arduino-Library/", }, { - version: "1.7.1", - library: "adafruit/Adafruit_BusIO", + library: "senseBox Web Library", + link: "https://github.com/sensebox/sensebox-libweb/", }, { - version: "1.0.6", - library: "adafruit/Adafruit_NeoPixel", + library: "Arduino WiFi101", + link: "https://github.com/arduino-libraries/WiFi101", }, { - version: "1.1.2", - library: "adafruit/Adafruit_SSD1306", + library: "Ethernet", + link: "https://github.com/arduino-libraries/Ethernet", }, { - version: "1.0.2", - library: "adafruit/Adafruit_Sensor", + library: "ArduinoJson", + link: "https://github.com/bblanchon/ArduinoJson", }, { - version: "3.8.0", - library: "milesburton/Arduino-Temperature-Control-Library", + library: "Adafruit Sensor Library", + link: "https://github.com/adafruit/Adafruit_Sensor", }, { - version: "1.5.0", - library: "arduino-libraries/ArduinoBearSSL", + library: "Adafruit HDC1000 Library", + link: "https://github.com/adafruit/Adafruit_HDC1000_Library", }, { - version: "1.3.4", - library: "arduino-libraries/ArduinoECCX08", + library: "Adafruit BME280 Library", + link: "https://github.com/adafruit/Adafruit_BME280_Library", }, { - version: "2.0.0", - library: "arduino-libraries/ArduinoECCX08", //todo + library: "Adafruit BMP280 Library", + link: "https://github.com/adafruit/Adafruit_BMP280_Library", }, { - version: "0.7.1", - library: "cmaglie/FlashStorage", + library: "Adafruit BME680 Library", + link: "https://github.com/adafruit/Adafruit_BME680", }, { - version: "1.5.1", - library: "matthijskooijman/arduino-lmic", + library: "Adafruit DPS310", + link: "https://github.com/adafruit/Adafruit_DPS310", }, { - version: "3.0.1", - library: "thesolarnomad/lora-serialization ", + library: "Adafruit NeoPixel", + link: "https://github.com/adafruit/Adafruit_NeoPixel", }, { - version: "todo", - library: "TSL45xxx", + library: "Adafruit SSD1306", + link: "https://github.com/adafruit/Adafruit_SSD1306", }, { - version: "2.3.4", - library: "teensy/td_libs_OneWire.html", + library: "Adafruit GFX Library", + link: "https://github.com/adafruit/Adafruit-GFX-Library", }, { - version: "1.0.0", - library: "watterott/Arduino-Libs/tree/master/RV8523", + library: "Adafruit MQTT Library", + link: "https://github.com/adafruit/Adafruit_MQTT_Library", }, { - version: "1.0.0", - library: "sensebox/SDS011-select-serial ", + library: "Adafruit BusIO", + link: "https://github.com/adafruit/Adafruit_BusIO", }, { - version: "1.0.0", - library: "Lucas-Steinmann/SSD1306-Plot-Library", + library: "Adafruit SleepyDog Library", + link: "https://github.com/adafruit/Adafruit_SleepyDog", }, { - version: "1.0.0", - library: "senseBoxIO", + library: "DallasTemperature", + link: "https://github.com/milesburton/Arduino-Temperature-Control-Library", + }, + { + library: "ArduinoBearSSL", + link: "https://github.com/arduino-libraries/ArduinoBearSSL", + }, + { + library: "ArduinoECCX08", + link: "https://github.com/arduino-libraries/ArduinoECCX08", + }, + { + library: "SparkFun SCD30 Arduino Library", + link: "https://github.com/sparkfun/SparkFun_SCD30_Arduino_Library", + }, + { + library: "SparkFun u-blox GNSS Arduino Library", + link: "https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library", + }, + { + library: "NewPing", + link: "https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home", + }, + { + library: "IBM LMIC framework", + link: "https://github.com/matthijskooijman/arduino-lmic", + }, + { + library: "LoRa Serialization", + link: "https://github.com/thesolarnomad/lora-serialization", + }, + { + library: "CayenneLPP", + link: "https://github.com/ElectronicCats/CayenneLPP", + }, + { library: "OneWire", link: "https://github.com/PaulStoffregen/OneWire" }, + { + library: "Nova Fitness Sds dust sensors library", + link: "https://github.com/lewapek/sds-dust-sensors-arduino-library", + }, + { library: "JC_Button", link: "https://github.com/JChristensen/JC_Button" }, + { library: "SD", link: "https://github.com/arduino-libraries/SD" }, + { + library: "BSEC Software Library", + link: "https://github.com/BoschSensortec/BSEC-Arduino-library", + }, + { + library: "TheThingsNetwork", + link: "https://github.com/TheThingsNetwork/arduino-device-lib", + }, + { + library: "NTPClient", + link: "https://github.com/arduino-libraries/NTPClient", + }, + { + library: "phyphox BLE", + link: "https://github.com/phyphox/phyphox-arduino", }, ]; };