1+ //https://blockly-demo.appspot.com/static/demos/blockfactory_old/index.html#5ag74x
2+ Blockly . Blocks [ 'lora_new' ] = {
3+ init : function ( ) {
4+ this . appendDummyInput ( )
5+ . appendField ( "LORA , Reset Pin" )
6+ . appendField ( new Blockly . FieldDropdown ( [ [ "0" , "0" ] , [ "1" , "1" ] , [ "2" , "2" ] , [ "3" , "3" ] , [ "4" , "4" ] , [ "5" , "5" ] , [ "6" , "6" ] , [ "7" , "7" ] , [ "8" , "8" ] , [ "9" , "9" ] , [ "15" , "15" ] ] ) , "resetPin" )
7+ . appendField ( " , Address:" )
8+ . appendField ( new Blockly . FieldDropdown ( [ [ "0" , "0" ] , [ "1" , "1" ] , [ "2" , "2" ] , [ "3" , "3" ] , [ "4" , "4" ] , [ "5" , "5" ] , [ "6" , "6" ] , [ "7" , "7" ] , [ "8" , "8" ] , [ "9" , "9" ] , [ "15" , "15" ] ] ) , "address" ) ;
9+ this . setOutput ( true , null ) ;
10+ this . setColour ( 230 ) ;
11+ this . setTooltip ( '' ) ;
12+ this . setHelpUrl ( 'http://webduino.io/' ) ;
13+ }
14+ } ;
15+
16+ Blockly . Blocks [ 'lora_send' ] = {
17+ init : function ( ) {
18+ this . appendValueInput ( "data" )
19+ . setCheck ( null )
20+ . appendField ( new Blockly . FieldVariable ( "lora" ) , "lora" )
21+ . appendField ( "傳送字串" ) ;
22+ this . setPreviousStatement ( true , null ) ;
23+ this . setNextStatement ( true , null ) ;
24+ this . setColour ( 65 ) ;
25+ this . setTooltip ( '' ) ;
26+ this . setHelpUrl ( 'http://webduino.io/' ) ;
27+ }
28+ } ;
29+
30+ //https://blockly-demo.appspot.com/static/demos/blockfactory_old/index.html#hv345s
31+ Blockly . Blocks [ 'lora_send_ack' ] = {
32+ init : function ( ) {
33+ this . appendValueInput ( "data" )
34+ . setCheck ( null )
35+ . appendField ( new Blockly . FieldVariable ( "lora" ) , "lora" )
36+ . appendField ( "傳送字串" ) ;
37+ this . appendStatementInput ( "send_ok" )
38+ . setCheck ( null )
39+ . appendField ( "成功後執行" ) ;
40+ this . appendStatementInput ( "send_failure" )
41+ . setCheck ( null )
42+ . appendField ( "失敗後執行" ) ;
43+ this . setPreviousStatement ( true , null ) ;
44+ this . setNextStatement ( true , null ) ;
45+ this . setColour ( 65 ) ;
46+ this . setTooltip ( '' ) ;
47+ this . setHelpUrl ( 'http://webduino.io/' ) ;
48+ }
49+ } ;
50+
51+ //https://blockly-demo.appspot.com/static/demos/blockfactory_old/index.html#t673pk
52+ Blockly . Blocks [ 'lora_recv_ack' ] = {
53+ init : function ( ) {
54+ this . appendStatementInput ( "recv_ok" )
55+ . setCheck ( null )
56+ . appendField ( new Blockly . FieldVariable ( "lora" ) , "lora" )
57+ . appendField ( "接收字串後執行" ) ;
58+ this . setPreviousStatement ( true , null ) ;
59+ this . setNextStatement ( true , null ) ;
60+ this . setColour ( 65 ) ;
61+ this . setTooltip ( '' ) ;
62+ this . setHelpUrl ( 'http://webduino.io/' ) ;
63+ }
64+ } ;
65+
66+ //https://blockly-demo.appspot.com/static/demos/blockfactory_old/index.html#csh9m9
67+ Blockly . Blocks [ 'lora_recv_data' ] = {
68+ init : function ( ) {
69+ this . appendDummyInput ( )
70+ . appendField ( new Blockly . FieldVariable ( "lora" ) , "lora" )
71+ . appendField ( "接收的字串" ) ;
72+ this . setOutput ( true , null ) ;
73+ this . setColour ( 65 ) ;
74+ this . setTooltip ( '' ) ;
75+ this . setHelpUrl ( 'http://webduino.io/' ) ;
76+ }
77+ } ;
0 commit comments