add cayenne concentration block
This commit is contained in:
		
							parent
							
								
									514680252b
								
							
						
					
					
						commit
						e44cab49fb
					
				| @ -158,7 +158,7 @@ Blockly.Blocks["sensebox_lora_ttn_mapper"] = { | |||||||
|     this.appendValueInput("Fix Type").appendField("Fix Type").setCheck(null); |     this.appendValueInput("Fix Type").appendField("Fix Type").setCheck(null); | ||||||
|     this.setPreviousStatement(true, null); |     this.setPreviousStatement(true, null); | ||||||
|     this.setNextStatement(true, null); |     this.setNextStatement(true, null); | ||||||
|     this.setTooltip(Blockly.Msg.senseBox_display_printDisplay_tip); |     this.setTooltip(Blockly.Msg.sensebox_lora_ttn_mapper_tip); | ||||||
|   }, |   }, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| @ -299,3 +299,21 @@ Blockly.Blocks["sensebox_lora_cayenne_gps"] = { | |||||||
|   }, |   }, | ||||||
|   LOOP_TYPES: ["sensebox_lora_cayenne_send"], |   LOOP_TYPES: ["sensebox_lora_cayenne_send"], | ||||||
| }; | }; | ||||||
|  | 
 | ||||||
|  | Blockly.Blocks["sensebox_lora_cayenne_concentration"] = { | ||||||
|  |   init: function () { | ||||||
|  |     this.setTooltip(Blockly.Msg.senseBox_LoRa_cayenne_concentration_tip); | ||||||
|  |     this.setHelpUrl(""); | ||||||
|  |     this.setColour(getColour().sensebox); | ||||||
|  |     this.appendValueInput("Value").appendField( | ||||||
|  |       Blockly.Msg.senseBox_LoRa_cayenne_concentration | ||||||
|  |     ); | ||||||
|  |     this.appendDummyInput() | ||||||
|  |       .setAlign(Blockly.ALIGN_LEFT) | ||||||
|  |       .appendField(Blockly.Msg.senseBox_LoRa_cayenne_channel) | ||||||
|  |       .appendField(new Blockly.FieldTextInput("1"), "CHANNEL"); | ||||||
|  |     this.setPreviousStatement(true, null); | ||||||
|  |     this.setNextStatement(true, null); | ||||||
|  |   }, | ||||||
|  |   LOOP_TYPES: ["sensebox_lora_cayenne_send"], | ||||||
|  | }; | ||||||
|  | |||||||
| @ -523,3 +523,12 @@ Blockly.Arduino.sensebox_lora_cayenne_gps = function (block) { | |||||||
|   var code = `lpp.addGPS(${channel}, ${lat}, ${lng}, ${alt});\n`; |   var code = `lpp.addGPS(${channel}, ${lat}, ${lng}, ${alt});\n`; | ||||||
|   return code; |   return code; | ||||||
| }; | }; | ||||||
|  | 
 | ||||||
