goog.provide('Blockly.Blocks.HELLO_STEM');
goog.require('Blockly.Blocks');

var HS_S77_PL_svg_PATH = typeof HS_S77_PL_svg_PATH === 'undefined' ? 'data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%3E%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%229%22%20fill%3D%22%234a90e2%22/%3E%3Cpath%20d%3D%22M6%208v4h3l4%203V5L9%208H6z%22%20fill%3D%22white%22/%3E%3Cpath%20d%3D%22M14%207.5c1%201%201%204%200%205%22%20fill%3D%22none%22%20stroke%3D%22white%22%20stroke-width%3D%221.3%22%20stroke-linecap%3D%22round%22/%3E%3C/svg%3E' : HS_S77_PL_svg_PATH;

Blockly.Blocks.EPD_Pin_Init= {
  init: function() { 
  this.appendValueInput("SCK")
      .setCheck(Number)
      .appendField("墨水屏(152x296) 引脚重定向  SCK");
  this.appendValueInput("MOSI")
      .setCheck(Number)
      .appendField("MOSI");
  this.appendValueInput("CS")
      .setCheck(Number)
      .appendField("CS");
  this.appendValueInput("RST")
      .setCheck(Number)
      .appendField("RST");
  this.appendValueInput("DC")
      .setCheck(Number)
      .appendField("DC");
  this.appendValueInput("BUSY")
      .setCheck(Number)
      .appendField("BUSY");
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.EPD_Init= {
  init: function() { 
  this.appendDummyInput()
      .appendField("初始化墨水屏(152X196)  屏幕 ");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["旋转 0°","0"],["旋转 90°","90"],["旋转 180","180"],["旋转 270°","270"]]), "Rotate_value");
  this.appendDummyInput()
      .appendField("背景颜色");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["白","WHITE"],["黑","BLACK"]]), "Color_value");
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.EPD_Display= {
  init: function() { 
  this.appendDummyInput()
      .appendField("墨水屏(152x296)  刷新页面");
  this.appendStatementInput("function")
      .setCheck(null);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.Paint_DrawNum= {
  init: function() { 
  this.appendValueInput("Num_x")
      .setCheck(Number)
      .appendField("墨水屏显示数字   起点x  ");
  this.appendValueInput("Num_y")
      .setCheck(Number)
      .appendField(" 起点y ");
  this.appendValueInput("Num_Value")
      .setCheck(Number)
      .appendField(" 内容 ");
  this.appendDummyInput()
      .appendField("字号");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["08","&Font8"],["12","&Font12"],["16","&Font16"],["20","&Font20"],["24","&Font24"]]), "Num_word_size");
  this.appendDummyInput()
      .appendField(" 字体颜色 ");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["黑","BLACK"],["白","WHITE"]]), "Num_color1");
  this.appendDummyInput()
      .appendField("背景颜色");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["白","WHITE"],["黑","BLACK"]]), "Num_color2");
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.Paint_DrawString_EN= {
  init: function() { 
  this.appendValueInput("String_x")
      .setCheck(Number)
      .appendField("墨水屏显示文本   起点x  ");
  this.appendValueInput("String_y")
      .setCheck(Number)
      .appendField(" 起点y ");
  this.appendValueInput("String_Value")
      .setCheck(String)
      .appendField(" 内容 ");
  this.appendDummyInput()
      .appendField("字号");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["08","&Font8"],["12","&Font12"],["16","&Font16"],["20","&Font20"],["24","&Font24"]]), "String_word_size");
  this.appendDummyInput()
      .appendField(" 字体颜色 ");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["黑","BLACK"],["白","WHITE"]]), "String_color1");
  this.appendDummyInput()
      .appendField("背景颜色");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["白","WHITE"],["黑","BLACK"]]), "String_color2");
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};



