Explorar o código

Merge branch 'master' of https://git.cocorobo.cn/CocoRoboLabs/cocoroboBlockly

jack %!s(int64=3) %!d(string=hai) anos
pai
achega
d704fc5bae

+ 2 - 2
dist/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>cocoroboblockly</title><link href=/static/css/app.74aed2aa85854fc9b3918283d720d026.css rel=stylesheet></head><style>@charset "utf-8";
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>cocoroboblockly</title><link href=/static/css/app.1446af6ca19b799a3723ecfa9bd2af21.css rel=stylesheet></head><style>@charset "utf-8";
 
   div::-webkit-scrollbar {
     /*滚动条整体样式*/
@@ -42,4 +42,4 @@
     height: 100%;
     width: 100%;
     background: #e6eaf0;
-  }</style><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.2c8059a8fa8003b77d15.js></script><script type=text/javascript src=/static/js/app.c599c73b17d2ae75bfd7.js></script></body></html>
+  }</style><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.b2aacab6810394641ae3.js></script><script type=text/javascript src=/static/js/app.03bf1b233a8c76dfac7d.js></script></body></html>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/app.1446af6ca19b799a3723ecfa9bd2af21.css


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/css/app.1446af6ca19b799a3723ecfa9bd2af21.css.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.03bf1b233a8c76dfac7d.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.03bf1b233a8c76dfac7d.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.c599c73b17d2ae75bfd7.js


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/app.c599c73b17d2ae75bfd7.js.map


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/manifest.2ae2e69a05c33dfc65f8.js.map


+ 1 - 1
dist/static/js/vendor.2c8059a8fa8003b77d15.js → dist/static/js/vendor.b2aacab6810394641ae3.js

@@ -9680,4 +9680,4 @@ function(t,e=!1){console.log(t.toString(e))}},"y+7x":function(t,e,n){"use strict
  * limitations under the License.
  * =============================================================================
  */function i(t,e,n,i,s){const a=e.inputParams[t];if(a&&void 0!==a.inputIndexStart){const t=a.inputIndexStart,l=0===a.inputIndexEnd?void 0:void 0===a.inputIndexEnd?t+1:a.inputIndexEnd;if("tensor"===a.type)return o(e.inputNames[a.inputIndexStart],n,i,s);if("tensors"===a.type){return e.inputNames.slice(t,l).map(t=>o(t,n,i,s))}const u=o(e.inputNames.slice(t)[0],n,i,s),c=u.dataSync();return"number"===a.type?c[0]:r._152.toNestedArray(u.shape,c)}const l=e.attrParams[t];return l&&l.value}function o(t,e,n,r){const[i,o]=a(t);if(null!=r){const t=r.getHashTableHandleByName(i);if(null!=t)return t}const l=n.currentContextIds.find(t=>!!e[s(i,t)]);return void 0!==l?e[s(i,l)][o]:void 0}function s(t,e){return e?`${t}-${e}`:t}function a(t){const e=t.split(":");if(1===e.length)return[t,0,void 0];const n=e[0],r=3===e.length?e[1]:void 0;return[n,Number(e[e.length-1]),r]}}});
-//# sourceMappingURL=vendor.2c8059a8fa8003b77d15.js.map
+//# sourceMappingURL=vendor.b2aacab6810394641ae3.js.map

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dist/static/js/vendor.b2aacab6810394641ae3.js.map


+ 96 - 47
src/components/functionFan2.vue

@@ -107,9 +107,8 @@
 </template>
 <style>
 .as {
-  animation: myfirst 1s;
-  -webkit-animation: myfirst 1s; /* Safari and Chrome */
-}
+  animation: myfirst 1s linear infinite;
+  }
 
 .asn {
   transform: rotate(0deg);
@@ -134,8 +133,7 @@
 }
 
 .ass {
-  animation: myfirst 3s;
-  -webkit-animation: myfirst 3s; /* Safari and Chrome */
+  animation: myfirst 3s linear infinite;
 }
 </style>
 <script>
@@ -313,7 +311,8 @@ export default {
             return;
           }
           this.hand = 1;
-          this.zhuan();
+          // this.zhuan();
+          this.$refs.fan.className = "as";
         } else if (_58y < 1 && _912y < 1 && _1316y < 1 && _1720y < 1) {
           console.log("石头");
           if (this.hand == 2) {
@@ -328,7 +327,8 @@ export default {
             return;
           }
           this.hand = 3;
-          this.zhuann();
+          this.$refs.fan.className = "ass";
+          // this.zhuann();
         }
       }
     },
@@ -583,60 +583,109 @@ export default {
         return _code;
       };
 