|  | Blockly.Arduino.sensebox_lora_cayenne_concentration = function (block) { | ||||||
|  |   var value = | ||||||
|  |     Blockly.Arduino.valueToCode(this, "Value", Blockly.Arduino.ORDER_ATOMIC) || | ||||||
|  |     0; | ||||||
|  |   var channel = this.getFieldValue("CHANNEL"); | ||||||
|  |   var code = `lpp.addConcentration(${channel}, ${value});\n`; | ||||||
|  |   return code; | ||||||
|  | }; | ||||||
|  | |||||||
| @ -1,44 +1,57 @@ | |||||||
| export const LORA = { | export const LORA = { | ||||||
|     /* |   /* | ||||||
|      * LoRa Blöcke |    * LoRa Blöcke | ||||||
|      */ |    */ | ||||||
| 
 | 
 | ||||||
|     senseBox_LoRa_connect: "Zu TTN senden", |   senseBox_LoRa_connect: "Zu TTN senden", | ||||||
|     senseBox_LoRa_device_id: "Device EUI (lsb)", |   senseBox_LoRa_device_id: "Device EUI (lsb)", | ||||||
|     senseBox_LoRa_app_id: "Application EUI (lsb)", |   senseBox_LoRa_app_id: "Application EUI (lsb)", | ||||||
|     senseBox_LoRa_app_key: "App Key (msb)", |   senseBox_LoRa_app_key: "App Key (msb)", | ||||||
|     senseBox_LoRa_nwskey_id: "Network Session Key (msb)", |   senseBox_LoRa_nwskey_id: "Network Session Key (msb)", | ||||||
|     senseBox_LoRa_appskey_id: "App Session Key (msb)", |   senseBox_LoRa_appskey_id: "App Session Key (msb)", | ||||||
|     senseBox_LoRa_devaddr_id: "Device Adress", |   senseBox_LoRa_devaddr_id: "Device Adress", | ||||||
|     senseBox_LoRa_interval: "Intervall in Minuten", |   senseBox_LoRa_interval: "Intervall in Minuten", | ||||||
|     senseBox_measurement: "Messung", |   senseBox_measurement: "Messung", | ||||||
|     senseBox_measurements: "Messungen", |   senseBox_measurements: "Messungen", | ||||||
| 
 | 
 | ||||||
|     senseBox_LoRa_send_message: "Sende als Lora Nachricht", |   senseBox_LoRa_send_message: "Sende als Lora Nachricht", | ||||||
|     senseBox_LoRa_send_cayenne: "Sende als Cayenne Nachricht", |   senseBox_LoRa_send_cayenne: "Sende als Cayenne Nachricht", | ||||||
|     senseBox_LoRa_cayenne_temperature: "Temperatur", |   senseBox_LoRa_cayenne_temperature: "Temperatur", | ||||||
|     senseBox_LoRa_cayenne_channel: "Kanal", |   senseBox_LoRa_cayenne_channel: "Kanal", | ||||||
|     senseBox_LoRa_cayenne_humidity: "Luftfeuchtigkeit", |   senseBox_LoRa_cayenne_humidity: "Luftfeuchtigkeit", | ||||||
|     senseBox_LoRa_cayenne_pressure: "Luftdruck", |   senseBox_LoRa_cayenne_pressure: "Luftdruck", | ||||||
|     senseBox_LoRa_cayenne_luminosity: "Helligkeit", |   senseBox_LoRa_cayenne_luminosity: "Helligkeit", | ||||||
|     senseBox_LoRa_cayenne_analog: "Analoger Wert", |   senseBox_LoRa_cayenne_analog: "Analoger Wert", | ||||||
|     senseBox_LoRa_cayenne_x: "X Wert", |   senseBox_LoRa_cayenne_x: "X Wert", | ||||||
|     senseBox_LoRa_cayenne_y: "Y Wert", |   senseBox_LoRa_cayenne_y: "Y Wert", | ||||||
|     senseBox_LoRa_cayenne_z: "Z Wert", |   senseBox_LoRa_cayenne_z: "Z Wert", | ||||||
|     senseBox_LoRa_cayenne_lat: "Breitengrad", |   senseBox_LoRa_cayenne_lat: "Breitengrad", | ||||||
|     senseBox_LoRa_cayenne_lng: "Längengrad", |   senseBox_LoRa_cayenne_lng: "Längengrad", | ||||||
|     senseBox_LoRa_cayenne_alt: "Höhe", |   senseBox_LoRa_cayenne_alt: "Höhe", | ||||||
|  |   senseBox_LoRa_cayenne_concentration: "Konzentration", | ||||||
| 
 | 
 | ||||||
|     senseBox_LoRa_cayenne_tip: "Sende Daten als Cayenne Payload Format", |   senseBox_LoRa_cayenne_tip: "Sende Daten als Cayenne Payload Format", | ||||||
|     senseBox_LoRa_cayenne_gps_tip: "Sende GPS", |   senseBox_LoRa_cayenne_gps_tip: "Sende GPS", | ||||||
|     senseBox_LoRa_cayenne_temperature_tip: "Sendet Temperaturwert mit einer Nachkommastelle", |   senseBox_LoRa_cayenne_temperature_tip: | ||||||
|     senseBox_LoRa_cayenne_pressure_tip: "Sendet Luftdruck mit einer Nachkommastelle", |     "Sendet Temperaturwert mit einer Nachkommastelle", | ||||||
|     senseBox_LoRa_cayenne_luminosity_tip: "Sendet Helligkeitswert", |   senseBox_LoRa_cayenne_pressure_tip: | ||||||
|     senseBox_LoRa_cayenne_analog_tip: "Sendet einen Dezimalwert mit einer Nachkommastelle", |     "Sendet Luftdruck mit einer Nachkommastelle", | ||||||
|  |   senseBox_LoRa_cayenne_luminosity_tip: "Sendet Helligkeitswert", | ||||||
|  |   senseBox_LoRa_cayenne_analog_tip: | ||||||
|  |     "Sendet einen Dezimalwert mit einer Nachkommastelle", | ||||||
| 
 | 
 | ||||||
|     senseBox_LoRa_message_tooltip: "Sende eine Nachricht über LoRa", |   senseBox_LoRa_cayenne_concentration_tip: "Sendet eine Konzentration in PPM", | ||||||
|     senseBox_LoRa_sensor_tip: "Sende einen Sensorwert mit einer bestimmten Anzahl an Bytes", | 
 | ||||||
|     senseBox_LoRa_init_abp_tooltip: "Initialisiere die LoRa übertragung. Die Aktivierung erfolgt über ABP. Registriere eine Application auf [thethingsnetwork](https://thethingsnetwork.com) und kopiere den **Network Session Key** und den **App Session Key** im **msb Format** und die **Device ID** im **hex Format**.", |   senseBox_LoRa_message_tooltip: "Sende eine Nachricht über LoRa", | ||||||
|     senseBox_LoRa_init_helpurl: "https://docs.sensebox.de/blockly/blockly-web-lora/", |   senseBox_LoRa_sensor_tip: | ||||||
|     senseBox_LoRa_init_otaa_tooltip: "Initialisiere die LoRa übertragung. Die Aktivierung erfolgt über OTAA. Registriere eine Application auf [thethingsnetwork](https://thethingsnetwork.com) und kopiere die **DEVICE EUI** und die **Application EUI** im **lsb Format** den **App Key** im **msb Format**.", |     "Sende einen Sensorwert mit einer bestimmten Anzahl an Bytes", | ||||||
| } |   senseBox_LoRa_init_abp_tooltip: | ||||||
|  |     "Initialisiere die LoRa übertragung. Die Aktivierung erfolgt über ABP. Registriere eine Application auf [thethingsnetwork](https://thethingsnetwork.com) und kopiere den **Network Session Key** und den **App Session Key** im **msb Format** und die **Device ID** im **hex Format**.", | ||||||
|  |   senseBox_LoRa_init_helpurl: | ||||||
|  |     "https://docs.sensebox.de/blockly/blockly-web-lora/", | ||||||
|  |   senseBox_LoRa_init_otaa_tooltip: | ||||||
|  |     "Initialisiere die LoRa übertragung. Die Aktivierung erfolgt über OTAA. Registriere eine Application auf [thethingsnetwork](https://thethingsnetwork.com) und kopiere die **DEVICE EUI** und die **Application EUI** im **lsb Format** den **App Key** im **msb Format**.", | ||||||
|  | 
 | ||||||
|  |   sensebox_lora_ttn_mapper_tip: | ||||||
|  |     "Mit einem TTN Mapper kannst du die LoRa-Netzabdeckung in deiner Umgebung aufzeichnen. Die Daten werden dann auf [ttnmaper](https://ttnmapper.org) angezeigt.", | ||||||
|  | }; | ||||||
|  | |||||||
| @ -1,51 +1,50 @@ | |||||||
| export const LORA = { | export const LORA = { | ||||||
|     /* |   /* | ||||||
|      * LoRa Blöcke |    * LoRa Blöcke | ||||||
|      */ |    */ | ||||||
| 
 | 
 | ||||||
|  |   senseBox_LoRa_connect: "Send to TTN", | ||||||
|  |   senseBox_LoRa_device_id: "Device EUI (lsb)", | ||||||
|  |   senseBox_LoRa_app_id: "Application EUI (lsb)", | ||||||
|  |   senseBox_LoRa_app_key: "App Key (msb)", | ||||||
|  |   senseBox_LoRa_nwskey_id: "Network Session Key (msb)", | ||||||
|  |   senseBox_LoRa_appskey_id: "App Session Key (msb)", | ||||||
|  |   senseBox_LoRa_devaddr_id: "Device Adress", | ||||||
|  |   senseBox_LoRa_interval: "Transmission interval in minutes", | ||||||
|  |   senseBox_measurement: "Messung", | ||||||
|  |   senseBox_measurements: "Messungen", | ||||||
| 
 | 
 | ||||||
|     senseBox_LoRa_connect: "Send to TTN", |   senseBox_LoRa_send_message: "Send as Lora Message", | ||||||
|     senseBox_LoRa_device_id: "Device EUI (lsb)", |   senseBox_LoRa_send_cayenne: "Send as Cayenne Payload", | ||||||
|     senseBox_LoRa_app_id: "Application EUI (lsb)", |   senseBox_LoRa_cayenne_temperature: "Temperature", | ||||||
|     senseBox_LoRa_app_key: "App Key (msb)", |   senseBox_LoRa_cayenne_channel: "Channel", | ||||||
|     senseBox_LoRa_nwskey_id: "Network Session Key (msb)", |   senseBox_LoRa_cayenne_humidity: "Humidity", | ||||||
|     senseBox_LoRa_appskey_id: "App Session Key (msb)", |   senseBox_LoRa_cayenne_pressure: "Pressure", | ||||||
|     senseBox_LoRa_devaddr_id: "Device Adress", |   senseBox_LoRa_cayenne_luminosity: "Luminosity", | ||||||
|     senseBox_LoRa_interval: "Transmission interval in minutes", |   senseBox_LoRa_cayenne_analog: "Analog Value", | ||||||
|     senseBox_measurement: "Messung", |   senseBox_LoRa_cayenne_x: "X Value", | ||||||
|     senseBox_measurements: "Messungen", |   senseBox_LoRa_cayenne_y: "Y Value", | ||||||
| 
 |   senseBox_LoRa_cayenne_z: "Z Value", | ||||||
|     senseBox_LoRa_send_message: "Send as Lora Message", |   senseBox_LoRa_cayenne_lat: "Latitude", | ||||||
|     senseBox_LoRa_send_cayenne: "Send as Cayenne Payload", |   senseBox_LoRa_cayenne_lng: "Longitude", | ||||||
|     senseBox_LoRa_cayenne_temperature: "Temperature", |   senseBox_LoRa_cayenne_alt: "Altitude", | ||||||
|     senseBox_LoRa_cayenne_channel: "Channel", |   senseBox_LoRa_cayenne_concentration: "Concentration", | ||||||
|     senseBox_LoRa_cayenne_humidity: "Humidity", |  | ||||||
|     senseBox_LoRa_cayenne_pressure: "Pressure", |  | ||||||
|     senseBox_LoRa_cayenne_luminosity: "Luminosity", |  | ||||||
|     senseBox_LoRa_cayenne_analog: "Analog Value", |  | ||||||
|     senseBox_LoRa_cayenne_x: "X Value", |  | ||||||
|     senseBox_LoRa_cayenne_y: "Y Value", |  | ||||||
|     senseBox_LoRa_cayenne_z: "Z Value", |  | ||||||
|     senseBox_LoRa_cayenne_lat: "Latitude", |  | ||||||
|     senseBox_LoRa_cayenne_lng: "Longitude", |  | ||||||
|     senseBox_LoRa_cayenne_alt: "Altitude", |  | ||||||
| 
 |  | ||||||
|     senseBox_LoRa_cayenne_humidity_tip: "Send temperature with one decimal", |  | ||||||
|     senseBox_LoRa_cayenne_tip: "Send Data as Cayenne Payload Format", |  | ||||||
|     senseBox_LoRa_cayenne_gps_tip: "Send GPS Data", |  | ||||||
|     senseBox_LoRa_cayenne_temperature_tip: "Send temperature with one decimal", |  | ||||||
|     senseBox_LoRa_cayenne_pressure_tip: "Send pressure with one decimal", |  | ||||||
|     senseBox_LoRa_cayenne_luminosity_tip: "Send luminosity without any decimals", |  | ||||||
|     senseBox_LoRa_cayenne_analog_tip: "Send a value with one decimal", |  | ||||||
| 
 |  | ||||||
|     senseBox_LoRa_message_tooltip: "Send a message with LoRa", |  | ||||||
|     senseBox_LoRa_sensor_tip: "Send a value with a specific number of bytes", |  | ||||||
|     senseBox_LoRa_init_abp_tooltip: "Initialize the LoRa transmission. The activation is done via ABP. Register an application on [thethingsnetwork](https://thethingsnetwork.com) and copy the **Network Session Key** and the **App Session Key** in **msb format** and the **Device ID** in **hex format**.", |  | ||||||
|     senseBox_LoRa_init_helpurl: "https://en.docs.sensebox.de/blockly/blockly-web-lora/", |  | ||||||
| 
 |  | ||||||
|     senseBox_LoRa_init_otaa_tooltip: "Initialize the LoRa transmission. The activation is done via OTAA. Register an application on [thethingsnetwork](https://thethingsnetwork.com) and copy the **DEVICE EUI** and the **Application EUI** in **lsb format** the **App Key** in **msb format**.", |  | ||||||
| 
 |  | ||||||
| } |  | ||||||
| 
 | 
 | ||||||
|  |   senseBox_LoRa_cayenne_humidity_tip: "Send temperature with one decimal", | ||||||
|  |   senseBox_LoRa_cayenne_tip: "Send Data as Cayenne Payload Format", | ||||||
|  |   senseBox_LoRa_cayenne_gps_tip: "Send GPS Data", | ||||||
|  |   senseBox_LoRa_cayenne_temperature_tip: "Send temperature with one decimal", | ||||||
|  |   senseBox_LoRa_cayenne_pressure_tip: "Send pressure with one decimal", | ||||||
|  |   senseBox_LoRa_cayenne_luminosity_tip: "Send luminosity without any decimals", | ||||||
|  |   senseBox_LoRa_cayenne_analog_tip: "Send a value with one decimal", | ||||||
| 
 | 
 | ||||||
|  |   senseBox_LoRa_message_tooltip: "Send a message with LoRa", | ||||||
|  |   senseBox_LoRa_sensor_tip: "Send a value with a specific number of bytes", | ||||||
|  |   senseBox_LoRa_init_abp_tooltip: | ||||||
|  |     "Initialize the LoRa transmission. The activation is done via ABP. Register an application on [thethingsnetwork](https://thethingsnetwork.com) and copy the **Network Session Key** and the **App Session Key** in **msb format** and the **Device ID** in **hex format**.", | ||||||
|  |   senseBox_LoRa_init_helpurl: | ||||||
|  |     "https://en.docs.sensebox.de/blockly/blockly-web-lora/", | ||||||
| 
 | 
 | ||||||
|  |   senseBox_LoRa_init_otaa_tooltip: | ||||||
|  |     "Initialize the LoRa transmission. The activation is done via OTAA. Register an application on [thethingsnetwork](https://thethingsnetwork.com) and copy the **DEVICE EUI** and the **Application EUI** in **lsb format** the **App Key** in **msb format**.", | ||||||
|  | }; | ||||||
|  | |||||||
| @ -376,6 +376,7 @@ class Toolbox extends React.Component { | |||||||
|             <Block type="sensebox_lora_cayenne_humidity" /> |             <Block type="sensebox_lora_cayenne_humidity" /> | ||||||
|             <Block type="sensebox_lora_cayenne_pressure" /> |             <Block type="sensebox_lora_cayenne_pressure" /> | ||||||
|             <Block type="sensebox_lora_cayenne_luminosity" /> |             <Block type="sensebox_lora_cayenne_luminosity" /> | ||||||
|  |             <Block type="sensebox_lora_cayenne_concentration" /> | ||||||
|             <Block type="sensebox_lora_cayenne_sensor" /> |             <Block type="sensebox_lora_cayenne_sensor" /> | ||||||
|             <Block type="sensebox_lora_cayenne_accelerometer" /> |             <Block type="sensebox_lora_cayenne_accelerometer" /> | ||||||
|             <Block type="sensebox_lora_cayenne_gps" /> |             <Block type="sensebox_lora_cayenne_gps" /> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user