Blockly.Blocks.Paint_DrawImage= {
  init: function() { 
  this.appendValueInput("Image_x")
      .setCheck(Number)
      .appendField("墨水屏显示图像   起点x  ");
  this.appendValueInput("Image_y")
      .setCheck(Number)
      .appendField(" 起点y ");
  this.appendValueInput("Image_Width")
      .setCheck(Number)
      .appendField("宽度");
  this.appendValueInput("Image_height")
      .setCheck(Number)
      .appendField("高度");
  this.appendValueInput("Image_value")
      .setCheck(String)
      .appendField("图像名称");
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};



Blockly.Blocks.Paint_Clear= {
  init: function() { 
  this.appendDummyInput()
      .appendField("墨水屏(152X296)  清屏颜色");
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([["白","WHITE"],["黑","BLACK"]]), "Clear_Color");
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.EPD_2IN66_Partial_Display= {
  init: function() { 
  this.appendDummyInput()
      .appendField("墨水屏(152X296) 局部刷新页面");
  this.appendStatementInput("Partial_Display")
      .setCheck(null);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.Hello_STEM_GPS= {
  init: function() { 
  this.appendValueInput("Tx_PIN")
      .setCheck(null)
      .appendField("初始化 GPS定位模块 Tx#");
  this.appendValueInput("Rx_PIN")
      .setCheck(null)
      .appendField("Rx#");
  this.appendValueInput("Bave")
      .setCheck(null)
      .appendField("波特率");
  this.appendDummyInput();
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(210);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.GPS_GET_DATA= {
  init: function() { 
  this.appendDummyInput()
      .appendField("GPS 获取到数据");
  this.setOutput(true, null);
  this.setColour(210);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.GPS_DATA_Proc= {
  init: function() { 
  this.appendDummyInput()
      .appendField("GPS 解析数据成功");
  this.setOutput(true, null);
  this.setColour(210);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.GPS_DATA_SUCC= {
  init: function() { 
  this.appendDummyInput()
      .appendField("GPS")
      .appendField(new Blockly.FieldDropdown([["位置","location"],["日期","date"],["时间","time"]]), "xuanze");
  this.appendDummyInput()
      .appendField("有效");
  this.setInputsInline(true);
  this.setOutput(true, null);
  this.setColour(210);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.GPS_Specific_DATA= {
  init: function() { 
  this.appendDummyInput()
      .appendField("GPS获取")
      .appendField(new Blockly.FieldDropdown([["位置-纬度","location.lat()"],["位置-经度","location.lng()"],["日期-年","date.year()"],["日期-月","date.month()"],["日期-日","date.day()"],["时间-时","time.hour()"],["时间-分","time.minute()"],["时间-秒","time.second()"]]), "SP_DATA");
  this.setInputsInline(true);
  this.setOutput(true, null);
  this.setColour(210);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.SU03T_Init = {
    init: function () {
        this.appendValueInput("Rx_PIN")
            .setCheck(null)
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("初始化语音识别模块 RX为");
        this.appendValueInput("Tx_PIN")
            .setCheck(null)
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("TX为");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};


Blockly.Blocks.SU03T_SHIBIE = {
    init: function () {
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("识别到")
            .appendField(new Blockly.FieldDropdown([
                ["开灯", "1"],
                ["关灯", "2"],
                ["调为红色", "3"],
                ["调为蓝色", "4"],
                ["调为绿色", "5"],
                ["调为彩色", "6"],
                ["打开空调", "7"],
                ["关闭空调", "8"],
                ["打开风扇", "9"],
                ["关闭风扇", "10"],
                ["1档风", "11"],
                ["2档风", "12"],
                ["3档风", "13"],
                ["自动模式", "14"],
                ["制冷模式", "15"],
                ["制热模式", "16"],
                ["升高温度", "17"],
                ["降低温度", "18"],
                ["打开台灯", "19"],
                ["关闭台灯", "20"],
                ["调到最亮", "21"],
                ["调到最暗", "22"],
                ["调亮一点", "23"],
                ["调暗一点", "24"],
                ["查询温度", "25"],
                ["查询湿度", "26"],
                ["查询天气", "27"]
            ]), "ZHILING");
        this.setOutput(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};


Blockly.Blocks.SU03T_ClearShiBie = {
    init: function () {
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("清楚识别结果");
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};


Blockly.Blocks.SU03T_BOBAOXIAOSHU = {
    init: function () {
        this.appendValueInput("NAME")
            .setCheck(null)
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("播报小数");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};


Blockly.Blocks.SU03T_BOBAOZHENGSHU = {
    init: function () {
        this.appendValueInput("BOBAOZHENGSHU")
            .setCheck(null)
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("播报整数");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.SU03T_BOBAO = {
    init: function () {
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("播报")
            .appendField(new Blockly.FieldDropdown([
                ["现在的温度是", "1"],
                ["度", "2"],
                ["现在的湿度是百分之", "3"],
                ["一", "4"],
                ["二", "5"],
                ["三", "6"],
                ["四", "7"],
                ["五", "8"],
                ["现在的时间是", "22"],
                ["年", "23"],
                ["月", "24"],
                ["日", "25"],
                ["点", "26"],
                ["分", "27"],
                ["秒", "28"],
                ["百分之", "29"],
                ["现在的距离是", "30"],
                ["厘米", "32"],
                ["米", "33"],
                ["千米", "34"]
            ]), "NRIRONG");
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};



Blockly.Blocks.HS_F26_Voice= {
  init: function() { 
  this.appendValueInput("F26_PIN")
      .setCheck(null)
      .appendField("语音播报（127段日常用语） 管脚#");
  this.appendDummyInput()
      .appendField("播报")
      .appendField(new Blockly.FieldDropdown([["老师", "0x00"],
                ["爸爸", "0x01"],
                ["妈妈", "0x02"],
                ["爷爷", "0x03"],
                ["奶奶", "0x04"],
                ["姥姥", "0x05"],
                ["姥爷", "0x06"],
                ["哥哥", "0x08"],
                ["姐姐", "0x08"],
                ["叔叔", "0x09"],
                ["阿姨", "0x0A"],
                ["上午", "0x0B"],
                ["下午", "0x0C"],
                ["晚上", "0x0D"],
                ["前方", "0x0E"],
                ["厘米", "0x0F"],
                ["新年快乐", "0x10"],
                ["身体健康", "0x11"],
                ["工作顺利", "0x12"],
                ["学习进步", "0x13"],
                ["您好", "0x14"],
                ["谢谢", "0x15"],
                ["的", "0x16"],
                ["祝", "0x17"],
                ["慢走", "0x18"],
                ["欢迎光临", "0x19"],
                ["亲爱的", "0x1A"],
                ["同学们", "0x1B"],
                ["工作辛苦了", "0x1C"],
                ["点", "0x1D"],
                ["打开", "0x1E"],
                ["关闭", "0x1F"],
                ["千", "0x20"],
                ["百", "0x21"],
                ["十/时", "0x22"],
                ["1", "0x23"],
                ["2", "0x24"],
                ["3", "0x25"],
                ["4", "0x26"],
                ["5", "0x27"],
                ["6", "0x28"],
                ["7", "0x29"],
                ["8", "0x2A"],
                ["9", "0x2B"],
                ["0", "0x2C"],
                ["当期", "0x2D"],
                ["转", "0x2E"],
                ["左", "0x2F"],
                ["右", "0x30"],
                ["请", "0x31"],
                ["已", "0x32"],
                ["现在", "0x33"],
                ["是", "0x34"],
                ["红灯", "0x35"],
                ["绿灯", "0x36"],
                ["黄灯", "0x37"],
                ["温度", "0x38"],
                ["湿度", "0x39"],
                ["欢迎常来", "0x3A"],
                ["还有", "0x3B"],
                ["秒", "0x3C"],
                ["分", "0x3D"],
                ["变", "0x3E"],
                ["等", "0x3F"],
                ["下一次", "0x40"],
                ["功能", "0x41"],
                ["障碍物", "0x42"],
                ["世界那么大，我想去看看", "0x43"],
                ["今天", "0x44"],
                ["年", "0x45"],
                ["月", "0x46"],
                ["日", "0x47"],
                ["星期", "0x48"],
                ["农历", "0x49"],
                ["现在时刻", "0x4A"],
                ["北京时间", "0x4B"],
                ["整", "0x4C"],
                ["度", "0x4D"],
                ["百分之", "0x4E"],
                ["距离", "0x4F"],
                ["厘米", "0x50"],
                ["明天", "0x51"],
                ["天气", "0x52"],
                ["白天", "0x53"],
                ["夜间", "0x54"],
                ["晴", "0x55"],
                ["多云", "0x56"],
                ["阴", "0x57"],
                ["雨", "0x58"],
                ["雷阵", "0x59"],
                ["小", "0x5A"],
                ["中", "0x5B"],
                ["大", "0x5C"],
                ["夹", "0x5D"],
                ["雪", "0x5E"],
                ["雾", "0x5F"],
                ["霾", "0x60"],
                ["风", "0x61"],
                ["东", "0x62"],
                ["南", "0x63"],
                ["西", "0x64"],
                ["北", "0x65"],
                ["到", "0x66"],
                ["级", "0x67"],
                ["偏", "0x68"],
                ["方向", "0x69"],
                ["空气质量", "0x6A"],
                ["优", "0x6B"],
                ["良", "0x6C"],
                ["轻度污染", "0x6D"],
                ["中度污染", "0x6E"],
                ["重度污染", "0x6F"],
                ["上", "0x70"],
                ["下", "0x71"],
                ["接近", "0x72"],
                ["远离", "0x73"],
                ["灯", "0x74"],
                ["远离", "0x75"],
                ["红色", "0x76"],
                ["绿色", "0x77"],
                ["蓝色", "0x78"],
                ["黄色", "0x79"],
                ["白色", "0x7A"],
                ["叮-音效", "0x7B"],
                ["滴滴滴-闹铃音效", "0x7C"],
                ["叮叮叮叮升-音效", "0x7D"],
                ["叮叮叮叮降-0音效", "0x7E"]]), "Voice");
  this.appendValueInput("Voice_Delay")
      .setCheck(null)
      .appendField("延时");
  this.appendDummyInput();
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(90);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.S23_Init= {
  init: function() { 
  this.appendValueInput("S23_PIN")
      .setCheck(null)
      .appendField("38K 红外遥控接收模块 管脚#");
  this.appendDummyInput();
  this.appendStatementInput("Have_signal")
      .setCheck(null)    .appendField("有信号");
  this.appendStatementInput("NO_signal")
      .setCheck(null)    .appendField("无信号");
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(180);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.F25_Init= {
  init: function() { 
  this.appendDummyInput()
      .appendField("HS-F25 初始化步进电机");
  this.appendValueInput("PIN_1")
      .setCheck(null)
      .setAlign(Blockly.ALIGN_RIGHT)
      .appendField("管脚1# ");
  this.appendValueInput("PIN_2")
      .setCheck(null)
      .setAlign(Blockly.ALIGN_RIGHT)
      .appendField("管脚2#  ");
  this.appendValueInput("PIN_3")
      .setCheck(null)
      .setAlign(Blockly.ALIGN_RIGHT)
      .appendField("管脚3#  ");
  this.appendValueInput("PIN_4")
      .setCheck(null)
      .setAlign(Blockly.ALIGN_RIGHT)
      .appendField("管脚4#  ");
  this.appendValueInput("Step_count")
      .setCheck(null)
      .setAlign(Blockly.ALIGN_RIGHT)
      .appendField("设置步数 ");
  this.appendValueInput("Rotational_speed")
      .setCheck(null)
      .setAlign(Blockly.ALIGN_RIGHT)
      .appendField("设置转速");
  this.setInputsInline(false);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(135);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.PIN= {
  init: function() { 
  this.appendDummyInput()
      .appendField(new Blockly.FieldDropdown([
        ["0","0"],
        ["2","2"],
        ["4","4"],
        ["5","5"],
        ["12","12"],
        ["13","13"],
        ["14","14"],
        ["15","15"],
        ["17","17"],
        ["18","18"],
        ["19","19"],
        ["20","20"],
        ["21","21"],
        ["22","22"],
        ["23","23"],
        ["25","25"],
        ["26","26"],
        ["27","27"],
        ["32","32"],
        ["33","33"]
    ]), "PIN");
  this.setInputsInline(false);
  this.setOutput(true, null);
  this.setColour(135);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};

Blockly.Blocks.F25_Set= {
  init: function() {
  this.appendValueInput("Move_Step")
      .setCheck(null)
      .appendField("HS-F25 步进电机 移动步数");
  this.appendDummyInput();
  this.setInputsInline(true);
  this.setPreviousStatement(true, null);
  this.setNextStatement(true, null);
  this.setColour(135);
  this.setTooltip("");
  this.setHelpUrl("");
  }
};


Blockly.Blocks.VTX316_Init = {
    init: function () {
        this.appendValueInput("Tx_Pin")
            .setCheck(null)
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("语音合成模块初始化 Tx");
        this.appendValueInput("Rx_Pin")
            .setCheck(null)
            .appendField("Rx");
        this.appendDummyInput();
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(90);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.VTX316_YUYINBOBAO = {
    init: function () {
        this.appendValueInput("YUYINBOBAO")
            .setCheck(null)
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("语音合成内容");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(120);
        this.setTooltip("需先将播报内容转为字符串");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.VTX316_YINLIANG = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("播报音量设置(0-9)")
            .appendField(new Blockly.FieldNumber(5, 0, 9, 1), "YINLIANG");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(90);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.VTX316_ZANTING = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("暂停播报");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.VTX316_HUIFU = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("恢复播放");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.TTX_YINXIAO = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("语音合成音效")
            .appendField(new Blockly.FieldDropdown([
                ["警报", "sound101"],
                ["刷卡成功", "sound102"],
                ["风铃声", "sound103"],
                ["刷卡成功", "sound104"],
                ["刷卡成功", "sound105"],
                ["警报", "sound106"],
                ["警报紧急", "sound107"],
                ["叮咚", "sound108"],
                ["叮咚", "sound201"],
                ["警报声", "sound202"],
                ["滴（蜂鸣器）", "sound901"],
                ["滴（蜂鸣器）", "sound902"],
                ["咚", "sound903"],
                ["*注意要加延时*", "0"]
            ]), "YINXIAO");
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.TTX_FAYANREN = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldImage(HS_S77_PL_svg_PATH, 20, 20, "*"))
            .appendField("发言人")
            .appendField(new Blockly.FieldDropdown([
                ["晓玲", "0"],
                ["尹小监", "1"],
                ["易小强", "2"],
                ["田蓓蓓", "3"],
                ["唐老鸭", "4"],
                ["小燕子", "5"],
                ["贝童", "6"],
                ["晓可", "7"]
            ]), "FAYANREN");
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(135);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};



Blockly.Blocks.HC164D_init = {
    init: function () {
        this.appendDummyInput()
            .appendField("数码管74HC164D");
        this.appendDummyInput()
            .appendField(new Blockly.FieldTextInput("SMG1"), "SMG_name");
        this.appendValueInput("CLK_Pin")
            .setCheck(null)
            .appendField("初始化   CLK  管脚 #");
        this.appendValueInput("DIO_Pin")
            .setCheck(null)
            .appendField(" DIO  管脚 #");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(90);
        this.setTooltip("初始化管脚");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.HC164D_display = {
    init: function () {
        this.appendDummyInput()
            .appendField("数码管74HC164D");
        this.appendDummyInput()
            .appendField(new Blockly.FieldTextInput("SMG1"), "SMG_name");
        this.appendValueInput("value")
            .setCheck(null)
            .appendField("显示");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(90);
        this.setTooltip("显示数值");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.SMG_value = {
    init: function () {
        this.appendDummyInput()
            .appendField(new Blockly.FieldDropdown([
                ["0", "0"],
                ["1", "1"],
                ["2", "2"],
                ["3", "3"],
                ["4", "4"],
                ["5", "5"],
                ["6", "6"],
                ["7", "7"],
                ["8", "8"],
                ["9", "9"],
                ["a", "10"],
                ["b", "11"],
                ["c", "12"],
                ["d", "13"],
                ["e", "14"],
                ["f", "15"]
            ]), "SMG_value");
        this.setOutput(true, null);
        this.setColour(90);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.HC595A_init = {
    init: function () {
        this.appendDummyInput()
            .appendField("数码管74HC595A")
            .appendField(new Blockly.FieldTextInput("SMG2"), "SMG_name");
        this.appendValueInput("RCK_Pin")
            .setCheck(null)
            .appendField("初始化   RCK  管脚 #");
        this.appendValueInput("SCK_Pin")
            .setCheck(null)
            .appendField(" SCK  管脚 #");
        this.appendValueInput("DS_Pin")
            .setCheck(null)
            .appendField(" DS  管脚 #");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(195);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.HC595A_display = {
    init: function () {
        this.appendDummyInput()
            .appendField("数码管74HC595A")
            .appendField(new Blockly.FieldTextInput("SMG2"), "SMG_name");
        this.appendValueInput("value")
            .setCheck(null)
            .appendField("显示");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(195);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.yuyingmokuai = {
    init: function () {
        this.appendValueInput("Pin")
            .setCheck(null)
            .appendField("语音模块(127段日常用语)  管脚 #");
        this.appendDummyInput()
            .appendField("播放")
            .appendField(new Blockly.FieldDropdown([
                ["老师", "0x00"],
                ["爸爸", "0x01"],
                ["妈妈", "0x02"],
                ["爷爷", "0x03"],
                ["奶奶", "0x04"],
                ["姥姥", "0x05"],
                ["姥爷", "0x06"],
                ["哥哥", "0x08"],
                ["姐姐", "0x08"],
                ["叔叔", "0x09"],
                ["阿姨", "0x0A"],
                ["上午", "0x0B"],
                ["下午", "0x0C"],
                ["晚上", "0x0D"],
                ["前方", "0x0E"],
                ["厘米", "0x0F"],
                ["新年快乐", "0x10"],
                ["身体健康", "0x11"],
                ["工作顺利", "0x12"],
                ["学习进步", "0x13"],
                ["您好", "0x14"],
                ["谢谢", "0x15"],
                ["的", "0x16"],
                ["祝", "0x17"],
                ["慢走", "0x18"],
                ["欢迎光临", "0x19"],
                ["亲爱的", "0x1A"],
                ["同学们", "0x1B"],
                ["工作辛苦了", "0x1C"],
                ["点", "0x1D"],
                ["打开", "0x1E"],
                ["关闭", "0x1F"],
                ["千", "0x20"],
                ["百", "0x21"],
                ["十/时", "0x22"],
                ["1", "0x23"],
                ["2", "0x24"],
                ["3", "0x25"],
                ["4", "0x26"],
                ["5", "0x27"],
                ["6", "0x28"],
                ["7", "0x29"],
                ["8", "0x2A"],
                ["9", "0x2B"],
                ["0", "0x2C"],
                ["当期", "0x2D"],
                ["转", "0x2E"],
                ["左", "0x2F"],
                ["右", "0x30"],
                ["请", "0x31"],
                ["已", "0x32"],
                ["现在", "0x33"],
                ["是", "0x34"],
                ["红灯", "0x35"],
                ["绿灯", "0x36"],
                ["黄灯", "0x37"],
                ["温度", "0x38"],
                ["湿度", "0x39"],
                ["欢迎常来", "0x3A"],
                ["还有", "0x3B"],
                ["秒", "0x3C"],
                ["分", "0x3D"],
                ["变", "0x3E"],
                ["等", "0x3F"],
                ["下一次", "0x40"],
                ["功能", "0x41"],
                ["障碍物", "0x42"],
                ["世界那么大，我想去看看", "0x43"],
                ["今天", "0x44"],
                ["年", "0x45"],
                ["月", "0x46"],
                ["日", "0x47"],
                ["星期", "0x48"],
                ["农历", "0x49"],
                ["现在时刻", "0x4A"],
                ["北京时间", "0x4B"],
                ["整", "0x4C"],
                ["度", "0x4D"],
                ["百分之", "0x4E"],
                ["距离", "0x4F"],
                ["厘米", "0x50"],
                ["明天", "0x51"],
                ["天气", "0x52"],
                ["白天", "0x53"],
                ["夜间", "0x54"],
                ["晴", "0x55"],
                ["多云", "0x56"],
                ["阴", "0x57"],
                ["雨", "0x58"],
                ["雷阵", "0x59"],
                ["小", "0x5A"],
                ["中", "0x5B"],
                ["大", "0x5C"],
                ["夹", "0x5D"],
                ["雪", "0x5E"],
                ["雾", "0x5F"],
                ["霾", "0x60"],
                ["风", "0x61"],
                ["东", "0x62"],
                ["南", "0x63"],
                ["西", "0x64"],
                ["北", "0x65"],
                ["到", "0x66"],
                ["级", "0x67"],
                ["偏", "0x68"],
                ["方向", "0x69"],
                ["空气质量", "0x6A"],
                ["优", "0x6B"],
                ["良", "0x6C"],
                ["轻度污染", "0x6D"],
                ["中度污染", "0x6E"],
                ["重度污染", "0x6F"],
                ["上", "0x70"],
                ["下", "0x71"],
                ["接近", "0x72"],
                ["远离", "0x73"],
                ["灯", "0x74"],
                ["远离", "0x75"],
                ["红色", "0x76"],
                ["绿色", "0x77"],
                ["蓝色", "0x78"],
                ["黄色", "0x79"],
                ["白色", "0x7A"],
                ["叮-音效", "0x7B"],
                ["滴滴滴-闹铃音效", "0x7C"],
                ["叮叮叮叮升-音效", "0x7D"],
                ["叮叮叮叮降-0音效", "0x7E"]]), "Entry");
        this.appendValueInput("Delay")
            .setCheck(null)
            .appendField("延时");
        this.setInputsInline(true);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(90);
        this.setTooltip("升级为127段常用语");
        this.setHelpUrl("");
    }
};


Blockly.Blocks.TDS_Init = {
    init: function () {
        this.appendValueInput("PIN")
            .setCheck(null)
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("TDS 水质传感器 初始化 引脚#");
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT);
        this.setPreviousStatement(true, null);
        this.setNextStatement(true, null);
        this.setColour(90);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};

Blockly.Blocks.TDS_Get = {
    init: function () {
        this.appendDummyInput()
            .setAlign(Blockly.ALIGN_LEFT)
            .appendField("TDS 水质传感器 获取TDS值");
        this.setOutput(true, null);
        this.setColour(90);
        this.setTooltip("");
        this.setHelpUrl("");
    }
};