-      Blockly.Blocks["iot_lcd_trunLeftinit"] = {
+      Blockly.Blocks["logic_loop"] = {
         init: function () {
-          this.appendDummyInput().appendField("向左移动");
-          this.setInputsInline(false);
-          this.setPreviousStatement(true);
-          this.setNextStatement(true);
-          this.setColour("#1b5873");
+          this.appendStatementInput("NAME")
+            .setCheck(null)
+            .appendField("重复执行");
+          this.setPreviousStatement(true, null);
+          this.setNextStatement(true, null);
+          this.setColour("#5b80a5");
           this.setTooltip("");
           this.setHelpUrl("");
         },
       };
+      Blockly.JavaScript["logic_loop"] = function (block) {
+        var statements_name = Blockly.JavaScript.statementToCode(block, "NAME");
+        // TODO: Assemble JavaScript into code variable.
+        var code = "for;\n";
+        return code;
+      };
 
-      Blockly.JavaScript.iot_lcd_trunLeftinit = function (block) {
-        var _code = "trunLeft=1;";
-        return _code;
+      Blockly.Blocks.controls_repeat_forever = {
+        init: function () {
+          this.jsonInit({
+            message0: Blockly.Msg.CONTROLS_REPEAT_FOREVER,
+            previousStatement: null,
+            nextStatement: null,
+            colour: "#5ba55b",
+            tooltip: Blockly.Msg.CONTROLS_REPEAT_FOREVER_TOOLTIP,
+            helpUrl: Blockly.Msg.CONTROLS_REPEAT_HELPURL,
+          });
+          this.appendStatementInput("DO").appendField(
+            Blockly.Msg.CONTROLS_REPEAT_INPUT_DO
+          );
+        },
       };
 
-      Blockly.Blocks["iot_lcd_trunRightinit"] = {
+      Blockly.JavaScript.controls_repeat_forever = function (a) {
+        var d = Blockly.JavaScript.statementToCode(a, "DO");
+        d = Blockly.JavaScript.addLoopTrap(d, a);
+        return "while (true) {\n" + d + "}\n";
+      };
+
+      Blockly.Blocks["logic_number"] = {
         init: function () {
-          this.appendDummyInput().appendField("向右移动");
-          this.setInputsInline(false);
-          this.setPreviousStatement(true);
-          this.setNextStatement(true);
-          this.setColour("#1b5873");
+          this.appendDummyInput().appendField(
+            new Blockly.FieldTextInput("0"),
+            "number"
+          );
+          this.setInputsInline(true);
+          this.setOutput(true, "Number");
+          this.setColour("#5b80a5");
           this.setTooltip("");
           this.setHelpUrl("");
         },
       };
-
-      Blockly.JavaScript.iot_lcd_trunRightinit = function (block) {
-        var _code = "trunRight=1;";
-        return _code;
+      Blockly.JavaScript["logic_number"] = function (block) {
+        var text_number = block.getFieldValue("number");
+        // TODO: Assemble JavaScript into code variable.
+        var code = text_number;
+        // TODO: Change ORDER_NONE to the correct strength.
+        return [code, Blockly.JavaScript.ORDER_NONE];
+      };
+      Blockly.Blocks["ai_gesture"] = {
+        init: function () {
+          this.appendDummyInput()
+            .appendField("AI手势识别")
+            .appendField(new Blockly.FieldDropdown([["ID", "ID"]]), "ID");
+          this.setInputsInline(true);
+          this.setOutput(true, null);
+          this.setColour(285);
+          this.setTooltip("");
+          this.setHelpUrl("");
+        },
+      };
+      Blockly.JavaScript["ai_gesture"] = function (block) {
+        var dropdown_id = block.getFieldValue("ID");
+        // TODO: Assemble JavaScript into code variable.
+        var code = "hands";
+        // TODO: Change ORDER_NONE to the correct strength.
+        return [code, Blockly.JavaScript.ORDER_NONE];
+      };
+      Blockly.Blocks["ai_motor"] = {
+        init: function () {
+          this.appendDummyInput()
+            .appendField("马达")
+            .appendField(new Blockly.FieldDropdown([["M1", "M1"]]), "motor")
+            .appendField("以速度")
+            .appendField(new Blockly.FieldTextInput("0"), "speed")
+            .appendField("转动");
+          this.setPreviousStatement(true, null);
+          this.setNextStatement(true, null);
+          this.setColour(285);
+          this.setTooltip("");
+          this.setHelpUrl("");
+        },
+      };
+      Blockly.JavaScript["ai_motor"] = function (block) {
+        var dropdown_motor = block.getFieldValue("motor");
+        var text_speed = block.getFieldValue("speed");
+        // TODO: Assemble JavaScript into code variable.
+        var code = "motor=" + text_speed;
+        // TODO: Change ORDER_NONE to the correct strength.
+        return code;
       };
-      var that = this;
-      window.addEventListener("message", function (e) {
-        // 监听 message 事件
-        if (e.data.success) {
-          that.loading = true;
-          that.$refs.unityvue.contentWindow.postMessage(
-            { type: that.type },
-            "*"
-          );
-        }
-
-        if (e.data.active) {
-          that.active = true;
-        } else if (e.data.active != undefined) {
-          that.active = false;
-        }
-
-        if (e.data.noCamera) {
-          that.$message.error(e.data.noCamera);
-        }
-      });
     },
   },
   mounted() {

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio