diff --git a/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/syntax/sensor/generic/GetLineSensor.java b/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/syntax/sensor/generic/GetLineSensor.java index 2020652d65..13cc4b3dd6 100644 --- a/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/syntax/sensor/generic/GetLineSensor.java +++ b/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/syntax/sensor/generic/GetLineSensor.java @@ -6,7 +6,7 @@ import de.fhg.iais.roberta.util.ast.BlocklyProperties; import de.fhg.iais.roberta.util.ast.ExternalSensorBean; -@NepoExpr(sampleValues = {@F2M(field = "LINE", mode = "LINE"), @F2M(field = "QUADRGB_LINE", mode = "LINE")}, name = "LINE_SENSING", category = "SENSOR", blocklyNames = {"robSensors_line_getSample"}) +@NepoExpr(sampleValues = {@F2M(field = "LINE", mode = "LINE"), @F2M(field = "QUADRGB_LINE", mode = "LINE"), @F2M(field = "QUADRGB_LINE_STATE", mode = "LINE_STATE")}, name = "LINE_SENSING", category = "SENSOR", blocklyNames = {"robSensors_line_getSample"}) public final class GetLineSensor extends ExternalSensor { diff --git a/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/ast/AstFactory.java b/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/ast/AstFactory.java index 97a238a241..a22005d9a0 100644 --- a/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/ast/AstFactory.java +++ b/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/ast/AstFactory.java @@ -55,7 +55,7 @@ public class AstFactory { private static final String[] allLegalModesArray = { "ALTITUDE", "AMBIENTLIGHT", "ANALOG", "ANGLE", "BACKWARD", "BALL", "CALIBRATE", "CALIBRATION", "CLOSING", "CO2EQUIVALENT", "COLOUR", "COMPASS", "DATE", "DEFAULT", "DEGREE", "DIGITAL", "DISTANCE", "DOWN", "EDISON_CODE", "FACE_DOWN", "FACE_UP", "FOREWARD", "FREEFALL", - "G3", "G6", "G8", "HUMIDITY", "IAQ", "IDALL", "IDONE", "LATITUDE", "LEFT", "LIGHT", "LIGHT_VALUE", "LINE", "LONGITUDE", "MODULATED", "MOTION", + "G3", "G6", "G8", "HUMIDITY", "IAQ", "IDALL", "IDONE", "LATITUDE", "LEFT", "LIGHT", "LIGHT_VALUE", "LINE", "LINE_STATE", "LONGITUDE", "MODULATED", "MOTION", "NAMEALL", "NAMEONE", "NONE", "OBSTACLE", "OFF", "OPENING", "NUMBERLINES", "PM10", "PM25", "PRESENCE", "PRESSED", "PRESSURE", "PULSEHIGH", "PULSELOW", "RATE", "RCCODE", "RED", "REFLEXION", "RESET", "RGB", "RIGHT", "ROTATION", "SEEK", "SERIAL", "SHAKE", "SOUND", "SPEED", "START", "STOP", "STRENGTH", "TEMPERATURE", "TILTED", "TIME", "UNMODULATED", "UP", "UVLIGHT", "VALUE", "VOCEQUIVALENT", "WAIT_FOR_PRESS", "WAIT_FOR_PRESS_AND_RELEASE", "X", "Y", "Z", "REDCHANNEL", diff --git a/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/syntax/SC.java b/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/syntax/SC.java index 8be72e1a37..9ad472393e 100644 --- a/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/syntax/SC.java +++ b/OpenRobertaRobot/src/main/java/de/fhg/iais/roberta/util/syntax/SC.java @@ -143,4 +143,7 @@ public interface SC { String WAIT = "WAIT"; String PORT = "PORT"; String SPEAKER = "SPEAKER"; + + String LINE = "LINE"; + String LINE_STATE = "LINE_STATE"; } diff --git a/OpenRobertaServer/staticResources/blockly/blockly_compressed.js b/OpenRobertaServer/staticResources/blockly/blockly_compressed.js index 0fb38e23b4..9e0be6e6ce 100644 --- a/OpenRobertaServer/staticResources/blockly/blockly_compressed.js +++ b/OpenRobertaServer/staticResources/blockly/blockly_compressed.js @@ -6,69 +6,43 @@ Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */ -var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b=e}},"es6","es3"); -$jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=$jscomp.checkStringArgs(this,b,"startsWith");b+="";var e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g=f}},"es6","es3"); -$jscomp.polyfill("String.prototype.repeat",function(a){return a?a:function(b){var c=$jscomp.checkStringArgs(this,null,"repeat");if(0>b||1342177279>>=1)c+=c;return d}},"es6","es3");$jscomp.polyfill("String.prototype.trimLeft",function(a){function b(){return this.replace(/^[\s\xa0]+/,"")}return a||b},"es_2019","es3"); -$jscomp.polyfill("Object.is",function(a){return a?a:function(b,c){return b===c?0!==b||1/b===1/c:b!==b&&c!==c}},"es6","es3");$jscomp.polyfill("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c>>0);goog.uidCounter_=0;goog.cloneObject=function(a){var b=goog.typeOf(a);if("object"==b||"array"==b){if("function"===typeof a.clone)return a.clone();b="array"==b?[]:{};for(var c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)}; -goog.bindJs_=function(a,b,c){if(!a)throw Error();if(2>>0);goog.uidCounter_=0;goog.cloneObject=function(a){var b=goog.typeOf(a);if(b=="object"||b=="array"){if(typeof a.clone==="function")return a.clone();b=b=="array"?[]:{};for(var c in a)b[c]=goog.cloneObject(a[c]);return b}return a};goog.bindNative_=function(a,b,c){return a.call.apply(a.bind,arguments)}; +goog.bindJs_=function(a,b,c){if(!a)throw Error();if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}};goog.bind=function(a,b,c){Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?goog.bind=goog.bindNative_:goog.bind=goog.bindJs_;return goog.bind.apply(null,arguments)}; goog.partial=function(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}};goog.mixin=function(a,b){for(var c in b)a[c]=b[c]};goog.now=Date.now;goog.globalEval=function(a){(0,eval)(a)}; -goog.getCssName=function(a,b){if("."==String(a).charAt(0))throw Error('className passed in goog.getCssName must not start with ".". You passed: '+a);var c=function(e){return goog.cssNameMapping_[e]||e},d=function(e){e=e.split("-");for(var f=[],g=0;g=0;--b){var c=a[b].src,d=c.lastIndexOf("?");d=d==-1?c.length:d;if(c.substr(d-7,7)=="base.js"){goog.basePath=c.substr(0,d-7);break}}}},goog.findBasePath_(),goog.Transpiler=function(){this.requiresTranspilation_=null;this.transpilationTarget_=goog.TRANSPILE_TO_LANGUAGE},goog.Transpiler.prototype.createRequiresTranspilation_=function(){function a(g,h){e?d[g]=!0:h()?(c=g,d[g]=!1):e=d[g]=!0}function b(g){try{return!!eval(g)}catch(h){return!1}} var c="es3",d={es3:!1},e=!1,f=goog.global.navigator&&goog.global.navigator.userAgent?goog.global.navigator.userAgent:"";a("es5",function(){return b("[1,].length==1")});a("es6",function(){return f.match(/Edge\/(\d+)(\.\d)*/i)?!1:b('(()=>{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')}); -a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async () => 1, true")});a("es9",function(){return b("({...rest} = {}), true")});a("es_next",function(){return!1});return{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(a,b){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var c=this.createRequiresTranspilation_();this.requiresTranspilation_=c.map;this.transpilationTarget_=this.transpilationTarget_|| -c.target}if(a in this.requiresTranspilation_)return this.requiresTranspilation_[a]?!0:!goog.inHtmlDocument_()||"es6"!=b||"noModule"in goog.global.document.createElement("script")?!1:!0;throw Error("Unknown language mode: "+a);},goog.Transpiler.prototype.transpile=function(a,b){return goog.transpile_(a,b,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={}; +a("es7",function(){return b("2 ** 2 == 4")});a("es8",function(){return b("async () => 1, true")});a("es9",function(){return b("({...rest} = {}), true")});a("es_next",function(){return!1});return{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(a,b){if(goog.TRANSPILE=="always")return!0;if(goog.TRANSPILE=="never")return!1;if(!this.requiresTranspilation_){var c=this.createRequiresTranspilation_();this.requiresTranspilation_=c.map;this.transpilationTarget_=this.transpilationTarget_|| +c.target}if(a in this.requiresTranspilation_)return this.requiresTranspilation_[a]?!0:!goog.inHtmlDocument_()||b!="es6"||"noModule"in goog.global.document.createElement("script")?!1:!0;throw Error("Unknown language mode: "+a);},goog.Transpiler.prototype.transpile=function(a,b){return goog.transpile_(a,b,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(a){return a.replace(/<\/(SCRIPT)/ig,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={}; this.idToPath_={};this.written_={};this.loadingDeps_=[];this.depsToLoad_=[];this.paused_=!1;this.factory_=new goog.DependencyFactory(goog.transpiler_);this.deferredCallbacks_={};this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(a,b){function c(){d&&(goog.global.setTimeout(d,0),d=null)}var d=b;if(a.length){b=[];for(var e=0;e=0&&(a=a.substring(b+3),b= +a.indexOf("/"),b>=0&&(a=a.substring(b+1)));return a},goog.Dependency.prototype.onLoad=function(a){this.loaded_?a():this.loadCallbacks_.push(a)},goog.Dependency.prototype.loaded=function(){this.loaded_=!0;var a=this.loadCallbacks_;this.loadCallbacks_=[];for(var b=0;b\x3c/script>";b.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(d):d)}else{var e=b.createElement("script");e.defer=goog.Dependency.defer_;e.async=!1;e.type="text/javascript";(d=goog.getScriptNonce())&&e.setAttribute("nonce",d);goog.DebugLoader_.IS_OLD_IE_? -(a.pause(),e.onreadystatechange=function(){if("loaded"==e.readyState||"complete"==e.readyState)a.loaded(),a.resume()}):e.onload=function(){e.onload=null;a.loaded()};e.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path;b.head.appendChild(e)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."), -a.loaded()):a.pause()},goog.Es6ModuleDependency=function(a,b,c,d,e){goog.Dependency.call(this,a,b,c,d,e)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(a){function b(l,m){l=m?'