chao преди 8 месеца
родител
ревизия
f8b5151308
променени са 42 файла, в които са добавени 2823 реда и са изтрити 3969 реда
  1. 71 121
      blockly/blocks/python/ai.js
  2. 1 0
      blockly/msg/js/en.js
  3. 1 0
      blockly/msg/js/zh-hans.js
  4. 1 0
      blockly/msg/js/zh-hant.js
  5. 2 2
      index.html
  6. 34 0
      index.js
  7. 24 24
      src/editor.js
  8. 1 2
      src/python/AI/numpyMnist识别.xml
  9. 1 2
      src/python/AI/人脸识别.xml
  10. 2 7
      src/python/AI/数字识别.xml
  11. 3 8
      src/python/AI/物体检测.xml
  12. 2 7
      src/python/AI/猜拳手势识别.xml
  13. 81 87
      src/python/AI/自学习.xml
  14. 95 101
      src/python/AI/自学习识别.xml
  15. 2 7
      src/python/AI/自定义训练识别.xml
  16. 2 7
      src/python/AI/车牌识别.xml
  17. 1 2
      src/python/GPT/图生文.xml
  18. 11 828
      src/python/luzhiyinpin.xml
  19. 79 29
      src/python/video/视频播放.xml
  20. 42 51
      src/python/传感器/光照值.xml
  21. 83 93
      src/python/传感器/温湿度.xml
  22. 272 290
      src/python/图像处理/区域颜色分析.xml
  23. 111 127
      src/python/图像处理/寻找色块.xml
  24. 111 127
      src/python/图像处理/寻找蓝色并追踪.xml
  25. 167 185
      src/python/图像处理/循线-单.xml
  26. 12 136
      src/python/图像处理/条形码识别.xml
  27. 49 76
      src/python/多线程.xml
  28. 186 201
      src/python/屏幕/小游戏:漫步者.xml
  29. 152 160
      src/python/屏幕/按键切换背景色.xml
  30. 97 108
      src/python/屏幕/旋转指定角度.xml
  31. 94 99
      src/python/屏幕/自动切换图片.xml
  32. 59 68
      src/python/屏幕/自动换行.xml
  33. 637 643
      src/python/屏幕/贪吃蛇.xml
  34. 9 9
      src/python/屏幕加载图片.xml
  35. 31 39
      src/python/屏幕显示hello_world.xml
  36. 171 180
      src/python/屏幕显示实心矩形.xml
  37. 121 133
      src/python/照相机.xml
  38. 1 2
      src/python/讯飞/公式识别.xml
  39. 1 2
      src/python/讯飞/在线人脸检测.xml
  40. 1 2
      src/python/讯飞/情绪识别.xml
  41. 1 2
      src/python/讯飞/手势识别.xml
  42. 1 2
      src/python/讯飞/文字识别.xml

+ 71 - 121
blockly/blocks/python/ai.js

@@ -1021,7 +1021,6 @@ Blockly.Python.ai_lcd_showcarvas_set_display = function (block) {
     Blockly.Python.definitions_['v831_import_camera'] = `from maix import camera`;
     Blockly.Python.addVariable(`_canvas_x`, `_canvas_x = 0`, true)
     Blockly.Python.addVariable(`_canvas_y`, `_canvas_y = 0`, true)
-    Blockly.Python.addVariable(`canvas`, `canvas = ""`, true)
     Blockly.Python.definitions_['v831_camera_set'] = `cameraSize = True
 def CAMERATYPE():
     global cameraSize
@@ -1047,7 +1046,7 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
-    pass
+    ScreenOrientation = False
 `
     Blockly.Python.definitions_[`v831_display_show_canvas`] = `def v831_display_show_canvas(displayShow,_canvas_x,_canvas_y):
     global ScreenOrientation,cameraSize
@@ -1210,10 +1209,10 @@ Blockly.Blocks['ai_lcd_textcarvas_new_line'] = {
             .appendField(Blockly.Msg.image_process_text_dispalyStr);
         this.appendValueInput("buttonUp")
             .setCheck("String")
-            .appendField(Blockly.Msg.image_process_text_buttonUp);
+            .appendField(Blockly.Msg.image_process_text_buttonDown);
         this.appendValueInput("buttonDown")
             .setCheck("String")
-            .appendField(Blockly.Msg.image_process_text_buttonDown);
+            .appendField(Blockly.Msg.image_process_text_buttonUp);
         this.appendValueInput("COLOR")
             .setCheck("String")
             .appendField(Blockly.Msg.image_process_text_color);
@@ -1274,7 +1273,7 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
-    pass
+    ScreenOrientation = False
 `
     var _code = ""
 
@@ -1289,7 +1288,7 @@ key_D = BUTTON(7)`
 
     Blockly.Python.definitions_["ai_lcd_textcarvas_new_line"] = `BUTTONNUMBER = 0
 def textCanvasNewLine(canvasName,posax,posay,text,Num,buttonUp,buttonDown,Scale,Color,LineNum):
-    global BUTTONNUMBER
+    global BUTTONNUMBER,ScreenOrientation
     numText = len(text)//Num + 1
     lineHeight = 240
     if ScreenOrientation:
@@ -1405,6 +1404,7 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
+    ScreenOrientation = False
 `
     var _code = ""
     if (color.charAt(0) == '#') {
@@ -1588,6 +1588,7 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
+    ScreenOrientation = False
 `
     if (color.charAt(0) == '#') {
         var d = 0,
@@ -1705,6 +1706,7 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
+    ScreenOrientation = False
 `
     // console.log(xy.split(','),size.split(','))
     let a = xy.split(',')
@@ -1811,6 +1813,7 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
+    ScreenOrientation = False
 `
     if (color.charAt(0) == '#') {
         var d = 0,
@@ -1849,7 +1852,7 @@ Blockly.Blocks['ai_lcd_draw_image_on_canvas'] = {
         this.appendDummyInput()
             .appendField(new Blockly.FieldImage("blockly/media/lcd_draw_image.png", 45, 45, { alt: "*", flipRtl: "FALSE" }));
         this.appendDummyInput()
-            .appendField(Blockly.Msg.image_process_text_on_canvas + Blockly.Msg.image_process_draw_image_title)
+            .appendField(Blockly.Msg.image_process_text_on_canvas + Blockly.Msg.image_process_draw_image_title);
         // .appendField(new Blockly.FieldVariable("canvas"), "varitem")
         // .appendField();
         this.appendValueInput("image_path")
@@ -1860,7 +1863,7 @@ Blockly.Blocks['ai_lcd_draw_image_on_canvas'] = {
             .appendField(Blockly.Msg.OLCD_COORDINATE);
         this.appendValueInput("alpha")
             .setCheck(null)
-            .appendField('图片透明度(范围0~1)');
+            .appendField(Blockly.Msg.image_process_draw_image_alpha);
         this.setInputsInline(false);
         this.setPreviousStatement(true, null);
         this.setNextStatement(true, null);
@@ -1871,7 +1874,6 @@ Blockly.Blocks['ai_lcd_draw_image_on_canvas'] = {
 };
 
 Blockly.Python['ai_lcd_draw_image_on_canvas'] = function (block) {
-    // var variable_name = Blockly.Python.variableDB_.getName(block.getFieldValue('varitem'), Blockly.Variables.NAME_TYPE);
     var value_image_path = Blockly.Python.valueToCode(block, 'image_path', Blockly.Python.ORDER_ATOMIC);
     var value_scale_y = Blockly.Python.valueToCode(block, 'scale_y', Blockly.Python.ORDER_ATOMIC);
     var alpha = Blockly.Python.valueToCode(block, 'alpha', Blockly.Python.ORDER_ATOMIC);
@@ -1904,11 +1906,11 @@ try:
         canvas = image.new(size = (320, 240))
 except:
     canvas = image.new(size = (320, 240))
+    ScreenOrientation = False
 `
     // let alpha = Blockly.Python.valueToCode(block, 'alpha', Blockly.Python.ORDER_ATOMIC)
     // TODO: Assemble Python into code variable.
-    var code = 'canvas.draw_image(' + value_image_path + ',' + value_scale_y + ',alpha=' + alpha + ')\n' +
-        '\n';
+    var code = 'canvas.draw_image(' + value_image_path + ',' + value_scale_y + ',alpha=' + alpha + ')\n';
 
     return code;
 };
@@ -1947,22 +1949,19 @@ Blockly.Python['v831_img_save'] = function (block) {
 
 Blockly.Blocks.v831_img_text = {
     init: function () {
-        this.setHelpUrl(Blockly.Msg.TEXT_TEXT_HELPURL);
+        this.appendValueInput("save_path")
+        .setCheck(null)
+        .appendField(Blockly.Msg.read_img_path_to)
+        this.setOutput(true, null);
         this.setColour("#f0983e");
-        this.appendDummyInput().appendField(this.newQuote_(!0)).appendField(new Blockly.FieldTextInput, "TEXT").appendField(this.newQuote_(!1));
-        this.setOutput(!0, "String");
-        var a = this;
-        this.setTooltip(function () {
-            var b = a.getParent();
-            return b && b.getInputsInline() && b.tooltip || Blockly.Msg.TEXT_TEXT_TOOLTIP
-        })
-    },
-    newQuote_: function (a) {
-        return new Blockly.FieldImage(a == this.RTL ? "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC", 12, 12, '"')
+        this.setTooltip(Blockly.Msg.read_img_path_to);
+        this.setHelpUrl("");
     }
 };
-Blockly.Python.v831_img_text = function (a) {
-    return [Blockly.Python.quote_(a.getFieldValue("TEXT")), Blockly.Python.ORDER_ATOMIC]
+Blockly.Python.v831_img_text = function (block) {
+    var save_path_location = Blockly.Python.valueToCode(block, 'save_path', Blockly.Python.ORDER_ATOMIC);
+    var code = 'image.open(' + save_path_location + ')';
+    return [code,Blockly.Python.ORDER_NONE];
 }
 Blockly.Blocks['v831_img_open'] = {
     init: function () {
@@ -1984,11 +1983,7 @@ Blockly.Blocks['v831_img_open'] = {
 };
 
 Blockly.Python['v831_img_open'] = function (block) {
-    // var variable_name = Blockly.Python.variableDB_.getName(block.getFieldValue('varitem'), Blockly.Variables.NAME_TYPE);
     var save_path_location = Blockly.Python.valueToCode(block, 'save_path', Blockly.Python.ORDER_ATOMIC);
-    // var compression_rate = block.getFieldValue('compression');
-    // TODO: Assemble Python into code variable.
-    // , quality=' + compression_rate + ' 图片压缩
     var code = 'canvas = image.open(' + save_path_location + ')\n';
     return code;
 };
@@ -8732,7 +8727,7 @@ class Number_recognition:
 
 number_recognition = Number_recognition()
 `;
-    var _code = `canvas = canvas.corp(48,8,224,224)
+    var _code = `canvas = canvas.crop(48,8,224,224)
 number_recognition.digitalShowCanvas(canvas)
 `
     return _code;
@@ -9005,7 +9000,7 @@ Blockly.Python.ai_model_object_load = function (block) {
         self.labels = ${a}
         anchors = [5.4, 5.38, 1.65, 2.09, 0.8, 1.83, 2.45, 4.14, 0.46, 0.8]
         self.m = nn.load(model, opt=options)
-        self.yolo2_decoder = decoder.Yolo2(len(labels), anchors, net_in_size=(224,224), net_out_size=(7, 7))
+        self.yolo2_decoder = decoder.Yolo2(len(self.labels), anchors, net_in_size=(224,224), net_out_size=(7, 7))
         self.OBJECTS = {
             "OBJECT_START_X": [],
             "OBJECT_START_Y": [],
@@ -9017,6 +9012,16 @@ Blockly.Python.ai_model_object_load = function (block) {
             "OBJECT_RESULT": [],
         }
     def objectRecognize(self, canvas):
+        self.OBJECTS = {
+            "OBJECT_START_X": [],
+            "OBJECT_START_Y": [],
+            "OBJECT_CONFIDENCE": [],
+            "OBJECT_WIDTH": [],
+            "OBJECT_HEIGHT": [],
+            "OBJECT_CENTER_X": [],
+            "OBJECT_CENTER_Y": [],
+            "OBJECT_RESULT": [],
+        }
         out = self.m.forward(canvas.tobytes(), quantize=True, layout="hwc")
         BOXES, PROBS = self.yolo2_decoder.run(out, nms=0.3, threshold=0.3, img_size=(224,224))
         if len(BOXES):
@@ -9028,13 +9033,14 @@ Blockly.Python.ai_model_object_load = function (block) {
                 self.OBJECTS["OBJECT_WIDTH"].append(BOXOBJ[0]+BOXOBJ[2])
                 self.OBJECTS["OBJECT_HEIGHT"].append(BOXOBJ[1]+ BOXOBJ[3])
                 self.OBJECTS["OBJECT_RESULT"].append(str(self.labels[PROBS[BOXESI][0]]))
-                self.OBJECTS["OBJECT_CONFIDENCE"].append(round(PROBS[BOXESI][1][PROBS[BOXESI][0]]*100, 2)]]))
-                self.OBJECTS["OBJECT_CENTER_X"].append(self.COLORS[BOXESI])
+                self.OBJECTS["OBJECT_CONFIDENCE"].append(round(PROBS[BOXESI][1][PROBS[BOXESI][0]]*100, 2))
+                self.OBJECTS["OBJECT_CENTER_X"].append(int((BOXOBJ[0] +BOXOBJ[0] + BOXOBJ[2])/2))
+                self.OBJECTS["OBJECT_CENTER_Y"].append(int((BOXOBJ[1] +BOXOBJ[1] + BOXOBJ[3])/2))
 
 ObjectRecognition = ObjectRecognition()
 `;
-    var _code = `canvas = canvas.corp(48,8,224,224)
-ObjectRecognition.objectRecognize()
+    var _code = `canvas = canvas.crop(48,8,224,224)
+ObjectRecognition.objectRecognize(canvas)
 `
     return _code;
 }
@@ -9335,14 +9341,14 @@ Blockly.Python.ai_model_Guesswork_load = function (block) {
             self.MORAS["MORA_CONFIDENCE"].append(round(prob*100, 2))
             self.MORAS["MORA_WIDTH"].append(box[0] + box[2])
             self.MORAS["MORA_HEIGHT"].append(box[1] + box[3])
-            self.MORAS["MORA_CENTER_X"].append(int((BOXOBJ[0] +BOXOBJ[0] + BOXOBJ[2])/2))
-            self.MORAS["MORA_CENTER_Y"].append(int((BOXOBJ[1] + BOXOBJ[1] + BOXOBJ[3])/2))
+            self.MORAS["MORA_CENTER_X"].append(int((box[0] +box[0] + box[2])/2))
+            self.MORAS["MORA_CENTER_Y"].append(int((box[1] + box[1] + box[3])/2))
             self.MORAS["MORA_RESULT"].append(self.labels[class_id])
             self.draw_rectangle_with_title(input, box, disp_str)
 
 Mora = Mora()          
 `;
-    var _code = `canvas = canvas.corp(48,8,224,224)
+    var _code = `canvas = canvas.crop(48,8,224,224)
 Mora.process(canvas)
 `
     return _code;
@@ -9901,15 +9907,15 @@ Blockly.Python['ai_model_card_recognition_load'] = function (block) {
             for id in LP_number:
                 string_LP += self.chars[id]
                 # string_LP += str(id)
-            input.draw_string(box[0], box[1], string_LP, color=(225,0,0))
-            input.draw_rectangle(box[0], box[1], box[2], box[3],color=(255,0,0), thickness=-1)
+            input.draw_string(box[0], box[1], string_LP, color=(225,105,0))
+            input.draw_rectangle(box[0], box[1], box[2], box[3],color=(150,0,0), thickness=1)
             self.LPRS["LPR_START_X"].append(box[0])
             self.LPRS["LPR_START_Y"].append(box[1])
-            self.LPRS["LPR_WIDTH"].append()
+            self.LPRS["LPR_WIDTH"].append(box[2]-box[0])
             self.LPRS["LPR_HEIGHT"].append(box[3]-box[1])
             self.LPRS["LPR_RESULT"].append(string_LP)
             self.LPRS["LPR_CENTER_X"].append(int((box[2]+box[0])/2))
-            self.LPRS["LPR_CENTER_Y"].append(int((box[3]+box[1])/2)))
+            self.LPRS["LPR_CENTER_Y"].append(int((box[3]+box[1])/2))
 
     def get_card_data(self, landmark):
         # landmark = i[4][:6]
@@ -9925,7 +9931,7 @@ Blockly.Python['ai_model_card_recognition_load'] = function (block) {
 LPRCARD  = LPR()
 `;
     // TODO: Assemble Python into code variable.
-    var code = `canvas = canvas.corp(48,8,224,224)
+    var code = `canvas = canvas.crop(48,8,224,224)
 LPRCARD.process(canvas)
 `;
     return code;
@@ -10306,10 +10312,7 @@ Blockly.Python['face_recognition_load'] = function (block) {
     Blockly.Python.definitions_['v831_import_from_maix_nn'] = `from maix import nn`
     Blockly.Python.definitions_['v831_import_from_maix_nn_face'] = `from maix.nn.app import face`
     Blockly.Python.definitions_['v831_import_from_maix_nn_FaceRecognize'] = `from maix.nn.app.face import FaceRecognize`
-
-    Blockly.Python.addVariable('score_threshold', 'score_threshold = 70', true);
     Blockly.Python.addVariable('NUMBERPERSON', 'NUMBERPERSON = 0', true);
-    Blockly.Python.addVariable('CLASSNAMEFACELIST', ``, true);
     Blockly.Python.definitions_.import_Face_Recognizer = `class Face_Recognizer:
     max_face_num = 4
     detect_threshold = 0.5
@@ -10323,16 +10326,14 @@ Blockly.Python['face_recognition_load'] = function (block) {
         input_size_fe = (128, 128, 3)
         self.feature_len = 256
         self.features = []
-        print("-- load model:", model)
         m = nn.load(model)
-        print("-- load ok")
-        print("-- load model:", model_fe)
         m_fe = nn.load(model_fe)
-        print("-- load ok")
         self.isLoadRecoredFace = False
         self.CLASSNAMEFACELIST = ${value_class_input}
         self.recognizer = FaceRecognize(m, m_fe, self.feature_len, self.input_size, threshold, nms, max_face_num)
-        print("-- init end")
+        self.FACERECOGNIZES = {
+        }
+        self.FACESRECOGNITONRESULT = []
 
     def get_faces(self, img, std_img = False):
         faces = self.recognizer.get_faces(img, std_img)
@@ -10397,11 +10398,11 @@ Blockly.Python['face_recognition_load'] = function (block) {
             w = int(dis_size[0] - 4 - image.get_string_size(key_r)[0] * 1)
             img.draw_string( w, 2 ,key_r , scale = 1, color = (255, 255, 255), thickness = 2)
     def recognizeShowMessage(self, canvas):
-        FACESRECOGNITONRESULT = FACERECGNIZER.get_faces(canvas)
-        if len(FACESRECOGNITONRESULT):
-            for FACESRECOGNITONRESULTI in FACESRECOGNITONRESULT:
+        self.FACESRECOGNITONRESULT = FACERECGNIZER.get_faces(canvas)
+        if len(self.FACESRECOGNITONRESULT):
+            for FACESRECOGNITONRESULTI in self.FACESRECOGNITONRESULT:
                 if self.isLoadRecoredFace:
-                    if round(FACERECGNIZER.recognize(FACESRECOGNITONRESULTI[3])[1], 2)]])>90
+                    if int(FACERECGNIZER.recognize(FACESRECOGNITONRESULTI[3])[1])>85:
                         canvas.draw_rectangle(FACESRECOGNITONRESULTI[1][0],FACESRECOGNITONRESULTI[1][1], FACESRECOGNITONRESULTI[1][0]+FACESRECOGNITONRESULTI[1][2],FACESRECOGNITONRESULTI[1][1]+ FACESRECOGNITONRESULTI[1][3], color=(51,204,0), thickness=1)
                         canvas.draw_string(40,0, ("".join([str(x) for x in [FACERECGNIZER.recognize(FACESRECOGNITONRESULTI[3])[0], " : ", round(FACERECGNIZER.recognize(FACESRECOGNITONRESULTI[3])[1], 2)]])), scale = 1, color = (51,204,0) , thickness = 1)
                     else:
@@ -10437,7 +10438,7 @@ Blockly.Blocks['face_recognition_if_face_new'] = {
 
 Blockly.Python['face_recognition_if_face_new'] = function (block) {
     var statements_input = Blockly.Python.statementToCode(block, 'input');
-    var code = `for FACESRECOGNITONRESULTI in FACESRECOGNITONRESULT:
+    var code = `for FACESRECOGNITONRESULTI in FACERECGNIZER.FACESRECOGNITONRESULT:
 ${statements_input}
 `
     return code;
@@ -10457,18 +10458,7 @@ Blockly.Blocks['face_recognition_if_face'] = {
 };
 
 Blockly.Python['face_recognition_if_face'] = function (block) {
-    Blockly.Python.addFunction("recognizeShowMessage", `def recognizeShowMessage():
-    global FACESRECOGNITONRESULT,isLoadRecoredFace
-    if len(FACESRECOGNITONRESULT):
-        for FACESRECOGNITONRESULTI in FACESRECOGNITONRESULT:
-            if isLoadRecoredFace:
-                canvas.draw_rectangle(FACESRECOGNITONRESULTI[1][0],FACESRECOGNITONRESULTI[1][1], FACESRECOGNITONRESULTI[1][0]+FACESRECOGNITONRESULTI[1][2],FACESRECOGNITONRESULTI[1][1]+ FACESRECOGNITONRESULTI[1][3], color=(51,204,0), thickness=1)
-                canvas.draw_string(40,0, ("".join([str(x) for x in [FACERECGNIZER.recognize(FACESRECOGNITONRESULTI[3])[0], " : ", round(FACERECGNIZER.recognize(FACESRECOGNITONRESULTI[3])[1], 2)]])), scale = 1, color = (51,204,0) , thickness = 1)
-            else:
-                FACERECGNIZER.map_face(FACESRECOGNITONRESULTI[1],FACESRECOGNITONRESULTI[2],canvas)
-                canvas.draw_rectangle(FACESRECOGNITONRESULTI[1][0],FACESRECOGNITONRESULTI[1][1], FACESRECOGNITONRESULTI[1][0]+FACESRECOGNITONRESULTI[1][2],FACESRECOGNITONRESULTI[1][1]+ FACESRECOGNITONRESULTI[1][3], color=(255,0,0), thickness=1)
-`)
-    var code = `recognizeShowMessage()\n`;
+    var code = ``;
     return code;
 };
 
@@ -10648,7 +10638,7 @@ def _CREATE_TEXT_FILE_WITH_CONTENT(_path, _data, _sep):
         except:
             pass
     canvas.draw_string(0,0, str("${saveFace}") + str(NUMBERPERSON), scale = 1, color = (51,204,0) , thickness = 1)
-    v831_display_show_canvas(canvas)
+    v831_display_show_canvas(canvas,_canvas_x,_canvas_y)
     time.sleep(1000 / 1000)
 `;
     return code;
@@ -10707,7 +10697,7 @@ key_D = BUTTON(7)
     
     canvas.draw_rectangle(0,0, 0+320,0+ 20, color=(0,0,0), thickness=-1)
     canvas.draw_string(40,0, ("".join([str(x) for x in ["${removeFace}", NUMBERPERSON, "${faceData}"]])), scale = 1, color = (255,255,255) , thickness = 1)
-    v831_display_show_canvas(canvas)
+    v831_display_show_canvas(canvas,_canvas_x,_canvas_y)
     time.sleep(1000 / 1000)
     NUMBERPERSON = NUMBERPERSON - 1
     FACERECGNIZER.remove_user(FACERECGNIZER.CLASSNAMEFACELIST[len(FACERECGNIZER)-1])
@@ -10950,7 +10940,8 @@ key_B = BUTTON(8)
 key_C = BUTTON(13)
 key_D = BUTTON(7)
 `
-    var code = `if key_${_type}.is_pressed() and SELFLEARNCOUNT < SELFLEARN.class_num:
+    var code = `canvas = canvas.crop(48, 8, 224, 224)
+if key_${_type}.is_pressed() and SELFLEARNCOUNT < SELFLEARN.class_num:
     while not (key_${_type}.is_pressed() == False):
             time.sleep(0.1)
     SELFLEARN.classifier.add_class_img(canvas)
@@ -11052,7 +11043,8 @@ Blockly.Blocks['ai_model_self_learning_class_verification'] = {
 };
 
 Blockly.Python['ai_model_self_learning_class_verification'] = function (block) {
-    var code = `SELFLEARNidx, SELFLEARNdistance = SELFLEARN.classifier.predict(canvas)
+    var code = `canvas = canvas.crop(48, 8, 224, 224)
+SELFLEARNidx, SELFLEARNdistance = SELFLEARN.classifier.predict(canvas)
 `;
     return code;
 };
@@ -12006,49 +11998,6 @@ Blockly.Python['ai_model_class_start_load'] = function (block) {
     return code;
 }
 
-Blockly.Blocks['ai_model_class_gather'] = {
-    init: function () {
-        this.appendDummyInput()
-            .appendField(Blockly.Msg.ai_model_class_gather);
-        this.setPreviousStatement(true, null);
-        this.setNextStatement(true, null);
-        this.setColour("#ee783a");
-        this.setTooltip(Blockly.Msg.ai_model_class_gather_TOOLTIP);
-        this.setHelpUrl("");
-    }
-};
-
-Blockly.Python['ai_model_class_gather'] = function (block) {
-    var code = '' +
-        '# capture img\n' +
-        'if train_status == 0:\n' +
-        '    if key1.value() == 0 and last_btn_status == 1:\n' +
-        '        #time.sleep_ms(30)\n' +
-        '        #if key1.value() == 1 and (last_btn_status == 1) and (time.ticks_ms() - last_cap_time > 500):\n' +
-        '        last_btn_status = 0\n' +
-        '        last_cap_time = time.ticks_ms()\n' +
-        '        if cap_num < class_num:\n' +
-        '            index = classifier.add_class_img(' + localStorage.getItem("ai_model_class_start_load") + ')\n' +
-        '            cap_num += 1\n' +
-        '        elif cap_num < class_num + sample_num:\n' +
-        '            index = classifier.add_sample_img(' + localStorage.getItem("ai_model_class_start_load") + ')\n' +
-        '            cap_num += 1\n' +
-        '        #else:\n' +
-        '        #    ' + localStorage.getItem("ai_model_class_start_load") + ' = draw_string(' + localStorage.getItem("ai_model_class_start_load") + ', 2, 200, "release boot key please", color=lcd.WHITE,scale=1, bg=lcd.RED)\n' +
-        '    else:\n' +
-        '        #time.sleep_ms(30)\n' +
-        '        if key1.value() == 1 and (last_btn_status == 0):\n' +
-        '            last_btn_status = 1\n' +
-        '        if cap_num < class_num:\n' +
-        '            ' + localStorage.getItem("ai_model_class_start_load") + '.draw_rectangle(-2,0, len("press right key to cap "+class_names[cap_num])*10+8 , 24, fill=True, color=lcd.RED)\n' +
-        '            ' + localStorage.getItem("ai_model_class_start_load") + ' = lcd_draw_string(' + localStorage.getItem("ai_model_class_start_load") + ', 0, 2, "press right key to cap "+class_names[cap_num], color=lcd.WHITE,scale=1,mono_space=False)\n' +
-        '        elif cap_num < class_num + sample_num:\n' +
-        '            ' + localStorage.getItem("ai_model_class_start_load") + '.draw_rectangle(-2,0, len("right key to cap {} {}".format(class_names[(cap_num-class_num) // 5],5 if (cap_num-class_num+1) % 5 == 0 else (cap_num-class_num+1) % 5))*10+8 , 24, fill=True, color=lcd.RED)\n' +
-        '            ' + localStorage.getItem("ai_model_class_start_load") + ' = lcd_draw_string(' + localStorage.getItem("ai_model_class_start_load") + ', 0, 2, "right key to cap {} {}".format(class_names[(cap_num-class_num) // 5],5 if (cap_num-class_num+1) % 5 == 0 else (cap_num-class_num+1) % 5), color=lcd.WHITE,scale=1,mono_space=False)\n' +
-        '\n';
-    return code;
-};
-
 Blockly.Blocks['ai_model_class_data_load'] = {
     init: function () {
         this.appendDummyInput()
@@ -12294,8 +12243,6 @@ Blockly.Python['ai_model_customized_load_setup'] = function (block) {
         "norm": [0.0078125, 0.0078125, 0.0078125],
     }
     def __init__(self):
-        from maix import nn
-        from maix.nn import decoder
         self.model = nn.load(self.m, opt=self.options)
         self.decoder = decoder.Yolo2(len(self.labels), self.anchors, net_in_size=(224, 224), net_out_size=(7, 7))
         self.FACESYOLOS = {
@@ -12313,8 +12260,8 @@ Blockly.Python['ai_model_customized_load_setup'] = function (block) {
         del self.decoder
 
     def faceRecognizeShowResult(self,canvas):
-        out = Yolo.model.forward(canvas, quantize=True, layout="hwc")
-        BOXES, PROBS = Yolo.decoder.run(out, nms=0.3, threshold=0.3, img_size=(224, 224))
+        out = self.model.forward(canvas, quantize=True, layout="hwc")
+        BOXES, PROBS = self.decoder.run(out, nms=0.3, threshold=0.3, img_size=(224, 224))
         self.FACESYOLOS = {
             "FACE_START_X": [],
             "FACE_START_Y": [],
@@ -12330,11 +12277,13 @@ Blockly.Python['ai_model_customized_load_setup'] = function (block) {
                 canvas.draw_string((BOXOBJ[0]),(BOXOBJ[1]), ("".join([str(x) for x in [self.labels[PROBS[BOXESI][0]], ";", str(round((PROBS[BOXESI][1][PROBS[BOXESI][0]]*100), 2)) + str("%")]])), scale = 1, color = (255,0,0) , thickness = 1)
                 canvas.draw_rectangle((BOXOBJ[0]),(BOXOBJ[1]), (BOXOBJ[0])+(BOXOBJ[2]),(BOXOBJ[1])+ (BOXOBJ[3]), color=(255,0,0), thickness=1)
                 self.FACESYOLOS["FACE_START_X"].append(BOXOBJ[0])
-                slef.FACESYOLOS["FACE_START_Y"].append(BOXOBJ[1])
+                self.FACESYOLOS["FACE_START_Y"].append(BOXOBJ[1])
                 self.FACESYOLOS["FACE_WIDTH"].append(BOXOBJ[0]+BOXOBJ[2])
                 self.FACESYOLOS["FACE_HEIGHT"].append(BOXOBJ[1]+BOXOBJ[3])
                 self.FACESYOLOS["FACE_CONFIDENCE"].append(round(PROBS[BOXESI][1][PROBS[BOXESI][0]]*100,2))
-                self.FACESYOLOS["FACE_RESULT"].append(self.labels[PROBS[BOXESI][0])
+                self.FACESYOLOS["FACE_RESULT"].append(self.labels[PROBS[BOXESI][0]])
+                self.FACESYOLOS["FACE_CENTET_X"].append(int((BOXOBJ[0]+BOXOBJ[2])/2))
+                self.FACESYOLOS["FACE_CENTET_Y"].append(int((BOXOBJ[1]+BOXOBJ[3])/2))
 
 
 FaceYolo = Yolo()
@@ -13598,7 +13547,8 @@ Blockly.Python['Numpy_Neural_Network_numpy_loading_model_fun'] = function (block
     return result   
 `
     // TODO: Assemble Python into code variable.
-    var code = `GETNUMPYRESULT = numpyResult(canvas)
+    var code = `canvas = canvas.crop(48,8,224,224)
+GETNUMPYRESULT = numpyResult(canvas)
 if GETNUMPYRESULT != "":
     canvas.draw_string(0,0, (str(GETNUMPYRESULT)), scale = 3, color = (204,204,204) , thickness = 1)
 else:

+ 1 - 0
blockly/msg/js/en.js

@@ -4316,6 +4316,7 @@ Blockly.Msg.image_process_draw_image_title = "Draw Image";
 Blockly.Msg.image_process_draw_image_title_image_path = "Set Image Path:";
 Blockly.Msg.image_process_draw_image_scale_x = "Set Length Scale by X Direction:";
 Blockly.Msg.image_process_draw_image_scale_y = "Set Height Scale by Y Direction:";
+Blockly.Msg.image_process_draw_image_alpha = "Setting transparency(0-1)";
 
 Blockly.Msg.image_process_draw_sensor_image_title = "Draw Image Captured from Camera";
 Blockly.Msg.image_process_draw_sensor_image_path = "Set Image From:";

+ 1 - 0
blockly/msg/js/zh-hans.js

@@ -4274,6 +4274,7 @@ Blockly.Msg.image_process_draw_image_title = "上绘制图片";
 Blockly.Msg.image_process_draw_image_title_image_path = "设置图片文档路径:";
 Blockly.Msg.image_process_draw_image_scale_x = "设置 X 方向的缩放比例:";
 Blockly.Msg.image_process_draw_image_scale_y = "设置 Y 方向的缩放比例:";
+Blockly.Msg.image_process_draw_image_alpha = "设置透明度(0-1)";
 
 Blockly.Msg.image_process_draw_sensor_image_title = "上绘制相机捕捉的图像";
 Blockly.Msg.image_process_draw_sensor_image_path = "设置图像源:";

+ 1 - 0
blockly/msg/js/zh-hant.js

@@ -4746,6 +4746,7 @@ Blockly.Msg.image_process_draw_image_title = "上繪製圖片";
 Blockly.Msg.image_process_draw_image_title_image_path = "設定圖片文件路徑:";
 Blockly.Msg.image_process_draw_image_scale_x = "設定 X 方向的縮放比例:";
 Blockly.Msg.image_process_draw_image_scale_y = "設定 Y 方向的縮放比例:";
+Blockly.Msg.image_process_draw_image_alpha = "設置透明度(0-1)";
 
 Blockly.Msg.image_process_draw_sensor_image_title = "上繪製相機捕捉的圖像";
 Blockly.Msg.image_process_draw_sensor_image_path = "設定圖像源:";

+ 2 - 2
index.html

@@ -3377,9 +3377,9 @@
                                 <li class="container-top-noactive" onclick="clickLoadingExample('luzhiyinpin.xml')">
                                     <div class="translatable_Record_audio">录制音频</div>
                                 </li>
-                                <li class="container-top-noactive" onclick="clickLoadingExample('bofangyinpin.xml')">
+                                <!-- <li class="container-top-noactive" onclick="clickLoadingExample('bofangyinpin.xml')">
                                     <div class="translatable_select_PAF">播放音频</div>
-                                </li>
+                                </li> -->
                                 <!-- <li class="container-top-noactive" onclick="clickLoadingExample('video/音频播放(2).xml')">
                                     <div class="translatable_select_PAF2">播放音频2</div>
                                 </li> -->

+ 34 - 0
index.js

@@ -2451,6 +2451,40 @@ async function runCocoPi() {
   if (text == "\n") {
     return true
   }
+  text = `import time
+from maix import *
+import gc
+import os
+import sys
+sys.path.append('/root/')
+from CocoPi import BUTTON
+from CocoPi import stm8s
+from CocoPi import multiFuncGpio
+from CocoPi import singleRgb
+from CocoPi import LED
+
+gc.enable()
+gc.collect()
+iic_slaver=stm8s()
+iic_slaver.clear()
+PIXEL_LED1= multiFuncGpio(0,0)
+PIXEL_LED2= multiFuncGpio(1,0)
+PIXEL_LED1.pixelInit_()
+PIXEL_LED2.pixelInit_()
+time.sleep(0.1)
+L1=singleRgb()
+L1.setColor(0,0,0)
+L1.show()
+time.sleep(0.2)
+L2=LED()
+L2.out(0)
+del iic_slaver
+del PIXEL_LED1
+del PIXEL_LED2
+del L1
+del L2
+
+${text}`
   window.file_manger_modal = false
   autoContent = false
   $("#runCode").addClass('disabled')

+ 24 - 24
src/editor.js

@@ -1835,22 +1835,22 @@ BlockPyEditor.CATEGORY_MAP = {
         '        </block>' +
         '   </value>' +
         '</block>' +
-        // '<block type="ai_lcd_createnonecarvas">' +
-        // '      <value name="wh">' +
-        // '    <block type="lcd_set_width_height">' +
-        // '      <value name="WIDTH">' +
-        // '        <shadow type="math_number">' +
-        // '          <field name="NUM">320</field>' +
-        // '        </shadow>' +
-        // '      </value>' +
-        // '      <value name="HEIGHT">' +
-        // '        <shadow type="math_number">' +
-        // '          <field name="NUM">240</field>' +
-        // '        </shadow>' +
-        // '      </value>' +
-        // '</block>' +
-        // '      </value>' +
-        // '</block>' +
+        // // '<block type="ai_lcd_createnonecarvas">' +
+        // // '      <value name="wh">' +
+        // // '    <block type="lcd_set_width_height">' +
+        // // '      <value name="WIDTH">' +
+        // // '        <shadow type="math_number">' +
+        // // '          <field name="NUM">320</field>' +
+        // // '        </shadow>' +
+        // // '      </value>' +
+        // // '      <value name="HEIGHT">' +
+        // // '        <shadow type="math_number">' +
+        // // '          <field name="NUM">240</field>' +
+        // // '        </shadow>' +
+        // // '      </value>' +
+        // // '</block>' +
+        // // '      </value>' +
+        // // '</block>' +
         '<block type="ai_lcd_fill_screen_with_rgb">' +
         '   <value name="rgb_value">' +
         '       <block type="ai_lcd_rgb_value_input">' +
@@ -2070,7 +2070,7 @@ BlockPyEditor.CATEGORY_MAP = {
 
         '    <block type="ai_lcd_draw_image_on_canvas">' +
         '      <value name="image_path">' +
-        '           <block type="v831_img_open">' +
+        '           <block type="v831_img_text">' +
         '               <value name="save_path">' +
         '                   <shadow type="text">' +
         '                       <field name="TEXT">/root/preset/img/cocorobo_logo.jpg</field>' +
@@ -2078,11 +2078,6 @@ BlockPyEditor.CATEGORY_MAP = {
         '               </value>' +
         '            </block>' +
         '      </value>' +
-        '      <value name="alpha">' +
-        '           <shadow type="math_number">' +
-        '               <field name="NUM">1</field>' +
-        '           </shadow>' +
-        '       </value>' +
         '      <value name="scale_y">' +
         '        <block type="lcd_set_position">' +
         '          <value name="POSX">' +
@@ -2097,6 +2092,11 @@ BlockPyEditor.CATEGORY_MAP = {
         '          </value>' +
         '        </block>' +
         '      </value>' +
+        '      <value name="alpha">' +
+        '           <shadow type="math_number">' +
+        '               <field name="NUM">1</field>' +
+        '           </shadow>' +
+        '       </value>' +
         '    </block>' +
 
         '<block type="ai_lcd_rotation"></block>' +
@@ -2107,7 +2107,7 @@ BlockPyEditor.CATEGORY_MAP = {
 
         '<category id="catCamera" name="Camera" colour="#60c1bb">' +
         // '<block type="ai_camera_init"></block>' +
-        '<block type="ai_camera_fit_to_screen_size"></block>' +
+        // '<block type="ai_camera_fit_to_screen_size"></block>' +
         // '<block type="ai_camera_windows">' +
         // '</block>' +
         '<block type="ai_camera_snapshot"></block>' +
@@ -2226,7 +2226,7 @@ BlockPyEditor.CATEGORY_MAP = {
         '            </shadow>' +
         '          </value>' +
         '</block>' +
-        '<block type="v831_img_text"><field name="TEXT">/root/user/img/</field></block>' +
+        // '<block type="v831_img_text"><field name="TEXT">/root/user/img/</field></block>' +
         '<block type="v831_img_open">' +
         '          <value name="save_path">' +
         '            <shadow type="text">' +

+ 1 - 2
src/python/AI/numpyMnist识别.xml

@@ -26,8 +26,7 @@
             <next>
               <block type="controls_repeat_forever" id="AOR9r+DS1`:!kj?-YWfl">
                 <statement name="DO">
-                  <block type="ai_camera_fit_to_screen_size" id="!fzj=PD|L6e4Z`d+82aX">
-                    <field name="size">224</field>
+                  <block type="ai_camera_snapshot" id="Vck%afYBkA_BQ-K!u2,7">
                     <next>
                       <block type="Numpy_Neural_Network_numpy_loading_model_fun" id="3@#hcv;uW!K%RE{xzljT">
                         <next>

+ 1 - 2
src/python/AI/人脸识别.xml

@@ -17,8 +17,7 @@
     <next>
       <block type="controls_repeat_forever" id="G;eI?9/bLk8BCQx,uJ!a">
         <statement name="DO">
-          <block type="ai_camera_fit_to_screen_size" id=").i8mMAB6q[8N%`SL}P3">
-            <field name="size">224</field>
+          <block type="ai_camera_snapshot" id="D]zhBu@E6?h2n:)p,SWW">
             <next>
               <block type="face_recognition_load" id="nr7fbKdQsVfEXai[_#v]">
                 <value name="class_input">

+ 2 - 7
src/python/AI/数字识别.xml

@@ -17,16 +17,11 @@
     <next>
       <block type="controls_repeat_forever" id="G;eI?9/bLk8BCQx,uJ!a">
         <statement name="DO">
-          <block type="ai_camera_fit_to_screen_size" id=").i8mMAB6q[8N%`SL}P3">
-            <field name="size">224</field>
+          <block type="ai_camera_snapshot" id="j347H5)v3H6q|BmULab`">
             <next>
               <block type="ai_model_digital_init_loding" id="VlAG+T}#c`V@7mUg(1M$">
                 <next>
-                  <block type="ai_model_digital" id="A[%Ie.#+;=}SU[*h$L%X">
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
-                    </next>
-                  </block>
+                  <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
                 </next>
               </block>
             </next>

+ 3 - 8
src/python/AI/物体检测.xml

@@ -17,16 +17,11 @@
     <next>
       <block type="controls_repeat_forever" id="G;eI?9/bLk8BCQx,uJ!a">
         <statement name="DO">
-          <block type="ai_camera_fit_to_screen_size" id=").i8mMAB6q[8N%`SL}P3">
-            <field name="size">224</field>
+          <block type="ai_camera_snapshot" id="P7WS$RQ,7RL^7;XD*BIm">
             <next>
-              <block type="ai_model_object_load" id="5$=jpL.+pP57^Exor=!p">
+              <block type="ai_model_object_load" id="8_zc^xBa#U]5n=uKM@2Y">
                 <next>
-                  <block type="ai_model_look_attribute" id="a}?KN8L-O1PM8A%[|E?$">
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
-                    </next>
-                  </block>
+                  <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
                 </next>
               </block>
             </next>

+ 2 - 7
src/python/AI/猜拳手势识别.xml

@@ -17,16 +17,11 @@
     <next>
       <block type="controls_repeat_forever" id="G;eI?9/bLk8BCQx,uJ!a">
         <statement name="DO">
-          <block type="ai_camera_fit_to_screen_size" id=").i8mMAB6q[8N%`SL}P3">
-            <field name="size">224</field>
+          <block type="ai_camera_snapshot" id="C@W}L4@7@epqRxC-.9gO">
             <next>
               <block type="ai_model_Guesswork_load" id="deLqc%(IfPNQbA_U%=IA">
                 <next>
-                  <block type="ai_model_Guesswork_look" id="/K-$MJZ-teJ..959).D/">
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
-                    </next>
-                  </block>
+                  <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
                 </next>
               </block>
             </next>

+ 81 - 87
src/python/AI/自学习.xml

@@ -1,113 +1,107 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="%j72E|OZ42Xb,~j=x(Pp" x="21" y="-151">
-    <field name="isScreen">False</field>
+  <block type="ai_lcd_showcarvas_set_cord" id="W7R|_~W5MK*6(A1*ncx(" x="21" y="-125">
+    <value name="xy">
+      <block type="lcd_set_position" id="V@33YjROc@9OWD#E9cB5">
+        <value name="POSX">
+          <shadow type="math_number" id=";5SG63c|BdKrCug!r@5$">
+            <field name="NUM">48</field>
+          </shadow>
+        </value>
+        <value name="POSY">
+          <shadow type="math_number" id="bA%|Dbq3+v?B(b5ikaLE">
+            <field name="NUM">8</field>
+          </shadow>
+        </value>
+      </block>
+    </value>
     <next>
-      <block type="ai_lcd_showcarvas_set_cord" id="W7R|_~W5MK*6(A1*ncx(">
-        <value name="xy">
-          <block type="lcd_set_position" id="V@33YjROc@9OWD#E9cB5">
-            <value name="POSX">
-              <shadow type="math_number" id=";5SG63c|BdKrCug!r@5$">
-                <field name="NUM">48</field>
-              </shadow>
+      <block type="ai_model_self_learning_load" id="B*nlVloQm8d;X?nRczp#">
+        <value name="class_input">
+          <block type="lists_create_with" id="y(op6$e/xn{U~9e3j8{y">
+            <mutation items="3"></mutation>
+            <value name="ADD0">
+              <block type="text" id="`_IHjPepx7y~5v$|@Kr+">
+                <field name="TEXT">Object 1 Name</field>
+              </block>
             </value>
-            <value name="POSY">
-              <shadow type="math_number" id="bA%|Dbq3+v?B(b5ikaLE">
-                <field name="NUM">8</field>
-              </shadow>
+            <value name="ADD1">
+              <block type="text" id="yV9GeA|/n8+P|YW]E^G,">
+                <field name="TEXT">Object 2 Name</field>
+              </block>
+            </value>
+            <value name="ADD2">
+              <block type="text" id="dY2P#+s/tb|oIf7*lair">
+                <field name="TEXT">Object 3 Name</field>
+              </block>
             </value>
           </block>
         </value>
         <next>
-          <block type="ai_model_self_learning_load" id="gzgCPM)25{tb$]=[P#Xb">
-            <value name="class_input">
-              <block type="lists_create_with" id=";gGw=8!(w^%{!515rZeO">
-                <mutation items="3"></mutation>
-                <value name="ADD0">
-                  <block type="text" id="%}c5FT%=}yOQtt1|LqDZ">
-                    <field name="TEXT">Object 1 Name</field>
-                  </block>
-                </value>
-                <value name="ADD1">
-                  <block type="text" id="#)51v*?8,-(z6P3zKLv)">
-                    <field name="TEXT">Object 2 Name</field>
-                  </block>
-                </value>
-                <value name="ADD2">
-                  <block type="text" id="Z=O5|GzYtvh~H_`VpSsX">
-                    <field name="TEXT">Object 3 Name</field>
-                  </block>
-                </value>
+          <block type="variables_set" id="/;mCyjS_H:7Ji1|M_M(q">
+            <field name="VAR">str_display</field>
+            <value name="VALUE">
+              <shadow type="math_number" id=",E{:e{.NH|~E%m)4}@]0">
+                <field name="NUM">0</field>
+              </shadow>
+              <block type="text" id="c+OdM`@_@UpoAAFv:dOE">
+                <field name="TEXT">按C键添加类别,按D键進行学习</field>
               </block>
             </value>
             <next>
-              <block type="variables_set" id="/;mCyjS_H:7Ji1|M_M(q">
-                <field name="VAR">str_display</field>
-                <value name="VALUE">
-                  <shadow type="math_number" id=",E{:e{.NH|~E%m)4}@]0">
-                    <field name="NUM">0</field>
-                  </shadow>
-                  <block type="text" id="c+OdM`@_@UpoAAFv:dOE">
-                    <field name="TEXT">按C键添加类别,按D键進行学习</field>
-                  </block>
-                </value>
-                <next>
-                  <block type="controls_repeat_forever" id="pqagRq6*P%eDslmV%kJ.">
-                    <statement name="DO">
-                      <block type="ai_camera_fit_to_screen_size" id="3?olti;Iu)4W+60.i)u6">
-                        <field name="size">224</field>
-                        <next>
-                          <block type="ai_lcd_textcarvas" id="nnSV:VW,N:!VUnb`8vx/">
-                            <value name="POSA">
-                              <block type="lcd_set_position" id="L{Q`p60%Yx}t5+7p.e%H">
-                                <value name="POSX">
-                                  <shadow type="math_number" id="~|C}(%aA9pKP0,8N~Vz@">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                </value>
-                                <value name="POSY">
-                                  <shadow type="math_number" id="|p#/_P;5`0A9?Z/=fGtJ">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                </value>
-                              </block>
-                            </value>
-                            <value name="CONTENT">
-                              <shadow type="text" id="KT6[TPX=8Gm+aGq}68qS">
-                                <field name="TEXT"></field>
+              <block type="controls_repeat_forever" id="pqagRq6*P%eDslmV%kJ.">
+                <statement name="DO">
+                  <block type="ai_camera_snapshot" id="8o^#u6z)L!gA12wvrpK{">
+                    <next>
+                      <block type="ai_lcd_textcarvas" id="nnSV:VW,N:!VUnb`8vx/">
+                        <value name="POSA">
+                          <block type="lcd_set_position" id="L{Q`p60%Yx}t5+7p.e%H">
+                            <value name="POSX">
+                              <shadow type="math_number" id="~|C}(%aA9pKP0,8N~Vz@">
+                                <field name="NUM">0</field>
                               </shadow>
-                              <block type="variables_get" id="]R^|csr2LvlZV4BDc=W@">
-                                <field name="VAR">str_display</field>
-                              </block>
                             </value>
-                            <value name="COLOR">
-                              <block type="lcd_set_color" id="s1eU7UuW]/L^*e#56$5x">
-                                <field name="COLOR">#ff0000</field>
-                              </block>
-                            </value>
-                            <value name="Scale">
-                              <shadow type="math_number" id="8.cY{ejjV8z_Oy#]E}E2">
-                                <field name="NUM">1</field>
+                            <value name="POSY">
+                              <shadow type="math_number" id="|p#/_P;5`0A9?Z/=fGtJ">
+                                <field name="NUM">0</field>
                               </shadow>
                             </value>
+                          </block>
+                        </value>
+                        <value name="CONTENT">
+                          <shadow type="text" id="KT6[TPX=8Gm+aGq}68qS">
+                            <field name="TEXT"></field>
+                          </shadow>
+                          <block type="variables_get" id="]R^|csr2LvlZV4BDc=W@">
+                            <field name="VAR">str_display</field>
+                          </block>
+                        </value>
+                        <value name="COLOR">
+                          <block type="lcd_set_color" id="s1eU7UuW]/L^*e#56$5x">
+                            <field name="COLOR">#ff0000</field>
+                          </block>
+                        </value>
+                        <value name="Scale">
+                          <shadow type="math_number" id="8.cY{ejjV8z_Oy#]E}E2">
+                            <field name="NUM">1</field>
+                          </shadow>
+                        </value>
+                        <next>
+                          <block type="ai_model_self_learning_add_class" id="p7;?Ei}/hAQY`h]bj@m!">
+                            <field name="button_type">C</field>
                             <next>
-                              <block type="ai_model_self_learning_add_class" id="p7;?Ei}/hAQY`h]bj@m!">
-                                <field name="button_type">C</field>
+                              <block type="ai_model_self_learning_picture" id="4S;FcCInEg*iXPxFE7!d">
+                                <field name="button_type">D</field>
                                 <next>
-                                  <block type="ai_model_self_learning_picture" id="4S;FcCInEg*iXPxFE7!d">
-                                    <field name="button_type">D</field>
-                                    <next>
-                                      <block type="ai_lcd_showcarvas_set_display" id="5%$VU]Wc+Di=y[*4,?u9"></block>
-                                    </next>
-                                  </block>
+                                  <block type="ai_lcd_showcarvas_set_display" id="5%$VU]Wc+Di=y[*4,?u9"></block>
                                 </next>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
-                    </statement>
+                    </next>
                   </block>
-                </next>
+                </statement>
               </block>
             </next>
           </block>

+ 95 - 101
src/python/AI/自学习识别.xml

@@ -1,63 +1,103 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="%j72E|OZ42Xb,~j=x(Pp" x="31" y="15">
-    <field name="isScreen">False</field>
+  <block type="ai_lcd_showcarvas_set_cord" id="W7R|_~W5MK*6(A1*ncx(" x="31" y="41">
+    <value name="xy">
+      <block type="lcd_set_position" id="V@33YjROc@9OWD#E9cB5">
+        <value name="POSX">
+          <shadow type="math_number" id=";5SG63c|BdKrCug!r@5$">
+            <field name="NUM">48</field>
+          </shadow>
+        </value>
+        <value name="POSY">
+          <shadow type="math_number" id="bA%|Dbq3+v?B(b5ikaLE">
+            <field name="NUM">8</field>
+          </shadow>
+        </value>
+      </block>
+    </value>
     <next>
-      <block type="ai_lcd_showcarvas_set_cord" id="W7R|_~W5MK*6(A1*ncx(">
-        <value name="xy">
-          <block type="lcd_set_position" id="V@33YjROc@9OWD#E9cB5">
-            <value name="POSX">
-              <shadow type="math_number" id=";5SG63c|BdKrCug!r@5$">
-                <field name="NUM">48</field>
-              </shadow>
+      <block type="ai_model_self_learning_recognize_load" id="dy69hGR*%gpr(xN$A6ck">
+        <value name="class_input">
+          <block type="lists_create_with" id="$Kl{eEGW*I=K*}J1N9S{">
+            <mutation items="3"></mutation>
+            <value name="ADD0">
+              <block type="text" id="zUUc,KiW]$kI`/ftp38y">
+                <field name="TEXT">1</field>
+              </block>
             </value>
-            <value name="POSY">
-              <shadow type="math_number" id="bA%|Dbq3+v?B(b5ikaLE">
-                <field name="NUM">8</field>
-              </shadow>
+            <value name="ADD1">
+              <block type="text" id="?To9H[U`cx7TF_-T;lO+">
+                <field name="TEXT">2</field>
+              </block>
+            </value>
+            <value name="ADD2">
+              <block type="text" id="4OTYzj(|(:vq5d%5x40L">
+                <field name="TEXT">3</field>
+              </block>
             </value>
           </block>
         </value>
         <next>
-          <block type="ai_model_self_learning_recognize_load" id="dy69hGR*%gpr(xN$A6ck">
-            <value name="class_input">
-              <block type="lists_create_with" id="$Kl{eEGW*I=K*}J1N9S{">
-                <mutation items="3"></mutation>
-                <value name="ADD0">
-                  <block type="text" id="zUUc,KiW]$kI`/ftp38y">
-                    <field name="TEXT">1</field>
-                  </block>
-                </value>
-                <value name="ADD1">
-                  <block type="text" id="?To9H[U`cx7TF_-T;lO+">
-                    <field name="TEXT">2</field>
-                  </block>
-                </value>
-                <value name="ADD2">
-                  <block type="text" id="4OTYzj(|(:vq5d%5x40L">
-                    <field name="TEXT">3</field>
-                  </block>
-                </value>
-              </block>
-            </value>
-            <next>
-              <block type="controls_repeat_forever" id="pqagRq6*P%eDslmV%kJ.">
-                <statement name="DO">
-                  <block type="ai_camera_fit_to_screen_size" id="3?olti;Iu)4W+60.i)u6">
-                    <field name="size">224</field>
+          <block type="controls_repeat_forever" id="pqagRq6*P%eDslmV%kJ.">
+            <statement name="DO">
+              <block type="ai_camera_snapshot" id="Z.aG;c;UPeo:d~r_}p%w">
+                <next>
+                  <block type="ai_model_self_learning_class_verification" id="AihW1:gB/^[:BwlE~045">
                     <next>
-                      <block type="ai_model_self_learning_class_verification" id="AihW1:gB/^[:BwlE~045">
+                      <block type="ai_lcd_textcarvas" id="3*k1H#[8AQDn;$?yhE$^">
+                        <value name="POSA">
+                          <block type="lcd_set_position" id="]OM$,XXbSEBIQakLD!c8">
+                            <value name="POSX">
+                              <shadow type="math_number" id="@*j);_R8+3Cos#/Zm:AV">
+                                <field name="NUM">0</field>
+                              </shadow>
+                            </value>
+                            <value name="POSY">
+                              <shadow type="math_number" id="un|4caegvgDUv$2xQt6j">
+                                <field name="NUM">0</field>
+                              </shadow>
+                            </value>
+                          </block>
+                        </value>
+                        <value name="CONTENT">
+                          <shadow type="text" id="KT6[TPX=8Gm+aGq}68qS">
+                            <field name="TEXT"></field>
+                          </shadow>
+                          <block type="text_join" id="*q@)3$tjD4%8#qKQSCX%">
+                            <mutation items="2"></mutation>
+                            <value name="ADD0">
+                              <block type="text" id="1CA.M7M,ACS`R?Cu{tK0">
+                                <field name="TEXT">识别名称:</field>
+                              </block>
+                            </value>
+                            <value name="ADD1">
+                              <block type="ai_model_self_learning_result" id="E]o?W*!?,~B6}]mB!7jc">
+                                <field name="TYPE">X</field>
+                              </block>
+                            </value>
+                          </block>
+                        </value>
+                        <value name="COLOR">
+                          <block type="lcd_set_color" id="PxiF+JU.q-Hw!$M;nCo|">
+                            <field name="COLOR">#ff0000</field>
+                          </block>
+                        </value>
+                        <value name="Scale">
+                          <shadow type="math_number" id="z15zT_X2j3-MNA_;nG(n">
+                            <field name="NUM">1</field>
+                          </shadow>
+                        </value>
                         <next>
-                          <block type="ai_lcd_textcarvas" id="3*k1H#[8AQDn;$?yhE$^">
+                          <block type="ai_lcd_textcarvas" id="|Cpa_SPKfI]a:FEa?KJl">
                             <value name="POSA">
-                              <block type="lcd_set_position" id="]OM$,XXbSEBIQakLD!c8">
+                              <block type="lcd_set_position" id="e6:g9BjP|`V0Va_@WI^^">
                                 <value name="POSX">
-                                  <shadow type="math_number" id="@*j);_R8+3Cos#/Zm:AV">
+                                  <shadow type="math_number" id=")V~Y7BWL`z%-OpH.=,nt">
                                     <field name="NUM">0</field>
                                   </shadow>
                                 </value>
                                 <value name="POSY">
-                                  <shadow type="math_number" id="un|4caegvgDUv$2xQt6j">
-                                    <field name="NUM">0</field>
+                                  <shadow type="math_number" id="dP|J5*~;)$0_Gp#LE/rQ">
+                                    <field name="NUM">50</field>
                                   </shadow>
                                 </value>
                               </block>
@@ -66,87 +106,41 @@
                               <shadow type="text" id="KT6[TPX=8Gm+aGq}68qS">
                                 <field name="TEXT"></field>
                               </shadow>
-                              <block type="text_join" id="*q@)3$tjD4%8#qKQSCX%">
+                              <block type="text_join" id="7:UUa{kU0#UxO+s:J:C%">
                                 <mutation items="2"></mutation>
                                 <value name="ADD0">
-                                  <block type="text" id="1CA.M7M,ACS`R?Cu{tK0">
-                                    <field name="TEXT">识别名称:</field>
+                                  <block type="text" id="ig4Oof~))fz^6iWD#*U3">
+                                    <field name="TEXT">置信度:</field>
                                   </block>
                                 </value>
                                 <value name="ADD1">
-                                  <block type="ai_model_self_learning_result" id="E]o?W*!?,~B6}]mB!7jc">
-                                    <field name="TYPE">X</field>
+                                  <block type="ai_model_self_learning_result" id="J,#+S4NVSoqieX+e]cX`">
+                                    <field name="TYPE">Y</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <value name="COLOR">
-                              <block type="lcd_set_color" id="PxiF+JU.q-Hw!$M;nCo|">
+                              <block type="lcd_set_color" id=")5YK*))7;:(-GmbR+@xE">
                                 <field name="COLOR">#ff0000</field>
                               </block>
                             </value>
                             <value name="Scale">
-                              <shadow type="math_number" id="z15zT_X2j3-MNA_;nG(n">
+                              <shadow type="math_number" id="Z_`dX$F5tIar[$[LoDPq">
                                 <field name="NUM">1</field>
                               </shadow>
                             </value>
                             <next>
-                              <block type="ai_lcd_textcarvas" id="|Cpa_SPKfI]a:FEa?KJl">
-                                <value name="POSA">
-                                  <block type="lcd_set_position" id="e6:g9BjP|`V0Va_@WI^^">
-                                    <value name="POSX">
-                                      <shadow type="math_number" id=")V~Y7BWL`z%-OpH.=,nt">
-                                        <field name="NUM">0</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="POSY">
-                                      <shadow type="math_number" id="dP|J5*~;)$0_Gp#LE/rQ">
-                                        <field name="NUM">50</field>
-                                      </shadow>
-                                    </value>
-                                  </block>
-                                </value>
-                                <value name="CONTENT">
-                                  <shadow type="text" id="KT6[TPX=8Gm+aGq}68qS">
-                                    <field name="TEXT"></field>
-                                  </shadow>
-                                  <block type="text_join" id="7:UUa{kU0#UxO+s:J:C%">
-                                    <mutation items="2"></mutation>
-                                    <value name="ADD0">
-                                      <block type="text" id="ig4Oof~))fz^6iWD#*U3">
-                                        <field name="TEXT">置信度:</field>
-                                      </block>
-                                    </value>
-                                    <value name="ADD1">
-                                      <block type="ai_model_self_learning_result" id="J,#+S4NVSoqieX+e]cX`">
-                                        <field name="TYPE">Y</field>
-                                      </block>
-                                    </value>
-                                  </block>
-                                </value>
-                                <value name="COLOR">
-                                  <block type="lcd_set_color" id=")5YK*))7;:(-GmbR+@xE">
-                                    <field name="COLOR">#ff0000</field>
-                                  </block>
-                                </value>
-                                <value name="Scale">
-                                  <shadow type="math_number" id="Z_`dX$F5tIar[$[LoDPq">
-                                    <field name="NUM">1</field>
-                                  </shadow>
-                                </value>
-                                <next>
-                                  <block type="ai_lcd_showcarvas_set_display" id="5%$VU]Wc+Di=y[*4,?u9"></block>
-                                </next>
-                              </block>
+                              <block type="ai_lcd_showcarvas_set_display" id="5%$VU]Wc+Di=y[*4,?u9"></block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
-                </statement>
+                </next>
               </block>
-            </next>
+            </statement>
           </block>
         </next>
       </block>

+ 2 - 7
src/python/AI/自定义训练识别.xml

@@ -17,8 +17,7 @@
     <next>
       <block type="controls_repeat_forever" id="G;eI?9/bLk8BCQx,uJ!a">
         <statement name="DO">
-          <block type="ai_camera_fit_to_screen_size" id=").i8mMAB6q[8N%`SL}P3">
-            <field name="size">224</field>
+          <block type="ai_camera_snapshot" id="q=$%4QcsZLB.G7QE%?U8">
             <next>
               <block type="ai_model_customized_load_setup" id="MC;*H#QbcZUiS;+CoQge">
                 <field name="model_path">autologistics</field>
@@ -58,11 +57,7 @@
                   </block>
                 </value>
                 <next>
-                  <block type="ai_model_customized_if_got" id=")yu;fA|q:%OZNh,r3JdK">
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
-                    </next>
-                  </block>
+                  <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
                 </next>
               </block>
             </next>

+ 2 - 7
src/python/AI/车牌识别.xml

@@ -17,16 +17,11 @@
     <next>
       <block type="controls_repeat_forever" id="G;eI?9/bLk8BCQx,uJ!a">
         <statement name="DO">
-          <block type="ai_camera_fit_to_screen_size" id=").i8mMAB6q[8N%`SL}P3">
-            <field name="size">224</field>
+          <block type="ai_camera_snapshot" id="%is5fNMB1Ng@N@rr~UY8">
             <next>
               <block type="ai_model_card_recognition_load" id="/8X_(`IplzCsGdw=O0#l">
                 <next>
-                  <block type="ai_model_card_xy" id="CL*hsw+oEjgM-L1$Pmk]">
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
-                    </next>
-                  </block>
+                  <block type="ai_lcd_showcarvas_set_display" id="G53S9xg,q:=U=lWRg95p"></block>
                 </next>
               </block>
             </next>

+ 1 - 2
src/python/GPT/图生文.xml

@@ -25,8 +25,7 @@
             <next>
               <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
                 <statement name="DO">
-                  <block type="ai_camera_fit_to_screen_size" id="FXI{hFCLy=*xB?M[Q-)^">
-                    <field name="size">320</field>
+                  <block type="ai_camera_snapshot" id="s3+{3fiHC/!nPx/+cjch">
                     <next>
                       <block type="ai_v831_button_read_released" id="$x~gT)UEvgf1df~{m4l@">
                         <field name="button_type">C</field>

+ 11 - 828
src/python/luzhiyinpin.xml

@@ -1,831 +1,14 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="2PHESD`!?Rz;,*CXs|@U" x="190" y="-282">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="procedures_callnoreturn" id="SLAXL/P~.W~xa2xY{,}3">
-        <mutation name="扫码联网"></mutation>
-        <next>
-          <block type="variables_set" id=";su3LI/ZZns%NLWA*d//">
-            <field name="VAR">voice_src</field>
-            <value name="VALUE">
-              <shadow type="math_number" id="!^ZX}~l$sF;f-/DQu-5r">
-                <field name="NUM">0</field>
-              </shadow>
-              <block type="text" id="oT`DE#=w.I#oC9)N1=;l">
-                <field name="TEXT">/root/user/audio/test.wav</field>
-              </block>
-            </value>
-            <next>
-              <block type="variables_set" id="V2+_z5Oc#{g^z?)?2rJ)">
-                <field name="VAR">voice_content</field>
-                <value name="VALUE">
-                  <shadow type="math_number" id=";$j$R{vGDSL{@o!SHtdl">
-                    <field name="NUM">0</field>
-                  </shadow>
-                  <block type="text" id="Tf!/$j7D(n#2pDV[_~=C">
-                    <field name="TEXT"></field>
-                  </block>
-                </value>
-                <next>
-                  <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
-                    <statement name="DO">
-                      <block type="ai_lcd_clearcanvas" id="zl$?(cS]-@,Q}3MA0vC)">
-                        <field name="varitem">canvas</field>
-                        <next>
-                          <block type="ai_v831_button_read_released" id="3vUa,}htbZ+6nJ?M^OVX">
-                            <field name="button_type">C</field>
-                            <statement name="input">
-                              <block type="procedures_callnoreturn" id="5KPn(9tmm/ygWmof]dVk">
-                                <mutation name="语音录制"></mutation>
-                                <next>
-                                  <block type="ai_lcd_textcarvas" id="+?n}`}s/o~p}?4KO:zV!">
-                                    <field name="varitem">canvas</field>
-                                    <value name="POSA">
-                                      <block type="lcd_set_position" id="yC26t!%x*+3Rhqn9H01Y">
-                                        <value name="POSX">
-                                          <shadow type="math_number" id="!fZ}o(U!5!7@-mtU1=)!">
-                                            <field name="NUM">40</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="POSY">
-                                          <shadow type="math_number" id="NPP^#/[.?:?@QZT*`oPS">
-                                            <field name="NUM">40</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
-                                    </value>
-                                    <value name="CONTENT">
-                                      <shadow type="text" id="oT{subxArGDDoOjt}~I(">
-                                        <field name="TEXT">语音文件识别中...</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="COLOR">
-                                      <block type="lcd_set_color" id="PAgYv8~SngF):8Q4mBtL">
-                                        <field name="COLOR">#ffffff</field>
-                                      </block>
-                                    </value>
-                                    <value name="Scale">
-                                      <shadow type="math_number" id="efOV[,@Zo]n#~duH-*NM">
-                                        <field name="NUM">2</field>
-                                      </shadow>
-                                    </value>
-                                    <next>
-                                      <block type="ai_lcd_showcarvas_set_display" id="#,~^f88~9)fUr.QV$.]R">
-                                        <field name="varitem">canvas</field>
-                                        <next>
-                                          <block type="procedures_callnoreturn" id="XML0G9.+8Rz$B;h3TiiA">
-                                            <mutation name="语音识别">
-                                              <arg name="x"></arg>
-                                            </mutation>
-                                            <value name="ARG0">
-                                              <block type="variables_get" id="k2H^tHVkX=s+lkE1!9%=">
-                                                <field name="VAR">voice_src</field>
-                                              </block>
-                                            </value>
-                                          </block>
-                                        </next>
-                                      </block>
-                                    </next>
-                                  </block>
-                                </next>
-                              </block>
-                            </statement>
-                            <next>
-                              <block type="controls_if" id="RRdx%spM1(z9U.M0+-4$">
-                                <value name="IF0">
-                                  <block type="logic_compare" id="h2!pHsr}UO2-?{D%}{bq">
-                                    <field name="OP">NEQ</field>
-                                    <value name="A">
-                                      <block type="variables_get" id="v64NrkKtc*Bu!uXMg5sZ">
-                                        <field name="VAR">voice_content</field>
-                                      </block>
-                                    </value>
-                                    <value name="B">
-                                      <block type="text" id="SQ`[/vg/?mNPpqshZS8H">
-                                        <field name="TEXT"></field>
-                                      </block>
-                                    </value>
-                                  </block>
-                                </value>
-                                <statement name="DO0">
-                                  <block type="ai_lcd_textcarvas" id="PuqO8/Q9G^HNsKU*J(|E">
-                                    <field name="varitem">canvas</field>
-                                    <value name="POSA">
-                                      <block type="lcd_set_position" id="F?Y$|`lv{{LO~M}3JE#%">
-                                        <value name="POSX">
-                                          <shadow type="math_number" id="3/.4Yd]N#$mM!cR6NU3s">
-                                            <field name="NUM">0</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="POSY">
-                                          <shadow type="math_number" id="dL[jSFu5V,ku24olPR9S">
-                                            <field name="NUM">50</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
-                                    </value>
-                                    <value name="CONTENT">
-                                      <shadow type="text" id="%:zvi7pTGPVGAS!(-?*W">
-                                        <field name="TEXT"></field>
-                                      </shadow>
-                                      <block type="variables_get" id="0Rj$,]Nh3cQ}TBeQcgx.">
-                                        <field name="VAR">voice_content</field>
-                                      </block>
-                                    </value>
-                                    <value name="COLOR">
-                                      <block type="lcd_set_color" id="Q8/e5@6j@NEJ_h!kjqAU">
-                                        <field name="COLOR">#33ff33</field>
-                                      </block>
-                                    </value>
-                                    <value name="Scale">
-                                      <shadow type="math_number" id="FK(OE.H`:v$g5fRd!ciG">
-                                        <field name="NUM">1</field>
-                                      </shadow>
-                                    </value>
-                                  </block>
-                                </statement>
-                                <next>
-                                  <block type="ai_lcd_textcarvas" id="Rs^aHf5nZeq?uuX_QJ)j">
-                                    <field name="varitem">canvas</field>
-                                    <value name="POSA">
-                                      <block type="lcd_set_position" id="+@[ewWr_w3GYjE6_yR40">
-                                        <value name="POSX">
-                                          <shadow type="math_number" id="zx9ZFaw?JqSL$MT$2Ib*">
-                                            <field name="NUM">200</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="POSY">
-                                          <shadow type="math_number" id="YR(aFs:@C.^uO=toN+oO">
-                                            <field name="NUM">0</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
-                                    </value>
-                                    <value name="CONTENT">
-                                      <shadow type="text" id="%:zvi7pTGPVGAS!(-?*W">
-                                        <field name="TEXT">C键录制并识别音频文件</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="COLOR">
-                                      <block type="lcd_set_color" id="pP$bKXegBvcKJ1V|-qlv">
-                                        <field name="COLOR">#ffffff</field>
-                                      </block>
-                                    </value>
-                                    <value name="Scale">
-                                      <shadow type="math_number" id="r@!gkhJ}{v{6-,+Z,R90">
-                                        <field name="NUM">1</field>
-                                      </shadow>
-                                    </value>
-                                    <next>
-                                      <block type="ai_lcd_showcarvas_set_display" id="bEE9sNGO]JzqRK6*-wD_">
-                                        <field name="varitem">canvas</field>
-                                      </block>
-                                    </next>
-                                  </block>
-                                </next>
-                              </block>
-                            </next>
-                          </block>
-                        </next>
-                      </block>
-                    </statement>
-                  </block>
-                </next>
-              </block>
-            </next>
-          </block>
-        </next>
-      </block>
-    </next>
-  </block>
-  <block type="procedures_defnoreturn" id="(@*HpQ6@szFrq5_!wi@G" x="750" y="6">
-    <field name="NAME">语音录制</field>
-    <statement name="STACK">
-      <block type="ai_lcd_clearcanvas" id="BF|g766@+~#)}O:+;Ht$">
-        <field name="varitem">canvas</field>
-        <next>
-          <block type="ai_lcd_textcarvas" id="TzT]rp*J]`vHD,nHU%!/">
-            <field name="varitem">canvas</field>
-            <value name="POSA">
-              <block type="lcd_set_position" id="=`bRcm1r#{UPnJd$pjU?">
-                <value name="POSX">
-                  <shadow type="math_number" id="#sr!P{z^@AZUOe+?BL0P">
-                    <field name="NUM">40</field>
-                  </shadow>
-                </value>
-                <value name="POSY">
-                  <shadow type="math_number" id="71Xj,E2WwT~FdeVN%Q[1">
-                    <field name="NUM">40</field>
-                  </shadow>
-                </value>
-              </block>
-            </value>
-            <value name="CONTENT">
-              <shadow type="text" id="uP?[phOJIQkCjLq9CU1K">
-                <field name="TEXT">录制语音中……(4秒)</field>
-              </shadow>
-            </value>
-            <value name="COLOR">
-              <block type="lcd_set_color" id="OG1gd8-uJM4ZL54GF`^X">
-                <field name="COLOR">#ffffff</field>
-              </block>
-            </value>
-            <value name="Scale">
-              <shadow type="math_number" id="+%=Ni-S-S-8:yBNypj{C">
-                <field name="NUM">2</field>
-              </shadow>
-            </value>
-            <next>
-              <block type="ai_lcd_showcarvas_set_display" id="Y,kL9iIv?.g.;)d,JpR1">
-                <field name="varitem">canvas</field>
-                <next>
-                  <block type="ai_mphone_record_setting" id="U6SbtvBbba{GD09iddhu">
-                    <value name="record_time">
-                      <shadow type="math_number" id="chl{kvnC/P4Aig!==)dy">
-                        <field name="NUM">4</field>
-                      </shadow>
-                    </value>
-                    <value name="path">
-                      <shadow type="text" id="_SQ-zIDr8z%cFy~g?kwh">
-                        <field name="TEXT">/root/user/audio/record.wav</field>
-                      </shadow>
-                      <block type="variables_get" id="b5N{EKwV~4.P9o5EcDAy">
-                        <field name="VAR">voice_src</field>
-                      </block>
-                    </value>
-                    <next>
-                      <block type="ai_lcd_clearcanvas" id="D_1|Rp0(:N?.OOhQ$q.T">
-                        <field name="varitem">canvas</field>
-                        <next>
-                          <block type="ai_lcd_textcarvas" id="4.#vceW?1UZD26Sr/Jcs">
-                            <field name="varitem">canvas</field>
-                            <value name="POSA">
-                              <block type="lcd_set_position" id="Oxd).ELG}hIZM+#i{i7x">
-                                <value name="POSX">
-                                  <shadow type="math_number" id="eial+svqu@JrRlW/1Amq">
-                                    <field name="NUM">40</field>
-                                  </shadow>
-                                </value>
-                                <value name="POSY">
-                                  <shadow type="math_number" id="iHg^bJCa!i,uuqtlr)*9">
-                                    <field name="NUM">40</field>
-                                  </shadow>
-                                </value>
-                              </block>
-                            </value>
-                            <value name="CONTENT">
-                              <shadow type="text" id="XtXD[-t/8y4S%6Qn0O,L">
-                                <field name="TEXT">语音录制结束</field>
-                              </shadow>
-                            </value>
-                            <value name="COLOR">
-                              <block type="lcd_set_color" id="F*~0j]6{BVEg3Zwu9!cl">
-                                <field name="COLOR">#ffffff</field>
-                              </block>
-                            </value>
-                            <value name="Scale">
-                              <shadow type="math_number" id="`QWoNV9OMU8EeA1T_hZ)">
-                                <field name="NUM">2</field>
-                              </shadow>
-                            </value>
-                            <next>
-                              <block type="ai_lcd_showcarvas_set_display" id="0{ZP(]M[!pbi/(cLTnkW">
-                                <field name="varitem">canvas</field>
-                                <next>
-                                  <block type="ai_lcd_clearcanvas" id="(BP!Uj^/%8yf6=.g1=x*">
-                                    <field name="varitem">canvas</field>
-                                  </block>
-                                </next>
-                              </block>
-                            </next>
-                          </block>
-                        </next>
-                      </block>
-                    </next>
-                  </block>
-                </next>
-              </block>
-            </next>
-          </block>
-        </next>
-      </block>
-    </statement>
-  </block>
-  <block type="procedures_defnoreturn" id="MdO0;x:sGHz$S(A{|%pN" x="1223" y="-16">
-    <field name="NAME">扫码联网</field>
-    <statement name="STACK">
-      <block type="controls_if" id="QFmk|4Cw6}n21!nrke#y">
-        <mutation else="1"></mutation>
-        <value name="IF0">
-          <block type="esp32_main_controller_get_wifi_connection_status" id="(x)B:OwYh|EpoS,iU~y2"></block>
-        </value>
-        <statement name="DO0">
-          <block type="variables_set" id="oldLjE9h_V);0gwLUqLp">
-            <field name="VAR">state</field>
-            <value name="VALUE">
-              <shadow type="math_number" id="+ZY$%3S?9_fayoksWjG:">
-                <field name="NUM">0</field>
-              </shadow>
-              <block type="text" id="S~`1o~82TueNdD6TT*fr">
-                <field name="TEXT"></field>
-              </block>
-            </value>
-          </block>
-        </statement>
-        <statement name="ELSE">
-          <block type="variables_set" id="k]EGN;l^*}3jz{T?Ce#F">
-            <field name="VAR">state</field>
-            <value name="VALUE">
-              <shadow type="math_number" id="+ZY$%3S?9_fayoksWjG:">
-                <field name="NUM">0</field>
-              </shadow>
-              <block type="text" id="8W*i4NJ;Vru3e1[^ou_c">
-                <field name="TEXT">扫码联网</field>
-              </block>
-            </value>
-            <next>
-              <block type="variables_set" id="2GkC(H8?w!`rDB?Bx?J=">
-                <field name="VAR">识别结果</field>
-                <value name="VALUE">
-                  <shadow type="math_number" id=";$j$R{vGDSL{@o!SHtdl">
-                    <field name="NUM">0</field>
-                  </shadow>
-                  <block type="text" id="Slp_:m=z,Hklsa)s{@PY">
-                    <field name="TEXT"></field>
-                  </block>
-                </value>
-                <next>
-                  <block type="controls_repeat_forever" id=":LF5=[ApbR;GVmzmh|`~">
-                    <statement name="DO">
-                      <block type="controls_if" id="(%Lc=pe(bSVHpTsYm?/{">
-                        <mutation elseif="1"></mutation>
-                        <value name="IF0">
-                          <block type="logic_compare" id="t`Fs.OucEz)@5eXC$5J*">
-                            <field name="OP">EQ</field>
-                            <value name="A">
-                              <block type="variables_get" id="h/:RncBzY$kT|1p*xpWA">
-                                <field name="VAR">state</field>
-                              </block>
-                            </value>
-                            <value name="B">
-                              <block type="text" id="x#U|#$aY5?0E=pc^Ux[G">
-                                <field name="TEXT">扫码联网</field>
-                              </block>
-                            </value>
-                          </block>
-                        </value>
-                        <statement name="DO0">
-                          <block type="variables_set" id="Cu;$;(2=5xDCN0X_`V)3">
-                            <field name="VAR">canvas</field>
-                            <value name="VALUE">
-                              <shadow type="math_number" id="ymMA[a~?0W9-vqU[`H3_">
-                                <field name="NUM">0</field>
-                              </shadow>
-                              <block type="ai_camera_snapshot" id="=1}#3hbmJ?he_09~HeDn"></block>
-                            </value>
-                            <next>
-                              <block type="variables_set" id="#rZEhIT(h!ixt0TY8k#$">
-                                <field name="VAR">qrCode</field>
-                                <value name="VALUE">
-                                  <shadow type="math_number" id="ymMA[a~?0W9-vqU[`H3_">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                  <block type="ai_vision_find_qrcode" id="XR1FTyBZ~BfT3B^h?2Xw">
-                                    <field name="varitem">canvas</field>
-                                  </block>
-                                </value>
-                                <next>
-                                  <block type="ai_lcd_draw_rectangle" id="XI5$[-#i^sfT(Anxj[[I">
-                                    <field name="varitem">canvas</field>
-                                    <field name="rect_type">fillrect</field>
-                                    <value name="POSA">
-                                      <block type="lcd_set_position" id="XHp~TJ9.ZOoO3Bp.CRPH">
-                                        <value name="POSX">
-                                          <shadow type="math_number" id="~0P_+`}ChKF6K5#/3_?[">
-                                            <field name="NUM">0</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="POSY">
-                                          <shadow type="math_number" id="8*Fi]9hQE^]ta:+AGSq#">
-                                            <field name="NUM">0</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
-                                    </value>
-                                    <value name="POSB">
-                                      <block type="lcd_set_width_height" id="_:HI_$5=X6gCu8zg?]].">
-                                        <value name="WIDTH">
-                                          <shadow type="math_number" id="LxbbW3:5h`0FA=Q+a6,-">
-                                            <field name="NUM">320</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="HEIGHT">
-                                          <shadow type="math_number" id=")Q|6ozkgm|%Oy@(w+njY">
-                                            <field name="NUM">20</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
-                                    </value>
-                                    <value name="COLOR">
-                                      <block type="lcd_set_color" id="f]`#WIQ0g.nhp)v_f+ra">
-                                        <field name="COLOR">#000000</field>
-                                      </block>
-                                    </value>
-                                    <next>
-                                      <block type="ai_lcd_textcarvas" id="o?Xee3@7Z7d1shgt=.~!">
-                                        <field name="varitem">canvas</field>
-                                        <value name="POSA">
-                                          <block type="lcd_set_position" id="%*a8qVFhJ[_J};+GRxvP">
-                                            <value name="POSX">
-                                              <shadow type="math_number" id="45#Ks%g9].:V;gyLe@7v">
-                                                <field name="NUM">50</field>
-                                              </shadow>
-                                            </value>
-                                            <value name="POSY">
-                                              <shadow type="math_number" id=";8`kH5D%t*Eoa{SFW-7U">
-                                                <field name="NUM">0</field>
-                                              </shadow>
-                                            </value>
-                                          </block>
-                                        </value>
-                                        <value name="CONTENT">
-                                          <shadow type="text" id="Yx!}/WC#[6zWWcyEp^k4">
-                                            <field name="TEXT">请扫描平台Wi-Fi二维码联网</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="COLOR">
-                                          <block type="lcd_set_color" id="iLjzPIF%lYI;?KBQ#/[$">
-                                            <field name="COLOR">#ffffff</field>
-                                          </block>
-                                        </value>
-                                        <value name="Scale">
-                                          <shadow type="math_number" id="nqzOJydkF/($.[m$H6Pv">
-                                            <field name="NUM">1</field>
-                                          </shadow>
-                                        </value>
-                                        <next>
-                                          <block type="controls_forEach" id="-:L$lT0zA7mfToS/t,.F">
-                                            <field name="VAR">i</field>
-                                            <value name="LIST">
-                                              <block type="variables_get" id="-{c41z,w]Y#[QB8KCcVz">
-                                                <field name="VAR">qrCode</field>
-                                              </block>
-                                            </value>
-                                            <statement name="DO">
-                                              <block type="ai_lcd_textcarvas" id="8a{z9sANpfx,m-E^?[ws">
-                                                <field name="varitem">canvas</field>
-                                                <value name="POSA">
-                                                  <block type="lcd_set_position" id="ioxr$KyBF@y^:cSUW[b)">
-                                                    <value name="POSX">
-                                                      <shadow type="math_number" id=":{s,U4pDy7MmNdkzh[db">
-                                                        <field name="NUM">0</field>
-                                                      </shadow>
-                                                      <block type="ai_vision_qrcode_get_info" id="+JV^_A]p9mWwj4XMccW=">
-                                                        <field name="varitem">i</field>
-                                                        <field name="get_info">x</field>
-                                                      </block>
-                                                    </value>
-                                                    <value name="POSY">
-                                                      <shadow type="math_number" id="{4h;Hl}{5HM,4vA;q#K#">
-                                                        <field name="NUM">0</field>
-                                                      </shadow>
-                                                      <block type="ai_vision_qrcode_get_info" id="3@C4V}bZ+$Zq%4rv{VSc">
-                                                        <field name="varitem">i</field>
-                                                        <field name="get_info">y</field>
-                                                      </block>
-                                                    </value>
-                                                  </block>
-                                                </value>
-                                                <value name="CONTENT">
-                                                  <shadow type="text" id="!4*_1/3)tAg3ygOM.|YW">
-                                                    <field name="TEXT"></field>
-                                                  </shadow>
-                                                  <block type="ai_vision_qrcode_get_info" id="u}v%Q4HoI0Jx3=a~f`{8">
-                                                    <field name="varitem">i</field>
-                                                    <field name="get_info">payload</field>
-                                                  </block>
-                                                </value>
-                                                <value name="COLOR">
-                                                  <block type="lcd_set_color" id="0uqSLJgr-ah=.H6F0Zg*">
-                                                    <field name="COLOR">#ff0000</field>
-                                                  </block>
-                                                </value>
-                                                <value name="Scale">
-                                                  <shadow type="math_number" id="$Eq^l2JOL,XJt3X@v/W2">
-                                                    <field name="NUM">1</field>
-                                                  </shadow>
-                                                </value>
-                                                <next>
-                                                  <block type="ai_lcd_draw_rectangle" id="qZ)[-$CRx*WU%R5F-C(b">
-                                                    <field name="varitem">canvas</field>
-                                                    <field name="rect_type">rect</field>
-                                                    <value name="POSA">
-                                                      <block type="lcd_set_position" id="%{ni*3`X:MOwcP+$x]Ce" inline="false">
-                                                        <value name="POSX">
-                                                          <shadow type="math_number" id=":{s,U4pDy7MmNdkzh[db">
-                                                            <field name="NUM">0</field>
-                                                          </shadow>
-                                                          <block type="ai_vision_qrcode_get_info" id="d`=/VVl{9bDr(rQsN=X9">
-                                                            <field name="varitem">i</field>
-                                                            <field name="get_info">x</field>
-                                                          </block>
-                                                        </value>
-                                                        <value name="POSY">
-                                                          <shadow type="math_number" id="{4h;Hl}{5HM,4vA;q#K#">
-                                                            <field name="NUM">0</field>
-                                                          </shadow>
-                                                          <block type="ai_vision_qrcode_get_info" id="w3FPKp`({0i%TOSAkfx|">
-                                                            <field name="varitem">i</field>
-                                                            <field name="get_info">y</field>
-                                                          </block>
-                                                        </value>
-                                                      </block>
-                                                    </value>
-                                                    <value name="POSB">
-                                                      <block type="lcd_set_width_height" id="w_%[j;O|%aA;,b/TN?OG" inline="false">
-                                                        <value name="WIDTH">
-                                                          <shadow type="math_number" id="k(B:~2AOLJV~zLnbe)89">
-                                                            <field name="NUM">320</field>
-                                                          </shadow>
-                                                          <block type="ai_vision_qrcode_get_info" id=".|m1N_[}die?dg8`TdGY">
-                                                            <field name="varitem">i</field>
-                                                            <field name="get_info">w1</field>
-                                                          </block>
-                                                        </value>
-                                                        <value name="HEIGHT">
-                                                          <shadow type="math_number" id="c)u)Q:9p$d5b5%4Lqa9$">
-                                                            <field name="NUM">240</field>
-                                                          </shadow>
-                                                          <block type="ai_vision_qrcode_get_info" id="$~EzG-QSb%]fHlU@Z+S2">
-                                                            <field name="varitem">i</field>
-                                                            <field name="get_info">h2</field>
-                                                          </block>
-                                                        </value>
-                                                      </block>
-                                                    </value>
-                                                    <value name="COLOR">
-                                                      <block type="lcd_set_color" id="8]sijmt:%XtQlj}tgIas">
-                                                        <field name="COLOR">#ff0000</field>
-                                                      </block>
-                                                    </value>
-                                                    <next>
-                                                      <block type="variables_set" id="KVP}T[SMJJey84#dVw0T">
-                                                        <field name="VAR">识别结果</field>
-                                                        <value name="VALUE">
-                                                          <shadow type="math_number" id="~c`T-qSJp-={%Hp!.bS)">
-                                                            <field name="NUM">0</field>
-                                                          </shadow>
-                                                          <block type="text_split_string_by_delimiter" id="LTbE[`1q4E(OeDv;,H=^">
-                                                            <field name="delimiter">;</field>
-                                                            <value name="string_input">
-                                                              <block type="ai_vision_qrcode_get_info" id="t-M^Cy5b#OLC+;)kF^N7">
-                                                                <field name="varitem">i</field>
-                                                                <field name="get_info">payload</field>
-                                                              </block>
-                                                            </value>
-                                                          </block>
-                                                        </value>
-                                                      </block>
-                                                    </next>
-                                                  </block>
-                                                </next>
-                                              </block>
-                                            </statement>
-                                            <next>
-                                              <block type="ai_lcd_showcarvas_set_display" id="_+g?Q4R`)mrc!;|8w=Y~">
-                                                <field name="varitem">canvas</field>
-                                                <next>
-                                                  <block type="controls_if" id="u4,JM+iCSC81$RBCpu5C">
-                                                    <value name="IF0">
-                                                      <block type="logic_compare" id="Ah]X%z9GHc.{/Wc6W2F#">
-                                                        <field name="OP">NEQ</field>
-                                                        <value name="A">
-                                                          <block type="variables_get" id="Cg#*ndDK+W9_!H,48}zu">
-                                                            <field name="VAR">识别结果</field>
-                                                          </block>
-                                                        </value>
-                                                        <value name="B">
-                                                          <block type="text" id="Ztob3cliQa=zb*$!QQsu">
-                                                            <field name="TEXT"></field>
-                                                          </block>
-                                                        </value>
-                                                      </block>
-                                                    </value>
-                                                    <statement name="DO0">
-                                                      <block type="variables_set" id="_(vhjruUh#kTA56w|d3d">
-                                                        <field name="VAR">SSID</field>
-                                                        <value name="VALUE">
-                                                          <shadow type="math_number" id="3K*LFc1ljS];!d#%F-4`">
-                                                            <field name="NUM">0</field>
-                                                          </shadow>
-                                                          <block type="text_getSubstring" id="HA}:BUUN/Lh]02:)p?t$">
-                                                            <mutation at1="true" at2="false"></mutation>
-                                                            <field name="WHERE1">FROM_START</field>
-                                                            <field name="WHERE2">LAST</field>
-                                                            <value name="STRING">
-                                                              <shadow type="text" id="@E%p@FmN[ioed_)`3-hh">
-                                                                <field name="TEXT">abc</field>
-                                                              </shadow>
-                                                              <block type="list_order_item" id="5th9:-d^^}a|jY6xj(wn">
-                                                                <field name="list_order">[</field>
-                                                                <value name="list_name">
-                                                                  <shadow type="text_list" id=")%{okxbD{Wt^eD@~NxWZ">
-                                                                    <field name="TEXT"></field>
-                                                                  </shadow>
-                                                                  <block type="variables_get" id="2!t]1Q6[YvWk.Qxvj#L|">
-                                                                    <field name="VAR">识别结果</field>
-                                                                  </block>
-                                                                </value>
-                                                                <value name="list_order_item">
-                                                                  <shadow type="math_number" id="U-6}MxOaKjYG*H#Oi{q[">
-                                                                    <field name="NUM">0</field>
-                                                                  </shadow>
-                                                                </value>
-                                                              </block>
-                                                            </value>
-                                                            <value name="AT1">
-                                                              <block type="math_number" id="Ay7P[`wsl5wzWu]e7H!k">
-                                                                <field name="NUM">5</field>
-                                                              </block>
-                                                            </value>
-                                                          </block>
-                                                        </value>
-                                                        <next>
-                                                          <block type="variables_set" id="BN[#=^R.N=8{4!T?0#qC">
-                                                            <field name="VAR">PASS</field>
-                                                            <value name="VALUE">
-                                                              <shadow type="math_number" id="TE/Z6~Io-j^00#j83r.6">
-                                                                <field name="NUM">0</field>
-                                                              </shadow>
-                                                              <block type="text_getSubstring" id="UL=9DP#qoN}.QG@*FHU!">
-                                                                <mutation at1="true" at2="false"></mutation>
-                                                                <field name="WHERE1">FROM_START</field>
-                                                                <field name="WHERE2">LAST</field>
-                                                                <value name="STRING">
-                                                                  <shadow type="text" id="@E%p@FmN[ioed_)`3-hh">
-                                                                    <field name="TEXT">abc</field>
-                                                                  </shadow>
-                                                                  <block type="list_order_item" id="_2**VKdEi@)N9l;p4LM~">
-                                                                    <field name="list_order">[</field>
-                                                                    <value name="list_name">
-                                                                      <shadow type="text_list" id=")%{okxbD{Wt^eD@~NxWZ">
-                                                                        <field name="TEXT"></field>
-                                                                      </shadow>
-                                                                      <block type="variables_get" id="~qdfyZP,~jtF#*T1+;sY">
-                                                                        <field name="VAR">识别结果</field>
-                                                                      </block>
-                                                                    </value>
-                                                                    <value name="list_order_item">
-                                                                      <shadow type="math_number" id="U-kC|FfTvDa%2qTHC},N">
-                                                                        <field name="NUM">1</field>
-                                                                      </shadow>
-                                                                    </value>
-                                                                  </block>
-                                                                </value>
-                                                                <value name="AT1">
-                                                                  <block type="math_number" id="cS/pZonr0iyWq3|Wp;#~">
-                                                                    <field name="NUM">5</field>
-                                                                  </block>
-                                                                </value>
-                                                              </block>
-                                                            </value>
-                                                            <next>
-                                                              <block type="esp32_main_controller_wifi_connect_internet" id="=jnPdoUl*ACAi-85g}J{">
-                                                                <value name="ssid">
-                                                                  <shadow type="text" id="([(K4/ZxJESaAK;i9lLA">
-                                                                    <field name="TEXT">ENTER_YOUR_SSID</field>
-                                                                  </shadow>
-                                                                  <block type="variables_get" id="1LX-)-jH},^9TXj).4c!">
-                                                                    <field name="VAR">SSID</field>
-                                                                  </block>
-                                                                </value>
-                                                                <value name="password">
-                                                                  <shadow type="text" id="[I.[L1]LZv$^U{xAXTxT">
-                                                                    <field name="TEXT">ENTER_YOUR_PASSWORD</field>
-                                                                  </shadow>
-                                                                  <block type="variables_get" id="xPj$i.?ita46~OsGowZU">
-                                                                    <field name="VAR">PASS</field>
-                                                                  </block>
-                                                                </value>
-                                                                <next>
-                                                                  <block type="controls_if" id="?[+@RI,Y^+j%?Ao;M%B;">
-                                                                    <mutation else="1"></mutation>
-                                                                    <value name="IF0">
-                                                                      <block type="esp32_main_controller_get_wifi_connection_status" id="]c2?qP})|]EfvYFEQROi"></block>
-                                                                    </value>
-                                                                    <statement name="DO0">
-                                                                      <block type="variables_set" id="},Y9asDZyTyB#yB7L+et">
-                                                                        <field name="VAR">state</field>
-                                                                        <value name="VALUE">
-                                                                          <shadow type="math_number" id="+ZY$%3S?9_fayoksWjG:">
-                                                                            <field name="NUM">0</field>
-                                                                          </shadow>
-                                                                          <block type="text" id="sq7I]qNXrv;Ny}TBNw)V">
-                                                                            <field name="TEXT"></field>
-                                                                          </block>
-                                                                        </value>
-                                                                      </block>
-                                                                    </statement>
-                                                                    <statement name="ELSE">
-                                                                      <block type="variables_set" id="~+E/j(}}J52t^zVL+y@2">
-                                                                        <field name="VAR">state</field>
-                                                                        <value name="VALUE">
-                                                                          <shadow type="math_number" id="+ZY$%3S?9_fayoksWjG:">
-                                                                            <field name="NUM">0</field>
-                                                                          </shadow>
-                                                                          <block type="text" id="zsSG)QM`+IL9a[7${WoB">
-                                                                            <field name="TEXT">扫码联网</field>
-                                                                          </block>
-                                                                        </value>
-                                                                      </block>
-                                                                    </statement>
-                                                                    <next>
-                                                                      <block type="variables_set" id="P+,6h[)bpFd;~gF3F*|)">
-                                                                        <field name="VAR">识别结果</field>
-                                                                        <value name="VALUE">
-                                                                          <shadow type="math_number" id="+ZY$%3S?9_fayoksWjG:">
-                                                                            <field name="NUM">0</field>
-                                                                          </shadow>
-                                                                          <block type="text" id="DD1$OM5bjJtDC6eh2mn5">
-                                                                            <field name="TEXT"></field>
-                                                                          </block>
-                                                                        </value>
-                                                                      </block>
-                                                                    </next>
-                                                                  </block>
-                                                                </next>
-                                                              </block>
-                                                            </next>
-                                                          </block>
-                                                        </next>
-                                                      </block>
-                                                    </statement>
-                                                  </block>
-                                                </next>
-                                              </block>
-                                            </next>
-                                          </block>
-                                        </next>
-                                      </block>
-                                    </next>
-                                  </block>
-                                </next>
-                              </block>
-                            </next>
-                          </block>
-                        </statement>
-                        <value name="IF1">
-                          <block type="logic_compare" id="L%xi)sGkTLkoTNk47eJf">
-                            <field name="OP">EQ</field>
-                            <value name="A">
-                              <block type="variables_get" id="3X*+8oW5yb?@1(yc4UHn">
-                                <field name="VAR">state</field>
-                              </block>
-                            </value>
-                            <value name="B">
-                              <block type="text" id="rPI(=(sLw[Bhi/Qv#xnt">
-                                <field name="TEXT"></field>
-                              </block>
-                            </value>
-                          </block>
-                        </value>
-                        <statement name="DO1">
-                          <block type="controls_flow_statements" id="HWi$%Sz4Oq[rHo#*l-KW">
-                            <field name="FLOW">BREAK</field>
-                          </block>
-                        </statement>
-                      </block>
-                    </statement>
-                  </block>
-                </next>
-              </block>
-            </next>
-          </block>
-        </statement>
-      </block>
-    </statement>
-  </block>
-  <block type="procedures_defnoreturn" id="}Co_!_Sq*DI,UQ]n,Jf4" x="608" y="733">
-    <mutation>
-      <arg name="x"></arg>
-    </mutation>
-    <field name="NAME">语音识别</field>
-    <statement name="STACK">
-      <block type="variables_set" id="EDubD)`;:KTre5FiT2XP">
-        <field name="VAR">voice_content</field>
-        <value name="VALUE">
-          <shadow type="math_number" id=".FtO6jdMk6bYI,YionX]">
-            <field name="NUM">0</field>
-          </shadow>
-          <block type="cocopi_chatGpt_voice_to_text_loading" id="xeLc!.Q,fDnr9(E$uxyB">
-            <value name="NAME">
-              <shadow type="text" id="ee?,}IUA:r4F9.DiH_z_">
-                <field name="TEXT">/root/user/audio/record.wav</field>
-              </shadow>
-            </value>
-          </block>
-        </value>
-      </block>
-    </statement>
+  <block type="ai_mphone_record_setting" id="k,q!Q)5?|%x[1Z[LmFQ?" x="243" y="-178">
+    <value name="record_time">
+      <shadow type="math_number" id="T+X86DlHi~ZbhKCd9.O|">
+        <field name="NUM">4</field>
+      </shadow>
+    </value>
+    <value name="path">
+      <shadow type="text" id="wH24j)=S],W[uMikd(1`">
+        <field name="TEXT">/root/user/audio/record.wav</field>
+      </shadow>
+    </value>
   </block>
 </xml>

+ 79 - 29
src/python/video/视频播放.xml

@@ -1,41 +1,91 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_video_set_init" id="s)iT]W_MIi^-OsA@9wsy" x="283" y="55">
+  <block type="ai_video_set_init" id="s)iT]W_MIi^-OsA@9wsy" x="219" y="80">
     <next>
-      <block type="controls_repeat_forever" id="%:9Rv@N|dqAPU].S!N^{">
-        <statement name="DO">
-          <block type="ai_video_set" id="n(I|j8=hj1EZdRYZg.;D">
-            <value name="path">
-              <shadow type="text" id="OymB=!5;Rgl$)^fiUe5E">
-                <field name="TEXT">/root/preset/video/output_240_240.mp4</field>
-              </shadow>
-            </value>
-            <next>
-              <block type="controls_forEach" id="xwO7XC6WCon;-@AiW5Tq">
-                <field name="VAR">i</field>
-                <value name="LIST">
-                  <block type="ai_video_set_stats" id="U.UmMvlIig$;4r1GXTuE"></block>
+      <block type="variables_set" id="F+*Q[~=Z}mnY?QH|d4^-">
+        <field name="VAR">stop_video</field>
+        <value name="VALUE">
+          <shadow type="math_number" id="/IJd@2Vx,eJI)hjF{GMM">
+            <field name="NUM">0</field>
+          </shadow>
+        </value>
+        <next>
+          <block type="controls_repeat_forever" id="Y2HxoM|F816klda];L_J">
+            <statement name="DO">
+              <block type="ai_video_set" id="n(I|j8=hj1EZdRYZg.;D">
+                <value name="path">
+                  <shadow type="text" id="OymB=!5;Rgl$)^fiUe5E">
+                    <field name="TEXT">/root/preset/video/output_240_240.mp4</field>
+                  </shadow>
                 </value>
-                <statement name="DO">
-                  <block type="controls_if" id="j+=t3%uNe=M9m`yGHCVy">
-                    <value name="IF0">
-                      <block type="ai_v831_button_read_pressed" id="(ac(yohOC)ATe?gHwF(5">
+                <next>
+                  <block type="controls_forEach" id="xwO7XC6WCon;-@AiW5Tq">
+                    <field name="VAR">i</field>
+                    <value name="LIST">
+                      <block type="ai_video_set_stats" id="U.UmMvlIig$;4r1GXTuE"></block>
+                    </value>
+                    <statement name="DO">
+                      <block type="ai_v831_button_read_released" id="#B~RnbaVk5FpBMR*]Vy(">
                         <field name="button_type">C</field>
+                        <statement name="input">
+                          <block type="variables_set" id="=K;Yp$-$?Th?Yf.$wr`Y">
+                            <field name="VAR">stop_video</field>
+                            <value name="VALUE">
+                              <shadow type="math_number" id="A)*J$;wiuui~^-%AN@2O">
+                                <field name="NUM">1</field>
+                              </shadow>
+                            </value>
+                          </block>
+                        </statement>
+                        <next>
+                          <block type="ai_v831_button_read_released" id="`5PB7}Nm_;uMU`qvw4iN">
+                            <field name="button_type">D</field>
+                            <statement name="input">
+                              <block type="variables_set" id="`{e9.GDvpcdP#S|C72/Y">
+                                <field name="VAR">stop_video</field>
+                                <value name="VALUE">
+                                  <shadow type="math_number" id="j:u$p5HIdWe(C{0-O!cb">
+                                    <field name="NUM">0</field>
+                                  </shadow>
+                                </value>
+                              </block>
+                            </statement>
+                            <next>
+                              <block type="controls_if" id="ZY1PAOZ,RXuLyCTVPJ}e">
+                                <value name="IF0">
+                                  <block type="logic_compare" id="-F7E8gkTMuW/.m|^HS*t">
+                                    <field name="OP">EQ</field>
+                                    <value name="A">
+                                      <block type="variables_get" id="kD*_|-XFmfd1)2C@CLL^">
+                                        <field name="VAR">stop_video</field>
+                                      </block>
+                                    </value>
+                                    <value name="B">
+                                      <block type="math_number" id="x@eS6]I%UZ_tNt*OWvyK">
+                                        <field name="NUM">1</field>
+                                      </block>
+                                    </value>
+                                  </block>
+                                </value>
+                                <statement name="DO0">
+                                  <block type="ai_video_stop_play" id="#5,QjWSS+?){2._6e$@]"></block>
+                                </statement>
+                                <next>
+                                  <block type="ai_video_set_play" id="3AgsrkDB^NVNa*oY9m%z">
+                                    <field name="varitem">i</field>
+                                  </block>
+                                </next>
+                              </block>
+                            </next>
+                          </block>
+                        </next>
                       </block>
-                    </value>
-                    <statement name="DO0">
-                      <block type="ai_video_stop_play" id="eU:}3:MR/xrw`vM|n{P."></block>
                     </statement>
-                    <next>
-                      <block type="ai_video_set_play" id="3AgsrkDB^NVNa*oY9m%z">
-                        <field name="varitem">i</field>
-                      </block>
-                    </next>
                   </block>
-                </statement>
+                </next>
               </block>
-            </next>
+            </statement>
           </block>
-        </statement>
+        </next>
       </block>
     </next>
   </block>

+ 42 - 51
src/python/传感器/光照值.xml

@@ -1,64 +1,55 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="}jJ1qH#$I5@6.MpK!wqX" x="275" y="304">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="CJRsu#Z|G{w@,lsD!ba{">
-        <statement name="DO">
-          <block type="ai_lcd_clearcanvas" id="as#Cg@W,1m?P=/#,@[s3">
-            <field name="varitem">canvas</field>
-            <next>
-              <block type="ai_lcd_textcarvas" id=",LV^1d@8sq)$I1itT#=,">
-                <field name="varitem">canvas</field>
-                <value name="POSA">
-                  <block type="lcd_set_position" id="j#(*CZt{#z{frFyb8GtE">
-                    <value name="POSX">
-                      <shadow type="math_number" id="X|?S4NL,r]/nLJE6lfz%">
-                        <field name="NUM">0</field>
-                      </shadow>
-                    </value>
-                    <value name="POSY">
-                      <shadow type="math_number" id="uo$ui_lGmu0|XgS]`s20">
-                        <field name="NUM">0</field>
-                      </shadow>
-                    </value>
-                  </block>
+  <block type="controls_repeat_forever" id="CJRsu#Z|G{w@,lsD!ba{" x="275" y="330">
+    <statement name="DO">
+      <block type="ai_lcd_clearcanvas" id="as#Cg@W,1m?P=/#,@[s3">
+        <next>
+          <block type="ai_lcd_textcarvas" id=",LV^1d@8sq)$I1itT#=,">
+            <value name="POSA">
+              <block type="lcd_set_position" id="j#(*CZt{#z{frFyb8GtE">
+                <value name="POSX">
+                  <shadow type="math_number" id="X|?S4NL,r]/nLJE6lfz%">
+                    <field name="NUM">0</field>
+                  </shadow>
                 </value>
-                <value name="CONTENT">
-                  <shadow type="text" id="sG3ORn@b:[z^InzIrxqF">
-                    <field name="TEXT"></field>
+                <value name="POSY">
+                  <shadow type="math_number" id="uo$ui_lGmu0|XgS]`s20">
+                    <field name="NUM">0</field>
                   </shadow>
-                  <block type="text_join" id="X#|)2|#bp#J;@,z*8Vc2">
-                    <mutation items="2"></mutation>
-                    <value name="ADD0">
-                      <block type="text" id="oBd9TCAM=HvdL-,=09nY">
-                        <field name="TEXT">获取光照值:</field>
-                      </block>
-                    </value>
-                    <value name="ADD1">
-                      <block type="esp32_main_controller_get_light" id="U#iWI!(A-i]*m,sC6cv["></block>
-                    </value>
-                  </block>
                 </value>
-                <value name="COLOR">
-                  <block type="lcd_set_color" id="4fO6N2F=ZFT5.,~:R4Bb">
-                    <field name="COLOR">#3366ff</field>
+              </block>
+            </value>
+            <value name="CONTENT">
+              <shadow type="text" id="sG3ORn@b:[z^InzIrxqF">
+                <field name="TEXT"></field>
+              </shadow>
+              <block type="text_join" id="X#|)2|#bp#J;@,z*8Vc2">
+                <mutation items="2"></mutation>
+                <value name="ADD0">
+                  <block type="text" id="oBd9TCAM=HvdL-,=09nY">
+                    <field name="TEXT">获取光照值:</field>
                   </block>
                 </value>
-                <value name="Scale">
-                  <shadow type="math_number" id="Fr%o|XKNIZ(i*!$l~@u7">
-                    <field name="NUM">1</field>
-                  </shadow>
+                <value name="ADD1">
+                  <block type="esp32_main_controller_get_light" id="U#iWI!(A-i]*m,sC6cv["></block>
                 </value>
-                <next>
-                  <block type="ai_lcd_showcarvas_set_display" id="a#`hs]t3jRLSTk8B8qPd">
-                    <field name="varitem">canvas</field>
-                  </block>
-                </next>
               </block>
+            </value>
+            <value name="COLOR">
+              <block type="lcd_set_color" id="4fO6N2F=ZFT5.,~:R4Bb">
+                <field name="COLOR">#3366ff</field>
+              </block>
+            </value>
+            <value name="Scale">
+              <shadow type="math_number" id="Fr%o|XKNIZ(i*!$l~@u7">
+                <field name="NUM">1</field>
+              </shadow>
+            </value>
+            <next>
+              <block type="ai_lcd_showcarvas_set_display" id="a#`hs]t3jRLSTk8B8qPd"></block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 83 - 93
src/python/传感器/温湿度.xml

@@ -1,24 +1,80 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="}jJ1qH#$I5@6.MpK!wqX" x="254" y="312">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="CJRsu#Z|G{w@,lsD!ba{">
-        <statement name="DO">
-          <block type="ai_lcd_clearcanvas" id="as#Cg@W,1m?P=/#,@[s3">
-            <field name="varitem">canvas</field>
+  <block type="controls_repeat_forever" id="CJRsu#Z|G{w@,lsD!ba{" x="254" y="338">
+    <statement name="DO">
+      <block type="ai_lcd_clearcanvas" id="as#Cg@W,1m?P=/#,@[s3">
+        <next>
+          <block type="ai_lcd_textcarvas" id=",LV^1d@8sq)$I1itT#=,">
+            <value name="POSA">
+              <block type="lcd_set_position" id="j#(*CZt{#z{frFyb8GtE">
+                <value name="POSX">
+                  <shadow type="math_number" id="X|?S4NL,r]/nLJE6lfz%">
+                    <field name="NUM">0</field>
+                  </shadow>
+                </value>
+                <value name="POSY">
+                  <shadow type="math_number" id="uo$ui_lGmu0|XgS]`s20">
+                    <field name="NUM">0</field>
+                  </shadow>
+                </value>
+              </block>
+            </value>
+            <value name="CONTENT">
+              <shadow type="text" id="sG3ORn@b:[z^InzIrxqF">
+                <field name="TEXT"></field>
+              </shadow>
+              <block type="text_join" id="X#|)2|#bp#J;@,z*8Vc2">
+                <mutation items="3"></mutation>
+                <value name="ADD0">
+                  <block type="text" id="oBd9TCAM=HvdL-,=09nY">
+                    <field name="TEXT">当前环境温度:</field>
+                  </block>
+                </value>
+                <value name="ADD1">
+                  <block type="math_keep_decimal" id="KT|N.-sie:9}3wwg/@z#">
+                    <value name="NUM">
+                      <shadow type="math_number" id="a75I,Jt642)##.JcjGVB">
+                        <field name="NUM">3.1415926</field>
+                      </shadow>
+                      <block type="esp32_main_controller_get_environmental_value" id="zVFKc^G3I5wgj[8uN4:r">
+                        <field name="env_get_type">temperature</field>
+                      </block>
+                    </value>
+                    <value name="PLACE">
+                      <shadow type="math_number" id="r|wn^T,%k?!0`5T+j0E}">
+                        <field name="NUM">2</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <value name="ADD2">
+                  <block type="text" id="_xJmE=u]{x-CGIOMkU3n">
+                    <field name="TEXT">度</field>
+                  </block>
+                </value>
+              </block>
+            </value>
+            <value name="COLOR">
+              <block type="lcd_set_color" id="4fO6N2F=ZFT5.,~:R4Bb">
+                <field name="COLOR">#3366ff</field>
+              </block>
+            </value>
+            <value name="Scale">
+              <shadow type="math_number" id="Fr%o|XKNIZ(i*!$l~@u7">
+                <field name="NUM">1</field>
+              </shadow>
+            </value>
             <next>
-              <block type="ai_lcd_textcarvas" id=",LV^1d@8sq)$I1itT#=,">
-                <field name="varitem">canvas</field>
+              <block type="ai_lcd_textcarvas" id="a=wN}vMR8|YG:u3PkcI)">
                 <value name="POSA">
-                  <block type="lcd_set_position" id="j#(*CZt{#z{frFyb8GtE">
+                  <block type="lcd_set_position" id="gK6B@3j(j#.Xdegy!1__">
                     <value name="POSX">
-                      <shadow type="math_number" id="X|?S4NL,r]/nLJE6lfz%">
+                      <shadow type="math_number" id="7Z#3G7_WGI_V$Mu+s_ZN">
                         <field name="NUM">0</field>
                       </shadow>
                     </value>
                     <value name="POSY">
-                      <shadow type="math_number" id="uo$ui_lGmu0|XgS]`s20">
-                        <field name="NUM">0</field>
+                      <shadow type="math_number" id="H(=e91g/$^t/$0QQyu02">
+                        <field name="NUM">30</field>
                       </shadow>
                     </value>
                   </block>
@@ -27,121 +83,55 @@
                   <shadow type="text" id="sG3ORn@b:[z^InzIrxqF">
                     <field name="TEXT"></field>
                   </shadow>
-                  <block type="text_join" id="X#|)2|#bp#J;@,z*8Vc2">
+                  <block type="text_join" id=":CnUn}KLAv_zr1z`Gdp5">
                     <mutation items="3"></mutation>
                     <value name="ADD0">
-                      <block type="text" id="oBd9TCAM=HvdL-,=09nY">
-                        <field name="TEXT">当前环境度:</field>
+                      <block type="text" id="zJQ=v%4n8rmp0gG@B}G=">
+                        <field name="TEXT">当前环境湿度:</field>
                       </block>
                     </value>
                     <value name="ADD1">
-                      <block type="math_keep_decimal" id="KT|N.-sie:9}3wwg/@z#">
+                      <block type="math_keep_decimal" id="Oz8W`FY;tzz}1752E%Pq">
                         <value name="NUM">
                           <shadow type="math_number" id="a75I,Jt642)##.JcjGVB">
                             <field name="NUM">3.1415926</field>
                           </shadow>
-                          <block type="esp32_main_controller_get_environmental_value" id="zVFKc^G3I5wgj[8uN4:r">
-                            <field name="env_get_type">temperature</field>
+                          <block type="esp32_main_controller_get_environmental_value" id="`u)Y;pQ?T=$+^(eX|SDv">
+                            <field name="env_get_type">humidity</field>
                           </block>
                         </value>
                         <value name="PLACE">
-                          <shadow type="math_number" id="r|wn^T,%k?!0`5T+j0E}">
+                          <shadow type="math_number" id="56NnTNG:/q:sw?bIDP!9">
                             <field name="NUM">2</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <value name="ADD2">
-                      <block type="text" id="_xJmE=u]{x-CGIOMkU3n">
-                        <field name="TEXT"></field>
+                      <block type="text" id="XQihPfUyk~U=YPM9D$hR">
+                        <field name="TEXT">%</field>
                       </block>
                     </value>
                   </block>
                 </value>
                 <value name="COLOR">
-                  <block type="lcd_set_color" id="4fO6N2F=ZFT5.,~:R4Bb">
+                  <block type="lcd_set_color" id="pppDf7D/h8r%r]ctYrvI">
                     <field name="COLOR">#3366ff</field>
                   </block>
                 </value>
                 <value name="Scale">
-                  <shadow type="math_number" id="Fr%o|XKNIZ(i*!$l~@u7">
+                  <shadow type="math_number" id="!Nm:y}pA]/ESE05pAjcn">
                     <field name="NUM">1</field>
                   </shadow>
                 </value>
                 <next>
-                  <block type="ai_lcd_textcarvas" id="a=wN}vMR8|YG:u3PkcI)">
-                    <field name="varitem">canvas</field>
-                    <value name="POSA">
-                      <block type="lcd_set_position" id="gK6B@3j(j#.Xdegy!1__">
-                        <value name="POSX">
-                          <shadow type="math_number" id="7Z#3G7_WGI_V$Mu+s_ZN">
-                            <field name="NUM">0</field>
-                          </shadow>
-                        </value>
-                        <value name="POSY">
-                          <shadow type="math_number" id="H(=e91g/$^t/$0QQyu02">
-                            <field name="NUM">30</field>
-                          </shadow>
-                        </value>
-                      </block>
-                    </value>
-                    <value name="CONTENT">
-                      <shadow type="text" id="sG3ORn@b:[z^InzIrxqF">
-                        <field name="TEXT"></field>
-                      </shadow>
-                      <block type="text_join" id=":CnUn}KLAv_zr1z`Gdp5">
-                        <mutation items="3"></mutation>
-                        <value name="ADD0">
-                          <block type="text" id="zJQ=v%4n8rmp0gG@B}G=">
-                            <field name="TEXT">当前环境湿度:</field>
-                          </block>
-                        </value>
-                        <value name="ADD1">
-                          <block type="math_keep_decimal" id="Oz8W`FY;tzz}1752E%Pq">
-                            <value name="NUM">
-                              <shadow type="math_number" id="a75I,Jt642)##.JcjGVB">
-                                <field name="NUM">3.1415926</field>
-                              </shadow>
-                              <block type="esp32_main_controller_get_environmental_value" id="`u)Y;pQ?T=$+^(eX|SDv">
-                                <field name="env_get_type">humidity</field>
-                              </block>
-                            </value>
-                            <value name="PLACE">
-                              <shadow type="math_number" id="56NnTNG:/q:sw?bIDP!9">
-                                <field name="NUM">2</field>
-                              </shadow>
-                            </value>
-                          </block>
-                        </value>
-                        <value name="ADD2">
-                          <block type="text" id="XQihPfUyk~U=YPM9D$hR">
-                            <field name="TEXT">%</field>
-                          </block>
-                        </value>
-                      </block>
-                    </value>
-                    <value name="COLOR">
-                      <block type="lcd_set_color" id="pppDf7D/h8r%r]ctYrvI">
-                        <field name="COLOR">#3366ff</field>
-                      </block>
-                    </value>
-                    <value name="Scale">
-                      <shadow type="math_number" id="!Nm:y}pA]/ESE05pAjcn">
-                        <field name="NUM">1</field>
-                      </shadow>
-                    </value>
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="a#`hs]t3jRLSTk8B8qPd">
-                        <field name="varitem">canvas</field>
-                      </block>
-                    </next>
-                  </block>
+                  <block type="ai_lcd_showcarvas_set_display" id="a#`hs]t3jRLSTk8B8qPd"></block>
                 </next>
               </block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 272 - 290
src/python/图像处理/区域颜色分析.xml

@@ -1,146 +1,237 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="C?v(YEe$x4G?o*-U1IXH" x="-92" y="143">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="aN4(,txRY%N7|n8I[S!l">
-        <statement name="DO">
-          <block type="variables_set" id="$9@@V_gt#Q_)%a$q[910">
-            <field name="VAR">canvas</field>
+  <block type="controls_repeat_forever" id="aN4(,txRY%N7|n8I[S!l" x="107" y="28">
+    <statement name="DO">
+      <block type="ai_camera_snapshot" id="m_OH)9ZeUD8Ijvxhm!99">
+        <next>
+          <block type="variables_set" id="_yL,T[]^%$p]u2UoWT3`">
+            <field name="VAR">RGB</field>
             <value name="VALUE">
-              <shadow type="math_number" id="w^59r$x`B.:,%8lWS-PT">
+              <shadow type="math_number" id="g],zgWTmQ689##0WQ]U7">
                 <field name="NUM">0</field>
               </shadow>
-              <block type="ai_camera_snapshot" id="m_OH)9ZeUD8Ijvxhm!99"></block>
+              <block type="ai_vision_color_analyze" id="n5F`W+9B=3+jN^frqpG,">
+                <value name="xy">
+                  <block type="ai_lcd_XY_vision" id="T7;`h//xb!)Kgm]2{9t|">
+                    <value name="A">
+                      <shadow type="math_number" id="bcv!+jom9!.|Ny3ei/6%">
+                        <field name="NUM">154</field>
+                      </shadow>
+                    </value>
+                    <value name="B">
+                      <shadow type="math_number" id="1:AS-b)j?kIRKMVm;]X~">
+                        <field name="NUM">114</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <value name="wh">
+                  <block type="ai_lcd_WH_vision" id="P[{A%*6M1HVYG*ZcO)[X">
+                    <value name="A">
+                      <shadow type="math_number" id="({Q9|+Y#:|m:x=Z[H(.z">
+                        <field name="NUM">10</field>
+                      </shadow>
+                    </value>
+                    <value name="B">
+                      <shadow type="math_number" id="(S0@:]sS;o_]Oq!zZyCh">
+                        <field name="NUM">10</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+              </block>
             </value>
             <next>
-              <block type="variables_set" id="_yL,T[]^%$p]u2UoWT3`">
-                <field name="VAR">RGB</field>
-                <value name="VALUE">
-                  <shadow type="math_number" id="g],zgWTmQ689##0WQ]U7">
-                    <field name="NUM">0</field>
-                  </shadow>
-                  <block type="ai_vision_color_analyze" id="n5F`W+9B=3+jN^frqpG,">
-                    <field name="varitem">canvas</field>
-                    <value name="xy">
-                      <block type="ai_lcd_XY_vision" id="T7;`h//xb!)Kgm]2{9t|">
-                        <value name="A">
-                          <shadow type="math_number" id="bcv!+jom9!.|Ny3ei/6%">
-                            <field name="NUM">154</field>
-                          </shadow>
-                        </value>
-                        <value name="B">
-                          <shadow type="math_number" id="1:AS-b)j?kIRKMVm;]X~">
-                            <field name="NUM">114</field>
-                          </shadow>
-                        </value>
-                      </block>
+              <block type="ai_lcd_draw_rectangle" id="V%~!vo57bZ3*%.nTu6BK">
+                <field name="rect_type">rect</field>
+                <value name="POSA">
+                  <block type="lcd_set_position" id="L.M?i]TQ%,EnhHc4)/xG">
+                    <value name="POSX">
+                      <shadow type="math_number" id="NaNb!GG~2RdF$^i+ZVv^">
+                        <field name="NUM">154</field>
+                      </shadow>
                     </value>
-                    <value name="wh">
-                      <block type="ai_lcd_WH_vision" id="P[{A%*6M1HVYG*ZcO)[X">
-                        <value name="A">
-                          <shadow type="math_number" id="({Q9|+Y#:|m:x=Z[H(.z">
-                            <field name="NUM">10</field>
-                          </shadow>
-                        </value>
-                        <value name="B">
-                          <shadow type="math_number" id="(S0@:]sS;o_]Oq!zZyCh">
-                            <field name="NUM">10</field>
-                          </shadow>
-                        </value>
-                      </block>
+                    <value name="POSY">
+                      <shadow type="math_number" id="ttrE|!XDS,^=G$z`P$WD">
+                        <field name="NUM">114</field>
+                      </shadow>
                     </value>
                   </block>
                 </value>
+                <value name="POSB">
+                  <block type="lcd_set_width_height" id="M/*{vZm3nJP$?7(0dOj(">
+                    <value name="WIDTH">
+                      <shadow type="math_number" id="XpG*/*ET!gv3K4.v5Av{">
+                        <field name="NUM">10</field>
+                      </shadow>
+                    </value>
+                    <value name="HEIGHT">
+                      <shadow type="math_number" id="Sx?Yknn8@a~`nqT0jz}d">
+                        <field name="NUM">10</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <value name="COLOR">
+                  <block type="lcd_set_color" id="x02IZ3Dw@CPbAu4c?^Rn">
+                    <field name="COLOR">#ff0000</field>
+                  </block>
+                </value>
                 <next>
-                  <block type="ai_lcd_draw_rectangle" id="V%~!vo57bZ3*%.nTu6BK">
-                    <field name="varitem">canvas</field>
-                    <field name="rect_type">rect</field>
+                  <block type="ai_lcd_draw_rectangle" id="n.@f6s,l)KnPrb,XrNJA">
+                    <field name="rect_type">fillrect</field>
                     <value name="POSA">
-                      <block type="lcd_set_position" id="L.M?i]TQ%,EnhHc4)/xG">
+                      <block type="lcd_set_position" id="4:U5YWd8v`5,,4Q6z3!%">
                         <value name="POSX">
-                          <shadow type="math_number" id="NaNb!GG~2RdF$^i+ZVv^">
-                            <field name="NUM">154</field>
+                          <shadow type="math_number" id="tm2cP{!eKV7C=~Rz405j">
+                            <field name="NUM">0</field>
                           </shadow>
                         </value>
                         <value name="POSY">
-                          <shadow type="math_number" id="ttrE|!XDS,^=G$z`P$WD">
-                            <field name="NUM">114</field>
+                          <shadow type="math_number" id="=.`Z%0%@/uN^E)WkgKx]">
+                            <field name="NUM">0</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <value name="POSB">
-                      <block type="lcd_set_width_height" id="M/*{vZm3nJP$?7(0dOj(">
+                      <block type="lcd_set_width_height" id="_Fw4]L]F[ffguv0M2PvK">
                         <value name="WIDTH">
-                          <shadow type="math_number" id="XpG*/*ET!gv3K4.v5Av{">
-                            <field name="NUM">10</field>
+                          <shadow type="math_number" id="J;1{93u.O@tNnnT:lvFB">
+                            <field name="NUM">320</field>
                           </shadow>
                         </value>
                         <value name="HEIGHT">
-                          <shadow type="math_number" id="Sx?Yknn8@a~`nqT0jz}d">
-                            <field name="NUM">10</field>
+                          <shadow type="math_number" id=",PL7JeJu]?@k}6Yp5R.%">
+                            <field name="NUM">20</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <value name="COLOR">
-                      <block type="lcd_set_color" id="x02IZ3Dw@CPbAu4c?^Rn">
-                        <field name="COLOR">#ff0000</field>
+                      <block type="ai_lcd_rgb_value_input" id="qjomXL3t*cbEA$sAkPK," inline="false">
+                        <value name="rgb_value_r">
+                          <shadow type="math_number" id="ZlTq1y/EV0/e~{RNryu2">
+                            <field name="NUM">0</field>
+                          </shadow>
+                          <block type="math_convert" id="W6MZEG^R30G|V1HkS,X:">
+                            <field name="TYPE0">int</field>
+                            <value name="INPUT0">
+                              <block type="list_order_item" id="l6Khjf/L2eENEx,TMX_?">
+                                <field name="list_order">[</field>
+                                <value name="list_name">
+                                  <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
+                                    <field name="TEXT"></field>
+                                  </shadow>
+                                  <block type="variables_get" id="%t0+?;9!%v#U(vx@;i/P">
+                                    <field name="VAR">RGB</field>
+                                  </block>
+                                </value>
+                                <value name="list_order_item">
+                                  <shadow type="math_number" id="If}?X1Bh.#rq3;QLCRBK">
+                                    <field name="NUM">0</field>
+                                  </shadow>
+                                </value>
+                              </block>
+                            </value>
+                          </block>
+                        </value>
+                        <value name="rgb_value_g">
+                          <shadow type="math_number" id="KW+)?cbgkR_IrGTkk51=">
+                            <field name="NUM">0</field>
+                          </shadow>
+                          <block type="math_convert" id="Y_Y%,+!;(WQ~u%yPY=,V">
+                            <field name="TYPE0">int</field>
+                            <value name="INPUT0">
+                              <block type="list_order_item" id="lc/O(KCcP=,7q/{FO(4S">
+                                <field name="list_order">[</field>
+                                <value name="list_name">
+                                  <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
+                                    <field name="TEXT"></field>
+                                  </shadow>
+                                  <block type="variables_get" id="iY$erXtB|9F.Hs.l/V!S">
+                                    <field name="VAR">RGB</field>
+                                  </block>
+                                </value>
+                                <value name="list_order_item">
+                                  <shadow type="math_number" id="5bA.P)BT;XB2C@v%FLgB">
+                                    <field name="NUM">1</field>
+                                  </shadow>
+                                </value>
+                              </block>
+                            </value>
+                          </block>
+                        </value>
+                        <value name="rgb_value_b">
+                          <shadow type="math_number" id="FQ{WFbYupzK6LsB=6)%2">
+                            <field name="NUM">0</field>
+                          </shadow>
+                          <block type="math_convert" id="5EBuEy:o3?tLQUrahXiu">
+                            <field name="TYPE0">int</field>
+                            <value name="INPUT0">
+                              <block type="list_order_item" id="g^Mdm,`x}7sZ2*$(a=Hd">
+                                <field name="list_order">[</field>
+                                <value name="list_name">
+                                  <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
+                                    <field name="TEXT"></field>
+                                  </shadow>
+                                  <block type="variables_get" id="#O(/t%s?G(%jp]@l{x@5">
+                                    <field name="VAR">RGB</field>
+                                  </block>
+                                </value>
+                                <value name="list_order_item">
+                                  <shadow type="math_number" id="ULz|.sz(Nely`]*Zic]h">
+                                    <field name="NUM">2</field>
+                                  </shadow>
+                                </value>
+                              </block>
+                            </value>
+                          </block>
+                        </value>
                       </block>
                     </value>
                     <next>
-                      <block type="ai_lcd_draw_rectangle" id="n.@f6s,l)KnPrb,XrNJA">
-                        <field name="varitem">canvas</field>
-                        <field name="rect_type">fillrect</field>
+                      <block type="ai_lcd_textcarvas" id="IK,n$aiF1a1/(}r=UNSz">
                         <value name="POSA">
-                          <block type="lcd_set_position" id="4:U5YWd8v`5,,4Q6z3!%">
+                          <block type="lcd_set_position" id="AbPik8xD:qp.$;E-1Cq~">
                             <value name="POSX">
-                              <shadow type="math_number" id="tm2cP{!eKV7C=~Rz405j">
-                                <field name="NUM">0</field>
+                              <shadow type="math_number" id="-ksCtYA|k~!YHp9$u2w5">
+                                <field name="NUM">120</field>
                               </shadow>
                             </value>
                             <value name="POSY">
-                              <shadow type="math_number" id="=.`Z%0%@/uN^E)WkgKx]">
+                              <shadow type="math_number" id="fO^m#`2(,[6+2`+:k!K=">
                                 <field name="NUM">0</field>
                               </shadow>
                             </value>
                           </block>
                         </value>
-                        <value name="POSB">
-                          <block type="lcd_set_width_height" id="_Fw4]L]F[ffguv0M2PvK">
-                            <value name="WIDTH">
-                              <shadow type="math_number" id="J;1{93u.O@tNnnT:lvFB">
-                                <field name="NUM">320</field>
-                              </shadow>
-                            </value>
-                            <value name="HEIGHT">
-                              <shadow type="math_number" id=",PL7JeJu]?@k}6Yp5R.%">
-                                <field name="NUM">20</field>
-                              </shadow>
+                        <value name="CONTENT">
+                          <shadow type="text" id="tRjl`]r:u6{-?qq:.*OA">
+                            <field name="TEXT"></field>
+                          </shadow>
+                          <block type="text_join" id="LJS$J[4KqzEEBUa!Q_?y">
+                            <mutation items="7"></mutation>
+                            <value name="ADD0">
+                              <block type="text" id="sW/;]xuZ4h?bts(?Cb,J">
+                                <field name="TEXT">(</field>
+                              </block>
                             </value>
-                          </block>
-                        </value>
-                        <value name="COLOR">
-                          <block type="ai_lcd_rgb_value_input" id="qjomXL3t*cbEA$sAkPK," inline="false">
-                            <value name="rgb_value_r">
-                              <shadow type="math_number" id="ZlTq1y/EV0/e~{RNryu2">
-                                <field name="NUM">0</field>
-                              </shadow>
-                              <block type="math_convert" id="W6MZEG^R30G|V1HkS,X:">
+                            <value name="ADD1">
+                              <block type="math_convert" id="*4.j~=X!QCd^Wln(P+m7">
                                 <field name="TYPE0">int</field>
                                 <value name="INPUT0">
-                                  <block type="list_order_item" id="l6Khjf/L2eENEx,TMX_?">
+                                  <block type="list_order_item" id="EF5iXK9F+`nbR9^V(uKA">
                                     <field name="list_order">[</field>
                                     <value name="list_name">
                                       <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
                                         <field name="TEXT"></field>
                                       </shadow>
-                                      <block type="variables_get" id="%t0+?;9!%v#U(vx@;i/P">
+                                      <block type="variables_get" id="kk[|nu08U9t_6a~k?ds4">
                                         <field name="VAR">RGB</field>
                                       </block>
                                     </value>
                                     <value name="list_order_item">
-                                      <shadow type="math_number" id="If}?X1Bh.#rq3;QLCRBK">
+                                      <shadow type="math_number" id="oldPb;tTJ;)*IA2X=n@d">
                                         <field name="NUM">0</field>
                                       </shadow>
                                     </value>
@@ -148,25 +239,27 @@
                                 </value>
                               </block>
                             </value>
-                            <value name="rgb_value_g">
-                              <shadow type="math_number" id="KW+)?cbgkR_IrGTkk51=">
-                                <field name="NUM">0</field>
-                              </shadow>
-                              <block type="math_convert" id="Y_Y%,+!;(WQ~u%yPY=,V">
+                            <value name="ADD2">
+                              <block type="text" id="Gjxxoer`~=Lhfx/)^*!9">
+                                <field name="TEXT">,</field>
+                              </block>
+                            </value>
+                            <value name="ADD3">
+                              <block type="math_convert" id="~f2U1wH^U`e0n[6zOlrS">
                                 <field name="TYPE0">int</field>
                                 <value name="INPUT0">
-                                  <block type="list_order_item" id="lc/O(KCcP=,7q/{FO(4S">
+                                  <block type="list_order_item" id=":`#-yRTlpf+4zkcP#}tT">
                                     <field name="list_order">[</field>
                                     <value name="list_name">
                                       <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
                                         <field name="TEXT"></field>
                                       </shadow>
-                                      <block type="variables_get" id="iY$erXtB|9F.Hs.l/V!S">
+                                      <block type="variables_get" id="^sRbro4B$b+F[IK/];/g">
                                         <field name="VAR">RGB</field>
                                       </block>
                                     </value>
                                     <value name="list_order_item">
-                                      <shadow type="math_number" id="5bA.P)BT;XB2C@v%FLgB">
+                                      <shadow type="math_number" id="ba/H1[XYC}6a!xo;5z*y">
                                         <field name="NUM">1</field>
                                       </shadow>
                                     </value>
@@ -174,25 +267,27 @@
                                 </value>
                               </block>
                             </value>
-                            <value name="rgb_value_b">
-                              <shadow type="math_number" id="FQ{WFbYupzK6LsB=6)%2">
-                                <field name="NUM">0</field>
-                              </shadow>
-                              <block type="math_convert" id="5EBuEy:o3?tLQUrahXiu">
+                            <value name="ADD4">
+                              <block type="text" id="@7JI@rfhueA3zBD_(^wr">
+                                <field name="TEXT">,</field>
+                              </block>
+                            </value>
+                            <value name="ADD5">
+                              <block type="math_convert" id="?esl(0N+8Cn^R;8)*phW">
                                 <field name="TYPE0">int</field>
                                 <value name="INPUT0">
-                                  <block type="list_order_item" id="g^Mdm,`x}7sZ2*$(a=Hd">
+                                  <block type="list_order_item" id="/N2#G](6zMBiv27RG.6E">
                                     <field name="list_order">[</field>
                                     <value name="list_name">
                                       <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
                                         <field name="TEXT"></field>
                                       </shadow>
-                                      <block type="variables_get" id="#O(/t%s?G(%jp]@l{x@5">
+                                      <block type="variables_get" id=",Z(_f`/i/Vi%IE}#`d!I">
                                         <field name="VAR">RGB</field>
                                       </block>
                                     </value>
                                     <value name="list_order_item">
-                                      <shadow type="math_number" id="ULz|.sz(Nely`]*Zic]h">
+                                      <shadow type="math_number" id="rH1Jgu)s7q4$LVx;dS76">
                                         <field name="NUM">2</field>
                                       </shadow>
                                     </value>
@@ -200,52 +295,45 @@
                                 </value>
                               </block>
                             </value>
+                            <value name="ADD6">
+                              <block type="text" id="diqXwO!fT}`{p!`iw6E}">
+                                <field name="TEXT">)</field>
+                              </block>
+                            </value>
                           </block>
                         </value>
-                        <next>
-                          <block type="ai_lcd_textcarvas" id="IK,n$aiF1a1/(}r=UNSz">
-                            <field name="varitem">canvas</field>
-                            <value name="POSA">
-                              <block type="lcd_set_position" id="AbPik8xD:qp.$;E-1Cq~">
-                                <value name="POSX">
-                                  <shadow type="math_number" id="-ksCtYA|k~!YHp9$u2w5">
-                                    <field name="NUM">120</field>
+                        <value name="COLOR">
+                          <block type="ai_lcd_rgb_value_input" id="Q^2Y]dYFON!wwyCk34sg" inline="false">
+                            <value name="rgb_value_r">
+                              <shadow type="math_number" id="+SMN=su=N3N4-q2Sl%yy">
+                                <field name="NUM">0</field>
+                              </shadow>
+                              <block type="math_arithmetic" id="%,3Bn33a$sm]7lo]UJGf">
+                                <field name="OP">MINUS</field>
+                                <value name="A">
+                                  <shadow type="math_number" id="o1Re^xl{Ap5f:)I)5D`p">
+                                    <field name="NUM">255</field>
                                   </shadow>
                                 </value>
-                                <value name="POSY">
-                                  <shadow type="math_number" id="fO^m#`2(,[6+2`+:k!K=">
-                                    <field name="NUM">0</field>
+                                <value name="B">
+                                  <shadow type="math_number" id="nWOtFb.$()L,VpO1_ZoY">
+                                    <field name="NUM">1</field>
                                   </shadow>
-                                </value>
-                              </block>
-                            </value>
-                            <value name="CONTENT">
-                              <shadow type="text" id="tRjl`]r:u6{-?qq:.*OA">
-                                <field name="TEXT"></field>
-                              </shadow>
-                              <block type="text_join" id="LJS$J[4KqzEEBUa!Q_?y">
-                                <mutation items="7"></mutation>
-                                <value name="ADD0">
-                                  <block type="text" id="sW/;]xuZ4h?bts(?Cb,J">
-                                    <field name="TEXT">(</field>
-                                  </block>
-                                </value>
-                                <value name="ADD1">
-                                  <block type="math_convert" id="*4.j~=X!QCd^Wln(P+m7">
+                                  <block type="math_convert" id="*+/mu+G}(:RH:3~XLA|7">
                                     <field name="TYPE0">int</field>
                                     <value name="INPUT0">
-                                      <block type="list_order_item" id="EF5iXK9F+`nbR9^V(uKA">
+                                      <block type="list_order_item" id="JTh14|{GV%~Y6XjePhJ.">
                                         <field name="list_order">[</field>
                                         <value name="list_name">
                                           <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
                                             <field name="TEXT"></field>
                                           </shadow>
-                                          <block type="variables_get" id="kk[|nu08U9t_6a~k?ds4">
+                                          <block type="variables_get" id="1yKQ#Vs~m%eN`f[A./jx">
                                             <field name="VAR">RGB</field>
                                           </block>
                                         </value>
                                         <value name="list_order_item">
-                                          <shadow type="math_number" id="oldPb;tTJ;)*IA2X=n@d">
+                                          <shadow type="math_number" id="G|NwkyE4lo~#q:z3VLY5">
                                             <field name="NUM">0</field>
                                           </shadow>
                                         </value>
@@ -253,27 +341,38 @@
                                     </value>
                                   </block>
                                 </value>
-                                <value name="ADD2">
-                                  <block type="text" id="Gjxxoer`~=Lhfx/)^*!9">
-                                    <field name="TEXT">,</field>
-                                  </block>
+                              </block>
+                            </value>
+                            <value name="rgb_value_g">
+                              <shadow type="math_number" id="kR597{rIfaLi#fD*M*Ox">
+                                <field name="NUM">0</field>
+                              </shadow>
+                              <block type="math_arithmetic" id="tMNgDg87u+NLy|M#^Kh6">
+                                <field name="OP">MINUS</field>
+                                <value name="A">
+                                  <shadow type="math_number" id="rs[g*RK2o)oJ|;ZA2.:f">
+                                    <field name="NUM">255</field>
+                                  </shadow>
                                 </value>
-                                <value name="ADD3">
-                                  <block type="math_convert" id="~f2U1wH^U`e0n[6zOlrS">
+                                <value name="B">
+                                  <shadow type="math_number" id="nWOtFb.$()L,VpO1_ZoY">
+                                    <field name="NUM">1</field>
+                                  </shadow>
+                                  <block type="math_convert" id="Pk;3Q{:T@3t5?gDjPAXa">
                                     <field name="TYPE0">int</field>
                                     <value name="INPUT0">
-                                      <block type="list_order_item" id=":`#-yRTlpf+4zkcP#}tT">
+                                      <block type="list_order_item" id="+o#Lw2D%w.kGFR=0uGsC">
                                         <field name="list_order">[</field>
                                         <value name="list_name">
                                           <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
                                             <field name="TEXT"></field>
                                           </shadow>
-                                          <block type="variables_get" id="^sRbro4B$b+F[IK/];/g">
+                                          <block type="variables_get" id="?h5*2g6gIZAy|G#N$0fZ">
                                             <field name="VAR">RGB</field>
                                           </block>
                                         </value>
                                         <value name="list_order_item">
-                                          <shadow type="math_number" id="ba/H1[XYC}6a!xo;5z*y">
+                                          <shadow type="math_number" id="e)orIRgTrljQ80Uq2--I">
                                             <field name="NUM">1</field>
                                           </shadow>
                                         </value>
@@ -281,27 +380,38 @@
                                     </value>
                                   </block>
                                 </value>
-                                <value name="ADD4">
-                                  <block type="text" id="@7JI@rfhueA3zBD_(^wr">
-                                    <field name="TEXT">,</field>
-                                  </block>
+                              </block>
+                            </value>
+                            <value name="rgb_value_b">
+                              <shadow type="math_number" id="BdoUG9|~lzPtq=/xd?gH">
+                                <field name="NUM">0</field>
+                              </shadow>
+                              <block type="math_arithmetic" id="g{HfvBF*Cwa=/}Xw|^4?">
+                                <field name="OP">MINUS</field>
+                                <value name="A">
+                                  <shadow type="math_number" id="VPkO[mHb}CzlBe,RcBg?">
+                                    <field name="NUM">255</field>
+                                  </shadow>
                                 </value>
-                                <value name="ADD5">
-                                  <block type="math_convert" id="?esl(0N+8Cn^R;8)*phW">
+                                <value name="B">
+                                  <shadow type="math_number" id="nWOtFb.$()L,VpO1_ZoY">
+                                    <field name="NUM">1</field>
+                                  </shadow>
+                                  <block type="math_convert" id="k39Hk)vC]Q).0:_1cwj|">
                                     <field name="TYPE0">int</field>
                                     <value name="INPUT0">
-                                      <block type="list_order_item" id="/N2#G](6zMBiv27RG.6E">
+                                      <block type="list_order_item" id="Im`BvH*vfV^*yh42v.?}">
                                         <field name="list_order">[</field>
                                         <value name="list_name">
                                           <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
                                             <field name="TEXT"></field>
                                           </shadow>
-                                          <block type="variables_get" id=",Z(_f`/i/Vi%IE}#`d!I">
+                                          <block type="variables_get" id=".$z]v?uxm|mxOUnvYXWN">
                                             <field name="VAR">RGB</field>
                                           </block>
                                         </value>
                                         <value name="list_order_item">
-                                          <shadow type="math_number" id="rH1Jgu)s7q4$LVx;dS76">
+                                          <shadow type="math_number" id="8B@!Sh`:[$uUErF!p3uJ">
                                             <field name="NUM">2</field>
                                           </shadow>
                                         </value>
@@ -309,145 +419,17 @@
                                     </value>
                                   </block>
                                 </value>
-                                <value name="ADD6">
-                                  <block type="text" id="diqXwO!fT}`{p!`iw6E}">
-                                    <field name="TEXT">)</field>
-                                  </block>
-                                </value>
                               </block>
                             </value>
-                            <value name="COLOR">
-                              <block type="ai_lcd_rgb_value_input" id="Q^2Y]dYFON!wwyCk34sg" inline="false">
-                                <value name="rgb_value_r">
-                                  <shadow type="math_number" id="+SMN=su=N3N4-q2Sl%yy">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                  <block type="math_arithmetic" id="%,3Bn33a$sm]7lo]UJGf">
-                                    <field name="OP">MINUS</field>
-                                    <value name="A">
-                                      <shadow type="math_number" id="o1Re^xl{Ap5f:)I)5D`p">
-                                        <field name="NUM">255</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="B">
-                                      <shadow type="math_number" id="nWOtFb.$()L,VpO1_ZoY">
-                                        <field name="NUM">1</field>
-                                      </shadow>
-                                      <block type="math_convert" id="*+/mu+G}(:RH:3~XLA|7">
-                                        <field name="TYPE0">int</field>
-                                        <value name="INPUT0">
-                                          <block type="list_order_item" id="JTh14|{GV%~Y6XjePhJ.">
-                                            <field name="list_order">[</field>
-                                            <value name="list_name">
-                                              <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
-                                                <field name="TEXT"></field>
-                                              </shadow>
-                                              <block type="variables_get" id="1yKQ#Vs~m%eN`f[A./jx">
-                                                <field name="VAR">RGB</field>
-                                              </block>
-                                            </value>
-                                            <value name="list_order_item">
-                                              <shadow type="math_number" id="G|NwkyE4lo~#q:z3VLY5">
-                                                <field name="NUM">0</field>
-                                              </shadow>
-                                            </value>
-                                          </block>
-                                        </value>
-                                      </block>
-                                    </value>
-                                  </block>
-                                </value>
-                                <value name="rgb_value_g">
-                                  <shadow type="math_number" id="kR597{rIfaLi#fD*M*Ox">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                  <block type="math_arithmetic" id="tMNgDg87u+NLy|M#^Kh6">
-                                    <field name="OP">MINUS</field>
-                                    <value name="A">
-                                      <shadow type="math_number" id="rs[g*RK2o)oJ|;ZA2.:f">
-                                        <field name="NUM">255</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="B">
-                                      <shadow type="math_number" id="nWOtFb.$()L,VpO1_ZoY">
-                                        <field name="NUM">1</field>
-                                      </shadow>
-                                      <block type="math_convert" id="Pk;3Q{:T@3t5?gDjPAXa">
-                                        <field name="TYPE0">int</field>
-                                        <value name="INPUT0">
-                                          <block type="list_order_item" id="+o#Lw2D%w.kGFR=0uGsC">
-                                            <field name="list_order">[</field>
-                                            <value name="list_name">
-                                              <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
-                                                <field name="TEXT"></field>
-                                              </shadow>
-                                              <block type="variables_get" id="?h5*2g6gIZAy|G#N$0fZ">
-                                                <field name="VAR">RGB</field>
-                                              </block>
-                                            </value>
-                                            <value name="list_order_item">
-                                              <shadow type="math_number" id="e)orIRgTrljQ80Uq2--I">
-                                                <field name="NUM">1</field>
-                                              </shadow>
-                                            </value>
-                                          </block>
-                                        </value>
-                                      </block>
-                                    </value>
-                                  </block>
-                                </value>
-                                <value name="rgb_value_b">
-                                  <shadow type="math_number" id="BdoUG9|~lzPtq=/xd?gH">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                  <block type="math_arithmetic" id="g{HfvBF*Cwa=/}Xw|^4?">
-                                    <field name="OP">MINUS</field>
-                                    <value name="A">
-                                      <shadow type="math_number" id="VPkO[mHb}CzlBe,RcBg?">
-                                        <field name="NUM">255</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="B">
-                                      <shadow type="math_number" id="nWOtFb.$()L,VpO1_ZoY">
-                                        <field name="NUM">1</field>
-                                      </shadow>
-                                      <block type="math_convert" id="k39Hk)vC]Q).0:_1cwj|">
-                                        <field name="TYPE0">int</field>
-                                        <value name="INPUT0">
-                                          <block type="list_order_item" id="Im`BvH*vfV^*yh42v.?}">
-                                            <field name="list_order">[</field>
-                                            <value name="list_name">
-                                              <shadow type="text_list" id="~=xntJ1!vck__:2@V#0~">
-                                                <field name="TEXT"></field>
-                                              </shadow>
-                                              <block type="variables_get" id=".$z]v?uxm|mxOUnvYXWN">
-                                                <field name="VAR">RGB</field>
-                                              </block>
-                                            </value>
-                                            <value name="list_order_item">
-                                              <shadow type="math_number" id="8B@!Sh`:[$uUErF!p3uJ">
-                                                <field name="NUM">2</field>
-                                              </shadow>
-                                            </value>
-                                          </block>
-                                        </value>
-                                      </block>
-                                    </value>
-                                  </block>
-                                </value>
-                              </block>
-                            </value>
-                            <value name="Scale">
-                              <shadow type="math_number" id="bjDr!Br;~d9PVc]SI4+j">
-                                <field name="NUM">1</field>
-                              </shadow>
-                            </value>
-                            <next>
-                              <block type="ai_lcd_showcarvas_set_display" id="PbdLe{v/}{fj9l7@;J9+">
-                                <field name="varitem">canvas</field>
-                              </block>
-                            </next>
                           </block>
+                        </value>
+                        <value name="Scale">
+                          <shadow type="math_number" id="bjDr!Br;~d9PVc]SI4+j">
+                            <field name="NUM">1</field>
+                          </shadow>
+                        </value>
+                        <next>
+                          <block type="ai_lcd_showcarvas_set_display" id="PbdLe{v/}{fj9l7@;J9+"></block>
                         </next>
                       </block>
                     </next>
@@ -456,8 +438,8 @@
               </block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 111 - 127
src/python/图像处理/寻找色块.xml

@@ -1,158 +1,142 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="C?v(YEe$x4G?o*-U1IXH" x="192" y="-122">
-    <field name="isScreen">False</field>
+  <block type="CocoRobo_return_list" id="P`(OGxj{C.hgN3(D$c3F" x="-3" y="-42">
+    <value name="list_name">
+      <block type="variables_get" id="J!NFjNYk_1+ee,/xVTel">
+        <field name="VAR">my_list</field>
+      </block>
+    </value>
+    <value name="list_items">
+      <shadow type="text_list" id="|_!BmX6|dd}{cqQydWkR">
+        <field name="TEXT">(34, 100, -38, 3, -128, -28)</field>
+      </shadow>
+    </value>
     <next>
-      <block type="CocoRobo_return_list" id="P`(OGxj{C.hgN3(D$c3F">
-        <value name="list_name">
-          <block type="variables_get" id="J!NFjNYk_1+ee,/xVTel">
-            <field name="VAR">my_list</field>
-          </block>
-        </value>
-        <value name="list_items">
-          <shadow type="text_list" id="|_!BmX6|dd}{cqQydWkR">
-            <field name="TEXT">(34, 100, -38, 3, -128, -28)</field>
-          </shadow>
-        </value>
-        <next>
-          <block type="controls_repeat_forever" id="PG.b9?agjAbFGi)W$h8Q">
-            <statement name="DO">
-              <block type="variables_set" id="U[qT/|r8}7``,N`vk6?J">
-                <field name="VAR">canvas</field>
+      <block type="controls_repeat_forever" id="8{M85LykUWXhtk4]1Mzo">
+        <statement name="DO">
+          <block type="ai_camera_snapshot" id="|O}93OKa;w5H@dN6O#6*">
+            <next>
+              <block type="variables_set" id="Be6jL@[${6n^r-+UBgTH">
+                <field name="VAR">lane_trackingline</field>
                 <value name="VALUE">
-                  <shadow type="math_number" id="%CW!*Owz+{eafwR7.CU_">
+                  <shadow type="math_number" id="MK*,d~E#uM99E`Ns.R[+">
                     <field name="NUM">0</field>
                   </shadow>
-                  <block type="ai_camera_snapshot" id="-JAPBQuzh[!ohjs10zcD"></block>
-                </value>
-                <next>
-                  <block type="variables_set" id="Be6jL@[${6n^r-+UBgTH">
-                    <field name="VAR">lane_trackingline</field>
-                    <value name="VALUE">
-                      <shadow type="math_number" id="MK*,d~E#uM99E`Ns.R[+">
-                        <field name="NUM">0</field>
-                      </shadow>
-                      <block type="ai_vision_find_lines" id="L,`DvE]*E{k|(@*N0UuU">
-                        <field name="varitem">canvas</field>
-                        <value name="color">
-                          <block type="variables_get" id="WOfho],O:s?[BGl~b[++">
-                            <field name="VAR">my_list</field>
-                          </block>
+                  <block type="ai_vision_find_lines" id="L,`DvE]*E{k|(@*N0UuU">
+                    <value name="color">
+                      <block type="variables_get" id="WOfho],O:s?[BGl~b[++">
+                        <field name="VAR">my_list</field>
+                      </block>
+                    </value>
+                    <value name="xy">
+                      <block type="ai_lcd_XY_vision" id="qp`6Ag}S(o^Na-9Jys2[">
+                        <value name="A">
+                          <shadow type="math_number" id=":qwlhg/wIfpQa(Rw$69n">
+                            <field name="NUM">0</field>
+                          </shadow>
                         </value>
-                        <value name="xy">
-                          <block type="ai_lcd_XY_vision" id="qp`6Ag}S(o^Na-9Jys2[">
-                            <value name="A">
-                              <shadow type="math_number" id=":qwlhg/wIfpQa(Rw$69n">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                            <value name="B">
-                              <shadow type="math_number" id="TaS=ObGC*%iTDauv+H#/">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                          </block>
+                        <value name="B">
+                          <shadow type="math_number" id="TaS=ObGC*%iTDauv+H#/">
+                            <field name="NUM">0</field>
+                          </shadow>
                         </value>
-                        <value name="wh">
-                          <block type="ai_lcd_WH_vision" id="W#Q4.3R4CODi?k~Ss$lG">
-                            <value name="A">
-                              <shadow type="math_number" id="sfLV)y[gG^^-Mu$yWxB@">
-                                <field name="NUM">320</field>
-                              </shadow>
-                            </value>
-                            <value name="B">
-                              <shadow type="math_number" id="aW[D}k?%fDYg[~Izr8#J">
-                                <field name="NUM">240</field>
-                              </shadow>
-                            </value>
-                          </block>
+                      </block>
+                    </value>
+                    <value name="wh">
+                      <block type="ai_lcd_WH_vision" id="W#Q4.3R4CODi?k~Ss$lG">
+                        <value name="A">
+                          <shadow type="math_number" id="sfLV)y[gG^^-Mu$yWxB@">
+                            <field name="NUM">320</field>
+                          </shadow>
+                        </value>
+                        <value name="B">
+                          <shadow type="math_number" id="aW[D}k?%fDYg[~Izr8#J">
+                            <field name="NUM">240</field>
+                          </shadow>
                         </value>
                       </block>
                     </value>
-                    <next>
-                      <block type="controls_if" id="lq$n#IfH1/4pvWv-wL-,">
-                        <value name="IF0">
-                          <block type="variables_get" id="ehLTH8xuzAOt}]va=.IX">
+                  </block>
+                </value>
+                <next>
+                  <block type="controls_if" id="lq$n#IfH1/4pvWv-wL-,">
+                    <value name="IF0">
+                      <block type="variables_get" id="ehLTH8xuzAOt}]va=.IX">
+                        <field name="VAR">lane_trackingline</field>
+                      </block>
+                    </value>
+                    <statement name="DO0">
+                      <block type="controls_forEach" id=":3wy$Xc`Sv32@xSFxBx-">
+                        <field name="VAR">i</field>
+                        <value name="LIST">
+                          <block type="variables_get" id="b=*R+[9wjMM4N,t~6!nJ">
                             <field name="VAR">lane_trackingline</field>
                           </block>
                         </value>
-                        <statement name="DO0">
-                          <block type="controls_forEach" id=":3wy$Xc`Sv32@xSFxBx-">
-                            <field name="VAR">i</field>
-                            <value name="LIST">
-                              <block type="variables_get" id="b=*R+[9wjMM4N,t~6!nJ">
-                                <field name="VAR">lane_trackingline</field>
-                              </block>
-                            </value>
-                            <statement name="DO">
-                              <block type="ai_lcd_draw_rectangle" id="eBgtX|r@luiM?GG*%Xn!">
-                                <field name="varitem">canvas</field>
-                                <field name="rect_type">rect</field>
-                                <value name="POSA">
-                                  <block type="lcd_set_position" id="J=o`rve`5M%Id-26ax0_">
-                                    <value name="POSX">
-                                      <shadow type="math_number" id="#hIXYdf]gbH3rz3Ie@4R">
-                                        <field name="NUM">0</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id=":BS86o$a1_kmKJ:$!^DY">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">x</field>
-                                      </block>
-                                    </value>
-                                    <value name="POSY">
-                                      <shadow type="math_number" id="L{sWd7QkA(G7a^){-;@L">
-                                        <field name="NUM">0</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id="/NYSB-IHEQ~VnGCjB^cp">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">y</field>
-                                      </block>
-                                    </value>
+                        <statement name="DO">
+                          <block type="ai_lcd_draw_rectangle" id="eBgtX|r@luiM?GG*%Xn!">
+                            <field name="rect_type">rect</field>
+                            <value name="POSA">
+                              <block type="lcd_set_position" id="J=o`rve`5M%Id-26ax0_">
+                                <value name="POSX">
+                                  <shadow type="math_number" id="#hIXYdf]gbH3rz3Ie@4R">
+                                    <field name="NUM">0</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id=":BS86o$a1_kmKJ:$!^DY">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">x</field>
+                                  </block>
+                                </value>
+                                <value name="POSY">
+                                  <shadow type="math_number" id="L{sWd7QkA(G7a^){-;@L">
+                                    <field name="NUM">0</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id="/NYSB-IHEQ~VnGCjB^cp">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">y</field>
                                   </block>
                                 </value>
-                                <value name="POSB">
-                                  <block type="lcd_set_width_height" id="YJpfL3[cLT11Ay28C!A)">
-                                    <value name="WIDTH">
-                                      <shadow type="math_number" id="Oahwz7^;Zoh?S7#`}B83">
-                                        <field name="NUM">320</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id="|)R?.xxj$C7HQWoumb2!">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">w</field>
-                                      </block>
-                                    </value>
-                                    <value name="HEIGHT">
-                                      <shadow type="math_number" id="qg!GHG7SOc8!M[}bgEus">
-                                        <field name="NUM">240</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id="kjAzTu6?1%^MUkw?@6zO">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">h</field>
-                                      </block>
-                                    </value>
+                              </block>
+                            </value>
+                            <value name="POSB">
+                              <block type="lcd_set_width_height" id="YJpfL3[cLT11Ay28C!A)">
+                                <value name="WIDTH">
+                                  <shadow type="math_number" id="Oahwz7^;Zoh?S7#`}B83">
+                                    <field name="NUM">320</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id="|)R?.xxj$C7HQWoumb2!">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">w</field>
                                   </block>
                                 </value>
-                                <value name="COLOR">
-                                  <block type="lcd_set_color" id="nO8r=r!1Z*kGVe?]XKch">
-                                    <field name="COLOR">#ff0000</field>
+                                <value name="HEIGHT">
+                                  <shadow type="math_number" id="qg!GHG7SOc8!M[}bgEus">
+                                    <field name="NUM">240</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id="kjAzTu6?1%^MUkw?@6zO">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">h</field>
                                   </block>
                                 </value>
                               </block>
-                            </statement>
+                            </value>
+                            <value name="COLOR">
+                              <block type="lcd_set_color" id="nO8r=r!1Z*kGVe?]XKch">
+                                <field name="COLOR">#ff0000</field>
+                              </block>
+                            </value>
                           </block>
                         </statement>
-                        <next>
-                          <block type="ai_lcd_showcarvas_set_display" id="j*eVEQ!e+ZHeIuY)*{Hk">
-                            <field name="varitem">canvas</field>
-                          </block>
-                        </next>
                       </block>
+                    </statement>
+                    <next>
+                      <block type="ai_lcd_showcarvas_set_display" id="V*0L{lbS!vap6~qBB55+"></block>
                     </next>
                   </block>
                 </next>
               </block>
-            </statement>
+            </next>
           </block>
-        </next>
+        </statement>
       </block>
     </next>
   </block>

+ 111 - 127
src/python/图像处理/寻找蓝色并追踪.xml

@@ -1,158 +1,142 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="C?v(YEe$x4G?o*-U1IXH" x="325" y="-118">
-    <field name="isScreen">False</field>
+  <block type="CocoRobo_return_list" id="P`(OGxj{C.hgN3(D$c3F" x="-3" y="-42">
+    <value name="list_name">
+      <block type="variables_get" id="J!NFjNYk_1+ee,/xVTel">
+        <field name="VAR">my_list</field>
+      </block>
+    </value>
+    <value name="list_items">
+      <shadow type="text_list" id="|_!BmX6|dd}{cqQydWkR">
+        <field name="TEXT">(3, 35, 8, 127, -128, -25)</field>
+      </shadow>
+    </value>
     <next>
-      <block type="CocoRobo_return_list" id="P`(OGxj{C.hgN3(D$c3F">
-        <value name="list_name">
-          <block type="variables_get" id="J!NFjNYk_1+ee,/xVTel">
-            <field name="VAR">my_list</field>
-          </block>
-        </value>
-        <value name="list_items">
-          <shadow type="text_list" id="|_!BmX6|dd}{cqQydWkR">
-            <field name="TEXT">(3, 35, 8, 127, -128, -25)</field>
-          </shadow>
-        </value>
-        <next>
-          <block type="controls_repeat_forever" id="PG.b9?agjAbFGi)W$h8Q">
-            <statement name="DO">
-              <block type="variables_set" id="U[qT/|r8}7``,N`vk6?J">
-                <field name="VAR">canvas</field>
+      <block type="controls_repeat_forever" id="8{M85LykUWXhtk4]1Mzo">
+        <statement name="DO">
+          <block type="ai_camera_snapshot" id="|O}93OKa;w5H@dN6O#6*">
+            <next>
+              <block type="variables_set" id="Be6jL@[${6n^r-+UBgTH">
+                <field name="VAR">lane_trackingline</field>
                 <value name="VALUE">
-                  <shadow type="math_number" id="%CW!*Owz+{eafwR7.CU_">
+                  <shadow type="math_number" id="MK*,d~E#uM99E`Ns.R[+">
                     <field name="NUM">0</field>
                   </shadow>
-                  <block type="ai_camera_snapshot" id="-JAPBQuzh[!ohjs10zcD"></block>
-                </value>
-                <next>
-                  <block type="variables_set" id="Be6jL@[${6n^r-+UBgTH">
-                    <field name="VAR">lane_trackingline</field>
-                    <value name="VALUE">
-                      <shadow type="math_number" id="MK*,d~E#uM99E`Ns.R[+">
-                        <field name="NUM">0</field>
-                      </shadow>
-                      <block type="ai_vision_find_lines" id="L,`DvE]*E{k|(@*N0UuU">
-                        <field name="varitem">canvas</field>
-                        <value name="color">
-                          <block type="variables_get" id="WOfho],O:s?[BGl~b[++">
-                            <field name="VAR">my_list</field>
-                          </block>
+                  <block type="ai_vision_find_lines" id="L,`DvE]*E{k|(@*N0UuU">
+                    <value name="color">
+                      <block type="variables_get" id="WOfho],O:s?[BGl~b[++">
+                        <field name="VAR">my_list</field>
+                      </block>
+                    </value>
+                    <value name="xy">
+                      <block type="ai_lcd_XY_vision" id="qp`6Ag}S(o^Na-9Jys2[">
+                        <value name="A">
+                          <shadow type="math_number" id=":qwlhg/wIfpQa(Rw$69n">
+                            <field name="NUM">0</field>
+                          </shadow>
                         </value>
-                        <value name="xy">
-                          <block type="ai_lcd_XY_vision" id="qp`6Ag}S(o^Na-9Jys2[">
-                            <value name="A">
-                              <shadow type="math_number" id=":qwlhg/wIfpQa(Rw$69n">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                            <value name="B">
-                              <shadow type="math_number" id="TaS=ObGC*%iTDauv+H#/">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                          </block>
+                        <value name="B">
+                          <shadow type="math_number" id="TaS=ObGC*%iTDauv+H#/">
+                            <field name="NUM">0</field>
+                          </shadow>
                         </value>
-                        <value name="wh">
-                          <block type="ai_lcd_WH_vision" id="W#Q4.3R4CODi?k~Ss$lG">
-                            <value name="A">
-                              <shadow type="math_number" id="sfLV)y[gG^^-Mu$yWxB@">
-                                <field name="NUM">320</field>
-                              </shadow>
-                            </value>
-                            <value name="B">
-                              <shadow type="math_number" id="aW[D}k?%fDYg[~Izr8#J">
-                                <field name="NUM">240</field>
-                              </shadow>
-                            </value>
-                          </block>
+                      </block>
+                    </value>
+                    <value name="wh">
+                      <block type="ai_lcd_WH_vision" id="W#Q4.3R4CODi?k~Ss$lG">
+                        <value name="A">
+                          <shadow type="math_number" id="sfLV)y[gG^^-Mu$yWxB@">
+                            <field name="NUM">320</field>
+                          </shadow>
+                        </value>
+                        <value name="B">
+                          <shadow type="math_number" id="aW[D}k?%fDYg[~Izr8#J">
+                            <field name="NUM">240</field>
+                          </shadow>
                         </value>
                       </block>
                     </value>
-                    <next>
-                      <block type="controls_if" id="lq$n#IfH1/4pvWv-wL-,">
-                        <value name="IF0">
-                          <block type="variables_get" id="ehLTH8xuzAOt}]va=.IX">
+                  </block>
+                </value>
+                <next>
+                  <block type="controls_if" id="lq$n#IfH1/4pvWv-wL-,">
+                    <value name="IF0">
+                      <block type="variables_get" id="ehLTH8xuzAOt}]va=.IX">
+                        <field name="VAR">lane_trackingline</field>
+                      </block>
+                    </value>
+                    <statement name="DO0">
+                      <block type="controls_forEach" id=":3wy$Xc`Sv32@xSFxBx-">
+                        <field name="VAR">i</field>
+                        <value name="LIST">
+                          <block type="variables_get" id="b=*R+[9wjMM4N,t~6!nJ">
                             <field name="VAR">lane_trackingline</field>
                           </block>
                         </value>
-                        <statement name="DO0">
-                          <block type="controls_forEach" id=":3wy$Xc`Sv32@xSFxBx-">
-                            <field name="VAR">i</field>
-                            <value name="LIST">
-                              <block type="variables_get" id="b=*R+[9wjMM4N,t~6!nJ">
-                                <field name="VAR">lane_trackingline</field>
-                              </block>
-                            </value>
-                            <statement name="DO">
-                              <block type="ai_lcd_draw_rectangle" id="eBgtX|r@luiM?GG*%Xn!">
-                                <field name="varitem">canvas</field>
-                                <field name="rect_type">rect</field>
-                                <value name="POSA">
-                                  <block type="lcd_set_position" id="J=o`rve`5M%Id-26ax0_">
-                                    <value name="POSX">
-                                      <shadow type="math_number" id="#hIXYdf]gbH3rz3Ie@4R">
-                                        <field name="NUM">0</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id=":BS86o$a1_kmKJ:$!^DY">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">x</field>
-                                      </block>
-                                    </value>
-                                    <value name="POSY">
-                                      <shadow type="math_number" id="L{sWd7QkA(G7a^){-;@L">
-                                        <field name="NUM">0</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id="/NYSB-IHEQ~VnGCjB^cp">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">y</field>
-                                      </block>
-                                    </value>
+                        <statement name="DO">
+                          <block type="ai_lcd_draw_rectangle" id="eBgtX|r@luiM?GG*%Xn!">
+                            <field name="rect_type">rect</field>
+                            <value name="POSA">
+                              <block type="lcd_set_position" id="J=o`rve`5M%Id-26ax0_">
+                                <value name="POSX">
+                                  <shadow type="math_number" id="#hIXYdf]gbH3rz3Ie@4R">
+                                    <field name="NUM">0</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id=":BS86o$a1_kmKJ:$!^DY">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">x</field>
+                                  </block>
+                                </value>
+                                <value name="POSY">
+                                  <shadow type="math_number" id="L{sWd7QkA(G7a^){-;@L">
+                                    <field name="NUM">0</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id="/NYSB-IHEQ~VnGCjB^cp">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">y</field>
                                   </block>
                                 </value>
-                                <value name="POSB">
-                                  <block type="lcd_set_width_height" id="YJpfL3[cLT11Ay28C!A)">
-                                    <value name="WIDTH">
-                                      <shadow type="math_number" id="Oahwz7^;Zoh?S7#`}B83">
-                                        <field name="NUM">320</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id="|)R?.xxj$C7HQWoumb2!">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">w</field>
-                                      </block>
-                                    </value>
-                                    <value name="HEIGHT">
-                                      <shadow type="math_number" id="qg!GHG7SOc8!M[}bgEus">
-                                        <field name="NUM">240</field>
-                                      </shadow>
-                                      <block type="ai_vision_get_blobs" id="kjAzTu6?1%^MUkw?@6zO">
-                                        <field name="varitem">i</field>
-                                        <field name="blob_type">h</field>
-                                      </block>
-                                    </value>
+                              </block>
+                            </value>
+                            <value name="POSB">
+                              <block type="lcd_set_width_height" id="YJpfL3[cLT11Ay28C!A)">
+                                <value name="WIDTH">
+                                  <shadow type="math_number" id="Oahwz7^;Zoh?S7#`}B83">
+                                    <field name="NUM">320</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id="|)R?.xxj$C7HQWoumb2!">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">w</field>
                                   </block>
                                 </value>
-                                <value name="COLOR">
-                                  <block type="lcd_set_color" id="nO8r=r!1Z*kGVe?]XKch">
-                                    <field name="COLOR">#ff0000</field>
+                                <value name="HEIGHT">
+                                  <shadow type="math_number" id="qg!GHG7SOc8!M[}bgEus">
+                                    <field name="NUM">240</field>
+                                  </shadow>
+                                  <block type="ai_vision_get_blobs" id="kjAzTu6?1%^MUkw?@6zO">
+                                    <field name="varitem">i</field>
+                                    <field name="blob_type">h</field>
                                   </block>
                                 </value>
                               </block>
-                            </statement>
+                            </value>
+                            <value name="COLOR">
+                              <block type="lcd_set_color" id="nO8r=r!1Z*kGVe?]XKch">
+                                <field name="COLOR">#ff0000</field>
+                              </block>
+                            </value>
                           </block>
                         </statement>
-                        <next>
-                          <block type="ai_lcd_showcarvas_set_display" id="j*eVEQ!e+ZHeIuY)*{Hk">
-                            <field name="varitem">canvas</field>
-                          </block>
-                        </next>
                       </block>
+                    </statement>
+                    <next>
+                      <block type="ai_lcd_showcarvas_set_display" id="V*0L{lbS!vap6~qBB55+"></block>
                     </next>
                   </block>
                 </next>
               </block>
-            </statement>
+            </next>
           </block>
-        </next>
+        </statement>
       </block>
     </next>
   </block>

+ 167 - 185
src/python/图像处理/循线-单.xml

@@ -1,232 +1,214 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="s#cEy_A$|EU4?-y,a4Dv" x="-7" y="84">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="PG.b9?agjAbFGi)W$h8Q">
-        <statement name="DO">
-          <block type="variables_set" id="U[qT/|r8}7``,N`vk6?J">
-            <field name="VAR">canvas</field>
+  <block type="controls_repeat_forever" id="aN4(,txRY%N7|n8I[S!l" x="107" y="28">
+    <statement name="DO">
+      <block type="ai_camera_snapshot" id="m_OH)9ZeUD8Ijvxhm!99">
+        <next>
+          <block type="variables_set" id="Be6jL@[${6n^r-+UBgTH">
+            <field name="VAR">lane_trackingline</field>
             <value name="VALUE">
-              <shadow type="math_number" id="%CW!*Owz+{eafwR7.CU_">
+              <shadow type="math_number" id="MK*,d~E#uM99E`Ns.R[+">
                 <field name="NUM">0</field>
               </shadow>
-              <block type="ai_camera_snapshot" id="-JAPBQuzh[!ohjs10zcD"></block>
+              <block type="ai_vision_find_blobs" id="cSuVwOUJ*9%dcx0Ef_PW">
+                <value name="color">
+                  <block type="ai_vision_get_threshold_default" id="gYVP2M*(;!^]z*Vh$d?B">
+                    <field name="color">black</field>
+                  </block>
+                </value>
+                <value name="xy">
+                  <block type="ai_lcd_XY_vision" id="K%e~mW6djYb9V}aq{{1q">
+                    <value name="A">
+                      <shadow type="math_number" id="k:AVm}9sOGJqMP5$|,;(">
+                        <field name="NUM">100</field>
+                      </shadow>
+                    </value>
+                    <value name="B">
+                      <shadow type="math_number" id="#:liOrYWFjja{+u=5T%A">
+                        <field name="NUM">60</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <value name="wh">
+                  <block type="ai_lcd_WH_vision" id="12uLtu=_rN*1h.T.[W7)">
+                    <value name="A">
+                      <shadow type="math_number" id="T-sP`0sS*9C-zF,c^rTQ">
+                        <field name="NUM">120</field>
+                      </shadow>
+                    </value>
+                    <value name="B">
+                      <shadow type="math_number" id="qwCyqf9!UfCM8]z-1D4.">
+                        <field name="NUM">120</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+              </block>
             </value>
             <next>
-              <block type="variables_set" id="Be6jL@[${6n^r-+UBgTH">
-                <field name="VAR">lane_trackingline</field>
-                <value name="VALUE">
-                  <shadow type="math_number" id="MK*,d~E#uM99E`Ns.R[+">
-                    <field name="NUM">0</field>
-                  </shadow>
-                  <block type="ai_vision_find_blobs" id="t27WZW/Mq210;]rJxY=T">
-                    <field name="varitem">canvas</field>
-                    <value name="color">
-                      <block type="ai_vision_get_threshold_default" id="a%S,UpSrd-$c.t#FG4U-">
-                        <field name="color">black</field>
-                      </block>
-                    </value>
-                    <value name="xy">
-                      <block type="ai_lcd_XY_vision" id="1(X{bHMog9gdKyH~fP.)">
-                        <value name="A">
-                          <shadow type="math_number" id="l9P;_8%c#)uH|D?m3Ag?">
-                            <field name="NUM">100</field>
+              <block type="controls_if" id="%l@VNX*UNxpZooxcy}b;">
+                <mutation elseif="1" else="1"></mutation>
+                <value name="IF0">
+                  <block type="logic_compare" id="~tiS25ts[n$T$Gy%j{WH">
+                    <field name="OP">GT</field>
+                    <value name="A">
+                      <block type="dict_key_value" id="#)TZv?zfA2,,)Il^][I{">
+                        <value name="dict_name">
+                          <shadow type="text_dict" id="M2L1Nz2$o8n`}-_P)X2D">
+                            <field name="TEXT"></field>
                           </shadow>
+                          <block type="variables_get" id=";Y#b@[ahb|wne3:*S6@C">
+                            <field name="VAR">lane_trackingline</field>
+                          </block>
                         </value>
-                        <value name="B">
-                          <shadow type="math_number" id="u{TK+S*84=xw(t.67R~8">
-                            <field name="NUM">60</field>
+                        <value name="dict_items">
+                          <shadow type="text" id="Wdf-Dkzi*D,_qske~Fy)">
+                            <field name="TEXT">cx</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
-                    <value name="wh">
-                      <block type="ai_lcd_WH_vision" id="F%E+.9*Pw`qq+VHRt.Li">
-                        <value name="A">
-                          <shadow type="math_number" id="dhY2+GzxRi(4,ccDK@v-">
-                            <field name="NUM">120</field>
-                          </shadow>
-                        </value>
-                        <value name="B">
-                          <shadow type="math_number" id="_@H{*`Ky3kW#UDSxix#5">
-                            <field name="NUM">120</field>
-                          </shadow>
-                        </value>
+                    <value name="B">
+                      <block type="math_number" id="louSfKK%e-`PqWB`+R4x">
+                        <field name="NUM">170</field>
                       </block>
                     </value>
                   </block>
                 </value>
-                <next>
-                  <block type="controls_if" id="%l@VNX*UNxpZooxcy}b;">
-                    <mutation elseif="1" else="1"></mutation>
-                    <value name="IF0">
-                      <block type="logic_compare" id="~tiS25ts[n$T$Gy%j{WH">
-                        <field name="OP">GT</field>
-                        <value name="A">
-                          <block type="dict_key_value" id="#)TZv?zfA2,,)Il^][I{">
-                            <value name="dict_name">
-                              <shadow type="text_dict" id="M2L1Nz2$o8n`}-_P)X2D">
-                                <field name="TEXT"></field>
-                              </shadow>
-                              <block type="variables_get" id=";Y#b@[ahb|wne3:*S6@C">
-                                <field name="VAR">lane_trackingline</field>
-                              </block>
-                            </value>
-                            <value name="dict_items">
-                              <shadow type="text" id="Wdf-Dkzi*D,_qske~Fy)">
-                                <field name="TEXT">cx</field>
-                              </shadow>
-                            </value>
-                          </block>
+                <statement name="DO0">
+                  <block type="ai_lcd_textcarvas" id="d9O*rXy*lE%g-Q,|iJ|u">
+                    <value name="POSA">
+                      <block type="lcd_set_position" id="4|)Wb0dk=-n14C,lBGBJ">
+                        <value name="POSX">
+                          <shadow type="math_number" id="DQ1[?buxu=IN,m@rsicW">
+                            <field name="NUM">0</field>
+                          </shadow>
                         </value>
-                        <value name="B">
-                          <block type="math_number" id="louSfKK%e-`PqWB`+R4x">
-                            <field name="NUM">170</field>
-                          </block>
+                        <value name="POSY">
+                          <shadow type="math_number" id="md;P54-/}5(=!:qo(_]@">
+                            <field name="NUM">0</field>
+                          </shadow>
                         </value>
                       </block>
                     </value>
-                    <statement name="DO0">
-                      <block type="ai_lcd_textcarvas" id="d9O*rXy*lE%g-Q,|iJ|u">
-                        <field name="varitem">canvas</field>
-                        <value name="POSA">
-                          <block type="lcd_set_position" id="4|)Wb0dk=-n14C,lBGBJ">
-                            <value name="POSX">
-                              <shadow type="math_number" id="DQ1[?buxu=IN,m@rsicW">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                            <value name="POSY">
-                              <shadow type="math_number" id="md;P54-/}5(=!:qo(_]@">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                          </block>
-                        </value>
-                        <value name="CONTENT">
-                          <shadow type="text" id="*N?#AYSo5*A.?eRGixE8">
-                            <field name="TEXT">靠右了</field>
+                    <value name="CONTENT">
+                      <shadow type="text" id="*N?#AYSo5*A.?eRGixE8">
+                        <field name="TEXT">靠右了</field>
+                      </shadow>
+                    </value>
+                    <value name="COLOR">
+                      <block type="lcd_set_color" id="?d)#?]1Bb(-Fi_xzga;x">
+                        <field name="COLOR">#33cc00</field>
+                      </block>
+                    </value>
+                    <value name="Scale">
+                      <shadow type="math_number" id="!5#hy=rSlt,@v#6Hp]B4">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </statement>
+                <value name="IF1">
+                  <block type="logic_compare" id="v6)qr?7Qn-M4FRCw.%gF">
+                    <field name="OP">LT</field>
+                    <value name="A">
+                      <block type="dict_key_value" id="Csj:*@F?]};vI@]iHlj-">
+                        <value name="dict_name">
+                          <shadow type="text_dict" id="M2L1Nz2$o8n`}-_P)X2D">
+                            <field name="TEXT"></field>
                           </shadow>
-                        </value>
-                        <value name="COLOR">
-                          <block type="lcd_set_color" id="?d)#?]1Bb(-Fi_xzga;x">
-                            <field name="COLOR">#33cc00</field>
+                          <block type="variables_get" id="~i[=~N|H1+p}|S]W]+w6">
+                            <field name="VAR">lane_trackingline</field>
                           </block>
                         </value>
-                        <value name="Scale">
-                          <shadow type="math_number" id="!5#hy=rSlt,@v#6Hp]B4">
-                            <field name="NUM">1</field>
+                        <value name="dict_items">
+                          <shadow type="text" id="gEx-ADe@0`?Xm`dIebgf">
+                            <field name="TEXT">cx</field>
                           </shadow>
                         </value>
                       </block>
-                    </statement>
-                    <value name="IF1">
-                      <block type="logic_compare" id="v6)qr?7Qn-M4FRCw.%gF">
-                        <field name="OP">LT</field>
-                        <value name="A">
-                          <block type="dict_key_value" id="Csj:*@F?]};vI@]iHlj-">
-                            <value name="dict_name">
-                              <shadow type="text_dict" id="M2L1Nz2$o8n`}-_P)X2D">
-                                <field name="TEXT"></field>
-                              </shadow>
-                              <block type="variables_get" id="~i[=~N|H1+p}|S]W]+w6">
-                                <field name="VAR">lane_trackingline</field>
-                              </block>
-                            </value>
-                            <value name="dict_items">
-                              <shadow type="text" id="gEx-ADe@0`?Xm`dIebgf">
-                                <field name="TEXT">cx</field>
-                              </shadow>
-                            </value>
-                          </block>
-                        </value>
-                        <value name="B">
-                          <block type="math_number" id="x;7X*ox0QuDf^36aZd7[">
-                            <field name="NUM">150</field>
-                          </block>
-                        </value>
+                    </value>
+                    <value name="B">
+                      <block type="math_number" id="x;7X*ox0QuDf^36aZd7[">
+                        <field name="NUM">150</field>
                       </block>
                     </value>
-                    <statement name="DO1">
-                      <block type="ai_lcd_textcarvas" id="|/^c8(:Ey:gGYn=}s`+Q">
-                        <field name="varitem">canvas</field>
-                        <value name="POSA">
-                          <block type="lcd_set_position" id="XFt#Nv!8b,_5Zg8#|RJo">
-                            <value name="POSX">
-                              <shadow type="math_number" id="Dj(Dt|72-@jRWs$vz+A?">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                            <value name="POSY">
-                              <shadow type="math_number" id="q7HTURZ`o!8?Mcw*PxzE">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                          </block>
-                        </value>
-                        <value name="CONTENT">
-                          <shadow type="text" id="sWl?@xd*g{aKZ%O?]j`Q">
-                            <field name="TEXT">靠左了</field>
+                  </block>
+                </value>
+                <statement name="DO1">
+                  <block type="ai_lcd_textcarvas" id="|/^c8(:Ey:gGYn=}s`+Q">
+                    <value name="POSA">
+                      <block type="lcd_set_position" id="XFt#Nv!8b,_5Zg8#|RJo">
+                        <value name="POSX">
+                          <shadow type="math_number" id="Dj(Dt|72-@jRWs$vz+A?">
+                            <field name="NUM">0</field>
                           </shadow>
                         </value>
-                        <value name="COLOR">
-                          <block type="lcd_set_color" id="SxXw6FZK*h3b2D_zz#|C">
-                            <field name="COLOR">#33cc00</field>
-                          </block>
-                        </value>
-                        <value name="Scale">
-                          <shadow type="math_number" id="eM@d~HqmAg^cq.8_?k*2">
-                            <field name="NUM">1</field>
+                        <value name="POSY">
+                          <shadow type="math_number" id="q7HTURZ`o!8?Mcw*PxzE">
+                            <field name="NUM">0</field>
                           </shadow>
                         </value>
                       </block>
-                    </statement>
-                    <statement name="ELSE">
-                      <block type="ai_lcd_textcarvas" id="Re-vQ}%g`A7!SH1Lg6U/">
-                        <field name="varitem">canvas</field>
-                        <value name="POSA">
-                          <block type="lcd_set_position" id="NB[[fW^GFRH)6/{hAoM;">
-                            <value name="POSX">
-                              <shadow type="math_number" id="LclHz!,)p4CZ[LXz{El%">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                            <value name="POSY">
-                              <shadow type="math_number" id="2x,7xUtqkA9Oc,D%9b_(">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                          </block>
-                        </value>
-                        <value name="CONTENT">
-                          <shadow type="text" id="YU7($8{O)i3=Fs:@bkS~">
-                            <field name="TEXT">直行</field>
+                    </value>
+                    <value name="CONTENT">
+                      <shadow type="text" id="sWl?@xd*g{aKZ%O?]j`Q">
+                        <field name="TEXT">靠左了</field>
+                      </shadow>
+                    </value>
+                    <value name="COLOR">
+                      <block type="lcd_set_color" id="SxXw6FZK*h3b2D_zz#|C">
+                        <field name="COLOR">#33cc00</field>
+                      </block>
+                    </value>
+                    <value name="Scale">
+                      <shadow type="math_number" id="eM@d~HqmAg^cq.8_?k*2">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </statement>
+                <statement name="ELSE">
+                  <block type="ai_lcd_textcarvas" id="Re-vQ}%g`A7!SH1Lg6U/">
+                    <value name="POSA">
+                      <block type="lcd_set_position" id="NB[[fW^GFRH)6/{hAoM;">
+                        <value name="POSX">
+                          <shadow type="math_number" id="LclHz!,)p4CZ[LXz{El%">
+                            <field name="NUM">0</field>
                           </shadow>
                         </value>
-                        <value name="COLOR">
-                          <block type="lcd_set_color" id="Q.P(pQHS`/:SYr*R+:Ko">
-                            <field name="COLOR">#33cc00</field>
-                          </block>
-                        </value>
-                        <value name="Scale">
-                          <shadow type="math_number" id="@q)f!QX18[6B$+7Y)bQi">
-                            <field name="NUM">1</field>
+                        <value name="POSY">
+                          <shadow type="math_number" id="2x,7xUtqkA9Oc,D%9b_(">
+                            <field name="NUM">0</field>
                           </shadow>
                         </value>
                       </block>
-                    </statement>
-                    <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="j*eVEQ!e+ZHeIuY)*{Hk">
-                        <field name="varitem">canvas</field>
+                    </value>
+                    <value name="CONTENT">
+                      <shadow type="text" id="YU7($8{O)i3=Fs:@bkS~">
+                        <field name="TEXT">直行</field>
+                      </shadow>
+                    </value>
+                    <value name="COLOR">
+                      <block type="lcd_set_color" id="Q.P(pQHS`/:SYr*R+:Ko">
+                        <field name="COLOR">#33cc00</field>
                       </block>
-                    </next>
+                    </value>
+                    <value name="Scale">
+                      <shadow type="math_number" id="@q)f!QX18[6B$+7Y)bQi">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
                   </block>
+                </statement>
+                <next>
+                  <block type="ai_lcd_showcarvas_set_display" id="PbdLe{v/}{fj9l7@;J9+"></block>
                 </next>
               </block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 12 - 136
src/python/图像处理/条形码识别.xml

@@ -1,149 +1,25 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="C?v(YEe$x4G?o*-U1IXH" x="82" y="227">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="RXrT=-eQ2pG$e|yM,2{[">
-        <statement name="DO">
-          <block type="variables_set" id=")-P2M_M#jM)IY00fSi0R">
-            <field name="VAR">canvas</field>
-            <value name="VALUE">
-              <shadow type="math_number" id="ymMA[a~?0W9-vqU[`H3_">
-                <field name="NUM">0</field>
-              </shadow>
-              <block type="ai_camera_snapshot" id="TKV`q8X3)%#|ejH7lD-)"></block>
-            </value>
+  <block type="controls_repeat_forever" id="8{M85LykUWXhtk4]1Mzo" x="306" y="-333">
+    <statement name="DO">
+      <block type="ai_camera_snapshot" id="|O}93OKa;w5H@dN6O#6*">
+        <next>
+          <block type="ai_vision_find_barcodes" id="p/]C0B%7[f9X95E-=hZy">
             <next>
-              <block type="variables_set" id="eyGx^`M!x~.HB|5zo..V">
-                <field name="VAR">barCode</field>
-                <value name="VALUE">
-                  <shadow type="math_number" id="ymMA[a~?0W9-vqU[`H3_">
-                    <field name="NUM">0</field>
-                  </shadow>
-                  <block type="ai_vision_find_barcodes" id="#6pw,ii`M/eC;b1^y%QT">
-                    <field name="varitem">canvas</field>
-                  </block>
-                </value>
+              <block type="ai_vision_barcodes_get_info" id="$@yFgYbsoZWjq(#E@72k">
+                <field name="get_info">barcodesPayload</field>
                 <next>
-                  <block type="controls_forEach" id="#g)91]#X7hFEEobXENtK">
-                    <field name="VAR">i</field>
-                    <value name="LIST">
-                      <block type="variables_get" id="TH:1cSR].Weoq7x`xV3X">
-                        <field name="VAR">barCode</field>
-                      </block>
-                    </value>
-                    <statement name="DO">
-                      <block type="ai_lcd_textcarvas" id="j8#FYkDSm83QN@aBQRag">
-                        <field name="varitem">canvas</field>
-                        <value name="POSA">
-                          <block type="lcd_set_position" id=",u,62:*G]6iBGaK3uZ/3">
-                            <value name="POSX">
-                              <shadow type="math_number" id=":{s,U4pDy7MmNdkzh[db">
-                                <field name="NUM">0</field>
-                              </shadow>
-                              <block type="ai_vision_barcodes_get_info" id="#10$CM%]}53C9)qz9~lX">
-                                <field name="varitem">i</field>
-                                <field name="get_info">x</field>
-                              </block>
-                            </value>
-                            <value name="POSY">
-                              <shadow type="math_number" id="{4h;Hl}{5HM,4vA;q#K#">
-                                <field name="NUM">0</field>
-                              </shadow>
-                              <block type="ai_vision_barcodes_get_info" id="{FB!Xg+j9N@#5o,n(.19">
-                                <field name="varitem">i</field>
-                                <field name="get_info">y</field>
-                              </block>
-                            </value>
-                          </block>
-                        </value>
-                        <value name="CONTENT">
-                          <shadow type="text" id="!4*_1/3)tAg3ygOM.|YW">
-                            <field name="TEXT"></field>
-                          </shadow>
-                          <block type="ai_vision_barcodes_get_info" id=")n$/ybC!VT`vvHkNGfKz">
-                            <field name="varitem">i</field>
-                            <field name="get_info">payload</field>
-                          </block>
-                        </value>
-                        <value name="COLOR">
-                          <block type="lcd_set_color" id="k9L/2JvE7|(Xl@0^8)x[">
-                            <field name="COLOR">#ff0000</field>
-                          </block>
-                        </value>
-                        <value name="Scale">
-                          <shadow type="math_number" id="[}E0F%^LWN[,3~[+`W$)">
-                            <field name="NUM">1</field>
-                          </shadow>
-                        </value>
-                        <next>
-                          <block type="ai_lcd_draw_rectangle" id="jF@WWq%HrA#-GOmBCL3`">
-                            <field name="varitem">canvas</field>
-                            <field name="rect_type">rect</field>
-                            <value name="POSA">
-                              <block type="lcd_set_position" id="-]22qpxJ:pA|2q)KhtIi">
-                                <value name="POSX">
-                                  <shadow type="math_number" id=":{s,U4pDy7MmNdkzh[db">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                  <block type="ai_vision_barcodes_get_info" id="id-joL#wMi.pEiF|7v3a">
-                                    <field name="varitem">i</field>
-                                    <field name="get_info">x</field>
-                                  </block>
-                                </value>
-                                <value name="POSY">
-                                  <shadow type="math_number" id="{4h;Hl}{5HM,4vA;q#K#">
-                                    <field name="NUM">0</field>
-                                  </shadow>
-                                  <block type="ai_vision_barcodes_get_info" id="OngS/31MRB6?-(X;=msr">
-                                    <field name="varitem">i</field>
-                                    <field name="get_info">y</field>
-                                  </block>
-                                </value>
-                              </block>
-                            </value>
-                            <value name="POSB">
-                              <block type="lcd_set_width_height" id="v(UHNp.1%X+6Wz0,9Qd@">
-                                <value name="WIDTH">
-                                  <shadow type="math_number" id="qvBuHxyte]^/XCCd3^|.">
-                                    <field name="NUM">320</field>
-                                  </shadow>
-                                  <block type="ai_vision_barcodes_get_info" id="ZKK6J(BJ62~$ET6Q0c2?">
-                                    <field name="varitem">i</field>
-                                    <field name="get_info">w</field>
-                                  </block>
-                                </value>
-                                <value name="HEIGHT">
-                                  <shadow type="math_number" id="?lv9|CAoEJ_=o8dE3km%">
-                                    <field name="NUM">240</field>
-                                  </shadow>
-                                  <block type="ai_vision_barcodes_get_info" id=")i:$+sk?2jWGRm_-9(~6">
-                                    <field name="varitem">i</field>
-                                    <field name="get_info">h</field>
-                                  </block>
-                                </value>
-                              </block>
-                            </value>
-                            <value name="COLOR">
-                              <block type="lcd_set_color" id=",5((j-}UpHdxGgRj/YqY">
-                                <field name="COLOR">#ff0000</field>
-                              </block>
-                            </value>
-                          </block>
-                        </next>
-                      </block>
-                    </statement>
+                  <block type="ai_vision_barcodes_get_info" id="`!5ZX2f,v/WG1-D{p1[M">
+                    <field name="get_info">barcodesCorners</field>
                     <next>
-                      <block type="ai_lcd_showcarvas_set_display" id="6Af3VHIh=JOf)iZ::m$=">
-                        <field name="varitem">canvas</field>
-                      </block>
+                      <block type="ai_lcd_showcarvas_set_display" id="V*0L{lbS!vap6~qBB55+"></block>
                     </next>
                   </block>
                 </next>
               </block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 49 - 76
src/python/多线程.xml

@@ -1,46 +1,25 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="}jJ1qH#$I5@6.MpK!wqX" x="45" y="-12">
-    <field name="isScreen">False</field>
+  <block type="variables_set" id="vmq:hId!f9qk;BB0?mel" x="-142" y="14">
+    <field name="VAR">RGB</field>
+    <value name="VALUE">
+      <shadow type="math_number" id="g],zgWTmQ689##0WQ]U7">
+        <field name="NUM">0</field>
+      </shadow>
+    </value>
     <next>
-      <block type="variables_set" id="1uxTk*lvDgbmRH5t=l0p">
-        <field name="VAR">RGB</field>
-        <value name="VALUE">
-          <shadow type="math_number" id="g],zgWTmQ689##0WQ]U7">
-            <field name="NUM">0</field>
-          </shadow>
-          <block type="tuple_create_with_items_insert" id="l%^pbytv--B)Tva^t_03">
-            <mutation items="3"></mutation>
-            <value name="ADD0">
-              <block type="math_number" id=":w]0k%@CqW}2mHcE~PHn">
-                <field name="NUM">0</field>
-              </block>
-            </value>
-            <value name="ADD1">
-              <block type="math_number" id="z;6~0qU6|Z5*O$gy2`i~">
-                <field name="NUM">0</field>
-              </block>
-            </value>
-            <value name="ADD2">
-              <block type="math_number" id="n,x}]-g0kGp,[2P?Tj4:">
-                <field name="NUM">0</field>
+      <block type="ai_system_thread_start" id="by.fGbx_M-JmM6KUIzN}">
+        <field name="thread">1</field>
+        <next>
+          <block type="time_delay" id="H(!}CdFmpv{s}FU^XY+R">
+            <value name="DELAY_TIME_MILI">
+              <block type="math_number" id="t[ii`6g?tcUVAjBoArmm">
+                <field name="NUM">1000</field>
               </block>
             </value>
-          </block>
-        </value>
-        <next>
-          <block type="ai_system_thread_start" id="Bql~{-zp9Ks3fM]{xJ^D">
-            <field name="thread">1</field>
             <next>
-              <block type="controls_repeat_forever" id="aN4(,txRY%N7|n8I[S!l">
+              <block type="controls_repeat_forever" id="wZgCnh-i@N13K4!@vqNn">
                 <statement name="DO">
-                  <block type="variables_set" id="$9@@V_gt#Q_)%a$q[910">
-                    <field name="VAR">canvas</field>
-                    <value name="VALUE">
-                      <shadow type="math_number" id="w^59r$x`B.:,%8lWS-PT">
-                        <field name="NUM">0</field>
-                      </shadow>
-                      <block type="ai_camera_snapshot" id="m_OH)9ZeUD8Ijvxhm!99"></block>
-                    </value>
+                  <block type="ai_camera_snapshot" id="l/S(8Y=92fc+z15b3uT-">
                     <next>
                       <block type="variables_set" id="_yL,T[]^%$p]u2UoWT3`">
                         <field name="VAR">RGB</field>
@@ -48,31 +27,30 @@
                           <shadow type="math_number" id="g],zgWTmQ689##0WQ]U7">
                             <field name="NUM">0</field>
                           </shadow>
-                          <block type="ai_vision_color_analyze" id="n5F`W+9B=3+jN^frqpG,">
-                            <field name="varitem">canvas</field>
+                          <block type="ai_vision_color_analyze" id="i5z[_3xcfNF~o{cF:}],">
                             <value name="xy">
-                              <block type="ai_lcd_XY_vision" id="T7;`h//xb!)Kgm]2{9t|">
+                              <block type="ai_lcd_XY_vision" id="vV4c+!!/8XhaPvrY~00F">
                                 <value name="A">
-                                  <shadow type="math_number" id="bcv!+jom9!.|Ny3ei/6%">
+                                  <shadow type="math_number" id="DvubSFIAlZHoCa]$s=04">
                                     <field name="NUM">154</field>
                                   </shadow>
                                 </value>
                                 <value name="B">
-                                  <shadow type="math_number" id="1:AS-b)j?kIRKMVm;]X~">
+                                  <shadow type="math_number" id="|fYZc7Yw6K!HcE[DkcVQ">
                                     <field name="NUM">114</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="wh">
-                              <block type="ai_lcd_WH_vision" id="P[{A%*6M1HVYG*ZcO)[X">
+                              <block type="ai_lcd_WH_vision" id="JGa9D{y*N!Ke(yJR+`|,">
                                 <value name="A">
-                                  <shadow type="math_number" id="({Q9|+Y#:|m:x=Z[H(.z">
+                                  <shadow type="math_number" id="c;yV1?vmC1,9o7NJ|Y,D">
                                     <field name="NUM">10</field>
                                   </shadow>
                                 </value>
                                 <value name="B">
-                                  <shadow type="math_number" id="(S0@:]sS;o_]Oq!zZyCh">
+                                  <shadow type="math_number" id="E8+^;sz{(3,7%;2IbVA:">
                                     <field name="NUM">10</field>
                                   </shadow>
                                 </value>
@@ -81,69 +59,67 @@
                           </block>
                         </value>
                         <next>
-                          <block type="ai_lcd_draw_rectangle" id="}Q8Mo[4`o:LI;W#;.fL7">
-                            <field name="varitem">canvas</field>
+                          <block type="ai_lcd_draw_rectangle" id="QqZSJ(lDPzw(Zm-xc_hL">
                             <field name="rect_type">rect</field>
                             <value name="POSA">
-                              <block type="lcd_set_position" id="9YxwQtp=w1CDcL(!5f}7">
+                              <block type="lcd_set_position" id="hTtgvm[{@{U+4me)w$I)">
                                 <value name="POSX">
-                                  <shadow type="math_number" id="/IpXG+d/zzb(t8-o@f%f">
+                                  <shadow type="math_number" id="9xVnEj1l83@;oNS-Ln[t">
                                     <field name="NUM">154</field>
                                   </shadow>
                                 </value>
                                 <value name="POSY">
-                                  <shadow type="math_number" id="VbApR5n:rfEvStP]jVB)">
+                                  <shadow type="math_number" id="m#B.S3^/|1MH6|2_icVh">
                                     <field name="NUM">114</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="POSB">
-                              <block type="lcd_set_width_height" id="w@7MyS3%^fAG+DGJz2$2">
+                              <block type="lcd_set_width_height" id="h5IKjMMb6kDp`+HWJDJn">
                                 <value name="WIDTH">
-                                  <shadow type="math_number" id="+$D_$w_`Pr[ynCrPX-_%">
+                                  <shadow type="math_number" id="?)-Z|F~wbbsH]vXH=p+5">
                                     <field name="NUM">10</field>
                                   </shadow>
                                 </value>
                                 <value name="HEIGHT">
-                                  <shadow type="math_number" id="V?21Y862sTcR8AG/11R9">
+                                  <shadow type="math_number" id="nCqU)]5:=siK/CX(_|Hm">
                                     <field name="NUM">10</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="COLOR">
-                              <block type="lcd_set_color" id="[EhYbphlkqmrM6BzA${X">
+                              <block type="lcd_set_color" id="UIRHTG^@fzXpcq?j#_aC">
                                 <field name="COLOR">#ff0000</field>
                               </block>
                             </value>
                             <next>
-                              <block type="ai_lcd_draw_rectangle" id="O0/4w%:3{6jz^!`gv$Fs">
-                                <field name="varitem">canvas</field>
+                              <block type="ai_lcd_draw_rectangle" id="9MAqXB_?up^RVZun9%K_">
                                 <field name="rect_type">fillrect</field>
                                 <value name="POSA">
-                                  <block type="lcd_set_position" id="7oR[t`_$~{6}tu?f?bf$">
+                                  <block type="lcd_set_position" id=";tDH`eH75UVA2Ipc/T;a">
                                     <value name="POSX">
-                                      <shadow type="math_number" id="uh#RD0AVIWi3A,yxM-cj">
+                                      <shadow type="math_number" id="v!S~Lid7XV)f:KP)^yMD">
                                         <field name="NUM">0</field>
                                       </shadow>
                                     </value>
                                     <value name="POSY">
-                                      <shadow type="math_number" id="O_#^V`o=v.6YpGtr`o:,">
+                                      <shadow type="math_number" id="iKmJW)r/LkleS*W{E!I+">
                                         <field name="NUM">0</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
                                 <value name="POSB">
-                                  <block type="lcd_set_position" id="O*$xVY]io{n7_Dh11X@+">
-                                    <value name="POSX">
-                                      <shadow type="math_number" id="aU5`hx/Y+[`pv|N=,q2G">
+                                  <block type="lcd_set_width_height" id="YKd!fV;!0*Y!8Cs9SoaO">
+                                    <value name="WIDTH">
+                                      <shadow type="math_number" id="WRP3eh{[Q41HiAu_^d|e">
                                         <field name="NUM">319</field>
                                       </shadow>
                                     </value>
-                                    <value name="POSY">
-                                      <shadow type="math_number" id="S(}rQYiohQE?BcY=js#S">
+                                    <value name="HEIGHT">
+                                      <shadow type="math_number" id=".@h-Xb6FS?C@TZINoK(0">
                                         <field name="NUM">20</field>
                                       </shadow>
                                     </value>
@@ -232,24 +208,23 @@
                                   </block>
                                 </value>
                                 <next>
-                                  <block type="ai_lcd_textcarvas" id="IK,n$aiF1a1/(}r=UNSz">
-                                    <field name="varitem">canvas</field>
+                                  <block type="ai_lcd_textcarvas" id="hi;x:k2EI=eoD?;6]~AX">
                                     <value name="POSA">
-                                      <block type="lcd_set_position" id="AbPik8xD:qp.$;E-1Cq~">
+                                      <block type="lcd_set_position" id="qdw7SbN+FAC0)dHqRM}1">
                                         <value name="POSX">
-                                          <shadow type="math_number" id="-ksCtYA|k~!YHp9$u2w5">
+                                          <shadow type="math_number" id="J`O]tdhTBDnJ}6A88~hy">
                                             <field name="NUM">120</field>
                                           </shadow>
                                         </value>
                                         <value name="POSY">
-                                          <shadow type="math_number" id="fO^m#`2(,[6+2`+:k!K=">
+                                          <shadow type="math_number" id="~qeDDIFzPvgYEw#OO=,C">
                                             <field name="NUM">0</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="CONTENT">
-                                      <shadow type="text" id="tRjl`]r:u6{-?qq:.*OA">
+                                      <shadow type="text" id="8,,Ha8ex1im{{~U9`U/E">
                                         <field name="TEXT"></field>
                                       </shadow>
                                       <block type="text_join" id="LJS$J[4KqzEEBUa!Q_?y">
@@ -467,14 +442,12 @@
                                       </block>
                                     </value>
                                     <value name="Scale">
-                                      <shadow type="math_number" id="bjDr!Br;~d9PVc]SI4+j">
+                                      <shadow type="math_number" id="$S8,o)ONNs!S6WgFYiWu">
                                         <field name="NUM">1</field>
                                       </shadow>
                                     </value>
                                     <next>
-                                      <block type="ai_lcd_showcarvas_set_display" id="PbdLe{v/}{fj9l7@;J9+">
-                                        <field name="varitem">canvas</field>
-                                      </block>
+                                      <block type="ai_lcd_showcarvas_set_display" id="KU_|n45EAKb,.=[/wBRo"></block>
                                     </next>
                                   </block>
                                 </next>
@@ -493,13 +466,13 @@
       </block>
     </next>
   </block>
-  <block type="ai_system_thread" id="0*AhzbN$yqg?kINWG7:]" x="816" y="155">
+  <block type="ai_system_thread" id="0*AhzbN$yqg?kINWG7:]" x="539" y="51">
     <field name="thread">1</field>
     <statement name="input">
       <block type="controls_repeat_forever" id="pbjpUY|lFc]csVpvqCL@">
         <statement name="DO">
           <block type="ai_audio_play_song" id="BEy*+6D^Fe[47|:oMUhF">
-            <field name="play_vol">100</field>
+            <field name="play_vol">75</field>
             <value name="path">
               <shadow type="text" id="r{Ywm4y~k#xfe/j6YTAd">
                 <field name="TEXT">/root/preset/audio/luckystar.wav</field>

+ 186 - 201
src/python/屏幕/小游戏:漫步者.xml

@@ -1,122 +1,212 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="3J#h)y(@eVv8|q=12Y|." x="-176" y="-28">
-    <field name="isScreen">False</field>
+  <block type="variables_set" id="h8Z3vr|%/ctwDca,mJO?" x="-176" y="-2">
+    <field name="VAR">X</field>
+    <value name="VALUE">
+      <shadow type="math_number" id="c(:ImmcO!caw#K.BzHX]">
+        <field name="NUM">0</field>
+      </shadow>
+    </value>
     <next>
-      <block type="variables_set" id="h8Z3vr|%/ctwDca,mJO?">
-        <field name="VAR">X</field>
+      <block type="variables_set" id="~(s|ExE:D2zIGh`!N5U*">
+        <field name="VAR">Y</field>
         <value name="VALUE">
-          <shadow type="math_number" id="c(:ImmcO!caw#K.BzHX]">
+          <shadow type="math_number" id="4Y;ge*p}r}trnK1D_[U`">
             <field name="NUM">0</field>
           </shadow>
         </value>
         <next>
-          <block type="variables_set" id="~(s|ExE:D2zIGh`!N5U*">
-            <field name="VAR">Y</field>
-            <value name="VALUE">
-              <shadow type="math_number" id="4Y;ge*p}r}trnK1D_[U`">
-                <field name="NUM">0</field>
-              </shadow>
-            </value>
-            <next>
-              <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
-                <statement name="DO">
-                  <block type="ai_lcd_clearcanvas" id="HsTt+N})TXqh99foO.Y$">
-                    <field name="varitem">canvas</field>
+          <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
+            <statement name="DO">
+              <block type="ai_lcd_clearcanvas" id="HsTt+N})TXqh99foO.Y$">
+                <next>
+                  <block type="procedures_callnoreturn" id="G8y+d;mKh.vB{g3LgraL">
+                    <mutation name="tips"></mutation>
                     <next>
-                      <block type="procedures_callnoreturn" id="G8y+d;mKh.vB{g3LgraL">
-                        <mutation name="tips"></mutation>
+                      <block type="procedures_callnoreturn" id="$4MiV3/!jT*E$RV(!qg=">
+                        <mutation name="Key_switch"></mutation>
                         <next>
-                          <block type="procedures_callnoreturn" id="$4MiV3/!jT*E$RV(!qg=">
-                            <mutation name="Key_switch"></mutation>
+                          <block type="controls_for" id="nDL%909vg[#*wHycNt.n">
+                            <field name="VAR">i</field>
+                            <value name="FROM">
+                              <shadow type="math_number" id="-Lkwi}jisc9$%}BC`GO7">
+                                <field name="NUM">0</field>
+                              </shadow>
+                            </value>
+                            <value name="TO">
+                              <shadow type="math_number" id="[4Ryn~HF4b#BP5%cRjz3">
+                                <field name="NUM">320</field>
+                              </shadow>
+                            </value>
+                            <value name="BY">
+                              <shadow type="math_number" id="qk(1d1?{u]$uc=^_2F(q">
+                                <field name="NUM">20</field>
+                              </shadow>
+                            </value>
+                            <statement name="DO">
+                              <block type="controls_if" id="5X}4{rAMo%I#J$SIS#_/">
+                                <value name="IF0">
+                                  <block type="logic_compare" id=":u[|q-;4%N{.,y%Pb@cZ">
+                                    <field name="OP">EQ</field>
+                                    <value name="A">
+                                      <block type="variables_get" id="/-#gsb-5TN)aKxxE]B75">
+                                        <field name="VAR">i</field>
+                                      </block>
+                                    </value>
+                                    <value name="B">
+                                      <block type="math_number" id="ocYvzaBvG_u/bLtb%=Y/">
+                                        <field name="NUM">320</field>
+                                      </block>
+                                    </value>
+                                  </block>
+                                </value>
+                                <statement name="DO0">
+                                  <block type="variables_set" id="HmWDL62WDPK6l/ps[A_}">
+                                    <field name="VAR">i</field>
+                                    <value name="VALUE">
+                                      <shadow type="math_number" id="BSVj@l}L,V^NrCGl(5;7">
+                                        <field name="NUM">319</field>
+                                      </shadow>
+                                    </value>
+                                  </block>
+                                </statement>
+                                <next>
+                                  <block type="ai_lcd_linecarvas" id="uK$u0$zgz8U^a))XpyvN">
+                                    <value name="POSA">
+                                      <block type="lcd_set_position" id="K!sh#pP)--GKlj}thork">
+                                        <value name="POSX">
+                                          <shadow type="math_number" id="_}r+^5%Im4K;$_]WG]3A">
+                                            <field name="NUM">0</field>
+                                          </shadow>
+                                          <block type="variables_get" id="[8c`z0F57Cyjas+?@OLT">
+                                            <field name="VAR">i</field>
+                                          </block>
+                                        </value>
+                                        <value name="POSY">
+                                          <shadow type="math_number" id="]ztegkN?IN9cWm-r;pkr">
+                                            <field name="NUM">0</field>
+                                          </shadow>
+                                        </value>
+                                      </block>
+                                    </value>
+                                    <value name="POSB">
+                                      <block type="lcd_set_position" id="G1t{DqVa)!TAU1/B^YIb">
+                                        <value name="POSX">
+                                          <shadow type="math_number" id="o2?Wdm%@w*:2_XgYf{0|">
+                                            <field name="NUM">0</field>
+                                          </shadow>
+                                          <block type="variables_get" id="F2;X4(%}PR-XJy_dQ:gA">
+                                            <field name="VAR">i</field>
+                                          </block>
+                                        </value>
+                                        <value name="POSY">
+                                          <shadow type="math_number" id="^[]F:0dBe$Vq/n@+YF?;">
+                                            <field name="NUM">240</field>
+                                          </shadow>
+                                        </value>
+                                      </block>
+                                    </value>
+                                    <value name="COLOR">
+                                      <block type="lcd_set_color" id="cT(PuSw#uV:v#N0L$/2K">
+                                        <field name="COLOR">#ff0000</field>
+                                      </block>
+                                    </value>
+                                    <value name="Scale">
+                                      <shadow type="math_number" id="K]:ik8mQ3wh)@WZKX;I3">
+                                        <field name="NUM">1</field>
+                                      </shadow>
+                                    </value>
+                                  </block>
+                                </next>
+                              </block>
+                            </statement>
                             <next>
-                              <block type="controls_for" id="nDL%909vg[#*wHycNt.n">
+                              <block type="controls_for" id="yYI/TsJNou`n!r6KBYKL">
                                 <field name="VAR">i</field>
                                 <value name="FROM">
-                                  <shadow type="math_number" id="-Lkwi}jisc9$%}BC`GO7">
+                                  <shadow type="math_number" id="1+6pDK)3?DRnhwA6Phrt">
                                     <field name="NUM">0</field>
                                   </shadow>
                                 </value>
                                 <value name="TO">
-                                  <shadow type="math_number" id="[4Ryn~HF4b#BP5%cRjz3">
-                                    <field name="NUM">320</field>
+                                  <shadow type="math_number" id="}SYhqn(3u|^Ef}}=C*z:">
+                                    <field name="NUM">240</field>
                                   </shadow>
                                 </value>
                                 <value name="BY">
-                                  <shadow type="math_number" id="qk(1d1?{u]$uc=^_2F(q">
+                                  <shadow type="math_number" id=";4*,_rRPR+C`nS7W+i#r">
                                     <field name="NUM">20</field>
                                   </shadow>
                                 </value>
                                 <statement name="DO">
-                                  <block type="controls_if" id="5X}4{rAMo%I#J$SIS#_/">
+                                  <block type="controls_if" id="448[Y_9.u}cYbo[JMLL9">
                                     <value name="IF0">
-                                      <block type="logic_compare" id=":u[|q-;4%N{.,y%Pb@cZ">
+                                      <block type="logic_compare" id="yiY4g?wDFg}^$UsAVwx(">
                                         <field name="OP">EQ</field>
                                         <value name="A">
-                                          <block type="variables_get" id="/-#gsb-5TN)aKxxE]B75">
+                                          <block type="variables_get" id="6l{~M$5@j}wUDfr6kQDd">
                                             <field name="VAR">i</field>
                                           </block>
                                         </value>
                                         <value name="B">
-                                          <block type="math_number" id="ocYvzaBvG_u/bLtb%=Y/">
-                                            <field name="NUM">320</field>
+                                          <block type="math_number" id="eI:Os_6mS}gOyy-7$c}O">
+                                            <field name="NUM">240</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <statement name="DO0">
-                                      <block type="variables_set" id="HmWDL62WDPK6l/ps[A_}">
+                                      <block type="variables_set" id="=o[0R/L`W^PhjKCJB`];">
                                         <field name="VAR">i</field>
                                         <value name="VALUE">
-                                          <shadow type="math_number" id="BSVj@l}L,V^NrCGl(5;7">
-                                            <field name="NUM">319</field>
+                                          <shadow type="math_number" id="K[_i(_kPO)c+W?T6=ZK^">
+                                            <field name="NUM">239</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </statement>
                                     <next>
-                                      <block type="ai_lcd_linecarvas" id="uK$u0$zgz8U^a))XpyvN">
-                                        <field name="varitem">canvas</field>
+                                      <block type="ai_lcd_linecarvas" id="#b0?U(d@P#|6Py6j=AJF">
                                         <value name="POSA">
-                                          <block type="lcd_set_position" id="K!sh#pP)--GKlj}thork">
+                                          <block type="lcd_set_position" id="qs!y86{HcbxRdi,R;n9A">
                                             <value name="POSX">
                                               <shadow type="math_number" id="_}r+^5%Im4K;$_]WG]3A">
                                                 <field name="NUM">0</field>
                                               </shadow>
-                                              <block type="variables_get" id="[8c`z0F57Cyjas+?@OLT">
-                                                <field name="VAR">i</field>
-                                              </block>
                                             </value>
                                             <value name="POSY">
-                                              <shadow type="math_number" id="]ztegkN?IN9cWm-r;pkr">
+                                              <shadow type="math_number" id="A+Lu$r;-d=A6!fs!bOr!">
                                                 <field name="NUM">0</field>
                                               </shadow>
+                                              <block type="variables_get" id="Yvn(Hd%K6Y]4+6EK1Z,{">
+                                                <field name="VAR">i</field>
+                                              </block>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="POSB">
-                                          <block type="lcd_set_position" id="G1t{DqVa)!TAU1/B^YIb">
+                                          <block type="lcd_set_position" id="O21TV^@Ubmgh-c7slWZK">
                                             <value name="POSX">
                                               <shadow type="math_number" id="o2?Wdm%@w*:2_XgYf{0|">
-                                                <field name="NUM">0</field>
+                                                <field name="NUM">320</field>
                                               </shadow>
-                                              <block type="variables_get" id="F2;X4(%}PR-XJy_dQ:gA">
-                                                <field name="VAR">i</field>
-                                              </block>
                                             </value>
                                             <value name="POSY">
-                                              <shadow type="math_number" id="^[]F:0dBe$Vq/n@+YF?;">
-                                                <field name="NUM">240</field>
+                                              <shadow type="math_number" id="/Iyrr2$z.On5N]3abaPe">
+                                                <field name="NUM">239</field>
                                               </shadow>
+                                              <block type="variables_get" id="(.t3U^~`5-EI,w]Z{ZUI">
+                                                <field name="VAR">i</field>
+                                              </block>
                                             </value>
                                           </block>
                                         </value>
                                         <value name="COLOR">
-                                          <block type="lcd_set_color" id="cT(PuSw#uV:v#N0L$/2K">
+                                          <block type="lcd_set_color" id="v=HeQP6Qq8[;br|9LP+r">
                                             <field name="COLOR">#ff0000</field>
                                           </block>
                                         </value>
                                         <value name="Scale">
-                                          <shadow type="math_number" id="K]:ik8mQ3wh)@WZKX;I3">
+                                          <shadow type="math_number" id="@g+kL,2-obQP7m@8gFlQ">
                                             <field name="NUM">1</field>
                                           </shadow>
                                         </value>
@@ -125,167 +215,66 @@
                                   </block>
                                 </statement>
                                 <next>
-                                  <block type="controls_for" id="yYI/TsJNou`n!r6KBYKL">
-                                    <field name="VAR">i</field>
-                                    <value name="FROM">
-                                      <shadow type="math_number" id="1+6pDK)3?DRnhwA6Phrt">
-                                        <field name="NUM">0</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="TO">
-                                      <shadow type="math_number" id="}SYhqn(3u|^Ef}}=C*z:">
-                                        <field name="NUM">240</field>
-                                      </shadow>
-                                    </value>
-                                    <value name="BY">
-                                      <shadow type="math_number" id=";4*,_rRPR+C`nS7W+i#r">
-                                        <field name="NUM">20</field>
-                                      </shadow>
-                                    </value>
-                                    <statement name="DO">
-                                      <block type="controls_if" id="448[Y_9.u}cYbo[JMLL9">
-                                        <value name="IF0">
-                                          <block type="logic_compare" id="yiY4g?wDFg}^$UsAVwx(">
-                                            <field name="OP">EQ</field>
+                                  <block type="ai_lcd_drawcirclecarvas" id="%~|bx]G8FT+-,(3:c,%y">
+                                    <field name="rect_type">fillrect</field>
+                                    <value name="POSA">
+                                      <block type="lcd_set_position" id="P([KcY-g7#Z]vnMn15SD">
+                                        <value name="POSX">
+                                          <shadow type="math_number" id="=`63wy9gh32`/?_f?~o@">
+                                            <field name="NUM">20</field>
+                                          </shadow>
+                                          <block type="math_arithmetic" id="84[Lf=[~YYXa_HuG|k20">
+                                            <field name="OP">ADD</field>
                                             <value name="A">
-                                              <block type="variables_get" id="6l{~M$5@j}wUDfr6kQDd">
-                                                <field name="VAR">i</field>
+                                              <shadow type="math_number" id="y4hT_]IT?_{isrqdU^{/">
+                                                <field name="NUM">1</field>
+                                              </shadow>
+                                              <block type="variables_get" id="]cxpCqaR-4Q%`Nxir}9R">
+                                                <field name="VAR">X</field>
                                               </block>
                                             </value>
                                             <value name="B">
-                                              <block type="math_number" id="eI:Os_6mS}gOyy-7$c}O">
-                                                <field name="NUM">240</field>
-                                              </block>
-                                            </value>
-                                          </block>
-                                        </value>
-                                        <statement name="DO0">
-                                          <block type="variables_set" id="=o[0R/L`W^PhjKCJB`];">
-                                            <field name="VAR">i</field>
-                                            <value name="VALUE">
-                                              <shadow type="math_number" id="K[_i(_kPO)c+W?T6=ZK^">
-                                                <field name="NUM">239</field>
+                                              <shadow type="math_number" id="{9p1-mvg73-~@Y-w,8-Z">
+                                                <field name="NUM">10</field>
                                               </shadow>
                                             </value>
                                           </block>
-                                        </statement>
-                                        <next>
-                                          <block type="ai_lcd_linecarvas" id="#b0?U(d@P#|6Py6j=AJF">
-                                            <field name="varitem">canvas</field>
-                                            <value name="POSA">
-                                              <block type="lcd_set_position" id="qs!y86{HcbxRdi,R;n9A">
-                                                <value name="POSX">
-                                                  <shadow type="math_number" id="_}r+^5%Im4K;$_]WG]3A">
-                                                    <field name="NUM">0</field>
-                                                  </shadow>
-                                                </value>
-                                                <value name="POSY">
-                                                  <shadow type="math_number" id="A+Lu$r;-d=A6!fs!bOr!">
-                                                    <field name="NUM">0</field>
-                                                  </shadow>
-                                                  <block type="variables_get" id="Yvn(Hd%K6Y]4+6EK1Z,{">
-                                                    <field name="VAR">i</field>
-                                                  </block>
-                                                </value>
-                                              </block>
-                                            </value>
-                                            <value name="POSB">
-                                              <block type="lcd_set_position" id="O21TV^@Ubmgh-c7slWZK">
-                                                <value name="POSX">
-                                                  <shadow type="math_number" id="o2?Wdm%@w*:2_XgYf{0|">
-                                                    <field name="NUM">320</field>
-                                                  </shadow>
-                                                </value>
-                                                <value name="POSY">
-                                                  <shadow type="math_number" id="/Iyrr2$z.On5N]3abaPe">
-                                                    <field name="NUM">239</field>
-                                                  </shadow>
-                                                  <block type="variables_get" id="(.t3U^~`5-EI,w]Z{ZUI">
-                                                    <field name="VAR">i</field>
-                                                  </block>
-                                                </value>
-                                              </block>
-                                            </value>
-                                            <value name="COLOR">
-                                              <block type="lcd_set_color" id="v=HeQP6Qq8[;br|9LP+r">
-                                                <field name="COLOR">#ff0000</field>
-                                              </block>
-                                            </value>
-                                            <value name="Scale">
-                                              <shadow type="math_number" id="@g+kL,2-obQP7m@8gFlQ">
+                                        </value>
+                                        <value name="POSY">
+                                          <shadow type="math_number" id="qAdL:Z,Ri_(QV:4}6^3k">
+                                            <field name="NUM">20</field>
+                                          </shadow>
+                                          <block type="math_arithmetic" id="b{/kPQ}G]KIf/Y6]?Cbw">
+                                            <field name="OP">ADD</field>
+                                            <value name="A">
+                                              <shadow type="math_number" id="y4hT_]IT?_{isrqdU^{/">
                                                 <field name="NUM">1</field>
                                               </shadow>
-                                            </value>
-                                          </block>
-                                        </next>
-                                      </block>
-                                    </statement>
-                                    <next>
-                                      <block type="ai_lcd_drawcirclecarvas" id="%~|bx]G8FT+-,(3:c,%y">
-                                        <field name="varitem">canvas</field>
-                                        <field name="rect_type">fillrect</field>
-                                        <value name="POSA">
-                                          <block type="lcd_set_position" id="P([KcY-g7#Z]vnMn15SD">
-                                            <value name="POSX">
-                                              <shadow type="math_number" id="=`63wy9gh32`/?_f?~o@">
-                                                <field name="NUM">20</field>
-                                              </shadow>
-                                              <block type="math_arithmetic" id="84[Lf=[~YYXa_HuG|k20">
-                                                <field name="OP">ADD</field>
-                                                <value name="A">
-                                                  <shadow type="math_number" id="y4hT_]IT?_{isrqdU^{/">
-                                                    <field name="NUM">1</field>
-                                                  </shadow>
-                                                  <block type="variables_get" id="]cxpCqaR-4Q%`Nxir}9R">
-                                                    <field name="VAR">X</field>
-                                                  </block>
-                                                </value>
-                                                <value name="B">
-                                                  <shadow type="math_number" id="{9p1-mvg73-~@Y-w,8-Z">
-                                                    <field name="NUM">10</field>
-                                                  </shadow>
-                                                </value>
+                                              <block type="variables_get" id="9=?5WZ3yD8+JOw`Rmmbr">
+                                                <field name="VAR">Y</field>
                                               </block>
                                             </value>
-                                            <value name="POSY">
-                                              <shadow type="math_number" id="qAdL:Z,Ri_(QV:4}6^3k">
-                                                <field name="NUM">20</field>
+                                            <value name="B">
+                                              <shadow type="math_number" id="g(azYPfg_bJlUm:(:?}q">
+                                                <field name="NUM">10</field>
                                               </shadow>
-                                              <block type="math_arithmetic" id="b{/kPQ}G]KIf/Y6]?Cbw">
-                                                <field name="OP">ADD</field>
-                                                <value name="A">
-                                                  <shadow type="math_number" id="y4hT_]IT?_{isrqdU^{/">
-                                                    <field name="NUM">1</field>
-                                                  </shadow>
-                                                  <block type="variables_get" id="9=?5WZ3yD8+JOw`Rmmbr">
-                                                    <field name="VAR">Y</field>
-                                                  </block>
-                                                </value>
-                                                <value name="B">
-                                                  <shadow type="math_number" id="g(azYPfg_bJlUm:(:?}q">
-                                                    <field name="NUM">10</field>
-                                                  </shadow>
-                                                </value>
-                                              </block>
                                             </value>
                                           </block>
                                         </value>
-                                        <value name="Scale">
-                                          <shadow type="math_number" id="=6wM(Kl92V/n4]LnrJ%e">
-                                            <field name="NUM">5</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="COLOR">
-                                          <block type="lcd_set_color" id="UOV;$ooBCseZBIc$Tsch">
-                                            <field name="COLOR">#ffffff</field>
-                                          </block>
-                                        </value>
-                                        <next>
-                                          <block type="ai_lcd_showcarvas_set_display" id="+H@8W[D|6=/2t2*v~}Q}">
-                                            <field name="varitem">canvas</field>
-                                          </block>
-                                        </next>
                                       </block>
+                                    </value>
+                                    <value name="Scale">
+                                      <shadow type="math_number" id="=6wM(Kl92V/n4]LnrJ%e">
+                                        <field name="NUM">5</field>
+                                      </shadow>
+                                    </value>
+                                    <value name="COLOR">
+                                      <block type="lcd_set_color" id="UOV;$ooBCseZBIc$Tsch">
+                                        <field name="COLOR">#ffffff</field>
+                                      </block>
+                                    </value>
+                                    <next>
+                                      <block type="ai_lcd_showcarvas_set_display" id="+H@8W[D|6=/2t2*v~}Q}"></block>
                                     </next>
                                   </block>
                                 </next>
@@ -296,9 +285,9 @@
                       </block>
                     </next>
                   </block>
-                </statement>
+                </next>
               </block>
-            </next>
+            </statement>
           </block>
         </next>
       </block>
@@ -308,7 +297,6 @@
     <field name="NAME">tips</field>
     <statement name="STACK">
       <block type="ai_lcd_textcarvas" id=",.WjL{L#[`Ipeh+ICR-E">
-        <field name="varitem">canvas</field>
         <value name="POSA">
           <block type="lcd_set_position" id="7+12F-yizkg]d`HERhB9">
             <value name="POSX">
@@ -340,7 +328,6 @@
         </value>
         <next>
           <block type="ai_lcd_textcarvas" id="e5_p9Tx[hFzSRv2(r*4D">
-            <field name="varitem">canvas</field>
             <value name="POSA">
               <block type="lcd_set_position" id="%*xMn4/o.IF_$:2{PyTG">
                 <value name="POSX">
@@ -372,7 +359,6 @@
             </value>
             <next>
               <block type="ai_lcd_textcarvas" id="TXbr`/n)AsfhH+Ib2vG=">
-                <field name="varitem">canvas</field>
                 <value name="POSA">
                   <block type="lcd_set_position" id="NRO==pJ5~7rpMI5N70+T">
                     <value name="POSX">
@@ -404,7 +390,6 @@
                 </value>
                 <next>
                   <block type="ai_lcd_textcarvas" id="Z`3xn]wCW_5P.XOr#;8X">
-                    <field name="varitem">canvas</field>
                     <value name="POSA">
                       <block type="lcd_set_position" id="i2gsouY5JFyI{uWMg|kH">
                         <value name="POSX">

+ 152 - 160
src/python/屏幕/按键切换背景色.xml

@@ -1,294 +1,286 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="3J#h)y(@eVv8|q=12Y|." x="-176" y="-28">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="!5t0w-uT,FiTCDY.Qnb^">
-        <statement name="DO">
-          <block type="ai_lcd_clearcanvas" id="~8wy06Xx:wT+y^2BSFP@">
-            <field name="varitem">canvas</field>
-            <next>
-              <block type="ai_lcd_textcarvas" id="ut3*C1=w9gR-BcnQM@++">
-                <field name="varitem">canvas</field>
-                <value name="POSA">
-                  <block type="lcd_set_position" id="eT[=Pn[{u.C{_I.C3q}]">
-                    <value name="POSX">
-                      <shadow type="math_number" id="xMLkvj^.8v:7F8cm+HMn">
-                        <field name="NUM">0</field>
-                      </shadow>
-                    </value>
-                    <value name="POSY">
-                      <shadow type="math_number" id="6Md}rM?XCv9UR|[e}Om~">
-                        <field name="NUM">0</field>
-                      </shadow>
-                    </value>
-                  </block>
-                </value>
-                <value name="CONTENT">
-                  <shadow type="text" id="M@a%5E@lAD(X_@}.$5N4">
-                    <field name="TEXT">未按键</field>
+  <block type="controls_repeat_forever" id="!5t0w-uT,FiTCDY.Qnb^" x="-176" y="-2">
+    <statement name="DO">
+      <block type="ai_lcd_clearcanvas" id="~8wy06Xx:wT+y^2BSFP@">
+        <next>
+          <block type="ai_lcd_textcarvas" id="ut3*C1=w9gR-BcnQM@++">
+            <value name="POSA">
+              <block type="lcd_set_position" id="eT[=Pn[{u.C{_I.C3q}]">
+                <value name="POSX">
+                  <shadow type="math_number" id="xMLkvj^.8v:7F8cm+HMn">
+                    <field name="NUM">0</field>
                   </shadow>
                 </value>
-                <value name="COLOR">
-                  <block type="lcd_set_color" id="PzWhRXGirSlSkbI/-OON">
-                    <field name="COLOR">#ffffff</field>
-                  </block>
-                </value>
-                <value name="Scale">
-                  <shadow type="math_number" id=".L7b:C.^=Xf~h]f2~A{B">
-                    <field name="NUM">2</field>
+                <value name="POSY">
+                  <shadow type="math_number" id="6Md}rM?XCv9UR|[e}Om~">
+                    <field name="NUM">0</field>
                   </shadow>
                 </value>
+              </block>
+            </value>
+            <value name="CONTENT">
+              <shadow type="text" id="M@a%5E@lAD(X_@}.$5N4">
+                <field name="TEXT">未按键</field>
+              </shadow>
+            </value>
+            <value name="COLOR">
+              <block type="lcd_set_color" id="PzWhRXGirSlSkbI/-OON">
+                <field name="COLOR">#ffffff</field>
+              </block>
+            </value>
+            <value name="Scale">
+              <shadow type="math_number" id=".L7b:C.^=Xf~h]f2~A{B">
+                <field name="NUM">2</field>
+              </shadow>
+            </value>
+            <next>
+              <block type="ai_v831_button_read_pressed" id="O7oEg,NS_wf,YoH.U!vm">
+                <field name="button_type">A</field>
+                <statement name="input">
+                  <block type="ai_lcd_fill_screen_with_rgb" id="9fb?i3?_F?BboUphgzRi">
+                    <value name="rgb_value">
+                      <block type="ai_lcd_rgb_value_input" id="b.N,Hfnd15?c1e)XAssr">
+                        <value name="rgb_value_r">
+                          <shadow type="math_number" id="0sx+j_gGv|3#cTSV/%~/">
+                            <field name="NUM">0</field>
+                          </shadow>
+                        </value>
+                        <value name="rgb_value_g">
+                          <shadow type="math_number" id="`A(%Q9kTs-}@b~yegoQl">
+                            <field name="NUM">255</field>
+                          </shadow>
+                        </value>
+                        <value name="rgb_value_b">
+                          <shadow type="math_number" id="FPP{pAJjw~{l|G^lQlX)">
+                            <field name="NUM">255</field>
+                          </shadow>
+                        </value>
+                      </block>
+                    </value>
+                    <next>
+                      <block type="ai_lcd_textcarvas" id="Vzb@G?nh1D?8l3XL6r`l">
+                        <value name="POSA">
+                          <block type="lcd_set_position" id="3M^j^c}ETH8|[Gj/%[rE">
+                            <value name="POSX">
+                              <shadow type="math_number" id="O79(r+rSJiDMuf3?+dt|">
+                                <field name="NUM">100</field>
+                              </shadow>
+                            </value>
+                            <value name="POSY">
+                              <shadow type="math_number" id="!n-r|NiusBjPnqgk*ESs">
+                                <field name="NUM">100</field>
+                              </shadow>
+                            </value>
+                          </block>
+                        </value>
+                        <value name="CONTENT">
+                          <shadow type="text" id="vG56wDLAZ$#8O4Ff!O0T">
+                            <field name="TEXT">A</field>
+                          </shadow>
+                        </value>
+                        <value name="COLOR">
+                          <block type="lcd_set_color" id="2VpvVkyVpyE5Ztc0tGUD">
+                            <field name="COLOR">#ffffff</field>
+                          </block>
+                        </value>
+                        <value name="Scale">
+                          <shadow type="math_number" id="C9_`#Dw3AVL~Os;+p1O|">
+                            <field name="NUM">3</field>
+                          </shadow>
+                        </value>
+                        <next>
+                          <block type="ai_lcd_showcarvas_set_display" id="N,-ZwN$2#8EKhdJ3l!nG"></block>
+                        </next>
+                      </block>
+                    </next>
+                  </block>
+                </statement>
                 <next>
-                  <block type="ai_v831_button_read_pressed" id="O7oEg,NS_wf,YoH.U!vm">
-                    <field name="button_type">A</field>
+                  <block type="ai_v831_button_read_pressed" id="m0/}1Qh.yMu{(#=j]$%P">
+                    <field name="button_type">B</field>
                     <statement name="input">
-                      <block type="ai_lcd_fill_screen_with_rgb" id="9fb?i3?_F?BboUphgzRi">
-                        <field name="varitem">canvas</field>
+                      <block type="ai_lcd_fill_screen_with_rgb" id="C;*p],kq0DT7R9W}|;jP">
                         <value name="rgb_value">
-                          <block type="ai_lcd_rgb_value_input" id="b.N,Hfnd15?c1e)XAssr">
+                          <block type="ai_lcd_rgb_value_input" id="*WTq6R6137y5g7O`U}_S">
                             <value name="rgb_value_r">
-                              <shadow type="math_number" id="0sx+j_gGv|3#cTSV/%~/">
+                              <shadow type="math_number" id="SQ0,}G,gY.+_icWz$DSu">
                                 <field name="NUM">0</field>
                               </shadow>
                             </value>
                             <value name="rgb_value_g">
-                              <shadow type="math_number" id="`A(%Q9kTs-}@b~yegoQl">
-                                <field name="NUM">255</field>
+                              <shadow type="math_number" id="JY2FbUh*]p$JuMCc^0{k">
+                                <field name="NUM">0</field>
                               </shadow>
                             </value>
                             <value name="rgb_value_b">
-                              <shadow type="math_number" id="FPP{pAJjw~{l|G^lQlX)">
+                              <shadow type="math_number" id="6(#kB9GwAoS[fbUN,cwo">
                                 <field name="NUM">255</field>
                               </shadow>
                             </value>
                           </block>
                         </value>
                         <next>
-                          <block type="ai_lcd_textcarvas" id="Vzb@G?nh1D?8l3XL6r`l">
-                            <field name="varitem">canvas</field>
+                          <block type="ai_lcd_textcarvas" id=")v7$xOCz5ER[bCX/@=1,">
                             <value name="POSA">
-                              <block type="lcd_set_position" id="3M^j^c}ETH8|[Gj/%[rE">
+                              <block type="lcd_set_position" id="i0ZHi8M_Lfmz+btMyw*h">
                                 <value name="POSX">
-                                  <shadow type="math_number" id="O79(r+rSJiDMuf3?+dt|">
+                                  <shadow type="math_number" id="G$uqr;/.kdM~P.7lojf}">
                                     <field name="NUM">100</field>
                                   </shadow>
                                 </value>
                                 <value name="POSY">
-                                  <shadow type="math_number" id="!n-r|NiusBjPnqgk*ESs">
+                                  <shadow type="math_number" id=")#y4H0!zWR+V~}R/5yk|">
                                     <field name="NUM">100</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="CONTENT">
-                              <shadow type="text" id="vG56wDLAZ$#8O4Ff!O0T">
-                                <field name="TEXT">A</field>
+                              <shadow type="text" id="o.g[CAR/`IMu9DLbcTH8">
+                                <field name="TEXT">B</field>
                               </shadow>
                             </value>
                             <value name="COLOR">
-                              <block type="lcd_set_color" id="2VpvVkyVpyE5Ztc0tGUD">
+                              <block type="lcd_set_color" id="3*M~,,*{WqtlPhm!Af60">
                                 <field name="COLOR">#ffffff</field>
                               </block>
                             </value>
                             <value name="Scale">
-                              <shadow type="math_number" id="C9_`#Dw3AVL~Os;+p1O|">
+                              <shadow type="math_number" id="{EEg3i{+|xKq7I(6~5^w">
                                 <field name="NUM">3</field>
                               </shadow>
                             </value>
+                            <next>
+                              <block type="ai_lcd_showcarvas_set_display" id="6LyFU=kmj}ZoY~J{#|,d"></block>
+                            </next>
                           </block>
                         </next>
                       </block>
                     </statement>
                     <next>
-                      <block type="ai_v831_button_read_pressed" id="m0/}1Qh.yMu{(#=j]$%P">
-                        <field name="button_type">B</field>
+                      <block type="ai_v831_button_read_pressed" id="k5%mGpDD9oWl6s.Ubl#-">
+                        <field name="button_type">C</field>
                         <statement name="input">
-                          <block type="ai_lcd_fill_screen_with_rgb" id="C;*p],kq0DT7R9W}|;jP">
-                            <field name="varitem">canvas</field>
+                          <block type="ai_lcd_fill_screen_with_rgb" id="W[Mb$cT:y$MXTg`k,ALT">
                             <value name="rgb_value">
-                              <block type="ai_lcd_rgb_value_input" id="*WTq6R6137y5g7O`U}_S">
+                              <block type="ai_lcd_rgb_value_input" id="UrJu86X@_7AEe:{j{S[U">
                                 <value name="rgb_value_r">
-                                  <shadow type="math_number" id="SQ0,}G,gY.+_icWz$DSu">
+                                  <shadow type="math_number" id="5jKp7S^PuEDax,z)Faj?">
                                     <field name="NUM">0</field>
                                   </shadow>
                                 </value>
                                 <value name="rgb_value_g">
-                                  <shadow type="math_number" id="JY2FbUh*]p$JuMCc^0{k">
-                                    <field name="NUM">0</field>
+                                  <shadow type="math_number" id="#_{6a6])1|T*5k16J%2N">
+                                    <field name="NUM">255</field>
                                   </shadow>
                                 </value>
                                 <value name="rgb_value_b">
-                                  <shadow type="math_number" id="6(#kB9GwAoS[fbUN,cwo">
-                                    <field name="NUM">255</field>
+                                  <shadow type="math_number" id="*ST+5BY=E2?C)5LCi_%@">
+                                    <field name="NUM">0</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <next>
-                              <block type="ai_lcd_textcarvas" id=")v7$xOCz5ER[bCX/@=1,">
-                                <field name="varitem">canvas</field>
+                              <block type="ai_lcd_textcarvas" id="ps3K^2UPWwa:(/{};ttV">
                                 <value name="POSA">
-                                  <block type="lcd_set_position" id="i0ZHi8M_Lfmz+btMyw*h">
+                                  <block type="lcd_set_position" id="rTqzw@MON@y;/59BkQL:">
                                     <value name="POSX">
-                                      <shadow type="math_number" id="G$uqr;/.kdM~P.7lojf}">
+                                      <shadow type="math_number" id="gpZs*4ELjb}Xs?/AB+ol">
                                         <field name="NUM">100</field>
                                       </shadow>
                                     </value>
                                     <value name="POSY">
-                                      <shadow type="math_number" id=")#y4H0!zWR+V~}R/5yk|">
+                                      <shadow type="math_number" id="~^Z=Ne1@-HSU09SG_MIX">
                                         <field name="NUM">100</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
                                 <value name="CONTENT">
-                                  <shadow type="text" id="o.g[CAR/`IMu9DLbcTH8">
-                                    <field name="TEXT">B</field>
+                                  <shadow type="text" id="0.Jg6R@g-+J^|9a:]L#i">
+                                    <field name="TEXT">C</field>
                                   </shadow>
                                 </value>
                                 <value name="COLOR">
-                                  <block type="lcd_set_color" id="3*M~,,*{WqtlPhm!Af60">
+                                  <block type="lcd_set_color" id="Ks1yeyZKtgo=4+kONMo3">
                                     <field name="COLOR">#ffffff</field>
                                   </block>
                                 </value>
                                 <value name="Scale">
-                                  <shadow type="math_number" id="{EEg3i{+|xKq7I(6~5^w">
+                                  <shadow type="math_number" id="k9~#i830XD]a1;Sz3%#1">
                                     <field name="NUM">3</field>
                                   </shadow>
                                 </value>
+                                <next>
+                                  <block type="ai_lcd_showcarvas_set_display" id="y-+)DWyYJ!_*,QWGE|EW"></block>
+                                </next>
                               </block>
                             </next>
                           </block>
                         </statement>
                         <next>
-                          <block type="ai_v831_button_read_pressed" id="k5%mGpDD9oWl6s.Ubl#-">
-                            <field name="button_type">C</field>
+                          <block type="ai_v831_button_read_pressed" id="VjS/~Ex+lzR]Vl}rXA,j">
+                            <field name="button_type">D</field>
                             <statement name="input">
-                              <block type="ai_lcd_fill_screen_with_rgb" id="W[Mb$cT:y$MXTg`k,ALT">
-                                <field name="varitem">canvas</field>
+                              <block type="ai_lcd_fill_screen_with_rgb" id="J+kqwWxn{i4jwuNuk:H%">
                                 <value name="rgb_value">
-                                  <block type="ai_lcd_rgb_value_input" id="UrJu86X@_7AEe:{j{S[U">
+                                  <block type="ai_lcd_rgb_value_input" id="}P*kc20$]V0n)}hfd=p-">
                                     <value name="rgb_value_r">
-                                      <shadow type="math_number" id="5jKp7S^PuEDax,z)Faj?">
-                                        <field name="NUM">0</field>
+                                      <shadow type="math_number" id="JRd[!@LG/`,{*-;+:qC@">
+                                        <field name="NUM">255</field>
                                       </shadow>
                                     </value>
                                     <value name="rgb_value_g">
-                                      <shadow type="math_number" id="#_{6a6])1|T*5k16J%2N">
-                                        <field name="NUM">255</field>
+                                      <shadow type="math_number" id="Eg$:r@N*6Dbe.i9,-N3J">
+                                        <field name="NUM">0</field>
                                       </shadow>
                                     </value>
                                     <value name="rgb_value_b">
-                                      <shadow type="math_number" id="*ST+5BY=E2?C)5LCi_%@">
+                                      <shadow type="math_number" id="P:W2D=TfkWl_`l2ot$a{">
                                         <field name="NUM">0</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
                                 <next>
-                                  <block type="ai_lcd_textcarvas" id="ps3K^2UPWwa:(/{};ttV">
-                                    <field name="varitem">canvas</field>
+                                  <block type="ai_lcd_textcarvas" id="h~U;!ey-1(_^r-vZ_EcU">
                                     <value name="POSA">
-                                      <block type="lcd_set_position" id="rTqzw@MON@y;/59BkQL:">
+                                      <block type="lcd_set_position" id="vpH;?YX%ySz@Vv@S=3@%">
                                         <value name="POSX">
-                                          <shadow type="math_number" id="gpZs*4ELjb}Xs?/AB+ol">
+                                          <shadow type="math_number" id="Uz$aB~)ER?RtV$%(^o$$">
                                             <field name="NUM">100</field>
                                           </shadow>
                                         </value>
                                         <value name="POSY">
-                                          <shadow type="math_number" id="~^Z=Ne1@-HSU09SG_MIX">
+                                          <shadow type="math_number" id="qAWQPFxVT1=UHf60{MlQ">
                                             <field name="NUM">100</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="CONTENT">
-                                      <shadow type="text" id="0.Jg6R@g-+J^|9a:]L#i">
-                                        <field name="TEXT">C</field>
+                                      <shadow type="text" id="#dsE/UEDdnaTxMf?7{#A">
+                                        <field name="TEXT">D</field>
                                       </shadow>
                                     </value>
                                     <value name="COLOR">
-                                      <block type="lcd_set_color" id="Ks1yeyZKtgo=4+kONMo3">
+                                      <block type="lcd_set_color" id="`*-_9yQKP;7;PPI!efxY">
                                         <field name="COLOR">#ffffff</field>
                                       </block>
                                     </value>
                                     <value name="Scale">
-                                      <shadow type="math_number" id="k9~#i830XD]a1;Sz3%#1">
+                                      <shadow type="math_number" id="K[+VY.6C|DywBz)6bqB4">
                                         <field name="NUM">3</field>
                                       </shadow>
                                     </value>
-                                  </block>
-                                </next>
-                              </block>
-                            </statement>
-                            <next>
-                              <block type="ai_v831_button_read_pressed" id="VjS/~Ex+lzR]Vl}rXA,j">
-                                <field name="button_type">D</field>
-                                <statement name="input">
-                                  <block type="ai_lcd_fill_screen_with_rgb" id="J+kqwWxn{i4jwuNuk:H%">
-                                    <field name="varitem">canvas</field>
-                                    <value name="rgb_value">
-                                      <block type="ai_lcd_rgb_value_input" id="}P*kc20$]V0n)}hfd=p-">
-                                        <value name="rgb_value_r">
-                                          <shadow type="math_number" id="JRd[!@LG/`,{*-;+:qC@">
-                                            <field name="NUM">255</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="rgb_value_g">
-                                          <shadow type="math_number" id="Eg$:r@N*6Dbe.i9,-N3J">
-                                            <field name="NUM">0</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="rgb_value_b">
-                                          <shadow type="math_number" id="P:W2D=TfkWl_`l2ot$a{">
-                                            <field name="NUM">0</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
-                                    </value>
                                     <next>
-                                      <block type="ai_lcd_textcarvas" id="h~U;!ey-1(_^r-vZ_EcU">
-                                        <field name="varitem">canvas</field>
-                                        <value name="POSA">
-                                          <block type="lcd_set_position" id="vpH;?YX%ySz@Vv@S=3@%">
-                                            <value name="POSX">
-                                              <shadow type="math_number" id="Uz$aB~)ER?RtV$%(^o$$">
-                                                <field name="NUM">100</field>
-                                              </shadow>
-                                            </value>
-                                            <value name="POSY">
-                                              <shadow type="math_number" id="qAWQPFxVT1=UHf60{MlQ">
-                                                <field name="NUM">100</field>
-                                              </shadow>
-                                            </value>
-                                          </block>
-                                        </value>
-                                        <value name="CONTENT">
-                                          <shadow type="text" id="#dsE/UEDdnaTxMf?7{#A">
-                                            <field name="TEXT">D</field>
-                                          </shadow>
-                                        </value>
-                                        <value name="COLOR">
-                                          <block type="lcd_set_color" id="`*-_9yQKP;7;PPI!efxY">
-                                            <field name="COLOR">#ffffff</field>
-                                          </block>
-                                        </value>
-                                        <value name="Scale">
-                                          <shadow type="math_number" id="K[+VY.6C|DywBz)6bqB4">
-                                            <field name="NUM">3</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
+                                      <block type="ai_lcd_showcarvas_set_display" id="+MNHURbmqr1Us5]52h|J"></block>
                                     </next>
                                   </block>
-                                </statement>
-                                <next>
-                                  <block type="ai_lcd_showcarvas_set_display" id="+MNHURbmqr1Us5]52h|J">
-                                    <field name="varitem">canvas</field>
-                                  </block>
                                 </next>
                               </block>
-                            </next>
+                            </statement>
                           </block>
                         </next>
                       </block>
@@ -298,8 +290,8 @@
               </block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 97 - 108
src/python/屏幕/旋转指定角度.xml

@@ -1,145 +1,134 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="3J#h)y(@eVv8|q=12Y|." x="-176" y="-28">
-    <field name="isScreen">False</field>
+  <block type="variables_set" id="h8Z3vr|%/ctwDca,mJO?" x="-176" y="-2">
+    <field name="VAR">state</field>
+    <value name="VALUE">
+      <shadow type="math_number" id="c(:ImmcO!caw#K.BzHX]">
+        <field name="NUM">0</field>
+      </shadow>
+    </value>
     <next>
-      <block type="variables_set" id="h8Z3vr|%/ctwDca,mJO?">
-        <field name="VAR">state</field>
-        <value name="VALUE">
-          <shadow type="math_number" id="c(:ImmcO!caw#K.BzHX]">
-            <field name="NUM">0</field>
-          </shadow>
-        </value>
-        <next>
-          <block type="controls_repeat_forever" id="!5t0w-uT,FiTCDY.Qnb^">
-            <statement name="DO">
-              <block type="ai_lcd_clearcanvas" id="~8wy06Xx:wT+y^2BSFP@">
-                <field name="varitem">canvas</field>
+      <block type="controls_repeat_forever" id="!5t0w-uT,FiTCDY.Qnb^">
+        <statement name="DO">
+          <block type="ai_lcd_clearcanvas" id="~8wy06Xx:wT+y^2BSFP@">
+            <next>
+              <block type="ai_lcd_draw_rectangle" id="Q`6q8=LVYXE?5D=lApHr">
+                <field name="rect_type">fillrect</field>
+                <value name="POSA">
+                  <block type="lcd_set_position" id="fjhY|mc[qB;;=Ji^MHG?">
+                    <value name="POSX">
+                      <shadow type="math_number" id="Mb(rEv7Mzk!mDLDK.vE2">
+                        <field name="NUM">0</field>
+                      </shadow>
+                    </value>
+                    <value name="POSY">
+                      <shadow type="math_number" id="gTVR#ykex9e:}+653xN0">
+                        <field name="NUM">0</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <value name="POSB">
+                  <block type="lcd_set_width_height" id="EtmPBi_e:@Hro8RotAv~">
+                    <value name="WIDTH">
+                      <shadow type="math_number" id="`I*Vk}/CjXMx^m@f|9n,">
+                        <field name="NUM">320</field>
+                      </shadow>
+                    </value>
+                    <value name="HEIGHT">
+                      <shadow type="math_number" id="Yab}/h,55,~hnAX9R2b(">
+                        <field name="NUM">240</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <value name="COLOR">
+                  <block type="lcd_set_color" id="m?9l![wVwZ67SL86;:ou">
+                    <field name="COLOR">#ff0000</field>
+                  </block>
+                </value>
                 <next>
-                  <block type="ai_lcd_draw_rectangle" id="Q`6q8=LVYXE?5D=lApHr">
-                    <field name="varitem">canvas</field>
-                    <field name="rect_type">fillrect</field>
+                  <block type="ai_lcd_textcarvas" id="}T_h+@QAJ+6Q~3BcUH~G">
                     <value name="POSA">
-                      <block type="lcd_set_position" id="fjhY|mc[qB;;=Ji^MHG?">
+                      <block type="lcd_set_position" id=")Kjfm/(yRSUf-wnf-:|g">
                         <value name="POSX">
-                          <shadow type="math_number" id="Mb(rEv7Mzk!mDLDK.vE2">
+                          <shadow type="math_number" id="_FvWVL#pVXLpF?Ak%/sv">
                             <field name="NUM">0</field>
                           </shadow>
                         </value>
                         <value name="POSY">
-                          <shadow type="math_number" id="gTVR#ykex9e:}+653xN0">
+                          <shadow type="math_number" id="x;`ATL%M9A6u{_}i42UU">
                             <field name="NUM">0</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
-                    <value name="POSB">
-                      <block type="lcd_set_width_height" id="EtmPBi_e:@Hro8RotAv~">
-                        <value name="WIDTH">
-                          <shadow type="math_number" id="`I*Vk}/CjXMx^m@f|9n,">
-                            <field name="NUM">320</field>
-                          </shadow>
-                        </value>
-                        <value name="HEIGHT">
-                          <shadow type="math_number" id="Yab}/h,55,~hnAX9R2b(">
-                            <field name="NUM">240</field>
-                          </shadow>
-                        </value>
-                      </block>
+                    <value name="CONTENT">
+                      <shadow type="text" id="!%`qGNSj6Od~)lO1eH|U">
+                        <field name="TEXT">Hello World!</field>
+                      </shadow>
                     </value>
                     <value name="COLOR">
-                      <block type="lcd_set_color" id="m?9l![wVwZ67SL86;:ou">
-                        <field name="COLOR">#ff0000</field>
+                      <block type="lcd_set_color" id="nS}B2x;}FwP+hPeWPE#T">
+                        <field name="COLOR">#ffffff</field>
                       </block>
                     </value>
+                    <value name="Scale">
+                      <shadow type="math_number" id="e)vS4.$)c)H|9Q,eePo{">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
                     <next>
-                      <block type="ai_lcd_textcarvas" id="}T_h+@QAJ+6Q~3BcUH~G">
-                        <field name="varitem">canvas</field>
-                        <value name="POSA">
-                          <block type="lcd_set_position" id=")Kjfm/(yRSUf-wnf-:|g">
-                            <value name="POSX">
-                              <shadow type="math_number" id="_FvWVL#pVXLpF?Ak%/sv">
-                                <field name="NUM">0</field>
-                              </shadow>
-                            </value>
-                            <value name="POSY">
-                              <shadow type="math_number" id="x;`ATL%M9A6u{_}i42UU">
-                                <field name="NUM">0</field>
+                      <block type="ai_v831_button_read_pressed" id="O7oEg,NS_wf,YoH.U!vm">
+                        <field name="button_type">C</field>
+                        <statement name="input">
+                          <block type="variables_set" id="Wq=T5z7C!W{(At2SIAM4">
+                            <field name="VAR">state</field>
+                            <value name="VALUE">
+                              <shadow type="math_number" id="!{5BNHFf~s-}?c0@OwD^">
+                                <field name="NUM">1</field>
                               </shadow>
                             </value>
                           </block>
-                        </value>
-                        <value name="CONTENT">
-                          <shadow type="text" id="!%`qGNSj6Od~)lO1eH|U">
-                            <field name="TEXT">Hello World!</field>
-                          </shadow>
-                        </value>
-                        <value name="COLOR">
-                          <block type="lcd_set_color" id="nS}B2x;}FwP+hPeWPE#T">
-                            <field name="COLOR">#ffffff</field>
-                          </block>
-                        </value>
-                        <value name="Scale">
-                          <shadow type="math_number" id="e)vS4.$)c)H|9Q,eePo{">
-                            <field name="NUM">1</field>
-                          </shadow>
-                        </value>
+                        </statement>
                         <next>
-                          <block type="ai_v831_button_read_pressed" id="O7oEg,NS_wf,YoH.U!vm">
-                            <field name="button_type">C</field>
+                          <block type="ai_v831_button_read_pressed" id="gHG]m_UAQx?!f8lIWQRP">
+                            <field name="button_type">D</field>
                             <statement name="input">
-                              <block type="variables_set" id="Wq=T5z7C!W{(At2SIAM4">
+                              <block type="variables_set" id="_yV+=_agwTe)?O@9$dK#">
                                 <field name="VAR">state</field>
                                 <value name="VALUE">
-                                  <shadow type="math_number" id="!{5BNHFf~s-}?c0@OwD^">
-                                    <field name="NUM">1</field>
+                                  <shadow type="math_number" id="_6Db+;3[W!2.ia@G)O9O">
+                                    <field name="NUM">0</field>
                                   </shadow>
                                 </value>
                               </block>
                             </statement>
                             <next>
-                              <block type="ai_v831_button_read_pressed" id="gHG]m_UAQx?!f8lIWQRP">
-                                <field name="button_type">D</field>
-                                <statement name="input">
-                                  <block type="variables_set" id="_yV+=_agwTe)?O@9$dK#">
-                                    <field name="VAR">state</field>
-                                    <value name="VALUE">
-                                      <shadow type="math_number" id="_6Db+;3[W!2.ia@G)O9O">
+                              <block type="controls_if" id="8:bR~0Ig.t|Vgb[Rq/kK">
+                                <mutation else="1"></mutation>
+                                <value name="IF0">
+                                  <block type="logic_compare" id="Bl^%cU}j8?7G?j-8riXC">
+                                    <field name="OP">EQ</field>
+                                    <value name="A">
+                                      <block type="variables_get" id=":~U{QIn%Z)Wj^mC2xD|Y">
+                                        <field name="VAR">state</field>
+                                      </block>
+                                    </value>
+                                    <value name="B">
+                                      <block type="math_number" id="8ceP`R;DlTk7dKxD10`b">
                                         <field name="NUM">0</field>
-                                      </shadow>
+                                      </block>
                                     </value>
                                   </block>
+                                </value>
+                                <statement name="DO0">
+                                  <block type="ai_lcd_showcarvas_set_display" id="8moPH@c=_ZhDft=Dh!@9"></block>
                                 </statement>
-                                <next>
-                                  <block type="controls_if" id="8:bR~0Ig.t|Vgb[Rq/kK">
-                                    <mutation else="1"></mutation>
-                                    <value name="IF0">
-                                      <block type="logic_compare" id="Bl^%cU}j8?7G?j-8riXC">
-                                        <field name="OP">EQ</field>
-                                        <value name="A">
-                                          <block type="variables_get" id=":~U{QIn%Z)Wj^mC2xD|Y">
-                                            <field name="VAR">state</field>
-                                          </block>
-                                        </value>
-                                        <value name="B">
-                                          <block type="math_number" id="8ceP`R;DlTk7dKxD10`b">
-                                            <field name="NUM">0</field>
-                                          </block>
-                                        </value>
-                                      </block>
-                                    </value>
-                                    <statement name="DO0">
-                                      <block type="ai_lcd_showcarvas_set_display" id="8moPH@c=_ZhDft=Dh!@9">
-                                        <field name="varitem">canvas</field>
-                                      </block>
-                                    </statement>
-                                    <statement name="ELSE">
-                                      <block type="ai_lcd_rotation" id="BEAs/4!]dL,n_)zq^JP{">
-                                        <field name="varitem">canvas</field>
-                                        <field name="DEGREE">90</field>
-                                      </block>
-                                    </statement>
+                                <statement name="ELSE">
+                                  <block type="ai_lcd_rotation" id="BEAs/4!]dL,n_)zq^JP{">
+                                    <field name="DEGREE">90</field>
                                   </block>
-                                </next>
+                                </statement>
                               </block>
                             </next>
                           </block>
@@ -149,9 +138,9 @@
                   </block>
                 </next>
               </block>
-            </statement>
+            </next>
           </block>
-        </next>
+        </statement>
       </block>
     </next>
   </block>

+ 94 - 99
src/python/屏幕/自动切换图片.xml

@@ -1,117 +1,112 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="}jJ1qH#$I5@6.MpK!wqX" x="121" y="313">
-    <field name="isScreen">False</field>
+  <block type="variables_set" id=",4vlIxdBhb[0Xss=mWCg" x="-26" y="19">
+    <field name="VAR">img_num</field>
+    <value name="VALUE">
+      <shadow type="math_number" id="7VFU!REOV@}bQ/rJXKYl">
+        <field name="NUM">0</field>
+      </shadow>
+    </value>
     <next>
-      <block type="variables_set" id=",4vlIxdBhb[0Xss=mWCg">
-        <field name="VAR">img_num</field>
-        <value name="VALUE">
-          <shadow type="math_number" id="7VFU!REOV@}bQ/rJXKYl">
-            <field name="NUM">0</field>
-          </shadow>
-        </value>
-        <next>
-          <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
-            <statement name="DO">
-              <block type="math_change" id="G:6c8!Z5D-{^uwtxSq14">
-                <field name="VAR">img_num</field>
-                <value name="DELTA">
-                  <shadow type="math_number" id="UKP:!JC]n]HNx(O1F%0W">
-                    <field name="NUM">1</field>
-                  </shadow>
-                </value>
-                <next>
-                  <block type="ai_lcd_draw_image_on_canvas" id="2].=jU}J@-1BA2RWg!~J">
-                    <field name="varitem">canvas</field>
-                    <value name="image_path">
-                      <shadow type="text" id="$6Hp`,)B8!|5Jtn(@G61">
-                        <field name="TEXT">/home/res/logo.png</field>
+      <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
+        <statement name="DO">
+          <block type="math_change" id="G:6c8!Z5D-{^uwtxSq14">
+            <field name="VAR">img_num</field>
+            <value name="DELTA">
+              <shadow type="math_number" id="UKP:!JC]n]HNx(O1F%0W">
+                <field name="NUM">1</field>
+              </shadow>
+            </value>
+            <next>
+              <block type="ai_lcd_draw_image_on_canvas" id="?=fQ;}P[;dO]Iz.QUPmp">
+                <value name="image_path">
+                  <block type="v831_img_text" id="!Rs-,c?arI*n=7sEKmXX">
+                    <value name="save_path">
+                      <shadow type="text" id="57qt)j=|dNzp1pB~*f2*">
+                        <field name="TEXT">/root/preset/img/cocorobo_logo.jpg</field>
                       </shadow>
-                      <block type="v831_img_open" id="s0,ln4drdL?dnUPBi9w^">
-                        <value name="save_path">
-                          <shadow type="text" id="#d?ikG[mrx+:`9JRv!)o">
-                            <field name="TEXT">/root/preset/img/cocorobo_logo.jpg</field>
-                          </shadow>
-                          <block type="text_join" id="]SRc/e@NTMb?Gw+5CCfU">
-                            <mutation items="2"></mutation>
-                            <value name="ADD0">
-                              <block type="text" id=".(]Ni/7A`@y!*]pN1ik:">
-                                <field name="TEXT">/root/preset/img/dog/dog</field>
+                      <block type="text_join" id="]SRc/e@NTMb?Gw+5CCfU">
+                        <mutation items="2"></mutation>
+                        <value name="ADD0">
+                          <block type="text" id=".(]Ni/7A`@y!*]pN1ik:">
+                            <field name="TEXT">/root/preset/img/dog/dog</field>
+                          </block>
+                        </value>
+                        <value name="ADD1">
+                          <block type="text_append_text" id="6*CyGwgV,%YfCVydM0l-">
+                            <value name="text_abc">
+                              <shadow type="text" id="+wAb6@5q0iL1qiOZ14[2">
+                                <field name="TEXT">abc</field>
+                              </shadow>
+                              <block type="variables_get" id=")clr!bKudA^B7wqgOJ;T">
+                                <field name="VAR">img_num</field>
                               </block>
                             </value>
-                            <value name="ADD1">
-                              <block type="text_append_text" id="6*CyGwgV,%YfCVydM0l-">
-                                <value name="text_abc">
-                                  <shadow type="text" id="+wAb6@5q0iL1qiOZ14[2">
-                                    <field name="TEXT">abc</field>
-                                  </shadow>
-                                  <block type="variables_get" id=")clr!bKudA^B7wqgOJ;T">
-                                    <field name="VAR">img_num</field>
-                                  </block>
-                                </value>
-                                <value name="append_text">
-                                  <shadow type="text" id="X|mG;E6.57~z#(p$NF`L">
-                                    <field name="TEXT">.jpg</field>
-                                  </shadow>
-                                </value>
-                              </block>
+                            <value name="append_text">
+                              <shadow type="text" id="X|mG;E6.57~z#(p$NF`L">
+                                <field name="TEXT">.jpg</field>
+                              </shadow>
                             </value>
                           </block>
                         </value>
                       </block>
                     </value>
-                    <value name="scale_y">
-                      <block type="lcd_set_position" id="HJ+e^*cfs;1D*`gY,h-@">
-                        <value name="POSX">
-                          <shadow type="math_number" id="%YKM{K#AyNXOo@Fs+j.w">
-                            <field name="NUM">0</field>
-                          </shadow>
-                        </value>
-                        <value name="POSY">
-                          <shadow type="math_number" id="*.132W_kH!x4@$,DFUkp">
-                            <field name="NUM">0</field>
-                          </shadow>
-                        </value>
-                      </block>
+                  </block>
+                </value>
+                <value name="scale_y">
+                  <block type="lcd_set_position" id="-od)~o+|x}G2xm*GNBAd">
+                    <value name="POSX">
+                      <shadow type="math_number" id="M(tclCEhlM,!zUHw^}=S">
+                        <field name="NUM">0</field>
+                      </shadow>
+                    </value>
+                    <value name="POSY">
+                      <shadow type="math_number" id="@Zyyn:y/j`v,85`B.hRz">
+                        <field name="NUM">0</field>
+                      </shadow>
                     </value>
+                  </block>
+                </value>
+                <value name="alpha">
+                  <shadow type="math_number" id="iPR}tSxTUDo-@ePpJ=:W">
+                    <field name="NUM">1</field>
+                  </shadow>
+                </value>
+                <next>
+                  <block type="ai_lcd_showcarvas_set_display" id=":1p8M*AbJxWYDRd(L!]=">
                     <next>
-                      <block type="time_delayseconds" id="I]6NV60Ie/(39h3|Ccak">
-                        <value name="DELAY_TIME_MICRO">
-                          <block type="math_number" id="w%4e|2nJ4QdGwz^(|,2G">
-                            <field name="NUM">1</field>
+                      <block type="controls_if" id="y/7v(cNSc=ozC9TeQ^aC">
+                        <value name="IF0">
+                          <block type="logic_compare" id="6i/lxgBbe1GHwm)L/9,L">
+                            <field name="OP">EQ</field>
+                            <value name="A">
+                              <block type="variables_get" id="*j^+Ng%jtfYUwY_W.`zG">
+                                <field name="VAR">img_num</field>
+                              </block>
+                            </value>
+                            <value name="B">
+                              <block type="math_number" id="0)i3)EAk^atc`zZG|,`5">
+                                <field name="NUM">30</field>
+                              </block>
+                            </value>
                           </block>
                         </value>
+                        <statement name="DO0">
+                          <block type="variables_set" id="z..dK])b8WSHyxAY5LE}">
+                            <field name="VAR">img_num</field>
+                            <value name="VALUE">
+                              <shadow type="math_number" id="y]RQ!Q}L(_web),LnumJ">
+                                <field name="NUM">0</field>
+                              </shadow>
+                            </value>
+                          </block>
+                        </statement>
                         <next>
-                          <block type="controls_if" id="!pq5kDSpjil,,sQj1|%c">
-                            <value name="IF0">
-                              <block type="logic_compare" id="BE$ZRO?ZlP(fr!0)fSh%">
-                                <field name="OP">EQ</field>
-                                <value name="A">
-                                  <block type="variables_get" id="ZAKWeZUl%A/%@e)0__$4">
-                                    <field name="VAR">img_num</field>
-                                  </block>
-                                </value>
-                                <value name="B">
-                                  <block type="math_number" id="(oQcKj#?A(n85DwM}r6.">
-                                    <field name="NUM">30</field>
-                                  </block>
-                                </value>
+                          <block type="time_delay" id="uYA4#v%Dy`TJZqDyVp;k">
+                            <value name="DELAY_TIME_MILI">
+                              <block type="math_number" id="hp0S++cD;Hj=I^hHh!fv">
+                                <field name="NUM">1000</field>
                               </block>
                             </value>
-                            <statement name="DO0">
-                              <block type="variables_set" id="OjV:UzyIQv(D4b;x3W{z">
-                                <field name="VAR">img_num</field>
-                                <value name="VALUE">
-                                  <shadow type="math_number" id="n`pefMb-;?MG2uq`R4M.">
-                                    <field name="NUM">1</field>
-                                  </shadow>
-                                </value>
-                              </block>
-                            </statement>
-                            <next>
-                              <block type="ai_lcd_showcarvas_set_display" id="+H@8W[D|6=/2t2*v~}Q}">
-                                <field name="varitem">canvas</field>
-                              </block>
-                            </next>
                           </block>
                         </next>
                       </block>
@@ -119,9 +114,9 @@
                   </block>
                 </next>
               </block>
-            </statement>
+            </next>
           </block>
-        </next>
+        </statement>
       </block>
     </next>
   </block>

+ 59 - 68
src/python/屏幕/自动换行.xml

@@ -1,79 +1,70 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="z5FW9W[Mj:0460~gQL=|" x="-106" y="21">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="K6.J`-oktV0Zu/IulOZY">
-        <statement name="DO">
-          <block type="ai_lcd_clearcanvas" id="TZ_8o`j)u8K^_,|RS^k`">
-            <field name="varitem">canvas</field>
-            <next>
-              <block type="ai_lcd_textcarvas_new_line" id="_zm,U|IEY@l7?A?|N6cr">
-                <field name="varitem">canvas</field>
-                <value name="POSA">
-                  <block type="lcd_set_position" id="L)hla%)p%xN!$@RH)(/7">
-                    <value name="POSX">
-                      <shadow type="math_number" id="R:c[G(j%jMz?1#BMO9%@">
-                        <field name="NUM">0</field>
-                      </shadow>
-                    </value>
-                    <value name="POSY">
-                      <shadow type="math_number" id="r=*9=zF`568F45/d^H2Z">
-                        <field name="NUM">0</field>
-                      </shadow>
-                    </value>
-                  </block>
-                </value>
-                <value name="CONTENT">
-                  <shadow type="text" id="X)=2n{7b}Q/u4bEi~]1n">
-                    <field name="TEXT">假如我是一只鸟, 我也应该用嘶哑的喉咙歌唱: 这被暴风雨所打击着的土地, 这永远汹涌着我们的悲愤的河流, 这无止息地吹刮着的激怒的风, 和那来自林间的无比温柔的黎明…… ——然后我死了, 连羽毛也腐烂在土地里面。 为什么我的眼里常含泪水? 因为我对这土地爱得深沉……</field>
-                  </shadow>
-                </value>
-                <value name="dispalyStr">
-                  <shadow type="math_number" id="pNb+vAfCGecGl|$Yw+LP">
-                    <field name="NUM">20</field>
+  <block type="controls_repeat_forever" id="K6.J`-oktV0Zu/IulOZY" x="-89" y="68">
+    <statement name="DO">
+      <block type="ai_lcd_clearcanvas" id="TZ_8o`j)u8K^_,|RS^k`">
+        <next>
+          <block type="ai_lcd_textcarvas_new_line" id="_zm,U|IEY@l7?A?|N6cr">
+            <value name="POSA">
+              <block type="lcd_set_position" id="L)hla%)p%xN!$@RH)(/7">
+                <value name="POSX">
+                  <shadow type="math_number" id="R:c[G(j%jMz?1#BMO9%@">
+                    <field name="NUM">0</field>
                   </shadow>
                 </value>
-                <value name="buttonUp">
-                  <shadow xmlns="" type="text">
-                    <field name="TEXT"/>
+                <value name="POSY">
+                  <shadow type="math_number" id="r=*9=zF`568F45/d^H2Z">
+                    <field name="NUM">0</field>
                   </shadow>
-                  <block type="ai_v831_button_read_pressed_canvas" id="qCGV~GFL}(xcE$Hq.[z3">
-                    <field name="button_type">C</field>
-                  </block>
                 </value>
-                <value name="buttonDown">
-                  <shadow xmlns="" type="text">
-                    <field name="TEXT"/>
-                  </shadow>
-                  <block type="ai_v831_button_read_pressed_canvas" id="gzciF+9.k)W?XXY;z_kC">
-                    <field name="button_type">D</field>
-                  </block>
-                </value>
-                <value name="COLOR">
-                  <block type="lcd_set_color" id="Gn_:i!Lkc#MRLzRl4l7#">
-                    <field name="COLOR">#ff0000</field>
-                  </block>
-                </value>
-                <value name="Scale">
-                  <shadow type="math_number" id="{0JTxjvo?@W/z3Zux%!{">
-                    <field name="NUM">1</field>
-                  </shadow>
-                </value>
-                <value name="LineNum">
-                  <shadow type="math_number" id="3Ssrj{G!`wmTe?28)HJC">
-                    <field name="NUM">40</field>
-                  </shadow>
-                </value>
-                <next>
-                  <block type="ai_lcd_showcarvas_set_display" id="cG2b4m#j(7S4VyWO8`_Y">
-                    <field name="varitem">canvas</field>
-                  </block>
-                </next>
               </block>
+            </value>
+            <value name="CONTENT">
+              <shadow type="text" id="X)=2n{7b}Q/u4bEi~]1n">
+                <field name="TEXT">假如我是一只鸟, 我也应该用嘶哑的喉咙歌唱: 这被暴风雨所打击着的土地, 这永远汹涌着我们的悲愤的河流, 这无止息地吹刮着的激怒的风, 和那来自林间的无比温柔的黎明…… ——然后我死了, 连羽毛也腐烂在土地里面。 为什么我的眼里常含泪水? 因为我对这土地爱得深沉……</field>
+              </shadow>
+            </value>
+            <value name="dispalyStr">
+              <shadow type="math_number" id="pNb+vAfCGecGl|$Yw+LP">
+                <field name="NUM">20</field>
+              </shadow>
+            </value>
+            <value name="buttonUp">
+              <shadow xmlns="" type="text">
+                <field name="TEXT"/>
+              </shadow>
+              <block type="ai_v831_button_read_pressed_canvas" id="qCGV~GFL}(xcE$Hq.[z3">
+                <field name="button_type">C</field>
+              </block>
+            </value>
+            <value name="buttonDown">
+              <shadow xmlns="" type="text">
+                <field name="TEXT"/>
+              </shadow>
+              <block type="ai_v831_button_read_pressed_canvas" id="gzciF+9.k)W?XXY;z_kC">
+                <field name="button_type">D</field>
+              </block>
+            </value>
+            <value name="COLOR">
+              <block type="lcd_set_color" id="Gn_:i!Lkc#MRLzRl4l7#">
+                <field name="COLOR">#ff0000</field>
+              </block>
+            </value>
+            <value name="Scale">
+              <shadow type="math_number" id="{0JTxjvo?@W/z3Zux%!{">
+                <field name="NUM">1</field>
+              </shadow>
+            </value>
+            <value name="LineNum">
+              <shadow type="math_number" id="3Ssrj{G!`wmTe?28)HJC">
+                <field name="NUM">40</field>
+              </shadow>
+            </value>
+            <next>
+              <block type="ai_lcd_showcarvas_set_display" id="cG2b4m#j(7S4VyWO8`_Y"></block>
             </next>
           </block>
-        </statement>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

Файловите разлики са ограничени, защото са твърде много
+ 637 - 643
src/python/屏幕/贪吃蛇.xml


+ 9 - 9
src/python/屏幕加载图片.xml

@@ -1,37 +1,37 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC" x="348" y="478">
+  <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC" x="-161" y="71">
     <statement name="DO">
-      <block type="ai_lcd_draw_image_on_canvas" id="1R:bISl}52M52d$D?8@q">
+      <block type="ai_lcd_draw_image_on_canvas" id="Jk{AMD!=!k!.*#Z9v(h[">
         <value name="image_path">
-          <block type="v831_img_open" id="C%]0Pl-vgjAHGbWj|7/i">
+          <block type="v831_img_text" id="=7_eEz2yswF,NGFQ;bl*">
             <value name="save_path">
-              <shadow type="text" id="-#s,7kt_(?D2w3OJB;5W">
+              <shadow type="text" id="aqb#]9I1fS.4g=}kRyZv">
                 <field name="TEXT">/root/preset/img/cocorobo_logo.jpg</field>
               </shadow>
             </value>
           </block>
         </value>
         <value name="scale_y">
-          <block type="lcd_set_position" id="B%LdV:7Iotqg6vH}9p-Q">
+          <block type="lcd_set_position" id="h:t7]9Cl`;;#~=0?=T9]">
             <value name="POSX">
-              <shadow type="math_number" id="L0{kF}EYf@4FkKnY2!!+">
+              <shadow type="math_number" id="u|rTnq^YcWjP|,vs[Alq">
                 <field name="NUM">0</field>
               </shadow>
             </value>
             <value name="POSY">
-              <shadow type="math_number" id="fI?q.-25}y+9h^miBpA2">
+              <shadow type="math_number" id="X3JFlUk-pCLB8yv[RyX5">
                 <field name="NUM">0</field>
               </shadow>
             </value>
           </block>
         </value>
         <value name="alpha">
-          <shadow type="math_number" id="Hj.F15jD1u}LJtDgj7}l">
+          <shadow type="math_number" id="u%r/Epk~*%G-,J/1F3Ls">
             <field name="NUM">1</field>
           </shadow>
         </value>
         <next>
-          <block type="ai_lcd_showcarvas_set_display" id="+H@8W[D|6=/2t2*v~}Q}"></block>
+          <block type="ai_lcd_showcarvas_set_display" id="w,,%k}P^69TuoFN/Tx[}"></block>
         </next>
       </block>
     </statement>

+ 31 - 39
src/python/屏幕显示hello_world.xml

@@ -1,48 +1,40 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="DuaBIX{kD]-GY#[f5H7u" x="359" y="177">
-    <field name="isScreen">False</field>
-    <next>
-      <block type="controls_repeat_forever" id="vrh0#gUxWLQ~$A}2}qU.">
-        <statement name="DO">
-          <block type="ai_lcd_textcarvas" id="}T_h+@QAJ+6Q~3BcUH~G">
-            <field name="varitem">canvas</field>
-            <value name="POSA">
-              <block type="lcd_set_position" id=")Kjfm/(yRSUf-wnf-:|g">
-                <value name="POSX">
-                  <shadow type="math_number" id="_FvWVL#pVXLpF?Ak%/sv">
-                    <field name="NUM">0</field>
-                  </shadow>
-                </value>
-                <value name="POSY">
-                  <shadow type="math_number" id="x;`ATL%M9A6u{_}i42UU">
-                    <field name="NUM">0</field>
-                  </shadow>
-                </value>
-              </block>
-            </value>
-            <value name="CONTENT">
-              <shadow type="text" id="!%`qGNSj6Od~)lO1eH|U">
-                <field name="TEXT">Hello World!</field>
+  <block type="controls_repeat_forever" id="vrh0#gUxWLQ~$A}2}qU." x="214" y="206">
+    <statement name="DO">
+      <block type="ai_lcd_textcarvas" id="}T_h+@QAJ+6Q~3BcUH~G">
+        <value name="POSA">
+          <block type="lcd_set_position" id=")Kjfm/(yRSUf-wnf-:|g">
+            <value name="POSX">
+              <shadow type="math_number" id="_FvWVL#pVXLpF?Ak%/sv">
+                <field name="NUM">0</field>
               </shadow>
             </value>
-            <value name="COLOR">
-              <block type="lcd_set_color" id="nS}B2x;}FwP+hPeWPE#T">
-                <field name="COLOR">#ffffff</field>
-              </block>
-            </value>
-            <value name="Scale">
-              <shadow type="math_number" id="e)vS4.$)c)H|9Q,eePo{">
-                <field name="NUM">1</field>
+            <value name="POSY">
+              <shadow type="math_number" id="x;`ATL%M9A6u{_}i42UU">
+                <field name="NUM">0</field>
               </shadow>
             </value>
-            <next>
-              <block type="ai_lcd_showcarvas_set_display" id="+H@8W[D|6=/2t2*v~}Q}">
-                <field name="varitem">canvas</field>
-              </block>
-            </next>
           </block>
-        </statement>
+        </value>
+        <value name="CONTENT">
+          <shadow type="text" id="!%`qGNSj6Od~)lO1eH|U">
+            <field name="TEXT">Hello World!</field>
+          </shadow>
+        </value>
+        <value name="COLOR">
+          <block type="lcd_set_color" id="nS}B2x;}FwP+hPeWPE#T">
+            <field name="COLOR">#ffffff</field>
+          </block>
+        </value>
+        <value name="Scale">
+          <shadow type="math_number" id="e)vS4.$)c)H|9Q,eePo{">
+            <field name="NUM">1</field>
+          </shadow>
+        </value>
+        <next>
+          <block type="ai_lcd_showcarvas_set_display" id="+H@8W[D|6=/2t2*v~}Q}"></block>
+        </next>
       </block>
-    </next>
+    </statement>
   </block>
 </xml>

+ 171 - 180
src/python/屏幕显示实心矩形.xml

@@ -1,250 +1,241 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="}jJ1qH#$I5@6.MpK!wqX" x="-6" y="211">
-    <field name="isScreen">False</field>
+  <block type="variables_set" id="{!t9!@n7$3M$qhIP3Un[" x="-6" y="237">
+    <field name="VAR">content</field>
+    <value name="VALUE">
+      <shadow type="math_number" id="}p`Ug:fx+#@b~xOe=hI3">
+        <field name="NUM">0</field>
+      </shadow>
+      <block type="text" id="3wt)@B@*Fq`pREQRaj#O">
+        <field name="TEXT">假如我是一只鸟, 我也应该用嘶哑的喉咙歌唱: 这被暴风雨所打击着的土地, 这永远汹涌着我们的悲愤的河流, 这无止息地吹刮着的激怒的风, 和那来自林间的无比温柔的黎明…… ——然后我死了, 连羽毛也腐烂在土地里面。 为什么我的眼里常含泪水? 因为我对这土地爱得深沉……</field>
+      </block>
+    </value>
     <next>
-      <block type="variables_set" id="{!t9!@n7$3M$qhIP3Un[">
-        <field name="VAR">content</field>
-        <value name="VALUE">
-          <shadow type="math_number" id="}p`Ug:fx+#@b~xOe=hI3">
-            <field name="NUM">0</field>
-          </shadow>
-          <block type="text" id="3wt)@B@*Fq`pREQRaj#O">
-            <field name="TEXT">假如我是一只鸟, 我也应该用嘶哑的喉咙歌唱: 这被暴风雨所打击着的土地, 这永远汹涌着我们的悲愤的河流, 这无止息地吹刮着的激怒的风, 和那来自林间的无比温柔的黎明…… ——然后我死了, 连羽毛也腐烂在土地里面。 为什么我的眼里常含泪水? 因为我对这土地爱得深沉……</field>
-          </block>
-        </value>
-        <next>
-          <block type="controls_repeat_forever" id="vrh0#gUxWLQ~$A}2}qU.">
-            <statement name="DO">
-              <block type="ai_lcd_clearcanvas" id="4Km|y168rqr{hi[R[xO~">
-                <field name="varitem">canvas</field>
-                <next>
-                  <block type="variables_set" id="V$`f/#r?iu/z2ZtmN/TV">
-                    <field name="VAR">num</field>
-                    <value name="VALUE">
-                      <shadow type="math_number" id="f~2=;11+8.-(ZDikJlTA">
-                        <field name="NUM">0</field>
+      <block type="controls_repeat_forever" id="vrh0#gUxWLQ~$A}2}qU.">
+        <statement name="DO">
+          <block type="ai_lcd_clearcanvas" id="4Km|y168rqr{hi[R[xO~">
+            <next>
+              <block type="variables_set" id="V$`f/#r?iu/z2ZtmN/TV">
+                <field name="VAR">num</field>
+                <value name="VALUE">
+                  <shadow type="math_number" id="f~2=;11+8.-(ZDikJlTA">
+                    <field name="NUM">0</field>
+                  </shadow>
+                  <block type="math_arithmetic" id="k]zl$`{NDgdq+X/;fo`^">
+                    <field name="OP">ADD</field>
+                    <value name="A">
+                      <shadow type="math_number" id="fPg!H39jjKGBFelwGrHW">
+                        <field name="NUM">1</field>
                       </shadow>
-                      <block type="math_arithmetic" id="k]zl$`{NDgdq+X/;fo`^">
-                        <field name="OP">ADD</field>
-                        <value name="A">
-                          <shadow type="math_number" id="fPg!H39jjKGBFelwGrHW">
-                            <field name="NUM">1</field>
+                      <block type="math_division_consult" id="#j#n=yL?IXV#M:6Fp`fd">
+                        <value name="DIVIDEND">
+                          <shadow type="math_number" id="bvBxjy+d,uRl%pt-2mrh">
+                            <field name="NUM">64</field>
                           </shadow>
-                          <block type="math_division_consult" id="#j#n=yL?IXV#M:6Fp`fd">
-                            <value name="DIVIDEND">
-                              <shadow type="math_number" id="bvBxjy+d,uRl%pt-2mrh">
-                                <field name="NUM">64</field>
+                          <block type="text_length" id="|Lx~(28s4Y`8tT(We3~L">
+                            <value name="VALUE">
+                              <shadow type="text" id="5#@{s:%fY]zcBvq=sS7d">
+                                <field name="TEXT"></field>
                               </shadow>
-                              <block type="text_length" id="|Lx~(28s4Y`8tT(We3~L">
-                                <value name="VALUE">
-                                  <shadow type="text" id="5#@{s:%fY]zcBvq=sS7d">
-                                    <field name="TEXT"></field>
-                                  </shadow>
-                                  <block type="variables_get" id="[OyMp|6P9N}(H=/_r|5W">
-                                    <field name="VAR">content</field>
-                                  </block>
-                                </value>
+                              <block type="variables_get" id="[OyMp|6P9N}(H=/_r|5W">
+                                <field name="VAR">content</field>
                               </block>
                             </value>
-                            <value name="DIVISOR">
-                              <shadow type="math_number" id="SCvl{.Q#wpQUcCj^X_^y">
-                                <field name="NUM">23</field>
-                              </shadow>
-                            </value>
                           </block>
                         </value>
-                        <value name="B">
-                          <shadow type="math_number" id="B%%dFe|:78[Kx#=G*A$E">
-                            <field name="NUM">1</field>
+                        <value name="DIVISOR">
+                          <shadow type="math_number" id="SCvl{.Q#wpQUcCj^X_^y">
+                            <field name="NUM">23</field>
                           </shadow>
                         </value>
                       </block>
                     </value>
-                    <next>
-                      <block type="controls_for" id="}UyYerJD=PC/22YG:V`7">
-                        <field name="VAR">i</field>
-                        <value name="FROM">
-                          <shadow type="math_number" id="0oa^ch-Hyz2@L!4FwN+t">
-                            <field name="NUM">1</field>
-                          </shadow>
-                        </value>
-                        <value name="TO">
-                          <shadow type="math_number" id="dm:EaRPFT1fS:~dZ-O=-">
-                            <field name="NUM">10</field>
-                          </shadow>
-                          <block type="variables_get" id="bYWK!6jQ+@cfeUOS}^p~">
-                            <field name="VAR">num</field>
-                          </block>
-                        </value>
-                        <value name="BY">
-                          <shadow type="math_number" id="ytHvxZB_6OV,]|4U=MW.">
-                            <field name="NUM">1</field>
-                          </shadow>
-                        </value>
-                        <statement name="DO">
-                          <block type="ai_lcd_textcarvas" id="=i_32NdV4NyV,M.jm{t/">
-                            <field name="varitem">canvas</field>
-                            <value name="POSA">
-                              <block type="lcd_set_position" id="`zwel/r6RKd|udp[Z;=w">
-                                <value name="POSX">
-                                  <shadow type="math_number" id="^dM}GEP,o7-:,n4=1vp)">
-                                    <field name="NUM">0</field>
+                    <value name="B">
+                      <shadow type="math_number" id="B%%dFe|:78[Kx#=G*A$E">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
+                  </block>
+                </value>
+                <next>
+                  <block type="controls_for" id="}UyYerJD=PC/22YG:V`7">
+                    <field name="VAR">i</field>
+                    <value name="FROM">
+                      <shadow type="math_number" id="0oa^ch-Hyz2@L!4FwN+t">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
+                    <value name="TO">
+                      <shadow type="math_number" id="dm:EaRPFT1fS:~dZ-O=-">
+                        <field name="NUM">10</field>
+                      </shadow>
+                      <block type="variables_get" id="bYWK!6jQ+@cfeUOS}^p~">
+                        <field name="VAR">num</field>
+                      </block>
+                    </value>
+                    <value name="BY">
+                      <shadow type="math_number" id="ytHvxZB_6OV,]|4U=MW.">
+                        <field name="NUM">1</field>
+                      </shadow>
+                    </value>
+                    <statement name="DO">
+                      <block type="ai_lcd_textcarvas" id="=i_32NdV4NyV,M.jm{t/">
+                        <value name="POSA">
+                          <block type="lcd_set_position" id="`zwel/r6RKd|udp[Z;=w">
+                            <value name="POSX">
+                              <shadow type="math_number" id="^dM}GEP,o7-:,n4=1vp)">
+                                <field name="NUM">0</field>
+                              </shadow>
+                            </value>
+                            <value name="POSY">
+                              <shadow type="math_number" id="6pyzLt}Z,g3i-JgL/=QH">
+                                <field name="NUM">30</field>
+                              </shadow>
+                              <block type="math_arithmetic" id="ZO:y(xJe;2Ra)/e]$*xo">
+                                <field name="OP">MULTIPLY</field>
+                                <value name="A">
+                                  <shadow type="math_number" id="oY*(uf$dxg-g[,A{o%}j">
+                                    <field name="NUM">30</field>
                                   </shadow>
                                 </value>
-                                <value name="POSY">
-                                  <shadow type="math_number" id="6pyzLt}Z,g3i-JgL/=QH">
-                                    <field name="NUM">30</field>
+                                <value name="B">
+                                  <shadow type="math_number" id="#t/5NzVw)}o:j@J5pSdv">
+                                    <field name="NUM">1</field>
                                   </shadow>
-                                  <block type="math_arithmetic" id="ZO:y(xJe;2Ra)/e]$*xo">
-                                    <field name="OP">MULTIPLY</field>
+                                  <block type="math_arithmetic" id=".YIhh;-NIS#,DX)NTzQG">
+                                    <field name="OP">MINUS</field>
                                     <value name="A">
-                                      <shadow type="math_number" id="oY*(uf$dxg-g[,A{o%}j">
-                                        <field name="NUM">30</field>
+                                      <shadow type="math_number" id="-IiMVi}2_h?d.?~S@^yU">
+                                        <field name="NUM">1</field>
                                       </shadow>
+                                      <block type="variables_get" id="V*{gYtcE$`^qt+leJ:@{">
+                                        <field name="VAR">i</field>
+                                      </block>
                                     </value>
                                     <value name="B">
-                                      <shadow type="math_number" id="#t/5NzVw)}o:j@J5pSdv">
+                                      <shadow type="math_number" id="sYf;jOcmBH(w2h%`;k^]">
                                         <field name="NUM">1</field>
                                       </shadow>
-                                      <block type="math_arithmetic" id=".YIhh;-NIS#,DX)NTzQG">
-                                        <field name="OP">MINUS</field>
-                                        <value name="A">
-                                          <shadow type="math_number" id="-IiMVi}2_h?d.?~S@^yU">
-                                            <field name="NUM">1</field>
-                                          </shadow>
-                                          <block type="variables_get" id="V*{gYtcE$`^qt+leJ:@{">
-                                            <field name="VAR">i</field>
-                                          </block>
-                                        </value>
-                                        <value name="B">
-                                          <shadow type="math_number" id="sYf;jOcmBH(w2h%`;k^]">
-                                            <field name="NUM">1</field>
-                                          </shadow>
-                                        </value>
-                                      </block>
                                     </value>
                                   </block>
                                 </value>
                               </block>
                             </value>
-                            <value name="CONTENT">
-                              <shadow type="text" id="XNkRTv%[:_-:=i#^3z|j">
-                                <field name="TEXT">识别到人脸</field>
+                          </block>
+                        </value>
+                        <value name="CONTENT">
+                          <shadow type="text" id="XNkRTv%[:_-:=i#^3z|j">
+                            <field name="TEXT">识别到人脸</field>
+                          </shadow>
+                          <block type="text_getSubstring" id="{Gui]Ndg70{MY10x^9ZE">
+                            <mutation at1="true" at2="true"></mutation>
+                            <field name="WHERE1">FROM_START</field>
+                            <field name="WHERE2">FROM_START</field>
+                            <value name="STRING">
+                              <shadow type="text" id="eA`NuMBEg4$[~Vw:FD[.">
+                                <field name="TEXT">abc</field>
                               </shadow>
-                              <block type="text_getSubstring" id="{Gui]Ndg70{MY10x^9ZE">
-                                <mutation at1="true" at2="true"></mutation>
-                                <field name="WHERE1">FROM_START</field>
-                                <field name="WHERE2">FROM_START</field>
-                                <value name="STRING">
-                                  <shadow type="text" id="eA`NuMBEg4$[~Vw:FD[.">
-                                    <field name="TEXT">abc</field>
+                              <block type="variables_get" id="tDx)(C#idXd2{ut%yXDj">
+                                <field name="VAR">content</field>
+                              </block>
+                            </value>
+                            <value name="AT1">
+                              <block type="math_arithmetic" id="ZKi@5z7a6i!jVm8gLHX2">
+                                <field name="OP">MULTIPLY</field>
+                                <value name="A">
+                                  <shadow type="math_number" id="}BD#=29Iasgz~jCwBFB9">
+                                    <field name="NUM">1</field>
                                   </shadow>
-                                  <block type="variables_get" id="tDx)(C#idXd2{ut%yXDj">
-                                    <field name="VAR">content</field>
-                                  </block>
-                                </value>
-                                <value name="AT1">
-                                  <block type="math_arithmetic" id="ZKi@5z7a6i!jVm8gLHX2">
-                                    <field name="OP">MULTIPLY</field>
+                                  <block type="math_arithmetic" id="xv`znWOV1T;=+~QU/9tO">
+                                    <field name="OP">MINUS</field>
                                     <value name="A">
-                                      <shadow type="math_number" id="}BD#=29Iasgz~jCwBFB9">
+                                      <shadow type="math_number" id="-IiMVi}2_h?d.?~S@^yU">
                                         <field name="NUM">1</field>
                                       </shadow>
-                                      <block type="math_arithmetic" id="xv`znWOV1T;=+~QU/9tO">
-                                        <field name="OP">MINUS</field>
-                                        <value name="A">
-                                          <shadow type="math_number" id="-IiMVi}2_h?d.?~S@^yU">
-                                            <field name="NUM">1</field>
-                                          </shadow>
-                                          <block type="variables_get" id="yJ8!Vgd8|(VZP~Y*#:JX">
-                                            <field name="VAR">i</field>
-                                          </block>
-                                        </value>
-                                        <value name="B">
-                                          <shadow type="math_number" id=")2A{WzyeuleNdjpH=#;?">
-                                            <field name="NUM">1</field>
-                                          </shadow>
-                                        </value>
+                                      <block type="variables_get" id="yJ8!Vgd8|(VZP~Y*#:JX">
+                                        <field name="VAR">i</field>
                                       </block>
                                     </value>
                                     <value name="B">
-                                      <shadow type="math_number" id="}3ynFdMdbKkFPJ|KTpo!">
-                                        <field name="NUM">23</field>
+                                      <shadow type="math_number" id=")2A{WzyeuleNdjpH=#;?">
+                                        <field name="NUM">1</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
-                                <value name="AT2">
-                                  <block type="math_arithmetic" id="aG!55/e-k6~Wz|]OaS_a">
-                                    <field name="OP">ADD</field>
+                                <value name="B">
+                                  <shadow type="math_number" id="}3ynFdMdbKkFPJ|KTpo!">
+                                    <field name="NUM">23</field>
+                                  </shadow>
+                                </value>
+                              </block>
+                            </value>
+                            <value name="AT2">
+                              <block type="math_arithmetic" id="aG!55/e-k6~Wz|]OaS_a">
+                                <field name="OP">ADD</field>
+                                <value name="A">
+                                  <shadow type="math_number" id="OY!.oLWK0uv=rZ=VM`po">
+                                    <field name="NUM">1</field>
+                                  </shadow>
+                                  <block type="math_arithmetic" id="`.VIpJyA7|km=j4@y~F4">
+                                    <field name="OP">MULTIPLY</field>
                                     <value name="A">
-                                      <shadow type="math_number" id="OY!.oLWK0uv=rZ=VM`po">
+                                      <shadow type="math_number" id="}BD#=29Iasgz~jCwBFB9">
                                         <field name="NUM">1</field>
                                       </shadow>
-                                      <block type="math_arithmetic" id="`.VIpJyA7|km=j4@y~F4">
-                                        <field name="OP">MULTIPLY</field>
+                                      <block type="math_arithmetic" id="1Bb_%0@R0w/-Aq^;/kkC">
+                                        <field name="OP">MINUS</field>
                                         <value name="A">
-                                          <shadow type="math_number" id="}BD#=29Iasgz~jCwBFB9">
+                                          <shadow type="math_number" id="-IiMVi}2_h?d.?~S@^yU">
                                             <field name="NUM">1</field>
                                           </shadow>
-                                          <block type="math_arithmetic" id="1Bb_%0@R0w/-Aq^;/kkC">
-                                            <field name="OP">MINUS</field>
-                                            <value name="A">
-                                              <shadow type="math_number" id="-IiMVi}2_h?d.?~S@^yU">
-                                                <field name="NUM">1</field>
-                                              </shadow>
-                                              <block type="variables_get" id="aS-3aU(IQyeH.)|RoJ5|">
-                                                <field name="VAR">i</field>
-                                              </block>
-                                            </value>
-                                            <value name="B">
-                                              <shadow type="math_number" id="!m09K`Y}ZY2R@[*RBOL-">
-                                                <field name="NUM">1</field>
-                                              </shadow>
-                                            </value>
+                                          <block type="variables_get" id="aS-3aU(IQyeH.)|RoJ5|">
+                                            <field name="VAR">i</field>
                                           </block>
                                         </value>
                                         <value name="B">
-                                          <shadow type="math_number" id="N%M}c,v-8ZN?,JTJ6D[J">
-                                            <field name="NUM">23</field>
+                                          <shadow type="math_number" id="!m09K`Y}ZY2R@[*RBOL-">
+                                            <field name="NUM">1</field>
                                           </shadow>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
-                                      <shadow type="math_number" id="*ST%V%P;@.9j@g_#2?/v">
-                                        <field name="NUM">22</field>
+                                      <shadow type="math_number" id="N%M}c,v-8ZN?,JTJ6D[J">
+                                        <field name="NUM">23</field>
                                       </shadow>
                                     </value>
                                   </block>
                                 </value>
+                                <value name="B">
+                                  <shadow type="math_number" id="*ST%V%P;@.9j@g_#2?/v">
+                                    <field name="NUM">22</field>
+                                  </shadow>
+                                </value>
                               </block>
                             </value>
-                            <value name="COLOR">
-                              <block type="lcd_set_color" id="oA1F:6!V0+=H4:5,}7wh">
-                                <field name="COLOR">#3366ff</field>
-                              </block>
-                            </value>
-                            <value name="Scale">
-                              <shadow type="math_number" id="NIFn}SbDnj7pilP1W)D%">
-                                <field name="NUM">1</field>
-                              </shadow>
-                            </value>
                           </block>
-                        </statement>
-                        <next>
-                          <block type="ai_lcd_showcarvas_set_display" id="-eJ)0^fT23eQ}?2I]1H4">
-                            <field name="varitem">canvas</field>
+                        </value>
+                        <value name="COLOR">
+                          <block type="lcd_set_color" id="oA1F:6!V0+=H4:5,}7wh">
+                            <field name="COLOR">#3366ff</field>
                           </block>
-                        </next>
+                        </value>
+                        <value name="Scale">
+                          <shadow type="math_number" id="NIFn}SbDnj7pilP1W)D%">
+                            <field name="NUM">1</field>
+                          </shadow>
+                        </value>
                       </block>
+                    </statement>
+                    <next>
+                      <block type="ai_lcd_showcarvas_set_display" id="-eJ)0^fT23eQ}?2I]1H4"></block>
                     </next>
                   </block>
                 </next>
               </block>
-            </statement>
+            </next>
           </block>
-        </next>
+        </statement>
       </block>
     </next>
   </block>

+ 121 - 133
src/python/照相机.xml

@@ -1,162 +1,152 @@
 <xml xmlns="http://www.w3.org/1999/xhtml" type="IoT">
-  <block type="ai_lcd_screeninit" id="yxRBJy4662:i:PifE,)t" x="186" y="-57">
-    <field name="isScreen">False</field>
+  <block type="variables_set" id="]4SdfeJ3Z9BYKz_$.bH0" x="186" y="-31">
+    <field name="VAR">image_num</field>
+    <value name="VALUE">
+      <shadow type="math_number" id="zOUo2bmyQu^~qOD39ee|">
+        <field name="NUM">0</field>
+      </shadow>
+    </value>
     <next>
-      <block type="variables_set" id="]4SdfeJ3Z9BYKz_$.bH0">
-        <field name="VAR">image_num</field>
+      <block type="variables_set" id="N`}aS(!d5+$xk^?BGPsy">
+        <field name="VAR">save_path</field>
         <value name="VALUE">
-          <shadow type="math_number" id="zOUo2bmyQu^~qOD39ee|">
+          <shadow type="math_number" id="q,BOyN58k?3n@x[BG;@8">
             <field name="NUM">0</field>
           </shadow>
+          <block type="text" id="2.o87/BU`ZW1KBgxYm8G">
+            <field name="TEXT"></field>
+          </block>
         </value>
         <next>
-          <block type="variables_set" id="N`}aS(!d5+$xk^?BGPsy">
-            <field name="VAR">save_path</field>
-            <value name="VALUE">
-              <shadow type="math_number" id="q,BOyN58k?3n@x[BG;@8">
-                <field name="NUM">0</field>
-              </shadow>
-              <block type="text" id="2.o87/BU`ZW1KBgxYm8G">
-                <field name="TEXT"></field>
-              </block>
-            </value>
-            <next>
-              <block type="controls_repeat_forever" id="PG.b9?agjAbFGi)W$h8Q">
-                <statement name="DO">
-                  <block type="ai_camera_fit_to_screen_size" id="uA5p1+iy+8F0R#g[t:^K">
-                    <field name="varitem">canvas</field>
-                    <field name="size">320</field>
-                    <next>
-                      <block type="ai_v831_button_read_released" id="jhw4jL7O]$C)2B;909LS">
-                        <field name="button_type">C</field>
-                        <statement name="input">
-                          <block type="variables_set" id="F-nQHybQHfRovo/ve?3E">
-                            <field name="VAR">image_num</field>
+          <block type="controls_repeat_forever" id="PG.b9?agjAbFGi)W$h8Q">
+            <statement name="DO">
+              <block type="ai_camera_snapshot" id="Rzm}mrY_Kp|3*N*(6Nmm">
+                <next>
+                  <block type="ai_v831_button_read_released" id="jhw4jL7O]$C)2B;909LS">
+                    <field name="button_type">C</field>
+                    <statement name="input">
+                      <block type="variables_set" id="F-nQHybQHfRovo/ve?3E">
+                        <field name="VAR">image_num</field>
+                        <value name="VALUE">
+                          <shadow type="math_number" id="Eze2!0H+7:}VZVpnmQ(p">
+                            <field name="NUM">0</field>
+                          </shadow>
+                          <block type="math_arithmetic" id=":*EVI0BXiMndYcD%*h?-">
+                            <field name="OP">ADD</field>
+                            <value name="A">
+                              <shadow type="math_number" id="`MYoc4UG%@qgHl@$(lgU">
+                                <field name="NUM">1</field>
+                              </shadow>
+                              <block type="variables_get" id="OuNm6;$}k^[GqXi)U;26">
+                                <field name="VAR">image_num</field>
+                              </block>
+                            </value>
+                            <value name="B">
+                              <shadow type="math_number" id="2e(F|L/WfY$8^9K6!C%H">
+                                <field name="NUM">1</field>
+                              </shadow>
+                            </value>
+                          </block>
+                        </value>
+                        <next>
+                          <block type="variables_set" id="Z~d/3.N0:PTNfQHB/VUB">
+                            <field name="VAR">save_path</field>
                             <value name="VALUE">
-                              <shadow type="math_number" id="Eze2!0H+7:}VZVpnmQ(p">
+                              <shadow type="math_number" id="q,BOyN58k?3n@x[BG;@8">
                                 <field name="NUM">0</field>
                               </shadow>
-                              <block type="math_arithmetic" id=":*EVI0BXiMndYcD%*h?-">
-                                <field name="OP">ADD</field>
-                                <value name="A">
-                                  <shadow type="math_number" id="`MYoc4UG%@qgHl@$(lgU">
-                                    <field name="NUM">1</field>
-                                  </shadow>
-                                  <block type="variables_get" id="OuNm6;$}k^[GqXi)U;26">
-                                    <field name="VAR">image_num</field>
+                              <block type="text_join" id="0d`ogir##HDjraSoE?n7">
+                                <mutation items="3"></mutation>
+                                <value name="ADD0">
+                                  <block type="text" id="8)ey.2061WXPH[McTD5y">
+                                    <field name="TEXT">/root/user/img/image</field>
                                   </block>
                                 </value>
-                                <value name="B">
-                                  <shadow type="math_number" id="2e(F|L/WfY$8^9K6!C%H">
-                                    <field name="NUM">1</field>
-                                  </shadow>
+                                <value name="ADD1">
+                                  <block type="variables_get" id="TiLN?.*u02;sR3,8.T3y">
+                                    <field name="VAR">save_path</field>
+                                  </block>
+                                </value>
+                                <value name="ADD2">
+                                  <block type="text" id="jzBbGMi=]rtK*CYsHA+}">
+                                    <field name="TEXT">.jpg</field>
+                                  </block>
                                 </value>
                               </block>
                             </value>
                             <next>
-                              <block type="variables_set" id="Z~d/3.N0:PTNfQHB/VUB">
-                                <field name="VAR">save_path</field>
-                                <value name="VALUE">
-                                  <shadow type="math_number" id="q,BOyN58k?3n@x[BG;@8">
-                                    <field name="NUM">0</field>
+                              <block type="v831_img_save" id="^X$YU~p^u;y;iDeRtvR]">
+                                <value name="save_path">
+                                  <shadow type="text" id="1X7GI^Qlthu28/^1I=_9">
+                                    <field name="TEXT">/root/img/saved.jpg</field>
                                   </shadow>
-                                  <block type="text_join" id="0d`ogir##HDjraSoE?n7">
-                                    <mutation items="3"></mutation>
-                                    <value name="ADD0">
-                                      <block type="text" id="8)ey.2061WXPH[McTD5y">
-                                        <field name="TEXT">/root/user/img/image</field>
-                                      </block>
-                                    </value>
-                                    <value name="ADD1">
-                                      <block type="variables_get" id="TiLN?.*u02;sR3,8.T3y">
-                                        <field name="VAR">save_path</field>
-                                      </block>
-                                    </value>
-                                    <value name="ADD2">
-                                      <block type="text" id="jzBbGMi=]rtK*CYsHA+}">
-                                        <field name="TEXT">.jpg</field>
-                                      </block>
-                                    </value>
+                                  <block type="variables_get" id="/K22$HD/ufN$o~:jd_nR">
+                                    <field name="VAR">save_path</field>
                                   </block>
                                 </value>
                                 <next>
-                                  <block type="v831_img_save" id="^X$YU~p^u;y;iDeRtvR]">
-                                    <field name="varitem">canvas</field>
-                                    <value name="save_path">
-                                      <shadow type="text" id="1X7GI^Qlthu28/^1I=_9">
-                                        <field name="TEXT">/root/img/saved.jpg</field>
-                                      </shadow>
-                                      <block type="variables_get" id="/K22$HD/ufN$o~:jd_nR">
-                                        <field name="VAR">save_path</field>
+                                  <block type="ai_lcd_textcarvas" id="#G`m(aK.uu2Om*vDB8;^">
+                                    <value name="POSA">
+                                      <block type="lcd_set_position" id="p3]]wa4pB;lO%TxhT7ok">
+                                        <value name="POSX">
+                                          <shadow type="math_number" id="/w.K5:9)^PEkE!0;:OrJ">
+                                            <field name="NUM">0</field>
+                                          </shadow>
+                                        </value>
+                                        <value name="POSY">
+                                          <shadow type="math_number" id="=dEu5q7PdYXc|.F_HIut">
+                                            <field name="NUM">0</field>
+                                          </shadow>
+                                        </value>
                                       </block>
                                     </value>
-                                    <next>
-                                      <block type="ai_lcd_textcarvas" id="#G`m(aK.uu2Om*vDB8;^">
-                                        <field name="varitem">canvas</field>
-                                        <value name="POSA">
-                                          <block type="lcd_set_position" id="p3]]wa4pB;lO%TxhT7ok">
-                                            <value name="POSX">
-                                              <shadow type="math_number" id="/w.K5:9)^PEkE!0;:OrJ">
-                                                <field name="NUM">0</field>
-                                              </shadow>
-                                            </value>
-                                            <value name="POSY">
-                                              <shadow type="math_number" id="=dEu5q7PdYXc|.F_HIut">
-                                                <field name="NUM">0</field>
-                                              </shadow>
-                                            </value>
+                                    <value name="CONTENT">
+                                      <shadow type="text" id="m#zpGK^;,]1fOm9(,h}|">
+                                        <field name="TEXT"></field>
+                                      </shadow>
+                                      <block type="text_join" id="FK//vhviZO,B*qM#O9sS">
+                                        <mutation items="3"></mutation>
+                                        <value name="ADD0">
+                                          <block type="text" id="7Q@W~fI.71PYNv;8J;9y">
+                                            <field name="TEXT">image</field>
                                           </block>
                                         </value>
-                                        <value name="CONTENT">
-                                          <shadow type="text" id="m#zpGK^;,]1fOm9(,h}|">
-                                            <field name="TEXT"></field>
-                                          </shadow>
-                                          <block type="text_join" id="FK//vhviZO,B*qM#O9sS">
-                                            <mutation items="3"></mutation>
+                                        <value name="ADD1">
+                                          <block type="text_join" id="VBzDKTVk-{DWw%q5V(,[">
+                                            <mutation items="1"></mutation>
                                             <value name="ADD0">
-                                              <block type="text" id="7Q@W~fI.71PYNv;8J;9y">
-                                                <field name="TEXT">image</field>
-                                              </block>
-                                            </value>
-                                            <value name="ADD1">
-                                              <block type="text_join" id="VBzDKTVk-{DWw%q5V(,[">
-                                                <mutation items="1"></mutation>
-                                                <value name="ADD0">
-                                                  <block type="variables_get" id="LIV|Y^^-%PVC/ihalV`7">
-                                                    <field name="VAR">image_num</field>
-                                                  </block>
-                                                </value>
-                                              </block>
-                                            </value>
-                                            <value name="ADD2">
-                                              <block type="text" id="$flNvvqeZ,T;.#zrR99N">
-                                                <field name="TEXT">.jpg</field>
+                                              <block type="variables_get" id="LIV|Y^^-%PVC/ihalV`7">
+                                                <field name="VAR">image_num</field>
                                               </block>
                                             </value>
                                           </block>
                                         </value>
-                                        <value name="COLOR">
-                                          <block type="lcd_set_color" id="46,nWJoZ%UikEO@kc,B2">
-                                            <field name="COLOR">#ff0000</field>
+                                        <value name="ADD2">
+                                          <block type="text" id="$flNvvqeZ,T;.#zrR99N">
+                                            <field name="TEXT">.jpg</field>
                                           </block>
                                         </value>
-                                        <value name="Scale">
-                                          <shadow type="math_number" id="u;P6c13;vIig?XrJ:h@G">
-                                            <field name="NUM">1</field>
-                                          </shadow>
-                                        </value>
+                                      </block>
+                                    </value>
+                                    <value name="COLOR">
+                                      <block type="lcd_set_color" id="46,nWJoZ%UikEO@kc,B2">
+                                        <field name="COLOR">#ff0000</field>
+                                      </block>
+                                    </value>
+                                    <value name="Scale">
+                                      <shadow type="math_number" id="u;P6c13;vIig?XrJ:h@G">
+                                        <field name="NUM">1</field>
+                                      </shadow>
+                                    </value>
+                                    <next>
+                                      <block type="ai_lcd_showcarvas_set_display" id="fsc;j-rB(sH!Krmtxl+*">
                                         <next>
-                                          <block type="ai_lcd_showcarvas_set_display" id="fsc;j-rB(sH!Krmtxl+*">
-                                            <field name="varitem">canvas</field>
-                                            <next>
-                                              <block type="time_delay" id="ND=lCQ+byN#!}Z*ogI[.">
-                                                <value name="DELAY_TIME_MILI">
-                                                  <block type="math_number" id="].]D^Vb$GTGi}~N=P}.t">
-                                                    <field name="NUM">1000</field>
-                                                  </block>
-                                                </value>
+                                          <block type="time_delay" id="ND=lCQ+byN#!}Z*ogI[.">
+                                            <value name="DELAY_TIME_MILI">
+                                              <block type="math_number" id="].]D^Vb$GTGi}~N=P}.t">
+                                                <field name="NUM">1000</field>
                                               </block>
-                                            </next>
+                                            </value>
                                           </block>
                                         </next>
                                       </block>
@@ -166,18 +156,16 @@
                               </block>
                             </next>
                           </block>
-                        </statement>
-                        <next>
-                          <block type="ai_lcd_showcarvas_set_display" id="$0=kg)(QUg.y,^c.~yNF">
-                            <field name="varitem">canvas</field>
-                          </block>
                         </next>
                       </block>
+                    </statement>
+                    <next>
+                      <block type="ai_lcd_showcarvas_set_display" id="$0=kg)(QUg.y,^c.~yNF"></block>
                     </next>
                   </block>
-                </statement>
+                </next>
               </block>
-            </next>
+            </statement>
           </block>
         </next>
       </block>

+ 1 - 2
src/python/讯飞/公式识别.xml

@@ -36,8 +36,7 @@
                 <next>
                   <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
                     <statement name="DO">
-                      <block type="ai_camera_fit_to_screen_size" id="-x|1rNvFHX+n!n;)PcrF">
-                        <field name="size">320</field>
+                      <block type="ai_camera_snapshot" id="Lzxs%4J^8vy{MK+2KvVi">
                         <next>
                           <block type="ai_v831_button_read_released" id="$x~gT)UEvgf1df~{m4l@">
                             <field name="button_type">C</field>

+ 1 - 2
src/python/讯飞/在线人脸检测.xml

@@ -39,8 +39,7 @@
                     <next>
                       <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
                         <statement name="DO">
-                          <block type="ai_camera_fit_to_screen_size" id="-x|1rNvFHX+n!n;)PcrF">
-                            <field name="size">320</field>
+                          <block type="ai_camera_snapshot" id="1UaSg60(q%%*)j4TsuvY">
                             <next>
                               <block type="ai_v831_button_read_released" id="$x~gT)UEvgf1df~{m4l@">
                                 <field name="button_type">C</field>

+ 1 - 2
src/python/讯飞/情绪识别.xml

@@ -36,8 +36,7 @@
                 <next>
                   <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
                     <statement name="DO">
-                      <block type="ai_camera_fit_to_screen_size" id="-x|1rNvFHX+n!n;)PcrF">
-                        <field name="size">320</field>
+                      <block type="ai_camera_snapshot" id="tW~oxwDyN#kOaZRGQ:kf">
                         <next>
                           <block type="ai_v831_button_read_released" id="$x~gT)UEvgf1df~{m4l@">
                             <field name="button_type">C</field>

+ 1 - 2
src/python/讯飞/手势识别.xml

@@ -36,8 +36,7 @@
                 <next>
                   <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
                     <statement name="DO">
-                      <block type="ai_camera_fit_to_screen_size" id="-x|1rNvFHX+n!n;)PcrF">
-                        <field name="size">320</field>
+                      <block type="ai_camera_snapshot" id=".Fdb|C6ZZ72u)2g#pR$:">
                         <next>
                           <block type="ai_v831_button_read_released" id="$x~gT)UEvgf1df~{m4l@">
                             <field name="button_type">C</field>

+ 1 - 2
src/python/讯飞/文字识别.xml

@@ -36,8 +36,7 @@
                 <next>
                   <block type="controls_repeat_forever" id="%^pGg[gavsJ@[AZTJJvC">
                     <statement name="DO">
-                      <block type="ai_camera_fit_to_screen_size" id="-x|1rNvFHX+n!n;)PcrF">
-                        <field name="size">320</field>
+                      <block type="ai_camera_snapshot" id="nYuBR{5*F{X[$b*)pO/}">
                         <next>
                           <block type="ai_v831_button_read_released" id="$x~gT)UEvgf1df~{m4l@">
                             <field name="button_type">C</field>

Някои файлове не бяха показани, защото твърде много файлове са промени