@paul53 sagte in mein erstes Blockly... korrekt? :
@Homoran sagte:
mit dem WERT für den Timeout verwechselt hatte. Aber den kann man dann auch nicht auf diese Art abfragen.
Das ist eine Konstante, die man nicht abfragen kann, außer man verwendet eine selbst erstellte Variable, deren Namen man im Timer eingeben kann, was allerdings nur bei Auswahl von "ms" funktioniert.
Nicht ganz so kann man feststellen, wann ein Timer triggern wird und damit auch alle anderen Zeiten. Startzeit ist, wann der Trigger gesetzt wurde, Ausführzeit wann er feuert.
Start- und Ausführzeit eines Timeout
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable type="timeout" id="timeout">timeout</variable>
<variable id="8qng8]/g6/DX%2f:8oG%">Refzeit</variable>
<variable type="timeout" id="timeout2">timeout2</variable>
<variable type="timeout" id="timeout3">timeout3</variable>
<variable id="y`kTh$dVrIpYC9ZqBb37">Startzeit</variable>
<variable id="[J?LK+klK~P!$a9J{s86">Ausfuehrzeit</variable>
</variables>
<block type="schedule" id="rwCoU3(up]bKF$@yP)3$" x="-88" y="-338">
<field name="SCHEDULE">46 19 * * *</field>
<statement name="STATEMENT">
<block type="comment" id="?IyrQ(*c/K[$;5F[^1tB">
<field name="COMMENT">ermittelt die Ref-zeit = Start der JS-Instanz</field>
<next>
<block type="timeouts_settimeout" id="%QB[ly.)pT*.LS?%?2@j">
<field name="NAME">timeout</field>
<field name="DELAY">0</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT">
<block type="variables_set" id="$;d!EQM%M]Fhjou;7CD5">
<field name="VAR" id="8qng8]/g6/DX%2f:8oG%">Refzeit</field>
<value name="VALUE">
<block type="convert_from_date" id="@j-H^`uPcXKiZs9cpveK">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">object</field>
<value name="VALUE">
<block type="math_arithmetic" id="EQu%gX)9i-]K7x,1(}h5" inline="false">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id="8{rl~7y:ue^S@?~wEh};">
<field name="NUM">1</field>
</shadow>
<block type="time_get" id="Wy4kV2(tS#)jti^6/R_l">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">object</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="cPn#Of}iDB3_/=0[~=3|">
<field name="NUM">1</field>
</shadow>
<block type="get_attr" id="4$nwl]3?3Qp;rWT(Rb;+">
<value name="PATH">
<shadow type="text" id="4BNH[wc1k*/Vw#Cg1ajP">
<field name="TEXT">_idleStart</field>
</shadow>
</value>
<value name="OBJECT">
<block type="variables_get" id="uG/5)zi)J:WjZE@j5=Na">
<field name="VAR" id="timeout" variabletype="timeout">timeout</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</statement>
<next>
<block type="comment" id="3e5`hi2,`@qPF_Z4QIPJ">
<field name="COMMENT">zu ermittelnde Startzeit</field>
<next>
<block type="timeouts_settimeout" id="pOG2+Q?t%4Fh@%Rn%z8_">
<field name="NAME">timeout2</field>
<field name="DELAY">480</field>
<field name="UNIT">min</field>
<statement name="STATEMENT">
<block type="debug" id="=h9u|YYvq)K!C-{=31~L">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="dv9!q`I#*GdN+n4sklNF">
<field name="TEXT">test</field>
</shadow>
</value>
</block>
</statement>
<next>
<block type="comment" id="*Ugt@fMeeN{wFEL)I+1.">
<field name="COMMENT">irgendwann im Programmablauf</field>
<next>
<block type="timeouts_settimeout" id="]+)B_?RaDVM;lWbsoWsO">
<field name="NAME">timeout3</field>
<field name="DELAY">100</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT">
<block type="variables_set" id="}vMVhT)SDXih:e3|;*j4">
<field name="VAR" id="y`kTh$dVrIpYC9ZqBb37">Startzeit</field>
<value name="VALUE">
<block type="convert_from_date" id="|SGH|hdsIgy}o5|nJ~yh">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">object</field>
<value name="VALUE">
<block type="math_arithmetic" id="yrvA=(AzfU3ImovfV#F-">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id="oW]NH*D~H0O/oVMzX:=w">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id="hN^qtBQOXml$a[vQ=$:q">
<field name="VAR" id="8qng8]/g6/DX%2f:8oG%">Refzeit</field>
</block>
</value>
<value name="B">
<shadow type="math_number" id="Wit9Ue4ZZ;]-Y3]EC^%z">
<field name="NUM">1</field>
</shadow>
<block type="get_attr" id="22hz9S98GbMZFock[2u[">
<value name="PATH">
<shadow type="text" id="r;:rdF.@88a++T8#ejC6">
<field name="TEXT">_idleStart</field>
</shadow>
</value>
<value name="OBJECT">
<block type="variables_get" id="08%E-!?ofQjb++N}c;k.">
<field name="VAR" id="timeout2" variabletype="timeout">timeout2</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="7dWFe,Q|]8i)@Huq[t2D">
<field name="VAR" id="[J?LK+klK~P!$a9J{s86">Ausfuehrzeit</field>
<value name="VALUE">
<block type="convert_from_date" id="n811.kKHk)OjOlU7NmV]">
<mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
<field name="OPTION">hh:mm:ss</field>
<value name="VALUE">
<block type="math_arithmetic" id="KA,G(tOh@Fiuj3`@ro~4">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="variables_get" id=",L`@1V)l*M}R#*D3Hq,V">
<field name="VAR" id="y`kTh$dVrIpYC9ZqBb37">Startzeit</field>
</block>
</value>
<value name="B">
<shadow type="math_number">
<field name="NUM">1</field>
</shadow>
<block type="get_attr" id="UykwG9#/!~kc#c*mBV1r">
<value name="PATH">
<shadow type="text" id="`2V`|^7VqTdxeY[FuSb_">
<field name="TEXT">_idleTimeout</field>
</shadow>
</value>
<value name="OBJECT">
<block type="variables_get" id="M8Y0m!qFD?AK{#|wC4{/">
<field name="VAR" id="timeout2" variabletype="timeout">timeout2</field>
</block>
</value>
</block>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="debug" id="QwlXbZ)4z%Fw?5E3E@8=" inline="true">
<field name="Severity">log</field>
<value name="TEXT">
<shadow type="text" id="Y$B`@:2G|gWF[rtKTA,i">
<field name="TEXT">test</field>
</shadow>
<block type="variables_get" id="jAsxX^%4^v@,KzcT=IEc">
<field name="VAR" id="[J?LK+klK~P!$a9J{s86">Ausfuehrzeit</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>