Merge pull request #77 from sensebox/fix/remove-warnings
resolve warnings
This commit is contained in:
		
						commit
						bc5cbb6b33
					
				| @ -136,11 +136,12 @@ Blockly.Blocks['controls_if'] = { | |||||||
|     saveConnections: function (containerBlock) { |     saveConnections: function (containerBlock) { | ||||||
|         var clauseBlock = containerBlock.nextConnection.targetBlock(); |         var clauseBlock = containerBlock.nextConnection.targetBlock(); | ||||||
|         var i = 1; |         var i = 1; | ||||||
|  |         var inputDo; | ||||||
|         while (clauseBlock) { |         while (clauseBlock) { | ||||||
|             switch (clauseBlock.type) { |             switch (clauseBlock.type) { | ||||||
|                 case 'controls_if_elseif': |                 case 'controls_if_elseif': | ||||||
|                     var inputIf = this.getInput('IF' + i); |                     var inputIf = this.getInput('IF' + i); | ||||||
|                     var inputDo = this.getInput('DO' + i); |                     inputDo = this.getInput('DO' + i); | ||||||
|                     clauseBlock.valueConnection_ = |                     clauseBlock.valueConnection_ = | ||||||
|                         inputIf && inputIf.connection.targetConnection; |                         inputIf && inputIf.connection.targetConnection; | ||||||
|                     clauseBlock.statementConnection_ = |                     clauseBlock.statementConnection_ = | ||||||
| @ -148,7 +149,7 @@ Blockly.Blocks['controls_if'] = { | |||||||
|                     i++; |                     i++; | ||||||
|                     break; |                     break; | ||||||
|                 case 'controls_if_else': |                 case 'controls_if_else': | ||||||
|                     var inputDo = this.getInput('ELSE'); |                     inputDo = this.getInput('ELSE'); | ||||||
|                     clauseBlock.statementConnection_ = |                     clauseBlock.statementConnection_ = | ||||||
|                         inputDo && inputDo.connection.targetConnection; |                         inputDo && inputDo.connection.targetConnection; | ||||||
|                     break; |                     break; | ||||||
| @ -169,11 +170,11 @@ Blockly.Blocks['controls_if'] = { | |||||||
|         if (this.getInput('ELSE')) { |         if (this.getInput('ELSE')) { | ||||||
|             this.removeInput('ELSE'); |             this.removeInput('ELSE'); | ||||||
|         } |         } | ||||||
|         var i = 1; |         var j = 1; | ||||||
|         while (this.getInput('IF' + i)) { |         while (this.getInput('IF' + j)) { | ||||||
|             this.removeInput('IF' + i); |             this.removeInput('IF' + j); | ||||||
|             this.removeInput('DO' + i); |             this.removeInput('DO' + j); | ||||||
|             i++; |             j++; | ||||||
|         } |         } | ||||||
|         // Rebuild block.
 |         // Rebuild block.
 | ||||||
|         for (var i = 1; i <= this.elseifCount_; i++) { |         for (var i = 1; i <= this.elseifCount_; i++) { | ||||||
|  | |||||||
| @ -112,7 +112,7 @@ Blockly.Blocks['sensebox_display_fastPrint'] = { | |||||||
|         // Is the block nested in a loop?
 |         // Is the block nested in a loop?
 | ||||||
|         var block = this; |         var block = this; | ||||||
|         do { |         do { | ||||||
|             if (this.LOOP_TYPES.indexOf(block.type) != -1) { |             if (this.LOOP_TYPES.indexOf(block.type) !== -1) { | ||||||
|                 legal = true; |                 legal = true; | ||||||
|                 break; |                 break; | ||||||
|             } |             } | ||||||
|  | |||||||
| @ -24,7 +24,7 @@ Blockly.Arduino.sensebox_osem_connection = function (Block) { | |||||||
|   var ssl = this.getFieldValue('SSL'); |   var ssl = this.getFieldValue('SSL'); | ||||||
|   var port = 0; |   var port = 0; | ||||||
|   var count = 0; |   var count = 0; | ||||||
|   if (blocks != undefined) { |   if (blocks !== undefined) { | ||||||
|     for (var i = 0; i < blocks.length; i++) { |     for (var i = 0; i < blocks.length; i++) { | ||||||
|       if (blocks[i].type === 'sensebox_send_to_osem') { |       if (blocks[i].type === 'sensebox_send_to_osem') { | ||||||
|         count++; |         count++; | ||||||
|  | |||||||
| @ -350,6 +350,7 @@ Blockly.Arduino.sensebox_sensor_truebner_smt50 = function () { | |||||||
|   var dropdown_port = this.getFieldValue('Port') |   var dropdown_port = this.getFieldValue('Port') | ||||||
|   var dropdown_value = this.getFieldValue('value'); |   var dropdown_value = this.getFieldValue('value'); | ||||||
|   var dropdown_pin = 1; |   var dropdown_pin = 1; | ||||||
|  |   var code = ''; | ||||||
|   if (dropdown_value === 'temp') { |   if (dropdown_value === 'temp') { | ||||||
|     if (dropdown_port === 'A') { |     if (dropdown_port === 'A') { | ||||||
|       dropdown_pin = 1; |       dropdown_pin = 1; | ||||||
| @ -361,7 +362,7 @@ Blockly.Arduino.sensebox_sensor_truebner_smt50 = function () { | |||||||
|       dropdown_pin = 5; |       dropdown_pin = 5; | ||||||
|     } |     } | ||||||
|     Blockly.Arduino.codeFunctions_['sensebox_smt50_temp'] = 'float getSMT50Temperature(int analogPin){\n  int sensorValue = analogRead(analogPin);\n  float voltage = sensorValue * (3.3 / 1024.0);\n   return (voltage - 0.5) * 100;\n}'; |     Blockly.Arduino.codeFunctions_['sensebox_smt50_temp'] = 'float getSMT50Temperature(int analogPin){\n  int sensorValue = analogRead(analogPin);\n  float voltage = sensorValue * (3.3 / 1024.0);\n   return (voltage - 0.5) * 100;\n}'; | ||||||
|     var code = 'getSMT50Temperature(' + dropdown_pin + ')'; |     code = 'getSMT50Temperature(' + dropdown_pin + ')'; | ||||||
|     return [code, Blockly.Arduino.ORDER_ATOMIC]; |     return [code, Blockly.Arduino.ORDER_ATOMIC]; | ||||||
|   } |   } | ||||||
|   else if (dropdown_value === 'soil') { |   else if (dropdown_value === 'soil') { | ||||||
| @ -375,7 +376,7 @@ Blockly.Arduino.sensebox_sensor_truebner_smt50 = function () { | |||||||
|       dropdown_pin = 6; |       dropdown_pin = 6; | ||||||
|     } |     } | ||||||
|     Blockly.Arduino.codeFunctions_['sensebox_smt50_soil'] = 'float getSMT50Moisture(int analogPin){\n   int sensorValue = analogRead(analogPin);\n    float voltage = sensorValue * (3.3 / 1024.0);\n   return (voltage * 50) / 3;\n}'; |     Blockly.Arduino.codeFunctions_['sensebox_smt50_soil'] = 'float getSMT50Moisture(int analogPin){\n   int sensorValue = analogRead(analogPin);\n    float voltage = sensorValue * (3.3 / 1024.0);\n   return (voltage * 50) / 3;\n}'; | ||||||
|     var code = 'getSMT50Moisture(' + dropdown_pin + ')'; |     code = 'getSMT50Moisture(' + dropdown_pin + ')'; | ||||||
|     return [code, Blockly.Arduino.ORDER_ATOMIC]; |     return [code, Blockly.Arduino.ORDER_ATOMIC]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -33,7 +33,6 @@ export const DISPLAY = { | |||||||
|     senseBox_display_plotYRange2: "Y-Wertebereich Ende", |     senseBox_display_plotYRange2: "Y-Wertebereich Ende", | ||||||
|     senseBox_display_plotXTick: "X-Linienabstand", |     senseBox_display_plotXTick: "X-Linienabstand", | ||||||
|     senseBox_display_plotYTick: "Y-Linienabstand", |     senseBox_display_plotYTick: "Y-Linienabstand", | ||||||
|     senseBox_display_printDisplay_tooltip: "Mit diesem Block können automatisch Diagramme auf dem Display erstellt werden.", |  | ||||||
|     senseBox_display_plotTimeFrame: "Zeitabschnitt", |     senseBox_display_plotTimeFrame: "Zeitabschnitt", | ||||||
|     sensebox_display_fillCircle: "Zeichne Punkt", |     sensebox_display_fillCircle: "Zeichne Punkt", | ||||||
|     sensebox_display_fillCircle_radius: "Radius", |     sensebox_display_fillCircle_radius: "Radius", | ||||||
|  | |||||||
| @ -40,7 +40,5 @@ export const LORA = { | |||||||
|     senseBox_LoRa_sensor_tip: "Sende einen Sensorwert mit einer bestimmten Anzahl an Bytes", |     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_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_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_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_init_helpurl: "https://docs.sensebox.de/blockly/blockly-web-lora/", |  | ||||||
| } | } | ||||||
| @ -108,7 +108,6 @@ export const TRANSLATIONS = { | |||||||
|     NEW_VARIABLE_TITLE: "Name der neuen Variable:", |     NEW_VARIABLE_TITLE: "Name der neuen Variable:", | ||||||
|     ORDINAL_NUMBER_SUFFIX: "", |     ORDINAL_NUMBER_SUFFIX: "", | ||||||
|     PROCEDURES_ALLOW_STATEMENTS: "Aussagen erlauben", |     PROCEDURES_ALLOW_STATEMENTS: "Aussagen erlauben", | ||||||
|     PROCEDURES_BEFORE_PARAMS: "mit:", |  | ||||||
|     PROCEDURES_CALLNORETURN_HELPURL: "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29", |     PROCEDURES_CALLNORETURN_HELPURL: "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29", | ||||||
|     PROCEDURES_CALLNORETURN_TOOLTIP: "Rufe einen Funktionsblock ohne Rückgabewert auf.", |     PROCEDURES_CALLNORETURN_TOOLTIP: "Rufe einen Funktionsblock ohne Rückgabewert auf.", | ||||||
|     PROCEDURES_CALLRETURN_HELPURL: "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29", |     PROCEDURES_CALLRETURN_HELPURL: "https://de.wikipedia.org/wiki/Prozedur_%28Programmierung%29", | ||||||
|  | |||||||
| @ -28,10 +28,8 @@ export const DISPLAY = { | |||||||
|     senseBox_display_plotXRange2: "X-Range End", |     senseBox_display_plotXRange2: "X-Range End", | ||||||
|     senseBox_display_plotYRange1: "Y-Range Begin", |     senseBox_display_plotYRange1: "Y-Range Begin", | ||||||
|     senseBox_display_plotYRange2: "Y-Range End", |     senseBox_display_plotYRange2: "Y-Range End", | ||||||
|     senseBox_display_plotXTick: "X-Linienabstand", |  | ||||||
|     senseBox_display_plotYTick: "Y-Tick", |     senseBox_display_plotYTick: "Y-Tick", | ||||||
|     senseBox_display_plotXTick: "X-Tick", |     senseBox_display_plotXTick: "X-Tick", | ||||||
|     senseBox_display_printDisplay_tooltip: "Use this Block to plot values on the OLED Display", |  | ||||||
|     senseBox_display_plotTimeFrame: "TimeFrame", |     senseBox_display_plotTimeFrame: "TimeFrame", | ||||||
|     sensebox_display_fillCircle: "Draw Point", |     sensebox_display_fillCircle: "Draw Point", | ||||||
|     sensebox_display_fillCircle_radius: "Radius", |     sensebox_display_fillCircle_radius: "Radius", | ||||||
|  | |||||||
| @ -44,7 +44,6 @@ export const LORA = { | |||||||
|     senseBox_LoRa_init_helpurl: "https://en.docs.sensebox.de/blockly/blockly-web-lora/", |     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_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_init_helpurl: "https://en.docs.sensebox.de/blockly/blockly-web-lora/", |  | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -167,6 +167,11 @@ class Navbar extends Component { | |||||||
|                   </Link> |                   </Link> | ||||||
|                 ); |                 ); | ||||||
|               } |               } | ||||||
|  |               else { | ||||||
|  |                 return( | ||||||
|  |                   null | ||||||
|  |                   ) | ||||||
|  |               } | ||||||
|             } |             } | ||||||
|             )} |             )} | ||||||
|           </List> |           </List> | ||||||
| @ -188,7 +193,14 @@ class Navbar extends Component { | |||||||
|                   </Link> |                   </Link> | ||||||
|                 ); |                 ); | ||||||
|               } |               } | ||||||
|  |               else { | ||||||
|  |                 return( | ||||||
|  |                   null | ||||||
|  |                   ) | ||||||
|  |               } | ||||||
|  |                | ||||||
|             } |             } | ||||||
|  |              | ||||||
|             )} |             )} | ||||||
|           </List> |           </List> | ||||||
|         </Drawer> |         </Drawer> | ||||||
|  | |||||||
| @ -38,7 +38,7 @@ class Tutorial extends Component { | |||||||
|       // authentication is completed
 |       // authentication is completed
 | ||||||
|       this.props.getTutorial(this.props.match.params.tutorialId); |       this.props.getTutorial(this.props.match.params.tutorialId); | ||||||
|     } |     } | ||||||
|     else if(this.props.tutorial && !this.props.isLoading && this.props.tutorial._id != this.props.match.params.tutorialId) { |     else if(this.props.tutorial && !this.props.isLoading && this.props.tutorial._id !== this.props.match.params.tutorialId) { | ||||||
|       this.props.getTutorial(this.props.match.params.tutorialId); |       this.props.getTutorial(this.props.match.params.tutorialId); | ||||||
|     } |     } | ||||||
|     if (this.props.message.id === 'GET_TUTORIAL_FAIL') { |     if (this.props.message.id === 'GET_TUTORIAL_FAIL') { | ||||||
|  | |||||||
| @ -9,7 +9,7 @@ const initialState = { | |||||||
|   user: null |   user: null | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function(state = initialState, action){ | export default function foo(state = initialState, action){ | ||||||
|   switch(action.type){ |   switch(action.type){ | ||||||
|     case USER_LOADING: |     case USER_LOADING: | ||||||
|       return { |       return { | ||||||
|  | |||||||
| @ -32,7 +32,7 @@ const initialState = { | |||||||
|   statistics: initialStatistics() |   statistics: initialStatistics() | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function(state = initialState, action){ | export default function foo(state = initialState, action){ | ||||||
|   switch(action.type){ |   switch(action.type){ | ||||||
|     case VISIT: |     case VISIT: | ||||||
|       return { |       return { | ||||||
|  | |||||||
| @ -6,7 +6,7 @@ const initialState = { | |||||||
|   id: null |   id: null | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function(state = initialState, action){ | export default function foo(state = initialState, action){ | ||||||
|   switch(action.type){ |   switch(action.type){ | ||||||
|     case GET_ERRORS: |     case GET_ERRORS: | ||||||
|     case GET_SUCCESS: |     case GET_SUCCESS: | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ const initialState = { | |||||||
|   progress: false |   progress: false | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function (state = initialState, action) { | export default function foo(state = initialState, action) { | ||||||
|   switch (action.type) { |   switch (action.type) { | ||||||
|     case PROJECT_PROGRESS: |     case PROJECT_PROGRESS: | ||||||
|       return { |       return { | ||||||
|  | |||||||
| @ -21,7 +21,7 @@ const initialState = { | |||||||
|   } |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function(state = initialState, action){ | export default function foo(state = initialState, action){ | ||||||
|   switch(action.type){ |   switch(action.type){ | ||||||
|     case BUILDER_CHANGE: |     case BUILDER_CHANGE: | ||||||
|       return { |       return { | ||||||
|  | |||||||
| @ -1,4 +1,4 @@ | |||||||
| import { TUTORIAL_PROGRESS, GET_TUTORIAL, GET_TUTORIALS, GET_STATUS, TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_ID, TUTORIAL_STEP } from '../actions/types'; | import { TUTORIAL_PROGRESS, GET_TUTORIAL, GET_TUTORIALS, GET_STATUS, TUTORIAL_SUCCESS, TUTORIAL_ERROR, TUTORIAL_CHANGE, TUTORIAL_XML, TUTORIAL_STEP } from '../actions/types'; | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| //
 | //
 | ||||||
| @ -21,7 +21,7 @@ const initialState = { | |||||||
|   progress: false |   progress: false | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function (state = initialState, action) { | export default function foo(state = initialState, action) { | ||||||
|   switch (action.type) { |   switch (action.type) { | ||||||
|     case TUTORIAL_PROGRESS: |     case TUTORIAL_PROGRESS: | ||||||
|       return { |       return { | ||||||
|  | |||||||
| @ -16,7 +16,7 @@ const initialState = { | |||||||
|   name: null |   name: null | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export default function(state = initialState, action){ | export default function foo(state = initialState, action){ | ||||||
|   switch(action.type){ |   switch(action.type){ | ||||||
|     case NEW_CODE: |     case NEW_CODE: | ||||||
|       return { |       return { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user