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; | ||||||
|  | }; | ||||||
|  | |||||||
| @ -28,17 +28,30 @@ export const LORA = { | |||||||
|   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_pressure_tip: | ||||||
|  |     "Sendet Luftdruck mit einer Nachkommastelle", | ||||||
|   senseBox_LoRa_cayenne_luminosity_tip: "Sendet Helligkeitswert", |   senseBox_LoRa_cayenne_luminosity_tip: "Sendet Helligkeitswert", | ||||||
|     senseBox_LoRa_cayenne_analog_tip: "Sendet einen Dezimalwert mit einer Nachkommastelle", |   senseBox_LoRa_cayenne_analog_tip: | ||||||
|  |     "Sendet einen Dezimalwert mit einer Nachkommastelle", | ||||||
|  | 
 | ||||||
|  |   senseBox_LoRa_cayenne_concentration_tip: "Sendet eine Konzentration in PPM", | ||||||
| 
 | 
 | ||||||
|   senseBox_LoRa_message_tooltip: "Sende eine Nachricht über LoRa", |   senseBox_LoRa_message_tooltip: "Sende eine Nachricht über LoRa", | ||||||
|     senseBox_LoRa_sensor_tip: "Sende einen Sensorwert mit einer bestimmten Anzahl an Bytes", |   senseBox_LoRa_sensor_tip: | ||||||
|     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**.", |     "Sende einen Sensorwert mit einer bestimmten Anzahl an Bytes", | ||||||
|     senseBox_LoRa_init_helpurl: "https://docs.sensebox.de/blockly/blockly-web-lora/", |   senseBox_LoRa_init_abp_tooltip: | ||||||
|     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**.", |     "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.", | ||||||
|  | }; | ||||||
|  | |||||||
| @ -3,7 +3,6 @@ export const LORA = { | |||||||
|    * LoRa Blöcke |    * LoRa Blöcke | ||||||
|    */ |    */ | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
|   senseBox_LoRa_connect: "Send to TTN", |   senseBox_LoRa_connect: "Send to TTN", | ||||||
|   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)", | ||||||
| @ -29,6 +28,7 @@ export const LORA = { | |||||||
|   senseBox_LoRa_cayenne_lat: "Latitude", |   senseBox_LoRa_cayenne_lat: "Latitude", | ||||||
|   senseBox_LoRa_cayenne_lng: "Longitude", |   senseBox_LoRa_cayenne_lng: "Longitude", | ||||||
|   senseBox_LoRa_cayenne_alt: "Altitude", |   senseBox_LoRa_cayenne_alt: "Altitude", | ||||||
|  |   senseBox_LoRa_cayenne_concentration: "Concentration", | ||||||
| 
 | 
 | ||||||
|   senseBox_LoRa_cayenne_humidity_tip: "Send temperature with one decimal", |   senseBox_LoRa_cayenne_humidity_tip: "Send temperature with one decimal", | ||||||
|   senseBox_LoRa_cayenne_tip: "Send Data as Cayenne Payload Format", |   senseBox_LoRa_cayenne_tip: "Send Data as Cayenne Payload Format", | ||||||
| @ -40,12 +40,11 @@ export const LORA = { | |||||||
| 
 | 
 | ||||||
|   senseBox_LoRa_message_tooltip: "Send a message with LoRa", |   senseBox_LoRa_message_tooltip: "Send a message with LoRa", | ||||||
|   senseBox_LoRa_sensor_tip: "Send a value with a specific number of bytes", |   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_abp_tooltip: | ||||||
|     senseBox_LoRa_init_helpurl: "https://en.docs.sensebox.de/blockly/blockly-web-lora/", |     "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: | ||||||
|     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**.", |     "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